{"version":3,"sources":["webpack://blueprint-webpack-boilerplate/webpack/runtime/create fake namespace object","webpack://blueprint-webpack-boilerplate/webpack/runtime/load script","webpack://blueprint-webpack-boilerplate/./node_modules/@babel/runtime/helpers/extends.js","webpack://blueprint-webpack-boilerplate/./node_modules/@videojs/xhr/lib/http-handler.js","webpack://blueprint-webpack-boilerplate/./node_modules/@videojs/xhr/lib/index.js","webpack://blueprint-webpack-boilerplate/./node_modules/@xmldom/xmldom/lib/conventions.js","webpack://blueprint-webpack-boilerplate/./node_modules/@xmldom/xmldom/lib/dom-parser.js","webpack://blueprint-webpack-boilerplate/./node_modules/@xmldom/xmldom/lib/dom.js","webpack://blueprint-webpack-boilerplate/./node_modules/@xmldom/xmldom/lib/entities.js","webpack://blueprint-webpack-boilerplate/./node_modules/@xmldom/xmldom/lib/index.js","webpack://blueprint-webpack-boilerplate/./node_modules/@xmldom/xmldom/lib/sax.js","webpack://blueprint-webpack-boilerplate/./src/js/components/cookie.js","webpack://blueprint-webpack-boilerplate/./node_modules/global/document.js","webpack://blueprint-webpack-boilerplate/./node_modules/global/window.js","webpack://blueprint-webpack-boilerplate/./node_modules/is-function/index.js","webpack://blueprint-webpack-boilerplate/./node_modules/jquery/dist/jquery.js","webpack://blueprint-webpack-boilerplate/./node_modules/keycode/index.js","webpack://blueprint-webpack-boilerplate/./node_modules/mux.js/lib/tools/parse-sidx.js","webpack://blueprint-webpack-boilerplate/./node_modules/mux.js/lib/utils/clock.js","webpack://blueprint-webpack-boilerplate/./node_modules/mux.js/lib/utils/numbers.js","webpack://blueprint-webpack-boilerplate/./node_modules/polylabel/polylabel.js","webpack://blueprint-webpack-boilerplate/./node_modules/tinyqueue/index.js","webpack://blueprint-webpack-boilerplate/./node_modules/url-toolkit/src/url-toolkit.js","webpack://blueprint-webpack-boilerplate/./node_modules/video.js/node_modules/safe-json-parse/tuple.js","webpack://blueprint-webpack-boilerplate/./node_modules/videojs-vtt.js/lib/browser-index.js","webpack://blueprint-webpack-boilerplate/./node_modules/videojs-vtt.js/lib/vtt.js","webpack://blueprint-webpack-boilerplate/./node_modules/videojs-vtt.js/lib/vttcue.js","webpack://blueprint-webpack-boilerplate/./node_modules/videojs-vtt.js/lib/vttregion.js","webpack://blueprint-webpack-boilerplate/webpack/bootstrap","webpack://blueprint-webpack-boilerplate/webpack/runtime/amd options","webpack://blueprint-webpack-boilerplate/webpack/runtime/compat get default export","webpack://blueprint-webpack-boilerplate/webpack/runtime/define property getters","webpack://blueprint-webpack-boilerplate/webpack/runtime/ensure chunk","webpack://blueprint-webpack-boilerplate/webpack/runtime/get javascript chunk filename","webpack://blueprint-webpack-boilerplate/webpack/runtime/get mini-css chunk filename","webpack://blueprint-webpack-boilerplate/webpack/runtime/global","webpack://blueprint-webpack-boilerplate/webpack/runtime/harmony module decorator","webpack://blueprint-webpack-boilerplate/webpack/runtime/hasOwnProperty shorthand","webpack://blueprint-webpack-boilerplate/webpack/runtime/make namespace object","webpack://blueprint-webpack-boilerplate/webpack/runtime/publicPath","webpack://blueprint-webpack-boilerplate/webpack/runtime/jsonp chunk loading","webpack://blueprint-webpack-boilerplate/./src/js/modules/applyForm.js","webpack://blueprint-webpack-boilerplate/./src/js/layouts/header.js","webpack://blueprint-webpack-boilerplate/./src/js/layouts/menu.js","webpack://blueprint-webpack-boilerplate/./node_modules/ssr-window/ssr-window.esm.js","webpack://blueprint-webpack-boilerplate/./node_modules/dom7/dom7.esm.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/utils/dom.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/utils/get-support.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/utils/get-device.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/utils/get-browser.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/utils/utils.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/modules/resize/resize.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/modules/observer/observer.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/events/onTouchStart.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/events/onTouchMove.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/events/onTouchEnd.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/events/onResize.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/events/onClick.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/events/onScroll.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/events/index.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/check-overflow/index.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/defaults.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/core-class.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/modular.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/events-emitter.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/update/index.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/update/updateSize.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/update/updateSlides.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/update/updateAutoHeight.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/update/updateSlidesOffset.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/update/updateSlidesProgress.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/update/updateProgress.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/update/updateSlidesClasses.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/update/updateActiveIndex.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/update/updateClickedSlide.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/translate/index.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/translate/getTranslate.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/translate/setTranslate.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/translate/minTranslate.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/translate/maxTranslate.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/translate/translateTo.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/transition/index.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/transition/setTransition.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/transition/transitionStart.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/transition/transitionEnd.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/slide/index.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/slide/slideTo.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/slide/slideToLoop.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/slide/slideNext.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/slide/slidePrev.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/slide/slideReset.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/slide/slideToClosest.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/slide/slideToClickedSlide.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/loop/index.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/loop/loopCreate.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/loop/loopFix.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/loop/loopDestroy.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/grab-cursor/index.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/grab-cursor/setGrabCursor.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/grab-cursor/unsetGrabCursor.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/manipulation/index.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/manipulation/appendSlide.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/manipulation/prependSlide.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/manipulation/addSlide.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/manipulation/removeSlide.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/manipulation/removeAllSlides.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/breakpoints/index.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/breakpoints/setBreakpoint.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/breakpoints/getBreakpoint.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/classes/index.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/classes/addClasses.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/classes/removeClasses.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/images/index.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/images/loadImage.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/core/images/preloadImages.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/navigation/navigation.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/pagination/pagination.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/autoplay/autoplay.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/effect-fade/effect-fade.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/controller/controller.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/thumbs/thumbs.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/keyboard/keyboard.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/mousewheel/mousewheel.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/node_modules/tslib/tslib.es6.mjs","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/Percent.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/Type.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/Math.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/Array.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/Disposer.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/AsyncPending.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/EventDispatcher.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/Object.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/String.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/Dictionary.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/Cache.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/Registry.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/List.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/SortedList.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/Number.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/Order.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/Adapter.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/Colors.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/Color.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/Base.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/Strings.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/Utils.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/Browser.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/Ease.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/SpriteState.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/SpriteEvents.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/defs/SVGDefaults.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/Options.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/Animation.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/DOM.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/rendering/AMElement.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/rendering/Group.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/InterfaceColorSet.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/PopupCSS.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/interaction/InteractionObjectEvents.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/interaction/InteractionObject.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/interaction/InteractionKeyboardObject.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/interaction/Inertia.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/Keyboard.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/Time.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/interaction/Interaction.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/Popup.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/Modal.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/Log.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/ResizeSensor.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/rendering/SVGContainer.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/rendering/Paper.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/Pattern.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/LinearGradient.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/RadialGradient.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/interaction/Mouse.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/formatters/TextFormatter.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/lang/en.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/Language.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/formatters/NumberFormatter.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/formatters/DateFormatter.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/formatters/DurationFormatter.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/export/ExportCSS.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/export/Export.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/Validatable.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/export/ExportMenu.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/Net.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/Sprite.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/Rectangle.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/Container.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/System.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/data/DataParser.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/data/CSVParser.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/data/JSONParser.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/data/DataLoader.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/data/DataSource.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/Responsive.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/DataItem.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/Component.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/Label.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/RoundedRectangle.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/Button.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/Circle.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/Ellipse.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/Image.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/Line.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/PointedShape.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/PointedRectangle.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/rendering/Path.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/Polyline.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/Polyarc.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/Morpher.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/Polygon.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/Polyspline.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/Slice.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/Preloader.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/ResizeButton.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/CloseButton.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/SwitchButton.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/Scrollbar.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/Slider.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/TextLink.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/rendering/filters/Filter.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/rendering/filters/DropShadowFilter.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/Tooltip.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/Trapezoid.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/Triangle.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/rendering/Smoothing.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/WavedCircle.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/WavedLine.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/WavedRectangle.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/ZoomOutButton.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/PlayButton.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/ColorModifier.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/GradientModifier.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/LinearGradientModifier.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/3d/Cone.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/rendering/filters/LightenFilter.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/3d/Rectangle3D.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/3d/Slice3D.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/RadialGradientModifier.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/LinePattern.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/CirclePattern.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/RectPattern.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/rendering/filters/ColorizeFilter.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/rendering/filters/DesaturateFilter.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/rendering/filters/BlurFilter.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/rendering/filters/FocusFilter.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/ColorSet.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/PatternSet.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/utils/Plugin.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/AmChartsLogo.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/Legend.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/axes/AxisBreak.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/axes/Axis.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/axes/AxisLine.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/axes/AxisFill.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/axes/Grid.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/axes/AxisLabel.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/elements/Tick.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/axes/AxisTick.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/axes/AxisRenderer.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/axes/AxisBullet.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/axes/AxisRendererY.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/axes/ValueAxisBreak.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/axes/ValueAxis.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/axes/AxisRendererX.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/elements/HeatLegend.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/core/elements/Grip.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/Chart.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/elements/Bullet.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/series/Series.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/types/SerialChart.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-array/src/fsum.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/math.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/noop.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/stream.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/area.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/bounds.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/cartesian.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/MapSeries.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/MapObject.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/MapImage.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/MapUtils.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/MapPolygon.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/MapPolygonSeries.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/clip/buffer.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/pointEqual.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/clip/rejoin.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/polygonContains.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-array/src/merge.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/clip/index.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/clip/antimeridian.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/circle.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/clip/circle.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/clip/rectangle.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/clip/line.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/compose.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/identity.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/rotation.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/transform.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/path/bounds.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/projection/fit.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/projection/resample.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/projection/index.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/projection/equirectangular.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/path/area.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/path/centroid.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/path/context.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/path/measure.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/path/string.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/length.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/distance.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/projections/Projection.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/path/index.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/interpolate.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/SmallMap.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/Geo.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/MapLineObject.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/MapImageSeries.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/MapLine.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/MapLineSeries.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/Graticule.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-array/src/range.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/graticule.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/GraticuleSeries.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/types/MapChart.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/MapSpline.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/MapArc.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/MapSplineSeries.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/MapArcSeries.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/ZoomControl.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/projection/mercator.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/projections/Mercator.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo-projection/src/math.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo-projection/src/miller.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/projections/Miller.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo-projection/src/eckert6.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/projections/Eckert6.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/projection/azimuthal.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/projection/orthographic.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/projections/Orthographic.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/projection/stereographic.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/projections/Stereographic.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/projection/conicEqualArea.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/projection/cylindricalEqualArea.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/projection/conic.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/projection/albers.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/projections/Albers.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/projections/AlbersUSA.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/projection/albersUsa.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/projection/naturalEarth1.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/projections/NaturalEarth1.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/projection/azimuthalEqualArea.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/projections/AzimuthalEqualArea.js","webpack://blueprint-webpack-boilerplate/./node_modules/d3-geo/src/projection/equalEarth.js","webpack://blueprint-webpack-boilerplate/./node_modules/@amcharts/amcharts4/.internal/charts/map/projections/EqualEarth.js","webpack://blueprint-webpack-boilerplate/./src/js/components/tabs.js","webpack://blueprint-webpack-boilerplate/./src/js/components/slider.js","webpack://blueprint-webpack-boilerplate/./src/js/components/accordion.js","webpack://blueprint-webpack-boilerplate/./src/js/components/aos.js","webpack://blueprint-webpack-boilerplate/./node_modules/@fancyapps/ui/dist/index.esm.js","webpack://blueprint-webpack-boilerplate/./node_modules/swiper/esm/components/scrollbar/scrollbar.js","webpack://blueprint-webpack-boilerplate/./src/js/components/fancyboxGallery.js","webpack://blueprint-webpack-boilerplate/./node_modules/@videojs/vhs-utils/es/resolve-url.js","webpack://blueprint-webpack-boilerplate/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://blueprint-webpack-boilerplate/./node_modules/m3u8-parser/node_modules/@videojs/vhs-utils/es/stream.js","webpack://blueprint-webpack-boilerplate/./node_modules/m3u8-parser/node_modules/@videojs/vhs-utils/es/decode-b64-to-uint8-array.js","webpack://blueprint-webpack-boilerplate/./node_modules/m3u8-parser/dist/m3u8-parser.es.js","webpack://blueprint-webpack-boilerplate/./node_modules/@videojs/vhs-utils/es/codecs.js","webpack://blueprint-webpack-boilerplate/./node_modules/@videojs/vhs-utils/es/media-types.js","webpack://blueprint-webpack-boilerplate/./node_modules/@videojs/vhs-utils/es/byte-helpers.js","webpack://blueprint-webpack-boilerplate/./node_modules/mpd-parser/node_modules/@videojs/vhs-utils/es/resolve-url.js","webpack://blueprint-webpack-boilerplate/./node_modules/mpd-parser/dist/mpd-parser.es.js","webpack://blueprint-webpack-boilerplate/./node_modules/mpd-parser/node_modules/@videojs/vhs-utils/es/media-groups.js","webpack://blueprint-webpack-boilerplate/./node_modules/mpd-parser/node_modules/@videojs/vhs-utils/es/decode-b64-to-uint8-array.js","webpack://blueprint-webpack-boilerplate/./node_modules/@videojs/vhs-utils/es/mp4-helpers.js","webpack://blueprint-webpack-boilerplate/./node_modules/@videojs/vhs-utils/es/id3-helpers.js","webpack://blueprint-webpack-boilerplate/./node_modules/@videojs/vhs-utils/es/opus-helpers.js","webpack://blueprint-webpack-boilerplate/./node_modules/@videojs/vhs-utils/es/ebml-helpers.js","webpack://blueprint-webpack-boilerplate/./node_modules/@videojs/vhs-utils/es/nal-helpers.js","webpack://blueprint-webpack-boilerplate/./node_modules/@videojs/vhs-utils/es/containers.js","webpack://blueprint-webpack-boilerplate/./node_modules/video.js/dist/video.es.js","webpack://blueprint-webpack-boilerplate/./src/js/components/videoJs.js","webpack://blueprint-webpack-boilerplate/./src/js/utils/browser.js","webpack://blueprint-webpack-boilerplate/./src/js/utils/constants.js","webpack://blueprint-webpack-boilerplate/./src/js/utils/loadPage.js","webpack://blueprint-webpack-boilerplate/./src/js/index.js"],"names":["leafPrototypes","getProto","inProgress","dataWebpackPrefix","_extends","module","exports","Object","assign","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","__esModule","apply","this","window","callback","decodeResponseBody","err","response","responseBody","statusCode","cause","TextDecoder","charset","contentTypeHeader","headers","toLowerCase","split","reduce","contentType","_contentType$split","type","value","trim","decode","e","String","fromCharCode","Uint8Array","isFunction","initParams","uri","options","params","createXHR","_createXHR","Error","called","body","getBody","undefined","xhr","responseText","responseType","responseXML","firefoxBugTakenEffect","documentElement","nodeName","getXml","isJson","JSON","parse","errorFunc","evt","clearTimeout","timeoutTimer","failureResponse","loadFunc","aborted","status","useXDR","method","url","rawRequest","getAllResponseHeaders","result","forEach","row","index","indexOf","slice","Array","isArray","push","parseHeaders","cors","XDomainRequest","XMLHttpRequest","data","sync","json","stringify","onreadystatechange","readyState","setTimeout","onload","onerror","onprogress","onabort","ontimeout","open","username","password","withCredentials","timeout","abort","code","setRequestHeader","obj","isEmpty","beforeSend","send","httpHandler","default","array","iterator","forEachArray","toUpperCase","freeze","object","oc","MIME_TYPE","HTML","isHTML","XML_APPLICATION","XML_TEXT","XML_XHTML_APPLICATION","XML_SVG_IMAGE","NAMESPACE","SVG","XML","XMLNS","TypeError","find","list","predicate","ac","item","conventions","dom","entities","sax","DOMImplementation","ParseError","XMLReader","normalizeLineEndings","input","replace","DOMParser","locator","DOMHandler","cdata","position","node","lineNumber","columnNumber","_locator","l","systemId","_toString","chars","start","substr","java","lang","appendElement","hander","currentElement","appendChild","doc","parseFromString","mimeType","domBuilder","errorHandler","defaultNSMap","xmlns","test","entityMap","HTML_ENTITIES","XML_ENTITIES","setDocumentLocator","errorImpl","isCallback","Function","build","fn","msg","buildErrorHandler","xml","normalize","error","startDocument","createDocument","documentURI","startElement","namespaceURI","localName","qName","attrs","el","createElementNS","len","getURI","getValue","attr","getQName","createAttributeNS","getLocator","nodeValue","setAttributeNode","endElement","current","tagName","parentNode","startPrefixMapping","prefix","endPrefixMapping","processingInstruction","ins","createProcessingInstruction","ignorableWhitespace","ch","characters","charNode","createCDATASection","createTextNode","skippedEntity","name","endDocument","comment","comm","createComment","startCDATA","endCDATA","startDTD","publicId","impl","implementation","createDocumentType","dt","doctype","warning","console","warn","fatalError","notEmptyString","orderedSetReducer","element","toOrderedSet","filter","splitOnASCIIWhitespace","keys","copy","src","dest","p","Class","Super","pt","t","constructor","NodeType","ELEMENT_NODE","ATTRIBUTE_NODE","TEXT_NODE","CDATA_SECTION_NODE","ENTITY_REFERENCE_NODE","ENTITY_NODE","PROCESSING_INSTRUCTION_NODE","COMMENT_NODE","DOCUMENT_NODE","DOCUMENT_TYPE_NODE","DOCUMENT_FRAGMENT_NODE","NOTATION_NODE","ExceptionCode","ExceptionMessage","HIERARCHY_REQUEST_ERR","INDEX_SIZE_ERR","DOMSTRING_SIZE_ERR","NOT_FOUND_ERR","WRONG_DOCUMENT_ERR","INVALID_CHARACTER_ERR","NO_DATA_ALLOWED_ERR","NO_MODIFICATION_ALLOWED_ERR","INUSE_ATTRIBUTE_ERR","NOT_SUPPORTED_ERR","DOMException","message","captureStackTrace","NodeList","LiveNodeList","refresh","_node","_refresh","_updateLiveList","inc","_inc","ownerDocument","ls","__set__","$$length","NamedNodeMap","_findNodeIndex","_addNamedNode","newAttr","oldAttr","ownerElement","_onRemoveAttribute","_nsMap","_onAddAttribute","_removeNamedNode","lastIndex","Node","_xmlEncoder","c","charCodeAt","_visitNode","firstChild","nextSibling","Document","remove","_onUpdateChild","newChild","cs","childNodes","child","_removeChild","previous","previousSibling","next","lastChild","isDocTypeNode","nodeType","isElementNode","isTextNode","isElementInsertionPossible","parentChildNodes","docTypeNode","isElementReplacementPossible","assertPreInsertionValidityInDocument","parent","nodeChildNodes","nodeChildElements","parentElementChild","assertPreReplacementValidityInDocument","_insertBefore","_inDocumentAssertion","hasValidParentNodeType","hasInsertableNodeType","assertPreInsertionValidity1to5","cp","removeChild","newFirst","newLast","pre","Element","Attr","CharacterData","Text","Comment","CDATASection","DocumentType","Notation","Entity","EntityReference","DocumentFragment","ProcessingInstruction","XMLSerializer","nodeSerializeToString","isHtml","nodeFilter","buf","refNode","lookupPrefix","visibleNamespaces","namespace","serializeToString","join","needNamespaceDefine","ns","addSerializedAttribute","qualifiedName","attributes","prefixedNodeName","defaultNS","ai","nsi","pubid","sysid","sub","internalSubset","importNode","deep","node2","cloneNode","n","v","attrs2","_ownerElement","INVALID_STATE_ERR","SYNTAX_ERR","INVALID_MODIFICATION_ERR","NAMESPACE_ERR","INVALID_ACCESS_ERR","toString","getNamedItem","setNamedItem","setNamedItemNS","getNamedItemNS","removeNamedItem","removeNamedItemNS","hasFeature","feature","version","root","insertBefore","refChild","replaceChild","oldChild","hasChildNodes","appendData","isSupported","hasAttributes","map","lookupNamespaceURI","isDefaultNamespace","importedNode","getElementById","id","rtv","getAttribute","getElementsByClassName","classNames","classNamesSet","base","nodeClassNames","matches","nodeClassNamesSet","every","createElement","createDocumentFragment","createAttribute","specified","createEntityReference","pl","hasAttribute","getAttributeNode","setAttribute","removeAttribute","removeAttributeNode","_appendSingleChild","setAttributeNodeNS","removeAttributeNS","old","getAttributeNodeNS","hasAttributeNS","getAttributeNS","setAttributeNS","getElementsByTagName","getElementsByTagNameNS","substringData","offset","count","substring","text","insertData","replaceData","deleteData","splitText","newText","newNode","defineProperty","getTextContent","get","set","amp","apos","gt","lt","quot","Aacute","aacute","Abreve","abreve","acd","acE","Acirc","acirc","acute","Acy","acy","AElig","aelig","af","Afr","afr","Agrave","agrave","alefsym","aleph","Alpha","alpha","Amacr","amacr","amalg","AMP","And","and","andand","andd","andslope","andv","ang","ange","angle","angmsd","angmsdaa","angmsdab","angmsdac","angmsdad","angmsdae","angmsdaf","angmsdag","angmsdah","angrt","angrtvb","angrtvbd","angsph","angst","angzarr","Aogon","aogon","Aopf","aopf","ap","apacir","apE","ape","apid","ApplyFunction","approx","approxeq","Aring","aring","Ascr","ascr","Assign","ast","asymp","asympeq","Atilde","atilde","Auml","auml","awconint","awint","backcong","backepsilon","backprime","backsim","backsimeq","Backslash","Barv","barvee","Barwed","barwed","barwedge","bbrk","bbrktbrk","bcong","Bcy","bcy","bdquo","becaus","Because","because","bemptyv","bepsi","bernou","Bernoullis","Beta","beta","beth","between","Bfr","bfr","bigcap","bigcirc","bigcup","bigodot","bigoplus","bigotimes","bigsqcup","bigstar","bigtriangledown","bigtriangleup","biguplus","bigvee","bigwedge","bkarow","blacklozenge","blacksquare","blacktriangle","blacktriangledown","blacktriangleleft","blacktriangleright","blank","blk12","blk14","blk34","block","bne","bnequiv","bNot","bnot","Bopf","bopf","bot","bottom","bowtie","boxbox","boxDL","boxDl","boxdL","boxdl","boxDR","boxDr","boxdR","boxdr","boxH","boxh","boxHD","boxHd","boxhD","boxhd","boxHU","boxHu","boxhU","boxhu","boxminus","boxplus","boxtimes","boxUL","boxUl","boxuL","boxul","boxUR","boxUr","boxuR","boxur","boxV","boxv","boxVH","boxVh","boxvH","boxvh","boxVL","boxVl","boxvL","boxvl","boxVR","boxVr","boxvR","boxvr","bprime","Breve","breve","brvbar","Bscr","bscr","bsemi","bsim","bsime","bsol","bsolb","bsolhsub","bull","bullet","bump","bumpE","bumpe","Bumpeq","bumpeq","Cacute","cacute","Cap","cap","capand","capbrcup","capcap","capcup","capdot","CapitalDifferentialD","caps","caret","caron","Cayleys","ccaps","Ccaron","ccaron","Ccedil","ccedil","Ccirc","ccirc","Cconint","ccups","ccupssm","Cdot","cdot","cedil","Cedilla","cemptyv","cent","CenterDot","centerdot","Cfr","cfr","CHcy","chcy","check","checkmark","Chi","chi","cir","circ","circeq","circlearrowleft","circlearrowright","circledast","circledcirc","circleddash","CircleDot","circledR","circledS","CircleMinus","CirclePlus","CircleTimes","cirE","cire","cirfnint","cirmid","cirscir","ClockwiseContourIntegral","CloseCurlyDoubleQuote","CloseCurlyQuote","clubs","clubsuit","Colon","colon","Colone","colone","coloneq","comma","commat","comp","compfn","complement","complexes","cong","congdot","Congruent","Conint","conint","ContourIntegral","Copf","copf","coprod","Coproduct","COPY","copysr","CounterClockwiseContourIntegral","crarr","Cross","cross","Cscr","cscr","csub","csube","csup","csupe","ctdot","cudarrl","cudarrr","cuepr","cuesc","cularr","cularrp","Cup","cup","cupbrcap","CupCap","cupcap","cupcup","cupdot","cupor","cups","curarr","curarrm","curlyeqprec","curlyeqsucc","curlyvee","curlywedge","curren","curvearrowleft","curvearrowright","cuvee","cuwed","cwconint","cwint","cylcty","Dagger","dagger","daleth","Darr","dArr","darr","dash","Dashv","dashv","dbkarow","dblac","Dcaron","dcaron","Dcy","dcy","DD","dd","ddagger","ddarr","DDotrahd","ddotseq","deg","Del","Delta","delta","demptyv","dfisht","Dfr","dfr","dHar","dharl","dharr","DiacriticalAcute","DiacriticalDot","DiacriticalDoubleAcute","DiacriticalGrave","DiacriticalTilde","diam","Diamond","diamond","diamondsuit","diams","die","DifferentialD","digamma","disin","div","divide","divideontimes","divonx","DJcy","djcy","dlcorn","dlcrop","dollar","Dopf","dopf","Dot","dot","DotDot","doteq","doteqdot","DotEqual","dotminus","dotplus","dotsquare","doublebarwedge","DoubleContourIntegral","DoubleDot","DoubleDownArrow","DoubleLeftArrow","DoubleLeftRightArrow","DoubleLeftTee","DoubleLongLeftArrow","DoubleLongLeftRightArrow","DoubleLongRightArrow","DoubleRightArrow","DoubleRightTee","DoubleUpArrow","DoubleUpDownArrow","DoubleVerticalBar","DownArrow","Downarrow","downarrow","DownArrowBar","DownArrowUpArrow","DownBreve","downdownarrows","downharpoonleft","downharpoonright","DownLeftRightVector","DownLeftTeeVector","DownLeftVector","DownLeftVectorBar","DownRightTeeVector","DownRightVector","DownRightVectorBar","DownTee","DownTeeArrow","drbkarow","drcorn","drcrop","Dscr","dscr","DScy","dscy","dsol","Dstrok","dstrok","dtdot","dtri","dtrif","duarr","duhar","dwangle","DZcy","dzcy","dzigrarr","Eacute","eacute","easter","Ecaron","ecaron","ecir","Ecirc","ecirc","ecolon","Ecy","ecy","eDDot","Edot","eDot","edot","ee","efDot","Efr","efr","eg","Egrave","egrave","egs","egsdot","elinters","ell","els","elsdot","Emacr","emacr","empty","emptyset","EmptySmallSquare","emptyv","EmptyVerySmallSquare","emsp","emsp13","emsp14","ENG","eng","ensp","Eogon","eogon","Eopf","eopf","epar","eparsl","eplus","epsi","Epsilon","epsilon","epsiv","eqcirc","eqcolon","eqsim","eqslantgtr","eqslantless","Equal","equals","EqualTilde","equest","Equilibrium","equiv","equivDD","eqvparsl","erarr","erDot","Escr","escr","esdot","Esim","esim","Eta","eta","ETH","eth","Euml","euml","euro","excl","exist","Exists","expectation","ExponentialE","exponentiale","fallingdotseq","Fcy","fcy","female","ffilig","fflig","ffllig","Ffr","ffr","filig","FilledSmallSquare","FilledVerySmallSquare","fjlig","flat","fllig","fltns","fnof","Fopf","fopf","ForAll","forall","fork","forkv","Fouriertrf","fpartint","frac12","frac13","frac14","frac15","frac16","frac18","frac23","frac25","frac34","frac35","frac38","frac45","frac56","frac58","frac78","frasl","frown","Fscr","fscr","gacute","Gamma","gamma","Gammad","gammad","gap","Gbreve","gbreve","Gcedil","Gcirc","gcirc","Gcy","gcy","Gdot","gdot","gE","ge","gEl","gel","geq","geqq","geqslant","ges","gescc","gesdot","gesdoto","gesdotol","gesl","gesles","Gfr","gfr","Gg","gg","ggg","gimel","GJcy","gjcy","gl","gla","glE","glj","gnap","gnapprox","gnE","gne","gneq","gneqq","gnsim","Gopf","gopf","grave","GreaterEqual","GreaterEqualLess","GreaterFullEqual","GreaterGreater","GreaterLess","GreaterSlantEqual","GreaterTilde","Gscr","gscr","gsim","gsime","gsiml","Gt","GT","gtcc","gtcir","gtdot","gtlPar","gtquest","gtrapprox","gtrarr","gtrdot","gtreqless","gtreqqless","gtrless","gtrsim","gvertneqq","gvnE","Hacek","hairsp","half","hamilt","HARDcy","hardcy","hArr","harr","harrcir","harrw","Hat","hbar","Hcirc","hcirc","hearts","heartsuit","hellip","hercon","Hfr","hfr","HilbertSpace","hksearow","hkswarow","hoarr","homtht","hookleftarrow","hookrightarrow","Hopf","hopf","horbar","HorizontalLine","Hscr","hscr","hslash","Hstrok","hstrok","HumpDownHump","HumpEqual","hybull","hyphen","Iacute","iacute","ic","Icirc","icirc","Icy","icy","Idot","IEcy","iecy","iexcl","iff","Ifr","ifr","Igrave","igrave","ii","iiiint","iiint","iinfin","iiota","IJlig","ijlig","Im","Imacr","imacr","image","ImaginaryI","imagline","imagpart","imath","imof","imped","Implies","in","incare","infin","infintie","inodot","Int","int","intcal","integers","Integral","intercal","Intersection","intlarhk","intprod","InvisibleComma","InvisibleTimes","IOcy","iocy","Iogon","iogon","Iopf","iopf","Iota","iota","iprod","iquest","Iscr","iscr","isin","isindot","isinE","isins","isinsv","isinv","it","Itilde","itilde","Iukcy","iukcy","Iuml","iuml","Jcirc","jcirc","Jcy","jcy","Jfr","jfr","jmath","Jopf","jopf","Jscr","jscr","Jsercy","jsercy","Jukcy","jukcy","Kappa","kappa","kappav","Kcedil","kcedil","Kcy","kcy","Kfr","kfr","kgreen","KHcy","khcy","KJcy","kjcy","Kopf","kopf","Kscr","kscr","lAarr","Lacute","lacute","laemptyv","lagran","Lambda","lambda","Lang","langd","langle","lap","Laplacetrf","laquo","Larr","lArr","larr","larrb","larrbfs","larrfs","larrhk","larrlp","larrpl","larrsim","larrtl","lat","lAtail","latail","late","lates","lBarr","lbarr","lbbrk","lbrace","lbrack","lbrke","lbrksld","lbrkslu","Lcaron","lcaron","Lcedil","lcedil","lceil","lcub","Lcy","lcy","ldca","ldquo","ldquor","ldrdhar","ldrushar","ldsh","lE","le","LeftAngleBracket","LeftArrow","Leftarrow","leftarrow","LeftArrowBar","LeftArrowRightArrow","leftarrowtail","LeftCeiling","LeftDoubleBracket","LeftDownTeeVector","LeftDownVector","LeftDownVectorBar","LeftFloor","leftharpoondown","leftharpoonup","leftleftarrows","LeftRightArrow","Leftrightarrow","leftrightarrow","leftrightarrows","leftrightharpoons","leftrightsquigarrow","LeftRightVector","LeftTee","LeftTeeArrow","LeftTeeVector","leftthreetimes","LeftTriangle","LeftTriangleBar","LeftTriangleEqual","LeftUpDownVector","LeftUpTeeVector","LeftUpVector","LeftUpVectorBar","LeftVector","LeftVectorBar","lEg","leg","leq","leqq","leqslant","les","lescc","lesdot","lesdoto","lesdotor","lesg","lesges","lessapprox","lessdot","lesseqgtr","lesseqqgtr","LessEqualGreater","LessFullEqual","LessGreater","lessgtr","LessLess","lesssim","LessSlantEqual","LessTilde","lfisht","lfloor","Lfr","lfr","lg","lgE","lHar","lhard","lharu","lharul","lhblk","LJcy","ljcy","Ll","ll","llarr","llcorner","Lleftarrow","llhard","lltri","Lmidot","lmidot","lmoust","lmoustache","lnap","lnapprox","lnE","lne","lneq","lneqq","lnsim","loang","loarr","lobrk","LongLeftArrow","Longleftarrow","longleftarrow","LongLeftRightArrow","Longleftrightarrow","longleftrightarrow","longmapsto","LongRightArrow","Longrightarrow","longrightarrow","looparrowleft","looparrowright","lopar","Lopf","lopf","loplus","lotimes","lowast","lowbar","LowerLeftArrow","LowerRightArrow","loz","lozenge","lozf","lpar","lparlt","lrarr","lrcorner","lrhar","lrhard","lrm","lrtri","lsaquo","Lscr","lscr","Lsh","lsh","lsim","lsime","lsimg","lsqb","lsquo","lsquor","Lstrok","lstrok","Lt","LT","ltcc","ltcir","ltdot","lthree","ltimes","ltlarr","ltquest","ltri","ltrie","ltrif","ltrPar","lurdshar","luruhar","lvertneqq","lvnE","macr","male","malt","maltese","Map","mapsto","mapstodown","mapstoleft","mapstoup","marker","mcomma","Mcy","mcy","mdash","mDDot","measuredangle","MediumSpace","Mellintrf","Mfr","mfr","mho","micro","mid","midast","midcir","middot","minus","minusb","minusd","minusdu","MinusPlus","mlcp","mldr","mnplus","models","Mopf","mopf","mp","Mscr","mscr","mstpos","Mu","mu","multimap","mumap","nabla","Nacute","nacute","nang","nap","napE","napid","napos","napprox","natur","natural","naturals","nbsp","nbump","nbumpe","ncap","Ncaron","ncaron","Ncedil","ncedil","ncong","ncongdot","ncup","Ncy","ncy","ndash","ne","nearhk","neArr","nearr","nearrow","nedot","NegativeMediumSpace","NegativeThickSpace","NegativeThinSpace","NegativeVeryThinSpace","nequiv","nesear","nesim","NestedGreaterGreater","NestedLessLess","NewLine","nexist","nexists","Nfr","nfr","ngE","nge","ngeq","ngeqq","ngeqslant","nges","nGg","ngsim","nGt","ngt","ngtr","nGtv","nhArr","nharr","nhpar","ni","nis","nisd","niv","NJcy","njcy","nlArr","nlarr","nldr","nlE","nle","nLeftarrow","nleftarrow","nLeftrightarrow","nleftrightarrow","nleq","nleqq","nleqslant","nles","nless","nLl","nlsim","nLt","nlt","nltri","nltrie","nLtv","nmid","NoBreak","NonBreakingSpace","Nopf","nopf","Not","not","NotCongruent","NotCupCap","NotDoubleVerticalBar","NotElement","NotEqual","NotEqualTilde","NotExists","NotGreater","NotGreaterEqual","NotGreaterFullEqual","NotGreaterGreater","NotGreaterLess","NotGreaterSlantEqual","NotGreaterTilde","NotHumpDownHump","NotHumpEqual","notin","notindot","notinE","notinva","notinvb","notinvc","NotLeftTriangle","NotLeftTriangleBar","NotLeftTriangleEqual","NotLess","NotLessEqual","NotLessGreater","NotLessLess","NotLessSlantEqual","NotLessTilde","NotNestedGreaterGreater","NotNestedLessLess","notni","notniva","notnivb","notnivc","NotPrecedes","NotPrecedesEqual","NotPrecedesSlantEqual","NotReverseElement","NotRightTriangle","NotRightTriangleBar","NotRightTriangleEqual","NotSquareSubset","NotSquareSubsetEqual","NotSquareSuperset","NotSquareSupersetEqual","NotSubset","NotSubsetEqual","NotSucceeds","NotSucceedsEqual","NotSucceedsSlantEqual","NotSucceedsTilde","NotSuperset","NotSupersetEqual","NotTilde","NotTildeEqual","NotTildeFullEqual","NotTildeTilde","NotVerticalBar","npar","nparallel","nparsl","npart","npolint","npr","nprcue","npre","nprec","npreceq","nrArr","nrarr","nrarrc","nrarrw","nRightarrow","nrightarrow","nrtri","nrtrie","nsc","nsccue","nsce","Nscr","nscr","nshortmid","nshortparallel","nsim","nsime","nsimeq","nsmid","nspar","nsqsube","nsqsupe","nsub","nsubE","nsube","nsubset","nsubseteq","nsubseteqq","nsucc","nsucceq","nsup","nsupE","nsupe","nsupset","nsupseteq","nsupseteqq","ntgl","Ntilde","ntilde","ntlg","ntriangleleft","ntrianglelefteq","ntriangleright","ntrianglerighteq","Nu","nu","num","numero","numsp","nvap","nVDash","nVdash","nvDash","nvdash","nvge","nvgt","nvHarr","nvinfin","nvlArr","nvle","nvlt","nvltrie","nvrArr","nvrtrie","nvsim","nwarhk","nwArr","nwarr","nwarrow","nwnear","Oacute","oacute","oast","ocir","Ocirc","ocirc","Ocy","ocy","odash","Odblac","odblac","odiv","odot","odsold","OElig","oelig","ofcir","Ofr","ofr","ogon","Ograve","ograve","ogt","ohbar","ohm","oint","olarr","olcir","olcross","oline","olt","Omacr","omacr","Omega","omega","Omicron","omicron","omid","ominus","Oopf","oopf","opar","OpenCurlyDoubleQuote","OpenCurlyQuote","operp","oplus","Or","or","orarr","ord","order","orderof","ordf","ordm","origof","oror","orslope","orv","oS","Oscr","oscr","Oslash","oslash","osol","Otilde","otilde","Otimes","otimes","otimesas","Ouml","ouml","ovbar","OverBar","OverBrace","OverBracket","OverParenthesis","par","para","parallel","parsim","parsl","part","PartialD","Pcy","pcy","percnt","period","permil","perp","pertenk","Pfr","pfr","Phi","phi","phiv","phmmat","phone","Pi","pi","pitchfork","piv","planck","planckh","plankv","plus","plusacir","plusb","pluscir","plusdo","plusdu","pluse","PlusMinus","plusmn","plussim","plustwo","pm","Poincareplane","pointint","Popf","popf","pound","Pr","pr","prap","prcue","prE","prec","precapprox","preccurlyeq","Precedes","PrecedesEqual","PrecedesSlantEqual","PrecedesTilde","preceq","precnapprox","precneqq","precnsim","precsim","Prime","prime","primes","prnap","prnE","prnsim","prod","Product","profalar","profline","profsurf","prop","Proportion","Proportional","propto","prsim","prurel","Pscr","pscr","Psi","psi","puncsp","Qfr","qfr","qint","Qopf","qopf","qprime","Qscr","qscr","quaternions","quatint","quest","questeq","QUOT","rAarr","race","Racute","racute","radic","raemptyv","Rang","rang","rangd","range","rangle","raquo","Rarr","rArr","rarr","rarrap","rarrb","rarrbfs","rarrc","rarrfs","rarrhk","rarrlp","rarrpl","rarrsim","Rarrtl","rarrtl","rarrw","rAtail","ratail","ratio","rationals","RBarr","rBarr","rbarr","rbbrk","rbrace","rbrack","rbrke","rbrksld","rbrkslu","Rcaron","rcaron","Rcedil","rcedil","rceil","rcub","Rcy","rcy","rdca","rdldhar","rdquo","rdquor","rdsh","Re","real","realine","realpart","reals","rect","REG","reg","ReverseElement","ReverseEquilibrium","ReverseUpEquilibrium","rfisht","rfloor","Rfr","rfr","rHar","rhard","rharu","rharul","Rho","rho","rhov","RightAngleBracket","RightArrow","Rightarrow","rightarrow","RightArrowBar","RightArrowLeftArrow","rightarrowtail","RightCeiling","RightDoubleBracket","RightDownTeeVector","RightDownVector","RightDownVectorBar","RightFloor","rightharpoondown","rightharpoonup","rightleftarrows","rightleftharpoons","rightrightarrows","rightsquigarrow","RightTee","RightTeeArrow","RightTeeVector","rightthreetimes","RightTriangle","RightTriangleBar","RightTriangleEqual","RightUpDownVector","RightUpTeeVector","RightUpVector","RightUpVectorBar","RightVector","RightVectorBar","ring","risingdotseq","rlarr","rlhar","rlm","rmoust","rmoustache","rnmid","roang","roarr","robrk","ropar","Ropf","ropf","roplus","rotimes","RoundImplies","rpar","rpargt","rppolint","rrarr","Rrightarrow","rsaquo","Rscr","rscr","Rsh","rsh","rsqb","rsquo","rsquor","rthree","rtimes","rtri","rtrie","rtrif","rtriltri","RuleDelayed","ruluhar","rx","Sacute","sacute","sbquo","Sc","sc","scap","Scaron","scaron","sccue","scE","sce","Scedil","scedil","Scirc","scirc","scnap","scnE","scnsim","scpolint","scsim","Scy","scy","sdot","sdotb","sdote","searhk","seArr","searr","searrow","sect","semi","seswar","setminus","setmn","sext","Sfr","sfr","sfrown","sharp","SHCHcy","shchcy","SHcy","shcy","ShortDownArrow","ShortLeftArrow","shortmid","shortparallel","ShortRightArrow","ShortUpArrow","shy","Sigma","sigma","sigmaf","sigmav","sim","simdot","sime","simeq","simg","simgE","siml","simlE","simne","simplus","simrarr","slarr","SmallCircle","smallsetminus","smashp","smeparsl","smid","smile","smt","smte","smtes","SOFTcy","softcy","sol","solb","solbar","Sopf","sopf","spades","spadesuit","spar","sqcap","sqcaps","sqcup","sqcups","Sqrt","sqsub","sqsube","sqsubset","sqsubseteq","sqsup","sqsupe","sqsupset","sqsupseteq","squ","Square","square","SquareIntersection","SquareSubset","SquareSubsetEqual","SquareSuperset","SquareSupersetEqual","SquareUnion","squarf","squf","srarr","Sscr","sscr","ssetmn","ssmile","sstarf","Star","star","starf","straightepsilon","straightphi","strns","Sub","subdot","subE","sube","subedot","submult","subnE","subne","subplus","subrarr","Subset","subset","subseteq","subseteqq","SubsetEqual","subsetneq","subsetneqq","subsim","subsub","subsup","succ","succapprox","succcurlyeq","Succeeds","SucceedsEqual","SucceedsSlantEqual","SucceedsTilde","succeq","succnapprox","succneqq","succnsim","succsim","SuchThat","Sum","sum","sung","Sup","sup","sup1","sup2","sup3","supdot","supdsub","supE","supe","supedot","Superset","SupersetEqual","suphsol","suphsub","suplarr","supmult","supnE","supne","supplus","Supset","supset","supseteq","supseteqq","supsetneq","supsetneqq","supsim","supsub","supsup","swarhk","swArr","swarr","swarrow","swnwar","szlig","Tab","Tau","tau","tbrk","Tcaron","tcaron","Tcedil","tcedil","Tcy","tcy","tdot","telrec","Tfr","tfr","there4","Therefore","therefore","Theta","theta","thetasym","thetav","thickapprox","thicksim","ThickSpace","thinsp","ThinSpace","thkap","thksim","THORN","thorn","Tilde","tilde","TildeEqual","TildeFullEqual","TildeTilde","times","timesb","timesbar","timesd","tint","toea","top","topbot","topcir","Topf","topf","topfork","tosa","tprime","TRADE","trade","triangle","triangledown","triangleleft","trianglelefteq","triangleq","triangleright","trianglerighteq","tridot","trie","triminus","TripleDot","triplus","trisb","tritime","trpezium","Tscr","tscr","TScy","tscy","TSHcy","tshcy","Tstrok","tstrok","twixt","twoheadleftarrow","twoheadrightarrow","Uacute","uacute","Uarr","uArr","uarr","Uarrocir","Ubrcy","ubrcy","Ubreve","ubreve","Ucirc","ucirc","Ucy","ucy","udarr","Udblac","udblac","udhar","ufisht","Ufr","ufr","Ugrave","ugrave","uHar","uharl","uharr","uhblk","ulcorn","ulcorner","ulcrop","ultri","Umacr","umacr","uml","UnderBar","UnderBrace","UnderBracket","UnderParenthesis","Union","UnionPlus","Uogon","uogon","Uopf","uopf","UpArrow","Uparrow","uparrow","UpArrowBar","UpArrowDownArrow","UpDownArrow","Updownarrow","updownarrow","UpEquilibrium","upharpoonleft","upharpoonright","uplus","UpperLeftArrow","UpperRightArrow","Upsi","upsi","upsih","Upsilon","upsilon","UpTee","UpTeeArrow","upuparrows","urcorn","urcorner","urcrop","Uring","uring","urtri","Uscr","uscr","utdot","Utilde","utilde","utri","utrif","uuarr","Uuml","uuml","uwangle","vangrt","varepsilon","varkappa","varnothing","varphi","varpi","varpropto","vArr","varr","varrho","varsigma","varsubsetneq","varsubsetneqq","varsupsetneq","varsupsetneqq","vartheta","vartriangleleft","vartriangleright","Vbar","vBar","vBarv","Vcy","vcy","VDash","Vdash","vDash","vdash","Vdashl","Vee","vee","veebar","veeeq","vellip","Verbar","verbar","Vert","vert","VerticalBar","VerticalLine","VerticalSeparator","VerticalTilde","VeryThinSpace","Vfr","vfr","vltri","vnsub","vnsup","Vopf","vopf","vprop","vrtri","Vscr","vscr","vsubnE","vsubne","vsupnE","vsupne","Vvdash","vzigzag","Wcirc","wcirc","wedbar","Wedge","wedge","wedgeq","weierp","Wfr","wfr","Wopf","wopf","wp","wr","wreath","Wscr","wscr","xcap","xcirc","xcup","xdtri","Xfr","xfr","xhArr","xharr","Xi","xi","xlArr","xlarr","xmap","xnis","xodot","Xopf","xopf","xoplus","xotime","xrArr","xrarr","Xscr","xscr","xsqcup","xuplus","xutri","xvee","xwedge","Yacute","yacute","YAcy","yacy","Ycirc","ycirc","Ycy","ycy","yen","Yfr","yfr","YIcy","yicy","Yopf","yopf","Yscr","yscr","YUcy","yucy","Yuml","yuml","Zacute","zacute","Zcaron","zcaron","Zcy","zcy","Zdot","zdot","zeetrf","ZeroWidthSpace","Zeta","zeta","Zfr","zfr","ZHcy","zhcy","zigrarr","Zopf","zopf","Zscr","zscr","zwj","zwnj","nameStartChar","nameChar","RegExp","tagNamePattern","copyLocator","f","parseElementStartPart","currentNSMap","entityReplacer","addAttribute","qname","startIndex","attributeNames","addValue","attrName","s","charAt","setTagName","closed","match","localNSMap","a","nsp","nsPrefix","_copy","parseHtmlSpecialContent","elStartEnd","elEndStart","fixSelfClosed","closeMap","pos","lastIndexOf","parseDCC","end","matchs","exec","lastMatch","endDTD","parseInstruction","ElementAttributes","defaultNSMapCopy","k","surrogate1","surrogate2","fixedFromCharCode","parseInt","appendText","xt","m","lineEnd","linePattern","lineStart","parseStack","tagStart","config","pop","endMatch","locator2","Math","max","getLocalName","factory","cookie","$","pluses","encode","raw","encodeURIComponent","decodeURIComponent","stringifyCookieValue","read","converter","parseCookieValue","extend","defaults","expires","days","Date","setMilliseconds","getMilliseconds","document","toUTCString","path","domain","secure","cookies","parts","shift","removeCookie","define","require","init","on","hide","parents","slideToggle","doccy","topLevel","g","minDoc","win","self","string","alert","confirm","prompt","global","w","noGlobal","arr","getPrototypeOf","concat","class2type","hasOwn","fnToString","ObjectFunctionString","support","isWindow","preservedScriptAttributes","nonce","noModule","DOMEval","val","script","head","toType","rhtmlSuffix","jQuery","selector","context","isArrayLike","elem","jquery","toArray","pushStack","elems","ret","merge","prevObject","each","first","eq","last","even","grep","_elem","odd","j","sort","splice","copyIsArray","clone","isPlainObject","expando","random","isReady","noop","proto","Ctor","isEmptyObject","globalEval","textContent","makeArray","results","inArray","isXMLDoc","docElem","second","invert","callbackExpect","arg","guid","Symbol","_i","whitespace","rtrimCSS","contains","b","bup","compareDocumentPosition","rcssescape","fcssescape","asCodePoint","escapeSelector","sel","preferredDoc","pushNative","Expr","outermostContext","sortInput","hasDuplicate","documentIsHTML","rbuggyQSA","dirruns","done","classCache","createCache","tokenCache","compilerCache","nonnativeSelectorCache","sortOrder","booleans","identifier","pseudos","rwhitespace","rcomma","rleadingCombinator","rdescend","rpseudo","ridentifier","matchExpr","ID","CLASS","TAG","ATTR","PSEUDO","CHILD","bool","needsContext","rinputs","rheader","rquickExpr","rsibling","runescape","funescape","escape","nonHex","high","unloadHandler","setDocument","inDisabledFieldset","addCombinator","disabled","dir","seed","nid","groups","newSelector","newContext","testContext","scope","tokenize","toSelector","querySelectorAll","qsaError","select","cache","cacheLength","markFunction","assert","createInputPseudo","createButtonPseudo","createDisabledPseudo","isDisabled","createPositionalPseudo","argument","matchIndexes","subWindow","webkitMatchesSelector","msMatchesSelector","defaultView","addEventListener","getById","getElementsByName","disconnectedMatch","cssHas","querySelector","attrId","tag","className","innerHTML","compare","sortDetached","expr","elements","matchesSelector","attrHandle","uniqueSort","duplicates","sortStable","createPseudo","relative","preFilter","excess","unquoted","nodeNameSelector","expectedNodeName","pattern","operator","what","_argument","simple","forward","ofType","_context","outerCache","nodeIndex","useCache","diff","pseudo","args","setFilters","idx","matched","matcher","compile","unmatched","has","elemLang","hash","location","focus","activeElement","safeActiveElement","hasFocus","href","tabIndex","enabled","checked","selected","selectedIndex","header","button","_matchIndexes","nth","radio","checkbox","file","submit","reset","parseOnly","tokens","soFar","preFilters","cached","combinator","skip","checkNonElements","doneName","oldCache","newCache","elementMatcher","matchers","condense","newUnmatched","mapped","setMatcher","postFilter","postFinder","postSelector","temp","matcherOut","preMap","postMap","preexisting","contexts","multipleContexts","matcherIn","matcherFromTokens","checkContext","leadingRelative","implicitRelative","matchContext","matchAnyContext","setMatchers","elementMatchers","bySet","byElement","superMatcher","outermost","matchedCount","setMatched","contextBackup","dirrunsUnique","matcherFromGroupMatchers","token","compiled","filters","unique","getText","isXML","selectors","until","truncate","is","siblings","rneedsContext","rsingleTag","winnow","qualifier","rootjQuery","parseHTML","ready","rparentsprev","guaranteedUnique","children","contents","prev","sibling","cur","targets","closest","prevAll","add","addBack","parentsUntil","nextAll","nextUntil","prevUntil","contentDocument","content","reverse","rnothtmlwhite","Identity","Thrower","ex","adoptValue","resolve","reject","noValue","promise","fail","then","Callbacks","_","flag","createOptions","firing","memory","fired","locked","queue","firingIndex","fire","once","stopOnFalse","disable","lock","fireWith","Deferred","func","tuples","state","always","deferred","pipe","fns","newDefer","tuple","returned","progress","notify","onFulfilled","onRejected","onProgress","maxDepth","depth","handler","special","that","mightThrow","notifyWith","resolveWith","process","exceptionHook","rejectWith","getErrorHook","getStackHook","stateString","when","singleValue","remaining","resolveContexts","resolveValues","primary","updateFunc","rerrorNames","asyncError","stack","readyException","readyList","completed","removeEventListener","catch","readyWait","wait","doScroll","access","chainable","emptyGet","bulk","_key","rmsPrefix","rdashAlpha","fcamelCase","_all","letter","camelCase","acceptData","owner","Data","uid","configurable","hasData","dataPriv","dataUser","rmultiDash","dataAttr","getData","removeData","_data","_removeData","dequeue","startLength","hooks","_queueHooks","unshift","stop","setter","clearQueue","tmp","defer","pnum","rcssNum","cssExpand","isAttached","composed","getRootNode","isHiddenWithinTree","style","display","css","adjustCSS","valueParts","tween","adjusted","scale","maxIterations","currentValue","initial","unit","cssNumber","initialInUnit","defaultDisplayMap","getDefaultDisplay","showHide","show","values","toggle","rcheckableType","rtagName","rscriptType","checkClone","noCloneChecked","defaultValue","option","wrapMap","thead","col","tr","td","_default","getAll","setGlobalEval","refElements","tbody","tfoot","colgroup","caption","th","optgroup","rhtml","buildFragment","scripts","selection","ignored","wrap","attached","fragment","nodes","htmlPrefilter","rtypenamespace","returnTrue","returnFalse","types","one","origFn","event","off","leverageNative","isSetup","saved","isTrigger","delegateType","stopPropagation","stopImmediatePropagation","preventDefault","trigger","isImmediatePropagationStopped","handleObjIn","eventHandle","events","handleObj","handlers","namespaces","origType","elemData","create","handle","triggered","dispatch","bindType","delegateCount","setup","mappedTypes","origCount","teardown","removeEvent","nativeEvent","handlerQueue","fix","delegateTarget","preDispatch","isPropagationStopped","currentTarget","rnamespace","postDispatch","matchedHandlers","matchedSelectors","addProp","hook","Event","enumerable","originalEvent","writable","load","noBubble","click","beforeunload","returnValue","props","isDefaultPrevented","defaultPrevented","relatedTarget","timeStamp","now","isSimulated","altKey","bubbles","cancelable","changedTouches","ctrlKey","detail","eventPhase","metaKey","pageX","pageY","shiftKey","view","charCode","keyCode","buttons","clientX","clientY","offsetX","offsetY","pointerId","pointerType","screenX","screenY","targetTouches","toElement","touches","which","blur","focusMappedHandler","documentMode","simulate","attaches","dataHolder","mouseenter","mouseleave","pointerenter","pointerleave","orig","related","rnoInnerhtml","rchecked","rcleanScript","manipulationTarget","disableScript","restoreScript","cloneCopyEvent","udataOld","udataCur","fixInput","domManip","collection","hasScripts","iNoClone","valueIsFunction","html","_evalUrl","keepData","cleanData","dataAndEvents","deepDataAndEvents","srcElements","destElements","inPage","detach","append","prepend","before","after","replaceWith","appendTo","prependTo","insertAfter","replaceAll","original","insert","rnumnonpx","rcustomProp","getStyles","opener","getComputedStyle","swap","rboxStyle","curCSS","computed","width","minWidth","maxWidth","isCustomProp","getPropertyValue","pixelBoxStyles","addGetHookIf","conditionFn","hookFn","computeStyleTests","container","cssText","divStyle","pixelPositionVal","reliableMarginLeftVal","roundPixelMeasures","marginLeft","right","pixelBoxStylesVal","boxSizingReliableVal","scrollboxSizeVal","offsetWidth","measure","round","parseFloat","reliableTrDimensionsVal","backgroundClip","clearCloneStyle","boxSizingReliable","pixelPosition","reliableMarginLeft","scrollboxSize","reliableTrDimensions","table","trChild","trStyle","height","borderTopWidth","borderBottomWidth","offsetHeight","cssPrefixes","emptyStyle","vendorProps","finalPropName","cssProps","capName","vendorPropName","rdisplayswap","cssShow","visibility","cssNormalTransform","letterSpacing","fontWeight","setPositiveNumber","subtract","boxModelAdjustment","dimension","box","isBorderBox","styles","computedVal","extra","marginDelta","ceil","getWidthOrHeight","valueIsBorderBox","offsetProp","getClientRects","Tween","easing","cssHooks","opacity","animationIterationCount","aspectRatio","borderImageSlice","columnCount","flexGrow","flexShrink","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineHeight","orphans","widows","zIndex","zoom","fillOpacity","floodOpacity","stopOpacity","strokeMiterlimit","strokeOpacity","origName","setProperty","isFinite","getBoundingClientRect","scrollboxSizeBuggy","left","margin","padding","border","suffix","expand","expanded","propHooks","run","percent","eased","duration","step","fx","scrollTop","scrollLeft","linear","swing","cos","PI","fxNow","rfxtypes","rrun","schedule","hidden","requestAnimationFrame","interval","tick","createFxNow","genFx","includeWidth","createTween","animation","Animation","tweeners","properties","stopped","prefilters","currentTime","startTime","tweens","opts","specialEasing","originalProperties","originalOptions","gotoEnd","propFilter","bind","complete","timer","anim","tweener","oldfire","propTween","restoreDisplay","isBox","dataShow","unqueued","overflow","overflowX","overflowY","prefilter","speed","opt","speeds","fadeTo","to","animate","optall","doAnimation","finish","stopQueue","timers","cssFn","slideDown","slideUp","fadeIn","fadeOut","fadeToggle","slow","fast","delay","time","checkOn","optSelected","radioValue","boolHook","removeAttr","nType","attrHooks","attrNames","getter","lowercaseName","rfocusable","rclickable","stripAndCollapse","getClass","classesToArray","removeProp","propFix","tabindex","addClass","curValue","finalValue","removeClass","toggleClass","stateVal","isValidValue","hasClass","rreturn","valHooks","optionSet","rquery","parseXML","parserErrorElem","rfocusMorph","stopPropagationCallback","onlyHandlers","bubbleType","ontype","lastElement","eventPath","parentWindow","triggerHandler","rbracket","rCRLF","rsubmitterTypes","rsubmittable","buildParams","traditional","param","valueOrFunction","serialize","serializeArray","r20","rhash","rantiCache","rheaders","rnoContent","rprotocol","transports","allTypes","originAnchor","addToPrefiltersOrTransports","structure","dataTypeExpression","dataType","dataTypes","inspectPrefiltersOrTransports","jqXHR","inspected","seekingTransport","inspect","prefilterOrFactory","dataTypeOrTransport","ajaxExtend","flatOptions","ajaxSettings","active","lastModified","etag","isLocal","protocol","processData","async","accepts","responseFields","converters","ajaxSetup","settings","ajaxPrefilter","ajaxTransport","ajax","transport","cacheURL","responseHeadersString","responseHeaders","urlAnchor","fireGlobals","uncached","callbackContext","globalEventContext","completeDeferred","requestHeaders","requestHeadersNames","strAbort","getResponseHeader","overrideMimeType","statusText","finalText","crossDomain","host","hasContent","ifModified","success","nativeStatusText","responses","isSuccess","modified","ct","finalDataType","firstDataType","ajaxHandleResponses","conv2","conv","dataFilter","throws","ajaxConvert","getJSON","getScript","wrapAll","firstElementChild","wrapInner","htmlIsFunction","unwrap","visible","xhrSuccessStatus","0","1223","xhrSupported","errorCallback","xhrFields","binary","scriptAttrs","scriptCharset","oldCallbacks","rjsonp","jsonp","jsonpCallback","originalSettings","callbackName","overwritten","responseContainer","jsonProp","createHTMLDocument","keepScripts","parsed","animated","setOffset","curPosition","curLeft","curCSSTop","curTop","curOffset","curCSSLeft","curElem","using","pageYOffset","pageXOffset","offsetParent","parentOffset","scrollTo","Height","Width","defaultExtra","funcName","unbind","delegate","undelegate","hover","fnOver","fnOut","rtrim","proxy","holdReady","hold","parseJSON","isNumeric","isNaN","_jQuery","_$","noConflict","searchInput","hasKeyCode","names","foundNamedKey","search","codes","aliases","isEventKey","nameOrCode","title","alias","getUint64","DataView","buffer","byteOffset","byteLength","flags","subarray","references","referenceId","getUint32","timescale","earliestPresentationTime","firstOffset","referenceCount","getUint16","referenceType","referencedSize","subsegmentDuration","startsWithSap","sapType","sapDeltaTime","secondsToVideoTs","secondsToAudioTs","videoTsToSeconds","audioTsToSeconds","audioTsToVideoTs","videoTsToAudioTs","metadataTsToSeconds","ONE_SECOND_IN_TS","seconds","sampleRate","timestamp","timelineStartPts","keepOriginalTimestamps","MAX_UINT32","pow","uint8","dv","getBigUint64","Number","MAX_SAFE_INTEGER","Queue","polylabel","polygon","precision","debug","minX","minY","maxX","maxY","cellSize","min","h","degeneratePoleOfInaccessibility","distance","cellQueue","compareMax","x","y","Cell","bestCell","area","points","getCentroidCell","bboxCell","d","numProbes","cell","log","poleOfInaccessibility","inside","minDistSq","Infinity","getSegDistSq","sqrt","pointToPolygonDist","SQRT2","px","py","dx","dy","TinyQueue","defaultCompare","_down","_up","halfLength","best","URL_REGEX","FIRST_SEGMENT_REGEX","SLASH_DOT_REGEX","SLASH_DOT_DOT_REGEX","URLToolkit","buildAbsoluteURL","baseURL","relativeURL","alwaysNormalize","basePartsForNormalise","parseURL","normalizePath","buildURLFromParts","relativeParts","scheme","baseParts","netLoc","pathParts","builtParts","query","baseURLPath","newPath","reviver","vttjs","WebVTT","VTTCue","VTTRegion","cueShim","regionShim","nativeVTTCue","nativeVTTRegion","shim","restore","_objCreate","F","o","ParsingError","errorData","parseTimeStamp","computeSeconds","Settings","parseOptions","keyValueDelim","groupDelim","kv","parseCue","cue","regionList","oInput","consumeTimeStamp","ts","Errors","BadTimeStamp","skipWhitespace","endTime","region","alt","vals","vals0","integer","vertical","line","lineAlign","snapToLines","size","align","center","middle","positionAlign","consumeCueSettings","BadSignature","dflt","defaultKey","TEXTAREA_ELEMENT","TAG_NAME","u","ruby","rt","DEFAULT_COLOR_CLASS","white","lime","cyan","red","yellow","magenta","blue","black","TAG_ANNOTATION","NEEDS_PARENT","parseContent","nextToken","shouldAdd","annotation","rootDiv","tagStack","classes","cl","bgColor","colorName","propName","propValue","strongRTLRanges","isStrongRTLChar","currentRange","determineBidi","cueDiv","nodeStack","pushNodes","nextTextNode","innerText","StyleBox","CueStyleBox","styleOptions","color","backgroundColor","writingMode","unicodeBidi","applyStyles","direction","textAlign","font","whiteSpace","textPos","formatStyle","move","BoxPosition","lh","offsetTop","rects","moveBoxToLinePosition","styleBox","containerBox","boxPositions","boxPosition","linePos","track","textTrackList","mediaElement","trackList","mode","computeLinePos","axis","maxPosition","initialAxis","abs","calculatedPercentage","bestPosition","specifiedPosition","percentage","overlapsOppositeAxis","within","overlapsAny","intersectPercentage","findBestPosition","toCSSCompatValues","toMove","overlaps","b2","boxes","reference","getSimpleBoxPosition","StringDecoder","convertCueToDOMTree","cuetext","processCues","cues","overlay","paddedOverlay","hasBeenReset","displayState","shouldCompute","fontSize","Parser","decoder","reportOrThrowError","onparsingerror","collectNextLine","stream","alreadyCollectedLine","ontimestampmap","parseTimestampMap","xy","anchor","lines","regionAnchorX","regionAnchorY","viewportAnchorX","viewportAnchorY","scroll","onregion","parseRegion","hasSubstring","oncue","flush","onflush","directionSetting","alignSetting","findAlignSetting","_id","_pauseOnExit","_startTime","_endTime","_text","_region","_vertical","_snapToLines","_line","_lineAlign","_position","_positionAlign","_size","_align","defineProperties","setting","findDirectionSetting","SyntaxError","getCueAsHTML","scrollSetting","isValidPercentValue","_width","_lines","_regionAnchorX","_regionAnchorY","_viewportAnchorX","_viewportAnchorY","_scroll","findScrollSetting","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","loaded","__webpack_modules__","amdO","__proto__","r","def","getOwnPropertyNames","definition","chunkId","Promise","all","promises","miniCssF","globalThis","hmd","needAttach","nc","onScriptComplete","doneFns","toStringTag","scriptUrl","importScripts","currentScript","installedChunks","179","installedChunkData","errorType","realSrc","request","webpackJsonpCallback","parentChunkLoadingFunction","chunkIds","moreModules","runtime","chunkLoadingGlobal","mdModalOpenBtn","mdModalCloseBtn","usModalOpenBtn","usModalCloseBtn","field","$thisFileName","files","checkOffset","fixedHeader","banner","innerWidth","mobileBannerUrl","backgroundImage","slide","classList","isObject","ssrDocument","createEvent","initEvent","hostname","origin","pathname","getDocument","ssrWindow","navigator","userAgent","history","replaceState","pushState","go","back","CustomEvent","Image","screen","matchMedia","cancelAnimationFrame","_getPrototypeOf","setPrototypeOf","_setPrototypeOf","_isNativeReflectConstruct","Reflect","construct","sham","Proxy","_construct","Parent","instance","_wrapNativeSuper","_cache","Wrapper","Dom7","_Array","subClass","superClass","items","_this","ReferenceError","_assertThisInitialized","arrayFlat","res","arrayFilter","toCreate","tempParent","qsa","uniqueArray","arrayUnique","noTrigger","shortcut","_len","Methods","_el$classList","_len2","_key2","_el$classList2","_len4","_key4","_len3","_key3","transform","transition","transitionDuration","_len5","_key5","eventType","targetSelector","listener","capture","handleLiveEvent","eventData","dom7EventData","_parents","handleEvent","_event","dom7LiveListeners","proxyListener","dom7Listeners","_len6","_key6","dom7proxy","_len9","_key9","dataIndex","dispatchEvent","transitionEnd","fireCallBack","outerWidth","includeMargins","_styles","outerHeight","_styles2","clientTop","clientLeft","scrollY","scrollX","_prop","compareWith","returnIndex","tempDiv","nextElementSibling","nextEls","_next","previousElementSibling","prevEls","_prev","_parent","foundElements","found","methodName","device","browser","nextTick","noExtend","nextSource","keysArray","nextIndex","nextKey","desc","getOwnPropertyDescriptor","__swiper__","bindModuleMethods","subKey","classesToSelector","createElementIfNotDefined","$container","createElements","checkProps","auto","getSupport","touch","DocumentTouch","pointerEvents","PointerEvent","maxTouchPoints","observer","passiveListener","supportsPassive","gestures","calcSupport","getDevice","overrides","_temp","platform","ua","ios","android","screenWidth","screenHeight","ipad","ipod","iphone","windows","macos","os","calcDevice","getBrowser","isEdge","isSafari","isWebView","calcBrowser","swiper","resize","createObserver","destroyed","initialized","ResizeObserver","entries","newWidth","newHeight","_ref","contentBoxSize","contentRect","inlineSize","blockSize","resizeHandler","observe","removeObserver","unobserve","emit","orientationChangeHandler","resizeObserver","destroy","Observer","attach","MutationObserver","WebkitMutationObserver","mutations","observerUpdate","childList","characterData","observers","observeParents","containerParents","$el","observeSlideChildren","$wrapperEl","disconnect","onTouchStart","touchEventsData","animating","preventInteractionOnTransition","$targetEl","touchEventsTarget","wrapperEl","isTouchEvent","isTouched","isMoved","noSwipingClass","shadowRoot","noSwiping","noSwipingSelector","allowClick","swipeHandler","currentX","currentY","startX","startY","edgeSwipeDetection","iOSEdgeSwipeDetection","edgeSwipeThreshold","iOSEdgeSwipeThreshold","allowTouchCallbacks","isScrolling","startMoving","touchStartTime","updateSize","swipeDirection","threshold","allowThresholdMove","formElements","shouldPreventDefault","allowTouchMove","touchStartPreventDefault","touchStartForcePreventDefault","isContentEditable","onTouchMove","rtl","rtlTranslate","targetTouch","preventedByNestedSwiper","touchReleaseOnEdges","loop","isVertical","translate","maxTranslate","minTranslate","touchAngle","diffX","diffY","isHorizontal","atan2","cssMode","touchMoveStopPropagation","nested","loopFix","startTranslate","getTranslate","setTransition","allowMomentumBounce","grabCursor","allowSlideNext","allowSlidePrev","setGrabCursor","touchRatio","currentTranslate","disableParentSwiper","resistanceRatio","resistance","followFinger","freeMode","watchSlidesProgress","watchSlidesVisibility","updateActiveIndex","updateSlidesClasses","velocities","updateProgress","setTranslate","onTouchEnd","slidesGrid","snapGrid","currentPos","touchEndTime","timeDiff","updateClickedSlide","lastClickTime","slideTo","activeIndex","slides","freeModeMomentum","lastMoveEvent","velocityEvent","velocity","freeModeMinimumVelocity","freeModeMomentumVelocityRatio","momentumDuration","freeModeMomentumRatio","momentumDistance","newPosition","afterBouncePosition","needsLoopFix","doBounce","bounceAmount","freeModeMomentumBounceRatio","freeModeMomentumBounce","centeredSlides","freeModeSticky","nextSlide","moveDistance","currentSlideSize","slidesSizesGrid","slideToClosest","transitionStart","longSwipesMs","stopIndex","groupSize","slidesPerGroupSkip","slidesPerGroup","_increment","increment","longSwipes","longSwipesRatio","shortSwipes","navigation","nextEl","prevEl","onResize","breakpoints","setBreakpoint","updateSlides","slidesPerView","isEnd","isBeginning","autoplay","running","paused","watchOverflow","checkOverflow","onClick","preventClicks","preventClicksPropagation","onScroll","previousTranslate","scrollWidth","translatesDiff","dummyEventAttached","dummyEventListener","initialSlide","updateOnWindowResize","autoHeight","setWrapperSize","virtualTranslate","effect","breakpointsBase","spaceBetween","slidesPerColumn","slidesPerColumnFill","centeredSlidesBounds","slidesOffsetBefore","slidesOffsetAfter","normalizeSlideIndex","centerInsufficientSlides","roundLengths","simulateTouch","uniqueNavElements","slideToClickedSlide","preloadImages","updateOnImagesReady","loopAdditionalSlides","loopedSlides","loopFillGroupWithBlank","loopPreventsSlide","passiveListeners","containerModifierClass","slideClass","slideBlankClass","slideActiveClass","slideDuplicateActiveClass","slideVisibleClass","slideDuplicateClass","slideNextClass","slideDuplicateNextClass","slidePrevClass","slideDuplicatePrevClass","wrapperClass","runCallbacksOnInit","_emitClasses","_defineProperties","descriptor","prototypes","modular","useParams","instanceParams","modules","moduleName","useModules","modulesParams","moduleParams","moduleEventName","eventsEmitter","priority","eventsListeners","onceHandler","__emitterProxy","onAny","eventsAnyListeners","offAny","eventHandler","eventsArray","update","clientWidth","clientHeight","getDirectionLabel","property","getDirectionPropertyValue","label","swiperSize","wrongRTL","isVirtual","virtual","previousSlidesLength","slidesLength","offsetBefore","offsetAfter","previousSnapGridLength","previousSlidesGridLength","slidePosition","prevSlideSize","slidesNumberEvenToRows","slideSize","virtualSize","marginTop","marginRight","marginBottom","floor","newSlidesGrid","_$wrapperEl$css","_$wrapperEl$css2","slidesPerRow","numFullColumns","newSlideOrderIndex","column","groupIndex","slideIndexInGroup","columnsInGroup","slideStyles","currentTransform","currentWebKitTransform","webkitTransform","paddingLeft","paddingRight","boxSizing","_slide$","swiperSlideSize","slidesGridItem","_i2","_slidesGridItem","_slides$filter$css","slideIndex","allSlidesSize","slideSizeValue","maxSnap","snap","_allSlidesSize","allSlidesOffset","snapIndex","updateSlidesOffset","updateAutoHeight","activeSlides","getSlideByIndex","visibleSlides","swiperSlideOffset","offsetLeft","updateSlidesProgress","offsetCenter","visibleSlidesIndexes","slideProgress","slideBefore","slideAfter","multiplier","wasBeginning","wasEnd","activeSlide","realIndex","prevSlide","emitSlidesClasses","newActiveIndex","previousIndex","previousRealIndex","previousSnapIndex","slideFound","clickedSlide","clickedIndex","matrix","curTransform","transformMatrix","curStyle","currentStyle","WebKitCSSMatrix","MozTransform","OTransform","MsTransform","msTransform","m41","m42","byController","translateTo","runCallbacks","translateBounds","internal","newTranslate","_wrapperEl$scrollTo","isH","behavior","onTranslateToWrapperTransitionEnd","indexAsNumber","normalizedTranslate","normalizedGird","normalizedGridNext","onSlideToWrapperTransitionEnd","slideToLoop","newIndex","slideNext","_clientLeft","slidePrev","prevIndex","normalizedSnapGrid","prevSnap","slideReset","currentSnap","slidesPerViewDynamic","slideToIndex","loopCreate","blankSlidesNum","blankNode","prependSlides","appendSlides","loopDestroy","moving","isLocked","cursor","unsetGrabCursor","manipulation","appendSlide","prependSlide","addSlide","activeIndexBuffer","baseLength","slidesBuffer","currentSlide","removeSlide","slidesIndexes","indexToRemove","removeAllSlides","attachEvents","touchEvents","passive","cancel","detachEvents","_swiper$loopedSlides","breakpoint","getBreakpoint","currentBreakpoint","breakpointOnlyParams","paramValue","breakpointParams","originalParams","wasMultiRow","isMultiRow","wasEnabled","emitContainerClasses","directionChanged","needsReLoop","changeDirection","isEnabled","enable","containerEl","currentWidth","currentHeight","innerHeight","point","minRatio","_points$i","wasLocked","lastSlidePosition","addClasses","resultClasses","suffixes","removeClasses","images","loadImage","imageEl","srcset","sizes","checkForComplete","onReady","imagesLoaded","imagesToLoad","currentSrc","extendedDefaults","Swiper","swipers","newParams","moduleParamName","desktop","swiperParams","passedParams","eventName","touchEventsTouch","touchEventsDesktop","clickTimeout","Constructor","staticProps","_proto","setProgress","getSlideClasses","slideEl","updates","spv","breakLoop","translateValue","newDirection","needUpdate","currentDirection","mount","mounted","getWrapper","wrapper","deleteInstance","cleanStyles","deleteProps","extendDefaults","newDefaults","installModule","use","prototypeGroup","protoMethod","Navigation","toggleEl","disabledClass","_swiper$navigation","$nextEl","$prevEl","lockClass","onPrevClick","onNextClick","_swiper$navigation2","hideOnClick","hiddenClass","toEdge","fromEdge","_swiper$navigation3","_swiper$navigation4","targetEl","pagination","clickable","isHidden","Pagination","total","paginationType","bullets","firstIndex","midIndex","dynamicBullets","bulletSize","dynamicMainBullets","dynamicBulletIndex","bulletActiveClass","$bullet","bulletIndex","$firstDisplayedBullet","$lastDisplayedBullet","dynamicBulletsLength","bulletsOffset","currentClass","formatFractionCurrent","totalClass","formatFractionTotal","progressbarDirection","progressbarOpposite","scaleX","scaleY","progressbarFillClass","renderCustom","render","paginationHTML","numberOfBullets","renderBullet","bulletClass","bulletElement","renderFraction","renderProgressbar","clickableClass","modifierClass","progressbarOppositeClass","number","activeIndexChange","snapIndexChange","slidesLengthChange","snapGridLengthChange","Autoplay","$activeSlideEl","autoplayResult","reverseDirection","stopOnLastSlide","pause","waitForTransition","onTransitionEnd","onVisibilityChange","visibilityState","onMouseEnter","disableOnInteraction","onMouseLeave","attachMouseEvents","pauseOnMouseEnter","detachMouseEvents","beforeTransitionStart","sliderFirstMove","touchEnd","Fade","$slideEl","tx","ty","slideOpacity","fadeEffect","crossFade","eventTriggered","triggerEvents","beforeInit","overwriteParams","Controller","LinearSpline","maxIndex","minIndex","guess","i1","i3","interpolate","x2","binarySearch","getInterpolateFunction","controller","spline","_setTranslate","controlledTranslate","controlled","control","setControlledTranslate","by","inverse","setControlledTransition","Thumbs","thumbsParams","thumbs","SwiperClass","swiperCreated","thumbsContainerClass","onThumbClick","thumbsSwiper","slideThumbActiveClass","currentIndex","autoScrollOffset","useOffset","newThumbsIndex","currentThumbsIndex","prevThumbsIndex","nextThumbsIndex","thumbsToActivate","thumbActiveClass","multipleActiveThumbs","slideChange","beforeDestroy","Keyboard","kc","pageUpDown","keyboard","isPageUp","isPageDown","isArrowLeft","isArrowRight","isArrowUp","isArrowDown","onlyInViewport","inView","swiperWidth","swiperHeight","windowWidth","windowHeight","swiperOffset","swiperCoord","Mousewheel","lastScrollTime","lastEventBeforeSnap","recentWheelEvents","isEventSupported","sX","sY","pX","pY","wheelDelta","wheelDeltaY","wheelDeltaX","HORIZONTAL_AXIS","deltaY","deltaX","deltaMode","spinX","spinY","pixelX","pixelY","handleMouseEnter","mouseEntered","handleMouseLeave","mousewheel","eventsTarget","releaseOnEdges","rtlFactor","forceToAxis","positions","sensitivity","_newEvent","sign","ignoreWheelEvents","_recentWheelEvents","_prevEvent","firstEvent","snapToThreshold","autoplayDisableOnInteraction","newEvent","prevEvent","animateSlider","releaseScroll","thresholdDelta","thresholdTime","getTime","extendStatics","__extends","__","__awaiter","thisArg","_arguments","P","generator","fulfilled","rejected","__generator","sent","trys","ops","verb","op","__values","__read","ar","SuppressedError","Percent","_value","getType","castString","toBoolean","toNumber","hasValue","isNumber","converted","isString","toText","getValueDefault","isDate","HALFPI","RADIANS","DEGREES","toNumberRange","fitToRange","rounded","minValue","maxValue","sin","intersect","range1","range2","start1","start2","end1","end2","getDistance","point1","point2","getCubicCurveDistance","controlPointA","controlPointB","stepCount","prevPoint","getPointOnCubicCurve","getScale","startPoint1","startPoint2","initialDistance","currentDistance","getMidPoint","getAngle","normalizeAngle","getBBox","length_1","top_1","getCommonRectangle","rectangles","rectangle","pointA","pointB","mt1","mt2","mt3","getCubicControlPointA","p0","p1","p2","p3","tensionX","tensionY","adjustTension","getCubicControlPointB","tension","getArcRect","startAngle","endAngle","radius","MAX_VALUE","bpoints","getArcPoint","fromAngle","toAngle","arc","any","output","eachContinue","toIndex","removeIndex","insertIndex","getSortedIndex","ordering","pivot","findIndex","keepIf","keep","Disposer","dispose","_disposed","_dispose","isDisposed","_super","MultiDisposer","disposers","MutableValueDisposer","_disposer","disposer","CounterDisposer","_counter","pendingFrame","nextQueue","readQueue","writeQueue","idleQueue","raf","frameLoop","pendFrame","writeFrame","EventDispatcher","_listeners","_killed","_disabled","_iterating","_enabled","hasListeners","hasListenersByType","killed","enableType","disableType","amount","_removeListener","_removeExistingListener","_eachListener","info","_shouldDispatch","dispatchImmediately","_on","shouldClone","onAll","copyFrom","TargetedEventDispatcher","hasKey","eachOrdered","keysOrdered","object1","object2","copyProperties","copyAllProperties","from","fromArray","iter","indexed","ListIterator","createNewItems","_create","_listCopy","clear","getFirst","returnItem","getLast","removeItem","repeat","DictionaryDisposer","dict","oldValue","Dictionary","_dictionary","getKey","insertKey","newValue","setKey","updateKey","removeKey","insertKeyIfEmpty","ifEmpty","_a","_b","_c","sortedIterator","DictionaryTemplate","template","_template","isTemplate","Cache","_storage","ttl","ownerStorage","cacheItem","touched","expired","Registry","themes","loadedThemes","_uidCount","registeredClasses","_placeholders","invalidSprites","invalidDatas","invalidRawDatas","invalidDataItems","invalidDataRange","invalidPositions","invalidLayouts","baseSprites","baseSpritesByUid","getUniqueId","noBase","sprite","svg","paper","_map","setCache","getCache","getPlaceholder","choice","addToInvalidComponents","component","baseId","removeFromInvalidComponents","addToInvalidSprites","removeFromInvalidSprites","addToInvalidPositions","removeFromInvalidPositions","addToInvalidLayouts","removeFromInvalidLayouts","IndexedIterable","_array","_start","_end","backwards","ListDisposer","ListGrouper","_getKey","_insert","_remove","_keys","_groups","_sort","index_1","push2","disposeOnRemove","disposer_1","checkBounds","List","_values","removeValue","hasIndex","getIndex","setIndex","_sortQuicksort","low","_sortPartition","value_a","value_b","moveValue","pushAll","setAll","newArray","oldArray","ListTemplate","make","out","OrderedList","findClosestIndex","closestValue","closestDifference","closestIndex","difference","SortedList","_ordering","OrderedListTemplate","SortedListTemplate","globalAdapter","GlobalAdapter","_callbackId","_callbacks","addAll","applyAll","callbacks","Adapter","enableKey","disableKey","_hasListenersByType","namedColors","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","blanchedalmond","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","darkblue","darkcyan","darkgoldenrod","darkgray","darkgrey","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","limegreen","linen","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","whitesmoke","yellowgreen","pad2","rgb1","rgb2","getLightnessStep","hslToRgb","hue2rgb","q","rgbToHsl","Color","rgb","_lightColor","_darkColor","rgba","hex","lighten","brighten","saturate","saturation","hsl","darkColor","lightColor","cacheId","hexToRgbWithAlpha","hexToRgb","rgbaToRgb","toColor","isColor","castColor","BaseObject","_disposers","_uid","_delayedMap","addDelayedMap","delayedMap","processDelayedMap","target_1","applyTheme","getCurrentThemes","theme","_themes","clearCache","clonedFrom","clones","addDisposer","removeDispose","cloneId","newObject","_clones","_className","setInterval","processConfig","raiseCriticalError","configKey","item_1","configValue","hasProperty","asIs","createClassInstance","processAdapters","processEvents","parent_1","asFunction","processListTemplate","processOrderedTemplate","templateValue","entryKey","entryValue","listItem","processDictionaryTemplate","processList","maybeColorOrPercent","processDictionary","isReserved","configOrder","processingErrors","errors","_processingErrors","entry","getConfigEntryType","itemCount","extraCount","createEntryInstance","BaseObjectEvents","_eventDispatcher","STRING","NUMBER","DATE","DURATION","PLACEHOLDER","PLACEHOLDER2","stripHash","getBaseURI","vendor","baseURI","loc","isNotEmpty","relativeToValue","full","escapeForRgex","splitTextByCharCount","maxChars","fullWords","fullWordFallback","words","word","wordLength","reverseString","truncateWithEllipsis","ellipsis","str","padString","char","cleanFormat","format","stripTags","plainText","anyToDate","date","anyToNumber","getYearDay","utc","getFullYear","getTimezoneOffset","getWeek","_utc","UTC","getMonth","getDate","day","getUTCDay","setUTCDate","getUTCDate","firstDay","getUTCFullYear","getMonthWeek","firstWeek","currentWeek","get12Hours","hours","getTimeZone","long","savings","wotz","toLocaleString","wtz","timeZoneName","fitNumber","fitNumberRelative","svgPointToSprite","sprites","sprite_1","rotation","relativeX","relativeY","ey","group","pixelPaddingLeft","pixelPaddingTop","spritePointToSvg","spritePointToSprite","toSprite","spriteRectToSvg","documentPointToSvg","svgContainer","cssScale","bbox","documentPointToSprite","htmlContainer","spritePointToDocument","svgPointToDocument","urlRegexp","parseUrl","separator","authority","port","serializeUrl","isRelativeUrl","joinUrl","parsedLeft","parsedRight","leftPath","rightPath","polyIn","polyOut","polyInOut","polyOut3","cubicIn","cubicOut","b0","bounceOut","asin","SpriteState","transitionEasing","propertyFields","_adapterO","ev","propertyName","fieldName","dataItem","dataContext","spriteValue","adapter","_x","SpriteEventDispatcher","_interactionEvents","_dispatchSpriteEvent","imev","_dispatchSpritePointEvent","spritePoint","svgPoint","getSvgPoint","_addInteractionObjectEvent","interactions","togglable","draggable","trackable","resizable","swipeable","wheelable","hoverable","focusable","SVGDefaults","strokeWidth","fill","stroke","verbose","commercialLicense","classNamePrefix","autoSetClassName","minPolylineStep","onlyShowOnViewport","autoDispose","licenses","suppressErrors","suppressWarnings","animationsEnabled","deferredDelay","disableHoverOnTransform","pixelPerfectPrecision","getProgressNumber","getProgressPercent","getProgressColor","getHybridProperty","rootStylesheet","AnimationDisposer","animationOptions","_loop","_pause","_delayTimeout","_time","_isFinished","animations","id_1","stopSameAnimations","staticOptions","options_1","childObject","updateMethod","convertedFrom","applyStaticOptions","event_1","resume","event_2","kill","isFinished","skipEvent","event_3","event_4","timeProgress","delayed","killed_1","newOptions","oldOptions","SVGNS","XLINK","currentClassName","setStyle","getShadowRoot","StyleRule","sheet","getStylesheet","cssRules","_rule","deleteRule","insertRule","appendStylesheet","selectorText","_setVendorPrefixName","styleId","findFont","parentElement","findFontSize","parent_2","StyleClass","AMElement","_isDisposed","_y","_rotationY","_rotationX","_rotation","_scale","removeNode","_transformString","transfromString","rotateString","svgbbox","moveTo","attribute","attributeName","attributeValue","getAttr","attrNS","getAttrNS","removeStyle","getStyle","addStyle","setClass","removeChildNodes","Group","elementName","addToBack","removeElement","hasChild","removeChildren","childNode","removeChildrenByTag","InterfaceColorSet","_purposes","primaryButton","primaryButtonHover","primaryButtonDown","primaryButtonActive","primaryButtonText","primaryButtonStroke","secondaryButton","secondaryButtonHover","secondaryButtonDown","secondaryButtonActive","secondaryButtonText","secondaryButtonStroke","grid","background","alternativeBackground","alternativeText","disabledBackground","positive","negative","getFor","purpose","setFor","rules","InteractionObjectEventDispatcher","_domEvents","_addDOMEvent","callback_1","_dispatchKeyboardEvent","InteractionObject","eventDisposers","replacedStyles","_clickable","_contextMenuDisabled","_hoverable","_trackable","_draggable","_swipeable","_resizable","_wheelable","_inert","_isHover","isRealHover","_isHoverByTouch","_isDown","_isFocused","_isTouchProtected","_inertiaOptions","inertias","_hitOptions","_hoverOptions","_swipeOptions","_keyboardOptions","_mouseOptions","_cursorOptions","_element","isHover","getInteraction","overObjects","isHoverByTouch","_overPointers","isDown","downObjects","_downPointers","isFocused","focusedObject","unprepElement","prepElement","processClickable","processContextMenu","processHoverable","processTrackable","processDraggable","processSwipeable","processResizable","processWheelable","_focusable","_tabindex","processFocusable","_originalPosition","_originalScale","_originalAngle","inertiaOptions","hitOptions","hoverOptions","swipeOptions","keyboardOptions","cursorOptions","contextMenuDisabled","applyCursorOverStyle","setEventDisposer","interaction","trackedObjects","transformedObjects","unlockWheel","InteractionKeyboardObject","io","directionX","directionY","keyboardEvent","_startedOn","processDragStart","getKeyboardOption","accelleration","accellerationDelay","ms","accelleratedMs","accellerationFactor","handleTransformMove","processDragStop","Inertia","startPoint","handleMove","getEventKey","isKey","eventKey","setTimezone","timezone","timeZone","Interaction","_globalEventsAdded","_pointerEvents","_usePointerEventsOnly","_useTouchEventsOnly","_addHoverEvents","_passiveSupported","_delayedEvents","pointers","mouseOptions","pointerdown","pointerup","pointermove","pointercancel","pointerover","pointerout","fullFF","wheel","onmousewheel","passiveSupported","addGlobalEvents","handleGlobalPointerDown","handleGlobalPointerMove","handleGlobalPointerUp","handleDocumentLeave","handleGlobalTouchStart","handleGlobalTouchMove","handleGlobalTouchEnd","handleGlobalKeyDown","handleGlobalKeyUp","processTouchable","handlePointerOut","handlePointerOver","processMovable","isGlobalElement","isTouchProtected","handleMouseWheel","lockWheel","handleFocus","handleBlur","handleFocusBlur","handleTouchDown","handlePointerDown","getHitOption","disposerKey","ko","showTooltipOn","pointer","getPointer","getPointerPoint","addBreadCrumb","handleGlobalMove","processDelayed","preventTouchAction","cancelled","handleGlobalUp","resetPointer","handleDown","handleOver","handleOut","mod","getMouseOption","WheelEvent","handleWheel","maybePreventDefault","handleHit","lastHit","lastHitPointer","soft","hoversPaused","shouldCancelHovers","areTransformed","moved","cancelAllHovers","overPointers","handleTrack","force","hasDelayedOut","getHoverOption","keepUntil","delayedEvent","inert","stopInertia","downPointers","applyCursorDownStyle","processResizeStart","sorted","DOCUMENT_POSITION_CONTAINED_BY","DOCUMENT_POSITION_CONTAINS","handleUp","restoreCursorDownStyle","swiped","handleSwipe","handleInertia","processResizeStop","lastEvent","composedPath","swiping","handleTransform","skipCheck","handleMoveInertia","handleResizeInertia","inertia","ref","getTrailPoint","getInertiaOption","factor","lastUpEvent","pointer2","pointer1","originalPosition","singlePoint","nextPointer","pointer1Moved","dragStartEvents","pointer2Moved","handleTransformResize","pointerMoved","dragTarget","getDragPointer","dragStart","lastDownEvent","dragStop","getPointerId","isPointerTouch","lastPointer","Touch","MouseEvent","swipeCanceled","lockDocument","unlockDocument","restoreAllStyles","lockElement","unlockElement","wheelLockEvent","isLocalElement","elementFromPoint","local","setTemporaryStyle","restoreStyle","getSwipeOption","overStyle","downStyle","setGlobalStyle","restoreGlobalStyle","tolerance","minTime","getShift","pointerExists","exists","logTouch","TouchEvent","except","Popup","_elements","_IOs","_content","_title","_classPrefix","_defaultStyles","_showCurtain","_dynamicResize","_verticalAlign","_shift","_tempShift","_readerTitle","_closable","_cssLoaded","_fitTo","_sized","curtain","showCurtain","positionElement","close","releasePointers","forceResize","dynamicResize","_bbox","toStyle","verticalAlign","setupDragging","createContentElement","getClassNames","classPrefix","headerClass","titleClass","contentClass","insideClass","curtainClass","closeClass","disablePointers","defaultStyles","loadDefaultCSS","createCurtainElement","applyEvents","applyReaderSettings","_left","_right","_top","_bottom","fg","bg","abg","closable","_spriteInteractionsEnabled","interactionsEnabled","readerTitle","classPrefixRaw","Modal","messages","Native","_targets","_observer","addTarget","removeTarget","Raf","lastTime_1","loop_1","newSize","_timer","ResizeSensor","_sensor","SVGContainer","htmlElement","ghost","autoResize","nonExportableSprites","_printing","initSensor","resizeSensor","paddingX","borderX","borderLeftWidth","borderRightWidth","paddingY","paddingTop","paddingBottom","borderY","maxHeight","left_1","checkTransform","_container","_modal","openModal","closeModal","modal","_popups","popupTemplate","openPopup","popup","popups","closeAllPopups","_readerAlertElement","readerAlert","readerAlertElement","HTMLElement","Paper","defs","addGroup","groupName","appendDef","foreignObject","supportsForeignObject","ghostPaper","ghostDiv","ghostSvgContainer","Pattern","patternUnits","interfaceColors","backgroundFill","backgroundOpacity","shapeRendering","draw","patternElement","strokeDasharray","rotationX","rotationY","addElement","_paper","_animations","LinearGradient","_stops","validate","x1","y1","y2","gradientElement","gradientStop","addColor","stops","gradientUnits","RadialGradient","cx","cy","fy","_cx","_cy","_fx","_fy","formatter","MouseCursorStyle","grab","grabbing","horizontalResize","verticalResize","notAllowed","Language","_locale","en","_defaultLocale","locale","getLocale","rest","translation","translations","getTranslations","translateAny","setTranslationAny","translateEmpty","translateFunc","translateAll","isDefault","TextFormatter","formatted","texts","unescape","cleanUp","wrapHtml","translateStyleShortcuts","wrapSvg","getSvgElement","styleSvgToHtml","getHtmlElement","chunk","quotedBlocks","noFormatting","chunks","chunks2","i2","chunk2","isImage","getTextFormatter","NumberFormatter","_negativeBase","_numberFormat","_outputFormat","_smallNumberThreshold","_forceLTR","language","_language","intlLocales","Intl","NumberFormat","parseFormat","details","zero","decimals","applyFormat","forceLTR","partFormat","mods","modSpacing","thousands","a_1","applyPrefix","bytePrefixes","a_2","smallNumberThreshold","smallNumberPrefixes","bigNumberPrefixes","ol","toPrecision","exp","toExponential","digits","zeros","exponent","ints","ip","intsr","decs","prefixes","newvalue","applied","invalidateSprite","invalidate","_intlLocales","_bigNumberPrefixes","_smallNumberPrefixes","_bytePrefixes","outputFormat","DateFormatter","_dateFormat","_inputDateFormat","timezoneMinutes","_firstDayOfWeek","months","monthsShort","weekdays","weekdaysShort","capitalize","dateFormat","applyTimezone","DateTimeFormat","timezoneOffset","setMinutes","getMinutes","fullYear","month","weekday","minutes","milliseconds","getUTCMonth","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","getDay","getHours","getSeconds","year","firstDayOfWeek","tz","tzh","tzm","toISOString","inputDateFormat","parsedIndexes","resValues","indexAdjust","year3","year2","year1","getStringList","monthLong","monthShort","week","yearDay","weekdayLong","weekdayShort","am","hour12Base1","hourBase0","hour12Base0","hourBase1","minute","millisecond","millisecondDigits","zone","iso","regex","resolveMonth","resolveShortMonth","setUTCFullYear","hour","isAm","resolveTimezoneOffset","_timezoneOffset","_timezone","setHours","DurationFormatter","_baseUnit","_unitValues","_unitAliases","baseUnit","durationFormat","getFormat","dirs","absolute","tstamp","toTimeStamp","toTimeUnit","maxUnit","getValueUnit","durationFormats","currentUnit","_durationFormat","_durationFormats","pdfmakePromise","Validatable","_validateDisposer","ExportMenu","closeDelay","closeOnClick","_menuTag","_itemTag","_labelTag","_iconTag","_ignoreNextClose","_items","getMenuItemClass","createMenuElement","drawBranch","menuElement","_currentSelection","moveSelection","branch","level","unsupported","ascendants","createItemElement","icon","createIconElement","createSvgElement","createLabelElement","readerLabel","getReaderLabel","typeClickable","submenu_1","getSubMenu","selectBranch","setFocus","delayUnselectBranch","local_level","menu","submenu","submenuElement","hideBranch","menuTag","itemTag","labelTag","iconTag","hasSubMenu","newPrefix","colorSet","alternative","setBlur","closeTimeout","ascendant","unselectBranch","event_5","event_6","newSelection","getPrevSibling","getNextSibling","getParentItem","getSiblings","showBranch","isBlob","blob_1","blob","reader","FileReader","readAsText","fontFamilySrcRegexp","getCssRules","loadStylesheet","e_2","eachStylesheet","topUrl","rule","CSSRule","IMPORT_RULE","eachStylesheets","iframe","doc_1","styleSheets","Export","_formatOptions","_extraSprites","_validateSprites","dataFieldsOrder","_dynamicDataFields","_removedObjects","_hiddenObjects","_objectsAlreadyHidden","_filePrefix","useWebFonts","useRetina","useSimplifiedExport","timeoutDelay","_exportRunning","_prevHasData","quality","imageFormat","addURL","addColumnNames","indent","useLocale","emptyAs","addBOM","printMethod","formatOptions","_menu","typeSupported","export","_disablePointers","_releasePointers","supported","getFormatOptions","_hasData","print","_getFunction","getImage","getSVG","getPDF","getExcel","getCSV","getHTML","getPrint","handleCustom","showPreloader","hideTimeout","_timeoutTimeout","showTimeout","hideNonExportableSprites","restoreNonExportableSprites","hidePreloader","download","filePrefix","callbackTarget","getFontFamilies","DOMURL","blobs","getDOMURL","FONT_FACE_RULE","cssText_1","urls","fullUrl","url_1","e_3","webFontFilter","msSaveOrOpenBlob","createObjectURL","readAsDataURL","includeExtras","prehidden","canvas","newCanvas","e_4","awaitValidSprites","simplifiedImageExport","getCanvas","addExtras","disposeCanvas","toDataURL","getContentType","getImageAdvanced","advanced","middleLeft_1","middleTop_1","middleWidth_1","middleHeight_1","extraRight_1","extraBottom_1","extras","ctx_1","right_1","bottom_1","extraSprites","extraSprite","extraCanvas","extraWidth","extraHeight","Sprite","exporting","getCanvasAdvanced","crop","getDisposableCanvas","getContext","findBackgroundColor","fillStyle","fillRect","drawImage","pixelRatio","ctx","img","pixelWidth","pixelHeight","getPixelRatio","getAdjustedScale","fonts","imagesToDataURI","prepForeignObjects","normalizeSVG","serializeElement","Blob","loadNewImage","revokeObjectURL","restoreRemovedObjects","canvg","useCORS","ignoreDimensions","scaleWidth","scaleHeight","fromString","devicePixelRatio","widthScale","heightScale","adjWidth","adjHeight","minHeight","svgToDataURI","imageToDataURI","objects","temporarilyRemoveObject","keepTainted","btoa","placeholder","crossOrigin","currentHref","URL","webkitURL","encodeURI","dimParams","styleParams","fos","addFont","paths","normal","vfs","bytes","bold","italics","bolditalics","pdfmake","defaultMargins","extraMargin","_d","pageSize","pageOrientation","pageMargins","defaultStyle","alignment","fit","getPageSizeFit","addData","getPDFData","extraFonts","createPdf","getDataUrl","dataFields","dataFieldsOrder_1","dataRow","dataValue","convertToSpecialFormat","getPDFDataRow","bi","headerRows","convertEmptyValue","margins","newMargins","fitSize","A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","A10","B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","B10","C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","C10","RA0","RA1","RA2","RA3","RA4","SRA0","SRA1","SRA2","SRA3","SRA4","EXECUTIVE","FOLIO","LEGAL","LETTER","TABLOID","XLSX","wbOptions","sheetName","wb","dataFieldsOrder_2","xlsx","bookType","bookSST","normalizeExcelSheetName","SheetNames","Sheets","getExcelRow","utils","aoa_to_sheet","workbook","write","csv","br","dataFieldsOrder_3","getCSVRow","forceQuotes","dataFieldsOrder_4","tableClass","getHTMLRow","headerRow","rowClass","useTag","cellClass","sourceData","_loop_1","newValue_1","keepOriginal","isDateField","isDurationField","durationFormatter","isNumberField","numberFormat","numberFormatter","useTimestamps","dateFormatter","fileName","link_1","decoded","blob_2","url_2","url_3","link","idoc","msBlobDownloadSupport","msSaveBlob","atob","blobDownloadSupport","linkDownloadSupport","legacyIE","showModal","execCommand","downloadSupport","printViaCSS","printViaIframe","originalTitle","clipPath","MSStream","contentWindow","currentColor","_sprite","validateSprites","_dataFields","generateDataFields","handleDataUpdated","_dateFormatter","_dateFields","dateFields","_numberFormatter","_numberFields","numberFields","_durationFormatter","_durationFields","durationFields","_backgroundColor","preloader","hideModal","_canvg","vfs_fonts","pdfMake","_pdfmake","_xlsx","setFormatOptions","isHiding","invalid","visualProperties","_bindings","_isTemplate","_isPath","_inited","_ready","_isHidden","isShowing","isStandaloneInstance","_isActive","_mask","_positionPrecision","_exporting","_exportable","positionInvalid","applyOnClones","_measuredWidthSelf","_measuredHeightSelf","maxLeft","maxRight","maxTop","maxBottom","maxLeftSelf","maxRightSelf","maxTopSelf","maxBottomSelf","_isDragged","_isResized","_internalDisabled","_updateDisabled","_internalDefaultsApplied","rollOutDelay","isBaseSprite","appeared","dragWhileResize","measureFailed","preventShow","cloneTooltip","setPropertyValue","_prevMeasuredWidth","_prevMeasuredHeight","_measuredWidth","_measuredHeight","_isMeasured","setClassName","applyInternalDefaults","__disabled","beforeDraw","afterDraw","invalidatePosition","validatePosition","removeSVGAttribute","sizeChanged","prevGroupTransform","transformString","nonScaling","globalScale","updateTooltipPosition","maskRectangle","_maskRectangle","_clipElement","e_1","isMeasured","horizontalCenter","verticalCenter","measureElement","e_1_1","return","applyFilters","showOnInit","applyMask","dispatchReady","hideTooltip","showTooltip","reinit","setState","defaultState","handleGlobalScale","nonScalingStroke","updateFilterScale","removeFromInvalids","states","plugins","configField","virtualParent","exportable","_tooltip","tooltip","_showSystemTooltip","showSystemTooltip","fillModifier","strokeModifier","focusFilter","_svgContainer","_interactionDisposer","_urlDisposer","_focusFilter","_filters","_alwaysShowDisposers","applyAccessibility","_topParent","topParent","oldParent","_tooltipContainer","tooltipContainer","_dataItem","handleAlwaysShowTooltip","handleAlwaysShow","oldDisposers","oldDisposer","_virtualParent","appendDefs","filterElement","fill_1","modify","stroke_1","_clipPath","setPaper","_htmlContainer","parent_3","_titleElement","_descriptionElement","setSVGAttributes","strokeDashoffset","strokeLinecap","strokeLinejoin","role","setSVGAttribute","userClassName","uidAttr","updateClipPath","mask","createClipPath","width_1","height_1","filterUnits","appendPrimitives","removeClipPath","setElement","SVGPathElement","definedBBox","svgBBox","updateCenter","prevElementTransform","elementX","elementY","elementWidth","elementHeigth","pixelPaddingRight","pixelPaddingBottom","measuredWidth","measuredHeight","pixelPerfect","positionPrecision","createSVGMatrix","createSVGPoint","p4","pt1","matrixTransform","pt2","pt3","pt4","tooltipText","tooltipHTML","sortChildren","getRelativeX","getRelativeY","getPixelX","pixel","getPixelY","isDragged","inited","hitTest","ax1","ay1","ax2","ay2","bx1","by1","bx2","by2","_states","processState","hiddenState","setVisibility","isActive","transitTo","applyCurrentState","allValues","newFilters_1","stateFilter","newFilter","currentFilter","isInTransition","isInteractive","setActive","setDisabled","deepInvalidate","_background","populateString","tags","getTagValue","reg2","matches2","getTagValueFromObject","populateStringFrom","formatApplied","numberValue","dateValue","durationValue","formatParts","formatterType","hints","setDataItem","dataContext_1","dataContext_2","dataContext2_1","fieldValue","setColorProperty","setPercentProperty","isPercent","length_2","bindToProperty","modifier","description","readerDescription","readerHidden","readerChecked","controls","readerControls","live","readerLive","orientation","readerOrientation","valueNow","readerValueNow","valueText","readerValueText","labelledByIds","describedByIds","labelledBy","readerLabelledBy","describedBy","readerDescribedBy","titleElement","titleId","descriptionElement","descriptionId","_interaction","hasFocused","focusedElement","hoverOnFocus","applyCursorStyle","handleDragStart","handleDragMove","handleDragStop","_outTimeout","targetSprite","keepTargetHover","handleOutReal","originalAngle","originalScale","handleToggle","urlHandler","cursorOverStyle","_baseId","setBaseId","baseSprite","urlTarget","handleResize","svgMidPoint","parentPoint1","parentPoint2","spriteMidPoint","parentPoint","getExporting","_export","modalPrefix","invalidateLayout","parentWidth","layout","pixelMarginLeft","pixelMarginRight","setMaxWidth","prevWidth","prevHeight","relativeWidth","previousWidth","previousHeight","parentHeight","valign","pixelMarginTop","pixelMarginBottom","setMaxHeight","relativeHeight","percentWidth","_pixelWidth","percentHeight","_relativeHeight","_pixelHeight","_relativeWidth","setPath","setFill","realFill","setStroke","realStroke","_rtl","showReal","_hideAnimation","_showHideDisposer","hideReal","currentSprite","hiddenState_1","getVisibility","toFront","toBack","_tooltipDataItem","_tooltipColorSource","tooltipPosition","tooltipDataItem","colorSource_1","tooltipColorSource_1","tooltipColorSource","getStrokeFromObject","getFillFromObject","animationDuration","autoTextColor","currentText","globalPoint","getTooltipX","getTooltipY","pointTooltipTo","instantly","showInViewport","pointTo","getCursorStyle","cursorDowntyle","setShowOnInit","_showOnInitDisposer","hideInitially","appear","_plugins","_systemUpdate","skippedSprites","_systemCheckIfValidate","_systemValidatePositions","_systemValidateLayouts","Rectangle","Container","_childrenByLayout","_childrenDisposers","setStateOnSprites","layoutInvalid","_absoluteWidth","_absoluteHeight","_shouldBeReady","_tapToActivate","tapTimeout","handleChildAdded","handleChildRemoved","processChild","handleChildTransform","sortAndAdd","addChildren","_children","fixed_1","relative_1","calculateRelativeSize","totalRelativeWidth","totalRelativeHeight","zindexed","sortArray","group_1","isCorrect","createChild","classType","disposeChildren","createBackground","processBackground","validateLayout","_availableWidth","_availableHeight","allValid","childMeasuredWidth","childMeasuredHeight","arrange","maxCellWidth","minCellWidth","contentLeft","contentRight","contentTop","contentBottom","nextX","nextY","columnWidth","rowHeight","childrenCopy","reverseOrder","fixedWidthGrid","maxColumns","getColumnWidth","childMarginLeft","childMarginRight","childMarginTop","childMarginBottom","childWidth","childHeight","childLeft","childRight","childTop","childBottom","nextColumnWidth","noneBBox","measuredContentWidth","measuredContentHeight","contentAlign","contentValign","dx_1","dy_1","mwa","mha","ddx","ddy","oldBBox","contentWidth","contentHeight","prevLeft","prevTop","prevBotttom","prevRight","dummyData","updateBackground","fitsToBounds","setStateOnChildren","_preloader","changed","invalidateLabels","handleValidate","stateName","allReady_1","dataInvalid","setTapToActivate","handleTapToActivate","initTapTimeout","handleTapToActivateDeactivation","_tapToActivateTimeout","tapToActivate","moveHtmlContainer","newContainer","svgDiv","hasLicense","System","_isPaused","dummyCounter","_frameRequested","updateStepDuration","reportTime","invalidData","dataProvider","validateData","dataValidationProgress","validateRawData","validateDataItems","validateDataRange","skipRangeEvent","validateLayouts","validatePositions","hasSkipped","checkIfValidate2","triggerIdle","requestFrame","all0_1","softInvalidate","hardInvalidate","VERSION","DataParser","maybeToNumber","maybeToDate","maybeToEmpty","separators","CSVParser","delimiter","skipRows","skipEmpty","useColumnNames","isCSV","getDelimiterFromData","sep","columns","lineColums","CSVToArray","numbers","parsableNumbers","dates","parsableDates","cols","dataPoint","objPattern","arrData","arrMatches","strMatchedDelimiter","strMatchedValue","JSONParser","isJSON","dataLoader","DataLoader","requestOptions","getParserByType","parser","getParserByData","DataSource","_requestOptions","_incremental","_incrementalParams","_keepCount","_updateCurrentData","lastLoad","disableCache","timestampUrl","_url","incremental","addUrlParams","incrementalParams","_parser","_reloadFrequency","_reloadDisposer","_reloadTimeout","reloadFrequency","Responsive","_rules","_appliedRules","_appliedTargets","_useDefault","_responsiveDisposers","_noStates","checkRules","_component","disposeResponsiveHandlers","applyRules","defaultRules","useDefault","isApplied","ruleId","allRules","rulesChanged","relevant","_applyRules","_timeout","ind","newTarget","defaultStateApplied","isApplied_1","getState","getDefaultState","setTargetState","stateId","tmpId","ResponsiveBreakpoints","widthXXS","XXS","widthXS","XS","widthS","S","widthM","M","widthL","L","widthXL","XL","widthXXL","XXL","heightXXS","heightXS","heightS","heightM","heightL","heightXL","heightXXL","isXXS","isXS","isS","isM","isL","isXL","isXXL","maybeXXS","maybeXS","maybeS","maybeM","maybeL","maybeXL","maybeXXL","DataItem","hasProperties","categories","locations","workingLocations","_index","_visible","_hidden","_ignoreMinMax","hasChildren","_valueAnimations","_locationAnimations","noChangeValues","fields","animation_1","_hideDisposer","setWorkingValue","toValue","animation_2","getDuration","interpolationDuration","calculated","getWorkingValue","realName","workingValue","getActualWorkingValue","setValue","newDuration","handleDataItemValueChange","setCalculatedValue","handleDataItemCalculatedValueChange","interpolationEasing","handleInterpolationProgress","valueAnimation","handleDataItemWorkingValueChange","setLocation","setWorkingLocation","workingLocation","locationAnimation","handleDataItemWorkingLocationChange","setDate","event_7","handleDataItemPropertyChange","setCategory","event_8","event_9","_dataContext","addSprite","Component","_dataSources","_parseDataFrom","_dataDisposers","_currentDataSetId","rangeChangeDuration","rangeChangeEasing","parsingStepDuration","rawDataInvalid","dataRangeInvalid","dataItemsInvalid","sequencedInterpolation","sequencedInterpolationDelay","_addAllDataItems","_usesData","minZoomCount","maxZoomCount","_dataItems","createDataItem","handleDataItemAdded","handleDataItemRemoved","invalidateData","dataUsers","handleDataUserAdded","maxZoomDeclination","invalidateDataItems","processDataItem","hasSomeValues_1","mainDataSet","rawDataItem","childDataItem","updateDataItem","validateDataElements","endIndex","dataItems","validateDataElement","removeCount","skipRaw","dataItem_1","invalidateDataUsers","invalidateDataRange","_prevStartIndex","_prevEndIndex","rangeChangeUpdate","appendDataItems","sliceData","_workingStartIndex","_workingEndIndex","invalidateRawData","disposeData","_startIndex","_endIndex","_dataSets","getDataItem","counter","this_1","dataUserDataItem","state_1","stacked","setData","getDataSource","setDataSourceEvents","dataSourceDateFields","dataSourceNumberFields","loadData","populateDataSourceFields","targetList","ds","keepCount","updateCurrentData","_responsive","declination","maxZoomFactor","_finalStart","_finalEnd","minZoomFactor","rangeChangeAnimation","zoomToIndexes","indexToPosition","dataSets","setDataSet","_updateDataItemIndexes","bindDataField","invalidateProcessedData","resetProcessedRange","_dataUsers","_exportData","_showOnInitDisposer2","Label","isOversized","textValign","baseLineRatio","handleMaxSize","availableWidth","availableHeight","updateCurrentText","_currentFormat","_prevStatus","getLineBBox","lineInfo","oldW","oldH","textPathElement","resetBBox","currentFormat","ignoreFormatting","currentLineHeight","firstChunk","skipTextChunks","getLineInfo","getSVGLineElement","complex","lineText","avgCharWidth","excessChars","addEllipsis","node_1","node_2","elementText","lastNode","splitLines","lineText_1","restOfLine","addLineInfo","tempElement","lineInfo_1","maybeHideOversized","alignSVGText","hideUnused","fo","lineElement","getHTMLLineElement","setStyles","pathElement","hideOversized","wordWrap","selectable","initLineCache","divs","_sourceDataItemEvents","classid","RoundedRectangle","cornerRadius","minSide","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomRight","cornerRadiusBottomLeft","maxcr","crtl","crtr","crbr","crbl","tl","bl","Button","tooltipY","iconPosition","hoverState","downState","_icon","currentIcon","_label","Circle","pixelRadius","Ellipse","radiusY","widthRatio","heightRatio","Line","positionToPoint","PointedRectangle","cr","stemX","stemY","pointerX","pointerY","bwh","pointerBaseWidth","lineT","lineR","lineB","lineL","d1","d2","arcTR","arcBR","arcBL","arcTL","PointedShape","pointerLength","lineTo","cubicCurveTo","arcTo","segments","pax","pay","ax","ay","arcToPoint","sweepFlag","largeArcFlag","xAxisRotation","Boolean","rectToPath","ccw","Polyline","_distance","makePath","_realSegments","deltaAngle","totalDistance","positionA","positionB","midPoint","Polyarc","controlPointDistance","controlPointPosition","realPoints","distanceAB","cpDistance","controlPoint1","controlPoint2","i_1","Morpher","morphable","_bboxes","morphDuration","morphEasing","morphToSingle","scaleRatio","morphToPolygon","toPoints","currentPoints","sortPoints","_morphFromPointsReal","_morphToPointsReal","normalizePoints","pointsA","pointsB","surfaceA","holeA","bboxA","middleX","middleY","addPoints","splitAt","newDistance","partA","partB","bbox1","bbox2","bboxes","surface","morphToCircle","commonBBox","hole","fromPoints","realRadius","realAngle","pointOnCircle","hlen","mustHaveCount","addToSegmentCount","newPoints","point0","extraPoint","lastPoint","morphToRectangle","realWidth","realHeight","i_2","i_3","_morphProgress","currentArea","surfaceFrom","holeFrom","surfaceTo","holeTo","currentSurface","i_4","slen","currentPoint","currentHole","i_5","morphBack","Polygon","_currentPoints","segment","areaHole","areaArr","holeArr","pointsArr","areaAndHole","coords","pointsArr_1","_morpher","Polyspline","allPoints","closed_1","getClosestPointIndex","f0","f1","point_1","Slice","innerRadius","innerCornerRadius","crSin","innerRadiusY","cornerRadiusY","innerCornerRadiusY","crAngle","crAngleY","crInnerAngle","crInnerAngleY","middleAngle","mPoint","a0","c0","d0","b1","pixelInnerRadius","shiftRadius","updateGradient","gradient","ix","iy","Preloader","sliceContainer","backgroundSlice","progressSlice","_started","ResizeButton","CloseButton","bgc","downColor","bhs","bds","SwitchButton","leftLabel","circle","p100","as","switchButton","rightLabel","_leftLabel","_rightLabel","_switchButton","Scrollbar","_previousStart","_previousEnd","_prevStart","_prevEnd","_isBusy","_skipRangeEvents","updateWhileMoving","animationEasing","startGrip","endGrip","updateThumb","thumb","dispatchRangeChange","hideGrips","updateExtremes","handleBgHit","makeBusy","thumbX","_thumbAnimation","thumbY","makeUnbusy","_thumb","_unbusyTimeout","stopAnimations","_zoomAnimation","makeUnbusyReal","_usingGrip","dispatchEvents","fromValue","directionFlipped","flipped","fromName","toName","innerWidth_1","innerHeight_1","getPosition","__start","__end","skipRangeEvents","fixRange","updateByOrientation","_startGrip","processGrip","_endGrip","handleGripDrag","cursorDownStyle","handleThumbPosition","handleDoubleClick","newStart","newEnd","zoomAnimation","innerWidth_2","innerHeight_2","_hideGrips","_overDisposer","_outDisposer","Slider","TextLink","Filter","_nonScaling","filterPrimitives","filterPrimitive","updateScale","setSprite","DropShadowFilter","feGaussianBlur","feOffset","feFlood","feComposite","feMerge","Tooltip","_boundingRect","_pointTo","fitPointerToBounds","_verticalOrientation","fixDoc","dropShadow","drawBackground","pointerOrientation","handleVisibility","textX","textY","boundingRect","textW","textH","ignoreBounds","documentWidth","textWidth","textHeight","bgWidth","bgX","bgHeight","bgY","boundX1","boundX2","boundY1","boundY2","delayedPointTo","_pointToDisposer","_animation","setBounds","oldRect","_boundingContainer","updateBounds","boundingContainer","Trapezoid","topSide","bottomSide","leftSide","rightSide","bs","rs","x0","y0","x3","y3","mt","mr","mb","ml","horizontalNeck","hn","verticalNeck","vn","Triangle","Tension","_tensionX","_tensionY","smooth","minStep","wavedLine","waveLength","waveHeight","adjustWaveLength","waveLengthX","waveLengthY","halfWaveCount","sign_1","Monotone","reversed","_reversed","_closed","_curve","t0","t1","NaN","slope2","slope3","h0","h1","s0","s1","WavedCircle","getPoints","circleLength","halfWaveHeight","halfWaveLength","angle1","angle2","WavedLine","WavedRectangle","waveLengthH","waveHeightH","waveLengthV","waveHeightV","rd","bd","ld","wavedTop","wavedRight","wavedBottom","wavedLeft","setWavedSides","ZoomOutButton","PlayButton","playIcon","stopIcon","activeState","ColorModifier","GradientModifier","lightnesses","brightnesses","opacities","offsets","_lightnesses","_brightnesses","_opacities","_offsets","lightness","brightness","LinearGradientModifier","Cone","topRadius","bodyFillModifier","radiusBase","LightenFilter","feColorMatrix","Rectangle3D","sideBack","sideBottom","sideLeft","sideRight","sideTop","sideFront","ah","bh","dh","colorStr","filter2","filter3","filter4","filter5","Slice3D","edge","sideA","sideB","edgeFill","edgePath","mangle","pp","RadialGradientModifier","LinePattern","CirclePattern","_circle","RectPattern","rectHeight","rectWidth","_rect","ColorizeFilter","intensity","applyFilter","DesaturateFilter","BlurFilter","FocusFilter","feMorphology","feBlend","ColorSet","_list","_currentStep","_currentPass","baseColor","stepOptions","passOptions","minColors","minLightness","maxLightness","shuffle","reuse","generate","getReusableColor","tmpstep","hueStep","hue","hues","applyStepOptions","pass","PatternSet","getLinePattern","getRectPattern","getCirclePattern","thickness","strokeDashArray","outline","currentStep","generatePatterns","Plugin","aColor","aGradient","aStroke","desaturateFilter","desaturateFilterHover","LegendDataItem","childrenCreated","label_1","labels","itemContainer","_valueLabel","valueLabel_1","valueLabels","_itemContainer","component_1","itemContainer_1","itemContainers","toggleDataItem","focusedItem","visibilitychanged","_marker","marker_1","markers","LegendSettings","createMarker","Legend","disabledColor","valueLabel","handleScrollbar","scrollable","updateMasks","_handleWheelReal","scrollbar","legendDataItem","tempMaxWidth","legendSettings","createLegendMarker","useDefaultMarker","updateLegendValue","itemValueText","maxLabelWidth","maxValueLabelWidth","maxMarkerWidth","maxAdjustedLabelWidth","trueMaxWidth","_mouseWheelDisposer","colorOrig","AxisBreak","_axis","breakSize","fillShape","_fillShape","startLine","_startLine","endLine","_endLine","addBreakSprite","renderer","gridContainer","createBreakSprites","breakTemplate","axisBreaks","invalidateSeries","startPosition","endPosition","updateBreakElement","AxisItemLocation","AxisDataItem","_grid","grid_1","isRange","axisRanges","_tick","component_2","tick_1","ticks","component_3","_axisFill","component_4","axisFill_1","axisFill","axisFills","_contents","createFill","_axisBreak","axisBreak","appendChildren","appendDataItem","minPosition","_bullet","Axis","_gridCount","_series","_axisItemCount","hideTooltipWhileZooming","toggleZoomOutButton","zoomable","_dataItemsIterator","series","fillRule","ghostLabel","updateLabelElement","updateGridCount","gridCount","axisLength","minGridDistance","axisFullLength","updateAxisLine","updateTooltip","updateBaseGridElement","_prevLength","initRenderer","above","bulletsContainer","updateGridContainer","validateAxisRanges","axisRange","validateBreaks","_axisBreaks","processBreak","breakContainer","registerSeries","createMask","_renderer","chart","ghostLabel_1","positionToAngle","pointToPosition","positionToCoordinate","getAnyRangePath","getPositionRangePath","anyToPosition","anyToPoint","_tooltipPosition","showTooltipAtPosition","toAxisPosition","tooltipLocation","getCellStartPosition","getCellEndPosition","tooltipLocation2","endPoint","currentItemStartPoint","currentItemEndPoint","fullWidthTooltip","getTooltipText","cursorTooltipEnabled","inversed","toGlobalPosition","boundingRectangle","roundPosition","axisLocation","_axisRanges","processAxisRange","createAxisBreak","adjustedStartValue","processSeriesDataItems","processSeriesDataItem","axisLetter","postProcessSeriesDataItems","postProcessSeriesDataItem","updateAxisBySeries","hideUnusedDataItems","dataItemsIterator","getSeriesDataItem","findNearest","stackKey","getX","getPositionX","getY","getPositionY","dataChangeUpdate","seriesDataChangeUpdate","adjustDifference","startMax","endMin","startValue","endValue","adjustedEndValue","intersection","isInBreak","fixAxisBreaks","firstAxisBreak","previousEndValue_1","getPositionLabel","_chart","createSeriesRange","resetIterators","AxisLine","AxisFill","fillPath","Grid","AxisLabel","Tick","AxisTick","AxisRenderer","cellStartLocation","cellEndLocation","minLabelPosition","maxLabelPosition","invalidateAxisItems","baseGrid","setAxis","processRenderer","positionItem","position2","getHeight","getWidth","coordinateToPosition","coordinate","coordinate2","updateGridElement","updateTickElement","updateBullet","updateFillElement","toggleVisibility","updatedStart","updatedEnd","_axisFills","createGrid","_ticks","createTick","_labels","createLabel","AxisBullet","AxisRendererY","opposite","inversedPosition","relativePositionSprite","bigNum","bbx","bbw","bbh","tickLength","basePoint","wavedRectangle","ValueAxisBreak","valueToPosition","ValueAxisDataItem","ValueAxis","_stepDecimalPlaces","_prevStepDecimalPlaces","_adjustLabelPrecision","_baseValue","_adjustedStart","_adjustedEnd","_extremesChanged","_deltaMinMax","_dsc","calculateTotals","axisFieldName","keepSelection","includeRangesInMinMax","_maxZoomed","_maxDefined","_minZoomed","_minDefined","_maxAdjusted","_minAdjusted","excludeFromTotal","dataItem_2","getMinMax","calculateZoom","validateAxisElements","positionToValue","differece","minMaxStep","adjustMinMax","stepDecimalPlaces","syncWithAxis","_step","fixSmallStep","value_1","minZoomed","logarithmic","LOG10E","maxZoomed","dataItemsIterator_1","precisionChanged","formatLabel","stepPower","decCount","renderer_1","breakValue_1","adjustedMin","adjustedMax","adjustedStep","itemIndex","fillEndPosition","adjustLabelPrecision","baseValue","valueToPoint","min_1","max_1","_difference","treatZeroAs","difference_1","value_2","breakStartPosition","breakEndPosition","breakStartValue","breakEndValue","E","xToValue","yToValue","animateMinMax","POSITIVE_INFINITY","NEGATIVE_INFINITY","ignoreMinMax","seriesMin","seriesMax","_minReal","_maxReal","dif","fixMin","fixMax","power","extraMin","extraMax","strict","strictMinMax","_minMaxAnimation","_finalMax","_finalMin","handleSelectionExtremesChange","_saveMinMax","strictMode","initialMin","initialMax","stepDivisor","maxPrecision","minCount","maxCount","handleExtremesChange","selectionMin","selectionMax","allHidden","outOfRange","seriesSelectionMin","seriesSelectionMax","minMaxStep2","syncAxes","extraTooltipPrecision","valueStr","zoomToValues","axisBreakDif","axisBreakGridCount","breakMinMaxStep","showTooltipAt","currentCount","synced","omin","omax","ostep","checkSync","xAxis","_min","_max","AxisRendererX","bby","HeatLegend","markerContainer","markerCount","getMinFromRules","minValue_1","heatRules","heatRule","getMaxFromRules","maxValue_1","valueAxis","minColor","maxColor","seriesFill","minOpacity","maxOpacity","minStrokeOpacity","maxStrokeOpacity","minStroke","maxStroke","strokeGradient","color_1","opacity_1","_valueAxis","dataField","dataFieldDefined","updateMinMax","seriesId_1","Grip","autoHideDelay","_autoHideTimeout","ChartDataItem","Chart","_legend","titles","chartAndLegendContainer","chartContainer","processTitle","updateReaderTitleReferences","fixLayout","legend","feedLegend","titleIds_1","setLegend","_dragGrip","grip_1","Bullet","tooltipX","copyToLegendMarker","SeriesDataItem","_bullets","Series","_showBullets","_tmin","_tmax","_smin","_smax","dataItemsByAxis","skipFocusThreshold","_itemReaderTextChanged","calculatePercent","usePercentHack","simplifiedProcessing","minBulletDistance","mainContainer","positionBullet","processBullet","itemsFocusable","removeBullet","eachBullet","processValues","getFirstValue","getAbsoluteFirstValue","working","count_1","sum_1","absoluteSum_1","low_1","high_1","open_1","close_1","previous_1","first_1","absoluteFirst_1","startIndex_1","prevValue","_loop_2","dataItem_3","ksum","zeroItem_1","dataItem_4","MSInputMethodContext","updateTooltipBounds","shouldCreateBullet","bulletTemplate","disabledField","currentDataItem","readerText_1","itemReaderText","xField","yField","isDynamic","itemWidth","itemHeight","rangesContainer","getAxisField","xPosition","yPosition","readerText","_itemReaderText","_legendDataItem","notRange","itemLabelText","labelText","_heatRules","dataField_1","seriesDataItem_1","property_1","foundSprite","anySprite","anyChild","foundSprite_1","ruleTarget","propertyField","listitem","maybeIndex","SerialChartDataItem","SerialChart","_exitDP","colors","seriesContainer","patterns","createSeries","handleSeriesAdded","handleSeriesRemoved","di","handleSeriesAdded2","handleLegendSeriesAdded","hiddenInLegend","legendData_1","Adder","_partials","Float64Array","_n","hi","lo","halfPi","quarterPi","atan","hypot","haversin","streamGeometry","geometry","streamGeometryType","streamObjectType","Feature","FeatureCollection","features","Sphere","sphere","Point","coordinates","MultiPoint","LineString","streamLine","MultiLineString","streamPolygon","MultiPolygon","GeometryCollection","geometries","polygonStart","polygonEnd","lambda00","phi00","lambda0","cosPhi0","sinPhi0","phi0","lambda1","phi1","lambda2","deltaSum","ranges","areaRingSum","areaSum","areaStream","areaRingStart","areaRingEnd","areaRing","areaPointFirst","areaPoint","dLambda","sdLambda","adLambda","cosPhi","sinPhi","spherical","cartesian","cartesianDot","cartesianCross","cartesianAddInPlace","cartesianScale","vector","cartesianNormalizeInPlace","boundsStream","boundsPoint","boundsLineStart","boundsLineEnd","boundsRingPoint","boundsRingStart","boundsRingEnd","linePoint","inflection","phii","lambdai","antimeridian","rangeCompare","rangeContains","merged","deltaMax","MapSeriesDataItem","_east","_west","_south","_north","getFeature","bounds","west","south","north","east","MapSeries","checkInclude","includes","excludes","processIncExc","handleObjectAdded","mapObject","_geodata","geodata","reverseGeodata","processReverseGeodata","madeFromGeoData","getFeatures","_mapObjects","_northDefined","_southDefined","_westDefined","_eastDefined","name_1","MapObject","handleTooltipMove","MapImage","latitude","geoPoint","longitude","projection","d3Projection","d3Path","multiLineToGeo","multiLine","pointToGeo","multiGeoToPoint","geoPoints","geoToPoint","multiGeoLineToMultiLine","multiGeoLine","multiGeoPolygonToMultipolygon","multiGeoPolygon","geoPolygon","multiPolygon","MapPolygon","pathGenerator","calculateVisualCenter","biggestArea","biggestPolygon","_visualLongitude","_visualLatitude","convert","visualLongitude","visualLatitude","MapPolygonSeriesDataItem","_mapPolygon","mapPolygon_1","mapPolygons","_polygon","_multiPolygon","_geoPolygon","_multiGeoPolygon","MapPolygonSeries","useGeodata","geoJSON","geodataNames","include","exclude","dataObject","mapPolygon","sortPolygonsBy","sortBy_1","reversed_1","sortPolygonsReversed","valA","valB","dirA","dirB","boxArea","_mapPolygons","polygonTemplate","getPolygonById","rejoin","other","z","compareIntersection","startInside","subject","clip","pointEqual","isSubject","arrays","pointVisible","clipLine","sink","ringBuffer","ringSink","polygonStarted","pointRing","ringStart","ringEnd","winding","sinPhi1","cosPhi1","absDelta","phiArc","polygonContains","pointLine","clean","ringSegments","validSegment","sign0","sign1","sinLambda0Lambda1","clipAntimeridianIntersect","circleRadius","cosRadius","acos","smallRadius","notHemisphere","two","n1","n2","n2n2","n1n2","determinant","c1","c2","n1xn2","A","uu","t2","polar","q1","v0","v00","sinRadius","circleStream","clipMax","clipMin","clipRectangle","a1","corner","comparePoint","ca","cb","x__","y__","v__","x_","y_","v_","activeStream","bufferStream","clipStream","polygonInside","cleanInside","compose","rotationIdentity","deltaLambda","deltaPhi","deltaGamma","rotationLambda","rotationPhiGamma","forwardRotationLambda","cosDeltaPhi","sinDeltaPhi","cosDeltaGamma","sinDeltaGamma","transformer","methods","TransformStream","fitBounds","clipExtent","fitExtent","extent","fitWidth","fitHeight","cosMinDistance","project","delta2","resampleLineTo","phi2","dx2","dy2","dz","x00","y00","a00","b00","c00","resampleStream","ringPoint","resampleNone","transformRadians","scaleTranslateRotate","sx","sy","scaleTranslate","cosAlpha","sinAlpha","ci","fi","projectionMutator","projectAt","rotate","projectResample","projectTransform","projectRotateTransform","cacheStream","preclip","postclip","identity","recenter","resample","transformRotate","clipAngle","reflectX","reflectY","equirectangularRaw","X0","Y0","Z0","X1","Y1","Z1","X2","Y2","Z2","centroidStream","centroidPoint","centroidLineStart","centroidLineEnd","centroidRingStart","centroidRingEnd","centroid","centroidPointFirstLine","centroidPointLine","centroidPointFirstRing","centroidPointRing","PathContext","_radius","pointRadius","_point","closePath","lengthRing","lengthSum","lengthStream","lengthPointFirst","lengthPoint","cacheDigits","cacheAppend","cacheRadius","cacheCircle","PathString","_append","RangeError","strings","appendRound","lengthLineEnd","cosDelta","Projection","_d3Projection","_d3Path","projectionStream","contextStream","invalidateProjection","unproject","deltaLongitude","deltaLatitude","unrotate","intermediatePoint","cy0","sy0","cy1","sy1","kx0","ky0","kx1","ky1","B","multiDistance","positionToGeoPoint","intermediatePointA","intermediatePointB","pa","pb","positionAB","SmallMap","moveToPosition","updateMapSize","newSeries","rectPoint","seriesPointToGeo","zoomToGeoPoint","zoomLevel","updateRectangle","wrapAngleTo180","MapLineObject","adjustRotation","mapLine","shortestDistance","MapImageSeriesDataItem","_mapImage","mapImage_1","mapImages","_geoPoint","multiPoint","MapImageSeries","multiGeoPoint","mapImage","_mapImages","getImageById","MapLine","_imageListeners","createLine","multiline","latitude180","normalizePoint","handleImagesToConnect","imagesToConnect","convertedPoints","convertedSegmentPoints","_arrow","lineObjects","_lineObjects","handleLineObjectAdded","mapLineObject","arrow","MapLineSeriesDataItem","_mapLine","mapLine_1","mapLines","_multiLine","_multiGeoLine","_geoLine","geoLine","MapLineSeries","_mapLines","lineTemplate","getLineById","Graticule","graticuleX","graticuleY","GraticuleSeriesDataItem","GraticuleSeries","longitudeStep","latitudeStep","singleSprite","graticule","X","Y","DX","DY","extentMajor","extentMinor","stepMajor","stepMinor","lineString","MapChart","zoomDuration","zoomEasing","minZoomLevel","maxZoomLevel","_prevZoomGeoPoint","maxPanOut","homeZoomLevel","zoomStep","centerMapOnZoomOut","backgroundSeries","handleAllInited","handleMapTransform","handleDoubleHit","handleDrag","updateCenterGeoPoint","_mapAnimation","allInited_1","updateScaleRatio","_zoomGeoPointReal","chartContainerBg","handleMapDown","_zoomControl","pan","mouseWheelBehavior","handlePanDown","handlePanUp","panSprite","handlePanMove","panBehavior","_downPointOrig","_downDeltaLongitude","_downDeltaLatitude","isResized","dln","dlt","dlg","downGeoLocal","geoLocal","goHome","updateZoomGeoPoint","seriesPoint","seriesMaxLeft","seriesMaxRight","seriesMaxTop","seriesMaxBottom","seriesWidth","seriesHeight","_centerGeoPoint","ww","hh","zoomGeoPoint","svgPointToGeo","zoomIn","zoomOut","_backgroundSeries","foundGraticule","deltaLong","deltaLat","initialScale","stepLong","stepLat","ln","_fitWidth","_fitHeight","hScale","vScale","geoPointToSVG","geoPointToSeries","hasData_1","mapPoint","zoomToMapObject","zoomToRectangle","splitLongitude","newLong","_prevZoomLevel","_smallMap","smallMap","zoomControl","plusButton","minusButton","rotateMap","homeGeoPoint","centerGeoPoint","hideOverflow","MapSpline","MapArc","MapSplineSeriesDataItem","MapSplineSeries","MapArcSeriesDataItem","MapArcSeries","ZoomControl","slider","handleBackgroundClick","updateThumbSize","handleThumbDrag","maxPower","LN2","minPower","mercatorRaw","Mercator","reclip","mercatorProjection","millerRaw","SQRT1_2","Miller","eckert6Raw","Eckert6","azimuthalInvert","cc","orthographicRaw","Orthographic","stereographicRaw","Stereographic","conicEqualAreaRaw","cylindricalEqualAreaRaw","r0","r0y","parallels","conicProjection","conicEqualArea","Albers","AlbersUsa","lower48Point","alaskaPoint","hawaiiPoint","lower48","albers","alaska","hawaii","pointStream","albersUsa","streams","multiplex","naturalEarth1Raw","phi4","NaturalEarth1","azimuthalEqualAreaRaw","cxcy","AzimuthalEqualArea","equalEarthRaw","l2","l6","EqualEarth","SwiperCore","EffectFade","tabsBtns","tabsContents","defaultTab","defaultTab2","defaultTab3","videoThumbCarousel","768","1024","1380","1480","1200","historyTextCarousel","historyNumberCarousel","historyCarousel","centerMode","992","1100","accordionItem","defaultAccordion","floatingDiv","floatingDivParent","scrollPosition","scrollFirstPosition","scrollDataPosAt","reservationScroll","targetScroll","activeJobScroll","cls","iMyWidth","iMyHeight","thLnk","EPSILON","scrollHeight","childElementCount","nativePointer","startCallback","moveCallback","endCallback","onPointerStart","onMove","currentPointers","some","triggerPointerStart","onPointerEnd","onWindowBlur","triggerPointerEnd","startPointers","setOptions","startsWith","super","Init","Ready","Panning","Mousemove","Destroy","PANUP","PANDOWN","PANLEFT","PANRIGHT","ZOOMIN","ZOOMOUT","TOGGLEZOOM","TOGGLE1TO1","ITERATEZOOM","ROTATECCW","ROTATECW","FLIPX","FLIPY","FITX","FITY","RESET","TOGGLEFS","panMode","dragMinThreshold","lockAxis","mouseMoveFactor","mouseMoveFriction","pinchToZoom","panOnlyZoomed","minScale","maxScale","friction","dragFriction","decelFriction","dblClick","wheelLimit","spinner","infinite","rubberband","bounce","maxVelocity","transformParent","isLoading","canZoomIn","canZoomOut","isDraggable","isDragging","inFullscreen","htmlHasFullscreen","l10n","T","O","R","isTouchDevice","fullWidth","fullScale","containerRect","targetScale","isResting","HTMLImageElement","isBouncingX","isBouncingY","inBounds","fullHeight","initContent","attachPlugins","Plugins","onLoad","onError","isContentLoading","cn","HTMLPictureElement","queueMicrotask","updateMetrics","updateTimer","isMobile","onWheel","pointerTracker","onPointerDown","onPointerMove","onPointerUp","onMouseMove","onKeydown","clickTimer","setTargetForce","isScaling","setTransform","setEdgeForce","rAF","getBounds","xDiff","yDiff","getMatrix","DOMPoint","DOMMatrixReadOnly","attachObserver","trackingPoints","startDecelAnim","getSelection","dataset","panzoomChange","panzoomAction","applyChange","dragOffset","clicks","pwt","removeAllRanges","addTrackingPoint","lockedAxis","isInfinite","originX","originY","panX","panY","isTicking","visualViewport","zoomWithWheel","panWithMouse","toggleFS","requestTick","calculateContentDim","naturalWidth","SVGElement","baseVal","naturalHeight","zoomTo","updateControls","coverScale","toggleMax","toggleCover","toggleZoom","flipX","flipY","DOMMatrix","multiply","clampTargetBounds","pmme","cwd","detachObserver","detachPlugins","I","thumbSrc","thumbEl","thumbElSrc","isDom","class","customClass","dim","H","pages","cleanup","createItem","page","localize","onRefresh","hasDots","isBeforePrev","isPrev","isCurrent","isNext","isAfterNext","dotTpl","dynamicFrom","W","isRTL","createButton","nextTpl","prevTpl","nav","initialPage","onNavReady","onTargetReady","onNavCreateSlide","onNavClick","onNavTouch","onTargetChange","panzoom","getPageForSlide","Sync","markSelectedSlide","addAsNavFor","addAsTargetFor","V","Dots","Z","contentDim","viewportDim","Set","userOptions","userPlugins","processOptions","bp","initLayout","initSlides","setInitialPosition","initPanzoom","isLTR","viewport","setViewportHeight","onDecel","onBeforeTransform","onEndAnimation","onSlideTo","inTransition","getPageFromIndex","clearTransitions","createSlideEl","onAnimationEnd","panTo","onChange","getVisibleSlides","lazyLoadSlide","removeSlideEl","markSelectedSlides","repositionSlides","lazySrc","lazySrcset","animationName","delete","pageIndex","getPageFromPosition","carouselPage","carouselNext","carouselPrev","prevPage","lp","flipInfiniteTrack","manageSlideVisiblity","transitionTo","getSlideMetrics","createPages","processPages","setInitialPage","preload","slidesPerPage","Panzoom","dragFree","adaptiveHeight","isSelected","NEXT","PREV","GOTO","U","G","K","J","Q","preventScroll","tt","dragToClose","hideScrollbar","Carousel","contentClick","contentDblClick","backdropClick","idle","showClass","hideClass","commonCaption","parentEl","CLOSE","MODAL","ERROR","IMAGE_ERROR","ELEMENT_NOT_FOUND","AJAX_NOT_FOUND","AJAX_FORBIDDEN","IFRAME_ERROR","TOGGLE_ZOOM","TOGGLE_THUMBS","TOGGLE_SLIDESHOW","TOGGLE_FULLSCREEN","DOWNLOAD","tpl","closeButton","main","groupAll","groupAttr","defaultType","defaultDisplay","autoFocus","trapFocus","placeFocusBack","Escape","Delete","Backspace","PageUp","PageDown","ArrowUp","ArrowDown","ArrowRight","ArrowLeft","Fullscreen","autoStart","compact","et","Closing","CustomClosing","Loading","Opening","nt","slug","st","_t","getInstance","carousel","getSlide","triggerEl","fancybox","hasSilentClose","startFromUrl","isOpeningSlide","origHash","onClose","Hash","ot","at","optionFor","setImage","contentEl","getZoomInfo","isClosing","hideLoading","revealContent","prevMouseMoveEvent","zoomToFull","zoomToCover","zoomToMax","setError","clearContent","showLoading","setContent","isCompact","onCreateSlide","onRemoveSlide","initialSize","protected","zoomOpacity","URLSearchParams","ht","processType","iframeEl","placeholderEl","playVideo","postMessage","poller","isCurrentSlide","setAspectRatio","resizeIframe","HTMLIFrameElement","DONE","autoSize","flex","play","muted","nocookie","getOwnPropertySymbols","propertyIsEnumerable","videoId","videoFormat","poster","setInlineContent","loadAjaxContent","setIframeContent","onInitSlide","onSelectSlide","onUnselectSlide","onDone","onMessage","iframeAttr","allow","scrolling","videoAutoplay","videoRatio","videoTpl","vimeo","byline","dnt","youtube","enablejsapi","rel","fs","ut","ft","removeProgressBar","inHover","progressBar","createProgressBar","onTimerEnd","onSettle","pauseOnHover","progressParentEl","showProgress","endIdle","onPrepare","playOnStart","hasThumbs","thumbTpl","bt","Hidden","Disabled","vt","formatThumb","thumbClipWidth","thumbHeight","refreshModern","shouldCenter","centerModern","carouselIndex","thumbGap","thumbExtraGap","thumbSlideEl","getProgress","thumbWidth","getSlides","updateModern","resizeModernSlide","getModernThumbPos","onClickModern","lazyLoadModern","onTransformM","buildClassic","buildModern","onInitSlides","onRefreshM","onChangeM","yt","showOnStart","wt","Et","footer","onInit","St","panLeft","change","panRight","panUp","panDown","action","toggle1to1","iterateZoom","rotateCCW","rotateCW","fitX","fitY","Pt","Mt","viewBox","Tt","createEl","createContainer","fancyboxToggleThumbs","fancyboxToggleFullscreen","toggleFullscreen","fancyboxToggleSlideshow","fsAPI","downloadSrc","removeContainer","infobar","slideshow","fullscreen","Ot","Html","Images","Slideshow","Toolbar","At","zt","Rt","kt","Dt","Ft","jt","Ht","Bt","Nt","fullscreenEnabled","webkitFullscreenEnabled","ALLOW_KEYBOARD_INPUT","exit","isFullscreen","userSlides","initCarousel","manageCaption","closeBtnEl","captionEl","spinnerEl","idleTimer","setIdle","checkFocus","downloadFilename","onMousemove","onFocus","resetIdle","toggleIdle","isTopmost","It","clearIdle","fancyboxCaption","ignoreFocusChange","origTabindex","lastFocus","manageCloseBtn","proceedClose","openers","fromEvent","fancyboxTrigger","fancyboxIndex","fromNodes","dragSize","trackSize","$dragEl","newPos","divider","moveDivider","getPointerPosition","setDragPosition","positionRatio","dragStartPos","onDragStart","dragTimeout","onDragMove","onDragEnd","snapOnRelease","enableDraggable","activeListener","disableDraggable","$swiperEl","dragClass","dragEl","Fancybox","mouse_x","mouse_y","balloonModal","selElmnt","sl","yl","closeAllSelect","elmnt","xl","arrNo","customSelect","popupTextCarousel","popupImgCarousel","DEFAULT_LOCATION","Stream","listeners","_length","destination","decodeB64ToUint8Array","b64Text","decodedString","Buffer","LineStream","nextNewline","TAB","parseByterange","byterangeString","parseAttributes","ParseStream","customParsers","tagMappers","acc","mapper","mappedLine","newLine","tagType","playlistType","allowed","URI","BYTERANGE","byterange","RESOLUTION","resolution","BANDWIDTH","dateTimeString","dateTimeObject","IV","Uint32Array","PRECISE","subkey","clientAttributePattern","isHexaDecimal","isDecimalFloating","expression","customType","dataParser","camelCaseKeys","setHoldBack","manifest","serverControl","targetDuration","partTargetDuration","hb","phb","minTargetDuration","minPartDuration","lineStream","parseStream","uris","currentMap","currentUri","hasParts","defaultMediaGroups","currentTimeline","allowCache","discontinuityStarts","lastByterangeEnd","lastPartByterangeEnd","daterangeTags","preloadHints","timeline","preloadSegment","mediaGroup","rendition","endList","mediaSequence","discontinuitySequence","METHOD","KEYFORMAT","contentProtection","KEYID","schemeIdUri","keyId","pssh","iv","playlist","playlists","mediaGroups","TYPE","NAME","mediaGroupType","DEFAULT","autoselect","AUTOSELECT","LANGUAGE","instreamId","CHARACTERISTICS","characteristics","FORCED","forced","discontinuity","timeOffset","precise","cueOut","cueOutCont","cueIn","warnOnMissingAttributes_","segmentIndex","partIndex","renditionReports","canBlockReload","canSkipDateranges","hint","isPart","otherHint","report","required","partInf","partTarget","daterange","endDate","startDate","plannedDuration","endOnNextYes","endOnNext","newDateInSeconds","setSeconds","independentSegments","custom","missing","addParser","addTagMapper","regexs","mp4","webm","ogg","video","audio","muxerVideo","muxerAudio","muxerText","mediaTypes","upperMediaTypes","translateLegacyCodec","codec","profile","avcLevel","parseCodecs","codecString","codecs","codecType","mediaType","isAudioCodec","getMimeForCodec","browserSupportsCodec","muxerSupportsCodec","DEFAULT_AUDIO_CODEC","MPEGURL_REGEX","DASH_REGEX","simpleTypeFromSourceType","isArrayBufferView","ArrayBuffer","isView","BigInt","BYTE_TABLE","Uint16Array","_ref$signed","signed","_ref$le","byte","stringToBytes","stringIsBytes","_temp3","_ref3","_ref3$offset","_ref3$mask","bByte","baseUrl","relativeUrl","nativeURL","protocolLess","removeLocation","newUrl","lists","urlTypeToSegment","indexRange","resolvedUri","startRange","endRange","parseEndNumber","endNumber","segmentRange","sourceDuration","periodDuration","segmentDuration","NOW","clientOffset","availabilityStartTime","periodStart","minimumUpdatePeriod","timeShiftBufferDepth","periodStartWC","segmentCount","availableStart","availableEnd","parseByDuration","startNumber","toSegments","sectionDuration","segmentsFromBase","initialization","presentationTime","initSegment","sourceURL","segmentTimeInfo","addSidxSegmentsToPlaylist$1","sidx","sidxByteRange","sidxEnd","mediaReferences","SUPPORTED_MEDIA_TYPES","getUniqueTimelineStarts","timelineStarts","keyFunction","getMediaGroupPlaylists","mediaGroupPlaylists","master","groupKey","labelKey","mediaProperties","updateMediaSequenceForPlaylist","generateSidxKey","byteRangeToString","mergeDiscontiguousPlaylists","playlistsByBaseUrl","allPlaylists","playlistGroup","mergedPlaylists","findIndexes","addSidxSegmentsToPlaylist","sidxMapping","sidxKey","sidxMatch","addSidxSegmentsToPlaylists","formatVideoPlaylist","AUDIO","SUBTITLES","CODECS","bandwidth","frameRate","serviceLocation","videoOnly","audioOnly","vttOnly","flattenMediaGroupPlaylists","mediaGroupObject","labelContents","toM3u8","dashPlaylists","contentSteering","previousManifest","eventStream","suggestedPresentationDelay","videoPlaylists","audioPlaylists","vttPlaylists","captions","captionServices","VIDEO","isAudioOnly","organizedAudioGroup","mainPlaylist","formattedPlaylists","roleLabel","formatAudioPlaylist","organizeAudioPlaylists","organizedVttGroup","m3u8Attributes","vttPlaylist","formatVttPlaylist","organizeVttPlaylists","playlistTimelineStarts","subs","svcObj","svc","service","channel","easyReader","oldManifest","newManifest","oldPlaylists","newPlaylists","oldPlaylist","findPlaylistWithName","firstNewSegment","oldMatchingSegmentIndex","oldSegment","updateSequenceNumbers","positionManifestOnTimeline","getLiveRValue","parseByTimeline","segmentTimeline","media","sIndex","segmentTime","nextS","identifierPattern","constructTemplateUrl","identifierReplacement","segmentsFromTemplate","templateValues","RepresentationID","Bandwidth","mapSegment","parseTemplateInfo","Time","presentationTimeOffset","segmentsFromList","segmentUrls","segmentUrlMap","segmentUrlObject","segmentUrl","mediaRange","SegmentURLToSegmentObject","generateSegments","segmentInfo","segmentAttributes","segmentsFn","segmentsInfo","findChildren","getContent","parseDuration","parsers","mediaPresentationDuration","parseDivisionValue","parsedValue","parseFn","keySystemsMap","buildBaseUrls","baseUrlElements","baseUrlElement","initialBaseUrl","resolvedBaseUrl","finalBaseUrl","getSegmentInformation","adaptationSet","segmentTemplate","segmentList","segmentBase","segmentTimelineParentNode","segmentInitializationParentNode","segmentInitialization","toEventStream","eventStreamAttributes","eventAttributes","messageData","contentEncoding","toRepresentations","periodAttributes","periodBaseUrls","periodSegmentInfo","adaptationSetAttributes","adaptationSetBaseUrls","roleAttributes","accessibility","labelVal","keySystem","psshNode","representations","adaptationSetSegmentInfo","representation","repBaseUrlElements","repBaseUrls","representationSegmentInfo","inheritBaseUrls","toAdaptationSets","mpdAttributes","mpdBaseUrls","adaptationSets","generateContentSteeringInformation","contentSteeringNodes","infoFromContentSteeringTag","serverURL","queryBeforeStart","stringToMpdXml","manifestString","mpd","DESCRIPTORS","ID3","getId3Offset","returnSize","getId3Size","parseDescriptors","headerSize","_DESCRIPTORS$z","dependsOnEsId","ocrEsId","descriptors","oti","streamType","bufferSize","maxBitrate","avgBitrate","findBox","normalizePaths","EBML_TAGS","EBML","DocType","Segment","SegmentInfo","Tracks","Track","TrackNumber","DefaultDuration","TrackEntry","TrackType","FlagDefault","CodecID","CodecPrivate","VideoTrack","AudioTrack","Cluster","Timestamp","TimestampScale","BlockGroup","BlockDuration","Block","SimpleBlock","LENGTH_TABLE","getvint","removeLength","getLength","valueBytes","_temp2","_ref2$le","byteCount","countBits","countBytes","byteIndex","numberToBytes","getInfinityDataSize","innerid","dataHeader","findEbml","dataStart","dataEnd","NAL_TYPE_ONE","NAL_TYPE_TWO","EMULATION_PREVENTION","discardEmulationPreventionBytes","newLength","newData","sourceIndex","findNal","nalLimit","nalStart","nalsFound","nalOffset","nalType","CONSTANTS","_isLikely","aac","mp3","docType","mkv","matroska","mov","fmp4","moof","moov","ac3","flac","avi","riff","wav","findH264Nal","findH265Nal","isLikelyTypes","isLikelyFn","isLikely","detectContainerForBytes","version$6","hooks_","removeHook","FullscreenApi","prefixed","apiMap","specApi","browserApi","log$1","createLogger$1","logByType","lvl","levels","lvlRegExp","resultName","LogByTypeFactory","createLogger","subName","subDelimiter","subStyles","resultDelimiter","createNewLogger","newName","newDelimiter","newStyles","fname","historyItem","accum","isPlain","merge$1","sources","defineLazyProperty","Obj","ANDROID_VERSION","IS_IPOD","IOS_VERSION","IS_ANDROID","IS_FIREFOX","IS_EDGE","IS_CHROMIUM","IS_CHROME","CHROMIUM_VERSION","CHROME_VERSION","IE_VERSION","IS_SAFARI","IS_WINDOWS","IS_IPAD","IS_IPHONE","TOUCH_ENABLED","isReal","UAD","brands","brand","USER_AGENT","major","minor","IS_IOS","IS_ANY_SAFARI","isNonBlankString","isEl","isInFrame","createQuerier","appendContent","classToCheck","throwIfWhitespace","classesToAdd","classesToRemove","classToToggle","setAttributes","attrValue","getAttributes","knownBooleans","attrVal","blockTextSelection","unblockTextSelection","computedStyle","findPosition","fullscreenElement","translated","boxTarget","boxW","emptyEl","normalizeContent","insertContent","isSingleLeftClick","$$","computedStyleValue","copyStyleSheetsToWindow","styleSheet","mediaText","Dom","videojs$1","_windowLoaded","autoSetup","vids","audios","mediaEls","mediaEl","autoSetupTimeout","player","vjs","setWindowLoaded","createStyleElement","setTextContent","DomData","WeakMap","_supportsPassive","_guid","newGUID","_cleanUpEvents","dispatcher","detachEvent","_handleMultipleEvents","fixEvent","fixed_","srcElement","fromElement","cancelBubble","passiveEvents","handlersCopy","attachEvent","removeType","targetData","Events","UPDATE_REFRESH_INTERVAL","bind_","bound","throttle","debounce","immediate","debounced","later","Fn","EVENT_MAP","EventTarget$2","ael","allowedEvents_","oldTimeout","objName","name_","isEvented","eventBusEl_","isValidEventType","validateTarget","fnName","validateEventType","validateListener","normalizeListenArgs","isTargetingSelf","listen","EventedMixin","removeListenerOnDispose","removeRemoverOnTargetDispose","largs","targetOrType","typeOrListener","evented","eventBusKey","eventedCallbacks","el_","StatefulMixin","stateUpdates","changes","stateful","handleStateChanged","toTitleCase$1","titleCaseEquals","str1","str2","Str","toTitleCase","Component$1","player_","isDisposed_","parentComponent_","options_","id_","handleLanguagechange","children_","childIndex_","childNameIndex_","setTimeoutIds_","setIntervalIds_","rafIds_","namedRafs_","clearingTimersOnDispose_","initChildren","reportTouchActivity","enableTouchActivity","readyQueue_","restoreEl","languages","primaryCode","primaryLang","localizedString","contentEl_","currentChild","getChild","iconName","experimentalSvgIcons","xmlnsURL","iconContainer","svgEl","useEl","iconIsSet_","componentName","componentClassName","componentClass","ComponentClass","getComponent","childFound","compEl","parentOptions","handleAdd","playerOptions","addChild","workingChildren","Tech","wchild","isTech","isReady_","readyQueue","skipListeners","widthOrHeight","pxIndex","computedWidthOrHeight","currentDimension","handleKeyDown","couldBeTap","touchStart","firstTouch","xdiff","ydiff","noTap","reportUserActivity","touchHolding","clearInterval","timeoutId","clearTimersOnDispose_","intervalId","idName","cancelName","ComponentToRegister","isComp","isPrototypeOf","reason","components_","Player","players","playerNames","pname","getRange","valueIndex","rangeIndex","rangeCheck","createTimeRangesObj","timeRangesObj","createTimeRanges$1","registerComponent","defaultImplementation","guide","gm","gh","setFormatTime","customImplementation","resetFormatTime","formatTime","createTimeRanges","createTimeRange","bufferedPercent","buffered","bufferedDuration","MediaError","defaultMessages","errorTypes","1","2","3","4","5","errNum","isPromise","silencePromise","trackToJson_","ModalDialog","handleKeyDown_","close_","opened_","hasBeenOpened_","hasBeenFilled_","closeable","uncloseable","descEl_","buildCSSClass","previouslyActiveEl_","fillAlways","wasPlaying_","pauseOnOpen","hadControls_","conditionalFocus_","conditionalBlur_","temporary","closeable_","controlText","fillWith","nextSiblingEl","content_","activeEl","playerEl","focusableEls","focusableEls_","focusIndex","allChildren","TrackList","tracks","tracks_","addTrack","labelchange_","rtrack","addtrack","removetrack","labelchange","disableOthers$1","disableOthers","TextTrackList","queueChange_","queueTrigger","triggerSelectedlanguagechange","triggerSelectedlanguagechange_","kind","removeTrack","selectedlanguagechange_","TextTrackCueList","setCues_","length_","oldLength","cues_","defineProp","VideoTrackKind","subtitles","commentary","AudioTrackKind","TextTrackKind","descriptions","chapters","metadata","TextTrackMode","showing","trackProps","newLabel","getAbsoluteURL","getFileExtension","isCrossOrigin","winLoc","urlInfo","Url","parseCues","srcContent","addCue","loadTrack","tech_","loaded_","TextTrack","tech","srclang","default_","activeCues_","preload_","preloadTextTracks","activeCues","timeupdateHandler","rvf_","requestVideoFrameCallback","stopTracking","startTracking","newMode","cancelVideoFrameCallback","originalCue","originalCue_","textTracks","removeCue","cuechange","newEnabled","newSelected","HTMLTrackElement","NONE","LOADED","LOADING","NORMAL","ListClass","changing_","enabledChange_","TrackClass","capitalName","selectedChange_","getterName","privateName","REMOTE","remoteText","remoteTextEl","trackElements","trackElements_","addTrackElement_","trackElement","trackElement_","ALL","onDurationChange_","onDurationChange","trackProgress_","trackProgress","trackCurrentTime_","trackCurrentTime","stopTrackingCurrentTime_","stopTrackingCurrentTime","disposeSourceHandler_","disposeSourceHandler","queuedHanders_","hasStarted_","featuresProgressEvents","manualProgressOn","featuresTimeupdateEvents","manualTimeUpdatesOn","nativeCaptions","nativeTextTracks","featuresNativeTextTracks","emulateTextTracks","autoRemoteTextTracks_","initTrackListeners","nativeControlsForTouch","emitTapEvents","triggerSourceset","manualProgress","stopTrackingProgress","progressInterval","numBufferedPercent","bufferedPercent_","duration_","manualTimeUpdates","currentTimeInterval","manuallyTriggered","clearTracks","manualProgressOff","manualTimeUpdatesOff","removeRemoteTextTrack","error_","_isScrubbing","_seconds","trackListChanges","addWebVttScript_","remoteTracks","remoteTextTracks","handleAddTrack","handleRemoveTrack","updateDisplay","textTracksChanges","createTrackHelper","manualCleanup","htmlTrackElement","createRemoteTextTrack","remoteTextTrackEls","getTrackElementByTrack_","removeTrackElement_","requestNamedAnimationFrame","cancelNamedAnimationFrame","override","_type","srcObj","canPlayType","techs_","canPlaySource","defaultTechOrder_","featuresVolumeControl","featuresMuteControl","featuresFullscreenResize","featuresPlaybackRate","featuresSourceset","featuresVideoFrameCallback","withSourceHandlers","_Tech","registerSourceHandler","sourceHandlers","can","selectSourceHandler","canHandleSource","sh","originalFn","sourceHandler_","setSource","nativeSourceHandler","currentSource_","handleSource","cleanupAutoTextTracks","registerTech","middlewares","middlewareInstances","TERMINATOR","setSourceHelper","mediate","middleware","callMethod","middlewareValue","middlewareIterator","terminated","mws","mw","executeRight","allowedGetters","played","seekable","volume","ended","allowedSetters","setCurrentTime","setMuted","setVolume","allowedMediators","lastRun","mwFactory","mwrest","mwf","mwi","getOrCreateFactory","_src","MimetypesKind","opus","ogv","m4v","m4a","caf","oga","m3u8","jpg","jpeg","gif","png","webp","getMimetype","ext","filterSource","newsrc","srcobj","fixSource","mimetype","techOrder","techName","getTech","loadTech_","ClickableComponent","handleMouseOver_","handleMouseOver","handleMouseOut_","handleMouseOut","handleClick_","handleClick","tabIndex_","createControlTextEl","controlTextEl_","controlText_","localizedText","nonIconControl","noUITitleAttributes","enabled_","clickHandler","PosterImage","update_","crossorigin","setSrc","loading","fontMap","monospace","sansSerif","serif","monospaceSansSerif","monospaceSerif","proportionalSansSerif","proportionalSerif","casual","smallcaps","constructColor","tryUpdateStyle","getCSSPositionValue","updateDisplayHandler","updateDisplayOverlay","toggleDisplay","preselectTrack","screenOrientation","changeOrientationEvent","addRemoteTextTrack","modes","userPref","cache_","selectedLanguage","firstDesc","firstCaptions","preferredTrack","allowMultipleShowingTracks","clearDisplay","showingTracks","updateForTrack","descriptionsTrack","captionsSubtitlesTrack","videoHeight","playerWidth","playerHeight","playerAspectRatio","videoAspectRatio","videoWidth","insetInlineMatch","insetBlockMatch","textTrackSettings","getValues","textOpacity","windowColor","windowOpacity","edgeStyle","textShadow","fontPercent","fontFamily","fontVariant","cueEl","updateDisplayState","isAudio","playerType","BigPlayButton","mouseused_","setIcon","handleMouseDown","playPromise","playToggle","playFocus","PlayToggle","replay","handlePlay","handlePause","handleEnded","handleSeeked","TimeDisplay","updateContent","updateTextNode_","span","labelText_","textNode_","formattedTime_","oldNode","CurrentTimeDisplay","scrubbing","DurationDisplay","RemainingTimeDisplay","displayNegative","remainingTimeDisplay","remainingTime","updateShowing","SeekToLive","updateLiveEdgeStatus","liveTracker","updateLiveEdgeStatusHandler_","textEl_","atLiveEdge","seekToLiveEdge","clamp","Num","handleMouseDown_","handleMouseUp_","handleMouseUp","handleMouseMove_","handleMouseMove","bar","barName","playerEvent","progress_","sizeKey","toFixed","getPercent","stepBack","stepForward","vertical_","percentify","partEls_","loadedText","percentageEl_","isLive","seekableEnd","bufferedEnd","percent_","seekBarRect","seekBarPoint","tooltipRect","playerRect","seekBarPointPx","spaceLeftOfPoint","spaceRightOfPoint","pullTooltipBy","liveWindow","secondsBehind","PlayProgressBar","timeTooltip","updateTime","MouseTimeDisplay","SeekBar","setEventHandlers_","updateInterval","enableIntervalHandler_","enableInterval_","disableIntervalHandler_","disableInterval_","toggleVisibility_","getCurrentTime_","liveCurrentTime","currentTime_","nextSeekedFromUser","seekableStart","videoWasPlaying","mouseDown","newTime","calculateDistance","userSeek_","mouseTimeDisplay","handleAction","gotoFraction","STEP_SECONDS","ProgressControl","throttledHandleMouseSeek","handleMouseSeek","handleMouseUpHandler_","handleMouseDownHandler_","seekBar","playProgressBar","seekBarEl","removeListenersAddedOnMousedownAndTouchstart","PictureInPictureToggle","handlePictureInPictureChange","handlePictureInPictureEnabledChange","handlePictureInPictureAudioModeChange","currentType","audioPosterMode","audioOnlyMode","isInPictureInPicture","exitPictureInPicture","disablePictureInPicture","enableDocumentPictureInPicture","requestPictureInPicture","FullscreenToggle","handleFullscreenChange","fsApi_","exitFullscreen","requestFullscreen","rangeBarRect","rangeBarPoint","volumeBarPointPx","MouseVolumeLevelDisplay","updateVolume","VolumeBar","updateLastVolume_","updateARIAAttributes","mouseVolumeLevelDisplay","volumeBarEl","volumeBarRect","volumeBarPoint","checkMuted","ariaValue","volumeAsPercentage_","volumeBeforeDrag","lastVolume_","VolumeControl","volumeBar","checkVolumeSupport","throttledHandleMouseMove","orientationClass","MuteToggle","checkMuteSupport","vol","lastVolume","volumeToSet","updateIcon_","updateControlText_","VolumePanel","inline","volumeControl","handleKeyPressHandler_","handleKeyPress","volumePanelState_","muteToggle","handleVolumeControlKeyUp","sliderActive_","sliderInactive_","validOptions","skipTime","getSkipForwardTime","controlBar","skipButtons","currentVideoTime","SkipBackward","getSkipBackwardTime","backward","Menu","menuButton_","menuButton","focusedChild_","boundHandleBlur_","boundHandleTapClick_","handleTapClick","removeEventListenerForItem","childComponent","addEventListenerForItem","contentElType","btn","buttonPressed_","unpressButton","childComponents","foundComponent","stepChild","MenuButton","buttonClass","handleMenuKeyUp_","handleMenuKeyUp","handleSubmenuKeyDown","createMenu","hideThreshold_","titleEl","titleComponent","addItem","createItems","buildWrapperCSSClass","menuButtonClass","pressButton","lockShowing","unlockShowing","TrackButton","updateHandler","MenuKeys","MenuItem","isSelected_","multiSelectable","menuItemEl","TextTrackMenuItem","kinds","changeHandler","handleTracksChange","selectedLanguageChangeHandler","handleSelectedLanguageChange","onchange","referenceTrack","shouldBeSelected","OffTextTrackMenuItem","TextTrackButton","TrackMenuItem","label_","kinds_","kind_","ChaptersTrackMenuItem","ChaptersButton","selectCurrentItem_","track_","findChaptersTrack","setTrack","updateHandler_","remoteTextTrackEl","getMenuCaption","mi","DescriptionsButton","SubtitlesButton","CaptionSettingsMenuItem","CaptionsButton","SubsCapsMenuItem","parentSpan","SubsCapsButton","language_","AudioTrackMenuItem","audioTracks","featuresNativeAudioTracks","AudioTrackButton","PlaybackRateMenuItem","rate","playbackRate","PlaybackRateMenuButton","labelElId_","updateVisibility","updateLabel","handlePlaybackRateschange","labelEl_","rates","playbackRates","playbackRateSupported","Spacer","ControlBar","ErrorDisplay","LOCAL_STORAGE_KEY$1","COLOR_BLACK","COLOR_BLUE","COLOR_CYAN","COLOR_GREEN","COLOR_MAGENTA","COLOR_RED","COLOR_WHITE","COLOR_YELLOW","OPACITY_OPAQUE","OPACITY_SEMI","OPACITY_TRANS","selectConfigs","parseOptionValue","endDialog","setDefaults","persistTextTrackSettings","saveSettings","restoreSettings","legendId","selectLabelledbyIds","optionId","createElSelect_","createElFgColor_","createElBgColor_","createElWinColor_","defaultsDescription","createElColors_","createElFont_","createElControls_","setSelectedOption","setValues","ttDisplay","subsCapsBtn","subsCapsButton","ccBtn","captionsButton","RESIZE_OBSERVER_AVAILABLE","loadListener_","resizeObserver_","debouncedHandler_","unloadListener_","trackingThreshold","liveTolerance","trackLiveHandler_","trackLive_","handlePlay_","handleFirstTimeupdate_","handleFirstTimeupdate","handleSeeked_","seekToLiveEdge_","reset_","handleDurationchange","toggleTracking","deltaTime","lastTime_","pastSeekEnd_","pastSeekEnd","isBehind","seekedBehindLive_","timeupdateSeen_","behindLiveEdge_","liveui","isTracking","hasStarted","trackingInterval_","nextSeekedFromUser_","lastSeekEnd_","seekableEnds","seekableStarts","behindLiveEdge","updateDom_","techEl","techAriaAttrs","techAriaAttr","sourcesetLoad","srcUrls","innerHTMLDescriptorPolyfill","dummy","docFrag","getDescriptor","firstSourceWatch","resetSourceWatch_","innerDescriptor","getInnerHTMLDescriptor","appendWrapper","appendFn","retval","srcDescriptorPolyfill","Html5","crossoriginTracks","initNetworkState_","handleLateInit_","enableSourceset","setupSourcesetHandling_","isScrubbing_","nodesLength","removeNodes","proxyNativeTracks_","restoreMetadataTracksInIOSNativePlayer_","setControls","proxyWebkitFullscreen_","triggerReady","resetSourceset_","disposeMediaElement","srcDescriptor","getSrcDescriptor","oldSetAttribute","oldLoad","setupSourceset","metadataTracksPreFullscreenState","takeMetadataTrackSnapshot","storedMode","restoreTrackMode","storedTrack","lowerCaseType","proxyNativeTracksForType_","overrideNative_","elTracks","techTracks","removeOldTracks","removeTracks","playerElIngest","movingMediaElementInDOM","techId","playerId","settingsAttrs","networkState","loadstartFired","setLoadstartFired","triggerLoadstart","eventsToTrigger","isScrubbing","fastSeek","checkProgress","endFn","beginFn","webkitPresentationMode","nativeIOSFullscreen","webkitEnterFullScreen","HAVE_METADATA","webkitDisplayingFullscreen","webkitExitFullScreen","webkitKeys","resetMediaElement","addTextTrack","getVideoPlaybackQuality","videoPlaybackQuality","webkitDroppedFrameCount","webkitDecodedFrameCount","droppedVideoFrames","totalVideoFrames","creationTime","TEST_VID","canControlVolume","canControl","canMuteVolume","canControlPlaybackRate","canOverrideAttributes","supportsNativeTextTracks","supportsNativeVideoTracks","videoTracks","supportsNativeAudioTracks","TECH_EVENTS_RETRIGGER","TECH_EVENTS_QUEUE","canplay","canplaythrough","playing","seeked","BREAKPOINT_ORDER","BREAKPOINT_CLASSES","DEFAULT_BREAKPOINTS","tiny","xsmall","small","medium","large","xlarge","huge","getTagSettings","boundDocumentFullscreenChange_","documentFullscreenChange_","boundFullWindowOnEscKey_","fullWindowOnEscKey","boundUpdateStyleEl_","updateStyleEl_","boundApplyInitTime_","applyInitTime_","boundUpdateCurrentBreakpoint_","updateCurrentBreakpoint_","boundHandleTechClick_","handleTechClick_","boundHandleTechDoubleClick_","handleTechDoubleClick_","boundHandleTechTouchStart_","handleTechTouchStart_","boundHandleTechTouchMove_","handleTechTouchMove_","boundHandleTechTouchEnd_","handleTechTouchEnd_","boundHandleTechTap_","handleTechTap_","isFullscreen_","isPosterFromTech_","queuedCallbacks_","userActive_","debugEnabled_","audioOnlyMode_","audioPosterMode_","audioOnlyCache_","hiddenChildren","tagAttributes","languagesToLower","languages_","resetCache_","poster_","controls_","changingSrc_","playCallbacks_","playTerminatedQueue_","scrubbing_","fullscreenchange","fluid_","playerOptionsCopy","middleware_","parsedSVG","majorVersion","userActive","listenForUserActivity_","responsive","styleEl_","playerElIngest_","divEmbed","defaultsStyleEl","fill_","fluid","links","linkEl","techGet_","techCall_","posterImage","privDimension","parsedVal","aspectRatio_","width_","height_","idClass","ratioParts","ratioMultiplier","unloadTech_","titleTechName","camelTechName","techName_","normalizeAutoplay","techOptions","playsinline","techCanOverridePoster","TechClass","handleTechReady_","textTracksJson_","addedTrack","eventObj","seeking","handleTechLoadStart_","handleTechSourceset_","handleTechWaiting_","handleTechEnded_","handleTechSeeking_","handleTechPlay_","handleTechPause_","handleTechDurationChange_","handleTechFullscreenChange_","handleTechFullscreenError_","handleTechEnterPictureInPicture_","handleTechLeavePictureInPicture_","handleTechError_","handleTechPosterChange_","handleTechTextData_","handleTechRateChange_","usingNativeControls","addTechControlsListeners_","trackEls","trackObjs","trackEl","textTrackConverter","safety","removeTechControlsListeners_","manualAutoplay_","resolveMuted","previouslyMuted","restoreMuted","mutedPromise","matchingSources","findMimetype","sourceElSources","sourceEls","matchingSourceEls","sourceObj","updateSourceCaches","updateSourceCaches_","playerSrc","currentSource","eventSrc","lastSource_","techSrc","lastPlaybackRate","queued","timeWhenWaiting","timeUpdateListener","userActions","doubleClick","userWasActive","targetPlayer","isFs","initTime","inactivityTimeout","defaultPlaybackRate","reduceRight","play_","isSrcReady","isSafariOrIOS","waitToPlay_","resetProgressBar_","runPlayTerminatedQueue_","runPlayCallbacks_","percentAsDecimal","defaultMuted","isFS","toggleFullscreenClass_","fullscreenOptions","offHandler","requestFullscreenHelper_","fsOptions","supportsFullScreen","preferFullWindow","enterFullWindow","exitFullscreenHelper_","exitFullWindow","isFullWindow","docOrigOverflow","isPiP","isInPictureInPicture_","togglePictureInPictureClass_","pipContainer","titleBar","pipWindow","pipVideo","hotkeys","excludeElement","handleHotkeys","fullscreenKey","keydownEvent","muteKey","playPauseKey","FSToggle","techs","findFirstPassingTechSourcePair","outerArray","innerArray","tester","outerChoice","innerChoice","foundSourceAndTech","finder","sourceOrder","isRetry","resetRetryOnError_","middlewareSource","src_","handleSrc_","notSupportedMessage","setTech","retry","stopListeningForErrors","sourceTech","selectSource","vhs","doReset_","resetControlBarUI_","resetPlaybackRate_","resetVolumeBar_","currentTimeDisplay","durationDisplay","progressControl","loadProgressBar","techAutoplay","newPoster","usingNativeControls_","hookFunction","newErr","suppressNotSupportedError","triggerSuppressedError","errorDisplay","userActivity_","mouseInProgress","lastMoveX","lastMoveY","handleActivity","handleMouseUpAndMouseLeave","isAudio_","playerChildren","controlBarHeight","exitPromises","enableAudioOnlyUI_","disableAudioOnlyUI_","enablePosterModeUI_","disablePosterModeUI_","candidateBreakpoint","breakpoints_","breakpoint_","currentBreakpointClass","responsive_","removeCurrentBreakpoint_","artist","artwork","currentSources","baseOptions","tagOptions","dataSetup","childName","previousLogLevel_","newRates","html5","userLanguage","navigationUI","BASE_PLUGIN_NAME","pluginStorage","pluginExists","getPlugin","markPluginAsActive","triggerSetupEvent","createPluginFactory","PluginSubClass","plugin","getEventHash","isBasic","basicPluginWrapper","createBasicPlugin","deprecateForMajor","oldName","warned","deprecate","registerPlugin","usingPlugin","hasPlugin","normalizeId","videojs","getPlayer","rootNode","PlayerComponent","hookOnce","getPlayers","nId","getAllPlayers","writeable","mergeOptions","deregisterPlugin","getPlugins","getPluginVersion","addLanguage","EventTarget","QualityLevel","bitrate","QualityLevelList","levels_","selectedIndex_","qualityLevel","getQualityLevelById","removed","addqualitylevel","removequalitylevel","version$5","qualityLevels","originalPluginFn","qualityLevelList","disposeHandler","initPlugin$1","resolveManifestRedirect","req","responseURL","logger","TIME_FUDGE_FACTOR","SAFE_TIME_DELTA","filterRanges","timeRanges","findRange","findNextRange","printableRange","strArr","timeRangesToArray","timeRangesList","lastBufferedEnd","timeAheadOf","segmentDurationWithParts","getPartsAndSegments","si","getLastParts","lastSegment","getKnownPartCount","partCount","liveEdgeDelay","partHoldBack","holdBack","intervalDuration","endSequence","backwardDuration","forwardDuration","totalDuration","sumDurations","defaultDuration","durationList","durations","playlistEnd","useSafeLiveEnd","liveEdgePadding","lastSegmentEndTime","isExcluded","excludeUntil","isIncompatible","excluded","isLowestEnabledRendition","currentBandwidth","playlistMatch","someAudioVariant","variant","Playlist","getMediaInfoForTime","startingSegmentIndex","startingPartIndex","exactManifestTimings","partsAndSegments","partAndSegment","isAes","estimateSegmentRequestTime","bytesReceived","createPlaylistID","groupID","setupMediaPlaylist","playlistErrors_","addPropertiesToMain","createGroupID","phonyUri","audioOnlyMain","groupId","setupMediaPlaylists","resolveMediaGroupUris","DateRangesStorage","offset_","pendingDateRanges_","processedDateRanges_","firstSegment","programDateTime","dateRanges","dateRange","trimProcessedDateRanges_","pendingDateRange","dateRangeClasses","dateRangesToProcess","processDateRange","classListIndex","EventTarget$1","updateSegment","skipped","resolveSegmentUris","baseUri","getAllSegments","isPlaylistUnchanged","updateMain$1","newMedia","unchangedCheck","oldMedia","mergedPlaylist","skippedSegments","oldSegments","newSegments","newSegment","updateSegments","refreshDelay","lastPart","lastDuration","PlaylistLoader","logger_","vhs_","addDateRangesToTextTrack_","addDateRangesToTextTrack","vhsOptions","customTagParsers","customTagMappers","llhls","dateRangesStorage_","handleMediaupdatetimeout_","handleLoadedPlaylist_","mediaPlaylist","setPendingDateRanges","availableDateRanges","getDateRangesToProcess","parameters","nextMSN","nextPart","_HLS_part","_HLS_msn","canSkipUntil","_HLS_skip","parsedUri","searchParams","addLLHLSQueryDirectives","playlistRequestError","haveMetadata","playlistString","startingState","onwarn","oninfo","customParser","parseManifest","playlistObject","parseManifest_","lastRequest","pendingMedia_","media_","updateMediaUpdateTimeout_","stopRequest","mediaUpdateTimeout","finalRenditionTimeout","oldRequest","shouldDelay","mediaChange","mainPlaylistRef","started","setupInitialPlaylist","srcUri","mainForMedia","videojsXHR","callbackWrapper","reqResponse","responseTime","roundTripTime","requestTime","timedout","xhrFactory","XhrFunction","beforeRequest","Vhs","_requestCallbackSet","_responseCallbackSet","xhrMethod","beforeRequestOptions","requestSet","requestCallback","callAllRequestHooks","responseSet","responseCallback","callAllResponseHooks","originalAbort","segmentXhrHeaders","Range","byterangeEnd","byterangeStart","byterangeStr","textRange","formatHexString","formatAsciiString","createTransferableMessage","transferable","initSegmentId","segmentKeyId","hexDump","ascii","tagDump","textRanges","seekToProgramTime","programTime","retryCount","seekTo","pauseAfterSeek","verifyProgramDateTimeTags","matchedSegment","lastSegmentStart","lastSegmentDuration","videoTimingInfo","transmuxedPresentationEnd","transmuxedPresentationStart","transmuxerPrependedSeconds","estimatedStart","findSegmentForProgramTime","mediaOffset","comparisonTimeStamp","segmentDateTime","segmentTimeEpoch","getOffsetFromTimestamp","seekToTime","callbackOnCompleted","dashPlaylistUnchanged","aSegment","bSegment","aByterange","bByterange","dashGroupId","equivalentSidx","compareSidxEntry","oldSidxMapping","newSidxMapping","currentSidxInfo","savedSidxInfo","sidxInfo","DashPlaylistLoader","srcUrlOrPlaylist","mainPlaylistLoader","mainPlaylistLoader_","isMain_","addMetadataToTextTrack","refreshXml_","refreshMedia_","loadedPlaylists_","srcUrl","sidxMapping_","childPlaylist_","mediaRequest_","fin","requestErrored_","id3Offset","finished","endRequestAndCallback","_bytes","progressListener","newPart","buffers","totalLen","tempBuffer","concatTypedArrays","containerRequest","playlistExclusionDuration","minimumUpdatePeriodTimeout_","createMupOnMedia_","addSidxSegments_","sidxChanged","isFinalRendition","updateMinimumUpdatePeriodTimeout_","requestMain_","mainChanged","haveMain_","hasPendingRequest","mainXml_","mainLoaded_","handleMain_","syncClientServerClock_","utcTiming","UTCTimingNode","parseUTCTimingScheme","clientOffset_","serverTime","oldMain","newMain","mainXml","parsedManifestInfo","manifestUri","periodNodes","periods","priorPeriod","priorPeriodAttributes","mpdType","getPeriodStart","contentSteeringInfo","representationInfo","inheritAttributes","parseMainXml","noChanges","playlistUpdate","removeOldMediaGroupLabels","updateMain","addEventStreamToMetadataTrack_","mpl","mup","createMUPTimeout_","mediaGroupSidx","filterChangedSidxMappings","mediaID","mediaChanged","createMediaUpdateTimeout","metadataArray","eventStreamNode","cueTime","frames","Config","GOAL_BUFFER_LENGTH","MAX_GOAL_BUFFER_LENGTH","BACK_BUFFER_LENGTH","GOAL_BUFFER_LENGTH_RATE","INITIAL_BANDWIDTH","BANDWIDTH_VARIANCE","BUFFER_LOW_WATER_LINE","MAX_BUFFER_LOW_WATER_LINE","EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE","BUFFER_LOW_WATER_LINE_RATE","BUFFER_HIGH_WATER_LINE","browserWorkerPolyFill","workerObj","objectUrl","BlobBuilder","getBlob","worker","Worker","objURL","terminate","getWorkerString","TransmuxWorker","commonjsGlobal","Stream$8","flushSource","partialFlush","endTimeline","dinf","esds","ftyp","mfhd","minf","mvex","mvhd","trak","tkhd","mdia","mdhd","hdlr","sdtp","stbl","stsd","traf","trex","trun$1","MAJOR_BRAND","MINOR_VERSION","AVC1_BRAND","VIDEO_HDLR","AUDIO_HDLR","HDLR_TYPES","VMHD","SMHD","DREF","STCO","STSC","STSZ","STTS","videoSample","audioSample","audioTrun","videoTrun","trunHeader","MAX_UINT32$1","avc1","avcC","btrt","dref","mdat","mp4a","pasp","smhd","stco","stsc","stsz","stts","styp","tfdt","tfhd","trun","vmhd","payload","setUint32","audioobjecttype","samplingfrequencyindex","channelcount","samplerate","sequenceNumber","trackFragments","samples","dependsOn","isDependedOn","hasRedundancy","avc1Box","sps","pps","sequenceParameterSets","pictureParameterSets","profileIdc","profileCompatibility","levelIdc","sarRatio","hSpacing","vSpacing","samplesize","trackFragmentHeader","trackFragmentDecodeTime","trackFragmentRun","sampleDependencyTable","upperWordBaseMediaDecodeTime","lowerWordBaseMediaDecodeTime","baseMediaDecodeTime","durationPresent","sizePresent","flagsPresent","compositionTimeOffset","bytesOffest","sample","isLeading","paddingValue","isNonSyncSample","degradationPriority","silence","mp4Generator","fileType","movie","sampleForFrame","frame","dataOffset","pts","dts","keyFrame","frameUtils$1","groupNalsIntoFrames","nalUnits","currentNal","currentFrame","nalCount","nalUnitType","groupFramesIntoGops","currentGop","gops","extendFirstKeyFrame","generateSampleTable","baseDataOffset","concatenateNalData","nalsByteLength","numberOfNals","generateSampleTableForFrame","concatenateNalDataForFrame","highPrefix","lowPrefix","zeroFill","ONE_SECOND_IN_TS$4","clock$2","clock$1","audioFrameUtils$1","prefixWithSilence","audioAppendStartTs","videoBaseMediaDecodeTime","baseMediaDecodeTimeTs","frameDuration","silentFrame","firstFrame","audioGapDuration","audioFillFrameCount","audioFillDuration","coneOfSilence","96000","88200","64000","48000","44100","32000","24000","16000","12000","11025","8000","metaTable","trimAdtsFramesByEarliestDts","adtsFrames","earliestAllowedDts","minSegmentDts","minSegmentPts","concatenateFrameData","sumFrameByteLengths","ONE_SECOND_IN_TS$3","trackDecodeInfo$1","clearDtsInfo","maxSegmentDts","maxSegmentPts","calculateTrackBaseMediaDecodeTime","timelineStartInfo","collectDtsInfo","captionPacketParser","parseSei","payloadType","payloadSize","parseUserData","sei","parseCaptionPackets","userData","ccData","emulationPreventionBytesPositions","USER_DATA_REGISTERED_ITU_T_T35","Stream$7","cea708Parser","CaptionStream$2","parse708captions_","parse708captions","captionPackets_","ccStreams_","Cea608Stream","cc708Stream_","Cea708Stream","newCaptionPackets","escapedRBSP","latestDts_","ignoreNextEqualDts_","numSameDts_","flushCCStreams","flushType","flushStream","presortIndex","packet","dispatchCea608Packet","dispatchCea708Packet","activeCea608Channel_","ccStream","setsTextOrXDSActive","setsChannel1Active","setsChannel2Active","CHARACTER_TRANSLATION_708","within708TextBlock","Cea708Window","windowNum","clearText","pendingNewLine","winAttr","penAttr","penLoc","penColor","rowLock","columnLock","relativePositioning","anchorVertical","anchorHorizontal","anchorPoint","rowCount","virtualRowCount","windowStyle","penStyle","rows","rowIdx","beforeRowOverflow","addText","backspace","Cea708Service","serviceNum","encoding","currentWindow","createTextDecoder","startPts","setCurrentWindow","textDecoder_","serviceProps","captionServiceEncodings","serviceName","serviceEncodings","current708Packet","services","new708Packet","add708Bytes","push708Packet","ptsVals","byte0","byte1","packet708","packetData","seq","sizeCode","pushServiceBlock","initService","handleText","multiByteCharacter","extendedCommands","defineWindow","clearWindows","deleteWindows","displayWindows","hideWindows","toggleWindows","setWindowAttributes","setPenAttributes","setPenColor","setPenLocation","isExtended","getPts","flushDisplayed","charCodeArray","newCode","isMultiByte","extended","currentByte","nextByte","unicode","firstByte","secondByte","fillRed","fillGreen","fillBlue","borderType","borderRed","borderGreen","borderBlue","printDirection","scrollDirection","justify","effectSpeed","effectDirection","displayEffect","displayedText","winId","endPts","pushCaption","textTag","penSize","underline","edgeType","fontStyle","fgOpacity","fgRed","fgGreen","fgBlue","bgOpacity","bgRed","bgGreen","bgBlue","edgeRed","edgeGreen","edgeBlue","CHARACTER_TRANSLATION","getCharFromCode","ROWS","createDisplayBuffer","BOTTOM_ROW","dataChannel","field_","dataChannel_","setConstants","char0","char1","lastControlCode_","PADDING_","RESUME_CAPTION_LOADING_","mode_","END_OF_CAPTION_","clearFormatting","displayed_","nonDisplayed_","startPts_","ROLL_UP_2_ROWS_","rollUpRows_","setRollUp","ROLL_UP_3_ROWS_","ROLL_UP_4_ROWS_","CARRIAGE_RETURN_","shiftRowsUp_","BACKSPACE_","row_","ERASE_DISPLAYED_MEMORY_","ERASE_NON_DISPLAYED_MEMORY_","RESUME_DIRECT_CAPTIONING_","isSpecialCharacter","column_","isExtCharacter","isMidRowCode","addFormatting","isOffsetControlCode","isPAC","formatting_","indentations","isColorPAC","isNormalChar","logWarning","topRow_","BASE_","EXT_","CONTROL_","OFFSET_","newBaseRow","popOn","baseRow","rollUp","paintOn","captionStream","CaptionStream","streamTypes","H264_STREAM_TYPE","ADTS_STREAM_TYPE","METADATA_STREAM_TYPE","Stream$6","TYPE_SHARED","handleRollover$1","TimestampRolloverStream$1","lastDTS","referenceDTS","type_","MetadataStream","timestampRolloverStream","TimestampRolloverStream","handleRollover","typedArrayIndexOf","typedArray","fromIndex","percentEncode$1","parseUtf8","parseIso88591$1","parseSyncSafeInteger$1","frameParsers","mimeTypeEndIndex","descriptionEndIndex","pictureType","pictureData","privateData","parseId3","parseId3Frames","frameSize","frameStart","tagSize","parseSyncSafeInteger","StreamTypes$3","id3","dispatchType","dataAlignmentIndicator","TransportPacketStream","TransportParseStream","ElementaryStream","metadataStream","Stream$4","CaptionStream$1","StreamTypes$2","MP2T_PACKET_LENGTH$1","bytesInBuffer","everything","parsePsi","parsePat","parsePmt","packetsWaitingForPmt","programMapTable","payloadUnitStartIndicator","pat","section_number","last_section_number","pmtPid","pmt","tableEnd","pid","processPes_","STREAM_TYPES","h264","adts","segmentHadPmt","timedMetadata","forceFlush","packetFlushable","trackId","pes","ptsDtsFlags","startPrefix","packetLength","parsePes","flushStreams_","m2ts$1","PAT_PID","MP2T_PACKET_LENGTH","AdtsStream$1","m2ts_1","ONE_SECOND_IN_TS$2","ADTS_SAMPLING_FREQUENCIES$1","handlePartialSegments","frameNum","skipWarn_","frameLength","protectionSkipBytes","oldBuffer","sampleCount","adtsFrameDuration","H264Stream$1","NalByteStream","PROFILES_WITH_OPTIONAL_SPS_DATA","Stream$2","ExpGolomb","workingData","workingBytesAvailable","workingWord","workingBitsAvailable","bitsAvailable","loadWord","workingBytes","availableBytes","skipBits","skipBytes","readBits","bits","valu","skipLeadingZeros","leadingZeroCount","skipUnsignedExpGolomb","skipExpGolomb","readUnsignedExpGolomb","clz","readExpGolomb","readBoolean","readUnsignedByte","syncPoint","swapBuffer","100","110","122","244","44","83","86","118","128","138","139","134","currentPts","currentDts","readSequenceParameterSet","skipScalingList","nalByteStream","nalUnitTypeCode","expGolombDecoder","lastScale","nextScale","chromaFormatIdc","picOrderCntType","numRefFramesInPicOrderCntCycle","picWidthInMbsMinus1","picHeightInMapUnitsMinus1","frameMbsOnlyFlag","scalingListCount","frameCropLeftOffset","frameCropRightOffset","frameCropTopOffset","frameCropBottomOffset","AacStream$1","H264Stream","ADTS_SAMPLING_FREQUENCIES","parseId3TagSize","isLikelyAacData","parseAdtsSize","lowThree","parseType","parseSampleRate","parseAacTimestamp","percentEncode","aacUtils","setTimestamp","bytesLeft","tempLength","VideoSegmentStream","AudioSegmentStream","Transmuxer","CoalesceStream","frameUtils","audioFrameUtils","trackDecodeInfo","m2ts","clock","AdtsStream","AacStream","ONE_SECOND_IN_TS$1","AUDIO_PROPERTIES","VIDEO_PROPERTIES","retriggerForStream","addPipelineLogRetriggers","transmuxer","pipeline","arrayEquals","generateSegmentTimingInfo","startDts","endDts","prependedContentDuration","firstSequenceNumber","setEarliestDts","earliestDts","setVideoBaseMediaDecodeTime","setAudioAppendStart","videoClockCyclesOfSilencePrefixed","gopsToAlignWith","minPTS","gopCache_","nalUnit","gopForFusion","firstGop","lastGop","resetStream_","getGopForFusion_","alignedGops","alignGopsAtEnd","alignGopsAtEnd_","alignGopsAtStart_","gop","dtsDistance","nearestGopObj","currentGopObj","nearestDistance","alignIndex","gopIndex","alignEndIndex","matchFound","trimIndex","alignGopsWith","newGopsToAlignWith","numberOfTracks","remux","remuxTracks","pendingTracks","videoTrack","pendingBoxes","pendingCaptions","pendingMetadata","pendingBytes","emittedTracks","audioTrack","captionStreams","setRemux","hasFlushed","transmuxPipeline_","setupAacPipeline","aacStream","audioTimestampRolloverStream","timedMetadataTimestampRolloverStream","adtsStream","coalesceStream","headOfPipeline","audioSegmentStream","getLogTrigger_","hasAudio","hasVideo","setupTsPipeline","packetStream","elementaryStream","h264Stream","videoSegmentStream","id3Frame","setBaseMediaDecodeTime","isAac","resetCaptions","getTimescaleFromMediaHeader","bin","parseType_1","toUnsigned$2","parseType$2","findBox$2","subresults","toUnsigned$1","getUint64$2","parseTfdt$2","parseSampleFlags","parseTrun$2","dataOffsetPresent","firstSampleFlagsPresent","sampleDurationPresent","sampleSizePresent","sampleFlagsPresent","sampleCompositionTimeOffsetPresent","getInt32","parseTfhd$2","baseDataOffsetPresent","sampleDescriptionIndexPresent","defaultSampleDurationPresent","defaultSampleSizePresent","defaultSampleFlagsPresent","durationIsEmpty","defaultBaseIsMoof","sampleDescriptionIndex","defaultSampleDuration","defaultSampleSize","defaultSampleFlags","baseDataOffsetIsMoof","findBox$1","parseTfdt$1","parseTrun$1","parseTfhd$1","window$2","mapToSample","approximateOffset","captionParser","segmentCache","parsedCaptions","parsingPartial","isInitialized","isPartial","logs","isNewInit","videoTrackIds","timescales","parsedData","cachedSegment","trackNals","videoTrackId","trafs","mdats","captionNals","mdatTrafPairs","matchingTraf","pair","headerInfo","truns","avcStream","seiNal","lastMatchedSample","avcView","seiNals","matchingSample","findSeiNals","allSamples","parseSamples","parseCaptionNals","parseEmbeddedCaptions","pushNals","nals","nal","clearParsedCaptions","resetCaptionStream","clearAllCaptions","uint8ToCString","curChar","retString","getUint64$1","isDefined","toUnsigned","toHexString","parseType$1","emsg","boxData","scheme_id_uri","presentation_time","presentation_time_delta","event_duration","emsgBox","message_data","hasScheme","isValidV0Box","isValidV1Box","isValidEmsgBox","timeDelta","window$1","probe$2","lowestTime","baseTime","traks","tkhdVersion","getUint8","sampleDescriptions","codecConfig","codecBox","segmentData","parsedBox","parsedId3Frames","StreamTypes$1","parsePid","parsePayloadUnitStartIndicator","parseAdaptionField","parseNalUnitType","probe$1","pusi","payloadOffset","parsePesType","parsePesTime","videoPacketContainsKeyFrame","frameBuffer","frameI","frameSyncPoint","foundKeyFrame","StreamTypes","probe","SYNC_BYTE","parseAudioPes_","pesType","endLoop","parseVideoPes_","firstKeyFrame","tsInspector","baseTimestamp","audioCount","audioTimescale","inspectAac_","parsePsi_","inspectTs_","audioBaseTimestamp","dtsTime","ptsTime","videoBaseTimestamp","adjustTimestamp_","MessageHandlers","initArray","gopInfo","timingInfo","videoSegmentTimingInfo","presentation","audioSegmentTimingInfo","trackInfo","audioTimingInfo","wireTransmuxerEvents","trackIds","id3Frames","emsgData","baseStartTime","tsStartTime","timeInfo","videoStart","audioStart","timestampOffset","appendStart","onmessage","messageHandlers","processTransmux","audioAppendStart","onData","onTrackInfo","onAudioTimingInfo","onVideoTimingInfo","onVideoSegmentTimingInfo","onAudioSegmentTimingInfo","onId3","onCaptions","onEndedTimeline","onTransmuxerLog","isEndOfTimeline","transmuxedData","waitForEndedTimelineEvent","currentTransmux","videoFrameDtsTime","videoFramePtsTime","handleData_","handleGopInfo_","handleDone_","transmuxQueue","processAction","segmentTransmuxer","enqueueAction","workerCallback","endAction","listenForEndEvent","isArrayBuffer","transfers","REQUEST_ERRORS","abortAll","activeXhrs","handleErrors","handleKeyResponse","finishProcessingFn","errorObj","parseInitSegment","transmuxAndNotify","trackInfoFn","timingInfoFn","videoSegmentTimingInfoFn","audioSegmentTimingInfoFn","id3Fn","captionsFn","endedTimelineFn","dataFn","doneFn","fmp4Tracks","isMuxed","audioStartFn","audioEndFn","videoStartFn","videoEndFn","probeResult","transmux","handleSegmentBytes","bytesAsUint8Array","isLikelyFmp4MediaSegment","isFmp4","audioCodec","videoCodec","finishLoading","decrypt","encryptedBytes","decryptionWorker","decryptionHandler","decrypted","keyBytes","encrypted","mediaSegmentRequest","xhrOptions","abortFn","progressFn","didError","segmentFinish","requestId","decryptedBytes","decryptSegment","endOfAllRequests","parseError","waitForCompletion","keyXhr","mapKeyXhr","initSegmentXhr","handleInitSegmentResponse","segmentRequestOptions","segmentXhr","newBytes","stringToArrayBuffer","lastReachedChar","stats","getRequestStats","handleSegmentResponse","progressEvent","getProgressStats","firstBytesReceivedAt","handleProgress","loadendState","activeXhr","calledAbortFn","handleLoadEnd","logFn$1","isMaat","mediaAttributes","unwrapCodecList","codecList","codecCount","codecObj","codecsForPlaylist","codecInfo","getCodecs","audioGroup","defaultCodecs","audioGroupId","audioType","codecsFromDefault","logFn","representationToString","safeGetComputedStyle","stableSort","sortFn","cmp","comparePlaylistBandwidth","leftBandwidth","rightBandwidth","simpleSelector","playerBandwidth","limitRenditionByPlayerDimensions","playlistController","getAudioTrackPlaylists_","sortedPlaylistReps","rep","enabledPlaylistReps","bandwidthPlaylistReps","highestRemainingBandwidthRep","bandwidthBestRep","chosenRep","haveResolution","resolutionBestRepList","resolutionBestRep","resolutionPlusOneList","resolutionPlusOneSmallest","resolutionPlusOneRep","leastPixelDiffRep","leastPixelDiffSelector","leastPixelDiffList","pixelDiff","lastBandwidthSelector","useDevicePixelRatio","systemBandwidth","playlistController_","dateRangeAttr","scte35Out","scte35In","dateRangeKeysToOmit","createMetadataTrackIfNotExists","inbandTextTracks","metadataTrack_","inBandMetadataTrackDispatchType","removeCuesFromTrack","finite","MIN_SEGMENT_DURATION_TO_SAVE_STATS","segmentInfoString","startOfSegment","mediaIndex","segmentLen","isSyncRequest","independent","hasPartIndex","zeroBasedPartCount","timingInfoPropertyForMedia","getBufferedEndOrFallback","fallback","shouldWaitForTimelineChange","timelineChangeController","loaderType","audioDisabled","lastMainTimelineChange","lastTimelineChange","pendingAudioTimelineChange","pendingTimelineChange","segmentTooLong","maxDuration","SegmentLoader","mediaSource","throughput","roundTrip","resetStats_","hasPlayed_","hasPlayed","seekable_","seeking_","mediaSource_","loaderType_","currentMediaInfo_","startingMediaInfo_","segmentMetadataTrack_","segmentMetadataTrack","goalBufferLength_","goalBufferLength","sourceType_","sourceType","sourceUpdater_","sourceUpdater","inbandTextTracks_","state_","timelineChangeController_","shouldSaveSegmentTimingInfo_","useDtsForTimestampOffset_","useDtsForTimestampOffset","calculateTimestampOffsetForEachSegment_","calculateTimestampOffsetForEachSegment","captionServices_","checkBufferTimeout_","currentTimeline_","pendingSegment_","xhrOptions_","pendingSegments_","audioDisabled_","isPendingTimestampOffset_","gopBuffer_","timeMapping_","safeAppend_","appendInitSegment_","playlistOfLastInitSegment_","callQueue_","loadQueue_","metadataQueue_","waitingOnRemove_","quotaExceededErrorRetryTimeout_","activeInitSegmentId_","initSegments_","cacheEncryptionKeys_","cacheEncryptionKeys","keyCache_","decrypter_","decrypter","syncController_","syncController","syncPoint_","transmuxer_","createTransmuxer_","triggerSyncInfoUpdate_","isEndOfStream_","ended_","fetchAtBuffer_","replaceSegmentsUntil_","newState","hasEnoughInfoToAppend_","processCallQueue_","hasEnoughInfoToLoad_","processLoadQueue_","term","mediaBytesTransferred","mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaSecondsLoaded","mediaAppends","abort_","removeAudio","monitorBuffer_","abortRequests","clearPendingTimelineChange","getMediaInfo_","videoBuffered","audioBuffered","storedMap","storedKey","playlist_","couldBeginLoading_","init_","resetEverything","newPlaylist","syncInfo","setDateTimeMappingForStart","oldId","resyncLoader","resetLoader","mediaSequenceDiff","saveExpiredSegmentInfo","resetLoaderProperties","removesRemaining","removeFinished","mapping","updatedBuffer","removeGopBuffer","removeVideo","monitorBufferTick_","fillBuffer_","updating","chooseNextRequest_","loadSegment_","appendedLastSegment","appendedLastPart","buffered_","bufferedTime","preloaded","haveEnoughBuffer","getSyncPoint","targetTime","timelineSegments","getSyncSegmentCandidate","nextSegment","hasIndependentSegments","lastSegmentLastPart","generateSegmentInfo_","forceTimestampOffset","overrideCheck","timestampOffsetForSegment_","audioBufferedEnd","audioTimestampOffset","currentTimePts","gopsSafeToAlignWith","videoTimestampOffset","timestampOffsetForSegment","measuredBandwidth","requestTimeRemaining","timeUntilRebuffer$1","timeUntilRebuffer","switchCandidate","compatiblePlaylists","enabledPlaylists","rebufferingEstimates","numRequests","rebufferingImpact","noRebufferingPlaylists","estimate","minRebufferMaxBandwidthSelector","timeSavedBySwitching","minimumTimeSaving","simpleSegment","earlyAbortWhenNeeded_","checkForAbort_","checkForIllegalMediaSwitch","akeys","bkeys","shallowEqual","timeType","timingInfoProperty","captionData","hasAppendedData_","handleCaptions_","captionTracks","captionTrack","trackName","getTrackById","captionService","createCaptionsTrackIfNotExists","captionArray","Cue","addCaptionData","handleId3_","callQueue","fun","loadQueue","getCurrentMediaInfo_","setTimeMapping_","updateMediaSecondsLoaded_","initSegmentForMap","segmentKey","useVideoTimingInfo","firstVideoFrameTimeForData","trueSegmentStart_","currentStart","currentVideoTimestampOffset","updateAppendInitSegmentStatus","updateSourceBufferTimestampOffset_","updateTimingInfoEnd_","saveSegmentTimingInfo","shouldSaveTimelineMapping","processMetadataQueue_","appendData_","changedTimestampOffset","audioBufferStart","audioBufferEnd","videoBufferStart","videoBufferEnd","appendToSourceBuffer_","timeToRemoveUntil","MIN_BACK_BUFFER","handleQuotaExceededError_","segmentObj","concatSegments","appendBuffer","handleAppendError_","segmentTimingInfo","transmuxedDecodeStart","transmuxedDecodeEnd","getInitSegmentAndUpdateState_","trimBackBuffer_","updateTransmuxerAndRequestSegment_","shouldUpdateTransmuxerTimestampOffset_","createSimplifiedSegmentObj_","isEndOfStream","isWalkingForward","isDiscontinuity","handleAbort_","handleProgress_","handleTrackInfo_","handleTimingInfo_","handleSegmentTimingInfo_","segmentRequestFinished_","removeToTime","trimTime","maxTrimTime","safeBackBufferTrimTime","previousSegment","saveTransferStats_","handleTimeout_","saveBandwidthRelatedStats_","updateGopBuffer","waitForAppendsToComplete_","timelineMapping","mappingForTimeline","waitForVideo","waitForAudio","waitingOnAppends","checkAppendsDone_","videoQueueCallback","audioQueueCallback","handleAppendsDone_","illegalMediaSwitchError","startingMedia","illegalMediaSwitch","didChange","getSegmentStartTimeForTimestampOffsetCalculation_","prioritizedTimingInfo","segmentDurationMessage","timingInfos","typeTimingInfo","mediaDuration","isSegmentWayTooLong","isSegmentSlightlyTooLong","segmentTooLongMessage","severity","getTroublesomeSegmentDurationMessage","recordThroughput_","addSegmentMetadataCue_","badSegmentGuess","badPartGuess","endOfStream","segmentProcessingTime","segmentProcessingThroughput","bufferTypes","sourceBuffer","queuePending","shiftQueue","queueIndex","queueEntry","nextQueueIndexOfType","cleanupBuffer","titleType","inSourceBuffers","sourceBuffers","actions","mime","addSourceBuffer","removeSourceBuffer","changeType","pushQueue","onUpdateend","bufferedAsString","prettyBuffered","SourceUpdater","sourceopenListener_","audioTimestampOffset_","videoTimestampOffset_","delayedAudioAppendQueue_","videoAppendQueued_","onVideoUpdateEnd_","onAudioUpdateEnd_","onVideoError_","videoError_","onAudioError_","audioError_","createdSourceBuffers_","initializedEme_","triggeredReady_","hasCreatedSourceBuffers","hasInitializedAnyEme","addOrChangeSourceBuffers","canRemoveSourceBuffer","canChangeType","processedAppend_","videoBuffer","que","audioBuffer","bufferA","bufferB","arity","extents","bufferIntersection","uint8ToUtf8","uintArray","VTT_LINE_TERMINATORS","NoVttJsError","VTTSegmentLoader","subtitlesTrack_","featuresNativeTextTracks_","loadVttJs","combinedByteLength","combinedSegment","timestampOffsetForTimeline","checkTimestampOffset","skipEmptySegments_","stopForError","requested","parseVTTCues_","updateTimeMapping_","timelines","uniqueCues","cueKey","removeDuplicateCuesFromTrack","decodeBytesToString","timestampmap","MPEGTS","LOCAL","mapData","mappingObj","firstStart","lastStart","findAdCue","mediaTime","adStartTime","adEndTime","syncPointStrategies","timelineToDatetimeMappings","lastDistance","datetimeMapping","discontinuitySync","discontinuities","SyncController","syncPoints","runStrategies_","selectSyncPoint_","strategy","bestSyncPoint","bestDistance","bestStrategy","lastRemovedSegment","playlistTimestamp","didCalculateSegmentTimeMapping","calculateSegmentTimeMapping_","saveDiscontinuitySyncInfo_","dateTime","accuracy","mediaIndexDiff","TimelineChangeController","pendingTimelineChanges_","lastTimelineChanges_","Decrypter","aesTables","AES","tables","encTable","decTable","sbox","sboxInv","xInv","x4","x8","tEnc","tDec","precompute","_tables","keyLen","rcon","encKey","decKey","encrypted0","encrypted1","encrypted2","encrypted3","a2","nInnerRounds","kIndex","table0","table1","table2","table3","AsyncStream","jobs","timeout_","processJob_","job","ntoh","initVector","STEP","encrypted32","Int32Array","asyncStream_","decryptChunk_","padded","decipher","decrypted32","init0","init1","init2","init3","wordIx","audioTrackKind_","stopLoaders","segmentLoader","activePlaylistLoader","startLoaders","playlistLoader","excludePlaylist","activeTrack","activeGroup","defaultTrack","onTrackChanged","setupListeners","segmentLoaders","initialize","variantLabel","isMainPlaylist","useForcedSubtitles","newProps","groupMatch","SteeringManifest","priority_","version_","ttl_","reloadUri_","ContentSteeringController","currentPathway","defaultPathway","availablePathways_","excludedPathways_","steeringManifest","proxyServerUrl_","manifestType_","ttlTimeout_","request_","excludedSteeringManifestURLs","xhr_","getBandwidth_","steeringTag","serverUri","steeringUri","decodeDataUriManifest_","reloadUri","pathwayId","defaultServiceLocation","proxyServerURL","requestSteeringManifest","initialUri","getRequestURI","errorInfo","retrySeconds","startTTLTimeout_","steeringManifestJson","assignSteeringProperties_","steeringUrl","steeringUrlObject","proxyServerUrlObject","setSteeringParams_","dataUri","urlObject","getPathway","networkThroughput","pathwayKey","throughputKey","steeringJson","TTL","nextPathway","pathwaysByPriority","chooseNextPathway","proxyURI","setProxyServerUrl_","steeringURI","ttlMS","clearTTLTimeout_","pathway","Vhs$1","loaderStats","sumLoaderStat","stat","audioSegmentLoader_","mainSegmentLoader_","PlaylistController","externVhs","useCueTags","enableLowInitialPlaylist","bufferBasedABR","maxPlaylistRetries","useCueTags_","cueTagsTrack_","requestOptions_","pauseLoading","mediaTypes_","getActiveGroup","onGroupChanged","lastTrack_","createMediaTypes","handleDurationChange_","handleSourceOpen_","handleSourceEnded_","segmentLoaderSettings","setupMainPlaylistLoaderListeners_","subtitleSegmentLoader_","contentSteeringController_","setupSegmentLoaderListeners_","startABRTimer_","stopABRTimer_","triggeredFmp4Usage","loadOnPlay_","timeToLoadedData__","mainAppendsToLoadedData__","audioAppendsToLoadedData__","timeToLoadedDataStart","mainAppendsToLoadedData_","audioAppendsToLoadedData_","nextPlaylist","selectPlaylist","shouldSwitchToMedia_","switchMedia_","newId","dashMediaPlaylists","abrTimer_","checkABR_","defaultPlaylists","groupKeys","defaultGroup","requestTimeout","audioSegmentLoader","mainSegmentLoader","variants","groupPropertyList","previousActiveLoader","lastGroup","lastGroup_","onGroupChanging","lastTrack","pc","fastQualityChange_","setAudio","activeTrack_","onAudioTrackChanged","setupMediaGroups","triggerPresenceUsage_","setupFirstPlay","updatedPlaylist","selectedMedia","initContentSteeringController_","excludeUnsupportedVariants_","selectInitialPlaylist","initialMedia_","handleUpdatedMediaPlaylist","playlistToExclude","lastExcludeReason_","stuckAtPlaylistEnd_","updateAdCues_","updateDuration","defaultDemuxed","audioGroupKeys","currentPlaylist","bufferLowWaterLine","bufferHighWaterLine","sharedLogLine","isBuffered","forwardBuffer","maxBufferLowWaterLine","nextBandwidth","currBandwidth","logLine","shouldSwitchToMedia","onSyncInfoUpdate_","onEndOfStream","delegateLoaders_","updateCodecs","tryToCreateSourceBuffers_","getCodecsOrExclude_","resetMainLoaderReplaceSegments","replaceSegmentsUntil","mainMediaInfo","getExpiredTime","absolutePlaylistEnd","pathwayAttribute_","reIncludeDelay","excludePathway","excludeThenChangePathway_","addAvailablePathway","reincluded","errorMessage","delayDuration","fnNames","loaders","dontFilterPlaylist","loader","audioSeekable","mainSeekable","oldEnd","oldStart","updateDuration_","setDuration","usingAudioLoader","hasMainMediaInfo","hasAudioMediaInfo","getPendingSegmentPlaylist","playlistCodecs","unsupportedCodecs","unsupportedAudio","supporter","switchMessages","newCodec","oldCodec","areMediaTypesKnown_","createSourceBuffers","excludeIncompatibleVariants_","ids","codecCount_","videoDetails","audioDetails","exclusionReasons","variantCodecs","variantCodecCount","variantVideoDetails","variantAudioDetails","adOffset","adTotal","updateAdCues","newMax","metadataTrack","addDateRangeMetadata","videoDuration","deprecateOldCue","cuesArray","cuesGroupedByStartTime","timeSlot","sortedStartTimes","cueGroup","finiteDuration","nextTime","addMetadata","initialMain","updateSteeringValues","assignTagProperties","clearAvailablePathways","didEnablePlaylists","differentPathwayId","noExcludeUntil","changeSegmentPathway_","switchMediaForDASHContentSteering_","Representation","vhsHandler","qualityChangeFunction","playlistID","changePlaylistFn","incompatible","currentlyEnabled","timerCancelEvents","PlaybackWatcher","allowSeeksWithinUnsafeLiveWindow","liveRangeSafeTimeDelta","consecutiveUpdates","lastRecordedTime","checkCurrentTimeTimeout_","playHandler","monitorCurrentTime_","canPlayHandler","waitingHandler","techWaiting_","cancelTimerHandler","resetTimeUpdate_","loaderTypes","loaderChecks","resetSegmentDownloads_","updateend","checkSegmentDownloads_","setSeekingHandlers","seekingAppendCheck_","fixesBadSeeks_","clearSeekingAppendCheck_","watchForBadSeeking_","checkCurrentTime_","isBufferedDifferent","isRangeDifferent","playlistId","waiting_","afterSeekableWindow_","beforeSeekableWindow_","minAppendedDuration","bufferedToCheck","nextRange","livePoint","videoUnderflow_","skipTheGap_","allowedEnd","isLLHLS","lastVideoRange","videoRange","audioRange","gapFromVideoUnderflow_","scheduledCurrentTime","gaps","findGaps","defaultOptions","errorInterval","IWillNotUseThisInPlugins","initPlugin","lastCalled","localOptions","loadedMetadataHandler","getSource","cleanupEvents","reloadSourceOnError","version$4","STANDARD_PLAYLIST_SELECTOR","INITIAL_PLAYLIST_SELECTOR","movingAverageBandwidthSelector","decay","average","lastSystemBandwidth","comparePlaylistResolution","leftWidth","rightWidth","LOCAL_STORAGE_KEY","handleVhsMediaChange","getVhsLocalStorage","storedObject","addOnRequestHook","addOnResponseHook","removeOnRequestHook","removeOnResponseHook","supportsNativeHls","canItPlay","supportsNativeDash","supportsTypeNatively","onRequest","onResponse","offRequest","offResponse","VhsHandler","initialBandwidth","_player","source_","ignoreNextSeekingEvent_","setOptions_","overrideNative","overrideNativeAudioTracks","overrideNativeVideoTracks","featuresNativeVideoTracks","useBandwidthFromLocalStorage","useNetworkInformationApi","playbackWatcherOptions","playbackWatcher_","defaultSelector","playerBandwidthEst","networkInformation","tenMbpsAsBitsPerSecond","networkInfoBandwidthEstBitsPerSec","downlink","invBandwidth","invThroughput","mediaRequests_","mediaRequestsAborted_","mediaRequestsTimedout_","mediaRequestsErrored_","mediaTransferDuration_","mediaBytesTransferred_","mediaSecondsLoaded_","mediaAppends_","mainAppendsToLoadedData","audioAppendsToLoadedData","appendsToLoadedData","appendsToLoadedData_","timeToLoadedData","timeToLoadedData_","currentTech","playerDimensions","currentDimensions","objectToStore","updateVhsLocalStorage","setupEme_","setupQualityLevels_","mediaSourceUrl_","audioPlaylistLoader","sourceKeySystems","audioMedia","mainPlaylists","eme","initializeMediaKeys","keySystemsOptionsArr","keySystems","keySystemsArr","keySystemsOptions","keySystemsObj","keySystemOptions","initializationFinishedPromises","keySessionCreatedPromises","waitForKeySessionCreation","initializedEme","createKeySessions_","didSetupEmeOptions","sourceOptions","audioPlaylist","videoContentType","audioContentType","keySystemContentTypes","emeKeySystems","setupEmeOptions","excludedHDPlaylists","handleWaitingForKey_","qualityLevels_","addQualityLevel","handleVhsLoadedMetadata","segmentEnd","findSegmentForPlayerTime","seekTime","programTimeObject","mediaSeconds","playerTime","offsetFromSegmentStart","playerTimeToProgramTime","getProgramTime","VhsSourceHandler","setupXhrHooks_","simpleType","getOverrideNative","defaultOverrideNative","nameOffset","verOffset","nAgt","browserName","fullVersion","homeSearchVideo","appName","appVersion","getDetail","hasTouch","documentHtml","browserVersion","loadPage","tabs","aosAnim","accordion","fancyboxGallery","videoJs","applyForm"],"mappings":";gBACIA,EADAC,ECAAC,EACAC,E,oBCDJ,SAASC,IAgBP,OAfAC,EAAOC,QAAUF,EAAWG,OAAOC,QAAU,SAAUC,GACrD,IAAK,IAAIC,EAAI,EAAGA,EAAIC,UAAUC,OAAQF,IAAK,CACzC,IAAIG,EAASF,UAAUD,GAEvB,IAAK,IAAII,KAAOD,EACVN,OAAOQ,UAAUC,eAAeC,KAAKJ,EAAQC,KAC/CL,EAAOK,GAAOD,EAAOC,IAK3B,OAAOL,GAGTJ,EAAOC,QAAP,QAA4BD,EAAOC,QAASD,EAAOC,QAAQY,YAAa,EACjEd,EAASe,MAAMC,KAAMT,WAG9BN,EAAOC,QAAUF,EACjBC,EAAOC,QAAP,QAA4BD,EAAOC,QAASD,EAAOC,QAAQY,YAAa,G,kCClBxE,IAAIG,EAAS,EAAQ,MA2DrBhB,EAAOC,QAzDmB,SAA6BgB,EAAUC,GAK/D,YAJ2B,IAAvBA,IACFA,GAAqB,GAGhB,SAAUC,EAAKC,EAAUC,GAE9B,GAAIF,EACFF,EAASE,QAKX,GAAIC,EAASE,YAAc,KAAOF,EAASE,YAAc,IAAzD,CACE,IAAIC,EAAQF,EAEZ,GAAIH,EACF,GAAIF,EAAOQ,YAAa,CACtB,IAAIC,QAsBc,KADRC,EArBeN,EAASO,SAAWP,EAASO,QAAQ,mBAuBpED,EAAoB,IAGfA,EAAkBE,cAAcC,MAAM,KAAKC,QAAO,SAAUL,EAASM,GAC1E,IAAIC,EAAqBD,EAAYF,MAAM,KACvCI,EAAOD,EAAmB,GAC1BE,EAAQF,EAAmB,GAE/B,MAAoB,YAAhBC,EAAKE,OACAD,EAAMC,OAGRV,IACN,UAlCK,IACEF,EAA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KACzB8ta,GAAcA,GAAY91Z,UAAU,EAAGygO,MAGL,IAA/Bq1L,GAAY9ta,QAAQ,OACvBy4O,GAAKq1L,GAAY9ta,QAAQ,KACzB8ta,GAAcA,GAAY91Z,UAAU,EAAGygO,KAGzC4+G,GAAex3Q,SAAS,GAAD,OAAKiuV,IAAgB,IAGxCnsT,MAAM01O,MACRy2E,GAAc,GAAH,OAAO3hU,WAAWguB,UAAU8zS,aACvC52E,GAAex3Q,SAASs6C,UAAU8zS,WAAY,KAGzC,CAAE7ka,KAAMyka,GAAa/4Z,QAASuiV,OC7E5B82E,GAAW,iBAAkBnsV,SAI7B00M,IAHU,0BAA0BzwR,KAAKk0H,UAAUyI,UACvC,aAAa38H,KAAKk0H,UAAUyI,UAC/BzI,UAAUC,UAAUj8C,MAAM,SACxBg8C,UAAUC,UAAUj8C,MAAM,4GACvBg8C,UAAUC,UAAUj8C,MAAM,SCGnC,WAChB,IAAMiwV,EAAepsV,SAASrqE,qBAAqB,QAAQ,GACrDk2Z,EAAcjtS,eAAoBx3H,KAAKzM,eAAiB,GACxD0xa,EAAiBztS,eAAoB9rH,SAAW,GAEhDk5G,EAAU,GAgChB,MAAO,CACLrrC,KANW,WAnBXqrC,EAAQ5tH,KAAK,SACT+ta,GACFngT,EAAQ5tH,KAAK,SAEb4tH,EAAQ5tH,KAAK,YAGXs2R,GACF1oK,EAAQ5tH,KAAK,UAEb4tH,EAAQ5tH,KAAK,WAEf4tH,EAAQ5tH,KAAKyta,EAAYzpa,QAAQ,KAAM,MACvC4pH,EAAQ5tH,KAAKiua,GACbrgT,EAAQ5tH,KAAK,MACb4tH,EAAQzrC,QACR6rV,EAAavgV,UAAYmgC,EAAQt7G,KAAK,OA7BxB,GCGhB47Z,OAGAr9U,IAEAo0G,IAIAkmF,KACAgjJ,KACAC,KACAC,KACA3tV,YACA4tV,KACAC,KACAC,I","file":"assets/js/main.js","sourcesContent":["var getProto = Object.getPrototypeOf ? function(obj) { return Object.getPrototypeOf(obj); } : function(obj) { return obj.__proto__; };\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach(function(key) { def[key] = function() { return value[key]; }; });\n\t}\n\tdef['default'] = function() { return value; };\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","var inProgress = {};\nvar dataWebpackPrefix = \"blueprint-webpack-boilerplate:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = function(url, done, key, chunkId) {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = function(prev, event) {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach(function(fn) { return fn(event); });\n\t\tif(prev) return prev(event);\n\t}\n\t;\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","function _extends() {\n module.exports = _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\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n return _extends.apply(this, arguments);\n}\n\nmodule.exports = _extends;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","\"use strict\";\n\nvar window = require('global/window');\n\nvar httpResponseHandler = function httpResponseHandler(callback, decodeResponseBody) {\n if (decodeResponseBody === void 0) {\n decodeResponseBody = false;\n }\n\n return function (err, response, responseBody) {\n // if the XHR failed, return that error\n if (err) {\n callback(err);\n return;\n } // if the HTTP status code is 4xx or 5xx, the request also failed\n\n\n if (response.statusCode >= 400 && response.statusCode <= 599) {\n var cause = responseBody;\n\n if (decodeResponseBody) {\n if (window.TextDecoder) {\n var charset = getCharset(response.headers && response.headers['content-type']);\n\n try {\n cause = new TextDecoder(charset).decode(responseBody);\n } catch (e) {}\n } else {\n cause = String.fromCharCode.apply(null, new Uint8Array(responseBody));\n }\n }\n\n callback({\n cause: cause\n });\n return;\n } // otherwise, request succeeded\n\n\n callback(null, responseBody);\n };\n};\n\nfunction getCharset(contentTypeHeader) {\n if (contentTypeHeader === void 0) {\n contentTypeHeader = '';\n }\n\n return contentTypeHeader.toLowerCase().split(';').reduce(function (charset, contentType) {\n var _contentType$split = contentType.split('='),\n type = _contentType$split[0],\n value = _contentType$split[1];\n\n if (type.trim() === 'charset') {\n return value.trim();\n }\n\n return charset;\n }, 'utf-8');\n}\n\nmodule.exports = httpResponseHandler;","\"use strict\";\n\nvar window = require(\"global/window\");\n\nvar _extends = require(\"@babel/runtime/helpers/extends\");\n\nvar isFunction = require('is-function');\n\ncreateXHR.httpHandler = require('./http-handler.js');\n/**\n * @license\n * slighly modified parse-headers 2.0.2 \n * Copyright (c) 2014 David Björklund\n * Available under the MIT license\n * \n */\n\nvar parseHeaders = function parseHeaders(headers) {\n var result = {};\n\n if (!headers) {\n return result;\n }\n\n headers.trim().split('\\n').forEach(function (row) {\n var index = row.indexOf(':');\n var key = row.slice(0, index).trim().toLowerCase();\n var value = row.slice(index + 1).trim();\n\n if (typeof result[key] === 'undefined') {\n result[key] = value;\n } else if (Array.isArray(result[key])) {\n result[key].push(value);\n } else {\n result[key] = [result[key], value];\n }\n });\n return result;\n};\n\nmodule.exports = createXHR; // Allow use of default import syntax in TypeScript\n\nmodule.exports.default = createXHR;\ncreateXHR.XMLHttpRequest = window.XMLHttpRequest || noop;\ncreateXHR.XDomainRequest = \"withCredentials\" in new createXHR.XMLHttpRequest() ? createXHR.XMLHttpRequest : window.XDomainRequest;\nforEachArray([\"get\", \"put\", \"post\", \"patch\", \"head\", \"delete\"], function (method) {\n createXHR[method === \"delete\" ? \"del\" : method] = function (uri, options, callback) {\n options = initParams(uri, options, callback);\n options.method = method.toUpperCase();\n return _createXHR(options);\n };\n});\n\nfunction forEachArray(array, iterator) {\n for (var i = 0; i < array.length; i++) {\n iterator(array[i]);\n }\n}\n\nfunction isEmpty(obj) {\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) return false;\n }\n\n return true;\n}\n\nfunction initParams(uri, options, callback) {\n var params = uri;\n\n if (isFunction(options)) {\n callback = options;\n\n if (typeof uri === \"string\") {\n params = {\n uri: uri\n };\n }\n } else {\n params = _extends({}, options, {\n uri: uri\n });\n }\n\n params.callback = callback;\n return params;\n}\n\nfunction createXHR(uri, options, callback) {\n options = initParams(uri, options, callback);\n return _createXHR(options);\n}\n\nfunction _createXHR(options) {\n if (typeof options.callback === \"undefined\") {\n throw new Error(\"callback argument missing\");\n }\n\n var called = false;\n\n var callback = function cbOnce(err, response, body) {\n if (!called) {\n called = true;\n options.callback(err, response, body);\n }\n };\n\n function readystatechange() {\n if (xhr.readyState === 4) {\n setTimeout(loadFunc, 0);\n }\n }\n\n function getBody() {\n // Chrome with requestType=blob throws errors arround when even testing access to responseText\n var body = undefined;\n\n if (xhr.response) {\n body = xhr.response;\n } else {\n body = xhr.responseText || getXml(xhr);\n }\n\n if (isJson) {\n try {\n body = JSON.parse(body);\n } catch (e) {}\n }\n\n return body;\n }\n\n function errorFunc(evt) {\n clearTimeout(timeoutTimer);\n\n if (!(evt instanceof Error)) {\n evt = new Error(\"\" + (evt || \"Unknown XMLHttpRequest Error\"));\n }\n\n evt.statusCode = 0;\n return callback(evt, failureResponse);\n } // will load the data & process the response in a special response object\n\n\n function loadFunc() {\n if (aborted) return;\n var status;\n clearTimeout(timeoutTimer);\n\n if (options.useXDR && xhr.status === undefined) {\n //IE8 CORS GET successful response doesn't have a status field, but body is fine\n status = 200;\n } else {\n status = xhr.status === 1223 ? 204 : xhr.status;\n }\n\n var response = failureResponse;\n var err = null;\n\n if (status !== 0) {\n response = {\n body: getBody(),\n statusCode: status,\n method: method,\n headers: {},\n url: uri,\n rawRequest: xhr\n };\n\n if (xhr.getAllResponseHeaders) {\n //remember xhr can in fact be XDR for CORS in IE\n response.headers = parseHeaders(xhr.getAllResponseHeaders());\n }\n } else {\n err = new Error(\"Internal XMLHttpRequest Error\");\n }\n\n return callback(err, response, response.body);\n }\n\n var xhr = options.xhr || null;\n\n if (!xhr) {\n if (options.cors || options.useXDR) {\n xhr = new createXHR.XDomainRequest();\n } else {\n xhr = new createXHR.XMLHttpRequest();\n }\n }\n\n var key;\n var aborted;\n var uri = xhr.url = options.uri || options.url;\n var method = xhr.method = options.method || \"GET\";\n var body = options.body || options.data;\n var headers = xhr.headers = options.headers || {};\n var sync = !!options.sync;\n var isJson = false;\n var timeoutTimer;\n var failureResponse = {\n body: undefined,\n headers: {},\n statusCode: 0,\n method: method,\n url: uri,\n rawRequest: xhr\n };\n\n if (\"json\" in options && options.json !== false) {\n isJson = true;\n headers[\"accept\"] || headers[\"Accept\"] || (headers[\"Accept\"] = \"application/json\"); //Don't override existing accept header declared by user\n\n if (method !== \"GET\" && method !== \"HEAD\") {\n headers[\"content-type\"] || headers[\"Content-Type\"] || (headers[\"Content-Type\"] = \"application/json\"); //Don't override existing accept header declared by user\n\n body = JSON.stringify(options.json === true ? body : options.json);\n }\n }\n\n xhr.onreadystatechange = readystatechange;\n xhr.onload = loadFunc;\n xhr.onerror = errorFunc; // IE9 must have onprogress be set to a unique function.\n\n xhr.onprogress = function () {// IE must die\n };\n\n xhr.onabort = function () {\n aborted = true;\n };\n\n xhr.ontimeout = errorFunc;\n xhr.open(method, uri, !sync, options.username, options.password); //has to be after open\n\n if (!sync) {\n xhr.withCredentials = !!options.withCredentials;\n } // Cannot set timeout with sync request\n // not setting timeout on the xhr object, because of old webkits etc. not handling that correctly\n // both npm's request and jquery 1.x use this kind of timeout, so this is being consistent\n\n\n if (!sync && options.timeout > 0) {\n timeoutTimer = setTimeout(function () {\n if (aborted) return;\n aborted = true; //IE9 may still call readystatechange\n\n xhr.abort(\"timeout\");\n var e = new Error(\"XMLHttpRequest timeout\");\n e.code = \"ETIMEDOUT\";\n errorFunc(e);\n }, options.timeout);\n }\n\n if (xhr.setRequestHeader) {\n for (key in headers) {\n if (headers.hasOwnProperty(key)) {\n xhr.setRequestHeader(key, headers[key]);\n }\n }\n } else if (options.headers && !isEmpty(options.headers)) {\n throw new Error(\"Headers cannot be set on an XDomainRequest object\");\n }\n\n if (\"responseType\" in options) {\n xhr.responseType = options.responseType;\n }\n\n if (\"beforeSend\" in options && typeof options.beforeSend === \"function\") {\n options.beforeSend(xhr);\n } // Microsoft Edge browser sends \"undefined\" when send is called with undefined value.\n // XMLHttpRequest spec says to pass null as body to indicate no body\n // See https://github.com/naugtur/xhr/issues/100.\n\n\n xhr.send(body || null);\n return xhr;\n}\n\nfunction getXml(xhr) {\n // xhr.responseXML will throw Exception \"InvalidStateError\" or \"DOMException\"\n // See https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseXML.\n try {\n if (xhr.responseType === \"document\") {\n return xhr.responseXML;\n }\n\n var firefoxBugTakenEffect = xhr.responseXML && xhr.responseXML.documentElement.nodeName === \"parsererror\";\n\n if (xhr.responseType === \"\" && !firefoxBugTakenEffect) {\n return xhr.responseXML;\n }\n } catch (e) {}\n\n return null;\n}\n\nfunction noop() {}","'use strict'\n\n/**\n * Ponyfill for `Array.prototype.find` which is only available in ES6 runtimes.\n *\n * Works with anything that has a `length` property and index access properties, including NodeList.\n *\n * @template {unknown} T\n * @param {Array | ({length:number, [number]: T})} list\n * @param {function (item: T, index: number, list:Array | ({length:number, [number]: T})):boolean} predicate\n * @param {Partial>?} ac `Array.prototype` by default,\n * \t\t\t\tallows injecting a custom implementation in tests\n * @returns {T | undefined}\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find\n * @see https://tc39.es/ecma262/multipage/indexed-collections.html#sec-array.prototype.find\n */\nfunction find(list, predicate, ac) {\n\tif (ac === undefined) {\n\t\tac = Array.prototype;\n\t}\n\tif (list && typeof ac.find === 'function') {\n\t\treturn ac.find.call(list, predicate);\n\t}\n\tfor (var i = 0; i < list.length; i++) {\n\t\tif (Object.prototype.hasOwnProperty.call(list, i)) {\n\t\t\tvar item = list[i];\n\t\t\tif (predicate.call(undefined, item, i, list)) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * \"Shallow freezes\" an object to render it immutable.\n * Uses `Object.freeze` if available,\n * otherwise the immutability is only in the type.\n *\n * Is used to create \"enum like\" objects.\n *\n * @template T\n * @param {T} object the object to freeze\n * @param {Pick = Object} oc `Object` by default,\n * \t\t\t\tallows to inject custom object constructor for tests\n * @returns {Readonly}\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze\n */\nfunction freeze(object, oc) {\n\tif (oc === undefined) {\n\t\toc = Object\n\t}\n\treturn oc && typeof oc.freeze === 'function' ? oc.freeze(object) : object\n}\n\n/**\n * Since we can not rely on `Object.assign` we provide a simplified version\n * that is sufficient for our needs.\n *\n * @param {Object} target\n * @param {Object | null | undefined} source\n *\n * @returns {Object} target\n * @throws TypeError if target is not an object\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n * @see https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.assign\n */\nfunction assign(target, source) {\n\tif (target === null || typeof target !== 'object') {\n\t\tthrow new TypeError('target is not an object')\n\t}\n\tfor (var key in source) {\n\t\tif (Object.prototype.hasOwnProperty.call(source, key)) {\n\t\t\ttarget[key] = source[key]\n\t\t}\n\t}\n\treturn target\n}\n\n/**\n * All mime types that are allowed as input to `DOMParser.parseFromString`\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString#Argument02 MDN\n * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#domparsersupportedtype WHATWG HTML Spec\n * @see DOMParser.prototype.parseFromString\n */\nvar MIME_TYPE = freeze({\n\t/**\n\t * `text/html`, the only mime type that triggers treating an XML document as HTML.\n\t *\n\t * @see DOMParser.SupportedType.isHTML\n\t * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration\n\t * @see https://en.wikipedia.org/wiki/HTML Wikipedia\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN\n\t * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring WHATWG HTML Spec\n\t */\n\tHTML: 'text/html',\n\n\t/**\n\t * Helper method to check a mime type if it indicates an HTML document\n\t *\n\t * @param {string} [value]\n\t * @returns {boolean}\n\t *\n\t * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration\n\t * @see https://en.wikipedia.org/wiki/HTML Wikipedia\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN\n\t * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring \t */\n\tisHTML: function (value) {\n\t\treturn value === MIME_TYPE.HTML\n\t},\n\n\t/**\n\t * `application/xml`, the standard mime type for XML documents.\n\t *\n\t * @see https://www.iana.org/assignments/media-types/application/xml IANA MimeType registration\n\t * @see https://tools.ietf.org/html/rfc7303#section-9.1 RFC 7303\n\t * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia\n\t */\n\tXML_APPLICATION: 'application/xml',\n\n\t/**\n\t * `text/html`, an alias for `application/xml`.\n\t *\n\t * @see https://tools.ietf.org/html/rfc7303#section-9.2 RFC 7303\n\t * @see https://www.iana.org/assignments/media-types/text/xml IANA MimeType registration\n\t * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia\n\t */\n\tXML_TEXT: 'text/xml',\n\n\t/**\n\t * `application/xhtml+xml`, indicates an XML document that has the default HTML namespace,\n\t * but is parsed as an XML document.\n\t *\n\t * @see https://www.iana.org/assignments/media-types/application/xhtml+xml IANA MimeType registration\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument WHATWG DOM Spec\n\t * @see https://en.wikipedia.org/wiki/XHTML Wikipedia\n\t */\n\tXML_XHTML_APPLICATION: 'application/xhtml+xml',\n\n\t/**\n\t * `image/svg+xml`,\n\t *\n\t * @see https://www.iana.org/assignments/media-types/image/svg+xml IANA MimeType registration\n\t * @see https://www.w3.org/TR/SVG11/ W3C SVG 1.1\n\t * @see https://en.wikipedia.org/wiki/Scalable_Vector_Graphics Wikipedia\n\t */\n\tXML_SVG_IMAGE: 'image/svg+xml',\n})\n\n/**\n * Namespaces that are used in this code base.\n *\n * @see http://www.w3.org/TR/REC-xml-names\n */\nvar NAMESPACE = freeze({\n\t/**\n\t * The XHTML namespace.\n\t *\n\t * @see http://www.w3.org/1999/xhtml\n\t */\n\tHTML: 'http://www.w3.org/1999/xhtml',\n\n\t/**\n\t * Checks if `uri` equals `NAMESPACE.HTML`.\n\t *\n\t * @param {string} [uri]\n\t *\n\t * @see NAMESPACE.HTML\n\t */\n\tisHTML: function (uri) {\n\t\treturn uri === NAMESPACE.HTML\n\t},\n\n\t/**\n\t * The SVG namespace.\n\t *\n\t * @see http://www.w3.org/2000/svg\n\t */\n\tSVG: 'http://www.w3.org/2000/svg',\n\n\t/**\n\t * The `xml:` namespace.\n\t *\n\t * @see http://www.w3.org/XML/1998/namespace\n\t */\n\tXML: 'http://www.w3.org/XML/1998/namespace',\n\n\t/**\n\t * The `xmlns:` namespace\n\t *\n\t * @see https://www.w3.org/2000/xmlns/\n\t */\n\tXMLNS: 'http://www.w3.org/2000/xmlns/',\n})\n\nexports.assign = assign;\nexports.find = find;\nexports.freeze = freeze;\nexports.MIME_TYPE = MIME_TYPE;\nexports.NAMESPACE = NAMESPACE;\n","var conventions = require(\"./conventions\");\nvar dom = require('./dom')\nvar entities = require('./entities');\nvar sax = require('./sax');\n\nvar DOMImplementation = dom.DOMImplementation;\n\nvar NAMESPACE = conventions.NAMESPACE;\n\nvar ParseError = sax.ParseError;\nvar XMLReader = sax.XMLReader;\n\n/**\n * Normalizes line ending according to https://www.w3.org/TR/xml11/#sec-line-ends:\n *\n * > XML parsed entities are often stored in computer files which,\n * > for editing convenience, are organized into lines.\n * > These lines are typically separated by some combination\n * > of the characters CARRIAGE RETURN (#xD) and LINE FEED (#xA).\n * >\n * > To simplify the tasks of applications, the XML processor must behave\n * > as if it normalized all line breaks in external parsed entities (including the document entity)\n * > on input, before parsing, by translating all of the following to a single #xA character:\n * >\n * > 1. the two-character sequence #xD #xA\n * > 2. the two-character sequence #xD #x85\n * > 3. the single character #x85\n * > 4. the single character #x2028\n * > 5. any #xD character that is not immediately followed by #xA or #x85.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction normalizeLineEndings(input) {\n\treturn input\n\t\t.replace(/\\r[\\n\\u0085]/g, '\\n')\n\t\t.replace(/[\\r\\u0085\\u2028]/g, '\\n')\n}\n\n/**\n * @typedef Locator\n * @property {number} [columnNumber]\n * @property {number} [lineNumber]\n */\n\n/**\n * @typedef DOMParserOptions\n * @property {DOMHandler} [domBuilder]\n * @property {Function} [errorHandler]\n * @property {(string) => string} [normalizeLineEndings] used to replace line endings before parsing\n * \t\t\t\t\t\tdefaults to `normalizeLineEndings`\n * @property {Locator} [locator]\n * @property {Record} [xmlns]\n *\n * @see normalizeLineEndings\n */\n\n/**\n * The DOMParser interface provides the ability to parse XML or HTML source code\n * from a string into a DOM `Document`.\n *\n * _xmldom is different from the spec in that it allows an `options` parameter,\n * to override the default behavior._\n *\n * @param {DOMParserOptions} [options]\n * @constructor\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser\n * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-parsing-and-serialization\n */\nfunction DOMParser(options){\n\tthis.options = options ||{locator:{}};\n}\n\nDOMParser.prototype.parseFromString = function(source,mimeType){\n\tvar options = this.options;\n\tvar sax = new XMLReader();\n\tvar domBuilder = options.domBuilder || new DOMHandler();//contentHandler and LexicalHandler\n\tvar errorHandler = options.errorHandler;\n\tvar locator = options.locator;\n\tvar defaultNSMap = options.xmlns||{};\n\tvar isHTML = /\\/x?html?$/.test(mimeType);//mimeType.toLowerCase().indexOf('html') > -1;\n \tvar entityMap = isHTML ? entities.HTML_ENTITIES : entities.XML_ENTITIES;\n\tif(locator){\n\t\tdomBuilder.setDocumentLocator(locator)\n\t}\n\n\tsax.errorHandler = buildErrorHandler(errorHandler,domBuilder,locator);\n\tsax.domBuilder = options.domBuilder || domBuilder;\n\tif(isHTML){\n\t\tdefaultNSMap[''] = NAMESPACE.HTML;\n\t}\n\tdefaultNSMap.xml = defaultNSMap.xml || NAMESPACE.XML;\n\tvar normalize = options.normalizeLineEndings || normalizeLineEndings;\n\tif (source && typeof source === 'string') {\n\t\tsax.parse(\n\t\t\tnormalize(source),\n\t\t\tdefaultNSMap,\n\t\t\tentityMap\n\t\t)\n\t} else {\n\t\tsax.errorHandler.error('invalid doc source')\n\t}\n\treturn domBuilder.doc;\n}\nfunction buildErrorHandler(errorImpl,domBuilder,locator){\n\tif(!errorImpl){\n\t\tif(domBuilder instanceof DOMHandler){\n\t\t\treturn domBuilder;\n\t\t}\n\t\terrorImpl = domBuilder ;\n\t}\n\tvar errorHandler = {}\n\tvar isCallback = errorImpl instanceof Function;\n\tlocator = locator||{}\n\tfunction build(key){\n\t\tvar fn = errorImpl[key];\n\t\tif(!fn && isCallback){\n\t\t\tfn = errorImpl.length == 2?function(msg){errorImpl(key,msg)}:errorImpl;\n\t\t}\n\t\terrorHandler[key] = fn && function(msg){\n\t\t\tfn('[xmldom '+key+']\\t'+msg+_locator(locator));\n\t\t}||function(){};\n\t}\n\tbuild('warning');\n\tbuild('error');\n\tbuild('fatalError');\n\treturn errorHandler;\n}\n\n//console.log('#\\n\\n\\n\\n\\n\\n\\n####')\n/**\n * +ContentHandler+ErrorHandler\n * +LexicalHandler+EntityResolver2\n * -DeclHandler-DTDHandler\n *\n * DefaultHandler:EntityResolver, DTDHandler, ContentHandler, ErrorHandler\n * DefaultHandler2:DefaultHandler,LexicalHandler, DeclHandler, EntityResolver2\n * @link http://www.saxproject.org/apidoc/org/xml/sax/helpers/DefaultHandler.html\n */\nfunction DOMHandler() {\n this.cdata = false;\n}\nfunction position(locator,node){\n\tnode.lineNumber = locator.lineNumber;\n\tnode.columnNumber = locator.columnNumber;\n}\n/**\n * @see org.xml.sax.ContentHandler#startDocument\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html\n */\nDOMHandler.prototype = {\n\tstartDocument : function() {\n \tthis.doc = new DOMImplementation().createDocument(null, null, null);\n \tif (this.locator) {\n \tthis.doc.documentURI = this.locator.systemId;\n \t}\n\t},\n\tstartElement:function(namespaceURI, localName, qName, attrs) {\n\t\tvar doc = this.doc;\n\t var el = doc.createElementNS(namespaceURI, qName||localName);\n\t var len = attrs.length;\n\t appendElement(this, el);\n\t this.currentElement = el;\n\n\t\tthis.locator && position(this.locator,el)\n\t for (var i = 0 ; i < len; i++) {\n\t var namespaceURI = attrs.getURI(i);\n\t var value = attrs.getValue(i);\n\t var qName = attrs.getQName(i);\n\t\t\tvar attr = doc.createAttributeNS(namespaceURI, qName);\n\t\t\tthis.locator &&position(attrs.getLocator(i),attr);\n\t\t\tattr.value = attr.nodeValue = value;\n\t\t\tel.setAttributeNode(attr)\n\t }\n\t},\n\tendElement:function(namespaceURI, localName, qName) {\n\t\tvar current = this.currentElement\n\t\tvar tagName = current.tagName;\n\t\tthis.currentElement = current.parentNode;\n\t},\n\tstartPrefixMapping:function(prefix, uri) {\n\t},\n\tendPrefixMapping:function(prefix) {\n\t},\n\tprocessingInstruction:function(target, data) {\n\t var ins = this.doc.createProcessingInstruction(target, data);\n\t this.locator && position(this.locator,ins)\n\t appendElement(this, ins);\n\t},\n\tignorableWhitespace:function(ch, start, length) {\n\t},\n\tcharacters:function(chars, start, length) {\n\t\tchars = _toString.apply(this,arguments)\n\t\t//console.log(chars)\n\t\tif(chars){\n\t\t\tif (this.cdata) {\n\t\t\t\tvar charNode = this.doc.createCDATASection(chars);\n\t\t\t} else {\n\t\t\t\tvar charNode = this.doc.createTextNode(chars);\n\t\t\t}\n\t\t\tif(this.currentElement){\n\t\t\t\tthis.currentElement.appendChild(charNode);\n\t\t\t}else if(/^\\s*$/.test(chars)){\n\t\t\t\tthis.doc.appendChild(charNode);\n\t\t\t\t//process xml\n\t\t\t}\n\t\t\tthis.locator && position(this.locator,charNode)\n\t\t}\n\t},\n\tskippedEntity:function(name) {\n\t},\n\tendDocument:function() {\n\t\tthis.doc.normalize();\n\t},\n\tsetDocumentLocator:function (locator) {\n\t if(this.locator = locator){// && !('lineNumber' in locator)){\n\t \tlocator.lineNumber = 0;\n\t }\n\t},\n\t//LexicalHandler\n\tcomment:function(chars, start, length) {\n\t\tchars = _toString.apply(this,arguments)\n\t var comm = this.doc.createComment(chars);\n\t this.locator && position(this.locator,comm)\n\t appendElement(this, comm);\n\t},\n\n\tstartCDATA:function() {\n\t //used in characters() methods\n\t this.cdata = true;\n\t},\n\tendCDATA:function() {\n\t this.cdata = false;\n\t},\n\n\tstartDTD:function(name, publicId, systemId) {\n\t\tvar impl = this.doc.implementation;\n\t if (impl && impl.createDocumentType) {\n\t var dt = impl.createDocumentType(name, publicId, systemId);\n\t this.locator && position(this.locator,dt)\n\t appendElement(this, dt);\n\t\t\t\t\tthis.doc.doctype = dt;\n\t }\n\t},\n\t/**\n\t * @see org.xml.sax.ErrorHandler\n\t * @link http://www.saxproject.org/apidoc/org/xml/sax/ErrorHandler.html\n\t */\n\twarning:function(error) {\n\t\tconsole.warn('[xmldom warning]\\t'+error,_locator(this.locator));\n\t},\n\terror:function(error) {\n\t\tconsole.error('[xmldom error]\\t'+error,_locator(this.locator));\n\t},\n\tfatalError:function(error) {\n\t\tthrow new ParseError(error, this.locator);\n\t}\n}\nfunction _locator(l){\n\tif(l){\n\t\treturn '\\n@'+(l.systemId ||'')+'#[line:'+l.lineNumber+',col:'+l.columnNumber+']'\n\t}\n}\nfunction _toString(chars,start,length){\n\tif(typeof chars == 'string'){\n\t\treturn chars.substr(start,length)\n\t}else{//java sax connect width xmldom on rhino(what about: \"? && !(chars instanceof String)\")\n\t\tif(chars.length >= start+length || start){\n\t\t\treturn new java.lang.String(chars,start,length)+'';\n\t\t}\n\t\treturn chars;\n\t}\n}\n\n/*\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/LexicalHandler.html\n * used method of org.xml.sax.ext.LexicalHandler:\n * #comment(chars, start, length)\n * #startCDATA()\n * #endCDATA()\n * #startDTD(name, publicId, systemId)\n *\n *\n * IGNORED method of org.xml.sax.ext.LexicalHandler:\n * #endDTD()\n * #startEntity(name)\n * #endEntity(name)\n *\n *\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/DeclHandler.html\n * IGNORED method of org.xml.sax.ext.DeclHandler\n * \t#attributeDecl(eName, aName, type, mode, value)\n * #elementDecl(name, model)\n * #externalEntityDecl(name, publicId, systemId)\n * #internalEntityDecl(name, value)\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/EntityResolver2.html\n * IGNORED method of org.xml.sax.EntityResolver2\n * #resolveEntity(String name,String publicId,String baseURI,String systemId)\n * #resolveEntity(publicId, systemId)\n * #getExternalSubset(name, baseURI)\n * @link http://www.saxproject.org/apidoc/org/xml/sax/DTDHandler.html\n * IGNORED method of org.xml.sax.DTDHandler\n * #notationDecl(name, publicId, systemId) {};\n * #unparsedEntityDecl(name, publicId, systemId, notationName) {};\n */\n\"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl\".replace(/\\w+/g,function(key){\n\tDOMHandler.prototype[key] = function(){return null}\n})\n\n/* Private static helpers treated below as private instance methods, so don't need to add these to the public API; we might use a Relator to also get rid of non-standard public properties */\nfunction appendElement (hander,node) {\n if (!hander.currentElement) {\n hander.doc.appendChild(node);\n } else {\n hander.currentElement.appendChild(node);\n }\n}//appendChild and setAttributeNS are preformance key\n\nexports.__DOMHandler = DOMHandler;\nexports.normalizeLineEndings = normalizeLineEndings;\nexports.DOMParser = DOMParser;\n","var conventions = require(\"./conventions\");\n\nvar find = conventions.find;\nvar NAMESPACE = conventions.NAMESPACE;\n\n/**\n * A prerequisite for `[].filter`, to drop elements that are empty\n * @param {string} input\n * @returns {boolean}\n */\nfunction notEmptyString (input) {\n\treturn input !== ''\n}\n/**\n * @see https://infra.spec.whatwg.org/#split-on-ascii-whitespace\n * @see https://infra.spec.whatwg.org/#ascii-whitespace\n *\n * @param {string} input\n * @returns {string[]} (can be empty)\n */\nfunction splitOnASCIIWhitespace(input) {\n\t// U+0009 TAB, U+000A LF, U+000C FF, U+000D CR, U+0020 SPACE\n\treturn input ? input.split(/[\\t\\n\\f\\r ]+/).filter(notEmptyString) : []\n}\n\n/**\n * Adds element as a key to current if it is not already present.\n *\n * @param {Record} current\n * @param {string} element\n * @returns {Record}\n */\nfunction orderedSetReducer (current, element) {\n\tif (!current.hasOwnProperty(element)) {\n\t\tcurrent[element] = true;\n\t}\n\treturn current;\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#ordered-set\n * @param {string} input\n * @returns {string[]}\n */\nfunction toOrderedSet(input) {\n\tif (!input) return [];\n\tvar list = splitOnASCIIWhitespace(input);\n\treturn Object.keys(list.reduce(orderedSetReducer, {}))\n}\n\n/**\n * Uses `list.indexOf` to implement something like `Array.prototype.includes`,\n * which we can not rely on being available.\n *\n * @param {any[]} list\n * @returns {function(any): boolean}\n */\nfunction arrayIncludes (list) {\n\treturn function(element) {\n\t\treturn list && list.indexOf(element) !== -1;\n\t}\n}\n\nfunction copy(src,dest){\n\tfor(var p in src){\n\t\tif (Object.prototype.hasOwnProperty.call(src, p)) {\n\t\t\tdest[p] = src[p];\n\t\t}\n\t}\n}\n\n/**\n^\\w+\\.prototype\\.([_\\w]+)\\s*=\\s*((?:.*\\{\\s*?[\\r\\n][\\s\\S]*?^})|\\S.*?(?=[;\\r\\n]));?\n^\\w+\\.prototype\\.([_\\w]+)\\s*=\\s*(\\S.*?(?=[;\\r\\n]));?\n */\nfunction _extends(Class,Super){\n\tvar pt = Class.prototype;\n\tif(!(pt instanceof Super)){\n\t\tfunction t(){};\n\t\tt.prototype = Super.prototype;\n\t\tt = new t();\n\t\tcopy(pt,t);\n\t\tClass.prototype = pt = t;\n\t}\n\tif(pt.constructor != Class){\n\t\tif(typeof Class != 'function'){\n\t\t\tconsole.error(\"unknown Class:\"+Class)\n\t\t}\n\t\tpt.constructor = Class\n\t}\n}\n\n// Node Types\nvar NodeType = {}\nvar ELEMENT_NODE = NodeType.ELEMENT_NODE = 1;\nvar ATTRIBUTE_NODE = NodeType.ATTRIBUTE_NODE = 2;\nvar TEXT_NODE = NodeType.TEXT_NODE = 3;\nvar CDATA_SECTION_NODE = NodeType.CDATA_SECTION_NODE = 4;\nvar ENTITY_REFERENCE_NODE = NodeType.ENTITY_REFERENCE_NODE = 5;\nvar ENTITY_NODE = NodeType.ENTITY_NODE = 6;\nvar PROCESSING_INSTRUCTION_NODE = NodeType.PROCESSING_INSTRUCTION_NODE = 7;\nvar COMMENT_NODE = NodeType.COMMENT_NODE = 8;\nvar DOCUMENT_NODE = NodeType.DOCUMENT_NODE = 9;\nvar DOCUMENT_TYPE_NODE = NodeType.DOCUMENT_TYPE_NODE = 10;\nvar DOCUMENT_FRAGMENT_NODE = NodeType.DOCUMENT_FRAGMENT_NODE = 11;\nvar NOTATION_NODE = NodeType.NOTATION_NODE = 12;\n\n// ExceptionCode\nvar ExceptionCode = {}\nvar ExceptionMessage = {};\nvar INDEX_SIZE_ERR = ExceptionCode.INDEX_SIZE_ERR = ((ExceptionMessage[1]=\"Index size error\"),1);\nvar DOMSTRING_SIZE_ERR = ExceptionCode.DOMSTRING_SIZE_ERR = ((ExceptionMessage[2]=\"DOMString size error\"),2);\nvar HIERARCHY_REQUEST_ERR = ExceptionCode.HIERARCHY_REQUEST_ERR = ((ExceptionMessage[3]=\"Hierarchy request error\"),3);\nvar WRONG_DOCUMENT_ERR = ExceptionCode.WRONG_DOCUMENT_ERR = ((ExceptionMessage[4]=\"Wrong document\"),4);\nvar INVALID_CHARACTER_ERR = ExceptionCode.INVALID_CHARACTER_ERR = ((ExceptionMessage[5]=\"Invalid character\"),5);\nvar NO_DATA_ALLOWED_ERR = ExceptionCode.NO_DATA_ALLOWED_ERR = ((ExceptionMessage[6]=\"No data allowed\"),6);\nvar NO_MODIFICATION_ALLOWED_ERR = ExceptionCode.NO_MODIFICATION_ALLOWED_ERR = ((ExceptionMessage[7]=\"No modification allowed\"),7);\nvar NOT_FOUND_ERR = ExceptionCode.NOT_FOUND_ERR = ((ExceptionMessage[8]=\"Not found\"),8);\nvar NOT_SUPPORTED_ERR = ExceptionCode.NOT_SUPPORTED_ERR = ((ExceptionMessage[9]=\"Not supported\"),9);\nvar INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = ((ExceptionMessage[10]=\"Attribute in use\"),10);\n//level2\nvar INVALID_STATE_ERR \t= ExceptionCode.INVALID_STATE_ERR \t= ((ExceptionMessage[11]=\"Invalid state\"),11);\nvar SYNTAX_ERR \t= ExceptionCode.SYNTAX_ERR \t= ((ExceptionMessage[12]=\"Syntax error\"),12);\nvar INVALID_MODIFICATION_ERR \t= ExceptionCode.INVALID_MODIFICATION_ERR \t= ((ExceptionMessage[13]=\"Invalid modification\"),13);\nvar NAMESPACE_ERR \t= ExceptionCode.NAMESPACE_ERR \t= ((ExceptionMessage[14]=\"Invalid namespace\"),14);\nvar INVALID_ACCESS_ERR \t= ExceptionCode.INVALID_ACCESS_ERR \t= ((ExceptionMessage[15]=\"Invalid access\"),15);\n\n/**\n * DOM Level 2\n * Object DOMException\n * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html\n * @see http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html\n */\nfunction DOMException(code, message) {\n\tif(message instanceof Error){\n\t\tvar error = message;\n\t}else{\n\t\terror = this;\n\t\tError.call(this, ExceptionMessage[code]);\n\t\tthis.message = ExceptionMessage[code];\n\t\tif(Error.captureStackTrace) Error.captureStackTrace(this, DOMException);\n\t}\n\terror.code = code;\n\tif(message) this.message = this.message + \": \" + message;\n\treturn error;\n};\nDOMException.prototype = Error.prototype;\ncopy(ExceptionCode,DOMException)\n\n/**\n * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-536297177\n * The NodeList interface provides the abstraction of an ordered collection of nodes, without defining or constraining how this collection is implemented. NodeList objects in the DOM are live.\n * The items in the NodeList are accessible via an integral index, starting from 0.\n */\nfunction NodeList() {\n};\nNodeList.prototype = {\n\t/**\n\t * The number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive.\n\t * @standard level1\n\t */\n\tlength:0,\n\t/**\n\t * Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null.\n\t * @standard level1\n\t * @param index unsigned long\n\t * Index into the collection.\n\t * @return Node\n\t * \tThe node at the indexth position in the NodeList, or null if that is not a valid index.\n\t */\n\titem: function(index) {\n\t\treturn index >= 0 && index < this.length ? this[index] : null;\n\t},\n\ttoString:function(isHTML,nodeFilter){\n\t\tfor(var buf = [], i = 0;i=0){\n\t\tvar lastIndex = list.length-1\n\t\twhile(i0 || key == 'xmlns'){\n//\t\t\treturn null;\n//\t\t}\n\t\t//console.log()\n\t\tvar i = this.length;\n\t\twhile(i--){\n\t\t\tvar attr = this[i];\n\t\t\t//console.log(attr.nodeName,key)\n\t\t\tif(attr.nodeName == key){\n\t\t\t\treturn attr;\n\t\t\t}\n\t\t}\n\t},\n\tsetNamedItem: function(attr) {\n\t\tvar el = attr.ownerElement;\n\t\tif(el && el!=this._ownerElement){\n\t\t\tthrow new DOMException(INUSE_ATTRIBUTE_ERR);\n\t\t}\n\t\tvar oldAttr = this.getNamedItem(attr.nodeName);\n\t\t_addNamedNode(this._ownerElement,this,attr,oldAttr);\n\t\treturn oldAttr;\n\t},\n\t/* returns Node */\n\tsetNamedItemNS: function(attr) {// raises: WRONG_DOCUMENT_ERR,NO_MODIFICATION_ALLOWED_ERR,INUSE_ATTRIBUTE_ERR\n\t\tvar el = attr.ownerElement, oldAttr;\n\t\tif(el && el!=this._ownerElement){\n\t\t\tthrow new DOMException(INUSE_ATTRIBUTE_ERR);\n\t\t}\n\t\toldAttr = this.getNamedItemNS(attr.namespaceURI,attr.localName);\n\t\t_addNamedNode(this._ownerElement,this,attr,oldAttr);\n\t\treturn oldAttr;\n\t},\n\n\t/* returns Node */\n\tremoveNamedItem: function(key) {\n\t\tvar attr = this.getNamedItem(key);\n\t\t_removeNamedNode(this._ownerElement,this,attr);\n\t\treturn attr;\n\n\n\t},// raises: NOT_FOUND_ERR,NO_MODIFICATION_ALLOWED_ERR\n\n\t//for level2\n\tremoveNamedItemNS:function(namespaceURI,localName){\n\t\tvar attr = this.getNamedItemNS(namespaceURI,localName);\n\t\t_removeNamedNode(this._ownerElement,this,attr);\n\t\treturn attr;\n\t},\n\tgetNamedItemNS: function(namespaceURI, localName) {\n\t\tvar i = this.length;\n\t\twhile(i--){\n\t\t\tvar node = this[i];\n\t\t\tif(node.localName == localName && node.namespaceURI == namespaceURI){\n\t\t\t\treturn node;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n};\n\n/**\n * The DOMImplementation interface represents an object providing methods\n * which are not dependent on any particular document.\n * Such an object is returned by the `Document.implementation` property.\n *\n * __The individual methods describe the differences compared to the specs.__\n *\n * @constructor\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation MDN\n * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-102161490 DOM Level 1 Core (Initial)\n * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-102161490 DOM Level 2 Core\n * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-102161490 DOM Level 3 Core\n * @see https://dom.spec.whatwg.org/#domimplementation DOM Living Standard\n */\nfunction DOMImplementation() {\n}\n\nDOMImplementation.prototype = {\n\t/**\n\t * The DOMImplementation.hasFeature() method returns a Boolean flag indicating if a given feature is supported.\n\t * The different implementations fairly diverged in what kind of features were reported.\n\t * The latest version of the spec settled to force this method to always return true, where the functionality was accurate and in use.\n\t *\n\t * @deprecated It is deprecated and modern browsers return true in all cases.\n\t *\n\t * @param {string} feature\n\t * @param {string} [version]\n\t * @returns {boolean} always true\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/hasFeature MDN\n\t * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-5CED94D7 DOM Level 1 Core\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-hasfeature DOM Living Standard\n\t */\n\thasFeature: function(feature, version) {\n\t\t\treturn true;\n\t},\n\t/**\n\t * Creates an XML Document object of the specified type with its document element.\n\t *\n\t * __It behaves slightly different from the description in the living standard__:\n\t * - There is no interface/class `XMLDocument`, it returns a `Document` instance.\n\t * - `contentType`, `encoding`, `mode`, `origin`, `url` fields are currently not declared.\n\t * - this implementation is not validating names or qualified names\n\t * (when parsing XML strings, the SAX parser takes care of that)\n\t *\n\t * @param {string|null} namespaceURI\n\t * @param {string} qualifiedName\n\t * @param {DocumentType=null} doctype\n\t * @returns {Document}\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocument MDN\n\t * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocument DOM Level 2 Core (initial)\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument DOM Level 2 Core\n\t *\n\t * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract\n\t * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names\n\t * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names\n\t */\n\tcreateDocument: function(namespaceURI, qualifiedName, doctype){\n\t\tvar doc = new Document();\n\t\tdoc.implementation = this;\n\t\tdoc.childNodes = new NodeList();\n\t\tdoc.doctype = doctype || null;\n\t\tif (doctype){\n\t\t\tdoc.appendChild(doctype);\n\t\t}\n\t\tif (qualifiedName){\n\t\t\tvar root = doc.createElementNS(namespaceURI, qualifiedName);\n\t\t\tdoc.appendChild(root);\n\t\t}\n\t\treturn doc;\n\t},\n\t/**\n\t * Returns a doctype, with the given `qualifiedName`, `publicId`, and `systemId`.\n\t *\n\t * __This behavior is slightly different from the in the specs__:\n\t * - this implementation is not validating names or qualified names\n\t * (when parsing XML strings, the SAX parser takes care of that)\n\t *\n\t * @param {string} qualifiedName\n\t * @param {string} [publicId]\n\t * @param {string} [systemId]\n\t * @returns {DocumentType} which can either be used with `DOMImplementation.createDocument` upon document creation\n\t * \t\t\t\t or can be put into the document via methods like `Node.insertBefore()` or `Node.replaceChild()`\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocumentType MDN\n\t * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocType DOM Level 2 Core\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype DOM Living Standard\n\t *\n\t * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract\n\t * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names\n\t * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names\n\t */\n\tcreateDocumentType: function(qualifiedName, publicId, systemId){\n\t\tvar node = new DocumentType();\n\t\tnode.name = qualifiedName;\n\t\tnode.nodeName = qualifiedName;\n\t\tnode.publicId = publicId || '';\n\t\tnode.systemId = systemId || '';\n\n\t\treturn node;\n\t}\n};\n\n\n/**\n * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247\n */\n\nfunction Node() {\n};\n\nNode.prototype = {\n\tfirstChild : null,\n\tlastChild : null,\n\tpreviousSibling : null,\n\tnextSibling : null,\n\tattributes : null,\n\tparentNode : null,\n\tchildNodes : null,\n\townerDocument : null,\n\tnodeValue : null,\n\tnamespaceURI : null,\n\tprefix : null,\n\tlocalName : null,\n\t// Modified in DOM Level 2:\n\tinsertBefore:function(newChild, refChild){//raises\n\t\treturn _insertBefore(this,newChild,refChild);\n\t},\n\treplaceChild:function(newChild, oldChild){//raises\n\t\t_insertBefore(this, newChild,oldChild, assertPreReplacementValidityInDocument);\n\t\tif(oldChild){\n\t\t\tthis.removeChild(oldChild);\n\t\t}\n\t},\n\tremoveChild:function(oldChild){\n\t\treturn _removeChild(this,oldChild);\n\t},\n\tappendChild:function(newChild){\n\t\treturn this.insertBefore(newChild,null);\n\t},\n\thasChildNodes:function(){\n\t\treturn this.firstChild != null;\n\t},\n\tcloneNode:function(deep){\n\t\treturn cloneNode(this.ownerDocument||this,this,deep);\n\t},\n\t// Modified in DOM Level 2:\n\tnormalize:function(){\n\t\tvar child = this.firstChild;\n\t\twhile(child){\n\t\t\tvar next = child.nextSibling;\n\t\t\tif(next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE){\n\t\t\t\tthis.removeChild(next);\n\t\t\t\tchild.appendData(next.data);\n\t\t\t}else{\n\t\t\t\tchild.normalize();\n\t\t\t\tchild = next;\n\t\t\t}\n\t\t}\n\t},\n \t// Introduced in DOM Level 2:\n\tisSupported:function(feature, version){\n\t\treturn this.ownerDocument.implementation.hasFeature(feature,version);\n\t},\n // Introduced in DOM Level 2:\n hasAttributes:function(){\n \treturn this.attributes.length>0;\n },\n\t/**\n\t * Look up the prefix associated to the given namespace URI, starting from this node.\n\t * **The default namespace declarations are ignored by this method.**\n\t * See Namespace Prefix Lookup for details on the algorithm used by this method.\n\t *\n\t * _Note: The implementation seems to be incomplete when compared to the algorithm described in the specs._\n\t *\n\t * @param {string | null} namespaceURI\n\t * @returns {string | null}\n\t * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespacePrefix\n\t * @see https://www.w3.org/TR/DOM-Level-3-Core/namespaces-algorithms.html#lookupNamespacePrefixAlgo\n\t * @see https://dom.spec.whatwg.org/#dom-node-lookupprefix\n\t * @see https://github.com/xmldom/xmldom/issues/322\n\t */\n lookupPrefix:function(namespaceURI){\n \tvar el = this;\n \twhile(el){\n \t\tvar map = el._nsMap;\n \t\t//console.dir(map)\n \t\tif(map){\n \t\t\tfor(var n in map){\n\t\t\t\t\t\tif (Object.prototype.hasOwnProperty.call(map, n) && map[n] === namespaceURI) {\n\t\t\t\t\t\t\treturn n;\n\t\t\t\t\t\t}\n \t\t\t}\n \t\t}\n \t\tel = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;\n \t}\n \treturn null;\n },\n // Introduced in DOM Level 3:\n lookupNamespaceURI:function(prefix){\n \tvar el = this;\n \twhile(el){\n \t\tvar map = el._nsMap;\n \t\t//console.dir(map)\n \t\tif(map){\n \t\t\tif(Object.prototype.hasOwnProperty.call(map, prefix)){\n \t\t\t\treturn map[prefix] ;\n \t\t\t}\n \t\t}\n \t\tel = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;\n \t}\n \treturn null;\n },\n // Introduced in DOM Level 3:\n isDefaultNamespace:function(namespaceURI){\n \tvar prefix = this.lookupPrefix(namespaceURI);\n \treturn prefix == null;\n }\n};\n\n\nfunction _xmlEncoder(c){\n\treturn c == '<' && '<' ||\n c == '>' && '>' ||\n c == '&' && '&' ||\n c == '\"' && '"' ||\n '&#'+c.charCodeAt()+';'\n}\n\n\ncopy(NodeType,Node);\ncopy(NodeType,Node.prototype);\n\n/**\n * @param callback return true for continue,false for break\n * @return boolean true: break visit;\n */\nfunction _visitNode(node,callback){\n\tif(callback(node)){\n\t\treturn true;\n\t}\n\tif(node = node.firstChild){\n\t\tdo{\n\t\t\tif(_visitNode(node,callback)){return true}\n }while(node=node.nextSibling)\n }\n}\n\n\n\nfunction Document(){\n\tthis.ownerDocument = this;\n}\n\nfunction _onAddAttribute(doc,el,newAttr){\n\tdoc && doc._inc++;\n\tvar ns = newAttr.namespaceURI ;\n\tif(ns === NAMESPACE.XMLNS){\n\t\t//update namespace\n\t\tel._nsMap[newAttr.prefix?newAttr.localName:''] = newAttr.value\n\t}\n}\n\nfunction _onRemoveAttribute(doc,el,newAttr,remove){\n\tdoc && doc._inc++;\n\tvar ns = newAttr.namespaceURI ;\n\tif(ns === NAMESPACE.XMLNS){\n\t\t//update namespace\n\t\tdelete el._nsMap[newAttr.prefix?newAttr.localName:'']\n\t}\n}\n\n/**\n * Updates `el.childNodes`, updating the indexed items and it's `length`.\n * Passing `newChild` means it will be appended.\n * Otherwise it's assumed that an item has been removed,\n * and `el.firstNode` and it's `.nextSibling` are used\n * to walk the current list of child nodes.\n *\n * @param {Document} doc\n * @param {Node} el\n * @param {Node} [newChild]\n * @private\n */\nfunction _onUpdateChild (doc, el, newChild) {\n\tif(doc && doc._inc){\n\t\tdoc._inc++;\n\t\t//update childNodes\n\t\tvar cs = el.childNodes;\n\t\tif (newChild) {\n\t\t\tcs[cs.length++] = newChild;\n\t\t} else {\n\t\t\tvar child = el.firstChild;\n\t\t\tvar i = 0;\n\t\t\twhile (child) {\n\t\t\t\tcs[i++] = child;\n\t\t\t\tchild = child.nextSibling;\n\t\t\t}\n\t\t\tcs.length = i;\n\t\t\tdelete cs[cs.length];\n\t\t}\n\t}\n}\n\n/**\n * Removes the connections between `parentNode` and `child`\n * and any existing `child.previousSibling` or `child.nextSibling`.\n *\n * @see https://github.com/xmldom/xmldom/issues/135\n * @see https://github.com/xmldom/xmldom/issues/145\n *\n * @param {Node} parentNode\n * @param {Node} child\n * @returns {Node} the child that was removed.\n * @private\n */\nfunction _removeChild (parentNode, child) {\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif (previous) {\n\t\tprevious.nextSibling = next;\n\t} else {\n\t\tparentNode.firstChild = next;\n\t}\n\tif (next) {\n\t\tnext.previousSibling = previous;\n\t} else {\n\t\tparentNode.lastChild = previous;\n\t}\n\tchild.parentNode = null;\n\tchild.previousSibling = null;\n\tchild.nextSibling = null;\n\t_onUpdateChild(parentNode.ownerDocument, parentNode);\n\treturn child;\n}\n\n/**\n * Returns `true` if `node` can be a parent for insertion.\n * @param {Node} node\n * @returns {boolean}\n */\nfunction hasValidParentNodeType(node) {\n\treturn (\n\t\tnode &&\n\t\t(node.nodeType === Node.DOCUMENT_NODE || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE || node.nodeType === Node.ELEMENT_NODE)\n\t);\n}\n\n/**\n * Returns `true` if `node` can be inserted according to it's `nodeType`.\n * @param {Node} node\n * @returns {boolean}\n */\nfunction hasInsertableNodeType(node) {\n\treturn (\n\t\tnode &&\n\t\t(isElementNode(node) ||\n\t\t\tisTextNode(node) ||\n\t\t\tisDocTypeNode(node) ||\n\t\t\tnode.nodeType === Node.DOCUMENT_FRAGMENT_NODE ||\n\t\t\tnode.nodeType === Node.COMMENT_NODE ||\n\t\t\tnode.nodeType === Node.PROCESSING_INSTRUCTION_NODE)\n\t);\n}\n\n/**\n * Returns true if `node` is a DOCTYPE node\n * @param {Node} node\n * @returns {boolean}\n */\nfunction isDocTypeNode(node) {\n\treturn node && node.nodeType === Node.DOCUMENT_TYPE_NODE;\n}\n\n/**\n * Returns true if the node is an element\n * @param {Node} node\n * @returns {boolean}\n */\nfunction isElementNode(node) {\n\treturn node && node.nodeType === Node.ELEMENT_NODE;\n}\n/**\n * Returns true if `node` is a text node\n * @param {Node} node\n * @returns {boolean}\n */\nfunction isTextNode(node) {\n\treturn node && node.nodeType === Node.TEXT_NODE;\n}\n\n/**\n * Check if en element node can be inserted before `child`, or at the end if child is falsy,\n * according to the presence and position of a doctype node on the same level.\n *\n * @param {Document} doc The document node\n * @param {Node} child the node that would become the nextSibling if the element would be inserted\n * @returns {boolean} `true` if an element can be inserted before child\n * @private\n * https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n */\nfunction isElementInsertionPossible(doc, child) {\n\tvar parentChildNodes = doc.childNodes || [];\n\tif (find(parentChildNodes, isElementNode) || isDocTypeNode(child)) {\n\t\treturn false;\n\t}\n\tvar docTypeNode = find(parentChildNodes, isDocTypeNode);\n\treturn !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child));\n}\n\n/**\n * Check if en element node can be inserted before `child`, or at the end if child is falsy,\n * according to the presence and position of a doctype node on the same level.\n *\n * @param {Node} doc The document node\n * @param {Node} child the node that would become the nextSibling if the element would be inserted\n * @returns {boolean} `true` if an element can be inserted before child\n * @private\n * https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n */\nfunction isElementReplacementPossible(doc, child) {\n\tvar parentChildNodes = doc.childNodes || [];\n\n\tfunction hasElementChildThatIsNotChild(node) {\n\t\treturn isElementNode(node) && node !== child;\n\t}\n\n\tif (find(parentChildNodes, hasElementChildThatIsNotChild)) {\n\t\treturn false;\n\t}\n\tvar docTypeNode = find(parentChildNodes, isDocTypeNode);\n\treturn !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child));\n}\n\n/**\n * @private\n * Steps 1-5 of the checks before inserting and before replacing a child are the same.\n *\n * @param {Node} parent the parent node to insert `node` into\n * @param {Node} node the node to insert\n * @param {Node=} child the node that should become the `nextSibling` of `node`\n * @returns {Node}\n * @throws DOMException for several node combinations that would create a DOM that is not well-formed.\n * @throws DOMException if `child` is provided but is not a child of `parent`.\n * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n * @see https://dom.spec.whatwg.org/#concept-node-replace\n */\nfunction assertPreInsertionValidity1to5(parent, node, child) {\n\t// 1. If `parent` is not a Document, DocumentFragment, or Element node, then throw a \"HierarchyRequestError\" DOMException.\n\tif (!hasValidParentNodeType(parent)) {\n\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Unexpected parent node type ' + parent.nodeType);\n\t}\n\t// 2. If `node` is a host-including inclusive ancestor of `parent`, then throw a \"HierarchyRequestError\" DOMException.\n\t// not implemented!\n\t// 3. If `child` is non-null and its parent is not `parent`, then throw a \"NotFoundError\" DOMException.\n\tif (child && child.parentNode !== parent) {\n\t\tthrow new DOMException(NOT_FOUND_ERR, 'child not in parent');\n\t}\n\tif (\n\t\t// 4. If `node` is not a DocumentFragment, DocumentType, Element, or CharacterData node, then throw a \"HierarchyRequestError\" DOMException.\n\t\t!hasInsertableNodeType(node) ||\n\t\t// 5. If either `node` is a Text node and `parent` is a document,\n\t\t// the sax parser currently adds top level text nodes, this will be fixed in 0.9.0\n\t\t// || (node.nodeType === Node.TEXT_NODE && parent.nodeType === Node.DOCUMENT_NODE)\n\t\t// or `node` is a doctype and `parent` is not a document, then throw a \"HierarchyRequestError\" DOMException.\n\t\t(isDocTypeNode(node) && parent.nodeType !== Node.DOCUMENT_NODE)\n\t) {\n\t\tthrow new DOMException(\n\t\t\tHIERARCHY_REQUEST_ERR,\n\t\t\t'Unexpected node type ' + node.nodeType + ' for parent node type ' + parent.nodeType\n\t\t);\n\t}\n}\n\n/**\n * @private\n * Step 6 of the checks before inserting and before replacing a child are different.\n *\n * @param {Document} parent the parent node to insert `node` into\n * @param {Node} node the node to insert\n * @param {Node | undefined} child the node that should become the `nextSibling` of `node`\n * @returns {Node}\n * @throws DOMException for several node combinations that would create a DOM that is not well-formed.\n * @throws DOMException if `child` is provided but is not a child of `parent`.\n * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n * @see https://dom.spec.whatwg.org/#concept-node-replace\n */\nfunction assertPreInsertionValidityInDocument(parent, node, child) {\n\tvar parentChildNodes = parent.childNodes || [];\n\tvar nodeChildNodes = node.childNodes || [];\n\n\t// DocumentFragment\n\tif (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n\t\tvar nodeChildElements = nodeChildNodes.filter(isElementNode);\n\t\t// If node has more than one element child or has a Text node child.\n\t\tif (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'More than one element or text in fragment');\n\t\t}\n\t\t// Otherwise, if `node` has one element child and either `parent` has an element child,\n\t\t// `child` is a doctype, or `child` is non-null and a doctype is following `child`.\n\t\tif (nodeChildElements.length === 1 && !isElementInsertionPossible(parent, child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Element in fragment can not be inserted before doctype');\n\t\t}\n\t}\n\t// Element\n\tif (isElementNode(node)) {\n\t\t// `parent` has an element child, `child` is a doctype,\n\t\t// or `child` is non-null and a doctype is following `child`.\n\t\tif (!isElementInsertionPossible(parent, child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Only one element can be added and only after doctype');\n\t\t}\n\t}\n\t// DocumentType\n\tif (isDocTypeNode(node)) {\n\t\t// `parent` has a doctype child,\n\t\tif (find(parentChildNodes, isDocTypeNode)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Only one doctype is allowed');\n\t\t}\n\t\tvar parentElementChild = find(parentChildNodes, isElementNode);\n\t\t// `child` is non-null and an element is preceding `child`,\n\t\tif (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can only be inserted before an element');\n\t\t}\n\t\t// or `child` is null and `parent` has an element child.\n\t\tif (!child && parentElementChild) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can not be appended since element is present');\n\t\t}\n\t}\n}\n\n/**\n * @private\n * Step 6 of the checks before inserting and before replacing a child are different.\n *\n * @param {Document} parent the parent node to insert `node` into\n * @param {Node} node the node to insert\n * @param {Node | undefined} child the node that should become the `nextSibling` of `node`\n * @returns {Node}\n * @throws DOMException for several node combinations that would create a DOM that is not well-formed.\n * @throws DOMException if `child` is provided but is not a child of `parent`.\n * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n * @see https://dom.spec.whatwg.org/#concept-node-replace\n */\nfunction assertPreReplacementValidityInDocument(parent, node, child) {\n\tvar parentChildNodes = parent.childNodes || [];\n\tvar nodeChildNodes = node.childNodes || [];\n\n\t// DocumentFragment\n\tif (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n\t\tvar nodeChildElements = nodeChildNodes.filter(isElementNode);\n\t\t// If `node` has more than one element child or has a Text node child.\n\t\tif (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'More than one element or text in fragment');\n\t\t}\n\t\t// Otherwise, if `node` has one element child and either `parent` has an element child that is not `child` or a doctype is following `child`.\n\t\tif (nodeChildElements.length === 1 && !isElementReplacementPossible(parent, child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Element in fragment can not be inserted before doctype');\n\t\t}\n\t}\n\t// Element\n\tif (isElementNode(node)) {\n\t\t// `parent` has an element child that is not `child` or a doctype is following `child`.\n\t\tif (!isElementReplacementPossible(parent, child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Only one element can be added and only after doctype');\n\t\t}\n\t}\n\t// DocumentType\n\tif (isDocTypeNode(node)) {\n\t\tfunction hasDoctypeChildThatIsNotChild(node) {\n\t\t\treturn isDocTypeNode(node) && node !== child;\n\t\t}\n\n\t\t// `parent` has a doctype child that is not `child`,\n\t\tif (find(parentChildNodes, hasDoctypeChildThatIsNotChild)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Only one doctype is allowed');\n\t\t}\n\t\tvar parentElementChild = find(parentChildNodes, isElementNode);\n\t\t// or an element is preceding `child`.\n\t\tif (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can only be inserted before an element');\n\t\t}\n\t}\n}\n\n/**\n * @private\n * @param {Node} parent the parent node to insert `node` into\n * @param {Node} node the node to insert\n * @param {Node=} child the node that should become the `nextSibling` of `node`\n * @returns {Node}\n * @throws DOMException for several node combinations that would create a DOM that is not well-formed.\n * @throws DOMException if `child` is provided but is not a child of `parent`.\n * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n */\nfunction _insertBefore(parent, node, child, _inDocumentAssertion) {\n\t// To ensure pre-insertion validity of a node into a parent before a child, run these steps:\n\tassertPreInsertionValidity1to5(parent, node, child);\n\n\t// If parent is a document, and any of the statements below, switched on the interface node implements,\n\t// are true, then throw a \"HierarchyRequestError\" DOMException.\n\tif (parent.nodeType === Node.DOCUMENT_NODE) {\n\t\t(_inDocumentAssertion || assertPreInsertionValidityInDocument)(parent, node, child);\n\t}\n\n\tvar cp = node.parentNode;\n\tif(cp){\n\t\tcp.removeChild(node);//remove and update\n\t}\n\tif(node.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = node.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn node;\n\t\t}\n\t\tvar newLast = node.lastChild;\n\t}else{\n\t\tnewFirst = newLast = node;\n\t}\n\tvar pre = child ? child.previousSibling : parent.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = child;\n\n\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparent.firstChild = newFirst;\n\t}\n\tif(child == null){\n\t\tparent.lastChild = newLast;\n\t}else{\n\t\tchild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parent;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parent.ownerDocument||parent, parent);\n\t//console.log(parent.lastChild.nextSibling == null)\n\tif (node.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnode.firstChild = node.lastChild = null;\n\t}\n\treturn node;\n}\n\n/**\n * Appends `newChild` to `parentNode`.\n * If `newChild` is already connected to a `parentNode` it is first removed from it.\n *\n * @see https://github.com/xmldom/xmldom/issues/135\n * @see https://github.com/xmldom/xmldom/issues/145\n * @param {Node} parentNode\n * @param {Node} newChild\n * @returns {Node}\n * @private\n */\nfunction _appendSingleChild (parentNode, newChild) {\n\tif (newChild.parentNode) {\n\t\tnewChild.parentNode.removeChild(newChild);\n\t}\n\tnewChild.parentNode = parentNode;\n\tnewChild.previousSibling = parentNode.lastChild;\n\tnewChild.nextSibling = null;\n\tif (newChild.previousSibling) {\n\t\tnewChild.previousSibling.nextSibling = newChild;\n\t} else {\n\t\tparentNode.firstChild = newChild;\n\t}\n\tparentNode.lastChild = newChild;\n\t_onUpdateChild(parentNode.ownerDocument, parentNode, newChild);\n\treturn newChild;\n}\n\nDocument.prototype = {\n\t//implementation : null,\n\tnodeName : '#document',\n\tnodeType : DOCUMENT_NODE,\n\t/**\n\t * The DocumentType node of the document.\n\t *\n\t * @readonly\n\t * @type DocumentType\n\t */\n\tdoctype : null,\n\tdocumentElement : null,\n\t_inc : 1,\n\n\tinsertBefore : function(newChild, refChild){//raises\n\t\tif(newChild.nodeType == DOCUMENT_FRAGMENT_NODE){\n\t\t\tvar child = newChild.firstChild;\n\t\t\twhile(child){\n\t\t\t\tvar next = child.nextSibling;\n\t\t\t\tthis.insertBefore(child,refChild);\n\t\t\t\tchild = next;\n\t\t\t}\n\t\t\treturn newChild;\n\t\t}\n\t\t_insertBefore(this, newChild, refChild);\n\t\tnewChild.ownerDocument = this;\n\t\tif (this.documentElement === null && newChild.nodeType === ELEMENT_NODE) {\n\t\t\tthis.documentElement = newChild;\n\t\t}\n\n\t\treturn newChild;\n\t},\n\tremoveChild : function(oldChild){\n\t\tif(this.documentElement == oldChild){\n\t\t\tthis.documentElement = null;\n\t\t}\n\t\treturn _removeChild(this,oldChild);\n\t},\n\treplaceChild: function (newChild, oldChild) {\n\t\t//raises\n\t\t_insertBefore(this, newChild, oldChild, assertPreReplacementValidityInDocument);\n\t\tnewChild.ownerDocument = this;\n\t\tif (oldChild) {\n\t\t\tthis.removeChild(oldChild);\n\t\t}\n\t\tif (isElementNode(newChild)) {\n\t\t\tthis.documentElement = newChild;\n\t\t}\n\t},\n\t// Introduced in DOM Level 2:\n\timportNode : function(importedNode,deep){\n\t\treturn importNode(this,importedNode,deep);\n\t},\n\t// Introduced in DOM Level 2:\n\tgetElementById :\tfunction(id){\n\t\tvar rtv = null;\n\t\t_visitNode(this.documentElement,function(node){\n\t\t\tif(node.nodeType == ELEMENT_NODE){\n\t\t\t\tif(node.getAttribute('id') == id){\n\t\t\t\t\trtv = node;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\treturn rtv;\n\t},\n\n\t/**\n\t * The `getElementsByClassName` method of `Document` interface returns an array-like object\n\t * of all child elements which have **all** of the given class name(s).\n\t *\n\t * Returns an empty list if `classeNames` is an empty string or only contains HTML white space characters.\n\t *\n\t *\n\t * Warning: This is a live LiveNodeList.\n\t * Changes in the DOM will reflect in the array as the changes occur.\n\t * If an element selected by this array no longer qualifies for the selector,\n\t * it will automatically be removed. Be aware of this for iteration purposes.\n\t *\n\t * @param {string} classNames is a string representing the class name(s) to match; multiple class names are separated by (ASCII-)whitespace\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName\n\t * @see https://dom.spec.whatwg.org/#concept-getelementsbyclassname\n\t */\n\tgetElementsByClassName: function(classNames) {\n\t\tvar classNamesSet = toOrderedSet(classNames)\n\t\treturn new LiveNodeList(this, function(base) {\n\t\t\tvar ls = [];\n\t\t\tif (classNamesSet.length > 0) {\n\t\t\t\t_visitNode(base.documentElement, function(node) {\n\t\t\t\t\tif(node !== base && node.nodeType === ELEMENT_NODE) {\n\t\t\t\t\t\tvar nodeClassNames = node.getAttribute('class')\n\t\t\t\t\t\t// can be null if the attribute does not exist\n\t\t\t\t\t\tif (nodeClassNames) {\n\t\t\t\t\t\t\t// before splitting and iterating just compare them for the most common case\n\t\t\t\t\t\t\tvar matches = classNames === nodeClassNames;\n\t\t\t\t\t\t\tif (!matches) {\n\t\t\t\t\t\t\t\tvar nodeClassNamesSet = toOrderedSet(nodeClassNames)\n\t\t\t\t\t\t\t\tmatches = classNamesSet.every(arrayIncludes(nodeClassNamesSet))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(matches) {\n\t\t\t\t\t\t\t\tls.push(node);\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});\n\t\t\t}\n\t\t\treturn ls;\n\t\t});\n\t},\n\n\t//document factory method:\n\tcreateElement :\tfunction(tagName){\n\t\tvar node = new Element();\n\t\tnode.ownerDocument = this;\n\t\tnode.nodeName = tagName;\n\t\tnode.tagName = tagName;\n\t\tnode.localName = tagName;\n\t\tnode.childNodes = new NodeList();\n\t\tvar attrs\t= node.attributes = new NamedNodeMap();\n\t\tattrs._ownerElement = node;\n\t\treturn node;\n\t},\n\tcreateDocumentFragment :\tfunction(){\n\t\tvar node = new DocumentFragment();\n\t\tnode.ownerDocument = this;\n\t\tnode.childNodes = new NodeList();\n\t\treturn node;\n\t},\n\tcreateTextNode :\tfunction(data){\n\t\tvar node = new Text();\n\t\tnode.ownerDocument = this;\n\t\tnode.appendData(data)\n\t\treturn node;\n\t},\n\tcreateComment :\tfunction(data){\n\t\tvar node = new Comment();\n\t\tnode.ownerDocument = this;\n\t\tnode.appendData(data)\n\t\treturn node;\n\t},\n\tcreateCDATASection :\tfunction(data){\n\t\tvar node = new CDATASection();\n\t\tnode.ownerDocument = this;\n\t\tnode.appendData(data)\n\t\treturn node;\n\t},\n\tcreateProcessingInstruction :\tfunction(target,data){\n\t\tvar node = new ProcessingInstruction();\n\t\tnode.ownerDocument = this;\n\t\tnode.tagName = node.nodeName = node.target = target;\n\t\tnode.nodeValue = node.data = data;\n\t\treturn node;\n\t},\n\tcreateAttribute :\tfunction(name){\n\t\tvar node = new Attr();\n\t\tnode.ownerDocument\t= this;\n\t\tnode.name = name;\n\t\tnode.nodeName\t= name;\n\t\tnode.localName = name;\n\t\tnode.specified = true;\n\t\treturn node;\n\t},\n\tcreateEntityReference :\tfunction(name){\n\t\tvar node = new EntityReference();\n\t\tnode.ownerDocument\t= this;\n\t\tnode.nodeName\t= name;\n\t\treturn node;\n\t},\n\t// Introduced in DOM Level 2:\n\tcreateElementNS :\tfunction(namespaceURI,qualifiedName){\n\t\tvar node = new Element();\n\t\tvar pl = qualifiedName.split(':');\n\t\tvar attrs\t= node.attributes = new NamedNodeMap();\n\t\tnode.childNodes = new NodeList();\n\t\tnode.ownerDocument = this;\n\t\tnode.nodeName = qualifiedName;\n\t\tnode.tagName = qualifiedName;\n\t\tnode.namespaceURI = namespaceURI;\n\t\tif(pl.length == 2){\n\t\t\tnode.prefix = pl[0];\n\t\t\tnode.localName = pl[1];\n\t\t}else{\n\t\t\t//el.prefix = null;\n\t\t\tnode.localName = qualifiedName;\n\t\t}\n\t\tattrs._ownerElement = node;\n\t\treturn node;\n\t},\n\t// Introduced in DOM Level 2:\n\tcreateAttributeNS :\tfunction(namespaceURI,qualifiedName){\n\t\tvar node = new Attr();\n\t\tvar pl = qualifiedName.split(':');\n\t\tnode.ownerDocument = this;\n\t\tnode.nodeName = qualifiedName;\n\t\tnode.name = qualifiedName;\n\t\tnode.namespaceURI = namespaceURI;\n\t\tnode.specified = true;\n\t\tif(pl.length == 2){\n\t\t\tnode.prefix = pl[0];\n\t\t\tnode.localName = pl[1];\n\t\t}else{\n\t\t\t//el.prefix = null;\n\t\t\tnode.localName = qualifiedName;\n\t\t}\n\t\treturn node;\n\t}\n};\n_extends(Document,Node);\n\n\nfunction Element() {\n\tthis._nsMap = {};\n};\nElement.prototype = {\n\tnodeType : ELEMENT_NODE,\n\thasAttribute : function(name){\n\t\treturn this.getAttributeNode(name)!=null;\n\t},\n\tgetAttribute : function(name){\n\t\tvar attr = this.getAttributeNode(name);\n\t\treturn attr && attr.value || '';\n\t},\n\tgetAttributeNode : function(name){\n\t\treturn this.attributes.getNamedItem(name);\n\t},\n\tsetAttribute : function(name, value){\n\t\tvar attr = this.ownerDocument.createAttribute(name);\n\t\tattr.value = attr.nodeValue = \"\" + value;\n\t\tthis.setAttributeNode(attr)\n\t},\n\tremoveAttribute : function(name){\n\t\tvar attr = this.getAttributeNode(name)\n\t\tattr && this.removeAttributeNode(attr);\n\t},\n\n\t//four real opeartion method\n\tappendChild:function(newChild){\n\t\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\t\treturn this.insertBefore(newChild,null);\n\t\t}else{\n\t\t\treturn _appendSingleChild(this,newChild);\n\t\t}\n\t},\n\tsetAttributeNode : function(newAttr){\n\t\treturn this.attributes.setNamedItem(newAttr);\n\t},\n\tsetAttributeNodeNS : function(newAttr){\n\t\treturn this.attributes.setNamedItemNS(newAttr);\n\t},\n\tremoveAttributeNode : function(oldAttr){\n\t\t//console.log(this == oldAttr.ownerElement)\n\t\treturn this.attributes.removeNamedItem(oldAttr.nodeName);\n\t},\n\t//get real attribute name,and remove it by removeAttributeNode\n\tremoveAttributeNS : function(namespaceURI, localName){\n\t\tvar old = this.getAttributeNodeNS(namespaceURI, localName);\n\t\told && this.removeAttributeNode(old);\n\t},\n\n\thasAttributeNS : function(namespaceURI, localName){\n\t\treturn this.getAttributeNodeNS(namespaceURI, localName)!=null;\n\t},\n\tgetAttributeNS : function(namespaceURI, localName){\n\t\tvar attr = this.getAttributeNodeNS(namespaceURI, localName);\n\t\treturn attr && attr.value || '';\n\t},\n\tsetAttributeNS : function(namespaceURI, qualifiedName, value){\n\t\tvar attr = this.ownerDocument.createAttributeNS(namespaceURI, qualifiedName);\n\t\tattr.value = attr.nodeValue = \"\" + value;\n\t\tthis.setAttributeNode(attr)\n\t},\n\tgetAttributeNodeNS : function(namespaceURI, localName){\n\t\treturn this.attributes.getNamedItemNS(namespaceURI, localName);\n\t},\n\n\tgetElementsByTagName : function(tagName){\n\t\treturn new LiveNodeList(this,function(base){\n\t\t\tvar ls = [];\n\t\t\t_visitNode(base,function(node){\n\t\t\t\tif(node !== base && node.nodeType == ELEMENT_NODE && (tagName === '*' || node.tagName == tagName)){\n\t\t\t\t\tls.push(node);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn ls;\n\t\t});\n\t},\n\tgetElementsByTagNameNS : function(namespaceURI, localName){\n\t\treturn new LiveNodeList(this,function(base){\n\t\t\tvar ls = [];\n\t\t\t_visitNode(base,function(node){\n\t\t\t\tif(node !== base && node.nodeType === ELEMENT_NODE && (namespaceURI === '*' || node.namespaceURI === namespaceURI) && (localName === '*' || node.localName == localName)){\n\t\t\t\t\tls.push(node);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn ls;\n\n\t\t});\n\t}\n};\nDocument.prototype.getElementsByTagName = Element.prototype.getElementsByTagName;\nDocument.prototype.getElementsByTagNameNS = Element.prototype.getElementsByTagNameNS;\n\n\n_extends(Element,Node);\nfunction Attr() {\n};\nAttr.prototype.nodeType = ATTRIBUTE_NODE;\n_extends(Attr,Node);\n\n\nfunction CharacterData() {\n};\nCharacterData.prototype = {\n\tdata : '',\n\tsubstringData : function(offset, count) {\n\t\treturn this.data.substring(offset, offset+count);\n\t},\n\tappendData: function(text) {\n\t\ttext = this.data+text;\n\t\tthis.nodeValue = this.data = text;\n\t\tthis.length = text.length;\n\t},\n\tinsertData: function(offset,text) {\n\t\tthis.replaceData(offset,0,text);\n\n\t},\n\tappendChild:function(newChild){\n\t\tthrow new Error(ExceptionMessage[HIERARCHY_REQUEST_ERR])\n\t},\n\tdeleteData: function(offset, count) {\n\t\tthis.replaceData(offset,count,\"\");\n\t},\n\treplaceData: function(offset, count, text) {\n\t\tvar start = this.data.substring(0,offset);\n\t\tvar end = this.data.substring(offset+count);\n\t\ttext = start + text + end;\n\t\tthis.nodeValue = this.data = text;\n\t\tthis.length = text.length;\n\t}\n}\n_extends(CharacterData,Node);\nfunction Text() {\n};\nText.prototype = {\n\tnodeName : \"#text\",\n\tnodeType : TEXT_NODE,\n\tsplitText : function(offset) {\n\t\tvar text = this.data;\n\t\tvar newText = text.substring(offset);\n\t\ttext = text.substring(0, offset);\n\t\tthis.data = this.nodeValue = text;\n\t\tthis.length = text.length;\n\t\tvar newNode = this.ownerDocument.createTextNode(newText);\n\t\tif(this.parentNode){\n\t\t\tthis.parentNode.insertBefore(newNode, this.nextSibling);\n\t\t}\n\t\treturn newNode;\n\t}\n}\n_extends(Text,CharacterData);\nfunction Comment() {\n};\nComment.prototype = {\n\tnodeName : \"#comment\",\n\tnodeType : COMMENT_NODE\n}\n_extends(Comment,CharacterData);\n\nfunction CDATASection() {\n};\nCDATASection.prototype = {\n\tnodeName : \"#cdata-section\",\n\tnodeType : CDATA_SECTION_NODE\n}\n_extends(CDATASection,CharacterData);\n\n\nfunction DocumentType() {\n};\nDocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;\n_extends(DocumentType,Node);\n\nfunction Notation() {\n};\nNotation.prototype.nodeType = NOTATION_NODE;\n_extends(Notation,Node);\n\nfunction Entity() {\n};\nEntity.prototype.nodeType = ENTITY_NODE;\n_extends(Entity,Node);\n\nfunction EntityReference() {\n};\nEntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE;\n_extends(EntityReference,Node);\n\nfunction DocumentFragment() {\n};\nDocumentFragment.prototype.nodeName =\t\"#document-fragment\";\nDocumentFragment.prototype.nodeType =\tDOCUMENT_FRAGMENT_NODE;\n_extends(DocumentFragment,Node);\n\n\nfunction ProcessingInstruction() {\n}\nProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE;\n_extends(ProcessingInstruction,Node);\nfunction XMLSerializer(){}\nXMLSerializer.prototype.serializeToString = function(node,isHtml,nodeFilter){\n\treturn nodeSerializeToString.call(node,isHtml,nodeFilter);\n}\nNode.prototype.toString = nodeSerializeToString;\nfunction nodeSerializeToString(isHtml,nodeFilter){\n\tvar buf = [];\n\tvar refNode = this.nodeType == 9 && this.documentElement || this;\n\tvar prefix = refNode.prefix;\n\tvar uri = refNode.namespaceURI;\n\n\tif(uri && prefix == null){\n\t\t//console.log(prefix)\n\t\tvar prefix = refNode.lookupPrefix(uri);\n\t\tif(prefix == null){\n\t\t\t//isHTML = true;\n\t\t\tvar visibleNamespaces=[\n\t\t\t{namespace:uri,prefix:null}\n\t\t\t//{namespace:uri,prefix:''}\n\t\t\t]\n\t\t}\n\t}\n\tserializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces);\n\t//console.log('###',this.nodeType,uri,prefix,buf.join(''))\n\treturn buf.join('');\n}\n\nfunction needNamespaceDefine(node, isHTML, visibleNamespaces) {\n\tvar prefix = node.prefix || '';\n\tvar uri = node.namespaceURI;\n\t// According to [Namespaces in XML 1.0](https://www.w3.org/TR/REC-xml-names/#ns-using) ,\n\t// and more specifically https://www.w3.org/TR/REC-xml-names/#nsc-NoPrefixUndecl :\n\t// > In a namespace declaration for a prefix [...], the attribute value MUST NOT be empty.\n\t// in a similar manner [Namespaces in XML 1.1](https://www.w3.org/TR/xml-names11/#ns-using)\n\t// and more specifically https://www.w3.org/TR/xml-names11/#nsc-NSDeclared :\n\t// > [...] Furthermore, the attribute value [...] must not be an empty string.\n\t// so serializing empty namespace value like xmlns:ds=\"\" would produce an invalid XML document.\n\tif (!uri) {\n\t\treturn false;\n\t}\n\tif (prefix === \"xml\" && uri === NAMESPACE.XML || uri === NAMESPACE.XMLNS) {\n\t\treturn false;\n\t}\n\n\tvar i = visibleNamespaces.length\n\twhile (i--) {\n\t\tvar ns = visibleNamespaces[i];\n\t\t// get namespace prefix\n\t\tif (ns.prefix === prefix) {\n\t\t\treturn ns.namespace !== uri;\n\t\t}\n\t}\n\treturn true;\n}\n/**\n * Well-formed constraint: No < in Attribute Values\n * > The replacement text of any entity referred to directly or indirectly\n * > in an attribute value must not contain a <.\n * @see https://www.w3.org/TR/xml11/#CleanAttrVals\n * @see https://www.w3.org/TR/xml11/#NT-AttValue\n *\n * Literal whitespace other than space that appear in attribute values\n * are serialized as their entity references, so they will be preserved.\n * (In contrast to whitespace literals in the input which are normalized to spaces)\n * @see https://www.w3.org/TR/xml11/#AVNormalize\n * @see https://w3c.github.io/DOM-Parsing/#serializing-an-element-s-attributes\n */\nfunction addSerializedAttribute(buf, qualifiedName, value) {\n\tbuf.push(' ', qualifiedName, '=\"', value.replace(/[<>&\"\\t\\n\\r]/g, _xmlEncoder), '\"')\n}\n\nfunction serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){\n\tif (!visibleNamespaces) {\n\t\tvisibleNamespaces = [];\n\t}\n\n\tif(nodeFilter){\n\t\tnode = nodeFilter(node);\n\t\tif(node){\n\t\t\tif(typeof node == 'string'){\n\t\t\t\tbuf.push(node);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}else{\n\t\t\treturn;\n\t\t}\n\t\t//buf.sort.apply(attrs, attributeSorter);\n\t}\n\n\tswitch(node.nodeType){\n\tcase ELEMENT_NODE:\n\t\tvar attrs = node.attributes;\n\t\tvar len = attrs.length;\n\t\tvar child = node.firstChild;\n\t\tvar nodeName = node.tagName;\n\n\t\tisHTML = NAMESPACE.isHTML(node.namespaceURI) || isHTML\n\n\t\tvar prefixedNodeName = nodeName\n\t\tif (!isHTML && !node.prefix && node.namespaceURI) {\n\t\t\tvar defaultNS\n\t\t\t// lookup current default ns from `xmlns` attribute\n\t\t\tfor (var ai = 0; ai < attrs.length; ai++) {\n\t\t\t\tif (attrs.item(ai).name === 'xmlns') {\n\t\t\t\t\tdefaultNS = attrs.item(ai).value\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!defaultNS) {\n\t\t\t\t// lookup current default ns in visibleNamespaces\n\t\t\t\tfor (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {\n\t\t\t\t\tvar namespace = visibleNamespaces[nsi]\n\t\t\t\t\tif (namespace.prefix === '' && namespace.namespace === node.namespaceURI) {\n\t\t\t\t\t\tdefaultNS = namespace.namespace\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (defaultNS !== node.namespaceURI) {\n\t\t\t\tfor (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {\n\t\t\t\t\tvar namespace = visibleNamespaces[nsi]\n\t\t\t\t\tif (namespace.namespace === node.namespaceURI) {\n\t\t\t\t\t\tif (namespace.prefix) {\n\t\t\t\t\t\t\tprefixedNodeName = namespace.prefix + ':' + nodeName\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuf.push('<', prefixedNodeName);\n\n\t\tfor(var i=0;i');\n\t\t\t//if is cdata child node\n\t\t\tif(isHTML && /^script$/i.test(nodeName)){\n\t\t\t\twhile(child){\n\t\t\t\t\tif(child.data){\n\t\t\t\t\t\tbuf.push(child.data);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tserializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());\n\t\t\t\t\t}\n\t\t\t\t\tchild = child.nextSibling;\n\t\t\t\t}\n\t\t\t}else\n\t\t\t{\n\t\t\t\twhile(child){\n\t\t\t\t\tserializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());\n\t\t\t\t\tchild = child.nextSibling;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbuf.push('');\n\t\t}else{\n\t\t\tbuf.push('/>');\n\t\t}\n\t\t// remove added visible namespaces\n\t\t//visibleNamespaces.length = startVisibleNamespaces;\n\t\treturn;\n\tcase DOCUMENT_NODE:\n\tcase DOCUMENT_FRAGMENT_NODE:\n\t\tvar child = node.firstChild;\n\t\twhile(child){\n\t\t\tserializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());\n\t\t\tchild = child.nextSibling;\n\t\t}\n\t\treturn;\n\tcase ATTRIBUTE_NODE:\n\t\treturn addSerializedAttribute(buf, node.name, node.value);\n\tcase TEXT_NODE:\n\t\t/**\n\t\t * The ampersand character (&) and the left angle bracket (<) must not appear in their literal form,\n\t\t * except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section.\n\t\t * If they are needed elsewhere, they must be escaped using either numeric character references or the strings\n\t\t * `&` and `<` respectively.\n\t\t * The right angle bracket (>) may be represented using the string \" > \", and must, for compatibility,\n\t\t * be escaped using either `>` or a character reference when it appears in the string `]]>` in content,\n\t\t * when that string is not marking the end of a CDATA section.\n\t\t *\n\t\t * In the content of elements, character data is any string of characters\n\t\t * which does not contain the start-delimiter of any markup\n\t\t * and does not include the CDATA-section-close delimiter, `]]>`.\n\t\t *\n\t\t * @see https://www.w3.org/TR/xml/#NT-CharData\n\t\t * @see https://w3c.github.io/DOM-Parsing/#xml-serializing-a-text-node\n\t\t */\n\t\treturn buf.push(node.data\n\t\t\t.replace(/[<&>]/g,_xmlEncoder)\n\t\t);\n\tcase CDATA_SECTION_NODE:\n\t\treturn buf.push( '');\n\tcase COMMENT_NODE:\n\t\treturn buf.push( \"\");\n\tcase DOCUMENT_TYPE_NODE:\n\t\tvar pubid = node.publicId;\n\t\tvar sysid = node.systemId;\n\t\tbuf.push('');\n\t\t}else if(sysid && sysid!='.'){\n\t\t\tbuf.push(' SYSTEM ', sysid, '>');\n\t\t}else{\n\t\t\tvar sub = node.internalSubset;\n\t\t\tif(sub){\n\t\t\t\tbuf.push(\" [\",sub,\"]\");\n\t\t\t}\n\t\t\tbuf.push(\">\");\n\t\t}\n\t\treturn;\n\tcase PROCESSING_INSTRUCTION_NODE:\n\t\treturn buf.push( \"\");\n\tcase ENTITY_REFERENCE_NODE:\n\t\treturn buf.push( '&',node.nodeName,';');\n\t//case ENTITY_NODE:\n\t//case NOTATION_NODE:\n\tdefault:\n\t\tbuf.push('??',node.nodeName);\n\t}\n}\nfunction importNode(doc,node,deep){\n\tvar node2;\n\tswitch (node.nodeType) {\n\tcase ELEMENT_NODE:\n\t\tnode2 = node.cloneNode(false);\n\t\tnode2.ownerDocument = doc;\n\t\t//var attrs = node2.attributes;\n\t\t//var len = attrs.length;\n\t\t//for(var i=0;i',\n\tlt: '<',\n\tquot: '\"',\n});\n\n/**\n * A map of all entities that are detected in an HTML document.\n * They contain all entries from `XML_ENTITIES`.\n *\n * @see XML_ENTITIES\n * @see DOMParser.parseFromString\n * @see DOMImplementation.prototype.createHTMLDocument\n * @see https://html.spec.whatwg.org/#named-character-references WHATWG HTML(5) Spec\n * @see https://html.spec.whatwg.org/entities.json JSON\n * @see https://www.w3.org/TR/xml-entity-names/ W3C XML Entity Names\n * @see https://www.w3.org/TR/html4/sgml/entities.html W3C HTML4/SGML\n * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Character_entity_references_in_HTML Wikipedia (HTML)\n * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Entities_representing_special_characters_in_XHTML Wikpedia (XHTML)\n */\nexports.HTML_ENTITIES = freeze({\n\tAacute: '\\u00C1',\n\taacute: '\\u00E1',\n\tAbreve: '\\u0102',\n\tabreve: '\\u0103',\n\tac: '\\u223E',\n\tacd: '\\u223F',\n\tacE: '\\u223E\\u0333',\n\tAcirc: '\\u00C2',\n\tacirc: '\\u00E2',\n\tacute: '\\u00B4',\n\tAcy: '\\u0410',\n\tacy: '\\u0430',\n\tAElig: '\\u00C6',\n\taelig: '\\u00E6',\n\taf: '\\u2061',\n\tAfr: '\\uD835\\uDD04',\n\tafr: '\\uD835\\uDD1E',\n\tAgrave: '\\u00C0',\n\tagrave: '\\u00E0',\n\talefsym: '\\u2135',\n\taleph: '\\u2135',\n\tAlpha: '\\u0391',\n\talpha: '\\u03B1',\n\tAmacr: '\\u0100',\n\tamacr: '\\u0101',\n\tamalg: '\\u2A3F',\n\tAMP: '\\u0026',\n\tamp: '\\u0026',\n\tAnd: '\\u2A53',\n\tand: '\\u2227',\n\tandand: '\\u2A55',\n\tandd: '\\u2A5C',\n\tandslope: '\\u2A58',\n\tandv: '\\u2A5A',\n\tang: '\\u2220',\n\tange: '\\u29A4',\n\tangle: '\\u2220',\n\tangmsd: '\\u2221',\n\tangmsdaa: '\\u29A8',\n\tangmsdab: '\\u29A9',\n\tangmsdac: '\\u29AA',\n\tangmsdad: '\\u29AB',\n\tangmsdae: '\\u29AC',\n\tangmsdaf: '\\u29AD',\n\tangmsdag: '\\u29AE',\n\tangmsdah: '\\u29AF',\n\tangrt: '\\u221F',\n\tangrtvb: '\\u22BE',\n\tangrtvbd: '\\u299D',\n\tangsph: '\\u2222',\n\tangst: '\\u00C5',\n\tangzarr: '\\u237C',\n\tAogon: '\\u0104',\n\taogon: '\\u0105',\n\tAopf: '\\uD835\\uDD38',\n\taopf: '\\uD835\\uDD52',\n\tap: '\\u2248',\n\tapacir: '\\u2A6F',\n\tapE: '\\u2A70',\n\tape: '\\u224A',\n\tapid: '\\u224B',\n\tapos: '\\u0027',\n\tApplyFunction: '\\u2061',\n\tapprox: '\\u2248',\n\tapproxeq: '\\u224A',\n\tAring: '\\u00C5',\n\taring: '\\u00E5',\n\tAscr: '\\uD835\\uDC9C',\n\tascr: '\\uD835\\uDCB6',\n\tAssign: '\\u2254',\n\tast: '\\u002A',\n\tasymp: '\\u2248',\n\tasympeq: '\\u224D',\n\tAtilde: '\\u00C3',\n\tatilde: '\\u00E3',\n\tAuml: '\\u00C4',\n\tauml: '\\u00E4',\n\tawconint: '\\u2233',\n\tawint: '\\u2A11',\n\tbackcong: '\\u224C',\n\tbackepsilon: '\\u03F6',\n\tbackprime: '\\u2035',\n\tbacksim: '\\u223D',\n\tbacksimeq: '\\u22CD',\n\tBackslash: '\\u2216',\n\tBarv: '\\u2AE7',\n\tbarvee: '\\u22BD',\n\tBarwed: '\\u2306',\n\tbarwed: '\\u2305',\n\tbarwedge: '\\u2305',\n\tbbrk: '\\u23B5',\n\tbbrktbrk: '\\u23B6',\n\tbcong: '\\u224C',\n\tBcy: '\\u0411',\n\tbcy: '\\u0431',\n\tbdquo: '\\u201E',\n\tbecaus: '\\u2235',\n\tBecause: '\\u2235',\n\tbecause: '\\u2235',\n\tbemptyv: '\\u29B0',\n\tbepsi: '\\u03F6',\n\tbernou: '\\u212C',\n\tBernoullis: '\\u212C',\n\tBeta: '\\u0392',\n\tbeta: '\\u03B2',\n\tbeth: '\\u2136',\n\tbetween: '\\u226C',\n\tBfr: '\\uD835\\uDD05',\n\tbfr: '\\uD835\\uDD1F',\n\tbigcap: '\\u22C2',\n\tbigcirc: '\\u25EF',\n\tbigcup: '\\u22C3',\n\tbigodot: '\\u2A00',\n\tbigoplus: '\\u2A01',\n\tbigotimes: '\\u2A02',\n\tbigsqcup: '\\u2A06',\n\tbigstar: '\\u2605',\n\tbigtriangledown: '\\u25BD',\n\tbigtriangleup: '\\u25B3',\n\tbiguplus: '\\u2A04',\n\tbigvee: '\\u22C1',\n\tbigwedge: '\\u22C0',\n\tbkarow: '\\u290D',\n\tblacklozenge: '\\u29EB',\n\tblacksquare: '\\u25AA',\n\tblacktriangle: '\\u25B4',\n\tblacktriangledown: '\\u25BE',\n\tblacktriangleleft: '\\u25C2',\n\tblacktriangleright: '\\u25B8',\n\tblank: '\\u2423',\n\tblk12: '\\u2592',\n\tblk14: '\\u2591',\n\tblk34: '\\u2593',\n\tblock: '\\u2588',\n\tbne: '\\u003D\\u20E5',\n\tbnequiv: '\\u2261\\u20E5',\n\tbNot: '\\u2AED',\n\tbnot: '\\u2310',\n\tBopf: '\\uD835\\uDD39',\n\tbopf: '\\uD835\\uDD53',\n\tbot: '\\u22A5',\n\tbottom: '\\u22A5',\n\tbowtie: '\\u22C8',\n\tboxbox: '\\u29C9',\n\tboxDL: '\\u2557',\n\tboxDl: '\\u2556',\n\tboxdL: '\\u2555',\n\tboxdl: '\\u2510',\n\tboxDR: '\\u2554',\n\tboxDr: '\\u2553',\n\tboxdR: '\\u2552',\n\tboxdr: '\\u250C',\n\tboxH: '\\u2550',\n\tboxh: '\\u2500',\n\tboxHD: '\\u2566',\n\tboxHd: '\\u2564',\n\tboxhD: '\\u2565',\n\tboxhd: '\\u252C',\n\tboxHU: '\\u2569',\n\tboxHu: '\\u2567',\n\tboxhU: '\\u2568',\n\tboxhu: '\\u2534',\n\tboxminus: '\\u229F',\n\tboxplus: '\\u229E',\n\tboxtimes: '\\u22A0',\n\tboxUL: '\\u255D',\n\tboxUl: '\\u255C',\n\tboxuL: '\\u255B',\n\tboxul: '\\u2518',\n\tboxUR: '\\u255A',\n\tboxUr: '\\u2559',\n\tboxuR: '\\u2558',\n\tboxur: '\\u2514',\n\tboxV: '\\u2551',\n\tboxv: '\\u2502',\n\tboxVH: '\\u256C',\n\tboxVh: '\\u256B',\n\tboxvH: '\\u256A',\n\tboxvh: '\\u253C',\n\tboxVL: '\\u2563',\n\tboxVl: '\\u2562',\n\tboxvL: '\\u2561',\n\tboxvl: '\\u2524',\n\tboxVR: '\\u2560',\n\tboxVr: '\\u255F',\n\tboxvR: '\\u255E',\n\tboxvr: '\\u251C',\n\tbprime: '\\u2035',\n\tBreve: '\\u02D8',\n\tbreve: '\\u02D8',\n\tbrvbar: '\\u00A6',\n\tBscr: '\\u212C',\n\tbscr: '\\uD835\\uDCB7',\n\tbsemi: '\\u204F',\n\tbsim: '\\u223D',\n\tbsime: '\\u22CD',\n\tbsol: '\\u005C',\n\tbsolb: '\\u29C5',\n\tbsolhsub: '\\u27C8',\n\tbull: '\\u2022',\n\tbullet: '\\u2022',\n\tbump: '\\u224E',\n\tbumpE: '\\u2AAE',\n\tbumpe: '\\u224F',\n\tBumpeq: '\\u224E',\n\tbumpeq: '\\u224F',\n\tCacute: '\\u0106',\n\tcacute: '\\u0107',\n\tCap: '\\u22D2',\n\tcap: '\\u2229',\n\tcapand: '\\u2A44',\n\tcapbrcup: '\\u2A49',\n\tcapcap: '\\u2A4B',\n\tcapcup: '\\u2A47',\n\tcapdot: '\\u2A40',\n\tCapitalDifferentialD: '\\u2145',\n\tcaps: '\\u2229\\uFE00',\n\tcaret: '\\u2041',\n\tcaron: '\\u02C7',\n\tCayleys: '\\u212D',\n\tccaps: '\\u2A4D',\n\tCcaron: '\\u010C',\n\tccaron: '\\u010D',\n\tCcedil: '\\u00C7',\n\tccedil: '\\u00E7',\n\tCcirc: '\\u0108',\n\tccirc: '\\u0109',\n\tCconint: '\\u2230',\n\tccups: '\\u2A4C',\n\tccupssm: '\\u2A50',\n\tCdot: '\\u010A',\n\tcdot: '\\u010B',\n\tcedil: '\\u00B8',\n\tCedilla: '\\u00B8',\n\tcemptyv: '\\u29B2',\n\tcent: '\\u00A2',\n\tCenterDot: '\\u00B7',\n\tcenterdot: '\\u00B7',\n\tCfr: '\\u212D',\n\tcfr: '\\uD835\\uDD20',\n\tCHcy: '\\u0427',\n\tchcy: '\\u0447',\n\tcheck: '\\u2713',\n\tcheckmark: '\\u2713',\n\tChi: '\\u03A7',\n\tchi: '\\u03C7',\n\tcir: '\\u25CB',\n\tcirc: '\\u02C6',\n\tcirceq: '\\u2257',\n\tcirclearrowleft: '\\u21BA',\n\tcirclearrowright: '\\u21BB',\n\tcircledast: '\\u229B',\n\tcircledcirc: '\\u229A',\n\tcircleddash: '\\u229D',\n\tCircleDot: '\\u2299',\n\tcircledR: '\\u00AE',\n\tcircledS: '\\u24C8',\n\tCircleMinus: '\\u2296',\n\tCirclePlus: '\\u2295',\n\tCircleTimes: '\\u2297',\n\tcirE: '\\u29C3',\n\tcire: '\\u2257',\n\tcirfnint: '\\u2A10',\n\tcirmid: '\\u2AEF',\n\tcirscir: '\\u29C2',\n\tClockwiseContourIntegral: '\\u2232',\n\tCloseCurlyDoubleQuote: '\\u201D',\n\tCloseCurlyQuote: '\\u2019',\n\tclubs: '\\u2663',\n\tclubsuit: '\\u2663',\n\tColon: '\\u2237',\n\tcolon: '\\u003A',\n\tColone: '\\u2A74',\n\tcolone: '\\u2254',\n\tcoloneq: '\\u2254',\n\tcomma: '\\u002C',\n\tcommat: '\\u0040',\n\tcomp: '\\u2201',\n\tcompfn: '\\u2218',\n\tcomplement: '\\u2201',\n\tcomplexes: '\\u2102',\n\tcong: '\\u2245',\n\tcongdot: '\\u2A6D',\n\tCongruent: '\\u2261',\n\tConint: '\\u222F',\n\tconint: '\\u222E',\n\tContourIntegral: '\\u222E',\n\tCopf: '\\u2102',\n\tcopf: '\\uD835\\uDD54',\n\tcoprod: '\\u2210',\n\tCoproduct: '\\u2210',\n\tCOPY: '\\u00A9',\n\tcopy: '\\u00A9',\n\tcopysr: '\\u2117',\n\tCounterClockwiseContourIntegral: '\\u2233',\n\tcrarr: '\\u21B5',\n\tCross: '\\u2A2F',\n\tcross: '\\u2717',\n\tCscr: '\\uD835\\uDC9E',\n\tcscr: '\\uD835\\uDCB8',\n\tcsub: '\\u2ACF',\n\tcsube: '\\u2AD1',\n\tcsup: '\\u2AD0',\n\tcsupe: '\\u2AD2',\n\tctdot: '\\u22EF',\n\tcudarrl: '\\u2938',\n\tcudarrr: '\\u2935',\n\tcuepr: '\\u22DE',\n\tcuesc: '\\u22DF',\n\tcularr: '\\u21B6',\n\tcularrp: '\\u293D',\n\tCup: '\\u22D3',\n\tcup: '\\u222A',\n\tcupbrcap: '\\u2A48',\n\tCupCap: '\\u224D',\n\tcupcap: '\\u2A46',\n\tcupcup: '\\u2A4A',\n\tcupdot: '\\u228D',\n\tcupor: '\\u2A45',\n\tcups: '\\u222A\\uFE00',\n\tcurarr: '\\u21B7',\n\tcurarrm: '\\u293C',\n\tcurlyeqprec: '\\u22DE',\n\tcurlyeqsucc: '\\u22DF',\n\tcurlyvee: '\\u22CE',\n\tcurlywedge: '\\u22CF',\n\tcurren: '\\u00A4',\n\tcurvearrowleft: '\\u21B6',\n\tcurvearrowright: '\\u21B7',\n\tcuvee: '\\u22CE',\n\tcuwed: '\\u22CF',\n\tcwconint: '\\u2232',\n\tcwint: '\\u2231',\n\tcylcty: '\\u232D',\n\tDagger: '\\u2021',\n\tdagger: '\\u2020',\n\tdaleth: '\\u2138',\n\tDarr: '\\u21A1',\n\tdArr: '\\u21D3',\n\tdarr: '\\u2193',\n\tdash: '\\u2010',\n\tDashv: '\\u2AE4',\n\tdashv: '\\u22A3',\n\tdbkarow: '\\u290F',\n\tdblac: '\\u02DD',\n\tDcaron: '\\u010E',\n\tdcaron: '\\u010F',\n\tDcy: '\\u0414',\n\tdcy: '\\u0434',\n\tDD: '\\u2145',\n\tdd: '\\u2146',\n\tddagger: '\\u2021',\n\tddarr: '\\u21CA',\n\tDDotrahd: '\\u2911',\n\tddotseq: '\\u2A77',\n\tdeg: '\\u00B0',\n\tDel: '\\u2207',\n\tDelta: '\\u0394',\n\tdelta: '\\u03B4',\n\tdemptyv: '\\u29B1',\n\tdfisht: '\\u297F',\n\tDfr: '\\uD835\\uDD07',\n\tdfr: '\\uD835\\uDD21',\n\tdHar: '\\u2965',\n\tdharl: '\\u21C3',\n\tdharr: '\\u21C2',\n\tDiacriticalAcute: '\\u00B4',\n\tDiacriticalDot: '\\u02D9',\n\tDiacriticalDoubleAcute: '\\u02DD',\n\tDiacriticalGrave: '\\u0060',\n\tDiacriticalTilde: '\\u02DC',\n\tdiam: '\\u22C4',\n\tDiamond: '\\u22C4',\n\tdiamond: '\\u22C4',\n\tdiamondsuit: '\\u2666',\n\tdiams: '\\u2666',\n\tdie: '\\u00A8',\n\tDifferentialD: '\\u2146',\n\tdigamma: '\\u03DD',\n\tdisin: '\\u22F2',\n\tdiv: '\\u00F7',\n\tdivide: '\\u00F7',\n\tdivideontimes: '\\u22C7',\n\tdivonx: '\\u22C7',\n\tDJcy: '\\u0402',\n\tdjcy: '\\u0452',\n\tdlcorn: '\\u231E',\n\tdlcrop: '\\u230D',\n\tdollar: '\\u0024',\n\tDopf: '\\uD835\\uDD3B',\n\tdopf: '\\uD835\\uDD55',\n\tDot: '\\u00A8',\n\tdot: '\\u02D9',\n\tDotDot: '\\u20DC',\n\tdoteq: '\\u2250',\n\tdoteqdot: '\\u2251',\n\tDotEqual: '\\u2250',\n\tdotminus: '\\u2238',\n\tdotplus: '\\u2214',\n\tdotsquare: '\\u22A1',\n\tdoublebarwedge: '\\u2306',\n\tDoubleContourIntegral: '\\u222F',\n\tDoubleDot: '\\u00A8',\n\tDoubleDownArrow: '\\u21D3',\n\tDoubleLeftArrow: '\\u21D0',\n\tDoubleLeftRightArrow: '\\u21D4',\n\tDoubleLeftTee: '\\u2AE4',\n\tDoubleLongLeftArrow: '\\u27F8',\n\tDoubleLongLeftRightArrow: '\\u27FA',\n\tDoubleLongRightArrow: '\\u27F9',\n\tDoubleRightArrow: '\\u21D2',\n\tDoubleRightTee: '\\u22A8',\n\tDoubleUpArrow: '\\u21D1',\n\tDoubleUpDownArrow: '\\u21D5',\n\tDoubleVerticalBar: '\\u2225',\n\tDownArrow: '\\u2193',\n\tDownarrow: '\\u21D3',\n\tdownarrow: '\\u2193',\n\tDownArrowBar: '\\u2913',\n\tDownArrowUpArrow: '\\u21F5',\n\tDownBreve: '\\u0311',\n\tdowndownarrows: '\\u21CA',\n\tdownharpoonleft: '\\u21C3',\n\tdownharpoonright: '\\u21C2',\n\tDownLeftRightVector: '\\u2950',\n\tDownLeftTeeVector: '\\u295E',\n\tDownLeftVector: '\\u21BD',\n\tDownLeftVectorBar: '\\u2956',\n\tDownRightTeeVector: '\\u295F',\n\tDownRightVector: '\\u21C1',\n\tDownRightVectorBar: '\\u2957',\n\tDownTee: '\\u22A4',\n\tDownTeeArrow: '\\u21A7',\n\tdrbkarow: '\\u2910',\n\tdrcorn: '\\u231F',\n\tdrcrop: '\\u230C',\n\tDscr: '\\uD835\\uDC9F',\n\tdscr: '\\uD835\\uDCB9',\n\tDScy: '\\u0405',\n\tdscy: '\\u0455',\n\tdsol: '\\u29F6',\n\tDstrok: '\\u0110',\n\tdstrok: '\\u0111',\n\tdtdot: '\\u22F1',\n\tdtri: '\\u25BF',\n\tdtrif: '\\u25BE',\n\tduarr: '\\u21F5',\n\tduhar: '\\u296F',\n\tdwangle: '\\u29A6',\n\tDZcy: '\\u040F',\n\tdzcy: '\\u045F',\n\tdzigrarr: '\\u27FF',\n\tEacute: '\\u00C9',\n\teacute: '\\u00E9',\n\teaster: '\\u2A6E',\n\tEcaron: '\\u011A',\n\tecaron: '\\u011B',\n\tecir: '\\u2256',\n\tEcirc: '\\u00CA',\n\tecirc: '\\u00EA',\n\tecolon: '\\u2255',\n\tEcy: '\\u042D',\n\tecy: '\\u044D',\n\teDDot: '\\u2A77',\n\tEdot: '\\u0116',\n\teDot: '\\u2251',\n\tedot: '\\u0117',\n\tee: '\\u2147',\n\tefDot: '\\u2252',\n\tEfr: '\\uD835\\uDD08',\n\tefr: '\\uD835\\uDD22',\n\teg: '\\u2A9A',\n\tEgrave: '\\u00C8',\n\tegrave: '\\u00E8',\n\tegs: '\\u2A96',\n\tegsdot: '\\u2A98',\n\tel: '\\u2A99',\n\tElement: '\\u2208',\n\telinters: '\\u23E7',\n\tell: '\\u2113',\n\tels: '\\u2A95',\n\telsdot: '\\u2A97',\n\tEmacr: '\\u0112',\n\temacr: '\\u0113',\n\tempty: '\\u2205',\n\temptyset: '\\u2205',\n\tEmptySmallSquare: '\\u25FB',\n\temptyv: '\\u2205',\n\tEmptyVerySmallSquare: '\\u25AB',\n\temsp: '\\u2003',\n\temsp13: '\\u2004',\n\temsp14: '\\u2005',\n\tENG: '\\u014A',\n\teng: '\\u014B',\n\tensp: '\\u2002',\n\tEogon: '\\u0118',\n\teogon: '\\u0119',\n\tEopf: '\\uD835\\uDD3C',\n\teopf: '\\uD835\\uDD56',\n\tepar: '\\u22D5',\n\teparsl: '\\u29E3',\n\teplus: '\\u2A71',\n\tepsi: '\\u03B5',\n\tEpsilon: '\\u0395',\n\tepsilon: '\\u03B5',\n\tepsiv: '\\u03F5',\n\teqcirc: '\\u2256',\n\teqcolon: '\\u2255',\n\teqsim: '\\u2242',\n\teqslantgtr: '\\u2A96',\n\teqslantless: '\\u2A95',\n\tEqual: '\\u2A75',\n\tequals: '\\u003D',\n\tEqualTilde: '\\u2242',\n\tequest: '\\u225F',\n\tEquilibrium: '\\u21CC',\n\tequiv: '\\u2261',\n\tequivDD: '\\u2A78',\n\teqvparsl: '\\u29E5',\n\terarr: '\\u2971',\n\terDot: '\\u2253',\n\tEscr: '\\u2130',\n\tescr: '\\u212F',\n\tesdot: '\\u2250',\n\tEsim: '\\u2A73',\n\tesim: '\\u2242',\n\tEta: '\\u0397',\n\teta: '\\u03B7',\n\tETH: '\\u00D0',\n\teth: '\\u00F0',\n\tEuml: '\\u00CB',\n\teuml: '\\u00EB',\n\teuro: '\\u20AC',\n\texcl: '\\u0021',\n\texist: '\\u2203',\n\tExists: '\\u2203',\n\texpectation: '\\u2130',\n\tExponentialE: '\\u2147',\n\texponentiale: '\\u2147',\n\tfallingdotseq: '\\u2252',\n\tFcy: '\\u0424',\n\tfcy: '\\u0444',\n\tfemale: '\\u2640',\n\tffilig: '\\uFB03',\n\tfflig: '\\uFB00',\n\tffllig: '\\uFB04',\n\tFfr: '\\uD835\\uDD09',\n\tffr: '\\uD835\\uDD23',\n\tfilig: '\\uFB01',\n\tFilledSmallSquare: '\\u25FC',\n\tFilledVerySmallSquare: '\\u25AA',\n\tfjlig: '\\u0066\\u006A',\n\tflat: '\\u266D',\n\tfllig: '\\uFB02',\n\tfltns: '\\u25B1',\n\tfnof: '\\u0192',\n\tFopf: '\\uD835\\uDD3D',\n\tfopf: '\\uD835\\uDD57',\n\tForAll: '\\u2200',\n\tforall: '\\u2200',\n\tfork: '\\u22D4',\n\tforkv: '\\u2AD9',\n\tFouriertrf: '\\u2131',\n\tfpartint: '\\u2A0D',\n\tfrac12: '\\u00BD',\n\tfrac13: '\\u2153',\n\tfrac14: '\\u00BC',\n\tfrac15: '\\u2155',\n\tfrac16: '\\u2159',\n\tfrac18: '\\u215B',\n\tfrac23: '\\u2154',\n\tfrac25: '\\u2156',\n\tfrac34: '\\u00BE',\n\tfrac35: '\\u2157',\n\tfrac38: '\\u215C',\n\tfrac45: '\\u2158',\n\tfrac56: '\\u215A',\n\tfrac58: '\\u215D',\n\tfrac78: '\\u215E',\n\tfrasl: '\\u2044',\n\tfrown: '\\u2322',\n\tFscr: '\\u2131',\n\tfscr: '\\uD835\\uDCBB',\n\tgacute: '\\u01F5',\n\tGamma: '\\u0393',\n\tgamma: '\\u03B3',\n\tGammad: '\\u03DC',\n\tgammad: '\\u03DD',\n\tgap: '\\u2A86',\n\tGbreve: '\\u011E',\n\tgbreve: '\\u011F',\n\tGcedil: '\\u0122',\n\tGcirc: '\\u011C',\n\tgcirc: '\\u011D',\n\tGcy: '\\u0413',\n\tgcy: '\\u0433',\n\tGdot: '\\u0120',\n\tgdot: '\\u0121',\n\tgE: '\\u2267',\n\tge: '\\u2265',\n\tgEl: '\\u2A8C',\n\tgel: '\\u22DB',\n\tgeq: '\\u2265',\n\tgeqq: '\\u2267',\n\tgeqslant: '\\u2A7E',\n\tges: '\\u2A7E',\n\tgescc: '\\u2AA9',\n\tgesdot: '\\u2A80',\n\tgesdoto: '\\u2A82',\n\tgesdotol: '\\u2A84',\n\tgesl: '\\u22DB\\uFE00',\n\tgesles: '\\u2A94',\n\tGfr: '\\uD835\\uDD0A',\n\tgfr: '\\uD835\\uDD24',\n\tGg: '\\u22D9',\n\tgg: '\\u226B',\n\tggg: '\\u22D9',\n\tgimel: '\\u2137',\n\tGJcy: '\\u0403',\n\tgjcy: '\\u0453',\n\tgl: '\\u2277',\n\tgla: '\\u2AA5',\n\tglE: '\\u2A92',\n\tglj: '\\u2AA4',\n\tgnap: '\\u2A8A',\n\tgnapprox: '\\u2A8A',\n\tgnE: '\\u2269',\n\tgne: '\\u2A88',\n\tgneq: '\\u2A88',\n\tgneqq: '\\u2269',\n\tgnsim: '\\u22E7',\n\tGopf: '\\uD835\\uDD3E',\n\tgopf: '\\uD835\\uDD58',\n\tgrave: '\\u0060',\n\tGreaterEqual: '\\u2265',\n\tGreaterEqualLess: '\\u22DB',\n\tGreaterFullEqual: '\\u2267',\n\tGreaterGreater: '\\u2AA2',\n\tGreaterLess: '\\u2277',\n\tGreaterSlantEqual: '\\u2A7E',\n\tGreaterTilde: '\\u2273',\n\tGscr: '\\uD835\\uDCA2',\n\tgscr: '\\u210A',\n\tgsim: '\\u2273',\n\tgsime: '\\u2A8E',\n\tgsiml: '\\u2A90',\n\tGt: '\\u226B',\n\tGT: '\\u003E',\n\tgt: '\\u003E',\n\tgtcc: '\\u2AA7',\n\tgtcir: '\\u2A7A',\n\tgtdot: '\\u22D7',\n\tgtlPar: '\\u2995',\n\tgtquest: '\\u2A7C',\n\tgtrapprox: '\\u2A86',\n\tgtrarr: '\\u2978',\n\tgtrdot: '\\u22D7',\n\tgtreqless: '\\u22DB',\n\tgtreqqless: '\\u2A8C',\n\tgtrless: '\\u2277',\n\tgtrsim: '\\u2273',\n\tgvertneqq: '\\u2269\\uFE00',\n\tgvnE: '\\u2269\\uFE00',\n\tHacek: '\\u02C7',\n\thairsp: '\\u200A',\n\thalf: '\\u00BD',\n\thamilt: '\\u210B',\n\tHARDcy: '\\u042A',\n\thardcy: '\\u044A',\n\thArr: '\\u21D4',\n\tharr: '\\u2194',\n\tharrcir: '\\u2948',\n\tharrw: '\\u21AD',\n\tHat: '\\u005E',\n\thbar: '\\u210F',\n\tHcirc: '\\u0124',\n\thcirc: '\\u0125',\n\thearts: '\\u2665',\n\theartsuit: '\\u2665',\n\thellip: '\\u2026',\n\thercon: '\\u22B9',\n\tHfr: '\\u210C',\n\thfr: '\\uD835\\uDD25',\n\tHilbertSpace: '\\u210B',\n\thksearow: '\\u2925',\n\thkswarow: '\\u2926',\n\thoarr: '\\u21FF',\n\thomtht: '\\u223B',\n\thookleftarrow: '\\u21A9',\n\thookrightarrow: '\\u21AA',\n\tHopf: '\\u210D',\n\thopf: '\\uD835\\uDD59',\n\thorbar: '\\u2015',\n\tHorizontalLine: '\\u2500',\n\tHscr: '\\u210B',\n\thscr: '\\uD835\\uDCBD',\n\thslash: '\\u210F',\n\tHstrok: '\\u0126',\n\thstrok: '\\u0127',\n\tHumpDownHump: '\\u224E',\n\tHumpEqual: '\\u224F',\n\thybull: '\\u2043',\n\thyphen: '\\u2010',\n\tIacute: '\\u00CD',\n\tiacute: '\\u00ED',\n\tic: '\\u2063',\n\tIcirc: '\\u00CE',\n\ticirc: '\\u00EE',\n\tIcy: '\\u0418',\n\ticy: '\\u0438',\n\tIdot: '\\u0130',\n\tIEcy: '\\u0415',\n\tiecy: '\\u0435',\n\tiexcl: '\\u00A1',\n\tiff: '\\u21D4',\n\tIfr: '\\u2111',\n\tifr: '\\uD835\\uDD26',\n\tIgrave: '\\u00CC',\n\tigrave: '\\u00EC',\n\tii: '\\u2148',\n\tiiiint: '\\u2A0C',\n\tiiint: '\\u222D',\n\tiinfin: '\\u29DC',\n\tiiota: '\\u2129',\n\tIJlig: '\\u0132',\n\tijlig: '\\u0133',\n\tIm: '\\u2111',\n\tImacr: '\\u012A',\n\timacr: '\\u012B',\n\timage: '\\u2111',\n\tImaginaryI: '\\u2148',\n\timagline: '\\u2110',\n\timagpart: '\\u2111',\n\timath: '\\u0131',\n\timof: '\\u22B7',\n\timped: '\\u01B5',\n\tImplies: '\\u21D2',\n\tin: '\\u2208',\n\tincare: '\\u2105',\n\tinfin: '\\u221E',\n\tinfintie: '\\u29DD',\n\tinodot: '\\u0131',\n\tInt: '\\u222C',\n\tint: '\\u222B',\n\tintcal: '\\u22BA',\n\tintegers: '\\u2124',\n\tIntegral: '\\u222B',\n\tintercal: '\\u22BA',\n\tIntersection: '\\u22C2',\n\tintlarhk: '\\u2A17',\n\tintprod: '\\u2A3C',\n\tInvisibleComma: '\\u2063',\n\tInvisibleTimes: '\\u2062',\n\tIOcy: '\\u0401',\n\tiocy: '\\u0451',\n\tIogon: '\\u012E',\n\tiogon: '\\u012F',\n\tIopf: '\\uD835\\uDD40',\n\tiopf: '\\uD835\\uDD5A',\n\tIota: '\\u0399',\n\tiota: '\\u03B9',\n\tiprod: '\\u2A3C',\n\tiquest: '\\u00BF',\n\tIscr: '\\u2110',\n\tiscr: '\\uD835\\uDCBE',\n\tisin: '\\u2208',\n\tisindot: '\\u22F5',\n\tisinE: '\\u22F9',\n\tisins: '\\u22F4',\n\tisinsv: '\\u22F3',\n\tisinv: '\\u2208',\n\tit: '\\u2062',\n\tItilde: '\\u0128',\n\titilde: '\\u0129',\n\tIukcy: '\\u0406',\n\tiukcy: '\\u0456',\n\tIuml: '\\u00CF',\n\tiuml: '\\u00EF',\n\tJcirc: '\\u0134',\n\tjcirc: '\\u0135',\n\tJcy: '\\u0419',\n\tjcy: '\\u0439',\n\tJfr: '\\uD835\\uDD0D',\n\tjfr: '\\uD835\\uDD27',\n\tjmath: '\\u0237',\n\tJopf: '\\uD835\\uDD41',\n\tjopf: '\\uD835\\uDD5B',\n\tJscr: '\\uD835\\uDCA5',\n\tjscr: '\\uD835\\uDCBF',\n\tJsercy: '\\u0408',\n\tjsercy: '\\u0458',\n\tJukcy: '\\u0404',\n\tjukcy: '\\u0454',\n\tKappa: '\\u039A',\n\tkappa: '\\u03BA',\n\tkappav: '\\u03F0',\n\tKcedil: '\\u0136',\n\tkcedil: '\\u0137',\n\tKcy: '\\u041A',\n\tkcy: '\\u043A',\n\tKfr: '\\uD835\\uDD0E',\n\tkfr: '\\uD835\\uDD28',\n\tkgreen: '\\u0138',\n\tKHcy: '\\u0425',\n\tkhcy: '\\u0445',\n\tKJcy: '\\u040C',\n\tkjcy: '\\u045C',\n\tKopf: '\\uD835\\uDD42',\n\tkopf: '\\uD835\\uDD5C',\n\tKscr: '\\uD835\\uDCA6',\n\tkscr: '\\uD835\\uDCC0',\n\tlAarr: '\\u21DA',\n\tLacute: '\\u0139',\n\tlacute: '\\u013A',\n\tlaemptyv: '\\u29B4',\n\tlagran: '\\u2112',\n\tLambda: '\\u039B',\n\tlambda: '\\u03BB',\n\tLang: '\\u27EA',\n\tlang: '\\u27E8',\n\tlangd: '\\u2991',\n\tlangle: '\\u27E8',\n\tlap: '\\u2A85',\n\tLaplacetrf: '\\u2112',\n\tlaquo: '\\u00AB',\n\tLarr: '\\u219E',\n\tlArr: '\\u21D0',\n\tlarr: '\\u2190',\n\tlarrb: '\\u21E4',\n\tlarrbfs: '\\u291F',\n\tlarrfs: '\\u291D',\n\tlarrhk: '\\u21A9',\n\tlarrlp: '\\u21AB',\n\tlarrpl: '\\u2939',\n\tlarrsim: '\\u2973',\n\tlarrtl: '\\u21A2',\n\tlat: '\\u2AAB',\n\tlAtail: '\\u291B',\n\tlatail: '\\u2919',\n\tlate: '\\u2AAD',\n\tlates: '\\u2AAD\\uFE00',\n\tlBarr: '\\u290E',\n\tlbarr: '\\u290C',\n\tlbbrk: '\\u2772',\n\tlbrace: '\\u007B',\n\tlbrack: '\\u005B',\n\tlbrke: '\\u298B',\n\tlbrksld: '\\u298F',\n\tlbrkslu: '\\u298D',\n\tLcaron: '\\u013D',\n\tlcaron: '\\u013E',\n\tLcedil: '\\u013B',\n\tlcedil: '\\u013C',\n\tlceil: '\\u2308',\n\tlcub: '\\u007B',\n\tLcy: '\\u041B',\n\tlcy: '\\u043B',\n\tldca: '\\u2936',\n\tldquo: '\\u201C',\n\tldquor: '\\u201E',\n\tldrdhar: '\\u2967',\n\tldrushar: '\\u294B',\n\tldsh: '\\u21B2',\n\tlE: '\\u2266',\n\tle: '\\u2264',\n\tLeftAngleBracket: '\\u27E8',\n\tLeftArrow: '\\u2190',\n\tLeftarrow: '\\u21D0',\n\tleftarrow: '\\u2190',\n\tLeftArrowBar: '\\u21E4',\n\tLeftArrowRightArrow: '\\u21C6',\n\tleftarrowtail: '\\u21A2',\n\tLeftCeiling: '\\u2308',\n\tLeftDoubleBracket: '\\u27E6',\n\tLeftDownTeeVector: '\\u2961',\n\tLeftDownVector: '\\u21C3',\n\tLeftDownVectorBar: '\\u2959',\n\tLeftFloor: '\\u230A',\n\tleftharpoondown: '\\u21BD',\n\tleftharpoonup: '\\u21BC',\n\tleftleftarrows: '\\u21C7',\n\tLeftRightArrow: '\\u2194',\n\tLeftrightarrow: '\\u21D4',\n\tleftrightarrow: '\\u2194',\n\tleftrightarrows: '\\u21C6',\n\tleftrightharpoons: '\\u21CB',\n\tleftrightsquigarrow: '\\u21AD',\n\tLeftRightVector: '\\u294E',\n\tLeftTee: '\\u22A3',\n\tLeftTeeArrow: '\\u21A4',\n\tLeftTeeVector: '\\u295A',\n\tleftthreetimes: '\\u22CB',\n\tLeftTriangle: '\\u22B2',\n\tLeftTriangleBar: '\\u29CF',\n\tLeftTriangleEqual: '\\u22B4',\n\tLeftUpDownVector: '\\u2951',\n\tLeftUpTeeVector: '\\u2960',\n\tLeftUpVector: '\\u21BF',\n\tLeftUpVectorBar: '\\u2958',\n\tLeftVector: '\\u21BC',\n\tLeftVectorBar: '\\u2952',\n\tlEg: '\\u2A8B',\n\tleg: '\\u22DA',\n\tleq: '\\u2264',\n\tleqq: '\\u2266',\n\tleqslant: '\\u2A7D',\n\tles: '\\u2A7D',\n\tlescc: '\\u2AA8',\n\tlesdot: '\\u2A7F',\n\tlesdoto: '\\u2A81',\n\tlesdotor: '\\u2A83',\n\tlesg: '\\u22DA\\uFE00',\n\tlesges: '\\u2A93',\n\tlessapprox: '\\u2A85',\n\tlessdot: '\\u22D6',\n\tlesseqgtr: '\\u22DA',\n\tlesseqqgtr: '\\u2A8B',\n\tLessEqualGreater: '\\u22DA',\n\tLessFullEqual: '\\u2266',\n\tLessGreater: '\\u2276',\n\tlessgtr: '\\u2276',\n\tLessLess: '\\u2AA1',\n\tlesssim: '\\u2272',\n\tLessSlantEqual: '\\u2A7D',\n\tLessTilde: '\\u2272',\n\tlfisht: '\\u297C',\n\tlfloor: '\\u230A',\n\tLfr: '\\uD835\\uDD0F',\n\tlfr: '\\uD835\\uDD29',\n\tlg: '\\u2276',\n\tlgE: '\\u2A91',\n\tlHar: '\\u2962',\n\tlhard: '\\u21BD',\n\tlharu: '\\u21BC',\n\tlharul: '\\u296A',\n\tlhblk: '\\u2584',\n\tLJcy: '\\u0409',\n\tljcy: '\\u0459',\n\tLl: '\\u22D8',\n\tll: '\\u226A',\n\tllarr: '\\u21C7',\n\tllcorner: '\\u231E',\n\tLleftarrow: '\\u21DA',\n\tllhard: '\\u296B',\n\tlltri: '\\u25FA',\n\tLmidot: '\\u013F',\n\tlmidot: '\\u0140',\n\tlmoust: '\\u23B0',\n\tlmoustache: '\\u23B0',\n\tlnap: '\\u2A89',\n\tlnapprox: '\\u2A89',\n\tlnE: '\\u2268',\n\tlne: '\\u2A87',\n\tlneq: '\\u2A87',\n\tlneqq: '\\u2268',\n\tlnsim: '\\u22E6',\n\tloang: '\\u27EC',\n\tloarr: '\\u21FD',\n\tlobrk: '\\u27E6',\n\tLongLeftArrow: '\\u27F5',\n\tLongleftarrow: '\\u27F8',\n\tlongleftarrow: '\\u27F5',\n\tLongLeftRightArrow: '\\u27F7',\n\tLongleftrightarrow: '\\u27FA',\n\tlongleftrightarrow: '\\u27F7',\n\tlongmapsto: '\\u27FC',\n\tLongRightArrow: '\\u27F6',\n\tLongrightarrow: '\\u27F9',\n\tlongrightarrow: '\\u27F6',\n\tlooparrowleft: '\\u21AB',\n\tlooparrowright: '\\u21AC',\n\tlopar: '\\u2985',\n\tLopf: '\\uD835\\uDD43',\n\tlopf: '\\uD835\\uDD5D',\n\tloplus: '\\u2A2D',\n\tlotimes: '\\u2A34',\n\tlowast: '\\u2217',\n\tlowbar: '\\u005F',\n\tLowerLeftArrow: '\\u2199',\n\tLowerRightArrow: '\\u2198',\n\tloz: '\\u25CA',\n\tlozenge: '\\u25CA',\n\tlozf: '\\u29EB',\n\tlpar: '\\u0028',\n\tlparlt: '\\u2993',\n\tlrarr: '\\u21C6',\n\tlrcorner: '\\u231F',\n\tlrhar: '\\u21CB',\n\tlrhard: '\\u296D',\n\tlrm: '\\u200E',\n\tlrtri: '\\u22BF',\n\tlsaquo: '\\u2039',\n\tLscr: '\\u2112',\n\tlscr: '\\uD835\\uDCC1',\n\tLsh: '\\u21B0',\n\tlsh: '\\u21B0',\n\tlsim: '\\u2272',\n\tlsime: '\\u2A8D',\n\tlsimg: '\\u2A8F',\n\tlsqb: '\\u005B',\n\tlsquo: '\\u2018',\n\tlsquor: '\\u201A',\n\tLstrok: '\\u0141',\n\tlstrok: '\\u0142',\n\tLt: '\\u226A',\n\tLT: '\\u003C',\n\tlt: '\\u003C',\n\tltcc: '\\u2AA6',\n\tltcir: '\\u2A79',\n\tltdot: '\\u22D6',\n\tlthree: '\\u22CB',\n\tltimes: '\\u22C9',\n\tltlarr: '\\u2976',\n\tltquest: '\\u2A7B',\n\tltri: '\\u25C3',\n\tltrie: '\\u22B4',\n\tltrif: '\\u25C2',\n\tltrPar: '\\u2996',\n\tlurdshar: '\\u294A',\n\tluruhar: '\\u2966',\n\tlvertneqq: '\\u2268\\uFE00',\n\tlvnE: '\\u2268\\uFE00',\n\tmacr: '\\u00AF',\n\tmale: '\\u2642',\n\tmalt: '\\u2720',\n\tmaltese: '\\u2720',\n\tMap: '\\u2905',\n\tmap: '\\u21A6',\n\tmapsto: '\\u21A6',\n\tmapstodown: '\\u21A7',\n\tmapstoleft: '\\u21A4',\n\tmapstoup: '\\u21A5',\n\tmarker: '\\u25AE',\n\tmcomma: '\\u2A29',\n\tMcy: '\\u041C',\n\tmcy: '\\u043C',\n\tmdash: '\\u2014',\n\tmDDot: '\\u223A',\n\tmeasuredangle: '\\u2221',\n\tMediumSpace: '\\u205F',\n\tMellintrf: '\\u2133',\n\tMfr: '\\uD835\\uDD10',\n\tmfr: '\\uD835\\uDD2A',\n\tmho: '\\u2127',\n\tmicro: '\\u00B5',\n\tmid: '\\u2223',\n\tmidast: '\\u002A',\n\tmidcir: '\\u2AF0',\n\tmiddot: '\\u00B7',\n\tminus: '\\u2212',\n\tminusb: '\\u229F',\n\tminusd: '\\u2238',\n\tminusdu: '\\u2A2A',\n\tMinusPlus: '\\u2213',\n\tmlcp: '\\u2ADB',\n\tmldr: '\\u2026',\n\tmnplus: '\\u2213',\n\tmodels: '\\u22A7',\n\tMopf: '\\uD835\\uDD44',\n\tmopf: '\\uD835\\uDD5E',\n\tmp: '\\u2213',\n\tMscr: '\\u2133',\n\tmscr: '\\uD835\\uDCC2',\n\tmstpos: '\\u223E',\n\tMu: '\\u039C',\n\tmu: '\\u03BC',\n\tmultimap: '\\u22B8',\n\tmumap: '\\u22B8',\n\tnabla: '\\u2207',\n\tNacute: '\\u0143',\n\tnacute: '\\u0144',\n\tnang: '\\u2220\\u20D2',\n\tnap: '\\u2249',\n\tnapE: '\\u2A70\\u0338',\n\tnapid: '\\u224B\\u0338',\n\tnapos: '\\u0149',\n\tnapprox: '\\u2249',\n\tnatur: '\\u266E',\n\tnatural: '\\u266E',\n\tnaturals: '\\u2115',\n\tnbsp: '\\u00A0',\n\tnbump: '\\u224E\\u0338',\n\tnbumpe: '\\u224F\\u0338',\n\tncap: '\\u2A43',\n\tNcaron: '\\u0147',\n\tncaron: '\\u0148',\n\tNcedil: '\\u0145',\n\tncedil: '\\u0146',\n\tncong: '\\u2247',\n\tncongdot: '\\u2A6D\\u0338',\n\tncup: '\\u2A42',\n\tNcy: '\\u041D',\n\tncy: '\\u043D',\n\tndash: '\\u2013',\n\tne: '\\u2260',\n\tnearhk: '\\u2924',\n\tneArr: '\\u21D7',\n\tnearr: '\\u2197',\n\tnearrow: '\\u2197',\n\tnedot: '\\u2250\\u0338',\n\tNegativeMediumSpace: '\\u200B',\n\tNegativeThickSpace: '\\u200B',\n\tNegativeThinSpace: '\\u200B',\n\tNegativeVeryThinSpace: '\\u200B',\n\tnequiv: '\\u2262',\n\tnesear: '\\u2928',\n\tnesim: '\\u2242\\u0338',\n\tNestedGreaterGreater: '\\u226B',\n\tNestedLessLess: '\\u226A',\n\tNewLine: '\\u000A',\n\tnexist: '\\u2204',\n\tnexists: '\\u2204',\n\tNfr: '\\uD835\\uDD11',\n\tnfr: '\\uD835\\uDD2B',\n\tngE: '\\u2267\\u0338',\n\tnge: '\\u2271',\n\tngeq: '\\u2271',\n\tngeqq: '\\u2267\\u0338',\n\tngeqslant: '\\u2A7E\\u0338',\n\tnges: '\\u2A7E\\u0338',\n\tnGg: '\\u22D9\\u0338',\n\tngsim: '\\u2275',\n\tnGt: '\\u226B\\u20D2',\n\tngt: '\\u226F',\n\tngtr: '\\u226F',\n\tnGtv: '\\u226B\\u0338',\n\tnhArr: '\\u21CE',\n\tnharr: '\\u21AE',\n\tnhpar: '\\u2AF2',\n\tni: '\\u220B',\n\tnis: '\\u22FC',\n\tnisd: '\\u22FA',\n\tniv: '\\u220B',\n\tNJcy: '\\u040A',\n\tnjcy: '\\u045A',\n\tnlArr: '\\u21CD',\n\tnlarr: '\\u219A',\n\tnldr: '\\u2025',\n\tnlE: '\\u2266\\u0338',\n\tnle: '\\u2270',\n\tnLeftarrow: '\\u21CD',\n\tnleftarrow: '\\u219A',\n\tnLeftrightarrow: '\\u21CE',\n\tnleftrightarrow: '\\u21AE',\n\tnleq: '\\u2270',\n\tnleqq: '\\u2266\\u0338',\n\tnleqslant: '\\u2A7D\\u0338',\n\tnles: '\\u2A7D\\u0338',\n\tnless: '\\u226E',\n\tnLl: '\\u22D8\\u0338',\n\tnlsim: '\\u2274',\n\tnLt: '\\u226A\\u20D2',\n\tnlt: '\\u226E',\n\tnltri: '\\u22EA',\n\tnltrie: '\\u22EC',\n\tnLtv: '\\u226A\\u0338',\n\tnmid: '\\u2224',\n\tNoBreak: '\\u2060',\n\tNonBreakingSpace: '\\u00A0',\n\tNopf: '\\u2115',\n\tnopf: '\\uD835\\uDD5F',\n\tNot: '\\u2AEC',\n\tnot: '\\u00AC',\n\tNotCongruent: '\\u2262',\n\tNotCupCap: '\\u226D',\n\tNotDoubleVerticalBar: '\\u2226',\n\tNotElement: '\\u2209',\n\tNotEqual: '\\u2260',\n\tNotEqualTilde: '\\u2242\\u0338',\n\tNotExists: '\\u2204',\n\tNotGreater: '\\u226F',\n\tNotGreaterEqual: '\\u2271',\n\tNotGreaterFullEqual: '\\u2267\\u0338',\n\tNotGreaterGreater: '\\u226B\\u0338',\n\tNotGreaterLess: '\\u2279',\n\tNotGreaterSlantEqual: '\\u2A7E\\u0338',\n\tNotGreaterTilde: '\\u2275',\n\tNotHumpDownHump: '\\u224E\\u0338',\n\tNotHumpEqual: '\\u224F\\u0338',\n\tnotin: '\\u2209',\n\tnotindot: '\\u22F5\\u0338',\n\tnotinE: '\\u22F9\\u0338',\n\tnotinva: '\\u2209',\n\tnotinvb: '\\u22F7',\n\tnotinvc: '\\u22F6',\n\tNotLeftTriangle: '\\u22EA',\n\tNotLeftTriangleBar: '\\u29CF\\u0338',\n\tNotLeftTriangleEqual: '\\u22EC',\n\tNotLess: '\\u226E',\n\tNotLessEqual: '\\u2270',\n\tNotLessGreater: '\\u2278',\n\tNotLessLess: '\\u226A\\u0338',\n\tNotLessSlantEqual: '\\u2A7D\\u0338',\n\tNotLessTilde: '\\u2274',\n\tNotNestedGreaterGreater: '\\u2AA2\\u0338',\n\tNotNestedLessLess: '\\u2AA1\\u0338',\n\tnotni: '\\u220C',\n\tnotniva: '\\u220C',\n\tnotnivb: '\\u22FE',\n\tnotnivc: '\\u22FD',\n\tNotPrecedes: '\\u2280',\n\tNotPrecedesEqual: '\\u2AAF\\u0338',\n\tNotPrecedesSlantEqual: '\\u22E0',\n\tNotReverseElement: '\\u220C',\n\tNotRightTriangle: '\\u22EB',\n\tNotRightTriangleBar: '\\u29D0\\u0338',\n\tNotRightTriangleEqual: '\\u22ED',\n\tNotSquareSubset: '\\u228F\\u0338',\n\tNotSquareSubsetEqual: '\\u22E2',\n\tNotSquareSuperset: '\\u2290\\u0338',\n\tNotSquareSupersetEqual: '\\u22E3',\n\tNotSubset: '\\u2282\\u20D2',\n\tNotSubsetEqual: '\\u2288',\n\tNotSucceeds: '\\u2281',\n\tNotSucceedsEqual: '\\u2AB0\\u0338',\n\tNotSucceedsSlantEqual: '\\u22E1',\n\tNotSucceedsTilde: '\\u227F\\u0338',\n\tNotSuperset: '\\u2283\\u20D2',\n\tNotSupersetEqual: '\\u2289',\n\tNotTilde: '\\u2241',\n\tNotTildeEqual: '\\u2244',\n\tNotTildeFullEqual: '\\u2247',\n\tNotTildeTilde: '\\u2249',\n\tNotVerticalBar: '\\u2224',\n\tnpar: '\\u2226',\n\tnparallel: '\\u2226',\n\tnparsl: '\\u2AFD\\u20E5',\n\tnpart: '\\u2202\\u0338',\n\tnpolint: '\\u2A14',\n\tnpr: '\\u2280',\n\tnprcue: '\\u22E0',\n\tnpre: '\\u2AAF\\u0338',\n\tnprec: '\\u2280',\n\tnpreceq: '\\u2AAF\\u0338',\n\tnrArr: '\\u21CF',\n\tnrarr: '\\u219B',\n\tnrarrc: '\\u2933\\u0338',\n\tnrarrw: '\\u219D\\u0338',\n\tnRightarrow: '\\u21CF',\n\tnrightarrow: '\\u219B',\n\tnrtri: '\\u22EB',\n\tnrtrie: '\\u22ED',\n\tnsc: '\\u2281',\n\tnsccue: '\\u22E1',\n\tnsce: '\\u2AB0\\u0338',\n\tNscr: '\\uD835\\uDCA9',\n\tnscr: '\\uD835\\uDCC3',\n\tnshortmid: '\\u2224',\n\tnshortparallel: '\\u2226',\n\tnsim: '\\u2241',\n\tnsime: '\\u2244',\n\tnsimeq: '\\u2244',\n\tnsmid: '\\u2224',\n\tnspar: '\\u2226',\n\tnsqsube: '\\u22E2',\n\tnsqsupe: '\\u22E3',\n\tnsub: '\\u2284',\n\tnsubE: '\\u2AC5\\u0338',\n\tnsube: '\\u2288',\n\tnsubset: '\\u2282\\u20D2',\n\tnsubseteq: '\\u2288',\n\tnsubseteqq: '\\u2AC5\\u0338',\n\tnsucc: '\\u2281',\n\tnsucceq: '\\u2AB0\\u0338',\n\tnsup: '\\u2285',\n\tnsupE: '\\u2AC6\\u0338',\n\tnsupe: '\\u2289',\n\tnsupset: '\\u2283\\u20D2',\n\tnsupseteq: '\\u2289',\n\tnsupseteqq: '\\u2AC6\\u0338',\n\tntgl: '\\u2279',\n\tNtilde: '\\u00D1',\n\tntilde: '\\u00F1',\n\tntlg: '\\u2278',\n\tntriangleleft: '\\u22EA',\n\tntrianglelefteq: '\\u22EC',\n\tntriangleright: '\\u22EB',\n\tntrianglerighteq: '\\u22ED',\n\tNu: '\\u039D',\n\tnu: '\\u03BD',\n\tnum: '\\u0023',\n\tnumero: '\\u2116',\n\tnumsp: '\\u2007',\n\tnvap: '\\u224D\\u20D2',\n\tnVDash: '\\u22AF',\n\tnVdash: '\\u22AE',\n\tnvDash: '\\u22AD',\n\tnvdash: '\\u22AC',\n\tnvge: '\\u2265\\u20D2',\n\tnvgt: '\\u003E\\u20D2',\n\tnvHarr: '\\u2904',\n\tnvinfin: '\\u29DE',\n\tnvlArr: '\\u2902',\n\tnvle: '\\u2264\\u20D2',\n\tnvlt: '\\u003C\\u20D2',\n\tnvltrie: '\\u22B4\\u20D2',\n\tnvrArr: '\\u2903',\n\tnvrtrie: '\\u22B5\\u20D2',\n\tnvsim: '\\u223C\\u20D2',\n\tnwarhk: '\\u2923',\n\tnwArr: '\\u21D6',\n\tnwarr: '\\u2196',\n\tnwarrow: '\\u2196',\n\tnwnear: '\\u2927',\n\tOacute: '\\u00D3',\n\toacute: '\\u00F3',\n\toast: '\\u229B',\n\tocir: '\\u229A',\n\tOcirc: '\\u00D4',\n\tocirc: '\\u00F4',\n\tOcy: '\\u041E',\n\tocy: '\\u043E',\n\todash: '\\u229D',\n\tOdblac: '\\u0150',\n\todblac: '\\u0151',\n\todiv: '\\u2A38',\n\todot: '\\u2299',\n\todsold: '\\u29BC',\n\tOElig: '\\u0152',\n\toelig: '\\u0153',\n\tofcir: '\\u29BF',\n\tOfr: '\\uD835\\uDD12',\n\tofr: '\\uD835\\uDD2C',\n\togon: '\\u02DB',\n\tOgrave: '\\u00D2',\n\tograve: '\\u00F2',\n\togt: '\\u29C1',\n\tohbar: '\\u29B5',\n\tohm: '\\u03A9',\n\toint: '\\u222E',\n\tolarr: '\\u21BA',\n\tolcir: '\\u29BE',\n\tolcross: '\\u29BB',\n\toline: '\\u203E',\n\tolt: '\\u29C0',\n\tOmacr: '\\u014C',\n\tomacr: '\\u014D',\n\tOmega: '\\u03A9',\n\tomega: '\\u03C9',\n\tOmicron: '\\u039F',\n\tomicron: '\\u03BF',\n\tomid: '\\u29B6',\n\tominus: '\\u2296',\n\tOopf: '\\uD835\\uDD46',\n\toopf: '\\uD835\\uDD60',\n\topar: '\\u29B7',\n\tOpenCurlyDoubleQuote: '\\u201C',\n\tOpenCurlyQuote: '\\u2018',\n\toperp: '\\u29B9',\n\toplus: '\\u2295',\n\tOr: '\\u2A54',\n\tor: '\\u2228',\n\torarr: '\\u21BB',\n\tord: '\\u2A5D',\n\torder: '\\u2134',\n\torderof: '\\u2134',\n\tordf: '\\u00AA',\n\tordm: '\\u00BA',\n\torigof: '\\u22B6',\n\toror: '\\u2A56',\n\torslope: '\\u2A57',\n\torv: '\\u2A5B',\n\toS: '\\u24C8',\n\tOscr: '\\uD835\\uDCAA',\n\toscr: '\\u2134',\n\tOslash: '\\u00D8',\n\toslash: '\\u00F8',\n\tosol: '\\u2298',\n\tOtilde: '\\u00D5',\n\totilde: '\\u00F5',\n\tOtimes: '\\u2A37',\n\totimes: '\\u2297',\n\totimesas: '\\u2A36',\n\tOuml: '\\u00D6',\n\touml: '\\u00F6',\n\tovbar: '\\u233D',\n\tOverBar: '\\u203E',\n\tOverBrace: '\\u23DE',\n\tOverBracket: '\\u23B4',\n\tOverParenthesis: '\\u23DC',\n\tpar: '\\u2225',\n\tpara: '\\u00B6',\n\tparallel: '\\u2225',\n\tparsim: '\\u2AF3',\n\tparsl: '\\u2AFD',\n\tpart: '\\u2202',\n\tPartialD: '\\u2202',\n\tPcy: '\\u041F',\n\tpcy: '\\u043F',\n\tpercnt: '\\u0025',\n\tperiod: '\\u002E',\n\tpermil: '\\u2030',\n\tperp: '\\u22A5',\n\tpertenk: '\\u2031',\n\tPfr: '\\uD835\\uDD13',\n\tpfr: '\\uD835\\uDD2D',\n\tPhi: '\\u03A6',\n\tphi: '\\u03C6',\n\tphiv: '\\u03D5',\n\tphmmat: '\\u2133',\n\tphone: '\\u260E',\n\tPi: '\\u03A0',\n\tpi: '\\u03C0',\n\tpitchfork: '\\u22D4',\n\tpiv: '\\u03D6',\n\tplanck: '\\u210F',\n\tplanckh: '\\u210E',\n\tplankv: '\\u210F',\n\tplus: '\\u002B',\n\tplusacir: '\\u2A23',\n\tplusb: '\\u229E',\n\tpluscir: '\\u2A22',\n\tplusdo: '\\u2214',\n\tplusdu: '\\u2A25',\n\tpluse: '\\u2A72',\n\tPlusMinus: '\\u00B1',\n\tplusmn: '\\u00B1',\n\tplussim: '\\u2A26',\n\tplustwo: '\\u2A27',\n\tpm: '\\u00B1',\n\tPoincareplane: '\\u210C',\n\tpointint: '\\u2A15',\n\tPopf: '\\u2119',\n\tpopf: '\\uD835\\uDD61',\n\tpound: '\\u00A3',\n\tPr: '\\u2ABB',\n\tpr: '\\u227A',\n\tprap: '\\u2AB7',\n\tprcue: '\\u227C',\n\tprE: '\\u2AB3',\n\tpre: '\\u2AAF',\n\tprec: '\\u227A',\n\tprecapprox: '\\u2AB7',\n\tpreccurlyeq: '\\u227C',\n\tPrecedes: '\\u227A',\n\tPrecedesEqual: '\\u2AAF',\n\tPrecedesSlantEqual: '\\u227C',\n\tPrecedesTilde: '\\u227E',\n\tpreceq: '\\u2AAF',\n\tprecnapprox: '\\u2AB9',\n\tprecneqq: '\\u2AB5',\n\tprecnsim: '\\u22E8',\n\tprecsim: '\\u227E',\n\tPrime: '\\u2033',\n\tprime: '\\u2032',\n\tprimes: '\\u2119',\n\tprnap: '\\u2AB9',\n\tprnE: '\\u2AB5',\n\tprnsim: '\\u22E8',\n\tprod: '\\u220F',\n\tProduct: '\\u220F',\n\tprofalar: '\\u232E',\n\tprofline: '\\u2312',\n\tprofsurf: '\\u2313',\n\tprop: '\\u221D',\n\tProportion: '\\u2237',\n\tProportional: '\\u221D',\n\tpropto: '\\u221D',\n\tprsim: '\\u227E',\n\tprurel: '\\u22B0',\n\tPscr: '\\uD835\\uDCAB',\n\tpscr: '\\uD835\\uDCC5',\n\tPsi: '\\u03A8',\n\tpsi: '\\u03C8',\n\tpuncsp: '\\u2008',\n\tQfr: '\\uD835\\uDD14',\n\tqfr: '\\uD835\\uDD2E',\n\tqint: '\\u2A0C',\n\tQopf: '\\u211A',\n\tqopf: '\\uD835\\uDD62',\n\tqprime: '\\u2057',\n\tQscr: '\\uD835\\uDCAC',\n\tqscr: '\\uD835\\uDCC6',\n\tquaternions: '\\u210D',\n\tquatint: '\\u2A16',\n\tquest: '\\u003F',\n\tquesteq: '\\u225F',\n\tQUOT: '\\u0022',\n\tquot: '\\u0022',\n\trAarr: '\\u21DB',\n\trace: '\\u223D\\u0331',\n\tRacute: '\\u0154',\n\tracute: '\\u0155',\n\tradic: '\\u221A',\n\traemptyv: '\\u29B3',\n\tRang: '\\u27EB',\n\trang: '\\u27E9',\n\trangd: '\\u2992',\n\trange: '\\u29A5',\n\trangle: '\\u27E9',\n\traquo: '\\u00BB',\n\tRarr: '\\u21A0',\n\trArr: '\\u21D2',\n\trarr: '\\u2192',\n\trarrap: '\\u2975',\n\trarrb: '\\u21E5',\n\trarrbfs: '\\u2920',\n\trarrc: '\\u2933',\n\trarrfs: '\\u291E',\n\trarrhk: '\\u21AA',\n\trarrlp: '\\u21AC',\n\trarrpl: '\\u2945',\n\trarrsim: '\\u2974',\n\tRarrtl: '\\u2916',\n\trarrtl: '\\u21A3',\n\trarrw: '\\u219D',\n\trAtail: '\\u291C',\n\tratail: '\\u291A',\n\tratio: '\\u2236',\n\trationals: '\\u211A',\n\tRBarr: '\\u2910',\n\trBarr: '\\u290F',\n\trbarr: '\\u290D',\n\trbbrk: '\\u2773',\n\trbrace: '\\u007D',\n\trbrack: '\\u005D',\n\trbrke: '\\u298C',\n\trbrksld: '\\u298E',\n\trbrkslu: '\\u2990',\n\tRcaron: '\\u0158',\n\trcaron: '\\u0159',\n\tRcedil: '\\u0156',\n\trcedil: '\\u0157',\n\trceil: '\\u2309',\n\trcub: '\\u007D',\n\tRcy: '\\u0420',\n\trcy: '\\u0440',\n\trdca: '\\u2937',\n\trdldhar: '\\u2969',\n\trdquo: '\\u201D',\n\trdquor: '\\u201D',\n\trdsh: '\\u21B3',\n\tRe: '\\u211C',\n\treal: '\\u211C',\n\trealine: '\\u211B',\n\trealpart: '\\u211C',\n\treals: '\\u211D',\n\trect: '\\u25AD',\n\tREG: '\\u00AE',\n\treg: '\\u00AE',\n\tReverseElement: '\\u220B',\n\tReverseEquilibrium: '\\u21CB',\n\tReverseUpEquilibrium: '\\u296F',\n\trfisht: '\\u297D',\n\trfloor: '\\u230B',\n\tRfr: '\\u211C',\n\trfr: '\\uD835\\uDD2F',\n\trHar: '\\u2964',\n\trhard: '\\u21C1',\n\trharu: '\\u21C0',\n\trharul: '\\u296C',\n\tRho: '\\u03A1',\n\trho: '\\u03C1',\n\trhov: '\\u03F1',\n\tRightAngleBracket: '\\u27E9',\n\tRightArrow: '\\u2192',\n\tRightarrow: '\\u21D2',\n\trightarrow: '\\u2192',\n\tRightArrowBar: '\\u21E5',\n\tRightArrowLeftArrow: '\\u21C4',\n\trightarrowtail: '\\u21A3',\n\tRightCeiling: '\\u2309',\n\tRightDoubleBracket: '\\u27E7',\n\tRightDownTeeVector: '\\u295D',\n\tRightDownVector: '\\u21C2',\n\tRightDownVectorBar: '\\u2955',\n\tRightFloor: '\\u230B',\n\trightharpoondown: '\\u21C1',\n\trightharpoonup: '\\u21C0',\n\trightleftarrows: '\\u21C4',\n\trightleftharpoons: '\\u21CC',\n\trightrightarrows: '\\u21C9',\n\trightsquigarrow: '\\u219D',\n\tRightTee: '\\u22A2',\n\tRightTeeArrow: '\\u21A6',\n\tRightTeeVector: '\\u295B',\n\trightthreetimes: '\\u22CC',\n\tRightTriangle: '\\u22B3',\n\tRightTriangleBar: '\\u29D0',\n\tRightTriangleEqual: '\\u22B5',\n\tRightUpDownVector: '\\u294F',\n\tRightUpTeeVector: '\\u295C',\n\tRightUpVector: '\\u21BE',\n\tRightUpVectorBar: '\\u2954',\n\tRightVector: '\\u21C0',\n\tRightVectorBar: '\\u2953',\n\tring: '\\u02DA',\n\trisingdotseq: '\\u2253',\n\trlarr: '\\u21C4',\n\trlhar: '\\u21CC',\n\trlm: '\\u200F',\n\trmoust: '\\u23B1',\n\trmoustache: '\\u23B1',\n\trnmid: '\\u2AEE',\n\troang: '\\u27ED',\n\troarr: '\\u21FE',\n\trobrk: '\\u27E7',\n\tropar: '\\u2986',\n\tRopf: '\\u211D',\n\tropf: '\\uD835\\uDD63',\n\troplus: '\\u2A2E',\n\trotimes: '\\u2A35',\n\tRoundImplies: '\\u2970',\n\trpar: '\\u0029',\n\trpargt: '\\u2994',\n\trppolint: '\\u2A12',\n\trrarr: '\\u21C9',\n\tRrightarrow: '\\u21DB',\n\trsaquo: '\\u203A',\n\tRscr: '\\u211B',\n\trscr: '\\uD835\\uDCC7',\n\tRsh: '\\u21B1',\n\trsh: '\\u21B1',\n\trsqb: '\\u005D',\n\trsquo: '\\u2019',\n\trsquor: '\\u2019',\n\trthree: '\\u22CC',\n\trtimes: '\\u22CA',\n\trtri: '\\u25B9',\n\trtrie: '\\u22B5',\n\trtrif: '\\u25B8',\n\trtriltri: '\\u29CE',\n\tRuleDelayed: '\\u29F4',\n\truluhar: '\\u2968',\n\trx: '\\u211E',\n\tSacute: '\\u015A',\n\tsacute: '\\u015B',\n\tsbquo: '\\u201A',\n\tSc: '\\u2ABC',\n\tsc: '\\u227B',\n\tscap: '\\u2AB8',\n\tScaron: '\\u0160',\n\tscaron: '\\u0161',\n\tsccue: '\\u227D',\n\tscE: '\\u2AB4',\n\tsce: '\\u2AB0',\n\tScedil: '\\u015E',\n\tscedil: '\\u015F',\n\tScirc: '\\u015C',\n\tscirc: '\\u015D',\n\tscnap: '\\u2ABA',\n\tscnE: '\\u2AB6',\n\tscnsim: '\\u22E9',\n\tscpolint: '\\u2A13',\n\tscsim: '\\u227F',\n\tScy: '\\u0421',\n\tscy: '\\u0441',\n\tsdot: '\\u22C5',\n\tsdotb: '\\u22A1',\n\tsdote: '\\u2A66',\n\tsearhk: '\\u2925',\n\tseArr: '\\u21D8',\n\tsearr: '\\u2198',\n\tsearrow: '\\u2198',\n\tsect: '\\u00A7',\n\tsemi: '\\u003B',\n\tseswar: '\\u2929',\n\tsetminus: '\\u2216',\n\tsetmn: '\\u2216',\n\tsext: '\\u2736',\n\tSfr: '\\uD835\\uDD16',\n\tsfr: '\\uD835\\uDD30',\n\tsfrown: '\\u2322',\n\tsharp: '\\u266F',\n\tSHCHcy: '\\u0429',\n\tshchcy: '\\u0449',\n\tSHcy: '\\u0428',\n\tshcy: '\\u0448',\n\tShortDownArrow: '\\u2193',\n\tShortLeftArrow: '\\u2190',\n\tshortmid: '\\u2223',\n\tshortparallel: '\\u2225',\n\tShortRightArrow: '\\u2192',\n\tShortUpArrow: '\\u2191',\n\tshy: '\\u00AD',\n\tSigma: '\\u03A3',\n\tsigma: '\\u03C3',\n\tsigmaf: '\\u03C2',\n\tsigmav: '\\u03C2',\n\tsim: '\\u223C',\n\tsimdot: '\\u2A6A',\n\tsime: '\\u2243',\n\tsimeq: '\\u2243',\n\tsimg: '\\u2A9E',\n\tsimgE: '\\u2AA0',\n\tsiml: '\\u2A9D',\n\tsimlE: '\\u2A9F',\n\tsimne: '\\u2246',\n\tsimplus: '\\u2A24',\n\tsimrarr: '\\u2972',\n\tslarr: '\\u2190',\n\tSmallCircle: '\\u2218',\n\tsmallsetminus: '\\u2216',\n\tsmashp: '\\u2A33',\n\tsmeparsl: '\\u29E4',\n\tsmid: '\\u2223',\n\tsmile: '\\u2323',\n\tsmt: '\\u2AAA',\n\tsmte: '\\u2AAC',\n\tsmtes: '\\u2AAC\\uFE00',\n\tSOFTcy: '\\u042C',\n\tsoftcy: '\\u044C',\n\tsol: '\\u002F',\n\tsolb: '\\u29C4',\n\tsolbar: '\\u233F',\n\tSopf: '\\uD835\\uDD4A',\n\tsopf: '\\uD835\\uDD64',\n\tspades: '\\u2660',\n\tspadesuit: '\\u2660',\n\tspar: '\\u2225',\n\tsqcap: '\\u2293',\n\tsqcaps: '\\u2293\\uFE00',\n\tsqcup: '\\u2294',\n\tsqcups: '\\u2294\\uFE00',\n\tSqrt: '\\u221A',\n\tsqsub: '\\u228F',\n\tsqsube: '\\u2291',\n\tsqsubset: '\\u228F',\n\tsqsubseteq: '\\u2291',\n\tsqsup: '\\u2290',\n\tsqsupe: '\\u2292',\n\tsqsupset: '\\u2290',\n\tsqsupseteq: '\\u2292',\n\tsqu: '\\u25A1',\n\tSquare: '\\u25A1',\n\tsquare: '\\u25A1',\n\tSquareIntersection: '\\u2293',\n\tSquareSubset: '\\u228F',\n\tSquareSubsetEqual: '\\u2291',\n\tSquareSuperset: '\\u2290',\n\tSquareSupersetEqual: '\\u2292',\n\tSquareUnion: '\\u2294',\n\tsquarf: '\\u25AA',\n\tsquf: '\\u25AA',\n\tsrarr: '\\u2192',\n\tSscr: '\\uD835\\uDCAE',\n\tsscr: '\\uD835\\uDCC8',\n\tssetmn: '\\u2216',\n\tssmile: '\\u2323',\n\tsstarf: '\\u22C6',\n\tStar: '\\u22C6',\n\tstar: '\\u2606',\n\tstarf: '\\u2605',\n\tstraightepsilon: '\\u03F5',\n\tstraightphi: '\\u03D5',\n\tstrns: '\\u00AF',\n\tSub: '\\u22D0',\n\tsub: '\\u2282',\n\tsubdot: '\\u2ABD',\n\tsubE: '\\u2AC5',\n\tsube: '\\u2286',\n\tsubedot: '\\u2AC3',\n\tsubmult: '\\u2AC1',\n\tsubnE: '\\u2ACB',\n\tsubne: '\\u228A',\n\tsubplus: '\\u2ABF',\n\tsubrarr: '\\u2979',\n\tSubset: '\\u22D0',\n\tsubset: '\\u2282',\n\tsubseteq: '\\u2286',\n\tsubseteqq: '\\u2AC5',\n\tSubsetEqual: '\\u2286',\n\tsubsetneq: '\\u228A',\n\tsubsetneqq: '\\u2ACB',\n\tsubsim: '\\u2AC7',\n\tsubsub: '\\u2AD5',\n\tsubsup: '\\u2AD3',\n\tsucc: '\\u227B',\n\tsuccapprox: '\\u2AB8',\n\tsucccurlyeq: '\\u227D',\n\tSucceeds: '\\u227B',\n\tSucceedsEqual: '\\u2AB0',\n\tSucceedsSlantEqual: '\\u227D',\n\tSucceedsTilde: '\\u227F',\n\tsucceq: '\\u2AB0',\n\tsuccnapprox: '\\u2ABA',\n\tsuccneqq: '\\u2AB6',\n\tsuccnsim: '\\u22E9',\n\tsuccsim: '\\u227F',\n\tSuchThat: '\\u220B',\n\tSum: '\\u2211',\n\tsum: '\\u2211',\n\tsung: '\\u266A',\n\tSup: '\\u22D1',\n\tsup: '\\u2283',\n\tsup1: '\\u00B9',\n\tsup2: '\\u00B2',\n\tsup3: '\\u00B3',\n\tsupdot: '\\u2ABE',\n\tsupdsub: '\\u2AD8',\n\tsupE: '\\u2AC6',\n\tsupe: '\\u2287',\n\tsupedot: '\\u2AC4',\n\tSuperset: '\\u2283',\n\tSupersetEqual: '\\u2287',\n\tsuphsol: '\\u27C9',\n\tsuphsub: '\\u2AD7',\n\tsuplarr: '\\u297B',\n\tsupmult: '\\u2AC2',\n\tsupnE: '\\u2ACC',\n\tsupne: '\\u228B',\n\tsupplus: '\\u2AC0',\n\tSupset: '\\u22D1',\n\tsupset: '\\u2283',\n\tsupseteq: '\\u2287',\n\tsupseteqq: '\\u2AC6',\n\tsupsetneq: '\\u228B',\n\tsupsetneqq: '\\u2ACC',\n\tsupsim: '\\u2AC8',\n\tsupsub: '\\u2AD4',\n\tsupsup: '\\u2AD6',\n\tswarhk: '\\u2926',\n\tswArr: '\\u21D9',\n\tswarr: '\\u2199',\n\tswarrow: '\\u2199',\n\tswnwar: '\\u292A',\n\tszlig: '\\u00DF',\n\tTab: '\\u0009',\n\ttarget: '\\u2316',\n\tTau: '\\u03A4',\n\ttau: '\\u03C4',\n\ttbrk: '\\u23B4',\n\tTcaron: '\\u0164',\n\ttcaron: '\\u0165',\n\tTcedil: '\\u0162',\n\ttcedil: '\\u0163',\n\tTcy: '\\u0422',\n\ttcy: '\\u0442',\n\ttdot: '\\u20DB',\n\ttelrec: '\\u2315',\n\tTfr: '\\uD835\\uDD17',\n\ttfr: '\\uD835\\uDD31',\n\tthere4: '\\u2234',\n\tTherefore: '\\u2234',\n\ttherefore: '\\u2234',\n\tTheta: '\\u0398',\n\ttheta: '\\u03B8',\n\tthetasym: '\\u03D1',\n\tthetav: '\\u03D1',\n\tthickapprox: '\\u2248',\n\tthicksim: '\\u223C',\n\tThickSpace: '\\u205F\\u200A',\n\tthinsp: '\\u2009',\n\tThinSpace: '\\u2009',\n\tthkap: '\\u2248',\n\tthksim: '\\u223C',\n\tTHORN: '\\u00DE',\n\tthorn: '\\u00FE',\n\tTilde: '\\u223C',\n\ttilde: '\\u02DC',\n\tTildeEqual: '\\u2243',\n\tTildeFullEqual: '\\u2245',\n\tTildeTilde: '\\u2248',\n\ttimes: '\\u00D7',\n\ttimesb: '\\u22A0',\n\ttimesbar: '\\u2A31',\n\ttimesd: '\\u2A30',\n\ttint: '\\u222D',\n\ttoea: '\\u2928',\n\ttop: '\\u22A4',\n\ttopbot: '\\u2336',\n\ttopcir: '\\u2AF1',\n\tTopf: '\\uD835\\uDD4B',\n\ttopf: '\\uD835\\uDD65',\n\ttopfork: '\\u2ADA',\n\ttosa: '\\u2929',\n\ttprime: '\\u2034',\n\tTRADE: '\\u2122',\n\ttrade: '\\u2122',\n\ttriangle: '\\u25B5',\n\ttriangledown: '\\u25BF',\n\ttriangleleft: '\\u25C3',\n\ttrianglelefteq: '\\u22B4',\n\ttriangleq: '\\u225C',\n\ttriangleright: '\\u25B9',\n\ttrianglerighteq: '\\u22B5',\n\ttridot: '\\u25EC',\n\ttrie: '\\u225C',\n\ttriminus: '\\u2A3A',\n\tTripleDot: '\\u20DB',\n\ttriplus: '\\u2A39',\n\ttrisb: '\\u29CD',\n\ttritime: '\\u2A3B',\n\ttrpezium: '\\u23E2',\n\tTscr: '\\uD835\\uDCAF',\n\ttscr: '\\uD835\\uDCC9',\n\tTScy: '\\u0426',\n\ttscy: '\\u0446',\n\tTSHcy: '\\u040B',\n\ttshcy: '\\u045B',\n\tTstrok: '\\u0166',\n\ttstrok: '\\u0167',\n\ttwixt: '\\u226C',\n\ttwoheadleftarrow: '\\u219E',\n\ttwoheadrightarrow: '\\u21A0',\n\tUacute: '\\u00DA',\n\tuacute: '\\u00FA',\n\tUarr: '\\u219F',\n\tuArr: '\\u21D1',\n\tuarr: '\\u2191',\n\tUarrocir: '\\u2949',\n\tUbrcy: '\\u040E',\n\tubrcy: '\\u045E',\n\tUbreve: '\\u016C',\n\tubreve: '\\u016D',\n\tUcirc: '\\u00DB',\n\tucirc: '\\u00FB',\n\tUcy: '\\u0423',\n\tucy: '\\u0443',\n\tudarr: '\\u21C5',\n\tUdblac: '\\u0170',\n\tudblac: '\\u0171',\n\tudhar: '\\u296E',\n\tufisht: '\\u297E',\n\tUfr: '\\uD835\\uDD18',\n\tufr: '\\uD835\\uDD32',\n\tUgrave: '\\u00D9',\n\tugrave: '\\u00F9',\n\tuHar: '\\u2963',\n\tuharl: '\\u21BF',\n\tuharr: '\\u21BE',\n\tuhblk: '\\u2580',\n\tulcorn: '\\u231C',\n\tulcorner: '\\u231C',\n\tulcrop: '\\u230F',\n\tultri: '\\u25F8',\n\tUmacr: '\\u016A',\n\tumacr: '\\u016B',\n\tuml: '\\u00A8',\n\tUnderBar: '\\u005F',\n\tUnderBrace: '\\u23DF',\n\tUnderBracket: '\\u23B5',\n\tUnderParenthesis: '\\u23DD',\n\tUnion: '\\u22C3',\n\tUnionPlus: '\\u228E',\n\tUogon: '\\u0172',\n\tuogon: '\\u0173',\n\tUopf: '\\uD835\\uDD4C',\n\tuopf: '\\uD835\\uDD66',\n\tUpArrow: '\\u2191',\n\tUparrow: '\\u21D1',\n\tuparrow: '\\u2191',\n\tUpArrowBar: '\\u2912',\n\tUpArrowDownArrow: '\\u21C5',\n\tUpDownArrow: '\\u2195',\n\tUpdownarrow: '\\u21D5',\n\tupdownarrow: '\\u2195',\n\tUpEquilibrium: '\\u296E',\n\tupharpoonleft: '\\u21BF',\n\tupharpoonright: '\\u21BE',\n\tuplus: '\\u228E',\n\tUpperLeftArrow: '\\u2196',\n\tUpperRightArrow: '\\u2197',\n\tUpsi: '\\u03D2',\n\tupsi: '\\u03C5',\n\tupsih: '\\u03D2',\n\tUpsilon: '\\u03A5',\n\tupsilon: '\\u03C5',\n\tUpTee: '\\u22A5',\n\tUpTeeArrow: '\\u21A5',\n\tupuparrows: '\\u21C8',\n\turcorn: '\\u231D',\n\turcorner: '\\u231D',\n\turcrop: '\\u230E',\n\tUring: '\\u016E',\n\turing: '\\u016F',\n\turtri: '\\u25F9',\n\tUscr: '\\uD835\\uDCB0',\n\tuscr: '\\uD835\\uDCCA',\n\tutdot: '\\u22F0',\n\tUtilde: '\\u0168',\n\tutilde: '\\u0169',\n\tutri: '\\u25B5',\n\tutrif: '\\u25B4',\n\tuuarr: '\\u21C8',\n\tUuml: '\\u00DC',\n\tuuml: '\\u00FC',\n\tuwangle: '\\u29A7',\n\tvangrt: '\\u299C',\n\tvarepsilon: '\\u03F5',\n\tvarkappa: '\\u03F0',\n\tvarnothing: '\\u2205',\n\tvarphi: '\\u03D5',\n\tvarpi: '\\u03D6',\n\tvarpropto: '\\u221D',\n\tvArr: '\\u21D5',\n\tvarr: '\\u2195',\n\tvarrho: '\\u03F1',\n\tvarsigma: '\\u03C2',\n\tvarsubsetneq: '\\u228A\\uFE00',\n\tvarsubsetneqq: '\\u2ACB\\uFE00',\n\tvarsupsetneq: '\\u228B\\uFE00',\n\tvarsupsetneqq: '\\u2ACC\\uFE00',\n\tvartheta: '\\u03D1',\n\tvartriangleleft: '\\u22B2',\n\tvartriangleright: '\\u22B3',\n\tVbar: '\\u2AEB',\n\tvBar: '\\u2AE8',\n\tvBarv: '\\u2AE9',\n\tVcy: '\\u0412',\n\tvcy: '\\u0432',\n\tVDash: '\\u22AB',\n\tVdash: '\\u22A9',\n\tvDash: '\\u22A8',\n\tvdash: '\\u22A2',\n\tVdashl: '\\u2AE6',\n\tVee: '\\u22C1',\n\tvee: '\\u2228',\n\tveebar: '\\u22BB',\n\tveeeq: '\\u225A',\n\tvellip: '\\u22EE',\n\tVerbar: '\\u2016',\n\tverbar: '\\u007C',\n\tVert: '\\u2016',\n\tvert: '\\u007C',\n\tVerticalBar: '\\u2223',\n\tVerticalLine: '\\u007C',\n\tVerticalSeparator: '\\u2758',\n\tVerticalTilde: '\\u2240',\n\tVeryThinSpace: '\\u200A',\n\tVfr: '\\uD835\\uDD19',\n\tvfr: '\\uD835\\uDD33',\n\tvltri: '\\u22B2',\n\tvnsub: '\\u2282\\u20D2',\n\tvnsup: '\\u2283\\u20D2',\n\tVopf: '\\uD835\\uDD4D',\n\tvopf: '\\uD835\\uDD67',\n\tvprop: '\\u221D',\n\tvrtri: '\\u22B3',\n\tVscr: '\\uD835\\uDCB1',\n\tvscr: '\\uD835\\uDCCB',\n\tvsubnE: '\\u2ACB\\uFE00',\n\tvsubne: '\\u228A\\uFE00',\n\tvsupnE: '\\u2ACC\\uFE00',\n\tvsupne: '\\u228B\\uFE00',\n\tVvdash: '\\u22AA',\n\tvzigzag: '\\u299A',\n\tWcirc: '\\u0174',\n\twcirc: '\\u0175',\n\twedbar: '\\u2A5F',\n\tWedge: '\\u22C0',\n\twedge: '\\u2227',\n\twedgeq: '\\u2259',\n\tweierp: '\\u2118',\n\tWfr: '\\uD835\\uDD1A',\n\twfr: '\\uD835\\uDD34',\n\tWopf: '\\uD835\\uDD4E',\n\twopf: '\\uD835\\uDD68',\n\twp: '\\u2118',\n\twr: '\\u2240',\n\twreath: '\\u2240',\n\tWscr: '\\uD835\\uDCB2',\n\twscr: '\\uD835\\uDCCC',\n\txcap: '\\u22C2',\n\txcirc: '\\u25EF',\n\txcup: '\\u22C3',\n\txdtri: '\\u25BD',\n\tXfr: '\\uD835\\uDD1B',\n\txfr: '\\uD835\\uDD35',\n\txhArr: '\\u27FA',\n\txharr: '\\u27F7',\n\tXi: '\\u039E',\n\txi: '\\u03BE',\n\txlArr: '\\u27F8',\n\txlarr: '\\u27F5',\n\txmap: '\\u27FC',\n\txnis: '\\u22FB',\n\txodot: '\\u2A00',\n\tXopf: '\\uD835\\uDD4F',\n\txopf: '\\uD835\\uDD69',\n\txoplus: '\\u2A01',\n\txotime: '\\u2A02',\n\txrArr: '\\u27F9',\n\txrarr: '\\u27F6',\n\tXscr: '\\uD835\\uDCB3',\n\txscr: '\\uD835\\uDCCD',\n\txsqcup: '\\u2A06',\n\txuplus: '\\u2A04',\n\txutri: '\\u25B3',\n\txvee: '\\u22C1',\n\txwedge: '\\u22C0',\n\tYacute: '\\u00DD',\n\tyacute: '\\u00FD',\n\tYAcy: '\\u042F',\n\tyacy: '\\u044F',\n\tYcirc: '\\u0176',\n\tycirc: '\\u0177',\n\tYcy: '\\u042B',\n\tycy: '\\u044B',\n\tyen: '\\u00A5',\n\tYfr: '\\uD835\\uDD1C',\n\tyfr: '\\uD835\\uDD36',\n\tYIcy: '\\u0407',\n\tyicy: '\\u0457',\n\tYopf: '\\uD835\\uDD50',\n\tyopf: '\\uD835\\uDD6A',\n\tYscr: '\\uD835\\uDCB4',\n\tyscr: '\\uD835\\uDCCE',\n\tYUcy: '\\u042E',\n\tyucy: '\\u044E',\n\tYuml: '\\u0178',\n\tyuml: '\\u00FF',\n\tZacute: '\\u0179',\n\tzacute: '\\u017A',\n\tZcaron: '\\u017D',\n\tzcaron: '\\u017E',\n\tZcy: '\\u0417',\n\tzcy: '\\u0437',\n\tZdot: '\\u017B',\n\tzdot: '\\u017C',\n\tzeetrf: '\\u2128',\n\tZeroWidthSpace: '\\u200B',\n\tZeta: '\\u0396',\n\tzeta: '\\u03B6',\n\tZfr: '\\u2128',\n\tzfr: '\\uD835\\uDD37',\n\tZHcy: '\\u0416',\n\tzhcy: '\\u0436',\n\tzigrarr: '\\u21DD',\n\tZopf: '\\u2124',\n\tzopf: '\\uD835\\uDD6B',\n\tZscr: '\\uD835\\uDCB5',\n\tzscr: '\\uD835\\uDCCF',\n\tzwj: '\\u200D',\n\tzwnj: '\\u200C',\n});\n\n/**\n * @deprecated use `HTML_ENTITIES` instead\n * @see HTML_ENTITIES\n */\nexports.entityMap = exports.HTML_ENTITIES;\n","var dom = require('./dom')\nexports.DOMImplementation = dom.DOMImplementation\nexports.XMLSerializer = dom.XMLSerializer\nexports.DOMParser = require('./dom-parser').DOMParser\n","var NAMESPACE = require(\"./conventions\").NAMESPACE;\n\n//[4] \tNameStartChar\t ::= \t\":\" | [A-Z] | \"_\" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]\n//[4a] \tNameChar\t ::= \tNameStartChar | \"-\" | \".\" | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]\n//[5] \tName\t ::= \tNameStartChar (NameChar)*\nvar nameStartChar = /[A-Z_a-z\\xC0-\\xD6\\xD8-\\xF6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]///\\u10000-\\uEFFFF\nvar nameChar = new RegExp(\"[\\\\-\\\\.0-9\"+nameStartChar.source.slice(1,-1)+\"\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040]\");\nvar tagNamePattern = new RegExp('^'+nameStartChar.source+nameChar.source+'*(?:\\:'+nameStartChar.source+nameChar.source+'*)?$');\n//var tagNamePattern = /^[a-zA-Z_][\\w\\-\\.]*(?:\\:[a-zA-Z_][\\w\\-\\.]*)?$/\n//var handlers = 'resolveEntity,getExternalSubset,characters,endDocument,endElement,endPrefixMapping,ignorableWhitespace,processingInstruction,setDocumentLocator,skippedEntity,startDocument,startElement,startPrefixMapping,notationDecl,unparsedEntityDecl,error,fatalError,warning,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,comment,endCDATA,endDTD,endEntity,startCDATA,startDTD,startEntity'.split(',')\n\n//S_TAG,\tS_ATTR,\tS_EQ,\tS_ATTR_NOQUOT_VALUE\n//S_ATTR_SPACE,\tS_ATTR_END,\tS_TAG_SPACE, S_TAG_CLOSE\nvar S_TAG = 0;//tag name offerring\nvar S_ATTR = 1;//attr name offerring\nvar S_ATTR_SPACE=2;//attr name end and space offer\nvar S_EQ = 3;//=space?\nvar S_ATTR_NOQUOT_VALUE = 4;//attr value(no quot value only)\nvar S_ATTR_END = 5;//attr value end and no space(quot end)\nvar S_TAG_SPACE = 6;//(attr value end || tag end ) && (space offer)\nvar S_TAG_CLOSE = 7;//closed el\n\n/**\n * Creates an error that will not be caught by XMLReader aka the SAX parser.\n *\n * @param {string} message\n * @param {any?} locator Optional, can provide details about the location in the source\n * @constructor\n */\nfunction ParseError(message, locator) {\n\tthis.message = message\n\tthis.locator = locator\n\tif(Error.captureStackTrace) Error.captureStackTrace(this, ParseError);\n}\nParseError.prototype = new Error();\nParseError.prototype.name = ParseError.name\n\nfunction XMLReader(){\n\n}\n\nXMLReader.prototype = {\n\tparse:function(source,defaultNSMap,entityMap){\n\t\tvar domBuilder = this.domBuilder;\n\t\tdomBuilder.startDocument();\n\t\t_copy(defaultNSMap ,defaultNSMap = {})\n\t\tparse(source,defaultNSMap,entityMap,\n\t\t\t\tdomBuilder,this.errorHandler);\n\t\tdomBuilder.endDocument();\n\t}\n}\nfunction parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){\n\tfunction fixedFromCharCode(code) {\n\t\t// String.prototype.fromCharCode does not supports\n\t\t// > 2 bytes unicode chars directly\n\t\tif (code > 0xffff) {\n\t\t\tcode -= 0x10000;\n\t\t\tvar surrogate1 = 0xd800 + (code >> 10)\n\t\t\t\t, surrogate2 = 0xdc00 + (code & 0x3ff);\n\n\t\t\treturn String.fromCharCode(surrogate1, surrogate2);\n\t\t} else {\n\t\t\treturn String.fromCharCode(code);\n\t\t}\n\t}\n\tfunction entityReplacer(a){\n\t\tvar k = a.slice(1,-1);\n\t\tif (Object.hasOwnProperty.call(entityMap, k)) {\n\t\t\treturn entityMap[k];\n\t\t}else if(k.charAt(0) === '#'){\n\t\t\treturn fixedFromCharCode(parseInt(k.substr(1).replace('x','0x')))\n\t\t}else{\n\t\t\terrorHandler.error('entity not found:'+a);\n\t\t\treturn a;\n\t\t}\n\t}\n\tfunction appendText(end){//has some bugs\n\t\tif(end>start){\n\t\t\tvar xt = source.substring(start,end).replace(/&#?\\w+;/g,entityReplacer);\n\t\t\tlocator&&position(start);\n\t\t\tdomBuilder.characters(xt,0,end-start);\n\t\t\tstart = end\n\t\t}\n\t}\n\tfunction position(p,m){\n\t\twhile(p>=lineEnd && (m = linePattern.exec(source))){\n\t\t\tlineStart = m.index;\n\t\t\tlineEnd = lineStart + m[0].length;\n\t\t\tlocator.lineNumber++;\n\t\t\t//console.log('line++:',locator,startPos,endPos)\n\t\t}\n\t\tlocator.columnNumber = p-lineStart+1;\n\t}\n\tvar lineStart = 0;\n\tvar lineEnd = 0;\n\tvar linePattern = /.*(?:\\r\\n?|\\n)|.*$/g\n\tvar locator = domBuilder.locator;\n\n\tvar parseStack = [{currentNSMap:defaultNSMapCopy}]\n\tvar closeMap = {};\n\tvar start = 0;\n\twhile(true){\n\t\ttry{\n\t\t\tvar tagStart = source.indexOf('<',start);\n\t\t\tif(tagStart<0){\n\t\t\t\tif(!source.substr(start).match(/^\\s*$/)){\n\t\t\t\t\tvar doc = domBuilder.doc;\n\t \t\t\tvar text = doc.createTextNode(source.substr(start));\n\t \t\t\tdoc.appendChild(text);\n\t \t\t\tdomBuilder.currentElement = text;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(tagStart>start){\n\t\t\t\tappendText(tagStart);\n\t\t\t}\n\t\t\tswitch(source.charAt(tagStart+1)){\n\t\t\tcase '/':\n\t\t\t\tvar end = source.indexOf('>',tagStart+3);\n\t\t\t\tvar tagName = source.substring(tagStart + 2, end).replace(/[ \\t\\n\\r]+$/g, '');\n\t\t\t\tvar config = parseStack.pop();\n\t\t\t\tif(end<0){\n\n\t \t\ttagName = source.substring(tagStart+2).replace(/[\\s<].*/,'');\n\t \t\terrorHandler.error(\"end tag name: \"+tagName+' is not complete:'+config.tagName);\n\t \t\tend = tagStart+1+tagName.length;\n\t \t}else if(tagName.match(/\\s\n\t\t\t\tlocator&&position(tagStart);\n\t\t\t\tend = parseInstruction(source,tagStart,domBuilder);\n\t\t\t\tbreak;\n\t\t\tcase '!':// start){\n\t\t\tstart = end;\n\t\t}else{\n\t\t\t//TODO: 这里有可能sax回退,有位置错误风险\n\t\t\tappendText(Math.max(tagStart,start)+1);\n\t\t}\n\t}\n}\nfunction copyLocator(f,t){\n\tt.lineNumber = f.lineNumber;\n\tt.columnNumber = f.columnNumber;\n\treturn t;\n}\n\n/**\n * @see #appendElement(source,elStartEnd,el,selfClosed,entityReplacer,domBuilder,parseStack);\n * @return end of the elementStartPart(end of elementEndPart for selfClosed el)\n */\nfunction parseElementStartPart(source,start,el,currentNSMap,entityReplacer,errorHandler){\n\n\t/**\n\t * @param {string} qname\n\t * @param {string} value\n\t * @param {number} startIndex\n\t */\n\tfunction addAttribute(qname, value, startIndex) {\n\t\tif (el.attributeNames.hasOwnProperty(qname)) {\n\t\t\terrorHandler.fatalError('Attribute ' + qname + ' redefined')\n\t\t}\n\t\tel.addValue(\n\t\t\tqname,\n\t\t\t// @see https://www.w3.org/TR/xml/#AVNormalize\n\t\t\t// since the xmldom sax parser does not \"interpret\" DTD the following is not implemented:\n\t\t\t// - recursive replacement of (DTD) entity references\n\t\t\t// - trimming and collapsing multiple spaces into a single one for attributes that are not of type CDATA\n\t\t\tvalue.replace(/[\\t\\n\\r]/g, ' ').replace(/&#?\\w+;/g, entityReplacer),\n\t\t\tstartIndex\n\t\t)\n\t}\n\tvar attrName;\n\tvar value;\n\tvar p = ++start;\n\tvar s = S_TAG;//status\n\twhile(true){\n\t\tvar c = source.charAt(p);\n\t\tswitch(c){\n\t\tcase '=':\n\t\t\tif(s === S_ATTR){//attrName\n\t\t\t\tattrName = source.slice(start,p);\n\t\t\t\ts = S_EQ;\n\t\t\t}else if(s === S_ATTR_SPACE){\n\t\t\t\ts = S_EQ;\n\t\t\t}else{\n\t\t\t\t//fatalError: equal must after attrName or space after attrName\n\t\t\t\tthrow new Error('attribute equal must after attrName'); // No known test case\n\t\t\t}\n\t\t\tbreak;\n\t\tcase '\\'':\n\t\tcase '\"':\n\t\t\tif(s === S_EQ || s === S_ATTR //|| s == S_ATTR_SPACE\n\t\t\t\t){//equal\n\t\t\t\tif(s === S_ATTR){\n\t\t\t\t\terrorHandler.warning('attribute value must after \"=\"')\n\t\t\t\t\tattrName = source.slice(start,p)\n\t\t\t\t}\n\t\t\t\tstart = p+1;\n\t\t\t\tp = source.indexOf(c,start)\n\t\t\t\tif(p>0){\n\t\t\t\t\tvalue = source.slice(start, p);\n\t\t\t\t\taddAttribute(attrName, value, start-1);\n\t\t\t\t\ts = S_ATTR_END;\n\t\t\t\t}else{\n\t\t\t\t\t//fatalError: no end quot match\n\t\t\t\t\tthrow new Error('attribute value no end \\''+c+'\\' match');\n\t\t\t\t}\n\t\t\t}else if(s == S_ATTR_NOQUOT_VALUE){\n\t\t\t\tvalue = source.slice(start, p);\n\t\t\t\taddAttribute(attrName, value, start);\n\t\t\t\terrorHandler.warning('attribute \"'+attrName+'\" missed start quot('+c+')!!');\n\t\t\t\tstart = p+1;\n\t\t\t\ts = S_ATTR_END\n\t\t\t}else{\n\t\t\t\t//fatalError: no equal before\n\t\t\t\tthrow new Error('attribute value must after \"=\"'); // No known test case\n\t\t\t}\n\t\t\tbreak;\n\t\tcase '/':\n\t\t\tswitch(s){\n\t\t\tcase S_TAG:\n\t\t\t\tel.setTagName(source.slice(start,p));\n\t\t\tcase S_ATTR_END:\n\t\t\tcase S_TAG_SPACE:\n\t\t\tcase S_TAG_CLOSE:\n\t\t\t\ts =S_TAG_CLOSE;\n\t\t\t\tel.closed = true;\n\t\t\tcase S_ATTR_NOQUOT_VALUE:\n\t\t\tcase S_ATTR:\n\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR_SPACE:\n\t\t\t\t\tel.closed = true;\n\t\t\t\tbreak;\n\t\t\t//case S_EQ:\n\t\t\tdefault:\n\t\t\t\tthrow new Error(\"attribute invalid close char('/')\") // No known test case\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ''://end document\n\t\t\terrorHandler.error('unexpected end of input');\n\t\t\tif(s == S_TAG){\n\t\t\t\tel.setTagName(source.slice(start,p));\n\t\t\t}\n\t\t\treturn p;\n\t\tcase '>':\n\t\t\tswitch(s){\n\t\t\tcase S_TAG:\n\t\t\t\tel.setTagName(source.slice(start,p));\n\t\t\tcase S_ATTR_END:\n\t\t\tcase S_TAG_SPACE:\n\t\t\tcase S_TAG_CLOSE:\n\t\t\t\tbreak;//normal\n\t\t\tcase S_ATTR_NOQUOT_VALUE://Compatible state\n\t\t\tcase S_ATTR:\n\t\t\t\tvalue = source.slice(start,p);\n\t\t\t\tif(value.slice(-1) === '/'){\n\t\t\t\t\tel.closed = true;\n\t\t\t\t\tvalue = value.slice(0,-1)\n\t\t\t\t}\n\t\t\tcase S_ATTR_SPACE:\n\t\t\t\tif(s === S_ATTR_SPACE){\n\t\t\t\t\tvalue = attrName;\n\t\t\t\t}\n\t\t\t\tif(s == S_ATTR_NOQUOT_VALUE){\n\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed quot(\")!');\n\t\t\t\t\taddAttribute(attrName, value, start)\n\t\t\t\t}else{\n\t\t\t\t\tif(!NAMESPACE.isHTML(currentNSMap['']) || !value.match(/^(?:disabled|checked|selected)$/i)){\n\t\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed value!! \"'+value+'\" instead!!')\n\t\t\t\t\t}\n\t\t\t\t\taddAttribute(value, value, start)\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase S_EQ:\n\t\t\t\tthrow new Error('attribute value missed!!');\n\t\t\t}\n//\t\t\tconsole.log(tagName,tagNamePattern,tagNamePattern.test(tagName))\n\t\t\treturn p;\n\t\t/*xml space '\\x20' | #x9 | #xD | #xA; */\n\t\tcase '\\u0080':\n\t\t\tc = ' ';\n\t\tdefault:\n\t\t\tif(c<= ' '){//space\n\t\t\t\tswitch(s){\n\t\t\t\tcase S_TAG:\n\t\t\t\t\tel.setTagName(source.slice(start,p));//tagName\n\t\t\t\t\ts = S_TAG_SPACE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR:\n\t\t\t\t\tattrName = source.slice(start,p)\n\t\t\t\t\ts = S_ATTR_SPACE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR_NOQUOT_VALUE:\n\t\t\t\t\tvar value = source.slice(start, p);\n\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed quot(\")!!');\n\t\t\t\t\taddAttribute(attrName, value, start)\n\t\t\t\tcase S_ATTR_END:\n\t\t\t\t\ts = S_TAG_SPACE;\n\t\t\t\t\tbreak;\n\t\t\t\t//case S_TAG_SPACE:\n\t\t\t\t//case S_EQ:\n\t\t\t\t//case S_ATTR_SPACE:\n\t\t\t\t//\tvoid();break;\n\t\t\t\t//case S_TAG_CLOSE:\n\t\t\t\t\t//ignore warning\n\t\t\t\t}\n\t\t\t}else{//not space\n//S_TAG,\tS_ATTR,\tS_EQ,\tS_ATTR_NOQUOT_VALUE\n//S_ATTR_SPACE,\tS_ATTR_END,\tS_TAG_SPACE, S_TAG_CLOSE\n\t\t\t\tswitch(s){\n\t\t\t\t//case S_TAG:void();break;\n\t\t\t\t//case S_ATTR:void();break;\n\t\t\t\t//case S_ATTR_NOQUOT_VALUE:void();break;\n\t\t\t\tcase S_ATTR_SPACE:\n\t\t\t\t\tvar tagName = el.tagName;\n\t\t\t\t\tif (!NAMESPACE.isHTML(currentNSMap['']) || !attrName.match(/^(?:disabled|checked|selected)$/i)) {\n\t\t\t\t\t\terrorHandler.warning('attribute \"'+attrName+'\" missed value!! \"'+attrName+'\" instead2!!')\n\t\t\t\t\t}\n\t\t\t\t\taddAttribute(attrName, attrName, start);\n\t\t\t\t\tstart = p;\n\t\t\t\t\ts = S_ATTR;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR_END:\n\t\t\t\t\terrorHandler.warning('attribute space is required\"'+attrName+'\"!!')\n\t\t\t\tcase S_TAG_SPACE:\n\t\t\t\t\ts = S_ATTR;\n\t\t\t\t\tstart = p;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_EQ:\n\t\t\t\t\ts = S_ATTR_NOQUOT_VALUE;\n\t\t\t\t\tstart = p;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_TAG_CLOSE:\n\t\t\t\t\tthrow new Error(\"elements closed character '/' and '>' must be connected to\");\n\t\t\t\t}\n\t\t\t}\n\t\t}//end outer switch\n\t\t//console.log('p++',p)\n\t\tp++;\n\t}\n}\n/**\n * @return true if has new namespace define\n */\nfunction appendElement(el,domBuilder,currentNSMap){\n\tvar tagName = el.tagName;\n\tvar localNSMap = null;\n\t//var currentNSMap = parseStack[parseStack.length-1].currentNSMap;\n\tvar i = el.length;\n\twhile(i--){\n\t\tvar a = el[i];\n\t\tvar qName = a.qName;\n\t\tvar value = a.value;\n\t\tvar nsp = qName.indexOf(':');\n\t\tif(nsp>0){\n\t\t\tvar prefix = a.prefix = qName.slice(0,nsp);\n\t\t\tvar localName = qName.slice(nsp+1);\n\t\t\tvar nsPrefix = prefix === 'xmlns' && localName\n\t\t}else{\n\t\t\tlocalName = qName;\n\t\t\tprefix = null\n\t\t\tnsPrefix = qName === 'xmlns' && ''\n\t\t}\n\t\t//can not set prefix,because prefix !== ''\n\t\ta.localName = localName ;\n\t\t//prefix == null for no ns prefix attribute\n\t\tif(nsPrefix !== false){//hack!!\n\t\t\tif(localNSMap == null){\n\t\t\t\tlocalNSMap = {}\n\t\t\t\t//console.log(currentNSMap,0)\n\t\t\t\t_copy(currentNSMap,currentNSMap={})\n\t\t\t\t//console.log(currentNSMap,1)\n\t\t\t}\n\t\t\tcurrentNSMap[nsPrefix] = localNSMap[nsPrefix] = value;\n\t\t\ta.uri = NAMESPACE.XMLNS\n\t\t\tdomBuilder.startPrefixMapping(nsPrefix, value)\n\t\t}\n\t}\n\tvar i = el.length;\n\twhile(i--){\n\t\ta = el[i];\n\t\tvar prefix = a.prefix;\n\t\tif(prefix){//no prefix attribute has no namespace\n\t\t\tif(prefix === 'xml'){\n\t\t\t\ta.uri = NAMESPACE.XML;\n\t\t\t}if(prefix !== 'xmlns'){\n\t\t\t\ta.uri = currentNSMap[prefix || '']\n\n\t\t\t\t//{console.log('###'+a.qName,domBuilder.locator.systemId+'',currentNSMap,a.uri)}\n\t\t\t}\n\t\t}\n\t}\n\tvar nsp = tagName.indexOf(':');\n\tif(nsp>0){\n\t\tprefix = el.prefix = tagName.slice(0,nsp);\n\t\tlocalName = el.localName = tagName.slice(nsp+1);\n\t}else{\n\t\tprefix = null;//important!!\n\t\tlocalName = el.localName = tagName;\n\t}\n\t//no prefix element has default namespace\n\tvar ns = el.uri = currentNSMap[prefix || ''];\n\tdomBuilder.startElement(ns,localName,tagName,el);\n\t//endPrefixMapping and startPrefixMapping have not any help for dom builder\n\t//localNSMap = null\n\tif(el.closed){\n\t\tdomBuilder.endElement(ns,localName,tagName);\n\t\tif(localNSMap){\n\t\t\tfor (prefix in localNSMap) {\n\t\t\t\tif (Object.prototype.hasOwnProperty.call(localNSMap, prefix)) {\n\t\t\t\t\tdomBuilder.endPrefixMapping(prefix);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}else{\n\t\tel.currentNSMap = currentNSMap;\n\t\tel.localNSMap = localNSMap;\n\t\t//parseStack.push(el);\n\t\treturn true;\n\t}\n}\nfunction parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBuilder){\n\tif(/^(?:script|textarea)$/i.test(tagName)){\n\t\tvar elEndStart = source.indexOf('',elStartEnd);\n\t\tvar text = source.substring(elStartEnd+1,elEndStart);\n\t\tif(/[&<]/.test(text)){\n\t\t\tif(/^script$/i.test(tagName)){\n\t\t\t\t//if(!/\\]\\]>/.test(text)){\n\t\t\t\t\t//lexHandler.startCDATA();\n\t\t\t\t\tdomBuilder.characters(text,0,text.length);\n\t\t\t\t\t//lexHandler.endCDATA();\n\t\t\t\t\treturn elEndStart;\n\t\t\t\t//}\n\t\t\t}//}else{//text area\n\t\t\t\ttext = text.replace(/&#?\\w+;/g,entityReplacer);\n\t\t\t\tdomBuilder.characters(text,0,text.length);\n\t\t\t\treturn elEndStart;\n\t\t\t//}\n\n\t\t}\n\t}\n\treturn elStartEnd+1;\n}\nfunction fixSelfClosed(source,elStartEnd,tagName,closeMap){\n\t//if(tagName in closeMap){\n\tvar pos = closeMap[tagName];\n\tif(pos == null){\n\t\t//console.log(tagName)\n\t\tpos = source.lastIndexOf('')\n\t\tif(pos',start+4);\n\t\t\t//append comment source.substring(4,end)//\") { // (3) next characters must match \"-->\"\n throw new ParsingError(ParsingError.Errors.BadTimeStamp,\n \"Malformed time stamp (time stamps must be separated by '-->'): \" +\n oInput);\n }\n input = input.substr(3);\n skipWhitespace();\n cue.endTime = consumeTimeStamp(); // (5) collect cue end time\n\n // 4.1 WebVTT cue settings list.\n skipWhitespace();\n consumeCueSettings(input, cue);\n}\n\n// When evaluating this file as part of a Webpack bundle for server\n// side rendering, `document` is an empty object.\nvar TEXTAREA_ELEMENT = document.createElement && document.createElement(\"textarea\");\n\nvar TAG_NAME = {\n c: \"span\",\n i: \"i\",\n b: \"b\",\n u: \"u\",\n ruby: \"ruby\",\n rt: \"rt\",\n v: \"span\",\n lang: \"span\"\n};\n\n// 5.1 default text color\n// 5.2 default text background color is equivalent to text color with bg_ prefix\nvar DEFAULT_COLOR_CLASS = {\n white: 'rgba(255,255,255,1)',\n lime: 'rgba(0,255,0,1)',\n cyan: 'rgba(0,255,255,1)',\n red: 'rgba(255,0,0,1)',\n yellow: 'rgba(255,255,0,1)',\n magenta: 'rgba(255,0,255,1)',\n blue: 'rgba(0,0,255,1)',\n black: 'rgba(0,0,0,1)'\n};\n\nvar TAG_ANNOTATION = {\n v: \"title\",\n lang: \"lang\"\n};\n\nvar NEEDS_PARENT = {\n rt: \"ruby\"\n};\n\n// Parse content into a document fragment.\nfunction parseContent(window, input) {\n function nextToken() {\n // Check for end-of-string.\n if (!input) {\n return null;\n }\n\n // Consume 'n' characters from the input.\n function consume(result) {\n input = input.substr(result.length);\n return result;\n }\n\n var m = input.match(/^([^<]*)(<[^>]*>?)?/);\n // If there is some text before the next tag, return it, otherwise return\n // the tag.\n return consume(m[1] ? m[1] : m[2]);\n }\n\n function unescape(s) {\n TEXTAREA_ELEMENT.innerHTML = s;\n s = TEXTAREA_ELEMENT.textContent;\n TEXTAREA_ELEMENT.textContent = \"\";\n return s;\n }\n\n function shouldAdd(current, element) {\n return !NEEDS_PARENT[element.localName] ||\n NEEDS_PARENT[element.localName] === current.localName;\n }\n\n // Create an element for this tag.\n function createElement(type, annotation) {\n var tagName = TAG_NAME[type];\n if (!tagName) {\n return null;\n }\n var element = window.document.createElement(tagName);\n var name = TAG_ANNOTATION[type];\n if (name && annotation) {\n element[name] = annotation.trim();\n }\n return element;\n }\n\n var rootDiv = window.document.createElement(\"div\"),\n current = rootDiv,\n t,\n tagStack = [];\n\n while ((t = nextToken()) !== null) {\n if (t[0] === '<') {\n if (t[1] === \"/\") {\n // If the closing tag matches, move back up to the parent node.\n if (tagStack.length &&\n tagStack[tagStack.length - 1] === t.substr(2).replace(\">\", \"\")) {\n tagStack.pop();\n current = current.parentNode;\n }\n // Otherwise just ignore the end tag.\n continue;\n }\n var ts = parseTimeStamp(t.substr(1, t.length - 2));\n var node;\n if (ts) {\n // Timestamps are lead nodes as well.\n node = window.document.createProcessingInstruction(\"timestamp\", ts);\n current.appendChild(node);\n continue;\n }\n var m = t.match(/^<([^.\\s/0-9>]+)(\\.[^\\s\\\\>]+)?([^>\\\\]+)?(\\\\?)>?$/);\n // If we can't parse the tag, skip to the next tag.\n if (!m) {\n continue;\n }\n // Try to construct an element, and ignore the tag if we couldn't.\n node = createElement(m[1], m[3]);\n if (!node) {\n continue;\n }\n // Determine if the tag should be added based on the context of where it\n // is placed in the cuetext.\n if (!shouldAdd(current, node)) {\n continue;\n }\n // Set the class list (as a list of classes, separated by space).\n if (m[2]) {\n var classes = m[2].split('.');\n\n classes.forEach(function(cl) {\n var bgColor = /^bg_/.test(cl);\n // slice out `bg_` if it's a background color\n var colorName = bgColor ? cl.slice(3) : cl;\n\n if (DEFAULT_COLOR_CLASS.hasOwnProperty(colorName)) {\n var propName = bgColor ? 'background-color' : 'color';\n var propValue = DEFAULT_COLOR_CLASS[colorName];\n\n node.style[propName] = propValue;\n }\n });\n\n node.className = classes.join(' ');\n }\n // Append the node to the current node, and enter the scope of the new\n // node.\n tagStack.push(m[1]);\n current.appendChild(node);\n current = node;\n continue;\n }\n\n // Text nodes are leaf nodes.\n current.appendChild(window.document.createTextNode(unescape(t)));\n }\n\n return rootDiv;\n}\n\n// This is a list of all the Unicode characters that have a strong\n// right-to-left category. What this means is that these characters are\n// written right-to-left for sure. It was generated by pulling all the strong\n// right-to-left characters out of the Unicode data table. That table can\n// found at: http://www.unicode.org/Public/UNIDATA/UnicodeData.txt\nvar strongRTLRanges = [[0x5be, 0x5be], [0x5c0, 0x5c0], [0x5c3, 0x5c3], [0x5c6, 0x5c6],\n [0x5d0, 0x5ea], [0x5f0, 0x5f4], [0x608, 0x608], [0x60b, 0x60b], [0x60d, 0x60d],\n [0x61b, 0x61b], [0x61e, 0x64a], [0x66d, 0x66f], [0x671, 0x6d5], [0x6e5, 0x6e6],\n [0x6ee, 0x6ef], [0x6fa, 0x70d], [0x70f, 0x710], [0x712, 0x72f], [0x74d, 0x7a5],\n [0x7b1, 0x7b1], [0x7c0, 0x7ea], [0x7f4, 0x7f5], [0x7fa, 0x7fa], [0x800, 0x815],\n [0x81a, 0x81a], [0x824, 0x824], [0x828, 0x828], [0x830, 0x83e], [0x840, 0x858],\n [0x85e, 0x85e], [0x8a0, 0x8a0], [0x8a2, 0x8ac], [0x200f, 0x200f],\n [0xfb1d, 0xfb1d], [0xfb1f, 0xfb28], [0xfb2a, 0xfb36], [0xfb38, 0xfb3c],\n [0xfb3e, 0xfb3e], [0xfb40, 0xfb41], [0xfb43, 0xfb44], [0xfb46, 0xfbc1],\n [0xfbd3, 0xfd3d], [0xfd50, 0xfd8f], [0xfd92, 0xfdc7], [0xfdf0, 0xfdfc],\n [0xfe70, 0xfe74], [0xfe76, 0xfefc], [0x10800, 0x10805], [0x10808, 0x10808],\n [0x1080a, 0x10835], [0x10837, 0x10838], [0x1083c, 0x1083c], [0x1083f, 0x10855],\n [0x10857, 0x1085f], [0x10900, 0x1091b], [0x10920, 0x10939], [0x1093f, 0x1093f],\n [0x10980, 0x109b7], [0x109be, 0x109bf], [0x10a00, 0x10a00], [0x10a10, 0x10a13],\n [0x10a15, 0x10a17], [0x10a19, 0x10a33], [0x10a40, 0x10a47], [0x10a50, 0x10a58],\n [0x10a60, 0x10a7f], [0x10b00, 0x10b35], [0x10b40, 0x10b55], [0x10b58, 0x10b72],\n [0x10b78, 0x10b7f], [0x10c00, 0x10c48], [0x1ee00, 0x1ee03], [0x1ee05, 0x1ee1f],\n [0x1ee21, 0x1ee22], [0x1ee24, 0x1ee24], [0x1ee27, 0x1ee27], [0x1ee29, 0x1ee32],\n [0x1ee34, 0x1ee37], [0x1ee39, 0x1ee39], [0x1ee3b, 0x1ee3b], [0x1ee42, 0x1ee42],\n [0x1ee47, 0x1ee47], [0x1ee49, 0x1ee49], [0x1ee4b, 0x1ee4b], [0x1ee4d, 0x1ee4f],\n [0x1ee51, 0x1ee52], [0x1ee54, 0x1ee54], [0x1ee57, 0x1ee57], [0x1ee59, 0x1ee59],\n [0x1ee5b, 0x1ee5b], [0x1ee5d, 0x1ee5d], [0x1ee5f, 0x1ee5f], [0x1ee61, 0x1ee62],\n [0x1ee64, 0x1ee64], [0x1ee67, 0x1ee6a], [0x1ee6c, 0x1ee72], [0x1ee74, 0x1ee77],\n [0x1ee79, 0x1ee7c], [0x1ee7e, 0x1ee7e], [0x1ee80, 0x1ee89], [0x1ee8b, 0x1ee9b],\n [0x1eea1, 0x1eea3], [0x1eea5, 0x1eea9], [0x1eeab, 0x1eebb], [0x10fffd, 0x10fffd]];\n\nfunction isStrongRTLChar(charCode) {\n for (var i = 0; i < strongRTLRanges.length; i++) {\n var currentRange = strongRTLRanges[i];\n if (charCode >= currentRange[0] && charCode <= currentRange[1]) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction determineBidi(cueDiv) {\n var nodeStack = [],\n text = \"\",\n charCode;\n\n if (!cueDiv || !cueDiv.childNodes) {\n return \"ltr\";\n }\n\n function pushNodes(nodeStack, node) {\n for (var i = node.childNodes.length - 1; i >= 0; i--) {\n nodeStack.push(node.childNodes[i]);\n }\n }\n\n function nextTextNode(nodeStack) {\n if (!nodeStack || !nodeStack.length) {\n return null;\n }\n\n var node = nodeStack.pop(),\n text = node.textContent || node.innerText;\n if (text) {\n // TODO: This should match all unicode type B characters (paragraph\n // separator characters). See issue #115.\n var m = text.match(/^.*(\\n|\\r)/);\n if (m) {\n nodeStack.length = 0;\n return m[0];\n }\n return text;\n }\n if (node.tagName === \"ruby\") {\n return nextTextNode(nodeStack);\n }\n if (node.childNodes) {\n pushNodes(nodeStack, node);\n return nextTextNode(nodeStack);\n }\n }\n\n pushNodes(nodeStack, cueDiv);\n while ((text = nextTextNode(nodeStack))) {\n for (var i = 0; i < text.length; i++) {\n charCode = text.charCodeAt(i);\n if (isStrongRTLChar(charCode)) {\n return \"rtl\";\n }\n }\n }\n return \"ltr\";\n}\n\nfunction computeLinePos(cue) {\n if (typeof cue.line === \"number\" &&\n (cue.snapToLines || (cue.line >= 0 && cue.line <= 100))) {\n return cue.line;\n }\n if (!cue.track || !cue.track.textTrackList ||\n !cue.track.textTrackList.mediaElement) {\n return -1;\n }\n var track = cue.track,\n trackList = track.textTrackList,\n count = 0;\n for (var i = 0; i < trackList.length && trackList[i] !== track; i++) {\n if (trackList[i].mode === \"showing\") {\n count++;\n }\n }\n return ++count * -1;\n}\n\nfunction StyleBox() {\n}\n\n// Apply styles to a div. If there is no div passed then it defaults to the\n// div on 'this'.\nStyleBox.prototype.applyStyles = function(styles, div) {\n div = div || this.div;\n for (var prop in styles) {\n if (styles.hasOwnProperty(prop)) {\n div.style[prop] = styles[prop];\n }\n }\n};\n\nStyleBox.prototype.formatStyle = function(val, unit) {\n return val === 0 ? 0 : val + unit;\n};\n\n// Constructs the computed display state of the cue (a div). Places the div\n// into the overlay which should be a block level element (usually a div).\nfunction CueStyleBox(window, cue, styleOptions) {\n StyleBox.call(this);\n this.cue = cue;\n\n // Parse our cue's text into a DOM tree rooted at 'cueDiv'. This div will\n // have inline positioning and will function as the cue background box.\n this.cueDiv = parseContent(window, cue.text);\n var styles = {\n color: \"rgba(255, 255, 255, 1)\",\n backgroundColor: \"rgba(0, 0, 0, 0.8)\",\n position: \"relative\",\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n display: \"inline\",\n writingMode: cue.vertical === \"\" ? \"horizontal-tb\"\n : cue.vertical === \"lr\" ? \"vertical-lr\"\n : \"vertical-rl\",\n unicodeBidi: \"plaintext\"\n };\n\n this.applyStyles(styles, this.cueDiv);\n\n // Create an absolutely positioned div that will be used to position the cue\n // div. Note, all WebVTT cue-setting alignments are equivalent to the CSS\n // mirrors of them except middle instead of center on Safari.\n this.div = window.document.createElement(\"div\");\n styles = {\n direction: determineBidi(this.cueDiv),\n writingMode: cue.vertical === \"\" ? \"horizontal-tb\"\n : cue.vertical === \"lr\" ? \"vertical-lr\"\n : \"vertical-rl\",\n unicodeBidi: \"plaintext\",\n textAlign: cue.align === \"middle\" ? \"center\" : cue.align,\n font: styleOptions.font,\n whiteSpace: \"pre-line\",\n position: \"absolute\"\n };\n\n this.applyStyles(styles);\n this.div.appendChild(this.cueDiv);\n\n // Calculate the distance from the reference edge of the viewport to the text\n // position of the cue box. The reference edge will be resolved later when\n // the box orientation styles are applied.\n var textPos = 0;\n switch (cue.positionAlign) {\n case \"start\":\n case \"line-left\":\n textPos = cue.position;\n break;\n case \"center\":\n textPos = cue.position - (cue.size / 2);\n break;\n case \"end\":\n case \"line-right\":\n textPos = cue.position - cue.size;\n break;\n }\n\n // Horizontal box orientation; textPos is the distance from the left edge of the\n // area to the left edge of the box and cue.size is the distance extending to\n // the right from there.\n if (cue.vertical === \"\") {\n this.applyStyles({\n left: this.formatStyle(textPos, \"%\"),\n width: this.formatStyle(cue.size, \"%\")\n });\n // Vertical box orientation; textPos is the distance from the top edge of the\n // area to the top edge of the box and cue.size is the height extending\n // downwards from there.\n } else {\n this.applyStyles({\n top: this.formatStyle(textPos, \"%\"),\n height: this.formatStyle(cue.size, \"%\")\n });\n }\n\n this.move = function(box) {\n this.applyStyles({\n top: this.formatStyle(box.top, \"px\"),\n bottom: this.formatStyle(box.bottom, \"px\"),\n left: this.formatStyle(box.left, \"px\"),\n right: this.formatStyle(box.right, \"px\"),\n height: this.formatStyle(box.height, \"px\"),\n width: this.formatStyle(box.width, \"px\")\n });\n };\n}\nCueStyleBox.prototype = _objCreate(StyleBox.prototype);\nCueStyleBox.prototype.constructor = CueStyleBox;\n\n// Represents the co-ordinates of an Element in a way that we can easily\n// compute things with such as if it overlaps or intersects with another Element.\n// Can initialize it with either a StyleBox or another BoxPosition.\nfunction BoxPosition(obj) {\n // Either a BoxPosition was passed in and we need to copy it, or a StyleBox\n // was passed in and we need to copy the results of 'getBoundingClientRect'\n // as the object returned is readonly. All co-ordinate values are in reference\n // to the viewport origin (top left).\n var lh, height, width, top;\n if (obj.div) {\n height = obj.div.offsetHeight;\n width = obj.div.offsetWidth;\n top = obj.div.offsetTop;\n\n var rects = (rects = obj.div.childNodes) && (rects = rects[0]) &&\n rects.getClientRects && rects.getClientRects();\n obj = obj.div.getBoundingClientRect();\n // In certain cases the outter div will be slightly larger then the sum of\n // the inner div's lines. This could be due to bold text, etc, on some platforms.\n // In this case we should get the average line height and use that. This will\n // result in the desired behaviour.\n lh = rects ? Math.max((rects[0] && rects[0].height) || 0, obj.height / rects.length)\n : 0;\n\n }\n this.left = obj.left;\n this.right = obj.right;\n this.top = obj.top || top;\n this.height = obj.height || height;\n this.bottom = obj.bottom || (top + (obj.height || height));\n this.width = obj.width || width;\n this.lineHeight = lh !== undefined ? lh : obj.lineHeight;\n}\n\n// Move the box along a particular axis. Optionally pass in an amount to move\n// the box. If no amount is passed then the default is the line height of the\n// box.\nBoxPosition.prototype.move = function(axis, toMove) {\n toMove = toMove !== undefined ? toMove : this.lineHeight;\n switch (axis) {\n case \"+x\":\n this.left += toMove;\n this.right += toMove;\n break;\n case \"-x\":\n this.left -= toMove;\n this.right -= toMove;\n break;\n case \"+y\":\n this.top += toMove;\n this.bottom += toMove;\n break;\n case \"-y\":\n this.top -= toMove;\n this.bottom -= toMove;\n break;\n }\n};\n\n// Check if this box overlaps another box, b2.\nBoxPosition.prototype.overlaps = function(b2) {\n return this.left < b2.right &&\n this.right > b2.left &&\n this.top < b2.bottom &&\n this.bottom > b2.top;\n};\n\n// Check if this box overlaps any other boxes in boxes.\nBoxPosition.prototype.overlapsAny = function(boxes) {\n for (var i = 0; i < boxes.length; i++) {\n if (this.overlaps(boxes[i])) {\n return true;\n }\n }\n return false;\n};\n\n// Check if this box is within another box.\nBoxPosition.prototype.within = function(container) {\n return this.top >= container.top &&\n this.bottom <= container.bottom &&\n this.left >= container.left &&\n this.right <= container.right;\n};\n\n// Check if this box is entirely within the container or it is overlapping\n// on the edge opposite of the axis direction passed. For example, if \"+x\" is\n// passed and the box is overlapping on the left edge of the container, then\n// return true.\nBoxPosition.prototype.overlapsOppositeAxis = function(container, axis) {\n switch (axis) {\n case \"+x\":\n return this.left < container.left;\n case \"-x\":\n return this.right > container.right;\n case \"+y\":\n return this.top < container.top;\n case \"-y\":\n return this.bottom > container.bottom;\n }\n};\n\n// Find the percentage of the area that this box is overlapping with another\n// box.\nBoxPosition.prototype.intersectPercentage = function(b2) {\n var x = Math.max(0, Math.min(this.right, b2.right) - Math.max(this.left, b2.left)),\n y = Math.max(0, Math.min(this.bottom, b2.bottom) - Math.max(this.top, b2.top)),\n intersectArea = x * y;\n return intersectArea / (this.height * this.width);\n};\n\n// Convert the positions from this box to CSS compatible positions using\n// the reference container's positions. This has to be done because this\n// box's positions are in reference to the viewport origin, whereas, CSS\n// values are in referecne to their respective edges.\nBoxPosition.prototype.toCSSCompatValues = function(reference) {\n return {\n top: this.top - reference.top,\n bottom: reference.bottom - this.bottom,\n left: this.left - reference.left,\n right: reference.right - this.right,\n height: this.height,\n width: this.width\n };\n};\n\n// Get an object that represents the box's position without anything extra.\n// Can pass a StyleBox, HTMLElement, or another BoxPositon.\nBoxPosition.getSimpleBoxPosition = function(obj) {\n var height = obj.div ? obj.div.offsetHeight : obj.tagName ? obj.offsetHeight : 0;\n var width = obj.div ? obj.div.offsetWidth : obj.tagName ? obj.offsetWidth : 0;\n var top = obj.div ? obj.div.offsetTop : obj.tagName ? obj.offsetTop : 0;\n\n obj = obj.div ? obj.div.getBoundingClientRect() :\n obj.tagName ? obj.getBoundingClientRect() : obj;\n var ret = {\n left: obj.left,\n right: obj.right,\n top: obj.top || top,\n height: obj.height || height,\n bottom: obj.bottom || (top + (obj.height || height)),\n width: obj.width || width\n };\n return ret;\n};\n\n// Move a StyleBox to its specified, or next best, position. The containerBox\n// is the box that contains the StyleBox, such as a div. boxPositions are\n// a list of other boxes that the styleBox can't overlap with.\nfunction moveBoxToLinePosition(window, styleBox, containerBox, boxPositions) {\n\n // Find the best position for a cue box, b, on the video. The axis parameter\n // is a list of axis, the order of which, it will move the box along. For example:\n // Passing [\"+x\", \"-x\"] will move the box first along the x axis in the positive\n // direction. If it doesn't find a good position for it there it will then move\n // it along the x axis in the negative direction.\n function findBestPosition(b, axis) {\n var bestPosition,\n specifiedPosition = new BoxPosition(b),\n percentage = 1; // Highest possible so the first thing we get is better.\n\n for (var i = 0; i < axis.length; i++) {\n while (b.overlapsOppositeAxis(containerBox, axis[i]) ||\n (b.within(containerBox) && b.overlapsAny(boxPositions))) {\n b.move(axis[i]);\n }\n // We found a spot where we aren't overlapping anything. This is our\n // best position.\n if (b.within(containerBox)) {\n return b;\n }\n var p = b.intersectPercentage(containerBox);\n // If we're outside the container box less then we were on our last try\n // then remember this position as the best position.\n if (percentage > p) {\n bestPosition = new BoxPosition(b);\n percentage = p;\n }\n // Reset the box position to the specified position.\n b = new BoxPosition(specifiedPosition);\n }\n return bestPosition || specifiedPosition;\n }\n\n var boxPosition = new BoxPosition(styleBox),\n cue = styleBox.cue,\n linePos = computeLinePos(cue),\n axis = [];\n\n // If we have a line number to align the cue to.\n if (cue.snapToLines) {\n var size;\n switch (cue.vertical) {\n case \"\":\n axis = [ \"+y\", \"-y\" ];\n size = \"height\";\n break;\n case \"rl\":\n axis = [ \"+x\", \"-x\" ];\n size = \"width\";\n break;\n case \"lr\":\n axis = [ \"-x\", \"+x\" ];\n size = \"width\";\n break;\n }\n\n var step = boxPosition.lineHeight,\n position = step * Math.round(linePos),\n maxPosition = containerBox[size] + step,\n initialAxis = axis[0];\n\n // If the specified intial position is greater then the max position then\n // clamp the box to the amount of steps it would take for the box to\n // reach the max position.\n if (Math.abs(position) > maxPosition) {\n position = position < 0 ? -1 : 1;\n position *= Math.ceil(maxPosition / step) * step;\n }\n\n // If computed line position returns negative then line numbers are\n // relative to the bottom of the video instead of the top. Therefore, we\n // need to increase our initial position by the length or width of the\n // video, depending on the writing direction, and reverse our axis directions.\n if (linePos < 0) {\n position += cue.vertical === \"\" ? containerBox.height : containerBox.width;\n axis = axis.reverse();\n }\n\n // Move the box to the specified position. This may not be its best\n // position.\n boxPosition.move(initialAxis, position);\n\n } else {\n // If we have a percentage line value for the cue.\n var calculatedPercentage = (boxPosition.lineHeight / containerBox.height) * 100;\n\n switch (cue.lineAlign) {\n case \"center\":\n linePos -= (calculatedPercentage / 2);\n break;\n case \"end\":\n linePos -= calculatedPercentage;\n break;\n }\n\n // Apply initial line position to the cue box.\n switch (cue.vertical) {\n case \"\":\n styleBox.applyStyles({\n top: styleBox.formatStyle(linePos, \"%\")\n });\n break;\n case \"rl\":\n styleBox.applyStyles({\n left: styleBox.formatStyle(linePos, \"%\")\n });\n break;\n case \"lr\":\n styleBox.applyStyles({\n right: styleBox.formatStyle(linePos, \"%\")\n });\n break;\n }\n\n axis = [ \"+y\", \"-x\", \"+x\", \"-y\" ];\n\n // Get the box position again after we've applied the specified positioning\n // to it.\n boxPosition = new BoxPosition(styleBox);\n }\n\n var bestPosition = findBestPosition(boxPosition, axis);\n styleBox.move(bestPosition.toCSSCompatValues(containerBox));\n}\n\nfunction WebVTT() {\n // Nothing\n}\n\n// Helper to allow strings to be decoded instead of the default binary utf8 data.\nWebVTT.StringDecoder = function() {\n return {\n decode: function(data) {\n if (!data) {\n return \"\";\n }\n if (typeof data !== \"string\") {\n throw new Error(\"Error - expected string data.\");\n }\n return decodeURIComponent(encodeURIComponent(data));\n }\n };\n};\n\nWebVTT.convertCueToDOMTree = function(window, cuetext) {\n if (!window || !cuetext) {\n return null;\n }\n return parseContent(window, cuetext);\n};\n\nvar FONT_SIZE_PERCENT = 0.05;\nvar FONT_STYLE = \"sans-serif\";\nvar CUE_BACKGROUND_PADDING = \"1.5%\";\n\n// Runs the processing model over the cues and regions passed to it.\n// @param overlay A block level element (usually a div) that the computed cues\n// and regions will be placed into.\nWebVTT.processCues = function(window, cues, overlay) {\n if (!window || !cues || !overlay) {\n return null;\n }\n\n // Remove all previous children.\n while (overlay.firstChild) {\n overlay.removeChild(overlay.firstChild);\n }\n\n var paddedOverlay = window.document.createElement(\"div\");\n paddedOverlay.style.position = \"absolute\";\n paddedOverlay.style.left = \"0\";\n paddedOverlay.style.right = \"0\";\n paddedOverlay.style.top = \"0\";\n paddedOverlay.style.bottom = \"0\";\n paddedOverlay.style.margin = CUE_BACKGROUND_PADDING;\n overlay.appendChild(paddedOverlay);\n\n // Determine if we need to compute the display states of the cues. This could\n // be the case if a cue's state has been changed since the last computation or\n // if it has not been computed yet.\n function shouldCompute(cues) {\n for (var i = 0; i < cues.length; i++) {\n if (cues[i].hasBeenReset || !cues[i].displayState) {\n return true;\n }\n }\n return false;\n }\n\n // We don't need to recompute the cues' display states. Just reuse them.\n if (!shouldCompute(cues)) {\n for (var i = 0; i < cues.length; i++) {\n paddedOverlay.appendChild(cues[i].displayState);\n }\n return;\n }\n\n var boxPositions = [],\n containerBox = BoxPosition.getSimpleBoxPosition(paddedOverlay),\n fontSize = Math.round(containerBox.height * FONT_SIZE_PERCENT * 100) / 100;\n var styleOptions = {\n font: fontSize + \"px \" + FONT_STYLE\n };\n\n (function() {\n var styleBox, cue;\n\n for (var i = 0; i < cues.length; i++) {\n cue = cues[i];\n\n // Compute the intial position and styles of the cue div.\n styleBox = new CueStyleBox(window, cue, styleOptions);\n paddedOverlay.appendChild(styleBox.div);\n\n // Move the cue div to it's correct line position.\n moveBoxToLinePosition(window, styleBox, containerBox, boxPositions);\n\n // Remember the computed div so that we don't have to recompute it later\n // if we don't have too.\n cue.displayState = styleBox.div;\n\n boxPositions.push(BoxPosition.getSimpleBoxPosition(styleBox));\n }\n })();\n};\n\nWebVTT.Parser = function(window, vttjs, decoder) {\n if (!decoder) {\n decoder = vttjs;\n vttjs = {};\n }\n if (!vttjs) {\n vttjs = {};\n }\n\n this.window = window;\n this.vttjs = vttjs;\n this.state = \"INITIAL\";\n this.buffer = \"\";\n this.decoder = decoder || new TextDecoder(\"utf8\");\n this.regionList = [];\n};\n\nWebVTT.Parser.prototype = {\n // If the error is a ParsingError then report it to the consumer if\n // possible. If it's not a ParsingError then throw it like normal.\n reportOrThrowError: function(e) {\n if (e instanceof ParsingError) {\n this.onparsingerror && this.onparsingerror(e);\n } else {\n throw e;\n }\n },\n parse: function (data) {\n var self = this;\n\n // If there is no data then we won't decode it, but will just try to parse\n // whatever is in buffer already. This may occur in circumstances, for\n // example when flush() is called.\n if (data) {\n // Try to decode the data that we received.\n self.buffer += self.decoder.decode(data, {stream: true});\n }\n\n function collectNextLine() {\n var buffer = self.buffer;\n var pos = 0;\n while (pos < buffer.length && buffer[pos] !== '\\r' && buffer[pos] !== '\\n') {\n ++pos;\n }\n var line = buffer.substr(0, pos);\n // Advance the buffer early in case we fail below.\n if (buffer[pos] === '\\r') {\n ++pos;\n }\n if (buffer[pos] === '\\n') {\n ++pos;\n }\n self.buffer = buffer.substr(pos);\n return line;\n }\n\n // 3.4 WebVTT region and WebVTT region settings syntax\n function parseRegion(input) {\n var settings = new Settings();\n\n parseOptions(input, function (k, v) {\n switch (k) {\n case \"id\":\n settings.set(k, v);\n break;\n case \"width\":\n settings.percent(k, v);\n break;\n case \"lines\":\n settings.integer(k, v);\n break;\n case \"regionanchor\":\n case \"viewportanchor\":\n var xy = v.split(',');\n if (xy.length !== 2) {\n break;\n }\n // We have to make sure both x and y parse, so use a temporary\n // settings object here.\n var anchor = new Settings();\n anchor.percent(\"x\", xy[0]);\n anchor.percent(\"y\", xy[1]);\n if (!anchor.has(\"x\") || !anchor.has(\"y\")) {\n break;\n }\n settings.set(k + \"X\", anchor.get(\"x\"));\n settings.set(k + \"Y\", anchor.get(\"y\"));\n break;\n case \"scroll\":\n settings.alt(k, v, [\"up\"]);\n break;\n }\n }, /=/, /\\s/);\n\n // Create the region, using default values for any values that were not\n // specified.\n if (settings.has(\"id\")) {\n var region = new (self.vttjs.VTTRegion || self.window.VTTRegion)();\n region.width = settings.get(\"width\", 100);\n region.lines = settings.get(\"lines\", 3);\n region.regionAnchorX = settings.get(\"regionanchorX\", 0);\n region.regionAnchorY = settings.get(\"regionanchorY\", 100);\n region.viewportAnchorX = settings.get(\"viewportanchorX\", 0);\n region.viewportAnchorY = settings.get(\"viewportanchorY\", 100);\n region.scroll = settings.get(\"scroll\", \"\");\n // Register the region.\n self.onregion && self.onregion(region);\n // Remember the VTTRegion for later in case we parse any VTTCues that\n // reference it.\n self.regionList.push({\n id: settings.get(\"id\"),\n region: region\n });\n }\n }\n\n // draft-pantos-http-live-streaming-20\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-20#section-3.5\n // 3.5 WebVTT\n function parseTimestampMap(input) {\n var settings = new Settings();\n\n parseOptions(input, function(k, v) {\n switch(k) {\n case \"MPEGT\":\n settings.integer(k + 'S', v);\n break;\n case \"LOCA\":\n settings.set(k + 'L', parseTimeStamp(v));\n break;\n }\n }, /[^\\d]:/, /,/);\n\n self.ontimestampmap && self.ontimestampmap({\n \"MPEGTS\": settings.get(\"MPEGTS\"),\n \"LOCAL\": settings.get(\"LOCAL\")\n });\n }\n\n // 3.2 WebVTT metadata header syntax\n function parseHeader(input) {\n if (input.match(/X-TIMESTAMP-MAP/)) {\n // This line contains HLS X-TIMESTAMP-MAP metadata\n parseOptions(input, function(k, v) {\n switch(k) {\n case \"X-TIMESTAMP-MAP\":\n parseTimestampMap(v);\n break;\n }\n }, /=/);\n } else {\n parseOptions(input, function (k, v) {\n switch (k) {\n case \"Region\":\n // 3.3 WebVTT region metadata header syntax\n parseRegion(v);\n break;\n }\n }, /:/);\n }\n\n }\n\n // 5.1 WebVTT file parsing.\n try {\n var line;\n if (self.state === \"INITIAL\") {\n // We can't start parsing until we have the first line.\n if (!/\\r\\n|\\n/.test(self.buffer)) {\n return this;\n }\n\n line = collectNextLine();\n\n var m = line.match(/^WEBVTT([ \\t].*)?$/);\n if (!m || !m[0]) {\n throw new ParsingError(ParsingError.Errors.BadSignature);\n }\n\n self.state = \"HEADER\";\n }\n\n var alreadyCollectedLine = false;\n while (self.buffer) {\n // We can't parse a line until we have the full line.\n if (!/\\r\\n|\\n/.test(self.buffer)) {\n return this;\n }\n\n if (!alreadyCollectedLine) {\n line = collectNextLine();\n } else {\n alreadyCollectedLine = false;\n }\n\n switch (self.state) {\n case \"HEADER\":\n // 13-18 - Allow a header (metadata) under the WEBVTT line.\n if (/:/.test(line)) {\n parseHeader(line);\n } else if (!line) {\n // An empty line terminates the header and starts the body (cues).\n self.state = \"ID\";\n }\n continue;\n case \"NOTE\":\n // Ignore NOTE blocks.\n if (!line) {\n self.state = \"ID\";\n }\n continue;\n case \"ID\":\n // Check for the start of NOTE blocks.\n if (/^NOTE($|[ \\t])/.test(line)) {\n self.state = \"NOTE\";\n break;\n }\n // 19-29 - Allow any number of line terminators, then initialize new cue values.\n if (!line) {\n continue;\n }\n self.cue = new (self.vttjs.VTTCue || self.window.VTTCue)(0, 0, \"\");\n // Safari still uses the old middle value and won't accept center\n try {\n self.cue.align = \"center\";\n } catch (e) {\n self.cue.align = \"middle\";\n }\n self.state = \"CUE\";\n // 30-39 - Check if self line contains an optional identifier or timing data.\n if (line.indexOf(\"-->\") === -1) {\n self.cue.id = line;\n continue;\n }\n // Process line as start of a cue.\n /*falls through*/\n case \"CUE\":\n // 40 - Collect cue timings and settings.\n try {\n parseCue(line, self.cue, self.regionList);\n } catch (e) {\n self.reportOrThrowError(e);\n // In case of an error ignore rest of the cue.\n self.cue = null;\n self.state = \"BADCUE\";\n continue;\n }\n self.state = \"CUETEXT\";\n continue;\n case \"CUETEXT\":\n var hasSubstring = line.indexOf(\"-->\") !== -1;\n // 34 - If we have an empty line then report the cue.\n // 35 - If we have the special substring '-->' then report the cue,\n // but do not collect the line as we need to process the current\n // one as a new cue.\n if (!line || hasSubstring && (alreadyCollectedLine = true)) {\n // We are done parsing self cue.\n self.oncue && self.oncue(self.cue);\n self.cue = null;\n self.state = \"ID\";\n continue;\n }\n if (self.cue.text) {\n self.cue.text += \"\\n\";\n }\n self.cue.text += line.replace(/\\u2028/g, '\\n').replace(/u2029/g, '\\n');\n continue;\n case \"BADCUE\": // BADCUE\n // 54-62 - Collect and discard the remaining cue.\n if (!line) {\n self.state = \"ID\";\n }\n continue;\n }\n }\n } catch (e) {\n self.reportOrThrowError(e);\n\n // If we are currently parsing a cue, report what we have.\n if (self.state === \"CUETEXT\" && self.cue && self.oncue) {\n self.oncue(self.cue);\n }\n self.cue = null;\n // Enter BADWEBVTT state if header was not parsed correctly otherwise\n // another exception occurred so enter BADCUE state.\n self.state = self.state === \"INITIAL\" ? \"BADWEBVTT\" : \"BADCUE\";\n }\n return this;\n },\n flush: function () {\n var self = this;\n try {\n // Finish decoding the stream.\n self.buffer += self.decoder.decode();\n // Synthesize the end of the current cue or region.\n if (self.cue || self.state === \"HEADER\") {\n self.buffer += \"\\n\\n\";\n self.parse();\n }\n // If we've flushed, parsed, and we're still on the INITIAL state then\n // that means we don't have enough of the stream to parse the first\n // line.\n if (self.state === \"INITIAL\") {\n throw new ParsingError(ParsingError.Errors.BadSignature);\n }\n } catch(e) {\n self.reportOrThrowError(e);\n }\n self.onflush && self.onflush();\n return this;\n }\n};\n\nmodule.exports = WebVTT;\n","/**\n * Copyright 2013 vtt.js Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nvar autoKeyword = \"auto\";\nvar directionSetting = {\n \"\": 1,\n \"lr\": 1,\n \"rl\": 1\n};\nvar alignSetting = {\n \"start\": 1,\n \"center\": 1,\n \"end\": 1,\n \"left\": 1,\n \"right\": 1,\n \"auto\": 1,\n \"line-left\": 1,\n \"line-right\": 1\n};\n\nfunction findDirectionSetting(value) {\n if (typeof value !== \"string\") {\n return false;\n }\n var dir = directionSetting[value.toLowerCase()];\n return dir ? value.toLowerCase() : false;\n}\n\nfunction findAlignSetting(value) {\n if (typeof value !== \"string\") {\n return false;\n }\n var align = alignSetting[value.toLowerCase()];\n return align ? value.toLowerCase() : false;\n}\n\nfunction VTTCue(startTime, endTime, text) {\n /**\n * Shim implementation specific properties. These properties are not in\n * the spec.\n */\n\n // Lets us know when the VTTCue's data has changed in such a way that we need\n // to recompute its display state. This lets us compute its display state\n // lazily.\n this.hasBeenReset = false;\n\n /**\n * VTTCue and TextTrackCue properties\n * http://dev.w3.org/html5/webvtt/#vttcue-interface\n */\n\n var _id = \"\";\n var _pauseOnExit = false;\n var _startTime = startTime;\n var _endTime = endTime;\n var _text = text;\n var _region = null;\n var _vertical = \"\";\n var _snapToLines = true;\n var _line = \"auto\";\n var _lineAlign = \"start\";\n var _position = \"auto\";\n var _positionAlign = \"auto\";\n var _size = 100;\n var _align = \"center\";\n\n Object.defineProperties(this, {\n \"id\": {\n enumerable: true,\n get: function() {\n return _id;\n },\n set: function(value) {\n _id = \"\" + value;\n }\n },\n\n \"pauseOnExit\": {\n enumerable: true,\n get: function() {\n return _pauseOnExit;\n },\n set: function(value) {\n _pauseOnExit = !!value;\n }\n },\n\n \"startTime\": {\n enumerable: true,\n get: function() {\n return _startTime;\n },\n set: function(value) {\n if (typeof value !== \"number\") {\n throw new TypeError(\"Start time must be set to a number.\");\n }\n _startTime = value;\n this.hasBeenReset = true;\n }\n },\n\n \"endTime\": {\n enumerable: true,\n get: function() {\n return _endTime;\n },\n set: function(value) {\n if (typeof value !== \"number\") {\n throw new TypeError(\"End time must be set to a number.\");\n }\n _endTime = value;\n this.hasBeenReset = true;\n }\n },\n\n \"text\": {\n enumerable: true,\n get: function() {\n return _text;\n },\n set: function(value) {\n _text = \"\" + value;\n this.hasBeenReset = true;\n }\n },\n\n \"region\": {\n enumerable: true,\n get: function() {\n return _region;\n },\n set: function(value) {\n _region = value;\n this.hasBeenReset = true;\n }\n },\n\n \"vertical\": {\n enumerable: true,\n get: function() {\n return _vertical;\n },\n set: function(value) {\n var setting = findDirectionSetting(value);\n // Have to check for false because the setting an be an empty string.\n if (setting === false) {\n throw new SyntaxError(\"Vertical: an invalid or illegal direction string was specified.\");\n }\n _vertical = setting;\n this.hasBeenReset = true;\n }\n },\n\n \"snapToLines\": {\n enumerable: true,\n get: function() {\n return _snapToLines;\n },\n set: function(value) {\n _snapToLines = !!value;\n this.hasBeenReset = true;\n }\n },\n\n \"line\": {\n enumerable: true,\n get: function() {\n return _line;\n },\n set: function(value) {\n if (typeof value !== \"number\" && value !== autoKeyword) {\n throw new SyntaxError(\"Line: an invalid number or illegal string was specified.\");\n }\n _line = value;\n this.hasBeenReset = true;\n }\n },\n\n \"lineAlign\": {\n enumerable: true,\n get: function() {\n return _lineAlign;\n },\n set: function(value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n console.warn(\"lineAlign: an invalid or illegal string was specified.\");\n } else {\n _lineAlign = setting;\n this.hasBeenReset = true;\n }\n }\n },\n\n \"position\": {\n enumerable: true,\n get: function() {\n return _position;\n },\n set: function(value) {\n if (value < 0 || value > 100) {\n throw new Error(\"Position must be between 0 and 100.\");\n }\n _position = value;\n this.hasBeenReset = true;\n }\n },\n\n \"positionAlign\": {\n enumerable: true,\n get: function() {\n return _positionAlign;\n },\n set: function(value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n console.warn(\"positionAlign: an invalid or illegal string was specified.\");\n } else {\n _positionAlign = setting;\n this.hasBeenReset = true;\n }\n }\n },\n\n \"size\": {\n enumerable: true,\n get: function() {\n return _size;\n },\n set: function(value) {\n if (value < 0 || value > 100) {\n throw new Error(\"Size must be between 0 and 100.\");\n }\n _size = value;\n this.hasBeenReset = true;\n }\n },\n\n \"align\": {\n enumerable: true,\n get: function() {\n return _align;\n },\n set: function(value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n throw new SyntaxError(\"align: an invalid or illegal alignment string was specified.\");\n }\n _align = setting;\n this.hasBeenReset = true;\n }\n }\n });\n\n /**\n * Other spec defined properties\n */\n\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#text-track-cue-display-state\n this.displayState = undefined;\n}\n\n/**\n * VTTCue methods\n */\n\nVTTCue.prototype.getCueAsHTML = function() {\n // Assume WebVTT.convertCueToDOMTree is on the global.\n return WebVTT.convertCueToDOMTree(window, this.text);\n};\n\nmodule.exports = VTTCue;\n","/**\n * Copyright 2013 vtt.js Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nvar scrollSetting = {\n \"\": true,\n \"up\": true\n};\n\nfunction findScrollSetting(value) {\n if (typeof value !== \"string\") {\n return false;\n }\n var scroll = scrollSetting[value.toLowerCase()];\n return scroll ? value.toLowerCase() : false;\n}\n\nfunction isValidPercentValue(value) {\n return typeof value === \"number\" && (value >= 0 && value <= 100);\n}\n\n// VTTRegion shim http://dev.w3.org/html5/webvtt/#vttregion-interface\nfunction VTTRegion() {\n var _width = 100;\n var _lines = 3;\n var _regionAnchorX = 0;\n var _regionAnchorY = 100;\n var _viewportAnchorX = 0;\n var _viewportAnchorY = 100;\n var _scroll = \"\";\n\n Object.defineProperties(this, {\n \"width\": {\n enumerable: true,\n get: function() {\n return _width;\n },\n set: function(value) {\n if (!isValidPercentValue(value)) {\n throw new Error(\"Width must be between 0 and 100.\");\n }\n _width = value;\n }\n },\n \"lines\": {\n enumerable: true,\n get: function() {\n return _lines;\n },\n set: function(value) {\n if (typeof value !== \"number\") {\n throw new TypeError(\"Lines must be set to a number.\");\n }\n _lines = value;\n }\n },\n \"regionAnchorY\": {\n enumerable: true,\n get: function() {\n return _regionAnchorY;\n },\n set: function(value) {\n if (!isValidPercentValue(value)) {\n throw new Error(\"RegionAnchorX must be between 0 and 100.\");\n }\n _regionAnchorY = value;\n }\n },\n \"regionAnchorX\": {\n enumerable: true,\n get: function() {\n return _regionAnchorX;\n },\n set: function(value) {\n if(!isValidPercentValue(value)) {\n throw new Error(\"RegionAnchorY must be between 0 and 100.\");\n }\n _regionAnchorX = value;\n }\n },\n \"viewportAnchorY\": {\n enumerable: true,\n get: function() {\n return _viewportAnchorY;\n },\n set: function(value) {\n if (!isValidPercentValue(value)) {\n throw new Error(\"ViewportAnchorY must be between 0 and 100.\");\n }\n _viewportAnchorY = value;\n }\n },\n \"viewportAnchorX\": {\n enumerable: true,\n get: function() {\n return _viewportAnchorX;\n },\n set: function(value) {\n if (!isValidPercentValue(value)) {\n throw new Error(\"ViewportAnchorX must be between 0 and 100.\");\n }\n _viewportAnchorX = value;\n }\n },\n \"scroll\": {\n enumerable: true,\n get: function() {\n return _scroll;\n },\n set: function(value) {\n var setting = findScrollSetting(value);\n // Have to check for false as an empty string is a legal value.\n if (setting === false) {\n console.warn(\"Scroll: an invalid or illegal string was specified.\");\n } else {\n _scroll = setting;\n }\n }\n }\n });\n}\n\nmodule.exports = VTTRegion;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","__webpack_require__.amdO = {};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = function(chunkId) {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce(function(promises, key) {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = function(chunkId) {\n\t// return url for filenames based on template\n\treturn \"assets/js/\" + {\"265\":\"canvg\",\"297\":\"xlsx\",\"643\":\"pdfmake\"}[chunkId] + \".js\";\n};","// This function allow to reference all chunks\n__webpack_require__.miniCssF = function(chunkId) {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.hmd = function(module) {\n\tmodule = Object.create(module);\n\tif (!module.children) module.children = [];\n\tObject.defineProperty(module, 'exports', {\n\t\tenumerable: true,\n\t\tset: function() {\n\t\t\tthrow new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);\n\t\t}\n\t});\n\treturn module;\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl + \"../../\";","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t179: 0\n};\n\n__webpack_require__.f.j = function(chunkId, promises) {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise(function(resolve, reject) { installedChunkData = installedChunks[chunkId] = [resolve, reject]; });\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = function(event) {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\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__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tfor(moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkIds[i]] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkblueprint_webpack_boilerplate\"] = self[\"webpackChunkblueprint_webpack_boilerplate\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","/**\r\n * Apply Form Module\r\n *\r\n * @file applyForm.js\r\n */\r\nimport $ from 'jquery';\r\nconst applyForm = (() => {\r\n /**\r\n *\r\n * @param {string} name\r\n */\r\n const getData = (name) => {\r\n const data = name;\r\n return data;\r\n };\r\n\r\n const formValidate = () => {\r\n $(\"#login-form\").validate();\r\n };\r\n\r\n const activationForm = () => {\r\n var multipleNumber = $(\".multiple-number\");\r\n if (multipleNumber.is(\":visible\")){\r\n $('form').on('input', e => {\r\n var letters = ['in-nm-a', 'in-nm-b', 'in-nm-c', 'in-nm-d', 'in-nm-e'];\r\n letters.forEach(letter => {\r\n let field = $(e.target);\r\n field.val(field.val().replace(/[^0-9]/g, ''));\r\n if(field.val().length == field.attr('maxlength')) { field.nextAll('input').first().focus(); }\r\n });\r\n });\r\n }\r\n\r\n\r\n\r\n // var countdownSeconds = 240; \r\n // if (document.getElementById('countdown')) {\r\n \r\n // var countdownInterval = setInterval(function() {\r\n // countdownSeconds--;\r\n // document.getElementById('countdown').innerHTML = countdownSeconds + 's';\r\n // if (countdownSeconds <= 0) {\r\n // clearInterval(countdownInterval);\r\n // $(\".multiple-number\").addClass(\"error\");\r\n // // document.getElementById('countdown').innerHTML = 'Countdown Expired';\r\n // }\r\n // }, 1000);\r\n // }\r\n };\r\n\r\n const modalLs = () => {\r\n var mdModalOpenBtn = document.querySelector('.open-md-modal');\r\n var mdModalCloseBtn = $('.md-modal-close, .md-modal-bg');\r\n if(mdModalOpenBtn){\r\n mdModalOpenBtn.addEventListener(\"click\", function(e) {\r\n var modalMdL = $(e.target.hash);\r\n modalMdL.addClass(\"show-md-modal\");\r\n $(\"body\").addClass(\"hidden\");\r\n e.preventDefault();\r\n });\r\n\r\n mdModalCloseBtn.on(\"click\", function(e) {\r\n $(this).parents(\".md-modal\").removeClass(\"show-md-modal\");\r\n $(\"body\").removeClass(\"hidden\");\r\n });\r\n }\r\n\r\n };\r\n\r\n const mobileFilter = () => {\r\n // var mdFilterOpenBtn = $('.filter-title');\r\n // var mdFilterCloseBtn = $('.mobile-filter-close');\r\n // if(mdFilterOpenBtn){\r\n // mdFilterOpenBtn.on(\"click\", function(e) {\r\n // $(\".filter-select-container\").addClass(\"show-filter\");\r\n // $(\".left-select-menu\").addClass(\"show-filter-content\");\r\n // $(\"body\").addClass(\"hidden\");\r\n // });\r\n\r\n // mdFilterCloseBtn.on(\"click\", function(e) {\r\n // $(\".filter-select-container\").removeClass(\"show-filter\");\r\n // $(\".left-select-menu\").addClass(\"show-filter-content\");\r\n // $(\"body\").removeClass(\"hidden\");\r\n // });\r\n // }\r\n };\r\n\r\n const userMobileMenu = () => {\r\n $(\".mobile-user-left-menu\").on(\"click\", function(){\r\n $(\".user-left-menu nav\").toggle();\r\n });\r\n };\r\n\r\n const userFileCustomName = () => {\r\n var inputFileItem = $(\".custom-file-inp input[type='file']\");\r\n inputFileItem.on(\"change\", function(){\r\n var $thisFileName = $(this)[0].files[0].name;\r\n $(this).parent(\".custom-file-inp\").find(\"span\").html($thisFileName);\r\n })\r\n };\r\n\r\n const userModal = () => {\r\n var usModalOpenBtn = $('.us-modal-open');\r\n var usModalCloseBtn = $('.us-modal-backdrop, .us-modal-cancel, .us-modal-close');\r\n if(usModalOpenBtn){\r\n usModalOpenBtn.on(\"click\", function(e) {\r\n $(\".us-modal\"+$(this).attr(\"data-modal\")).addClass(\"show-modal\");\r\n $(\"body\").addClass(\"hidden\");\r\n });\r\n\r\n usModalCloseBtn.on(\"click\", function(e) {\r\n $(\".us-modal\").removeClass(\"show-modal\");\r\n $(\"body\").removeClass(\"hidden\");\r\n });\r\n }\r\n };\r\n\r\n const positionInputFilter = () => {\r\n // document.addEventListener('DOMContentLoaded', function () {\r\n // var searchInputs = document.querySelectorAll('.filter-select .col-list .col-search input');\r\n // var itemContainers = document.querySelectorAll('.filter-select .col-list .check-list');\r\n // var closeIcons = document.querySelectorAll('.col-search svg');\r\n\r\n // // SVG öğelerine tıklama olayını ekleyin\r\n // closeIcons.forEach(function (icon) {\r\n // icon.addEventListener('click', function () {\r\n // // İlgili SVG'ye tıklandığında, ilişkili input alanlarını temizleyin\r\n // console.log(\"asd\");\r\n // var parentFilter = icon.closest('.col-search');\r\n // var inputFields = parentFilter.querySelectorAll('.col-search input[type=\"text\"]');\r\n \r\n // inputFields.forEach(function (input) {\r\n // input.value = ''; // Input alanını temizle\r\n // });\r\n // filterItems();\r\n // });\r\n // });\r\n \r\n // searchInputs.forEach(function (searchInput) {\r\n // searchInput.addEventListener('input', function () {\r\n // filterItems();\r\n // });\r\n // });\r\n \r\n // function normalizeText(text) {\r\n // // Türkçe karakterleri düzeltme\r\n // var normalizedText = text\r\n // .replace(/Ğ/g, 'g')\r\n // .replace(/Ü/g, 'u')\r\n // .replace(/Ş/g, 's')\r\n // .replace(/I/g, 'i')\r\n // .replace(/İ/g, 'i')\r\n // .replace(/Ö/g, 'o')\r\n // .replace(/Ç/g, 'c')\r\n // .replace(/ğ/g, 'g')\r\n // .replace(/ü/g, 'u')\r\n // .replace(/ş/g, 's')\r\n // .replace(/ı/g, 'i')\r\n // .replace(/i/g, 'i')\r\n // .replace(/ö/g, 'o')\r\n // .replace(/ç/g, 'c');\r\n // return normalizedText.toLowerCase();\r\n // }\r\n \r\n // function filterItems() {\r\n // itemContainers.forEach(function (itemContainer) {\r\n // var searchInputsInContainer = itemContainer.parentElement.querySelectorAll('.col-search input');\r\n // var searchValues = Array.from(searchInputsInContainer).map(function (input) {\r\n // return normalizeText(input.value);\r\n // });\r\n \r\n // var checkboxes = itemContainer.querySelectorAll('.custom-check input');\r\n // var selectedCheckboxes = Array.from(checkboxes).filter(function (checkbox) {\r\n // return checkbox.checked;\r\n // }).map(function (checkbox) {\r\n // return normalizeText(checkbox.value);\r\n // });\r\n \r\n // itemContainer.querySelectorAll('.custom-check').forEach(function (item) {\r\n // var itemName = normalizeText(item.querySelector('.nm').textContent);\r\n // var checkboxValue = normalizeText(item.querySelector('input').value);\r\n \r\n // var searchFilter = searchValues.length === 0 || searchValues.every(function (searchValue) {\r\n // return itemName.includes(searchValue) || checkboxValue.includes(searchValue);\r\n // });\r\n \r\n // var checkboxFilter = selectedCheckboxes.length === 0 || selectedCheckboxes.includes(checkboxValue);\r\n \r\n // if (searchFilter && checkboxFilter) {\r\n // item.style.display = 'flex';\r\n // } else {\r\n // item.style.display = 'none';\r\n // }\r\n // });\r\n // });\r\n // }\r\n // });\r\n };\r\n\r\n /**\r\n * init module\r\n */\r\n const init = () => {\r\n getData('data');\r\n activationForm();\r\n modalLs();\r\n mobileFilter();\r\n userModal();\r\n userMobileMenu();\r\n userFileCustomName();\r\n positionInputFilter();\r\n };\r\n\r\n return {\r\n init,\r\n };\r\n})();\r\n\r\nexport default applyForm;\r\n","/**\r\n * Header Layout\r\n *\r\n * @file header.js\r\n */\r\n\r\nimport $ from 'jquery';\r\n\r\nconst header = (() => {\r\n\r\n const fixedHeader = () => {\r\n var offset = $(\"header\").offset();\r\n checkOffset();\r\n\r\n $(window).scroll(function() {\r\n checkOffset();\r\n });\r\n\r\n function checkOffset() {\r\n if ( $(window).scrollTop() >= 20){\r\n $('header').addClass('fixed_header');\r\n } else {\r\n $('header').removeClass('fixed_header');\r\n } \r\n }\r\n };\r\n\r\n const fullMenu = () => {\r\n $(\".header-menu .main-nav__item,.header-mt > .header-right .apply-now, .header-mt > .header-right .lang\").hover(function(){\r\n $(\"header\").addClass(\"show-menu\");\r\n }, function(){\r\n $(\"header\").removeClass(\"show-menu\");\r\n })\r\n };\r\n\r\n const mobileMenu = () => {\r\n $(\".mobile-menu-arrow\").on(\"click\", function(){\r\n $(this).toggleClass(\"active\");\r\n $(\".mobile-menu-toggle\").toggleClass(\"active\");\r\n $(\"body\").toggleClass(\"hidden\");\r\n });\r\n };\r\n\r\n const mobileDetailMenu = () => {\r\n window.addEventListener('load', function() {\r\n const banner = document.querySelector('.detail-banner');\r\n if(banner){\r\n \r\n if(banner.hasAttribute('mobile-banner')){\r\n // Eğer mobile-banner attribute'si varsa ve ekran genişliği 768px'den küçükse\r\n if (banner.hasAttribute('mobile-banner') && window.innerWidth <= 768) {\r\n const mobileBannerUrl = banner.getAttribute('mobile-banner');\r\n if (mobileBannerUrl) {\r\n banner.style.backgroundImage = `url(${mobileBannerUrl})`;\r\n }\r\n }\r\n }\r\n }\r\n });\r\n \r\n // Ekran boyutu değiştiğinde yeniden kontrol et\r\n window.addEventListener('resize', function() {\r\n const banner = document.querySelector('.detail-banner');\r\n if(banner){\r\n \r\n if(banner.hasAttribute('mobile-banner')){\r\n // Eğer mobile-banner attribute'si varsa ve ekran genişliği 768px'den küçükse\r\n if (banner.hasAttribute('mobile-banner') && window.innerWidth <= 768) {\r\n const mobileBannerUrl = banner.getAttribute('mobile-banner');\r\n if (mobileBannerUrl) {\r\n banner.style.backgroundImage = `url(${mobileBannerUrl})`;\r\n }\r\n }\r\n }\r\n }\r\n });\r\n };\r\n \r\n\r\n const init = () => {\r\n fixedHeader();\r\n fullMenu();\r\n mobileMenu();\r\n mobileDetailMenu();\r\n };\r\n\r\n return {\r\n init,\r\n };\r\n})();\r\n\r\nexport default header;\r\n","/**\r\n * Menu Componenets\r\n *\r\n * @file menu.js\r\n */\r\n\r\nimport $ from 'jquery';\r\n\r\nconst menu = (() => {\r\n // Services Page Project List\r\n const mobileFooterMenu = () => {\r\n $(\".footer-m-select\").each(function(){\r\n $(this).on(\"change\", function(){\r\n window.open($(this).val(),\"_self\");\r\n })\r\n });\r\n };\r\n\r\n const profileLeftMenuBar = () => {\r\n document.querySelectorAll('.profile-slide').forEach((slide) => {\r\n const dataWidth = parseFloat(slide.getAttribute('data-width')) || 0;\r\n \r\n if (dataWidth > 0.99) {\r\n slide.classList.add('green'); // %1'in üstündeyse \"green\" class'ı eklenir.\r\n } else {\r\n slide.classList.remove('green'); // %1'in altındaysa \"green\" class'ı kaldırılır.\r\n }\r\n });\r\n };\r\n\r\n const init = () => {\r\n mobileFooterMenu();\r\n profileLeftMenuBar();\r\n };\r\n\r\n return {\r\n init,\r\n };\r\n})();\r\n\r\nexport default menu;\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(' 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 { 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 { 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 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) {\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 } 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 { getWindow, getDocument } from 'ssr-window';\nimport $ from '../../../utils/dom';\nimport { extend, now } from '../../../utils/utils';\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 componenet\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 if (params.noSwiping && $targetEl.closest(params.noSwipingSelector ? params.noSwipingSelector : \".\" + params.noSwipingClass)[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.formElements)) preventDefault = false;\n\n if (document.activeElement && $(document.activeElement).is(data.formElements) && 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.formElements)) {\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};","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 // 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 formElements: 'input, select, option, textarea, button, video, label',\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 getWrapper = function getWrapper() {\n if (el && el.shadowRoot && el.shadowRoot.querySelector) {\n var res = $(el.shadowRoot.querySelector(\".\" + swiper.params.wrapperClass)); // 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(\".\" + swiper.params.wrapperClass);\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;","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 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 { 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 marginTop: ''\n });else slides.css({\n marginRight: '',\n marginBottom: ''\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 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};","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 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 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 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};","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 currentSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate)];\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 loopCreate from './loopCreate';\nimport loopFix from './loopFix';\nimport loopDestroy from './loopDestroy';\nexport default {\n loopCreate: loopCreate,\n loopFix: loopFix,\n loopDestroy: loopDestroy\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 setGrabCursor from './setGrabCursor';\nimport unsetGrabCursor from './unsetGrabCursor';\nexport default {\n setGrabCursor: setGrabCursor,\n unsetGrabCursor: unsetGrabCursor\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 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};","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 setBreakpoint from './setBreakpoint';\nimport getBreakpoint from './getBreakpoint';\nexport default {\n setBreakpoint: setBreakpoint,\n getBreakpoint: getBreakpoint\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 === '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 currentWidth = base === 'window' ? window.innerWidth : containerEl.clientWidth;\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 (value <= currentWidth) {\n breakpoint = point;\n }\n }\n\n return breakpoint || 'max';\n}","import addClasses from './addClasses';\nimport removeClasses from './removeClasses';\nexport default {\n addClasses: addClasses,\n removeClasses: removeClasses\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 loadImage from './loadImage';\nimport preloadImages from './preloadImages';\nexport default {\n loadImage: loadImage,\n preloadImages: preloadImages\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}","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 + \"\\\">\";\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 = \"\" + ' / ' + (\"\");\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 = \"\";\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};","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\n/* eslint no-underscore-dangle: \"off\" */\nimport { getDocument } from 'ssr-window';\nimport { nextTick, bindModuleMethods } from '../../utils/utils';\nvar Autoplay = {\n run: function run() {\n var swiper = this;\n var $activeSlideEl = swiper.slides.eq(swiper.activeIndex);\n var delay = swiper.params.autoplay.delay;\n\n if ($activeSlideEl.attr('data-swiper-autoplay')) {\n delay = $activeSlideEl.attr('data-swiper-autoplay') || swiper.params.autoplay.delay;\n }\n\n clearTimeout(swiper.autoplay.timeout);\n swiper.autoplay.timeout = nextTick(function () {\n var autoplayResult;\n\n if (swiper.params.autoplay.reverseDirection) {\n if (swiper.params.loop) {\n swiper.loopFix();\n autoplayResult = swiper.slidePrev(swiper.params.speed, true, true);\n swiper.emit('autoplay');\n } else if (!swiper.isBeginning) {\n autoplayResult = swiper.slidePrev(swiper.params.speed, true, true);\n swiper.emit('autoplay');\n } else if (!swiper.params.autoplay.stopOnLastSlide) {\n autoplayResult = swiper.slideTo(swiper.slides.length - 1, swiper.params.speed, true, true);\n swiper.emit('autoplay');\n } else {\n swiper.autoplay.stop();\n }\n } else if (swiper.params.loop) {\n swiper.loopFix();\n autoplayResult = swiper.slideNext(swiper.params.speed, true, true);\n swiper.emit('autoplay');\n } else if (!swiper.isEnd) {\n autoplayResult = swiper.slideNext(swiper.params.speed, true, true);\n swiper.emit('autoplay');\n } else if (!swiper.params.autoplay.stopOnLastSlide) {\n autoplayResult = swiper.slideTo(0, swiper.params.speed, true, true);\n swiper.emit('autoplay');\n } else {\n swiper.autoplay.stop();\n }\n\n if (swiper.params.cssMode && swiper.autoplay.running) swiper.autoplay.run();else if (autoplayResult === false) {\n swiper.autoplay.run();\n }\n }, delay);\n },\n start: function start() {\n var swiper = this;\n if (typeof swiper.autoplay.timeout !== 'undefined') return false;\n if (swiper.autoplay.running) return false;\n swiper.autoplay.running = true;\n swiper.emit('autoplayStart');\n swiper.autoplay.run();\n return true;\n },\n stop: function stop() {\n var swiper = this;\n if (!swiper.autoplay.running) return false;\n if (typeof swiper.autoplay.timeout === 'undefined') return false;\n\n if (swiper.autoplay.timeout) {\n clearTimeout(swiper.autoplay.timeout);\n swiper.autoplay.timeout = undefined;\n }\n\n swiper.autoplay.running = false;\n swiper.emit('autoplayStop');\n return true;\n },\n pause: function pause(speed) {\n var swiper = this;\n if (!swiper.autoplay.running) return;\n if (swiper.autoplay.paused) return;\n if (swiper.autoplay.timeout) clearTimeout(swiper.autoplay.timeout);\n swiper.autoplay.paused = true;\n\n if (speed === 0 || !swiper.params.autoplay.waitForTransition) {\n swiper.autoplay.paused = false;\n swiper.autoplay.run();\n } else {\n ['transitionend', 'webkitTransitionEnd'].forEach(function (event) {\n swiper.$wrapperEl[0].addEventListener(event, swiper.autoplay.onTransitionEnd);\n });\n }\n },\n onVisibilityChange: function onVisibilityChange() {\n var swiper = this;\n var document = getDocument();\n\n if (document.visibilityState === 'hidden' && swiper.autoplay.running) {\n swiper.autoplay.pause();\n }\n\n if (document.visibilityState === 'visible' && swiper.autoplay.paused) {\n swiper.autoplay.run();\n swiper.autoplay.paused = false;\n }\n },\n onTransitionEnd: function onTransitionEnd(e) {\n var swiper = this;\n if (!swiper || swiper.destroyed || !swiper.$wrapperEl) return;\n if (e.target !== swiper.$wrapperEl[0]) return;\n ['transitionend', 'webkitTransitionEnd'].forEach(function (event) {\n swiper.$wrapperEl[0].removeEventListener(event, swiper.autoplay.onTransitionEnd);\n });\n swiper.autoplay.paused = false;\n\n if (!swiper.autoplay.running) {\n swiper.autoplay.stop();\n } else {\n swiper.autoplay.run();\n }\n },\n onMouseEnter: function onMouseEnter() {\n var swiper = this;\n\n if (swiper.params.autoplay.disableOnInteraction) {\n swiper.autoplay.stop();\n } else {\n swiper.autoplay.pause();\n }\n\n ['transitionend', 'webkitTransitionEnd'].forEach(function (event) {\n swiper.$wrapperEl[0].removeEventListener(event, swiper.autoplay.onTransitionEnd);\n });\n },\n onMouseLeave: function onMouseLeave() {\n var swiper = this;\n\n if (swiper.params.autoplay.disableOnInteraction) {\n return;\n }\n\n swiper.autoplay.paused = false;\n swiper.autoplay.run();\n },\n attachMouseEvents: function attachMouseEvents() {\n var swiper = this;\n\n if (swiper.params.autoplay.pauseOnMouseEnter) {\n swiper.$el.on('mouseenter', swiper.autoplay.onMouseEnter);\n swiper.$el.on('mouseleave', swiper.autoplay.onMouseLeave);\n }\n },\n detachMouseEvents: function detachMouseEvents() {\n var swiper = this;\n swiper.$el.off('mouseenter', swiper.autoplay.onMouseEnter);\n swiper.$el.off('mouseleave', swiper.autoplay.onMouseLeave);\n }\n};\nexport default {\n name: 'autoplay',\n params: {\n autoplay: {\n enabled: false,\n delay: 3000,\n waitForTransition: true,\n disableOnInteraction: true,\n stopOnLastSlide: false,\n reverseDirection: false,\n pauseOnMouseEnter: false\n }\n },\n create: function create() {\n var swiper = this;\n bindModuleMethods(swiper, {\n autoplay: _extends({}, Autoplay, {\n running: false,\n paused: false\n })\n });\n },\n on: {\n init: function init(swiper) {\n if (swiper.params.autoplay.enabled) {\n swiper.autoplay.start();\n var document = getDocument();\n document.addEventListener('visibilitychange', swiper.autoplay.onVisibilityChange);\n swiper.autoplay.attachMouseEvents();\n }\n },\n beforeTransitionStart: function beforeTransitionStart(swiper, speed, internal) {\n if (swiper.autoplay.running) {\n if (internal || !swiper.params.autoplay.disableOnInteraction) {\n swiper.autoplay.pause(speed);\n } else {\n swiper.autoplay.stop();\n }\n }\n },\n sliderFirstMove: function sliderFirstMove(swiper) {\n if (swiper.autoplay.running) {\n if (swiper.params.autoplay.disableOnInteraction) {\n swiper.autoplay.stop();\n } else {\n swiper.autoplay.pause();\n }\n }\n },\n touchEnd: function touchEnd(swiper) {\n if (swiper.params.cssMode && swiper.autoplay.paused && !swiper.params.autoplay.disableOnInteraction) {\n swiper.autoplay.run();\n }\n },\n destroy: function destroy(swiper) {\n swiper.autoplay.detachMouseEvents();\n\n if (swiper.autoplay.running) {\n swiper.autoplay.stop();\n }\n\n var document = getDocument();\n document.removeEventListener('visibilitychange', swiper.autoplay.onVisibilityChange);\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 { extend, bindModuleMethods } from '../../utils/utils';\nvar Fade = {\n setTranslate: function setTranslate() {\n var swiper = this;\n var slides = swiper.slides;\n\n for (var i = 0; i < slides.length; i += 1) {\n var $slideEl = swiper.slides.eq(i);\n var offset = $slideEl[0].swiperSlideOffset;\n var tx = -offset;\n if (!swiper.params.virtualTranslate) tx -= swiper.translate;\n var ty = 0;\n\n if (!swiper.isHorizontal()) {\n ty = tx;\n tx = 0;\n }\n\n var slideOpacity = swiper.params.fadeEffect.crossFade ? Math.max(1 - Math.abs($slideEl[0].progress), 0) : 1 + Math.min(Math.max($slideEl[0].progress, -1), 0);\n $slideEl.css({\n opacity: slideOpacity\n }).transform(\"translate3d(\" + tx + \"px, \" + ty + \"px, 0px)\");\n }\n },\n setTransition: function setTransition(duration) {\n var swiper = this;\n var slides = swiper.slides,\n $wrapperEl = swiper.$wrapperEl;\n slides.transition(duration);\n\n if (swiper.params.virtualTranslate && duration !== 0) {\n var eventTriggered = false;\n slides.transitionEnd(function () {\n if (eventTriggered) return;\n if (!swiper || swiper.destroyed) return;\n eventTriggered = true;\n swiper.animating = false;\n var triggerEvents = ['webkitTransitionEnd', 'transitionend'];\n\n for (var i = 0; i < triggerEvents.length; i += 1) {\n $wrapperEl.trigger(triggerEvents[i]);\n }\n });\n }\n }\n};\nexport default {\n name: 'effect-fade',\n params: {\n fadeEffect: {\n crossFade: false\n }\n },\n create: function create() {\n var swiper = this;\n bindModuleMethods(swiper, {\n fadeEffect: _extends({}, Fade)\n });\n },\n on: {\n beforeInit: function beforeInit(swiper) {\n if (swiper.params.effect !== 'fade') return;\n swiper.classNames.push(swiper.params.containerModifierClass + \"fade\");\n var overwriteParams = {\n slidesPerView: 1,\n slidesPerColumn: 1,\n slidesPerGroup: 1,\n watchSlidesProgress: true,\n spaceBetween: 0,\n virtualTranslate: true\n };\n extend(swiper.params, overwriteParams);\n extend(swiper.originalParams, overwriteParams);\n },\n setTranslate: function setTranslate(swiper) {\n if (swiper.params.effect !== 'fade') return;\n swiper.fadeEffect.setTranslate();\n },\n setTransition: function setTransition(swiper, duration) {\n if (swiper.params.effect !== 'fade') return;\n swiper.fadeEffect.setTransition(duration);\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\n/* eslint no-bitwise: [\"error\", { \"allow\": [\">>\"] }] */\nimport { nextTick, bindModuleMethods } from '../../utils/utils';\nvar Controller = {\n LinearSpline: function LinearSpline(x, y) {\n var binarySearch = function search() {\n var maxIndex;\n var minIndex;\n var guess;\n return function (array, val) {\n minIndex = -1;\n maxIndex = array.length;\n\n while (maxIndex - minIndex > 1) {\n guess = maxIndex + minIndex >> 1;\n\n if (array[guess] <= val) {\n minIndex = guess;\n } else {\n maxIndex = guess;\n }\n }\n\n return maxIndex;\n };\n }();\n\n this.x = x;\n this.y = y;\n this.lastIndex = x.length - 1; // Given an x value (x2), return the expected y2 value:\n // (x1,y1) is the known point before given value,\n // (x3,y3) is the known point after given value.\n\n var i1;\n var i3;\n\n this.interpolate = function interpolate(x2) {\n if (!x2) return 0; // Get the indexes of x1 and x3 (the array indexes before and after given x2):\n\n i3 = binarySearch(this.x, x2);\n i1 = i3 - 1; // We have our indexes i1 & i3, so we can calculate already:\n // y2 := ((x2−x1) × (y3−y1)) ÷ (x3−x1) + y1\n\n return (x2 - this.x[i1]) * (this.y[i3] - this.y[i1]) / (this.x[i3] - this.x[i1]) + this.y[i1];\n };\n\n return this;\n },\n // xxx: for now i will just save one spline function to to\n getInterpolateFunction: function getInterpolateFunction(c) {\n var swiper = this;\n\n if (!swiper.controller.spline) {\n swiper.controller.spline = swiper.params.loop ? new Controller.LinearSpline(swiper.slidesGrid, c.slidesGrid) : new Controller.LinearSpline(swiper.snapGrid, c.snapGrid);\n }\n },\n setTranslate: function setTranslate(_setTranslate, byController) {\n var swiper = this;\n var controlled = swiper.controller.control;\n var multiplier;\n var controlledTranslate;\n var Swiper = swiper.constructor;\n\n function setControlledTranslate(c) {\n // this will create an Interpolate function based on the snapGrids\n // x is the Grid of the scrolled scroller and y will be the controlled scroller\n // it makes sense to create this only once and recall it for the interpolation\n // the function does a lot of value caching for performance\n var translate = swiper.rtlTranslate ? -swiper.translate : swiper.translate;\n\n if (swiper.params.controller.by === 'slide') {\n swiper.controller.getInterpolateFunction(c); // i am not sure why the values have to be multiplicated this way, tried to invert the snapGrid\n // but it did not work out\n\n controlledTranslate = -swiper.controller.spline.interpolate(-translate);\n }\n\n if (!controlledTranslate || swiper.params.controller.by === 'container') {\n multiplier = (c.maxTranslate() - c.minTranslate()) / (swiper.maxTranslate() - swiper.minTranslate());\n controlledTranslate = (translate - swiper.minTranslate()) * multiplier + c.minTranslate();\n }\n\n if (swiper.params.controller.inverse) {\n controlledTranslate = c.maxTranslate() - controlledTranslate;\n }\n\n c.updateProgress(controlledTranslate);\n c.setTranslate(controlledTranslate, swiper);\n c.updateActiveIndex();\n c.updateSlidesClasses();\n }\n\n if (Array.isArray(controlled)) {\n for (var i = 0; i < controlled.length; i += 1) {\n if (controlled[i] !== byController && controlled[i] instanceof Swiper) {\n setControlledTranslate(controlled[i]);\n }\n }\n } else if (controlled instanceof Swiper && byController !== controlled) {\n setControlledTranslate(controlled);\n }\n },\n setTransition: function setTransition(duration, byController) {\n var swiper = this;\n var Swiper = swiper.constructor;\n var controlled = swiper.controller.control;\n var i;\n\n function setControlledTransition(c) {\n c.setTransition(duration, swiper);\n\n if (duration !== 0) {\n c.transitionStart();\n\n if (c.params.autoHeight) {\n nextTick(function () {\n c.updateAutoHeight();\n });\n }\n\n c.$wrapperEl.transitionEnd(function () {\n if (!controlled) return;\n\n if (c.params.loop && swiper.params.controller.by === 'slide') {\n c.loopFix();\n }\n\n c.transitionEnd();\n });\n }\n }\n\n if (Array.isArray(controlled)) {\n for (i = 0; i < controlled.length; i += 1) {\n if (controlled[i] !== byController && controlled[i] instanceof Swiper) {\n setControlledTransition(controlled[i]);\n }\n }\n } else if (controlled instanceof Swiper && byController !== controlled) {\n setControlledTransition(controlled);\n }\n }\n};\nexport default {\n name: 'controller',\n params: {\n controller: {\n control: undefined,\n inverse: false,\n by: 'slide' // or 'container'\n\n }\n },\n create: function create() {\n var swiper = this;\n bindModuleMethods(swiper, {\n controller: _extends({\n control: swiper.params.controller.control\n }, Controller)\n });\n },\n on: {\n update: function update(swiper) {\n if (!swiper.controller.control) return;\n\n if (swiper.controller.spline) {\n swiper.controller.spline = undefined;\n delete swiper.controller.spline;\n }\n },\n resize: function resize(swiper) {\n if (!swiper.controller.control) return;\n\n if (swiper.controller.spline) {\n swiper.controller.spline = undefined;\n delete swiper.controller.spline;\n }\n },\n observerUpdate: function observerUpdate(swiper) {\n if (!swiper.controller.control) return;\n\n if (swiper.controller.spline) {\n swiper.controller.spline = undefined;\n delete swiper.controller.spline;\n }\n },\n setTranslate: function setTranslate(swiper, translate, byController) {\n if (!swiper.controller.control) return;\n swiper.controller.setTranslate(translate, byController);\n },\n setTransition: function setTransition(swiper, duration, byController) {\n if (!swiper.controller.control) return;\n swiper.controller.setTransition(duration, byController);\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 { extend, isObject, bindModuleMethods } from '../../utils/utils';\nimport $ from '../../utils/dom';\nvar Thumbs = {\n init: function init() {\n var swiper = this;\n var thumbsParams = swiper.params.thumbs;\n if (swiper.thumbs.initialized) return false;\n swiper.thumbs.initialized = true;\n var SwiperClass = swiper.constructor;\n\n if (thumbsParams.swiper instanceof SwiperClass) {\n swiper.thumbs.swiper = thumbsParams.swiper;\n extend(swiper.thumbs.swiper.originalParams, {\n watchSlidesProgress: true,\n slideToClickedSlide: false\n });\n extend(swiper.thumbs.swiper.params, {\n watchSlidesProgress: true,\n slideToClickedSlide: false\n });\n } else if (isObject(thumbsParams.swiper)) {\n swiper.thumbs.swiper = new SwiperClass(extend({}, thumbsParams.swiper, {\n watchSlidesVisibility: true,\n watchSlidesProgress: true,\n slideToClickedSlide: false\n }));\n swiper.thumbs.swiperCreated = true;\n }\n\n swiper.thumbs.swiper.$el.addClass(swiper.params.thumbs.thumbsContainerClass);\n swiper.thumbs.swiper.on('tap', swiper.thumbs.onThumbClick);\n return true;\n },\n onThumbClick: function onThumbClick() {\n var swiper = this;\n var thumbsSwiper = swiper.thumbs.swiper;\n if (!thumbsSwiper) return;\n var clickedIndex = thumbsSwiper.clickedIndex;\n var clickedSlide = thumbsSwiper.clickedSlide;\n if (clickedSlide && $(clickedSlide).hasClass(swiper.params.thumbs.slideThumbActiveClass)) return;\n if (typeof clickedIndex === 'undefined' || clickedIndex === null) return;\n var slideToIndex;\n\n if (thumbsSwiper.params.loop) {\n slideToIndex = parseInt($(thumbsSwiper.clickedSlide).attr('data-swiper-slide-index'), 10);\n } else {\n slideToIndex = clickedIndex;\n }\n\n if (swiper.params.loop) {\n var currentIndex = swiper.activeIndex;\n\n if (swiper.slides.eq(currentIndex).hasClass(swiper.params.slideDuplicateClass)) {\n swiper.loopFix(); // eslint-disable-next-line\n\n swiper._clientLeft = swiper.$wrapperEl[0].clientLeft;\n currentIndex = swiper.activeIndex;\n }\n\n var prevIndex = swiper.slides.eq(currentIndex).prevAll(\"[data-swiper-slide-index=\\\"\" + slideToIndex + \"\\\"]\").eq(0).index();\n var nextIndex = swiper.slides.eq(currentIndex).nextAll(\"[data-swiper-slide-index=\\\"\" + slideToIndex + \"\\\"]\").eq(0).index();\n if (typeof prevIndex === 'undefined') slideToIndex = nextIndex;else if (typeof nextIndex === 'undefined') slideToIndex = prevIndex;else if (nextIndex - currentIndex < currentIndex - prevIndex) slideToIndex = nextIndex;else slideToIndex = prevIndex;\n }\n\n swiper.slideTo(slideToIndex);\n },\n update: function update(initial) {\n var swiper = this;\n var thumbsSwiper = swiper.thumbs.swiper;\n if (!thumbsSwiper) return;\n var slidesPerView = thumbsSwiper.params.slidesPerView === 'auto' ? thumbsSwiper.slidesPerViewDynamic() : thumbsSwiper.params.slidesPerView;\n var autoScrollOffset = swiper.params.thumbs.autoScrollOffset;\n var useOffset = autoScrollOffset && !thumbsSwiper.params.loop;\n\n if (swiper.realIndex !== thumbsSwiper.realIndex || useOffset) {\n var currentThumbsIndex = thumbsSwiper.activeIndex;\n var newThumbsIndex;\n var direction;\n\n if (thumbsSwiper.params.loop) {\n if (thumbsSwiper.slides.eq(currentThumbsIndex).hasClass(thumbsSwiper.params.slideDuplicateClass)) {\n thumbsSwiper.loopFix(); // eslint-disable-next-line\n\n thumbsSwiper._clientLeft = thumbsSwiper.$wrapperEl[0].clientLeft;\n currentThumbsIndex = thumbsSwiper.activeIndex;\n } // Find actual thumbs index to slide to\n\n\n var prevThumbsIndex = thumbsSwiper.slides.eq(currentThumbsIndex).prevAll(\"[data-swiper-slide-index=\\\"\" + swiper.realIndex + \"\\\"]\").eq(0).index();\n var nextThumbsIndex = thumbsSwiper.slides.eq(currentThumbsIndex).nextAll(\"[data-swiper-slide-index=\\\"\" + swiper.realIndex + \"\\\"]\").eq(0).index();\n\n if (typeof prevThumbsIndex === 'undefined') {\n newThumbsIndex = nextThumbsIndex;\n } else if (typeof nextThumbsIndex === 'undefined') {\n newThumbsIndex = prevThumbsIndex;\n } else if (nextThumbsIndex - currentThumbsIndex === currentThumbsIndex - prevThumbsIndex) {\n newThumbsIndex = thumbsSwiper.params.slidesPerGroup > 1 ? nextThumbsIndex : currentThumbsIndex;\n } else if (nextThumbsIndex - currentThumbsIndex < currentThumbsIndex - prevThumbsIndex) {\n newThumbsIndex = nextThumbsIndex;\n } else {\n newThumbsIndex = prevThumbsIndex;\n }\n\n direction = swiper.activeIndex > swiper.previousIndex ? 'next' : 'prev';\n } else {\n newThumbsIndex = swiper.realIndex;\n direction = newThumbsIndex > swiper.previousIndex ? 'next' : 'prev';\n }\n\n if (useOffset) {\n newThumbsIndex += direction === 'next' ? autoScrollOffset : -1 * autoScrollOffset;\n }\n\n if (thumbsSwiper.visibleSlidesIndexes && thumbsSwiper.visibleSlidesIndexes.indexOf(newThumbsIndex) < 0) {\n if (thumbsSwiper.params.centeredSlides) {\n if (newThumbsIndex > currentThumbsIndex) {\n newThumbsIndex = newThumbsIndex - Math.floor(slidesPerView / 2) + 1;\n } else {\n newThumbsIndex = newThumbsIndex + Math.floor(slidesPerView / 2) - 1;\n }\n } else if (newThumbsIndex > currentThumbsIndex && thumbsSwiper.params.slidesPerGroup === 1) {// newThumbsIndex = newThumbsIndex - slidesPerView + 1;\n }\n\n thumbsSwiper.slideTo(newThumbsIndex, initial ? 0 : undefined);\n }\n } // Activate thumbs\n\n\n var thumbsToActivate = 1;\n var thumbActiveClass = swiper.params.thumbs.slideThumbActiveClass;\n\n if (swiper.params.slidesPerView > 1 && !swiper.params.centeredSlides) {\n thumbsToActivate = swiper.params.slidesPerView;\n }\n\n if (!swiper.params.thumbs.multipleActiveThumbs) {\n thumbsToActivate = 1;\n }\n\n thumbsToActivate = Math.floor(thumbsToActivate);\n thumbsSwiper.slides.removeClass(thumbActiveClass);\n\n if (thumbsSwiper.params.loop || thumbsSwiper.params.virtual && thumbsSwiper.params.virtual.enabled) {\n for (var i = 0; i < thumbsToActivate; i += 1) {\n thumbsSwiper.$wrapperEl.children(\"[data-swiper-slide-index=\\\"\" + (swiper.realIndex + i) + \"\\\"]\").addClass(thumbActiveClass);\n }\n } else {\n for (var _i = 0; _i < thumbsToActivate; _i += 1) {\n thumbsSwiper.slides.eq(swiper.realIndex + _i).addClass(thumbActiveClass);\n }\n }\n }\n};\nexport default {\n name: 'thumbs',\n params: {\n thumbs: {\n swiper: null,\n multipleActiveThumbs: true,\n autoScrollOffset: 0,\n slideThumbActiveClass: 'swiper-slide-thumb-active',\n thumbsContainerClass: 'swiper-container-thumbs'\n }\n },\n create: function create() {\n var swiper = this;\n bindModuleMethods(swiper, {\n thumbs: _extends({\n swiper: null,\n initialized: false\n }, Thumbs)\n });\n },\n on: {\n beforeInit: function beforeInit(swiper) {\n var thumbs = swiper.params.thumbs;\n if (!thumbs || !thumbs.swiper) return;\n swiper.thumbs.init();\n swiper.thumbs.update(true);\n },\n slideChange: function slideChange(swiper) {\n if (!swiper.thumbs.swiper) return;\n swiper.thumbs.update();\n },\n update: function update(swiper) {\n if (!swiper.thumbs.swiper) return;\n swiper.thumbs.update();\n },\n resize: function resize(swiper) {\n if (!swiper.thumbs.swiper) return;\n swiper.thumbs.update();\n },\n observerUpdate: function observerUpdate(swiper) {\n if (!swiper.thumbs.swiper) return;\n swiper.thumbs.update();\n },\n setTransition: function setTransition(swiper, duration) {\n var thumbsSwiper = swiper.thumbs.swiper;\n if (!thumbsSwiper) return;\n thumbsSwiper.setTransition(duration);\n },\n beforeDestroy: function beforeDestroy(swiper) {\n var thumbsSwiper = swiper.thumbs.swiper;\n if (!thumbsSwiper) return;\n\n if (swiper.thumbs.swiperCreated && thumbsSwiper) {\n thumbsSwiper.destroy();\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\n/* eslint-disable consistent-return */\nimport { getWindow, getDocument } from 'ssr-window';\nimport $ from '../../utils/dom';\nimport { bindModuleMethods } from '../../utils/utils';\nvar Keyboard = {\n handle: function handle(event) {\n var swiper = this;\n if (!swiper.enabled) return;\n var window = getWindow();\n var document = getDocument();\n var rtl = swiper.rtlTranslate;\n var e = event;\n if (e.originalEvent) e = e.originalEvent; // jquery fix\n\n var kc = e.keyCode || e.charCode;\n var pageUpDown = swiper.params.keyboard.pageUpDown;\n var isPageUp = pageUpDown && kc === 33;\n var isPageDown = pageUpDown && kc === 34;\n var isArrowLeft = kc === 37;\n var isArrowRight = kc === 39;\n var isArrowUp = kc === 38;\n var isArrowDown = kc === 40; // Directions locks\n\n if (!swiper.allowSlideNext && (swiper.isHorizontal() && isArrowRight || swiper.isVertical() && isArrowDown || isPageDown)) {\n return false;\n }\n\n if (!swiper.allowSlidePrev && (swiper.isHorizontal() && isArrowLeft || swiper.isVertical() && isArrowUp || isPageUp)) {\n return false;\n }\n\n if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {\n return undefined;\n }\n\n if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) {\n return undefined;\n }\n\n if (swiper.params.keyboard.onlyInViewport && (isPageUp || isPageDown || isArrowLeft || isArrowRight || isArrowUp || isArrowDown)) {\n var inView = false; // Check that swiper should be inside of visible area of window\n\n if (swiper.$el.parents(\".\" + swiper.params.slideClass).length > 0 && swiper.$el.parents(\".\" + swiper.params.slideActiveClass).length === 0) {\n return undefined;\n }\n\n var $el = swiper.$el;\n var swiperWidth = $el[0].clientWidth;\n var swiperHeight = $el[0].clientHeight;\n var windowWidth = window.innerWidth;\n var windowHeight = window.innerHeight;\n var swiperOffset = swiper.$el.offset();\n if (rtl) swiperOffset.left -= swiper.$el[0].scrollLeft;\n var swiperCoord = [[swiperOffset.left, swiperOffset.top], [swiperOffset.left + swiperWidth, swiperOffset.top], [swiperOffset.left, swiperOffset.top + swiperHeight], [swiperOffset.left + swiperWidth, swiperOffset.top + swiperHeight]];\n\n for (var i = 0; i < swiperCoord.length; i += 1) {\n var point = swiperCoord[i];\n\n if (point[0] >= 0 && point[0] <= windowWidth && point[1] >= 0 && point[1] <= windowHeight) {\n if (point[0] === 0 && point[1] === 0) continue; // eslint-disable-line\n\n inView = true;\n }\n }\n\n if (!inView) return undefined;\n }\n\n if (swiper.isHorizontal()) {\n if (isPageUp || isPageDown || isArrowLeft || isArrowRight) {\n if (e.preventDefault) e.preventDefault();else e.returnValue = false;\n }\n\n if ((isPageDown || isArrowRight) && !rtl || (isPageUp || isArrowLeft) && rtl) swiper.slideNext();\n if ((isPageUp || isArrowLeft) && !rtl || (isPageDown || isArrowRight) && rtl) swiper.slidePrev();\n } else {\n if (isPageUp || isPageDown || isArrowUp || isArrowDown) {\n if (e.preventDefault) e.preventDefault();else e.returnValue = false;\n }\n\n if (isPageDown || isArrowDown) swiper.slideNext();\n if (isPageUp || isArrowUp) swiper.slidePrev();\n }\n\n swiper.emit('keyPress', kc);\n return undefined;\n },\n enable: function enable() {\n var swiper = this;\n var document = getDocument();\n if (swiper.keyboard.enabled) return;\n $(document).on('keydown', swiper.keyboard.handle);\n swiper.keyboard.enabled = true;\n },\n disable: function disable() {\n var swiper = this;\n var document = getDocument();\n if (!swiper.keyboard.enabled) return;\n $(document).off('keydown', swiper.keyboard.handle);\n swiper.keyboard.enabled = false;\n }\n};\nexport default {\n name: 'keyboard',\n params: {\n keyboard: {\n enabled: false,\n onlyInViewport: true,\n pageUpDown: true\n }\n },\n create: function create() {\n var swiper = this;\n bindModuleMethods(swiper, {\n keyboard: _extends({\n enabled: false\n }, Keyboard)\n });\n },\n on: {\n init: function init(swiper) {\n if (swiper.params.keyboard.enabled) {\n swiper.keyboard.enable();\n }\n },\n destroy: function destroy(swiper) {\n if (swiper.keyboard.enabled) {\n swiper.keyboard.disable();\n }\n }\n }\n};","/* eslint-disable consistent-return */\nimport { getWindow, getDocument } from 'ssr-window';\nimport $ from '../../utils/dom';\nimport { now, nextTick, bindModuleMethods } from '../../utils/utils';\n\nfunction isEventSupported() {\n var document = getDocument();\n var eventName = 'onwheel';\n var isSupported = (eventName in document);\n\n if (!isSupported) {\n var element = document.createElement('div');\n element.setAttribute(eventName, 'return;');\n isSupported = typeof element[eventName] === 'function';\n }\n\n if (!isSupported && document.implementation && document.implementation.hasFeature && // always returns true in newer browsers as per the standard.\n // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature\n document.implementation.hasFeature('', '') !== true) {\n // This is the only way to test support for the `wheel` event in IE9+.\n isSupported = document.implementation.hasFeature('Events.wheel', '3.0');\n }\n\n return isSupported;\n}\n\nvar Mousewheel = {\n lastScrollTime: now(),\n lastEventBeforeSnap: undefined,\n recentWheelEvents: [],\n event: function event() {\n var window = getWindow();\n if (window.navigator.userAgent.indexOf('firefox') > -1) return 'DOMMouseScroll';\n return isEventSupported() ? 'wheel' : 'mousewheel';\n },\n normalize: function normalize(e) {\n // Reasonable defaults\n var PIXEL_STEP = 10;\n var LINE_HEIGHT = 40;\n var PAGE_HEIGHT = 800;\n var sX = 0;\n var sY = 0; // spinX, spinY\n\n var pX = 0;\n var pY = 0; // pixelX, pixelY\n // Legacy\n\n if ('detail' in e) {\n sY = e.detail;\n }\n\n if ('wheelDelta' in e) {\n sY = -e.wheelDelta / 120;\n }\n\n if ('wheelDeltaY' in e) {\n sY = -e.wheelDeltaY / 120;\n }\n\n if ('wheelDeltaX' in e) {\n sX = -e.wheelDeltaX / 120;\n } // side scrolling on FF with DOMMouseScroll\n\n\n if ('axis' in e && e.axis === e.HORIZONTAL_AXIS) {\n sX = sY;\n sY = 0;\n }\n\n pX = sX * PIXEL_STEP;\n pY = sY * PIXEL_STEP;\n\n if ('deltaY' in e) {\n pY = e.deltaY;\n }\n\n if ('deltaX' in e) {\n pX = e.deltaX;\n }\n\n if (e.shiftKey && !pX) {\n // if user scrolls with shift he wants horizontal scroll\n pX = pY;\n pY = 0;\n }\n\n if ((pX || pY) && e.deltaMode) {\n if (e.deltaMode === 1) {\n // delta in LINE units\n pX *= LINE_HEIGHT;\n pY *= LINE_HEIGHT;\n } else {\n // delta in PAGE units\n pX *= PAGE_HEIGHT;\n pY *= PAGE_HEIGHT;\n }\n } // Fall-back if spin cannot be determined\n\n\n if (pX && !sX) {\n sX = pX < 1 ? -1 : 1;\n }\n\n if (pY && !sY) {\n sY = pY < 1 ? -1 : 1;\n }\n\n return {\n spinX: sX,\n spinY: sY,\n pixelX: pX,\n pixelY: pY\n };\n },\n handleMouseEnter: function handleMouseEnter() {\n var swiper = this;\n if (!swiper.enabled) return;\n swiper.mouseEntered = true;\n },\n handleMouseLeave: function handleMouseLeave() {\n var swiper = this;\n if (!swiper.enabled) return;\n swiper.mouseEntered = false;\n },\n handle: function handle(event) {\n var e = event;\n var disableParentSwiper = true;\n var swiper = this;\n if (!swiper.enabled) return;\n var params = swiper.params.mousewheel;\n\n if (swiper.params.cssMode) {\n e.preventDefault();\n }\n\n var target = swiper.$el;\n\n if (swiper.params.mousewheel.eventsTarget !== 'container') {\n target = $(swiper.params.mousewheel.eventsTarget);\n }\n\n if (!swiper.mouseEntered && !target[0].contains(e.target) && !params.releaseOnEdges) return true;\n if (e.originalEvent) e = e.originalEvent; // jquery fix\n\n var delta = 0;\n var rtlFactor = swiper.rtlTranslate ? -1 : 1;\n var data = Mousewheel.normalize(e);\n\n if (params.forceToAxis) {\n if (swiper.isHorizontal()) {\n if (Math.abs(data.pixelX) > Math.abs(data.pixelY)) delta = -data.pixelX * rtlFactor;else return true;\n } else if (Math.abs(data.pixelY) > Math.abs(data.pixelX)) delta = -data.pixelY;else return true;\n } else {\n delta = Math.abs(data.pixelX) > Math.abs(data.pixelY) ? -data.pixelX * rtlFactor : -data.pixelY;\n }\n\n if (delta === 0) return true;\n if (params.invert) delta = -delta; // Get the scroll positions\n\n var positions = swiper.getTranslate() + delta * params.sensitivity;\n if (positions >= swiper.minTranslate()) positions = swiper.minTranslate();\n if (positions <= swiper.maxTranslate()) positions = swiper.maxTranslate(); // When loop is true:\n // the disableParentSwiper will be true.\n // When loop is false:\n // if the scroll positions is not on edge,\n // then the disableParentSwiper will be true.\n // if the scroll on edge positions,\n // then the disableParentSwiper will be false.\n\n disableParentSwiper = swiper.params.loop ? true : !(positions === swiper.minTranslate() || positions === swiper.maxTranslate());\n if (disableParentSwiper && swiper.params.nested) e.stopPropagation();\n\n if (!swiper.params.freeMode) {\n // Register the new event in a variable which stores the relevant data\n var newEvent = {\n time: now(),\n delta: Math.abs(delta),\n direction: Math.sign(delta),\n raw: event\n }; // Keep the most recent events\n\n var recentWheelEvents = swiper.mousewheel.recentWheelEvents;\n\n if (recentWheelEvents.length >= 2) {\n recentWheelEvents.shift(); // only store the last N events\n }\n\n var prevEvent = recentWheelEvents.length ? recentWheelEvents[recentWheelEvents.length - 1] : undefined;\n recentWheelEvents.push(newEvent); // If there is at least one previous recorded event:\n // If direction has changed or\n // if the scroll is quicker than the previous one:\n // Animate the slider.\n // Else (this is the first time the wheel is moved):\n // Animate the slider.\n\n if (prevEvent) {\n if (newEvent.direction !== prevEvent.direction || newEvent.delta > prevEvent.delta || newEvent.time > prevEvent.time + 150) {\n swiper.mousewheel.animateSlider(newEvent);\n }\n } else {\n swiper.mousewheel.animateSlider(newEvent);\n } // If it's time to release the scroll:\n // Return now so you don't hit the preventDefault.\n\n\n if (swiper.mousewheel.releaseScroll(newEvent)) {\n return true;\n }\n } else {\n // Freemode or scrollContainer:\n // If we recently snapped after a momentum scroll, then ignore wheel events\n // to give time for the deceleration to finish. Stop ignoring after 500 msecs\n // or if it's a new scroll (larger delta or inverse sign as last event before\n // an end-of-momentum snap).\n var _newEvent = {\n time: now(),\n delta: Math.abs(delta),\n direction: Math.sign(delta)\n };\n var lastEventBeforeSnap = swiper.mousewheel.lastEventBeforeSnap;\n var ignoreWheelEvents = lastEventBeforeSnap && _newEvent.time < lastEventBeforeSnap.time + 500 && _newEvent.delta <= lastEventBeforeSnap.delta && _newEvent.direction === lastEventBeforeSnap.direction;\n\n if (!ignoreWheelEvents) {\n swiper.mousewheel.lastEventBeforeSnap = undefined;\n\n if (swiper.params.loop) {\n swiper.loopFix();\n }\n\n var position = swiper.getTranslate() + delta * params.sensitivity;\n var wasBeginning = swiper.isBeginning;\n var wasEnd = swiper.isEnd;\n if (position >= swiper.minTranslate()) position = swiper.minTranslate();\n if (position <= swiper.maxTranslate()) position = swiper.maxTranslate();\n swiper.setTransition(0);\n swiper.setTranslate(position);\n swiper.updateProgress();\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n\n if (!wasBeginning && swiper.isBeginning || !wasEnd && swiper.isEnd) {\n swiper.updateSlidesClasses();\n }\n\n if (swiper.params.freeModeSticky) {\n // When wheel scrolling starts with sticky (aka snap) enabled, then detect\n // the end of a momentum scroll by storing recent (N=15?) wheel events.\n // 1. do all N events have decreasing or same (absolute value) delta?\n // 2. did all N events arrive in the last M (M=500?) msecs?\n // 3. does the earliest event have an (absolute value) delta that's\n // at least P (P=1?) larger than the most recent event's delta?\n // 4. does the latest event have a delta that's smaller than Q (Q=6?) pixels?\n // If 1-4 are \"yes\" then we're near the end of a momentum scroll deceleration.\n // Snap immediately and ignore remaining wheel events in this scroll.\n // See comment above for \"remaining wheel events in this scroll\" determination.\n // If 1-4 aren't satisfied, then wait to snap until 500ms after the last event.\n clearTimeout(swiper.mousewheel.timeout);\n swiper.mousewheel.timeout = undefined;\n var _recentWheelEvents = swiper.mousewheel.recentWheelEvents;\n\n if (_recentWheelEvents.length >= 15) {\n _recentWheelEvents.shift(); // only store the last N events\n\n }\n\n var _prevEvent = _recentWheelEvents.length ? _recentWheelEvents[_recentWheelEvents.length - 1] : undefined;\n\n var firstEvent = _recentWheelEvents[0];\n\n _recentWheelEvents.push(_newEvent);\n\n if (_prevEvent && (_newEvent.delta > _prevEvent.delta || _newEvent.direction !== _prevEvent.direction)) {\n // Increasing or reverse-sign delta means the user started scrolling again. Clear the wheel event log.\n _recentWheelEvents.splice(0);\n } else if (_recentWheelEvents.length >= 15 && _newEvent.time - firstEvent.time < 500 && firstEvent.delta - _newEvent.delta >= 1 && _newEvent.delta <= 6) {\n // We're at the end of the deceleration of a momentum scroll, so there's no need\n // to wait for more events. Snap ASAP on the next tick.\n // Also, because there's some remaining momentum we'll bias the snap in the\n // direction of the ongoing scroll because it's better UX for the scroll to snap\n // in the same direction as the scroll instead of reversing to snap. Therefore,\n // if it's already scrolled more than 20% in the current direction, keep going.\n var snapToThreshold = delta > 0 ? 0.8 : 0.2;\n swiper.mousewheel.lastEventBeforeSnap = _newEvent;\n\n _recentWheelEvents.splice(0);\n\n swiper.mousewheel.timeout = nextTick(function () {\n swiper.slideToClosest(swiper.params.speed, true, undefined, snapToThreshold);\n }, 0); // no delay; move on next tick\n }\n\n if (!swiper.mousewheel.timeout) {\n // if we get here, then we haven't detected the end of a momentum scroll, so\n // we'll consider a scroll \"complete\" when there haven't been any wheel events\n // for 500ms.\n swiper.mousewheel.timeout = nextTick(function () {\n var snapToThreshold = 0.5;\n swiper.mousewheel.lastEventBeforeSnap = _newEvent;\n\n _recentWheelEvents.splice(0);\n\n swiper.slideToClosest(swiper.params.speed, true, undefined, snapToThreshold);\n }, 500);\n }\n } // Emit event\n\n\n if (!ignoreWheelEvents) swiper.emit('scroll', e); // Stop autoplay\n\n if (swiper.params.autoplay && swiper.params.autoplayDisableOnInteraction) swiper.autoplay.stop(); // Return page scroll on edge positions\n\n if (position === swiper.minTranslate() || position === swiper.maxTranslate()) return true;\n }\n }\n\n if (e.preventDefault) e.preventDefault();else e.returnValue = false;\n return false;\n },\n animateSlider: function animateSlider(newEvent) {\n var swiper = this;\n var window = getWindow();\n\n if (this.params.mousewheel.thresholdDelta && newEvent.delta < this.params.mousewheel.thresholdDelta) {\n // Prevent if delta of wheel scroll delta is below configured threshold\n return false;\n }\n\n if (this.params.mousewheel.thresholdTime && now() - swiper.mousewheel.lastScrollTime < this.params.mousewheel.thresholdTime) {\n // Prevent if time between scrolls is below configured threshold\n return false;\n } // If the movement is NOT big enough and\n // if the last time the user scrolled was too close to the current one (avoid continuously triggering the slider):\n // Don't go any further (avoid insignificant scroll movement).\n\n\n if (newEvent.delta >= 6 && now() - swiper.mousewheel.lastScrollTime < 60) {\n // Return false as a default\n return true;\n } // If user is scrolling towards the end:\n // If the slider hasn't hit the latest slide or\n // if the slider is a loop and\n // if the slider isn't moving right now:\n // Go to next slide and\n // emit a scroll event.\n // Else (the user is scrolling towards the beginning) and\n // if the slider hasn't hit the first slide or\n // if the slider is a loop and\n // if the slider isn't moving right now:\n // Go to prev slide and\n // emit a scroll event.\n\n\n if (newEvent.direction < 0) {\n if ((!swiper.isEnd || swiper.params.loop) && !swiper.animating) {\n swiper.slideNext();\n swiper.emit('scroll', newEvent.raw);\n }\n } else if ((!swiper.isBeginning || swiper.params.loop) && !swiper.animating) {\n swiper.slidePrev();\n swiper.emit('scroll', newEvent.raw);\n } // If you got here is because an animation has been triggered so store the current time\n\n\n swiper.mousewheel.lastScrollTime = new window.Date().getTime(); // Return false as a default\n\n return false;\n },\n releaseScroll: function releaseScroll(newEvent) {\n var swiper = this;\n var params = swiper.params.mousewheel;\n\n if (newEvent.direction < 0) {\n if (swiper.isEnd && !swiper.params.loop && params.releaseOnEdges) {\n // Return true to animate scroll on edges\n return true;\n }\n } else if (swiper.isBeginning && !swiper.params.loop && params.releaseOnEdges) {\n // Return true to animate scroll on edges\n return true;\n }\n\n return false;\n },\n enable: function enable() {\n var swiper = this;\n var event = Mousewheel.event();\n\n if (swiper.params.cssMode) {\n swiper.wrapperEl.removeEventListener(event, swiper.mousewheel.handle);\n return true;\n }\n\n if (!event) return false;\n if (swiper.mousewheel.enabled) return false;\n var target = swiper.$el;\n\n if (swiper.params.mousewheel.eventsTarget !== 'container') {\n target = $(swiper.params.mousewheel.eventsTarget);\n }\n\n target.on('mouseenter', swiper.mousewheel.handleMouseEnter);\n target.on('mouseleave', swiper.mousewheel.handleMouseLeave);\n target.on(event, swiper.mousewheel.handle);\n swiper.mousewheel.enabled = true;\n return true;\n },\n disable: function disable() {\n var swiper = this;\n var event = Mousewheel.event();\n\n if (swiper.params.cssMode) {\n swiper.wrapperEl.addEventListener(event, swiper.mousewheel.handle);\n return true;\n }\n\n if (!event) return false;\n if (!swiper.mousewheel.enabled) return false;\n var target = swiper.$el;\n\n if (swiper.params.mousewheel.eventsTarget !== 'container') {\n target = $(swiper.params.mousewheel.eventsTarget);\n }\n\n target.off(event, swiper.mousewheel.handle);\n swiper.mousewheel.enabled = false;\n return true;\n }\n};\nexport default {\n name: 'mousewheel',\n params: {\n mousewheel: {\n enabled: false,\n releaseOnEdges: false,\n invert: false,\n forceToAxis: false,\n sensitivity: 1,\n eventsTarget: 'container',\n thresholdDelta: null,\n thresholdTime: null\n }\n },\n create: function create() {\n var swiper = this;\n bindModuleMethods(swiper, {\n mousewheel: {\n enabled: false,\n lastScrollTime: now(),\n lastEventBeforeSnap: undefined,\n recentWheelEvents: [],\n enable: Mousewheel.enable,\n disable: Mousewheel.disable,\n handle: Mousewheel.handle,\n handleMouseEnter: Mousewheel.handleMouseEnter,\n handleMouseLeave: Mousewheel.handleMouseLeave,\n animateSlider: Mousewheel.animateSlider,\n releaseScroll: Mousewheel.releaseScroll\n }\n });\n },\n on: {\n init: function init(swiper) {\n if (!swiper.params.mousewheel.enabled && swiper.params.cssMode) {\n swiper.mousewheel.disable();\n }\n\n if (swiper.params.mousewheel.enabled) swiper.mousewheel.enable();\n },\n destroy: function destroy(swiper) {\n if (swiper.params.cssMode) {\n swiper.mousewheel.enable();\n }\n\n if (swiper.mousewheel.enabled) swiper.mousewheel.disable();\n }\n }\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 */\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;\n return g = { next: verb(0), \"throw\": verb(1), \"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 = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\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\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\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;\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 }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\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 function next() {\n while (env.stack.length) {\n var rec = env.stack.pop();\n try {\n var result = rec.dispose && rec.dispose.call(rec.value);\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n catch (e) {\n fail(e);\n }\n }\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\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};\n","/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Represents a relative value (percent).\r\n *\r\n * The Percent object, can be instantiated using two ways:\r\n *\r\n * * Via `new Percent(X)`.\r\n * * Via `am4core.percent(X)`.\r\n *\r\n * `Percent` type objects can be used in a number of dual-measuring or\r\n * positioning properties, like `width`. E.g.:\r\n *\r\n * ```TypeScript\r\n * chart.paddingRight = new Percent(10);\r\n * // or\r\n * chart.paddingRight = am4core.percent(10);\r\n * ```\r\n * ```JavaScript\r\n * chart.paddingRight = new Percent(10);\r\n * // or\r\n * chart.paddingRight = am4core.percent(10);\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"paddingRight\": \"10%\"\r\n * }\r\n * ```\r\n */\r\nvar Percent = /** @class */ (function () {\r\n /**\r\n * Constructor.\r\n *\r\n * @param percent Percent value\r\n */\r\n function Percent(percent) {\r\n this._value = percent;\r\n }\r\n Object.defineProperty(Percent.prototype, \"value\", {\r\n /**\r\n * Relative value.\r\n *\r\n * E.g. 100% is 1, 50% is 0.5, etc.\r\n *\r\n * This is useful to apply transformations to other values. E.g.:\r\n *\r\n * ```TypeScript\r\n * let value = 256;\r\n * let percent = new am4core.Percent(50);\r\n * console.log(value * percent.value); // outputs 128\r\n * ```\r\n * ```JavaScript\r\n * var value = 256;\r\n * var percent = new am4core.Percent(50);\r\n * console.log(value * percent.value); // outputs 128\r\n * ```\r\n *\r\n * Alternatively, you can use `am4core.percent()` helper function:\r\n *\r\n * ```TypeScript\r\n * let value = 256;\r\n * let percent = am4core.percent(50);\r\n * console.log(value * percent.value); // outputs 128\r\n * ```\r\n * ```JavaScript\r\n * var value = 256;\r\n * var percent = am4core.percent(50);\r\n * console.log(value * percent.value); // outputs 128\r\n * ```\r\n *\r\n * @readonly\r\n * @return Relative value\r\n */\r\n get: function () {\r\n return this._value / 100;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Percent.prototype, \"percent\", {\r\n /**\r\n * Value in percent.\r\n *\r\n * @return Percent\r\n */\r\n get: function () {\r\n return this._value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Percent.prototype.toString = function () {\r\n return \"\" + this._value + \"%\";\r\n };\r\n return Percent;\r\n}());\r\nexport { Percent };\r\n/**\r\n * Converts numeric percent value to a proper [[Percent]] object.\r\n *\r\n * ```TypeScript\r\n * pieSeries.radius = am4core.percent(80);\r\n * ```\r\n * ```JavaScript\r\n * pieSeries.radius = am4core.percent(80);\r\n * ```\r\n *\r\n * @param value Percent\r\n * @return Percent object\r\n */\r\nexport function percent(value) {\r\n return new Percent(value);\r\n}\r\n/**\r\n * Checks if value is a [[Percent]] object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Input value\r\n * @return Is percent?\r\n */\r\nexport function isPercent(value) {\r\n return value instanceof Percent;\r\n}\r\n//# sourceMappingURL=Percent.js.map","/**\r\n * A collection of utility functions for various type checks and conversion\r\n * @todo Review unused functions for removal\r\n * @hidden\r\n */\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { percent, isPercent } from \"./Percent\";\r\n/**\r\n * ============================================================================\r\n * TYPE CHECK\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Returns `true` if value is not a number (NaN).\r\n *\r\n * @param value Input value\r\n * @return Is NaN?\r\n * @deprecated Is not used anywhere. JS built-in isNaN is used everywhere. Maybe we don't need this, or if we do, then we should use it everywhere\r\n */\r\nexport function isNaN(value) {\r\n return Number(value) !== value;\r\n}\r\n/**\r\n * Returns a type of the value.\r\n *\r\n * @param value Input value\r\n * @return Type of the value\r\n */\r\nexport function getType(value) {\r\n return ({}).toString.call(value);\r\n}\r\n/**\r\n * Returns a default value if the passed in value is empty.\r\n *\r\n * @param value Input value\r\n * @param optional Default value\r\n * @return Value or default value whichever is available\r\n * @deprecated Not used anywhere\r\n */\r\nexport function getDefault(value, optional) {\r\n return value || optional;\r\n}\r\n/**\r\n * Checks if the passed in value is a string.\r\n *\r\n * @param value Value\r\n * @return Is string?\r\n * @throws {Error}\r\n * @deprecated Not used anywhere\r\n */\r\nexport function checkString(value) {\r\n if (typeof value === \"string\") {\r\n return true;\r\n }\r\n else {\r\n throw new Error(\"Expected a string but got \" + getType(value));\r\n }\r\n}\r\n/**\r\n * Checks if the passed in value is a boolean.\r\n *\r\n * @param value Value\r\n * @return Is boolean?\r\n * @throws {Error}\r\n * @deprecated Not used anywhere\r\n */\r\nexport function checkBoolean(value) {\r\n if (typeof value === \"boolean\") {\r\n return true;\r\n }\r\n else {\r\n throw new Error(\"Expected a boolean but got \" + getType(value));\r\n }\r\n}\r\n/**\r\n * Checks if the passed in value is a number.\r\n *\r\n * @param value Value\r\n * @return Is number?\r\n * @throws {Error}\r\n */\r\nexport function checkNumber(value) {\r\n if (typeof value === \"number\") {\r\n if (isNaN(value)) {\r\n throw new Error(\"Expected a number but got NaN\");\r\n }\r\n }\r\n else {\r\n throw new Error(\"Expected a number but got \" + getType(value));\r\n }\r\n return true;\r\n}\r\n/**\r\n * Checks if the passed in value is an object.\r\n *\r\n * @param value Value\r\n * @return Is object?\r\n * @throws {Error}\r\n * @todo Is the input type correct?\r\n * @deprecated Not used anywhere\r\n */\r\nexport function checkObject(value) {\r\n var t = getType(value);\r\n if (t === \"[object Object]\") {\r\n return true;\r\n }\r\n else {\r\n throw new Error(\"Expected an object but got \" + t);\r\n }\r\n}\r\n/**\r\n * Checks if the passed in value is an array.\r\n *\r\n * @param value Value\r\n * @return Is array?\r\n * @throws {Error}\r\n * @deprecated Not used anywhere\r\n */\r\nexport function checkArray(value) {\r\n if (Array.isArray(value)) {\r\n return true;\r\n }\r\n else {\r\n throw new Error(\"Expected an array but got \" + getType(value));\r\n }\r\n}\r\n/**\r\n * Checks if the passed in value is a Date object.\r\n *\r\n * @param value Value\r\n * @return Is Date object?\r\n * @throws {Error}\r\n * @deprecated Not used anywhere\r\n */\r\nexport function checkDate(value) {\r\n var t = getType(value);\r\n if (t === \"[object Date]\") {\r\n return true;\r\n }\r\n else {\r\n throw new Error(\"Expected a date but got \" + t);\r\n }\r\n}\r\n/**\r\n * ============================================================================\r\n * TYPE CASTING\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Casts string or a number into string.\r\n *\r\n * @param value Input\r\n * @return String value\r\n * @deprecated Not used anywhere\r\n */\r\nexport function castString(value) {\r\n if (typeof value === \"string\") {\r\n return value;\r\n }\r\n else if (typeof value === \"number\") {\r\n return \"\" + value;\r\n }\r\n else {\r\n throw new Error(\"Expected a string or number but got \" + getType(value));\r\n }\r\n}\r\n/**\r\n * Casts string or a number into a number.\r\n *\r\n * @param value Input value\r\n * @return Number value\r\n * @throws {Error}\r\n */\r\nexport function castNumber(value) {\r\n if (typeof value === \"string\") {\r\n var number = +value;\r\n if (isNaN(number)) {\r\n throw new Error(\"Cannot cast string \" + JSON.stringify(value) + \" to a number\");\r\n }\r\n else {\r\n return number;\r\n }\r\n }\r\n else if (typeof value === \"number\") {\r\n if (isNaN(value)) {\r\n throw new Error(\"Expected a number but got NaN\");\r\n }\r\n else {\r\n return value;\r\n }\r\n }\r\n else {\r\n var t = getType(value);\r\n if (t === \"[object Date]\") {\r\n return value.getTime();\r\n }\r\n else {\r\n throw new Error(\"Expected a string, number, or date but got \" + t);\r\n }\r\n }\r\n}\r\n/**\r\n * Casts number, string or Date into a Date object.\r\n *\r\n * @param value Input value\r\n * @return Date object\r\n * @deprecated Not used anywhere\r\n * @throws {Error}\r\n * @hidden\r\n * @deprecated\r\n */\r\n/*export function castDate(value: string | number | Date, formatter?: DateFormatter): Date {\r\n if (typeof value === \"string\") {\r\n if (formatter) {\r\n return formatter.parse(value);\r\n }\r\n return new Date(value);\r\n\r\n } else if (typeof value === \"number\") {\r\n return new Date(value);\r\n\r\n } else {\r\n const t = getType(value);\r\n\r\n if (t === \"[object Date]\") {\r\n return value;\r\n\r\n } else {\r\n throw new Error(\"Expected a string, number, or date but got \" + t);\r\n }\r\n }\r\n}*/\r\n/**\r\n * ============================================================================\r\n * QUICK CONVERSION\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Converts any value into `boolean`.\r\n *\r\n * @param value Source value\r\n * @return `true` or `false`\r\n */\r\nexport function toBoolean(value) {\r\n return value ? true : false;\r\n}\r\n/**\r\n * Converts any value into a `number`.\r\n *\r\n * @param value Source value\r\n * @return Number representation of value\r\n */\r\nexport function toNumber(value) {\r\n if (hasValue(value) && !isNumber(value)) {\r\n var converted = Number(value);\r\n if (isNaN(converted) && isString(value) && value != \"\") {\r\n return toNumber(value.replace(/[^0-9.\\-]+/g, ''));\r\n }\r\n return converted;\r\n }\r\n return value;\r\n}\r\n/**\r\n * Converts any value into a string (text).\r\n *\r\n * @param value Source value\r\n * @return String representation of the input\r\n */\r\nexport function toText(value) {\r\n if (hasValue(value) && !isString(value)) {\r\n if (isNumber(value)) {\r\n return castString(value);\r\n }\r\n else if (isObject(value)) {\r\n return value.toString();\r\n }\r\n }\r\n return value;\r\n}\r\n/**\r\n * Converts any value to a number or [[Percent]].\r\n *\r\n * If the parameter is a string and contains \"%\", it will\r\n * convert it into a [[Percent]].\r\n *\r\n * Otherwise, it will convert into a number.\r\n *\r\n * @param value Number or percent\r\n * @return Percent object\r\n */\r\nexport function toNumberOrPercent(value) {\r\n if (!hasValue(value) || isNumber(value) || isPercent(value)) {\r\n return value;\r\n }\r\n if (isString(value) && value.indexOf(\"%\") != -1) {\r\n return percent(toNumber(value));\r\n }\r\n return toNumber(value);\r\n}\r\n/**\r\n * Checks if a variable has a value.\r\n *\r\n * @param a Input value\r\n * @returns Has value?\r\n */\r\nexport function hasValue(a) {\r\n return a != null;\r\n}\r\n/**\r\n * Returns a value or throws an {Error} exception if the variable has not\r\n * value.\r\n *\r\n * @param a Input value\r\n * @returns Value\r\n */\r\nexport function getValue(a) {\r\n if (hasValue(a)) {\r\n return a;\r\n }\r\n else {\r\n throw new Error(\"Value doesn't exist\");\r\n }\r\n}\r\n/**\r\n * Returns a value, or returns the default value if it doesn't have a value.\r\n *\r\n * @param a Input value\r\n * @returns Value\r\n */\r\nexport function getValueDefault(a, defaultValue) {\r\n if (hasValue(a)) {\r\n return a;\r\n }\r\n else {\r\n return defaultValue;\r\n }\r\n}\r\n/**\r\n * ============================================================================\r\n * TYPE CHECK\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Checks if parameter is `Date`.\r\n *\r\n * @param value Input value\r\n * @return Is Date?\r\n */\r\nexport function isDate(value) {\r\n return getType(value) === \"[object Date]\";\r\n}\r\n/**\r\n * Checks if parameter is `string`.\r\n *\r\n * @param value Input value\r\n * @return Is string?\r\n */\r\nexport function isString(value) {\r\n return typeof value === \"string\";\r\n}\r\n/**\r\n * Checks if parameter is `number`.\r\n *\r\n * @param value Input value\r\n * @return Is number?\r\n */\r\nexport function isNumber(value) {\r\n return typeof value === \"number\" && Number(value) == value;\r\n}\r\n/**\r\n * Checks if parameter is `object`.\r\n *\r\n * @param value Input value\r\n * @return Is object?\r\n */\r\nexport function isObject(value) {\r\n return typeof value === \"object\" && value != null;\r\n}\r\n/**\r\n * Checks if parameter is `Array`.\r\n *\r\n * @param value Input value\r\n * @return Is Array?\r\n */\r\nexport function isArray(value) {\r\n return Array.isArray(value);\r\n}\r\n//# sourceMappingURL=Type.js.map","/**\r\n * A collection of Math-related functions\r\n *\r\n * @todo Comment trigonometric functions?\r\n */\r\nimport * as $type from \"./Type\";\r\n/**\r\n * ============================================================================\r\n * CONSTANTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nexport var PI = Math.PI;\r\nexport var HALFPI = PI / 2;\r\nexport var RADIANS = PI / 180;\r\nexport var DEGREES = 180 / PI;\r\n/**\r\n * Converts any value and fits it into a specific value range.\r\n *\r\n * @param value Source value\r\n * @param min Minimum allowable value\r\n * @param max Maximum allowable value\r\n * @return Number\r\n */\r\nexport function toNumberRange(value, min, max) {\r\n if ($type.hasValue(value)) {\r\n value = $type.toNumber(value);\r\n return fitToRange(value, min, max);\r\n }\r\n return value;\r\n}\r\n/**\r\n * Rounds the numeric value to whole number or specific precision of set.\r\n *\r\n * @param value Value\r\n * @param precision Precision (number of decimal points)\r\n * @param floor In case value ends with 0.5 and precision is 0, we might need to floor the value instead of ceiling it.\r\n * @return Rounded value\r\n */\r\nexport function round(value, precision, floor) {\r\n if (!$type.isNumber(precision) || precision <= 0) {\r\n var rounded = Math.round(value);\r\n if (floor) {\r\n if (rounded - value == 0.5) {\r\n rounded--;\r\n }\r\n }\r\n return rounded;\r\n }\r\n else {\r\n var d = Math.pow(10, precision);\r\n return Math.round(value * d) / d;\r\n }\r\n}\r\n/**\r\n * Ceils the numeric value to whole number or specific precision of set.\r\n *\r\n * @param value Value\r\n * @param precision Precision (number of decimal points)\r\n * @return Rounded value\r\n */\r\nexport function ceil(value, precision) {\r\n if (!$type.isNumber(precision) || precision <= 0) {\r\n return Math.ceil(value);\r\n }\r\n else {\r\n var d = Math.pow(10, precision);\r\n return Math.ceil(value * d) / d;\r\n }\r\n}\r\n/**\r\n * Stretches `t` so that it will always be between `from` and `to`.\r\n *\r\n * @param t Number from 0 to 1\r\n * @param from Lowest possible value\r\n * @param to Highest possible value\r\n * @return Adjusted value\r\n */\r\nexport function stretch(t, from, to) {\r\n return (t * (to - from)) + from;\r\n}\r\n/**\r\n * Adjust numeric value so it fits to specific value range.\r\n *\r\n * @param value Value\r\n * @param minValue Lowest possible value\r\n * @param maxValue Highest possible value\r\n * @return Adjusted value\r\n */\r\nexport function fitToRange(value, minValue, maxValue) {\r\n if ($type.isNumber(minValue)) {\r\n if ($type.isNumber(maxValue) && maxValue < minValue) {\r\n var temp = maxValue;\r\n maxValue = minValue;\r\n minValue = temp;\r\n }\r\n if (value < minValue) {\r\n value = minValue;\r\n }\r\n }\r\n if ($type.isNumber(maxValue)) {\r\n if (value > maxValue) {\r\n value = maxValue;\r\n }\r\n }\r\n return value;\r\n}\r\n/**\r\n * Returns sine of a number.\r\n *\r\n * @param value Value\r\n * @return Sine\r\n */\r\nexport function sin(value) {\r\n return round(Math.sin(RADIANS * value), 10);\r\n}\r\n/**\r\n * Returns tan of a number.\r\n *\r\n * @param value Value\r\n * @return Sine\r\n */\r\nexport function tan(value) {\r\n return round(Math.tan(RADIANS * value), 10);\r\n}\r\n/**\r\n * Returns cosine of a number.\r\n *\r\n * @param value Value\r\n * @return Cosine\r\n */\r\nexport function cos(value) {\r\n return round(Math.cos(RADIANS * value), 10);\r\n}\r\nexport function max(left, right) {\r\n if ($type.isNumber(left)) {\r\n if ($type.isNumber(right)) {\r\n if (right > left) {\r\n return right;\r\n }\r\n else {\r\n return left;\r\n }\r\n }\r\n else {\r\n return left;\r\n }\r\n }\r\n else if ($type.isNumber(right)) {\r\n return right;\r\n }\r\n else {\r\n return null;\r\n }\r\n}\r\nexport function min(left, right) {\r\n if ($type.isNumber(left)) {\r\n if ($type.isNumber(right)) {\r\n if (right < left) {\r\n return right;\r\n }\r\n else {\r\n return left;\r\n }\r\n }\r\n else {\r\n return left;\r\n }\r\n }\r\n else if ($type.isNumber(right)) {\r\n return right;\r\n }\r\n else {\r\n return null;\r\n }\r\n}\r\n/**\r\n * Returns the closest value from the array of values to the reference value.\r\n *\r\n * @param values Array of values\r\n * @param value Reference value\r\n * @return Closes value from the array\r\n */\r\nexport function closest(values, referenceValue) {\r\n return values.reduce(function (prev, curr) {\r\n return (Math.abs(curr - referenceValue) < Math.abs(prev - referenceValue) ? curr : prev);\r\n });\r\n}\r\n/**\r\n * Checks whether two ranges of values intersect.\r\n *\r\n * @param range1 Range 1\r\n * @param range2 Range 2\r\n * @return Any intersecting numbers?\r\n */\r\nexport function intersect(range1, range2) {\r\n var start1 = $type.getValue(range1.start);\r\n var start2 = $type.getValue(range2.start);\r\n var end1 = $type.getValue(range1.end);\r\n var end2 = $type.getValue(range2.end);\r\n return Math.max(start1, start2) <= Math.min(end1, end2);\r\n}\r\n/**\r\n * Inverts the range of values.\r\n *\r\n * @param range Range\r\n */\r\nexport function invertRange(range) {\r\n var start = $type.getValue(range.start);\r\n var end = $type.getValue(range.end);\r\n return { start: 1 - end, end: 1 - start };\r\n}\r\n/**\r\n * Returns an intersection range between two ranges of values.\r\n *\r\n * @param range1 Range 1\r\n * @param range2 Range 2\r\n * @return Intersecting value range\r\n */\r\nexport function intersection(range1, range2) {\r\n var start1 = $type.getValue(range1.start);\r\n var start2 = $type.getValue(range2.start);\r\n var end1 = $type.getValue(range1.end);\r\n var end2 = $type.getValue(range2.end);\r\n var startMax = Math.max(start1, start2);\r\n var endMin = Math.min(end1, end2);\r\n if (endMin < startMax) {\r\n return undefined;\r\n }\r\n else {\r\n return { start: startMax, end: endMin };\r\n }\r\n}\r\n/**\r\n * Returns pixel \"distance\" between two points.\r\n *\r\n * If second point is not specified, distance from {x:0, y:0} point is\r\n * calculated.\r\n *\r\n * @param point1 Point 1\r\n * @param point2 Point 2\r\n * @return Distance in relative pixels\r\n */\r\nexport function getDistance(point1, point2) {\r\n if (!point1) {\r\n return 0;\r\n }\r\n if (!point2) {\r\n point2 = { x: 0, y: 0 };\r\n }\r\n return Math.sqrt(Math.pow(Math.abs(point1.x - point2.x), 2) + Math.pow(Math.abs(point1.y - point2.y), 2));\r\n}\r\n/**\r\n * Returns pixel \"horizontal distance\" between two points.\r\n *\r\n * If second point is not specified, distance from {x:0, y:0} point is\r\n * calculated.\r\n *\r\n * @param point1 Point 1\r\n * @param point2 Point 2\r\n * @return Distance in relative pixels\r\n */\r\nexport function getHorizontalDistance(point1, point2) {\r\n if (!point1) {\r\n return 0;\r\n }\r\n if (!point2) {\r\n point2 = { x: 0, y: 0 };\r\n }\r\n return Math.abs(point1.x - point2.x);\r\n}\r\n/**\r\n * Returns pixel \"vertical distance\" between two points.\r\n *\r\n * If second point is not specified, distance from {x:0, y:0} point is\r\n * calculated.\r\n *\r\n * @param point1 Point 1\r\n * @param point2 Point 2\r\n * @return Distance in relative pixels\r\n */\r\nexport function getVerticalDistance(point1, point2) {\r\n if (!point1) {\r\n return 0;\r\n }\r\n if (!point2) {\r\n point2 = { x: 0, y: 0 };\r\n }\r\n return Math.abs(point1.y - point2.y);\r\n}\r\n/**\r\n * Returns approximate pixel \"distance\" between two points of cubic curve\r\n *\r\n * If second point is not specified, distance from {x:0, y:0} point is\r\n * calculated.\r\n *\r\n * @param point1 Point 1\r\n * @param point2 Point 2\r\n * @param controlPointA Control Point 1\r\n * @param controlPointB Control Point 2\r\n * @param stepCount number of steps (the more, the more accurate result)\r\n * @return Distance in relative pixels\r\n */\r\nexport function getCubicCurveDistance(point1, point2, controlPointA, controlPointB, stepCount) {\r\n if (!point1) {\r\n return 0;\r\n }\r\n if (!point2) {\r\n point2 = { x: 0, y: 0 };\r\n }\r\n var distance = 0;\r\n var prevPoint = point1;\r\n if (stepCount > 0) {\r\n for (var s = 0; s <= stepCount; s++) {\r\n var point = getPointOnCubicCurve(point1, point2, controlPointA, controlPointB, s / stepCount);\r\n distance += getDistance(prevPoint, point);\r\n prevPoint = point;\r\n }\r\n }\r\n return distance;\r\n}\r\n/**\r\n * Returns scale based on original and end position of the two points.\r\n *\r\n * @param point1 Current position of point 1\r\n * @param startPoint1 Start position of point 1\r\n * @param point2 Current position of point 1\r\n * @param startPoint2 Start position of point 2\r\n * @return Scale Calculated scale\r\n */\r\nexport function getScale(point1, startPoint1, point2, startPoint2) {\r\n var initialDistance = getDistance(startPoint1, startPoint2);\r\n var currentDistance = getDistance(point1, point2);\r\n return Math.abs(currentDistance / initialDistance);\r\n}\r\n/**\r\n * Returns an exact mid point between two points.\r\n *\r\n * @param point1 Position of point 1\r\n * @param point2 Position of point 2\r\n * @return Mid point Position of mid-point\r\n */\r\nexport function getMidPoint(point1, point2, position) {\r\n if (!$type.isNumber(position)) {\r\n position = 0.5;\r\n }\r\n return {\r\n \"x\": (point1.x + (point2.x - point1.x) * position),\r\n \"y\": (point1.y + (point2.y - point1.y) * position)\r\n };\r\n}\r\n/**\r\n * Returns difference in angles between starting and ending position of two\r\n * vectors.\r\n *\r\n * @param point1 Current position of point 1\r\n * @param startPoint1 Start position of point 1\r\n * @param point2 Current position of point 1\r\n * @param startPoint2 Start position of point 2\r\n * @return Angle difference in degrees\r\n */\r\nexport function getRotation(point1, startPoint1, point2, startPoint2) {\r\n // Get start and end angles\r\n var startAngle = getAngle(startPoint1, startPoint2);\r\n var angle = getAngle(point1, point2);\r\n // Calculate angle\r\n var diff = startAngle - angle;\r\n if (diff < 0) {\r\n diff += 360;\r\n }\r\n return diff;\r\n}\r\n/**\r\n * Calculates angle of the vector based on two or one point.\r\n *\r\n * @param point1 Point 1\r\n * @param point2 Point 2\r\n * @return Angle in degrees\r\n */\r\nexport function getAngle(point1, point2) {\r\n if (!point2) {\r\n point2 = { x: point1.x * 2, y: point1.y * 2 };\r\n }\r\n var diffX = point2.x - point1.x;\r\n var diffY = point2.y - point1.y;\r\n var angle = Math.atan2(diffY, diffX) * DEGREES;\r\n if (angle < 0) {\r\n angle += 360;\r\n }\r\n return normalizeAngle(angle);\r\n}\r\n/**\r\n * Returns the shift in coordinates of the center when item is rotated, moved\r\n * and scaled at the same time.\r\n *\r\n * @param center Current center\r\n * @param point1 Frst reference point\r\n * @param startPoint1 Original position of the first reference point\r\n * @param point2 Second reference point\r\n * @param startPoint2 Original position of the first reference point\r\n * @return Shift in center point coordinates\r\n */\r\nexport function getCenterShift(center, point1, startPoint1, point2, startPoint2) {\r\n // Get angle\r\n var angle = getRotation(point1, startPoint1, point2, startPoint2) - 90;\r\n if (angle < 0) {\r\n angle += 360;\r\n }\r\n // Get distance between new position\r\n var distance = getDistance(point1, point2);\r\n // Calculate new X\r\n var x = Math.cos(angle) / distance + point1.x;\r\n var y = Math.cos(angle) / distance + point1.y;\r\n var shift = {\r\n \"x\": x - center.x,\r\n \"y\": y - center.y\r\n };\r\n return shift;\r\n}\r\n/**\r\n * Converts an array of points into a bounding box rectangle.\r\n *\r\n * Array can contain any number of points.\r\n *\r\n * @param points Points\r\n * @return Bounding box rectangle\r\n */\r\nexport function getBBox(points) {\r\n if (points) {\r\n var length_1 = points.length;\r\n if (length_1 !== 0) {\r\n var left = void 0;\r\n var right = void 0;\r\n var top_1;\r\n var bottom = void 0;\r\n for (var i = 0; i < length_1; i++) {\r\n var point = points[i];\r\n if (!$type.isNumber(right) || (point.x > right)) {\r\n right = point.x;\r\n }\r\n if (!$type.isNumber(left) || (point.x < left)) {\r\n left = point.x;\r\n }\r\n if (!$type.isNumber(top_1) || (point.y < top_1)) {\r\n top_1 = point.y;\r\n }\r\n if (!$type.isNumber(bottom) || (point.y > bottom)) {\r\n bottom = point.y;\r\n }\r\n }\r\n return { x: left, y: top_1, width: right - left, height: bottom - top_1 };\r\n }\r\n }\r\n return { x: 0, y: 0, width: 0, height: 0 };\r\n}\r\n/**\r\n * Returns a [[IRectangle]] object representing a common rectangle that fits\r\n * all passed in rectangles in it.\r\n *\r\n * @param rectangles An array of rectangles\r\n * @return Common rectangle\r\n */\r\nexport function getCommonRectangle(rectangles) {\r\n var length = rectangles.length;\r\n if (length !== 0) {\r\n var minX = void 0;\r\n var minY = void 0;\r\n var maxX = void 0;\r\n var maxY = void 0;\r\n for (var i = 0; i < length; i++) {\r\n var rectangle = rectangles[i];\r\n minX = min(rectangle.x, minX);\r\n minY = min(rectangle.y, minY);\r\n maxX = max(rectangle.x + rectangle.width, maxX);\r\n maxY = max(rectangle.y + rectangle.height, maxY);\r\n }\r\n return { x: minX, y: minY, width: maxX - minX, height: maxY - minY };\r\n }\r\n}\r\n/**\r\n * [getPointOnQuadraticCurve description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param pointA [description]\r\n * @param pointB [description]\r\n * @param controlPoint [description]\r\n * @param position [description]\r\n * @return [description]\r\n */\r\nexport function getPointOnQuadraticCurve(pointA, pointB, controlPoint, position) {\r\n var x = (1 - position) * (1 - position) * pointA.x + 2 * (1 - position) * position * controlPoint.x + position * position * pointB.x;\r\n var y = (1 - position) * (1 - position) * pointA.y + 2 * (1 - position) * position * controlPoint.y + position * position * pointB.y;\r\n return { x: x, y: y };\r\n}\r\n/**\r\n * [getPointOnCubicCurve description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param pointA [description]\r\n * @param pointB [description]\r\n * @param controlPointA [description]\r\n * @param controlPointB [description]\r\n * @param position [description]\r\n * @return [description]\r\n */\r\nexport function getPointOnCubicCurve(pointA, pointB, controlPointA, controlPointB, position) {\r\n var point = { x: 0, y: 0 };\r\n var mt1 = 1 - position;\r\n var mt2 = mt1 * mt1;\r\n var mt3 = mt2 * mt1;\r\n point.x = pointA.x * mt3 + controlPointA.x * 3 * mt2 * position + controlPointB.x * 3 * mt1 * position * position + pointB.x * position * position * position;\r\n point.y = pointA.y * mt3 + controlPointA.y * 3 * mt2 * position + controlPointB.y * 3 * mt1 * position * position + pointB.y * position * position * position;\r\n return point;\r\n}\r\n/**\r\n * [getCubicControlPointA description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param p0 [description]\r\n * @param p1 [description]\r\n * @param p2 [description]\r\n * @param p3 [description]\r\n * @param tensionX [description]\r\n * @param tensionY [description]\r\n * @return [description]\r\n */\r\nexport function getCubicControlPointA(p0, p1, p2, p3, tensionX, tensionY) {\r\n tensionX = adjustTension(tensionX);\r\n tensionY = adjustTension(tensionY);\r\n return { x: ((-p0.x + p1.x / tensionX + p2.x) * tensionX), y: ((-p0.y + p1.y / tensionY + p2.y) * tensionY) };\r\n}\r\n/**\r\n * [getCubicControlPointB description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param p0 [description]\r\n * @param p1 [description]\r\n * @param p2 [description]\r\n * @param p3 [description]\r\n * @param tensionX [description]\r\n * @param tensionY [description]\r\n * @return [description]\r\n */\r\nexport function getCubicControlPointB(p0, p1, p2, p3, tensionX, tensionY) {\r\n tensionX = adjustTension(tensionX);\r\n tensionY = adjustTension(tensionY);\r\n return { x: ((p1.x + p2.x / tensionX - p3.x) * tensionX), y: ((p1.y + p2.y / tensionY - p3.y) * tensionY) };\r\n}\r\n/**\r\n * [adjustTension description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param tension [description]\r\n * @return [description]\r\n */\r\nexport function adjustTension(tension) {\r\n return 1 - tension + 0.00001;\r\n}\r\n/**\r\n * [normalizeAngle description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param value [description]\r\n * @return [description]\r\n */\r\nexport function normalizeAngle(value) {\r\n if (value == 360) {\r\n return 360;\r\n }\r\n return value % 360;\r\n}\r\n/**\r\n * [normalizeAngleToRange description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @todo review this with various angles, can be tested on radar chart with custom start/end angles\r\n * @param value [description]\r\n * @param startAngle [description]\r\n * @param endAngle [description]\r\n * @return [description]\r\n */\r\nexport function fitAngleToRange(value, startAngle, endAngle) {\r\n if (startAngle > endAngle) {\r\n var temp = startAngle;\r\n startAngle = endAngle;\r\n endAngle = temp;\r\n }\r\n value = normalizeAngle(value);\r\n var count = (startAngle - normalizeAngle(startAngle)) / 360;\r\n if (value < startAngle) {\r\n value += 360 * (count + 1);\r\n }\r\n var maxEnd = startAngle + (endAngle - startAngle) / 2 + 180;\r\n var maxStart = startAngle + (endAngle - startAngle) / 2 - 180;\r\n if (value > endAngle) {\r\n if (value - 360 > startAngle) {\r\n value -= 360;\r\n }\r\n else {\r\n if (value < maxEnd) {\r\n value = endAngle;\r\n }\r\n else {\r\n value = startAngle;\r\n }\r\n }\r\n }\r\n if (value < startAngle) {\r\n if (value > maxStart) {\r\n value = startAngle;\r\n }\r\n else {\r\n value = endAngle;\r\n }\r\n }\r\n return value;\r\n}\r\n/**\r\n * Returns [[IRectangle]] of an arc in relative values, assuming that the\r\n * center is at the circle center.\r\n *\r\n * Used to find out max radius of an arc.\r\n *\r\n * @ignore Exclude from docs\r\n * @param startAngle Start angle\r\n * @param endAngle End angle\r\n * @param radius \t Relative radius\r\n * @return Rectangle\r\n */\r\nexport function getArcRect(startAngle, endAngle, radius) {\r\n var minX = Number.MAX_VALUE;\r\n var minY = Number.MAX_VALUE;\r\n var maxX = -Number.MAX_VALUE;\r\n var maxY = -Number.MAX_VALUE;\r\n var bpoints = [];\r\n if (!$type.isNumber(radius)) {\r\n radius = 1;\r\n }\r\n bpoints.push(getArcPoint(radius, startAngle));\r\n bpoints.push(getArcPoint(radius, endAngle));\r\n var fromAngle = Math.min(Math.floor(startAngle / 90) * 90, Math.floor(endAngle / 90) * 90);\r\n var toAngle = Math.max(Math.ceil(startAngle / 90) * 90, Math.ceil(endAngle / 90) * 90);\r\n for (var angle = fromAngle; angle <= toAngle; angle += 90) {\r\n if (angle >= startAngle && angle <= endAngle) {\r\n bpoints.push(getArcPoint(radius, angle));\r\n }\r\n }\r\n for (var i = 0; i < bpoints.length; i++) {\r\n var pt = bpoints[i];\r\n if (pt.x < minX) {\r\n minX = pt.x;\r\n }\r\n if (pt.y < minY) {\r\n minY = pt.y;\r\n }\r\n if (pt.x > maxX) {\r\n maxX = pt.x;\r\n }\r\n if (pt.y > maxY) {\r\n maxY = pt.y;\r\n }\r\n }\r\n return ({ x: minX, y: minY, width: maxX - minX, height: maxY - minY });\r\n}\r\n/**\r\n * Returns point on arc\r\n *\r\n * @param center point\r\n * @param radius\r\n * @param arc\r\n * @return {boolean}\r\n */\r\nexport function getArcPoint(radius, arc) {\r\n return ({ x: radius * cos(arc), y: radius * sin(arc) });\r\n}\r\n/**\r\n * Returns true if a point is within rectangle\r\n *\r\n * @param point\r\n * @param rectangle\r\n * @return {boolean}\r\n */\r\nexport function isInRectangle(point, rectangle) {\r\n if (point.x >= rectangle.x && point.x <= rectangle.x + rectangle.width && point.y >= rectangle.y && point.y <= rectangle.y + rectangle.height) {\r\n return true;\r\n }\r\n return false;\r\n}\r\nexport function getLineIntersection(pointA1, pointA2, pointB1, pointB2) {\r\n var x = ((pointA1.x * pointA2.y - pointA2.x * pointA1.y) * (pointB1.x - pointB2.x) - (pointA1.x - pointA2.x) * (pointB1.x * pointB2.y - pointB1.y * pointB2.x)) / ((pointA1.x - pointA2.x) * (pointB1.y - pointB2.y) - (pointA1.y - pointA2.y) * (pointB1.x - pointB2.x));\r\n var y = ((pointA1.x * pointA2.y - pointA2.x * pointA1.y) * (pointB1.y - pointB2.y) - (pointA1.y - pointA2.y) * (pointB1.x * pointB2.y - pointB1.y * pointB2.x)) / ((pointA1.x - pointA2.x) * (pointB1.y - pointB2.y) - (pointA1.y - pointA2.y) * (pointB1.x - pointB2.x));\r\n return { x: x, y: y };\r\n}\r\n//# sourceMappingURL=Math.js.map","import * as $math from \"./Math\";\r\nimport * as $type from \"./Type\";\r\n/**\r\n * ============================================================================\r\n * UTILITY FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Searches `array` for `value`.\r\n *\r\n * Returns -1 if not found.\r\n *\r\n * @param array Source array\r\n * @param value Value to search\r\n * @returns Index\r\n */\r\nexport function indexOf(array, value) {\r\n var length = array.length;\r\n for (var i = 0; i < length; ++i) {\r\n // TODO handle NaN\r\n if (array[i] === value) {\r\n return i;\r\n }\r\n }\r\n return -1;\r\n}\r\n/**\r\n * Calls `test` for each element in `array`.\r\n *\r\n * If `test` returns `true` then it immediately returns `true`.\r\n *\r\n * If `test` returns `false` for all of the elements in `array` then it returns `false`.\r\n *\r\n * @param array Source array\r\n * @param test Function which is called on each element\r\n * @returns Whether `test` returned true or not\r\n */\r\nexport function any(array, test) {\r\n var length = array.length;\r\n for (var i = 0; i < length; ++i) {\r\n if (test(array[i])) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\n/**\r\n * Calls `fn` function for every member of array and returns a new array out\r\n * of all outputs.\r\n *\r\n * @param array Source array\r\n * @param fn Callback function\r\n * @returns New array\r\n */\r\nexport function map(array, fn) {\r\n var length = array.length;\r\n var output = new Array(length);\r\n for (var i = 0; i < length; ++i) {\r\n output[i] = fn(array[i], i);\r\n }\r\n return output;\r\n}\r\n/**\r\n * Iterates through all items in array and calls `fn` function for each of\r\n * them.\r\n *\r\n * @param array Source array\r\n * @param fn Callback function\r\n */\r\nexport function each(array, fn) {\r\n var length = array.length;\r\n for (var i = 0; i < length; ++i) {\r\n fn(array[i], i);\r\n }\r\n}\r\n/**\r\n * Iterates through all items in array in reverse order and calls `fn` function for each of\r\n * them.\r\n *\r\n * @param array Source array\r\n * @param fn Callback function\r\n */\r\nexport function eachReverse(array, fn) {\r\n var i = array.length;\r\n while (i--) {\r\n fn(array[i], i);\r\n }\r\n}\r\n/**\r\n * Iterates through all items in array and calls `fn` function for each of\r\n * them.\r\n *\r\n * If `fn` call evaluates to `false`, further iteration is cancelled.\r\n *\r\n * @param array Source array\r\n * @param fn Callback function\r\n */\r\nexport function eachContinue(array, fn) {\r\n var length = array.length;\r\n for (var i = 0; i < length; ++i) {\r\n if (!fn(array[i], i)) {\r\n break;\r\n }\r\n }\r\n}\r\n/**\r\n * Shifts an item at `index` towards beginning of the array.\r\n *\r\n * @param array Source array\r\n * @param index Target element index\r\n */\r\nexport function shiftLeft(array, index) {\r\n var length = array.length;\r\n for (var i = index; i < length; ++i) {\r\n array[i - index] = array[i];\r\n }\r\n array.length = length - index;\r\n}\r\n/**\r\n * Returns the last item of the array.\r\n *\r\n * @param array Source array\r\n * @returns Last item\r\n */\r\nexport function last(array) {\r\n var length = array.length;\r\n return length ? array[length - 1] : undefined;\r\n}\r\n/**\r\n * Returns the first item of the array.\r\n *\r\n * @param array Source array\r\n * @returns Last item\r\n */\r\nexport function first(array) {\r\n return array[0];\r\n}\r\n/**\r\n * Inserts `element` into `array` at `index`.\r\n *\r\n * Caps `index` to be between `0` and `array.length`\r\n *\r\n * @param array Source array\r\n * @param element Item to insert\r\n * @param array Index to insert item at\r\n */\r\nexport function insert(array, element, index) {\r\n //if (array) {\r\n index = $math.fitToRange(index, 0, array.length);\r\n array.splice(index, 0, element);\r\n //}\r\n}\r\n/**\r\n * Removes all copies of `element` from `array` (if they exist) and then\r\n * inserts `element` at `index`.\r\n *\r\n * @param array Source array\r\n * @param element Item\r\n * @param array Index to move item to\r\n */\r\nexport function setIndex(array, element, index) {\r\n remove(array, element);\r\n insert(array, element, index);\r\n}\r\n/**\r\n * Pushes all of the elements from `input` into `array`.\r\n *\r\n * @param array Output array\r\n * @param input Input array\r\n */\r\nexport function pushAll(array, input) {\r\n var length = input.length;\r\n for (var i = 0; i < length; ++i) {\r\n array.push(input[i]);\r\n }\r\n}\r\n/**\r\n * Removes `element` from `array`.\r\n *\r\n * If there are multiple copies of `element`, they are all removed.\r\n *\r\n * @param array Source array\r\n * @param element Item to remove\r\n */\r\nexport function remove(array, element) {\r\n var found = false;\r\n var index = array.indexOf(element);\r\n if (index !== -1) {\r\n found = true;\r\n array.splice(index, 1);\r\n var length_1 = array.length;\r\n while (index < length_1) {\r\n // TODO handle NaN\r\n if (array[index] === element) {\r\n array.splice(index, 1);\r\n --length_1;\r\n }\r\n else {\r\n ++index;\r\n }\r\n }\r\n }\r\n return found;\r\n}\r\n/**\r\n * Adds an `element` to `array`.\r\n *\r\n * If array already contains and item like this, it is removed before adding\r\n * it again.\r\n *\r\n * Optionally `toIndex` can be specified to add element at specific index.\r\n *\r\n * @param array Source array\r\n * @param element Item to add\r\n * @param array Index to move item to\r\n */\r\nexport function move(array, element, toIndex) {\r\n // @todo this implementation must be the same as the List.moveValue method\r\n // @todo don't do anything if the desired index is the same as the current index\r\n var index = indexOf(array, element);\r\n // @todo remove all old values rather than only the first ?\r\n if (index !== -1) {\r\n removeIndex(array, index);\r\n }\r\n if (toIndex == null) {\r\n array.push(element);\r\n }\r\n else {\r\n insertIndex(array, toIndex, element);\r\n }\r\n}\r\n/**\r\n * Inserts `element` into `array` at `index`.\r\n *\r\n * If `index` is not provided, it will insert `element` at the end of `array`.\r\n *\r\n * @param array Source array\r\n * @param element Item to add\r\n * @param array Index to add item at\r\n */\r\nexport function add(array, element, index) {\r\n // Append to the end if index is not set\r\n if (!$type.isNumber(index)) {\r\n array.push(element);\r\n }\r\n // Add to the beginning of array if index is 0\r\n else if (index === 0) {\r\n array.unshift(element);\r\n }\r\n // Add to indicated place if index is set\r\n else {\r\n array.splice(index, 0, element);\r\n }\r\n}\r\n/**\r\n * Removes `element` from `array` (if it exists) and then inserts `element` at\r\n * `index`.\r\n *\r\n * If `index` is not provided, it will insert `element` at the end of `array`.\r\n *\r\n * @param array Source array\r\n * @param element Item to remove\r\n * @param array Index to move item to\r\n */\r\nexport function replace(array, element, index) {\r\n // check if exists\r\n var ind = array.indexOf(element);\r\n // remove if exists\r\n if (ind !== -1) {\r\n array.splice(ind, 1);\r\n }\r\n // add to end if index is not set\r\n if (!$type.isNumber(index)) {\r\n array.push(element);\r\n }\r\n // add to indicated place if index is set\r\n else {\r\n array.splice(index, 0, element);\r\n }\r\n}\r\n/**\r\n * Wraps `input` in an array, if it isn't already an array.\r\n *\r\n * @param input Source value\r\n * @return An array\r\n */\r\nexport function toArray(input) {\r\n if (Array.isArray(input)) {\r\n return input;\r\n }\r\n else {\r\n return [input];\r\n }\r\n}\r\n/**\r\n * Returns `true` if `element` exists in `array`.\r\n *\r\n * @param array Source array\r\n * @param element Item to search for\r\n * @returns Item in array?\r\n */\r\nexport function has(array, element) {\r\n return indexOf(array, element) !== -1;\r\n}\r\n/**\r\n * Returns a shallow copy of `array`.\r\n *\r\n * @param array Source array\r\n * @returns Copy of the array\r\n */\r\nexport function copy(array) {\r\n var length = array.length;\r\n // It's faster to create the array with a pre-defined length\r\n var output = new Array(length);\r\n for (var i = 0; i < length; ++i) {\r\n // Because the array has a pre-defined length, we have to assign rather than push\r\n // This is also faster than pushing\r\n output[i] = array[i];\r\n }\r\n return output;\r\n}\r\n/**\r\n * Returns a copy of `array` which contains all the elements between `start`\r\n * and `end`. (including `start` and excluding `end`)\r\n *\r\n * If `end` is not provided, it defaults to `array.length`.\r\n *\r\n * @param array Source array\r\n * @param start Start index\r\n * @param end End index\r\n * @returns Part of the array\r\n */\r\nexport function slice(array, start, end) {\r\n if (end === void 0) { end = array.length; }\r\n var output = new Array(end - start);\r\n for (var i = start; i < end; ++i) {\r\n output[i - start] = array[i];\r\n }\r\n return output;\r\n}\r\n/**\r\n * Inserts a value into array at specific index.\r\n *\r\n * @param array Source array\r\n * @param index Index\r\n * @param value Value to insert\r\n */\r\nexport function insertIndex(array, index, value) {\r\n array.splice(index, 0, value);\r\n}\r\n/**\r\n * Removes a value from array at specific index.\r\n *\r\n * @param array Source array\r\n * @param index Index\r\n */\r\nexport function removeIndex(array, index) {\r\n array.splice(index, 1);\r\n}\r\n/**\r\n * Orders an array using specific `ordering` function and returns index of\r\n * the `value`.\r\n *\r\n * @ignore Exclude from docs\r\n * @param array Source array\r\n * @param ordering An ordering function\r\n * @param value Value to search for\r\n * @returns Result of the search\r\n */\r\nexport function getSortedIndex(array, ordering, value) {\r\n var start = 0;\r\n var end = array.length;\r\n var found = false;\r\n while (start < end) {\r\n // TODO is this faster/slower than using Math.floor ?\r\n var pivot = (start + end) >> 1;\r\n var order = ordering(value, array[pivot]);\r\n // less\r\n if (order < 0) {\r\n end = pivot;\r\n // equal\r\n }\r\n else if (order === 0) {\r\n found = true;\r\n start = pivot + 1;\r\n // more\r\n }\r\n else {\r\n start = pivot + 1;\r\n }\r\n }\r\n return {\r\n found: found,\r\n index: (found ? start - 1 : start)\r\n };\r\n}\r\n/**\r\n * Searches the array using custom function and returns index of the item if\r\n * found.\r\n *\r\n * Will call `matches` function on all items of the array. If return value\r\n * evaluates to `true`, index is returned.\r\n *\r\n * Otherwise returns -1.\r\n *\r\n * @param array Source array\r\n * @param matches Search function\r\n * @returns Index of the item if found\r\n */\r\nexport function findIndex(array, matches) {\r\n var length = array.length;\r\n for (var i = 0; i < length; ++i) {\r\n if (matches(array[i], i)) {\r\n return i;\r\n }\r\n }\r\n return -1;\r\n}\r\n/**\r\n * Searches the array using custom function and returns item if found.\r\n *\r\n * Will call `matches` function on all items of the array. If return value\r\n * evaluates to `true`, index is returned.\r\n *\r\n * Otherwise returns `undefined`.\r\n *\r\n * @param array Source array\r\n * @param matches Search function\r\n * @returns Item if found\r\n */\r\nexport function find(array, matches) {\r\n var index = findIndex(array, matches);\r\n if (index !== -1) {\r\n return array[index];\r\n }\r\n}\r\n/**\r\n * Iterates through all items in array and calls `fn` function for each of\r\n * them.\r\n *\r\n * @param array Source array\r\n * @param fn Callback function\r\n */\r\nexport function shuffle(array) {\r\n // https://stackoverflow.com/a/2450976/449477\r\n var currentIndex = array.length, temporaryValue, randomIndex;\r\n // While there remain elements to shuffle...\r\n while (0 !== currentIndex) {\r\n // Pick a remaining element...\r\n randomIndex = Math.floor(Math.random() * currentIndex);\r\n currentIndex -= 1;\r\n // And swap it with the current element.\r\n temporaryValue = array[currentIndex];\r\n array[currentIndex] = array[randomIndex];\r\n array[randomIndex] = temporaryValue;\r\n }\r\n}\r\nexport function keepIf(array, keep) {\r\n var length = array.length;\r\n var i = 0;\r\n while (i < length) {\r\n if (keep(array[i])) {\r\n ++i;\r\n }\r\n else {\r\n array.splice(i, 1);\r\n --length;\r\n }\r\n }\r\n}\r\n//# sourceMappingURL=Array.js.map","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport * as $array from \"./Array\";\r\nimport * as $type from \"./Type\";\r\n/**\r\n * A base class for disposable objects.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nvar Disposer = /** @class */ (function () {\r\n /**\r\n * Constructor.\r\n *\r\n * @param dispose Function that disposes object\r\n */\r\n function Disposer(dispose) {\r\n this._disposed = false;\r\n this._dispose = dispose;\r\n }\r\n /**\r\n * Checks if object is disposed.\r\n *\r\n * @return Disposed?\r\n */\r\n Disposer.prototype.isDisposed = function () {\r\n return this._disposed;\r\n };\r\n /**\r\n * Disposes the object.\r\n */\r\n Disposer.prototype.dispose = function () {\r\n if (!this._disposed) {\r\n this._disposed = true;\r\n this._dispose();\r\n }\r\n };\r\n return Disposer;\r\n}());\r\nexport { Disposer };\r\n/**\r\n * A collection of related disposers that can be disposed in one go.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nvar MultiDisposer = /** @class */ (function (_super) {\r\n __extends(MultiDisposer, _super);\r\n function MultiDisposer(disposers) {\r\n return _super.call(this, function () {\r\n $array.each(disposers, function (x) {\r\n x.dispose();\r\n });\r\n }) || this;\r\n }\r\n return MultiDisposer;\r\n}(Disposer));\r\nexport { MultiDisposer };\r\n/**\r\n * A special kind of Disposer that has attached value set.\r\n *\r\n * If a new value is set using `set()` method, the old disposer value is\r\n * disposed.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nvar MutableValueDisposer = /** @class */ (function (_super) {\r\n __extends(MutableValueDisposer, _super);\r\n /**\r\n * Constructor.\r\n */\r\n function MutableValueDisposer() {\r\n var _this = _super.call(this, function () {\r\n if ($type.hasValue(_this._disposer)) {\r\n _this._disposer.dispose();\r\n _this._disposer = undefined;\r\n }\r\n }) || this;\r\n return _this;\r\n }\r\n /**\r\n * Returns current value.\r\n *\r\n * @return Value\r\n */\r\n MutableValueDisposer.prototype.get = function () {\r\n return this._value;\r\n };\r\n /**\r\n * Sets value and disposes previous disposer if it was set.\r\n *\r\n * @param value New value\r\n * @param disposer Disposer\r\n */\r\n MutableValueDisposer.prototype.set = function (value, disposer) {\r\n if ($type.hasValue(this._disposer)) {\r\n this._disposer.dispose();\r\n }\r\n this._disposer = disposer;\r\n this._value = value;\r\n };\r\n /**\r\n * Resets the disposer value.\r\n */\r\n MutableValueDisposer.prototype.reset = function () {\r\n this.set(undefined, undefined);\r\n };\r\n return MutableValueDisposer;\r\n}(Disposer));\r\nexport { MutableValueDisposer };\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nvar CounterDisposer = /** @class */ (function (_super) {\r\n __extends(CounterDisposer, _super);\r\n function CounterDisposer() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n /**\r\n * [_counter description]\r\n *\r\n * @todo Description\r\n */\r\n _this._counter = 0;\r\n return _this;\r\n }\r\n /**\r\n * [increment description]\r\n *\r\n * @todo Description\r\n */\r\n CounterDisposer.prototype.increment = function () {\r\n var _this = this;\r\n // TODO throw an error if it is disposed\r\n ++this._counter;\r\n // TODO make this more efficient\r\n return new Disposer(function () {\r\n --_this._counter;\r\n if (_this._counter === 0) {\r\n _this.dispose();\r\n }\r\n });\r\n };\r\n return CounterDisposer;\r\n}(Disposer));\r\nexport { CounterDisposer };\r\n//# sourceMappingURL=Disposer.js.map","/**\r\n * A collection of low-level async operation stuff.\r\n */\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport * as $array from \"./Array\";\r\nvar pendingFrame = false;\r\nvar nextQueue = [];\r\nvar readQueue = [];\r\nvar writeQueue = [];\r\nvar idleQueue = [];\r\nvar fps = 1000 / 60;\r\n/**\r\n * [raf description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport var raf = (typeof requestAnimationFrame === \"function\"\r\n ? function (fn) {\r\n requestAnimationFrame(fn);\r\n }\r\n : function (fn) {\r\n setTimeout(fn, fps);\r\n });\r\n/**\r\n * [frameLoop description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nfunction frameLoop() {\r\n var now = Date.now();\r\n var length = nextQueue.length;\r\n for (var i = 0; i < length; ++i) {\r\n nextQueue[i](now);\r\n }\r\n $array.shiftLeft(nextQueue, length);\r\n for (var i = 0; i < readQueue.length; ++i) {\r\n readQueue[i](now);\r\n }\r\n readQueue.length = 0;\r\n for (var i = 0; i < writeQueue.length; ++i) {\r\n writeQueue[i](now);\r\n }\r\n writeQueue.length = 0;\r\n if (nextQueue.length === 0 && readQueue.length === 0) {\r\n pendingFrame = false;\r\n }\r\n else {\r\n raf(frameLoop);\r\n }\r\n}\r\n/**\r\n * [pendFrame description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nfunction pendFrame() {\r\n if (!pendingFrame) {\r\n pendingFrame = true;\r\n raf(frameLoop);\r\n }\r\n}\r\n/**\r\n * [nextFrame description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param fn [description]\r\n */\r\nexport function nextFrame(fn) {\r\n nextQueue.push(fn);\r\n pendFrame();\r\n}\r\n/**\r\n * [readFrame description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param fn [description]\r\n */\r\nexport function readFrame(fn) {\r\n readQueue.push(fn);\r\n pendFrame();\r\n}\r\n/**\r\n * [writeFrame description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param fn [description]\r\n */\r\nexport function writeFrame(fn) {\r\n writeQueue.push(fn);\r\n pendFrame();\r\n}\r\n/**\r\n * [whenIdle description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param fn [description]\r\n */\r\nexport function whenIdle(fn) {\r\n idleQueue.push(fn);\r\n}\r\n/**\r\n * [triggerIdle description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @todo Maybe don't trigger a callback which was added while in the middle of triggering?\r\n */\r\nexport function triggerIdle() {\r\n var now = Date.now();\r\n var length = idleQueue.length;\r\n for (var i = 0; i < length; ++i) {\r\n idleQueue.shift()(now);\r\n }\r\n}\r\n//# sourceMappingURL=AsyncPending.js.map","/**\r\n * Event Dispatcher module is used for registering listeners and dispatching\r\n * events across amCharts system.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Disposer } from \"./Disposer\";\r\nimport * as $array from \"./Array\";\r\nimport * as $async from \"./AsyncPending\";\r\nimport * as $type from \"./Type\";\r\n/*export interface IEventDispatcher {\r\n isDisposed(): boolean;\r\n dispose(): void;\r\n hasListeners(): boolean;\r\n enable(): void;\r\n disable(): void;\r\n enableType(type: Key): void;\r\n disableType(type: Key, amount?: number): void;\r\n isEnabled(type: Key): boolean;\r\n has(type: Key, callback?: (this: C, event: T[Key]) => void, context?: C): boolean;\r\n dispatchImmediately(type: Key, event: T[Key]): void;\r\n dispatch(type: Key, event: T[Key]): void;\r\n onAll(callback: (this: C, type: Key, event: T[Key]) => void, context?: C): IDisposer;\r\n on(type: Key, callback: (this: C, event: T[Key]) => void, context?: C): IDisposer;\r\n once(type: Key, callback: (this: C, event: T[Key]) => void, context?: C): IDisposer;\r\n off(type: Key, callback: (this: C, event: T[Key]) => void, context?: C): void;\r\n off(type: Key, callback: (this: C, event: T[Key]) => void, context?: C): void;\r\n copyFrom(source: this): void;\r\n}*/\r\n/**\r\n * Universal Event Dispatcher.\r\n *\r\n * @important\r\n */\r\nvar EventDispatcher = /** @class */ (function () {\r\n /**\r\n * Constructor\r\n */\r\n function EventDispatcher() {\r\n this._listeners = [];\r\n this._killed = [];\r\n this._disabled = {};\r\n this._iterating = 0;\r\n this._enabled = true;\r\n this._disposed = false;\r\n }\r\n /**\r\n * Returns if this object has been already disposed.\r\n *\r\n * @return Disposed?\r\n */\r\n EventDispatcher.prototype.isDisposed = function () {\r\n return this._disposed;\r\n };\r\n /**\r\n * Dispose (destroy) this object.\r\n */\r\n EventDispatcher.prototype.dispose = function () {\r\n if (!this._disposed) {\r\n this._disposed = true;\r\n var a = this._listeners;\r\n this._iterating = 1;\r\n this._listeners = null;\r\n this._disabled = null;\r\n try {\r\n $array.each(a, function (x) {\r\n x.disposer.dispose();\r\n });\r\n }\r\n finally {\r\n this._killed = null;\r\n this._iterating = null;\r\n }\r\n }\r\n };\r\n /**\r\n * Checks if this particular event dispatcher has any listeners set.\r\n *\r\n * @return Has listeners?\r\n */\r\n EventDispatcher.prototype.hasListeners = function () {\r\n return this._listeners.length !== 0;\r\n };\r\n /**\r\n * Checks if this particular event dispatcher has any particular listeners set.\r\n *\r\n * @return Has particular event listeners?\r\n */\r\n EventDispatcher.prototype.hasListenersByType = function (type) {\r\n return $array.any(this._listeners, function (x) { return (x.type === null || x.type === type) && !x.killed; });\r\n };\r\n /**\r\n * Enable dispatching of events if they were previously disabled by\r\n * `disable()`.\r\n */\r\n EventDispatcher.prototype.enable = function () {\r\n this._enabled = true;\r\n };\r\n /**\r\n * Disable dispatching of events until re-enabled by `enable()`.\r\n */\r\n EventDispatcher.prototype.disable = function () {\r\n this._enabled = false;\r\n };\r\n /**\r\n * Enable dispatching particular event, if it was disabled before by\r\n * `disableType()`.\r\n *\r\n * @param type Event type\r\n */\r\n EventDispatcher.prototype.enableType = function (type) {\r\n delete this._disabled[type];\r\n };\r\n /**\r\n * Disable dispatching of events for a certain event type.\r\n *\r\n * Optionally, can set how many dispatches to skip before automatically\r\n * re-enabling the dispatching.\r\n *\r\n * @param type Event type\r\n * @param amount Number of event dispatches to skip\r\n */\r\n EventDispatcher.prototype.disableType = function (type, amount) {\r\n if (amount === void 0) { amount = Infinity; }\r\n this._disabled[type] = amount;\r\n };\r\n /**\r\n * Removes listener from dispatcher.\r\n *\r\n * Will throw an exception if such listener does not exists.\r\n *\r\n * @param listener Listener to remove\r\n */\r\n EventDispatcher.prototype._removeListener = function (listener) {\r\n if (this._iterating === 0) {\r\n var index = this._listeners.indexOf(listener);\r\n if (index === -1) {\r\n throw new Error(\"Invalid state: could not remove listener\");\r\n }\r\n this._listeners.splice(index, 1);\r\n }\r\n else {\r\n this._killed.push(listener);\r\n }\r\n };\r\n /**\r\n * Removes existing listener by certain parameters.\r\n *\r\n * @param once Listener's once setting\r\n * @param type Listener's type\r\n * @param callback Callback function\r\n * @param context Callback context\r\n */\r\n EventDispatcher.prototype._removeExistingListener = function (once, type, callback, context) {\r\n if (this._disposed) {\r\n throw new Error(\"EventDispatcher is disposed\");\r\n }\r\n this._eachListener(function (info) {\r\n if (info.once === once && // TODO is this correct ?\r\n info.type === type &&\r\n (callback == null || info.callback === callback) &&\r\n info.context === context) {\r\n info.disposer.dispose();\r\n }\r\n });\r\n };\r\n /**\r\n * Checks if dispatching for particular event type is enabled.\r\n *\r\n * @param type Event type\r\n * @return Enabled?\r\n */\r\n EventDispatcher.prototype.isEnabled = function (type) {\r\n if (this._disposed) {\r\n throw new Error(\"EventDispatcher is disposed\");\r\n }\r\n // TODO is this check correct ?\r\n return this._enabled && this._listeners.length > 0 && this.hasListenersByType(type) && this._disabled[type] == null;\r\n };\r\n /**\r\n * Checks if there's already a listener with specific parameters.\r\n *\r\n * @param type Listener's type\r\n * @param callback Callback function\r\n * @param context Callback context\r\n * @return Has listener?\r\n */\r\n EventDispatcher.prototype.has = function (type, callback, context) {\r\n var index = $array.findIndex(this._listeners, function (info) {\r\n return info.once !== true && // Ignoring \"once\" listeners\r\n info.type === type &&\r\n (callback == null || info.callback === callback) &&\r\n info.context === context;\r\n });\r\n return index !== -1;\r\n };\r\n /**\r\n * Checks whether event of the particular type should be dispatched.\r\n *\r\n * @param type Event type\r\n * @return Dispatch?\r\n */\r\n EventDispatcher.prototype._shouldDispatch = function (type) {\r\n if (this._disposed) {\r\n throw new Error(\"EventDispatcher is disposed\");\r\n }\r\n var count = this._disabled[type];\r\n if (!$type.isNumber(count)) {\r\n return this._enabled;\r\n }\r\n else {\r\n if (count <= 1) {\r\n delete this._disabled[type];\r\n }\r\n else {\r\n --this._disabled[type];\r\n }\r\n return false;\r\n }\r\n };\r\n /**\r\n * [_eachListener description]\r\n *\r\n * All of this extra code is needed when a listener is removed while iterating\r\n *\r\n * @todo Description\r\n * @param fn [description]\r\n */\r\n EventDispatcher.prototype._eachListener = function (fn) {\r\n var _this = this;\r\n ++this._iterating;\r\n try {\r\n $array.each(this._listeners, fn);\r\n }\r\n finally {\r\n --this._iterating;\r\n // TODO should this be inside or outside the finally ?\r\n if (this._iterating === 0 && this._killed.length !== 0) {\r\n // Remove killed listeners\r\n $array.each(this._killed, function (killed) {\r\n _this._removeListener(killed);\r\n });\r\n this._killed.length = 0;\r\n }\r\n }\r\n };\r\n /**\r\n * Dispatches an event immediately without waiting for next cycle.\r\n *\r\n * @param type Event type\r\n * @param event Event object\r\n * @todo automatically add in type and target properties if they are missing\r\n */\r\n EventDispatcher.prototype.dispatchImmediately = function (type, event) {\r\n if (this._shouldDispatch(type)) {\r\n // TODO check if it's faster to use an object of listeners rather than a single big array\r\n // TODO if the function throws, maybe it should keep going ?\r\n this._eachListener(function (listener) {\r\n if (!listener.killed && (listener.type === null || listener.type === type)) {\r\n listener.dispatch(type, event);\r\n }\r\n });\r\n }\r\n };\r\n /**\r\n * Shelves the event to be dispatched within next update cycle.\r\n *\r\n * @param type Event type\r\n * @param event Event object\r\n * @todo automatically add in type and target properties if they are missing\r\n */\r\n EventDispatcher.prototype.dispatch = function (type, event) {\r\n if (this._shouldDispatch(type)) {\r\n this._eachListener(function (listener) {\r\n // TODO check if it's faster to use an object of listeners rather than a single big array\r\n if (!listener.killed && (listener.type === null || listener.type === type)) {\r\n // TODO if the function throws, maybe it should keep going ?\r\n // TODO dispatch during the update cycle, rather than using whenIdle\r\n $async.whenIdle(function () {\r\n if (!listener.killed) {\r\n listener.dispatch(type, event);\r\n }\r\n });\r\n }\r\n });\r\n }\r\n };\r\n /**\r\n * Creates, catalogs and returns an [[EventListener]].\r\n *\r\n * Event listener can be disposed.\r\n *\r\n * @param once Listener's once setting\r\n * @param type Listener's type\r\n * @param callback Callback function\r\n * @param context Callback context\r\n * @param shouldClone Whether the listener should be copied when the EventDispatcher is copied\r\n * @param dispatch\r\n * @returns An event listener\r\n */\r\n EventDispatcher.prototype._on = function (once, type, callback, context, shouldClone, dispatch) {\r\n var _this = this;\r\n if (this._disposed) {\r\n throw new Error(\"EventDispatcher is disposed\");\r\n }\r\n this._removeExistingListener(once, type, callback, context);\r\n var info = {\r\n type: type,\r\n callback: callback,\r\n context: context,\r\n shouldClone: shouldClone,\r\n dispatch: dispatch,\r\n killed: false,\r\n once: once,\r\n disposer: new Disposer(function () {\r\n info.killed = true;\r\n _this._removeListener(info);\r\n })\r\n };\r\n this._listeners.push(info);\r\n return info;\r\n };\r\n /**\r\n * Creates an event listener to be invoked on **any** event.\r\n *\r\n * @param callback Callback function\r\n * @param context Callback context\r\n * @param shouldClone Whether the listener should be copied when the EventDispatcher is copied\r\n * @returns A disposable event listener\r\n * @todo what if `listen` is called on the same function twice ?\r\n */\r\n EventDispatcher.prototype.onAll = function (callback, context, shouldClone) {\r\n if (shouldClone === void 0) { shouldClone = true; }\r\n return this._on(false, null, callback, context, shouldClone, function (type, event) { return callback.call(context, type, event); }).disposer;\r\n };\r\n /**\r\n * Creates an event listener to be invoked on a specific event type.\r\n *\r\n * ```TypeScript\r\n * series.events.on(\"hidden\", (ev) => {\r\n * console.log(\"Series hidden: \" + ev.target.name);\r\n * }, this);\r\n * ```\r\n * ```JavaScript\r\n * series.events.on(\"hidden\", function(ev) {\r\n * console.log(\"Series hidden: \" + ev.target.name);\r\n * }, this);\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"series\": [{\r\n * // ...\r\n * \"events\": {\r\n * \t\"hidden\": function(ev) {\r\n * \t console.log(\"Series hidden: \" + ev.target.name);\r\n * \t}\r\n * }\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * The above will invoke our custom event handler whenever series we put\r\n * event on is hidden.\r\n *\r\n * @param type Listener's type\r\n * @param callback Callback function\r\n * @param context Callback context\r\n * @param shouldClone Whether the listener should be copied when the EventDispatcher is copied\r\n * @returns A disposable event listener\r\n * @todo what if `listen` is called on the same function twice ?\r\n */\r\n EventDispatcher.prototype.on = function (type, callback, context, shouldClone) {\r\n if (shouldClone === void 0) { shouldClone = true; }\r\n return this._on(false, type, callback, context, shouldClone, function (type, event) { return callback.call(context, event); }).disposer;\r\n };\r\n /**\r\n * Creates an event listener to be invoked on a specific event type once.\r\n *\r\n * Once the event listener is invoked, it is automatically disposed.\r\n *\r\n * ```TypeScript\r\n * series.events.on(\"hidden\", (ev) => {\r\n * console.log(\"Series hidden: \" + ev.target.name);\r\n * }, this);\r\n * ```\r\n * ```JavaScript\r\n * series.events.on(\"hidden\", function(ev) {\r\n * console.log(\"Series hidden: \" + ev.target.name);\r\n * }, this);\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"series\": [{\r\n * // ...\r\n * \"events\": {\r\n * \t\"hidden\": function(ev) {\r\n * \t console.log(\"Series hidden: \" + ev.target.name);\r\n * \t}\r\n * }\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * The above will invoke our custom event handler the first time series we\r\n * put event on is hidden.\r\n *\r\n * @param type Listener's type\r\n * @param callback Callback function\r\n * @param context Callback context\r\n * @param shouldClone Whether the listener should be copied when the EventDispatcher is copied\r\n * @returns A disposable event listener\r\n * @todo what if `listen` is called on the same function twice ?\r\n */\r\n EventDispatcher.prototype.once = function (type, callback, context, shouldClone) {\r\n if (shouldClone === void 0) { shouldClone = true; }\r\n var x = this._on(true, type, callback, context, shouldClone, function (type, event) {\r\n x.disposer.dispose();\r\n callback.call(context, event);\r\n });\r\n // TODO maybe this should return a different Disposer ?\r\n return x.disposer;\r\n };\r\n /**\r\n * Removes the event listener with specific parameters.\r\n *\r\n * @param type Listener's type\r\n * @param callback Callback function\r\n * @param context Callback context\r\n */\r\n EventDispatcher.prototype.off = function (type, callback, context) {\r\n this._removeExistingListener(false, type, callback, context);\r\n };\r\n /**\r\n * Copies all dispatcher parameters, including listeners, from another event\r\n * dispatcher.\r\n *\r\n * @param source Source event dispatcher\r\n */\r\n EventDispatcher.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n if (this._disposed) {\r\n throw new Error(\"EventDispatcher is disposed\");\r\n }\r\n if (source === this) {\r\n throw new Error(\"Cannot copyFrom the same TargetedEventDispatcher\");\r\n }\r\n $array.each(source._listeners, function (x) {\r\n // TODO is this correct ?\r\n if (!x.killed && x.shouldClone) {\r\n if (x.type === null) {\r\n _this.onAll(x.callback, x.context);\r\n }\r\n else if (x.once) {\r\n _this.once(x.type, x.callback, x.context);\r\n }\r\n else {\r\n _this.on(x.type, x.callback, x.context);\r\n }\r\n }\r\n });\r\n };\r\n return EventDispatcher;\r\n}());\r\nexport { EventDispatcher };\r\n/**\r\n * A version of the [[EventDispatcher]] that dispatches events for a specific\r\n * target object.\r\n *\r\n * @important\r\n */\r\nvar TargetedEventDispatcher = /** @class */ (function (_super) {\r\n __extends(TargetedEventDispatcher, _super);\r\n /**\r\n * Constructor\r\n *\r\n * @param target Event dispatcher target\r\n */\r\n function TargetedEventDispatcher(target) {\r\n var _this = _super.call(this) || this;\r\n _this.target = target;\r\n return _this;\r\n }\r\n /**\r\n * Copies all dispatcher parameters, including listeners, from another event\r\n * dispatcher.\r\n *\r\n * @param source Source event dispatcher\r\n */\r\n TargetedEventDispatcher.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n if (this._disposed) {\r\n throw new Error(\"EventDispatcher is disposed\");\r\n }\r\n if (source === this) {\r\n throw new Error(\"Cannot copyFrom the same TargetedEventDispatcher\");\r\n }\r\n $array.each(source._listeners, function (x) {\r\n // TODO very hacky\r\n if (x.context === source.target) {\r\n return;\r\n }\r\n // TODO is this correct ?\r\n if (!x.killed && x.shouldClone) {\r\n if (x.type === null) {\r\n _this.onAll(x.callback, x.context);\r\n }\r\n else if (x.once) {\r\n _this.once(x.type, x.callback, x.context);\r\n }\r\n else {\r\n _this.on(x.type, x.callback, x.context);\r\n }\r\n }\r\n });\r\n };\r\n return TargetedEventDispatcher;\r\n}(EventDispatcher));\r\nexport { TargetedEventDispatcher };\r\n//# sourceMappingURL=EventDispatcher.js.map","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport * as $array from \"./Array\";\r\nimport * as $type from \"./Type\";\r\n/**\r\n * ============================================================================\r\n * UTILITY FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Returns an iterator for all entries in object.\r\n *\r\n * Can be used to safely iterate through all properties of the object.\r\n *\r\n * @param object Source object\r\n * @returns Iterator\r\n */\r\nexport function entries(object) {\r\n return function (push) {\r\n // TODO make this more efficient ?\r\n for (var key in object) {\r\n if (hasKey(object, key)) {\r\n if (!push([key, object[key]])) {\r\n break;\r\n }\r\n }\r\n }\r\n };\r\n}\r\n/**\r\n * Returns an array of object's property names.\r\n *\r\n * @param object Source object\r\n * @returns Object property names\r\n */\r\nexport function keys(object) {\r\n var output = [];\r\n for (var key in object) {\r\n if (hasKey(object, key)) {\r\n output.push(key);\r\n }\r\n }\r\n return output;\r\n}\r\n/**\r\n * Returns an array of object's property names ordered using specific ordering\r\n * function.\r\n *\r\n * @param object Source object\r\n * @param order Ordering function\r\n * @returns Object property names\r\n */\r\nexport function keysOrdered(object, order) {\r\n return keys(object).sort(order);\r\n}\r\n/**\r\n * Checks if `object` has a specific `key`.\r\n *\r\n * @param object Source object\r\n * @param key Property name\r\n * @returns Has key?\r\n */\r\nexport function hasKey(object, key) {\r\n return {}.hasOwnProperty.call(object, key);\r\n}\r\n/**\r\n * Returns value of the specific `key`.\r\n *\r\n * @param object Source object\r\n * @param key Property name\r\n * @returns Key value\r\n */\r\nexport function getKey(object, key) {\r\n return object[key];\r\n}\r\n/**\r\n * Iterates through all properties of the object calling `fn` for each of them.\r\n *\r\n * If return value of the function evaluates to `false` further iteration is\r\n * cancelled.\r\n *\r\n * @param object Source object\r\n * @param fn Callback function\r\n */\r\nexport function eachContinue(object, fn) {\r\n for (var key in object) {\r\n if (hasKey(object, key)) {\r\n if (!fn(key, object[key])) {\r\n break;\r\n }\r\n }\r\n }\r\n}\r\n/**\r\n * Iterates through all properties of the object calling `fn` for each of them.\r\n *\r\n * @param object Source object\r\n * @param fn Callback function\r\n */\r\nexport function each(object, fn) {\r\n eachContinue(object, function (key, value) {\r\n fn(key, value);\r\n return true;\r\n });\r\n}\r\n/**\r\n * Orders object properties using custom `ord` function and iterates through\r\n * them calling `fn` for each of them.\r\n *\r\n * @param object Source object\r\n * @param fn Callback function\r\n * @param order Ordering function\r\n */\r\nexport function eachOrdered(object, fn, ord) {\r\n $array.each(keysOrdered(object, ord), function (key) {\r\n fn(key, object[key]);\r\n });\r\n}\r\n/**\r\n * Returns a copy of the object.\r\n *\r\n * @param object Source object\r\n * @returns Copy of the object\r\n */\r\nexport function copy(object) {\r\n return Object.assign({}, object);\r\n}\r\n/**\r\n * Merges two objects and returns a new object that contains properties from\r\n * both source objects.\r\n *\r\n * @param object1 Source object #1\r\n * @param object2 Source object #2\r\n * @returns Combined object\r\n */\r\nexport function merge(object1, object2) {\r\n return Object.assign({}, object1, object2);\r\n}\r\n/**\r\n * Returns object clone.\r\n *\r\n * @param object Source object\r\n * @returns Clone\r\n */\r\nexport function clone(object) {\r\n return JSON.parse(JSON.stringify(object));\r\n}\r\n/**\r\n * Copies a list of properties from one object to another.\r\n *\r\n * Will not copy empty properties.\r\n *\r\n * @param source Source object\r\n * @param target Target object\r\n * @param keys List of keys to copy\r\n */\r\nexport function copyProperties(source, target, keys) {\r\n $array.each(keys, function (key) {\r\n if ($type.hasValue(source[key])) {\r\n target[key] = source[key];\r\n }\r\n });\r\n}\r\n/**\r\n * Copies a list of properties from one object to another only if target does't have value of the property set.\r\n *\r\n * Will not copy empty properties.\r\n *\r\n * @param source Source object\r\n * @param target Target object\r\n * @param keys List of keys to copy\r\n */\r\nexport function softCopyProperties(source, target, keys) {\r\n $array.each(keys, function (key) {\r\n if ($type.hasValue(source[key]) && !($type.hasValue(target[key]))) {\r\n target[key] = source[key];\r\n }\r\n });\r\n}\r\n/**\r\n * Copies a list of properties from one object to another.\r\n *\r\n * Will copy empty properties.\r\n *\r\n * @param source Source object\r\n * @param target Target object\r\n * @param keys List of keys to copy\r\n */\r\nexport function forceCopyProperties(source, target, keys) {\r\n $array.each(keys, function (key) {\r\n target[key] = source[key];\r\n });\r\n}\r\n/**\r\n * Copies all properties from one object to another.\r\n *\r\n * @param from Source object\r\n * @param to Target object\r\n */\r\nexport function copyAllProperties(from, to) {\r\n copyProperties(from, to, keys(from));\r\n}\r\n//# sourceMappingURL=Object.js.map","import * as $array from \"./Array\";\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function fromArray(array) {\r\n return function (push) {\r\n var length = array.length;\r\n for (var i = 0; i < length; ++i) {\r\n if (!push(array[i])) {\r\n break;\r\n }\r\n }\r\n };\r\n}\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function length(iter) {\r\n var sum = 0;\r\n iter(function (_) {\r\n ++sum;\r\n return true;\r\n });\r\n return sum;\r\n}\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function toArray(iter) {\r\n var output = [];\r\n iter(function (value) {\r\n output.push(value);\r\n return true;\r\n });\r\n return output;\r\n}\r\n/**\r\n * [iter description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function eachContinue(iter, fn) {\r\n iter(fn);\r\n}\r\n/**\r\n * [iter description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function each(iter, fn) {\r\n iter(function (value) {\r\n fn(value);\r\n return true;\r\n });\r\n}\r\n/**\r\n * [iter description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function sort(iter, fn) {\r\n return fromArray(toArray(iter).sort(fn));\r\n}\r\n/**\r\n * [A description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function map(iter, fn) {\r\n return function (push) { return iter(function (value) { return push(fn(value)); }); };\r\n}\r\n/**\r\n * [iter description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function filter(iter, fn) {\r\n return function (push) { return iter(function (value) {\r\n if (fn(value)) {\r\n return push(value);\r\n }\r\n else {\r\n return true;\r\n }\r\n }); };\r\n}\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function concat() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n return function (push) {\r\n var go = true;\r\n var push2 = function (value) { return (go = push(value)); };\r\n var length = args.length;\r\n for (var i = 0; i < length; ++i) {\r\n args[i](push2);\r\n if (!go) {\r\n break;\r\n }\r\n }\r\n };\r\n}\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function flatten(iter) {\r\n return function (push) {\r\n var go = true;\r\n var push2 = function (value) { return (go = push(value)); };\r\n iter(function (value) {\r\n value(push2);\r\n return go;\r\n });\r\n };\r\n}\r\n/**\r\n * [number description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function indexed(iter) {\r\n return function (push) {\r\n var index = 0;\r\n iter(function (value) { return push([index++, value]); });\r\n };\r\n}\r\n/**\r\n * [iter description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function findIndex(iter, matches) {\r\n var found = false;\r\n var i = 0;\r\n iter(function (value) {\r\n if (matches(value)) {\r\n found = true;\r\n return false;\r\n }\r\n else {\r\n ++i;\r\n return true;\r\n }\r\n });\r\n return (found ? i : -1);\r\n}\r\n/**\r\n * [iter description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function find(iter, matches) {\r\n var output;\r\n iter(function (value) {\r\n if (matches(value)) {\r\n output = value;\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n });\r\n return output;\r\n}\r\n/**\r\n * [A description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function findMap(iter, matches) {\r\n var output;\r\n iter(function (value) {\r\n var v = matches(value);\r\n if (v !== null) {\r\n output = v;\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n });\r\n return output;\r\n}\r\n/**\r\n * [iter description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function contains(iter, matches) {\r\n var output = false;\r\n iter(function (value) {\r\n if (matches(value)) {\r\n output = true;\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n });\r\n return output;\r\n}\r\n/**\r\n * [A description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function foldl(iter, init, fn) {\r\n iter(function (value) {\r\n init = fn(init, value);\r\n return true;\r\n });\r\n return init;\r\n}\r\n/**\r\n * [min2 description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param left [description]\r\n * @param right [description]\r\n * @return [description]\r\n */\r\nfunction min2(left, right) {\r\n if (left == null || right < left) {\r\n return right;\r\n }\r\n else {\r\n return left;\r\n }\r\n}\r\n/**\r\n * [min description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Verify that this works correctly\r\n * @todo Description\r\n * @param a [description]\r\n * @return [description]\r\n */\r\nexport function min(a) {\r\n return foldl(a, null, min2);\r\n}\r\n/**\r\n * [max2 description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param left [description]\r\n * @param right [description]\r\n * @return [description]\r\n */\r\nfunction max2(left, right) {\r\n if (left == null || right > left) {\r\n return right;\r\n }\r\n else {\r\n return left;\r\n }\r\n}\r\n/**\r\n * [max description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Verify that this works correctly\r\n * @todo Description\r\n * @param a [description]\r\n * @return [description]\r\n */\r\nexport function max(a) {\r\n return foldl(a, null, max2);\r\n}\r\n/**\r\n * [join description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param iter [description]\r\n * @param separator [description]\r\n * @return [description]\r\n */\r\nexport function join(iter, separator) {\r\n if (separator === void 0) { separator = \"\"; }\r\n var first = true;\r\n var init = \"\";\r\n iter(function (value) {\r\n if (first) {\r\n first = false;\r\n }\r\n else {\r\n init += separator;\r\n }\r\n init += value;\r\n return true;\r\n });\r\n return init;\r\n}\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nvar ListIterator = /** @class */ (function () {\r\n /**\r\n * Constructor\r\n *\r\n * @param list [description]\r\n * @param create [description]\r\n */\r\n function ListIterator(list, create) {\r\n // flag specifies if iterator should create new list item if it is reqested for a nextItem but there is no more left in the list\r\n this.createNewItems = false;\r\n this.list = list;\r\n this._create = create;\r\n this.reset();\r\n }\r\n ListIterator.prototype.reset = function () {\r\n this._listCopy = toArray(this.list.iterator());\r\n };\r\n ListIterator.prototype.clear = function () {\r\n this._listCopy.length = 0;\r\n };\r\n ListIterator.prototype.getFirst = function () {\r\n return this.returnItem(0);\r\n };\r\n ListIterator.prototype.getLast = function () {\r\n return this.returnItem(this._listCopy.length - 1);\r\n };\r\n ListIterator.prototype.find = function (fn) {\r\n var index = $array.findIndex(this._listCopy, fn);\r\n if (index !== -1) {\r\n var item = this._listCopy[index];\r\n // TODO use removeIndex instead ?\r\n $array.remove(this._listCopy, item);\r\n return item;\r\n }\r\n else {\r\n return this.getLast();\r\n }\r\n };\r\n ListIterator.prototype.removeItem = function (item) {\r\n return $array.remove(this._listCopy, item);\r\n };\r\n ListIterator.prototype.returnItem = function (index) {\r\n if (index >= 0 && index < this._listCopy.length) {\r\n var item = this._listCopy[index];\r\n // TODO use removeIndex instead ?\r\n $array.remove(this._listCopy, item);\r\n return item;\r\n }\r\n else if (this.createNewItems) {\r\n return this._create();\r\n }\r\n };\r\n ListIterator.prototype.iterator = function () {\r\n return fromArray(this._listCopy);\r\n };\r\n return ListIterator;\r\n}());\r\nexport { ListIterator };\r\n//# sourceMappingURL=Iterator.js.map","/**\r\n * ============================================================================\r\n * COMPARING FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Comparing function used for ordering.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Use localeCompare\r\n * @param a Item 1\r\n * @param b Item 2\r\n * @return Result\r\n */\r\nexport function order(a, b) {\r\n if (a === b) {\r\n return 0;\r\n }\r\n else if (a < b) {\r\n return -1;\r\n }\r\n else {\r\n return 1;\r\n }\r\n}\r\n/**\r\n * ============================================================================\r\n * OTHER FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Repeats a `string` number of times as set in `amount`.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Make this faster\r\n * @param string Source string\r\n * @param amount Number of times to repeat string\r\n * @return New string\r\n */\r\nexport function repeat(string, amount) {\r\n return new Array(amount + 1).join(string);\r\n}\r\n/**\r\n * Generates a random string `characters` length.\r\n *\r\n * @param chars Number of characters\r\n * @return Random string\r\n */\r\nexport function random(chars) {\r\n var res = \"\";\r\n var choice = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\r\n for (var i = 0; i < chars; i++) {\r\n res += choice.charAt(Math.floor(Math.random() * choice.length));\r\n }\r\n return res;\r\n}\r\n//# sourceMappingURL=String.js.map","import { __extends, __generator, __read } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Disposer } from \"./Disposer\";\r\nimport { EventDispatcher } from \"./EventDispatcher\";\r\nimport * as $object from \"./Object\";\r\nimport * as $iter from \"./Iterator\";\r\nimport * as $string from \"./String\";\r\n/**\r\n * A disposable dictionary, which when disposed itself will call `dispose()`\r\n * method on all its items.\r\n */\r\nvar DictionaryDisposer = /** @class */ (function (_super) {\r\n __extends(DictionaryDisposer, _super);\r\n function DictionaryDisposer(dict) {\r\n var _this = this;\r\n var disposer = dict.events.on(\"removed\", function (x) {\r\n x.oldValue.dispose();\r\n }, undefined, false);\r\n _this = _super.call(this, function () {\r\n disposer.dispose();\r\n // TODO clear the dictionary ?\r\n $iter.each(dict.iterator(), function (a) {\r\n var v = a[1];\r\n v.dispose();\r\n });\r\n }) || this;\r\n return _this;\r\n }\r\n return DictionaryDisposer;\r\n}(Disposer));\r\nexport { DictionaryDisposer };\r\n/**\r\n * A Dictionary is collection where values of some type can be mapped to\r\n * string keys.\r\n *\r\n * You might call it an \"associative list\" or \"associative array\".\r\n */\r\nvar Dictionary = /** @class */ (function () {\r\n /**\r\n * Constructor\r\n */\r\n function Dictionary() {\r\n /**\r\n * Event dispatcher.\r\n */\r\n this.events = new EventDispatcher();\r\n this._dictionary = {};\r\n }\r\n /**\r\n * Returns `true` if key exists in Dictionary.\r\n *\r\n * @param key The key to search for\r\n * @return `true` if key exists, `false` if it doesn't\r\n */\r\n Dictionary.prototype.hasKey = function (key) {\r\n return $object.hasKey(this._dictionary, key);\r\n };\r\n /**\r\n * Returns the value for a specific key.\r\n *\r\n * @param key The key to search for\r\n * @return Value for the key, or `undefined` if it doesn't exist\r\n */\r\n Dictionary.prototype.getKey = function (key) {\r\n return this._dictionary[key];\r\n };\r\n /**\r\n * Inserts value at specific key.\r\n *\r\n * Will thrown an exception if the key already exists in the dictionary.\r\n *\r\n * @param key Key\r\n * @param value Value\r\n */\r\n Dictionary.prototype.insertKey = function (key, value) {\r\n if ($object.hasKey(this._dictionary, key)) {\r\n throw new Error(\"Key \" + key + \" already exists in dictionary\");\r\n }\r\n else {\r\n this._dictionary[key] = value;\r\n if (this.events.isEnabled(\"insertKey\")) {\r\n this.events.dispatchImmediately(\"insertKey\", {\r\n type: \"insertKey\",\r\n target: this,\r\n key: key,\r\n newValue: value\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * Adds or updates key/value into dictionary.\r\n *\r\n * If the key already exists, the old value will be overwritten.\r\n *\r\n * If the new value is exactly the same as the old value (using ===), it won't do anything.\r\n *\r\n * @param key Key\r\n * @param value Value\r\n */\r\n Dictionary.prototype.setKey = function (key, value) {\r\n if ($object.hasKey(this._dictionary, key)) {\r\n var oldValue = this._dictionary[key];\r\n if (oldValue !== value) {\r\n this._dictionary[key] = value;\r\n if (this.events.isEnabled(\"setKey\")) {\r\n this.events.dispatchImmediately(\"setKey\", {\r\n type: \"setKey\",\r\n target: this,\r\n key: key,\r\n oldValue: oldValue,\r\n newValue: value\r\n });\r\n }\r\n if (this.events.isEnabled(\"removed\")) {\r\n this.events.dispatchImmediately(\"removed\", {\r\n type: \"removed\",\r\n target: this,\r\n oldValue: oldValue\r\n });\r\n }\r\n }\r\n }\r\n else {\r\n this._dictionary[key] = value;\r\n if (this.events.isEnabled(\"insertKey\")) {\r\n this.events.dispatchImmediately(\"insertKey\", {\r\n type: \"insertKey\",\r\n target: this,\r\n key: key,\r\n newValue: value\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * Updates the value at specific `key` using custom function.\r\n *\r\n * Passes in current value into the function, and uses its output as a new\r\n * value.\r\n *\r\n * If the new value is exactly the same as the old value (using ===), it won't do anything.\r\n *\r\n * @ignore Exclude from docs\r\n * @param key Key\r\n * @param fn Function to transform the value\r\n */\r\n Dictionary.prototype.updateKey = function (key, fn) {\r\n if ($object.hasKey(this._dictionary, key)) {\r\n var oldValue = this._dictionary[key];\r\n var newValue = fn(oldValue);\r\n if (oldValue !== newValue) {\r\n this._dictionary[key] = newValue;\r\n if (this.events.isEnabled(\"setKey\")) {\r\n this.events.dispatchImmediately(\"setKey\", {\r\n type: \"setKey\",\r\n target: this,\r\n key: key,\r\n oldValue: oldValue,\r\n newValue: newValue\r\n });\r\n }\r\n if (this.events.isEnabled(\"removed\")) {\r\n this.events.dispatchImmediately(\"removed\", {\r\n type: \"removed\",\r\n target: this,\r\n oldValue: oldValue\r\n });\r\n }\r\n }\r\n }\r\n else {\r\n throw new Error(\"Key \" + key + \" doesn't exist in dictionary\");\r\n }\r\n };\r\n /**\r\n * Removes value at specific `key` from dictionary.\r\n *\r\n * @param key Key to remove\r\n */\r\n Dictionary.prototype.removeKey = function (key) {\r\n if ($object.hasKey(this._dictionary, key)) {\r\n var oldValue = this._dictionary[key];\r\n delete this._dictionary[key];\r\n if (this.events.isEnabled(\"removeKey\")) {\r\n this.events.dispatchImmediately(\"removeKey\", {\r\n type: \"removeKey\",\r\n target: this,\r\n key: key,\r\n oldValue: oldValue\r\n });\r\n }\r\n if (this.events.isEnabled(\"removed\")) {\r\n this.events.dispatchImmediately(\"removed\", {\r\n type: \"removed\",\r\n target: this,\r\n oldValue: oldValue\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * [insertKeyIfEmpty description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo description\r\n * @param key [description]\r\n * @param ifEmpty [description]\r\n * @return [description]\r\n */\r\n Dictionary.prototype.insertKeyIfEmpty = function (key, ifEmpty) {\r\n if (!this.hasKey(key)) {\r\n this.insertKey(key, ifEmpty());\r\n }\r\n return this.getKey(key);\r\n };\r\n /**\r\n * Removes all items from the dictionary.\r\n */\r\n Dictionary.prototype.clear = function () {\r\n var _this = this;\r\n // TODO dispatch this after clear\r\n if (this.events.isEnabled(\"removed\")) {\r\n $object.each(this._dictionary, function (key, value) {\r\n _this.events.dispatchImmediately(\"removed\", {\r\n type: \"removed\",\r\n target: _this,\r\n oldValue: value\r\n });\r\n });\r\n }\r\n this._dictionary = {};\r\n if (this.events.isEnabled(\"cleared\")) {\r\n this.events.dispatchImmediately(\"cleared\", {\r\n type: \"cleared\",\r\n target: this\r\n });\r\n }\r\n };\r\n /**\r\n * Copies items from another Dictionary.\r\n *\r\n * @param source A Dictionary to copy items from\r\n */\r\n Dictionary.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n $iter.each(source.iterator(), function (a) {\r\n // TODO fix this type cast\r\n _this.setKey(a[0], a[1]);\r\n });\r\n };\r\n /**\r\n * Returns an interator that can be used to iterate through all items in\r\n * the dictionary.\r\n *\r\n * @return Iterator\r\n */\r\n Dictionary.prototype.iterator = function () {\r\n // @todo fix this type after the Iterator bug is fixed\r\n // https://github.com/Microsoft/TypeScript/issues/16730\r\n return $object.entries(this._dictionary);\r\n };\r\n /**\r\n * Returns an ES6 iterator for the keys/values of the dictionary.\r\n */\r\n Dictionary.prototype[Symbol.iterator] = function () {\r\n var _a, _b, _i, key;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n _a = [];\r\n for (_b in this._dictionary)\r\n _a.push(_b);\r\n _i = 0;\r\n _c.label = 1;\r\n case 1:\r\n if (!(_i < _a.length)) return [3 /*break*/, 4];\r\n key = _a[_i];\r\n if (!$object.hasKey(this._dictionary, key)) return [3 /*break*/, 3];\r\n return [4 /*yield*/, [key, this._dictionary[key]]];\r\n case 2:\r\n _c.sent();\r\n _c.label = 3;\r\n case 3:\r\n _i++;\r\n return [3 /*break*/, 1];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n };\r\n /**\r\n * Calls `f` for each key/value in the dictionary.\r\n */\r\n Dictionary.prototype.each = function (f) {\r\n $iter.each(this.iterator(), function (_a) {\r\n var _b = __read(_a, 2), key = _b[0], value = _b[1];\r\n return f(key, value);\r\n });\r\n };\r\n /**\r\n * Returns an iterator that can be used to iterate through all items in\r\n * the dictionary, ordered by key.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Iterator\r\n */\r\n Dictionary.prototype.sortedIterator = function () {\r\n return $iter.sort(this.iterator(), function (x, y) { return $string.order(x[0], y[0]); });\r\n };\r\n return Dictionary;\r\n}());\r\nexport { Dictionary };\r\n/**\r\n * A version of a [[Dictionary]] that has a \"template\".\r\n *\r\n * A template is an instance of an object, that can be used to create new\r\n * elements in the list without actually needing to create instances for those.\r\n *\r\n * When new element is created in the list, e.g. by calling its `create()`\r\n * method, an exact copy of the element is created (including properties and\r\n * other attributes), inserted into the list and returned.\r\n */\r\nvar DictionaryTemplate = /** @class */ (function (_super) {\r\n __extends(DictionaryTemplate, _super);\r\n /**\r\n * Constructor\r\n *\r\n * @param t Template object\r\n */\r\n function DictionaryTemplate(t) {\r\n var _this = _super.call(this) || this;\r\n _this.template = t;\r\n return _this;\r\n }\r\n Object.defineProperty(DictionaryTemplate.prototype, \"template\", {\r\n /**\r\n * @return Template object\r\n */\r\n get: function () {\r\n return this._template;\r\n },\r\n /**\r\n * A \"template\" object to copy all properties from when creating new list\r\n * items.\r\n *\r\n * @param v Template object\r\n */\r\n set: function (v) {\r\n v.isTemplate = true;\r\n this._template = v;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies all elements from other dictionary.\r\n *\r\n * @param source Source dictionary\r\n */\r\n DictionaryTemplate.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n $iter.each(source.iterator(), function (a) {\r\n // TODO fix this type cast\r\n // TODO why does this need to clone ?\r\n _this.setKey(a[0], a[1].clone());\r\n });\r\n };\r\n /**\r\n * Instantiates a new object of the specified type, adds it to specified\r\n * `key` in the dictionary, and returns it.\r\n *\r\n * @param make Item type to use. Will use the default type for the dictionary if not specified.\r\n * @return Newly created item\r\n */\r\n DictionaryTemplate.prototype.create = function (key) {\r\n var _this = this;\r\n return this.insertKeyIfEmpty(key, function () { return _this.template.clone(); });\r\n };\r\n return DictionaryTemplate;\r\n}(Dictionary));\r\nexport { DictionaryTemplate };\r\n//# sourceMappingURL=Dictionary.js.map","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Dictionary } from \"./Dictionary\";\r\nimport * as $type from \"./Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Represents object cache.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Better storage\r\n * @todo TTL logging\r\n * @todo Garbage collector\r\n */\r\nvar Cache = /** @class */ (function () {\r\n function Cache() {\r\n /**\r\n * Storage for cache items.\r\n */\r\n this._storage = new Dictionary();\r\n /**\r\n * Default TTL in milliseconds.\r\n */\r\n this.ttl = 1000;\r\n }\r\n /**\r\n * Caches or updates cached value, resets TTL.\r\n *\r\n * If `ttl` is set to zero, item will never expire.\r\n *\r\n * @param owner An id of the object that owns this cache\r\n * @param key Index key\r\n * @param value Value\r\n * @param ttl TTL of the cache to live in milliseconds\r\n */\r\n Cache.prototype.set = function (owner, key, value, ttl) {\r\n // Create if storage does not exist for this owner\r\n var ownerStorage = this._storage.insertKeyIfEmpty(owner, function () { return new Dictionary(); });\r\n // Create cache item\r\n var item = {\r\n \"touched\": new Date().getTime(),\r\n \"ttl\": $type.isNumber(ttl) ? ttl : this.ttl,\r\n \"value\": value\r\n };\r\n // Set\r\n ownerStorage.setKey(key, item);\r\n };\r\n /**\r\n * Rerturns cached item, respecting TTL.\r\n *\r\n * @param owner An id of the object that owns this cache\r\n * @param key Index key\r\n * @param value Value to return if cache not available\r\n * @return Value, or `undefined` if not set\r\n */\r\n Cache.prototype.get = function (owner, key, value) {\r\n if (value === void 0) { value = undefined; }\r\n // \t\t || ypeof this._storage[owner][key] === \"undefined\" || this._storage[owner][key].expired === true) {\r\n if (this._storage.hasKey(owner)) {\r\n var ownerStorage = this._storage.getKey(owner);\r\n if (ownerStorage.hasKey(key)) {\r\n var cacheItem = ownerStorage.getKey(key);\r\n if (cacheItem.ttl && ((cacheItem.touched + cacheItem.ttl) < new Date().getTime())) {\r\n cacheItem.expired = true;\r\n }\r\n if (cacheItem.expired) {\r\n ownerStorage.removeKey(key);\r\n return value;\r\n }\r\n return cacheItem.value;\r\n }\r\n else {\r\n return value;\r\n }\r\n }\r\n else {\r\n return value;\r\n }\r\n };\r\n /**\r\n * Clears cache for specific owner or everything.\r\n *\r\n * @param owner Owner to clear cache for\r\n */\r\n Cache.prototype.clear = function (owner) {\r\n if (owner) {\r\n this._storage.removeKey(owner);\r\n }\r\n else {\r\n this._storage.clear();\r\n }\r\n };\r\n return Cache;\r\n}());\r\nexport { Cache };\r\n/**\r\n * ============================================================================\r\n * GLOBAL INSTANCE\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A global instance of cache. Use this instance to cache any values.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport var cache = new Cache();\r\n//# sourceMappingURL=Cache.js.map","import { EventDispatcher } from \"./utils/EventDispatcher\";\r\nimport { Dictionary } from \"./utils/Dictionary\";\r\nimport { cache } from \"./utils/Cache\";\r\nimport * as $type from \"./utils/Type\";\r\nimport * as $string from \"./utils/String\";\r\nimport * as $array from \"./utils/Array\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Registry is used to store miscellaneous system-wide information, like ids,\r\n * maps, themes, and registered classes.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nvar Registry = /** @class */ (function () {\r\n function Registry() {\r\n var _this = this;\r\n /**\r\n * Event dispacther.\r\n */\r\n this.events = new EventDispatcher();\r\n /**\r\n * All currently applied themes. All new chart instances created will\r\n * automatically inherit and retain System's themes.\r\n */\r\n this.themes = [];\r\n /**\r\n * List of all loaded available themes.\r\n *\r\n * Whenever a theme loads, it registers itself in System's `loadedThemes`\r\n * collection.\r\n */\r\n this.loadedThemes = {};\r\n /**\r\n * An indeternal counter used to generate unique IDs.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this._uidCount = 0;\r\n /**\r\n * Keeps register of class references so that they can be instnatiated using\r\n * string key.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this.registeredClasses = {};\r\n /**\r\n * Holds all generated placeholders.\r\n */\r\n this._placeholders = {};\r\n /**\r\n * A list of invalid(ated) [[Sprite]] objects that need to be re-validated\r\n * during next cycle.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this.invalidSprites = {};\r\n /**\r\n * Components are added to this list when their data provider changes to\r\n * a new one or data is added/removed from their data provider.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this.invalidDatas = {};\r\n /**\r\n * Components are added to this list when values of their raw data change.\r\n * Used when we want a smooth animation from one set of values to another.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this.invalidRawDatas = [];\r\n /**\r\n * Components are added to this list when values of their data changes\r\n * (but not data provider itself).\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this.invalidDataItems = [];\r\n /**\r\n * Components are added to this list when their data range (selection) is\r\n * changed, e.g. zoomed.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this.invalidDataRange = [];\r\n /**\r\n * A list of [[Sprite]] objects that have invalid(ated) positions, that need\r\n * to be recalculated.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this.invalidPositions = {};\r\n /**\r\n * A list of [[Container]] objects with invalid(ated) layouts.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this.invalidLayouts = {};\r\n /**\r\n * An array holding all active (non-disposed) top level elemens.\r\n *\r\n * When, for example, a new chart is created, its instance will be added to\r\n * this array, and will be removed when the chart is disposed.\r\n */\r\n this.baseSprites = [];\r\n /**\r\n * An UID-based map of base sprites (top-level charts).\r\n */\r\n this.baseSpritesByUid = {};\r\n /**\r\n * Queued charts (waiting for their turn) to initialize.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/performance/#Daisy_chaining_multiple_charts} for more information\r\n */\r\n this.queue = [];\r\n /**\r\n * An array of deferred charts that haven't been created yet.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/performance/#Deferred_daisy_chained_instantiation} for more information\r\n * @since 4.10.0\r\n */\r\n this.deferred = [];\r\n this.uid = this.getUniqueId();\r\n this.invalidSprites.noBase = [];\r\n this.invalidDatas.noBase = [];\r\n this.invalidLayouts.noBase = [];\r\n this.invalidPositions.noBase = [];\r\n // This is needed for Angular Universal SSR\r\n if (typeof addEventListener !== \"undefined\") {\r\n // This is needed to prevent charts from being cut off when printing\r\n addEventListener(\"beforeprint\", function () {\r\n $array.each(_this.baseSprites, function (sprite) {\r\n var svg = sprite.paper.svg;\r\n svg.setAttribute(\"viewBox\", \"0 0 \" + svg.clientWidth + \" \" + svg.clientHeight);\r\n });\r\n });\r\n addEventListener(\"afterprint\", function () {\r\n $array.each(_this.baseSprites, function (sprite) {\r\n var svg = sprite.paper.svg;\r\n svg.removeAttribute(\"viewBox\");\r\n });\r\n });\r\n }\r\n }\r\n /**\r\n * Generates a unique chart system-wide ID.\r\n *\r\n * @return Generated ID\r\n */\r\n Registry.prototype.getUniqueId = function () {\r\n var uid = this._uidCount;\r\n this._uidCount += 1;\r\n return \"id-\" + uid;\r\n };\r\n Object.defineProperty(Registry.prototype, \"map\", {\r\n /**\r\n * Returns a universal collection for mapping ids with objects.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Map collection\r\n */\r\n get: function () {\r\n if (!this._map) {\r\n this._map = new Dictionary();\r\n }\r\n return this._map;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Caches value in object's cache.\r\n *\r\n * @ignore Exclude from docs\r\n * @param key Key\r\n * @param value Value\r\n * @param ttl TTL in seconds\r\n */\r\n Registry.prototype.setCache = function (key, value, ttl) {\r\n cache.set(this.uid, key, value, ttl);\r\n };\r\n /**\r\n * Retrieves cached value.\r\n *\r\n * @ignore Exclude from docs\r\n * @param key Key\r\n * @param value Value to return if cache is not available\r\n * @return Value\r\n */\r\n Registry.prototype.getCache = function (key, value) {\r\n if (value === void 0) { value = undefined; }\r\n return cache.get(this.uid, key, value);\r\n };\r\n /**\r\n * Dispatches an event using own event dispatcher. Will automatically\r\n * populate event data object with event type and target (this element).\r\n * It also checks if there are any handlers registered for this sepecific\r\n * event.\r\n *\r\n * @param eventType Event type (name)\r\n * @param data Data to pass into event handler(s)\r\n */\r\n Registry.prototype.dispatch = function (eventType, data) {\r\n // @todo Implement proper type check\r\n if (this.events.isEnabled(eventType)) {\r\n if (data) {\r\n data.type = eventType;\r\n data.target = data.target || this;\r\n this.events.dispatch(eventType, {\r\n type: eventType,\r\n target: this\r\n });\r\n }\r\n else {\r\n this.events.dispatch(eventType, {\r\n type: eventType,\r\n target: this\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * Works like `dispatch`, except event is triggered immediately, without\r\n * waiting for the next frame cycle.\r\n *\r\n * @param eventType Event type (name)\r\n * @param data Data to pass into event handler(s)\r\n */\r\n Registry.prototype.dispatchImmediately = function (eventType, data) {\r\n // @todo Implement proper type check\r\n if (this.events.isEnabled(eventType)) {\r\n if (data) {\r\n data.type = eventType;\r\n data.target = data.target || this;\r\n this.events.dispatchImmediately(eventType, data);\r\n }\r\n else {\r\n this.events.dispatchImmediately(eventType, {\r\n type: eventType,\r\n target: this\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * Returns a unique placeholder suitable for the key.\r\n *\r\n * @param key Key\r\n * @return Random string to be used as placeholder\r\n */\r\n Registry.prototype.getPlaceholder = function (key) {\r\n if ($type.hasValue(this._placeholders[key])) {\r\n return this._placeholders[key];\r\n }\r\n this._placeholders[key] = \"__amcharts_\" + key + \"_\" + $string.random(8) + \"__\";\r\n return this._placeholders[key];\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Registry.prototype.addToInvalidComponents = function (component) {\r\n if (component.baseId) {\r\n $array.move(this.invalidDatas[component.baseId], component);\r\n }\r\n else {\r\n $array.move(this.invalidDatas[\"noBase\"], component);\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Registry.prototype.removeFromInvalidComponents = function (component) {\r\n if (component.baseId) {\r\n $array.remove(this.invalidDatas[component.baseId], component);\r\n }\r\n $array.remove(this.invalidDatas[\"noBase\"], component);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Registry.prototype.addToInvalidSprites = function (sprite) {\r\n if (sprite.baseId) {\r\n $array.add(this.invalidSprites[sprite.baseId], sprite);\r\n }\r\n else {\r\n $array.add(this.invalidSprites[\"noBase\"], sprite);\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Registry.prototype.removeFromInvalidSprites = function (sprite) {\r\n if (sprite.baseId) {\r\n $array.remove(this.invalidSprites[sprite.baseId], sprite);\r\n }\r\n $array.remove(this.invalidSprites[\"noBase\"], sprite);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Registry.prototype.addToInvalidPositions = function (sprite) {\r\n if (sprite.baseId) {\r\n $array.add(this.invalidPositions[sprite.baseId], sprite);\r\n }\r\n else {\r\n $array.add(this.invalidPositions[\"noBase\"], sprite);\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Registry.prototype.removeFromInvalidPositions = function (sprite) {\r\n if (sprite.baseId) {\r\n $array.remove(this.invalidPositions[sprite.baseId], sprite);\r\n }\r\n $array.remove(this.invalidPositions[\"noBase\"], sprite);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Registry.prototype.addToInvalidLayouts = function (sprite) {\r\n if (sprite.baseId) {\r\n $array.add(this.invalidLayouts[sprite.baseId], sprite);\r\n }\r\n else {\r\n $array.add(this.invalidLayouts[\"noBase\"], sprite);\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Registry.prototype.removeFromInvalidLayouts = function (sprite) {\r\n if (sprite.baseId) {\r\n $array.remove(this.invalidLayouts[sprite.baseId], sprite);\r\n }\r\n $array.remove(this.invalidLayouts[\"noBase\"], sprite);\r\n };\r\n return Registry;\r\n}());\r\nexport { Registry };\r\n/**\r\n * A singleton global instance of [[Registry]].\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport var registry = new Registry();\r\n/**\r\n * Returns `true` if object is an instance of the class. It's the same as `instanceof` except it doesn't need to import the class.\r\n *\r\n * @param object Object\r\n * @param name Class name\r\n * @return Is instance of class\r\n */\r\nexport function is(object, name) {\r\n var x = registry.registeredClasses[name];\r\n return x != null && object instanceof x;\r\n}\r\n//# sourceMappingURL=Registry.js.map","import { __extends, __generator } from \"tslib\";\r\nimport { Disposer, MultiDisposer } from \"./Disposer\";\r\nimport { EventDispatcher } from \"./EventDispatcher\";\r\nimport * as $array from \"./Array\";\r\nimport * as $iter from \"./Iterator\";\r\n/**\r\n * @todo Description\r\n */\r\nvar IndexedIterable = /** @class */ (function () {\r\n /**\r\n * Constructor.\r\n *\r\n * @param array List items\r\n * @param start Start index\r\n * @param end End index\r\n */\r\n function IndexedIterable(array, start, end) {\r\n this._array = array;\r\n this._start = start;\r\n this._end = end;\r\n }\r\n /**\r\n * Returns a list item iterator.\r\n *\r\n * @return Iterator\r\n */\r\n IndexedIterable.prototype.iterator = function () {\r\n var _this = this;\r\n return function (push) {\r\n if (_this._start !== _this._end) {\r\n if (_this._start < _this._end) {\r\n for (var i = _this._start; i < _this._end; ++i) {\r\n if (!push(_this._array[i])) {\r\n break;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = _this._start - 1; i >= _this._end; --i) {\r\n if (!push(_this._array[i])) {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n };\r\n };\r\n /**\r\n * Returns an interable list sorted backwards than current list.\r\n *\r\n * @return List\r\n */\r\n IndexedIterable.prototype.backwards = function () {\r\n return new IndexedIterable(this._array, this._end, this._start);\r\n };\r\n /**\r\n * Returns a new list consisting only of specific range of items between\r\n * `start` and `end` indexes.\r\n *\r\n * @param start Start index\r\n * @param end End index\r\n * @return List\r\n */\r\n IndexedIterable.prototype.range = function (start, end) {\r\n if (start <= end) {\r\n if (this._start === this._end) {\r\n return this;\r\n }\r\n else if (this._start < this._end) {\r\n var diff = end - start;\r\n start = Math.max(this._start + start, this._start);\r\n end = Math.min(start + diff, this._end);\r\n return new IndexedIterable(this._array, start, end);\r\n }\r\n else {\r\n var diff = end - start;\r\n start = Math.max(this._start - start, this._end);\r\n end = Math.max(start - diff, this._end);\r\n return new IndexedIterable(this._array, start, end);\r\n }\r\n }\r\n else {\r\n throw new Error(\"Start index must be lower than end index\");\r\n }\r\n };\r\n return IndexedIterable;\r\n}());\r\nexport { IndexedIterable };\r\n/**\r\n * ListGrouper organizes [[List]] items into groups.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nvar ListGrouper = /** @class */ (function (_super) {\r\n __extends(ListGrouper, _super);\r\n /**\r\n * Constructor.\r\n */\r\n function ListGrouper(list, getKey, sort) {\r\n var _this = _super.call(this, [\r\n list.events.on(\"inserted\", function (x) {\r\n var value = x.newValue;\r\n var key = _this._getKey(value);\r\n var index = 0;\r\n $iter.eachContinue(list.iterator(), function (x) {\r\n if (x === value) {\r\n return false;\r\n }\r\n else if (_this._getKey(x) === key) {\r\n ++index;\r\n }\r\n return true;\r\n });\r\n _this._insert(value, key, index);\r\n }, undefined, false),\r\n list.events.on(\"removed\", function (x) {\r\n _this._remove(x.oldValue);\r\n }, undefined, false)\r\n ]) || this;\r\n /**\r\n * Grouping keys.\r\n */\r\n _this._keys = [];\r\n /**\r\n * List item groups.\r\n */\r\n _this._groups = {};\r\n _this._getKey = getKey;\r\n _this._sort = sort;\r\n $iter.each(list.iterator(), function (x) {\r\n _this._insert(x, getKey(x));\r\n });\r\n return _this;\r\n }\r\n /**\r\n * Inserts an item (`x`) to a specific group (`key`) and specific `index`.\r\n *\r\n * @param x Item\r\n * @param key Group name\r\n * @param index Index\r\n */\r\n ListGrouper.prototype._insert = function (x, key, index) {\r\n if (this._groups[key] == null) {\r\n this._groups[key] = [];\r\n // TODO code duplication with SortedList\r\n var _a = $array.getSortedIndex(this._keys, this._sort, key), found = _a.found, index_1 = _a.index;\r\n if (found) {\r\n throw new Error(\"Key already exists: \" + key);\r\n }\r\n else {\r\n $array.insertIndex(this._keys, index_1, key);\r\n }\r\n }\r\n if (index == null) {\r\n this._groups[key].push(x);\r\n }\r\n else {\r\n $array.insertIndex(this._groups[key], index, x);\r\n }\r\n };\r\n /**\r\n * Removes an item from the list.\r\n *\r\n * @param x Item to remove\r\n */\r\n ListGrouper.prototype._remove = function (x) {\r\n var key = this._getKey(x);\r\n var values = this._groups[key];\r\n if (values != null) {\r\n $array.remove(values, x);\r\n if (values.length === 0) {\r\n delete this._groups[key];\r\n var _a = $array.getSortedIndex(this._keys, this._sort, key), found = _a.found, index = _a.index;\r\n if (found) {\r\n $array.removeIndex(this._keys, index);\r\n }\r\n else {\r\n throw new Error(\"Key doesn't exist: \" + key);\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Returns an iterator for the list.\r\n *\r\n * The iterator will iterate through all items in all groups.\r\n *\r\n * @return Iterator\r\n */\r\n ListGrouper.prototype.iterator = function () {\r\n var _this = this;\r\n return $iter.flatten($iter.map($iter.fromArray(this._keys), function (key) {\r\n return $iter.fromArray(_this._groups[key]);\r\n }));\r\n };\r\n return ListGrouper;\r\n}(MultiDisposer));\r\nexport { ListGrouper };\r\n/**\r\n * A disposable list, which when disposed itself will call `dispose()` method\r\n * on all its items.\r\n */\r\nvar ListDisposer = /** @class */ (function (_super) {\r\n __extends(ListDisposer, _super);\r\n function ListDisposer(list, disposeOnRemove) {\r\n if (disposeOnRemove === void 0) { disposeOnRemove = true; }\r\n var _this = this;\r\n if (disposeOnRemove) {\r\n var disposer_1 = list.events.on(\"removed\", function (x) {\r\n x.oldValue.dispose();\r\n }, undefined, false);\r\n _this = _super.call(this, function () {\r\n disposer_1.dispose();\r\n // TODO clear the list ?\r\n $iter.each(list.iterator(), function (x) {\r\n x.dispose();\r\n });\r\n }) || this;\r\n }\r\n else {\r\n _this = _super.call(this, function () {\r\n // TODO clear the list ?\r\n $iter.each(list.iterator(), function (x) {\r\n x.dispose();\r\n });\r\n }) || this;\r\n }\r\n return _this;\r\n }\r\n return ListDisposer;\r\n}(Disposer));\r\nexport { ListDisposer };\r\n/**\r\n * Checks if specific index fits into length.\r\n *\r\n * @param index Index\r\n * @param len Length\r\n */\r\nfunction checkBounds(index, len) {\r\n if (!(index >= 0 && index < len)) {\r\n throw new Error(\"Index out of bounds: \" + index);\r\n }\r\n}\r\n/**\r\n * A List class is used to hold a number of indexed items of the same type.\r\n */\r\nvar List = /** @class */ (function () {\r\n /**\r\n * Constructor\r\n *\r\n * @param initial Inital list of values to add to list\r\n */\r\n function List(initial) {\r\n if (initial === void 0) { initial = []; }\r\n /**\r\n * Event dispatcher.\r\n */\r\n this.events = new EventDispatcher();\r\n this._values = initial;\r\n }\r\n Object.defineProperty(List.prototype, \"values\", {\r\n /**\r\n * An array of values in the list.\r\n *\r\n * Do not use this property to add values. Rather use dedicated methods, like\r\n * `push()`, `removeIndex()`, etc.\r\n *\r\n * @readonly\r\n * @return List values\r\n */\r\n get: function () {\r\n return this._values;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Checks if list contains specific item reference.\r\n *\r\n * @param item Item to search for\r\n * @return `true` if found, `false` if not found\r\n */\r\n List.prototype.contains = function (value) {\r\n return this._values.indexOf(value) !== -1;\r\n };\r\n /**\r\n * Removes specific item from the list.\r\n *\r\n * @param item An item to remove\r\n */\r\n List.prototype.removeValue = function (value) {\r\n var i = 0;\r\n var length = this._values.length;\r\n while (i < length) {\r\n // TODO handle NaN\r\n if (this._values[i] === value) {\r\n this.removeIndex(i);\r\n --length;\r\n }\r\n else {\r\n ++i;\r\n }\r\n }\r\n };\r\n /**\r\n * Searches the list for specific item and returns its index.\r\n *\r\n * @param item An item to search for\r\n * @return Index or -1 if not found\r\n */\r\n List.prototype.indexOf = function (value) {\r\n return $array.indexOf(this._values, value);\r\n };\r\n Object.defineProperty(List.prototype, \"length\", {\r\n /**\r\n * Number of items in list.\r\n *\r\n * @readonly\r\n * @return Number of items\r\n */\r\n get: function () {\r\n return this._values.length;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Checks if there's a value at specific index.\r\n *\r\n * @param index Index\r\n * @return Value exists?\r\n */\r\n List.prototype.hasIndex = function (index) {\r\n return index >= 0 && index < this._values.length;\r\n };\r\n /**\r\n * Returns an item at specified index.\r\n *\r\n * @param index Index\r\n * @return List item\r\n */\r\n List.prototype.getIndex = function (index) {\r\n return this._values[index];\r\n };\r\n /**\r\n * Sets value at specific index.\r\n *\r\n * If there's already a value at the index, it is overwritten.\r\n *\r\n * @param index Index\r\n * @param value New value\r\n * @return New value\r\n */\r\n List.prototype.setIndex = function (index, value) {\r\n checkBounds(index, this._values.length);\r\n var oldValue = this._values[index];\r\n // Do nothing if the old value and the new value are the same\r\n if (oldValue !== value) {\r\n this._values[index] = value;\r\n if (this.events.isEnabled(\"setIndex\")) {\r\n this.events.dispatchImmediately(\"setIndex\", {\r\n type: \"setIndex\",\r\n target: this,\r\n index: index,\r\n oldValue: oldValue,\r\n newValue: value\r\n });\r\n }\r\n if (this.events.isEnabled(\"removed\")) {\r\n this.events.dispatchImmediately(\"removed\", {\r\n type: \"removed\",\r\n target: this,\r\n oldValue: oldValue\r\n });\r\n }\r\n if (this.events.isEnabled(\"inserted\")) {\r\n this.events.dispatchImmediately(\"inserted\", {\r\n type: \"inserted\",\r\n target: this,\r\n newValue: value\r\n });\r\n }\r\n }\r\n return oldValue;\r\n };\r\n /**\r\n * Adds an item to the list at a specific index, which pushes all the other\r\n * items further down the list.\r\n *\r\n * @param index Index\r\n * @param item An item to add\r\n */\r\n List.prototype.insertIndex = function (index, value) {\r\n checkBounds(index, this._values.length + 1);\r\n $array.insertIndex(this._values, index, value);\r\n if (this.events.isEnabled(\"insertIndex\")) {\r\n this.events.dispatchImmediately(\"insertIndex\", {\r\n type: \"insertIndex\",\r\n target: this,\r\n index: index,\r\n newValue: value\r\n });\r\n }\r\n if (this.events.isEnabled(\"inserted\")) {\r\n this.events.dispatchImmediately(\"inserted\", {\r\n type: \"inserted\",\r\n target: this,\r\n newValue: value\r\n });\r\n }\r\n };\r\n /**\r\n * [_sortQuicksort description]\r\n *\r\n * @todo Description\r\n * @param low [description]\r\n * @param high [description]\r\n * @param order [description]\r\n */\r\n List.prototype._sortQuicksort = function (low, high, order) {\r\n if (low < high) {\r\n var p = this._sortPartition(low, high, order);\r\n this._sortQuicksort(low, p, order);\r\n this._sortQuicksort(p + 1, high, order);\r\n }\r\n };\r\n /**\r\n * [_sortPartition description]\r\n *\r\n * @todo Description\r\n * @param low [description]\r\n * @param high [description]\r\n * @param order [description]\r\n * @return [description]\r\n */\r\n List.prototype._sortPartition = function (low, high, order) {\r\n var values = this._values;\r\n var pivot = values[low];\r\n var i = low - 1;\r\n var j = high + 1;\r\n for (;;) {\r\n do {\r\n ++i;\r\n } while (order(values[i], pivot) < 0);\r\n do {\r\n --j;\r\n } while (order(values[j], pivot) > 0);\r\n if (i >= j) {\r\n return j;\r\n }\r\n else {\r\n this.swap(i, j);\r\n }\r\n }\r\n };\r\n /**\r\n * Reorders list items according to specific ordering function.\r\n *\r\n * @param order Ordering function\r\n */\r\n List.prototype.sort = function (order) {\r\n // https://en.wikipedia.org/wiki/Quicksort#Hoare_partition_scheme\r\n // @todo faster implementation of this\r\n // @todo test this\r\n this._sortQuicksort(0, this._values.length - 1, order);\r\n };\r\n /**\r\n * Swaps indexes of two items in the list.\r\n *\r\n * @param a Item 1\r\n * @param b Item 2\r\n */\r\n List.prototype.swap = function (a, b) {\r\n var len = this._values.length;\r\n checkBounds(a, len);\r\n checkBounds(b, len);\r\n if (a !== b) {\r\n var value_a = this._values[a];\r\n var value_b = this._values[b];\r\n this._values[a] = value_b;\r\n if (this.events.isEnabled(\"setIndex\")) {\r\n this.events.dispatchImmediately(\"setIndex\", {\r\n type: \"setIndex\",\r\n target: this,\r\n index: a,\r\n oldValue: value_a,\r\n newValue: value_b\r\n });\r\n }\r\n this._values[b] = value_a;\r\n if (this.events.isEnabled(\"setIndex\")) {\r\n this.events.dispatchImmediately(\"setIndex\", {\r\n type: \"setIndex\",\r\n target: this,\r\n index: b,\r\n oldValue: value_b,\r\n newValue: value_a\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * Removes a value at specific index.\r\n *\r\n * @param index Index of value to remove\r\n * @return Removed value\r\n */\r\n List.prototype.removeIndex = function (index) {\r\n checkBounds(index, this._values.length);\r\n var oldValue = this._values[index];\r\n $array.removeIndex(this._values, index);\r\n if (this.events.isEnabled(\"removeIndex\")) {\r\n this.events.dispatchImmediately(\"removeIndex\", {\r\n type: \"removeIndex\",\r\n target: this,\r\n index: index,\r\n oldValue: oldValue\r\n });\r\n }\r\n if (this.events.isEnabled(\"removed\")) {\r\n this.events.dispatchImmediately(\"removed\", {\r\n type: \"removed\",\r\n target: this,\r\n oldValue: oldValue\r\n });\r\n }\r\n return oldValue;\r\n };\r\n /**\r\n * Moves an item to a specific index within the list.\r\n *\r\n * If the index is not specified it will move the item to the end of the\r\n * list.\r\n *\r\n * @param value Item to move\r\n * @param index Index to place item at\r\n */\r\n List.prototype.moveValue = function (value, toIndex) {\r\n // TODO don't do anything if the desired index is the same as the current index\r\n var index = this.indexOf(value);\r\n // TODO remove all old values rather than only the first ?\r\n if (index !== -1) {\r\n var oldValue = this._values[index];\r\n $array.removeIndex(this._values, index);\r\n if (this.events.isEnabled(\"removeIndex\")) {\r\n this.events.dispatchImmediately(\"removeIndex\", {\r\n type: \"removeIndex\",\r\n target: this,\r\n index: index,\r\n oldValue: oldValue\r\n });\r\n }\r\n }\r\n if (toIndex == null) {\r\n toIndex = this._values.length;\r\n this._values.push(value);\r\n }\r\n else {\r\n $array.insertIndex(this._values, toIndex, value);\r\n }\r\n if (this.events.isEnabled(\"insertIndex\")) {\r\n this.events.dispatchImmediately(\"insertIndex\", {\r\n type: \"insertIndex\",\r\n target: this,\r\n index: toIndex,\r\n newValue: value\r\n });\r\n }\r\n if (index === -1) {\r\n if (this.events.isEnabled(\"inserted\")) {\r\n this.events.dispatchImmediately(\"inserted\", {\r\n type: \"inserted\",\r\n target: this,\r\n newValue: value\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * Adds an item to the end of the list.\r\n *\r\n * @param item An item to add\r\n */\r\n List.prototype.push = function (value) {\r\n var index = this._values.push(value) - 1;\r\n if (this.events.isEnabled(\"insertIndex\")) {\r\n this.events.dispatchImmediately(\"insertIndex\", {\r\n type: \"insertIndex\",\r\n target: this,\r\n index: index,\r\n newValue: value\r\n });\r\n }\r\n if (this.events.isEnabled(\"inserted\")) {\r\n this.events.dispatchImmediately(\"inserted\", {\r\n type: \"inserted\",\r\n target: this,\r\n newValue: value\r\n });\r\n }\r\n return value;\r\n };\r\n /**\r\n * Adds an item as a first item in the list.\r\n *\r\n * @param item An item to add\r\n */\r\n List.prototype.unshift = function (value) {\r\n this.insertIndex(0, value);\r\n };\r\n /**\r\n * Adds multiple items to the list.\r\n *\r\n * @param items An Array of items to add\r\n */\r\n List.prototype.pushAll = function (values) {\r\n var _this = this;\r\n $array.each(values, function (value) {\r\n _this.push(value);\r\n });\r\n };\r\n /**\r\n * Copies and adds items from abother list.\r\n *\r\n * @param source A list top copy items from\r\n */\r\n List.prototype.copyFrom = function (source) {\r\n this.pushAll(source._values);\r\n };\r\n /**\r\n * Returns the last item from the list, and removes it.\r\n *\r\n * @return Item\r\n */\r\n List.prototype.pop = function () {\r\n var index = this._values.length - 1;\r\n return index < 0 ? undefined : this.removeIndex(this._values.length - 1);\r\n };\r\n /**\r\n * Returns the first item from the list, and removes it.\r\n *\r\n * @return Item\r\n */\r\n List.prototype.shift = function () {\r\n return this._values.length ? this.removeIndex(0) : undefined;\r\n };\r\n /**\r\n * Sets multiple items to the list.\r\n *\r\n * All current items are removed.\r\n *\r\n * @param newArray New items\r\n */\r\n List.prototype.setAll = function (newArray) {\r\n var _this = this;\r\n // @tod if a value exists in both the new and old arrays, don't send remove/insert events\r\n var oldArray = $array.copy(this._values);\r\n this._values.length = 0;\r\n $array.each(newArray, function (value) {\r\n _this._values.push(value);\r\n });\r\n if (this.events.isEnabled(\"setAll\")) {\r\n this.events.dispatchImmediately(\"setAll\", {\r\n type: \"setAll\",\r\n target: this,\r\n oldArray: oldArray,\r\n newArray: this._values // TODO make a copy ?\r\n });\r\n }\r\n if (this.events.isEnabled(\"removed\")) {\r\n $array.each(oldArray, function (x) {\r\n _this.events.dispatchImmediately(\"removed\", {\r\n type: \"removed\",\r\n target: _this,\r\n oldValue: x\r\n });\r\n });\r\n }\r\n if (this.events.isEnabled(\"inserted\")) {\r\n $array.each(this._values, function (x) {\r\n _this.events.dispatchImmediately(\"inserted\", {\r\n type: \"inserted\",\r\n target: _this,\r\n newValue: x\r\n });\r\n });\r\n }\r\n };\r\n /**\r\n * Removes all items from the list.\r\n */\r\n List.prototype.clear = function () {\r\n this.setAll([]);\r\n };\r\n /**\r\n * Returns a list iterator.\r\n *\r\n * @return Iterator\r\n */\r\n List.prototype.iterator = function () {\r\n return $iter.fromArray(this._values);\r\n };\r\n /**\r\n * Returns an ES6 iterator for the list.\r\n */\r\n List.prototype[Symbol.iterator] = function () {\r\n var length, i;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n length = this._values.length;\r\n i = 0;\r\n _a.label = 1;\r\n case 1:\r\n if (!(i < length)) return [3 /*break*/, 4];\r\n return [4 /*yield*/, this._values[i]];\r\n case 2:\r\n _a.sent();\r\n _a.label = 3;\r\n case 3:\r\n ++i;\r\n return [3 /*break*/, 1];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n };\r\n /**\r\n * Calls `f` for each element in the list.\r\n *\r\n * `f` should have at least one parameter defined which will get a current\r\n * item, with optional second argument - index.\r\n */\r\n List.prototype.each = function (f) {\r\n $array.each(this._values, f);\r\n };\r\n /**\r\n * Returns a specific range of list items, which can be iterated.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Code duplication with IndexedIterable\r\n * @param start Start index\r\n * @param end End index\r\n * @return Range\r\n */\r\n List.prototype.range = function (start, end) {\r\n if (start <= end) {\r\n var diff = end - start;\r\n start = Math.max(start, 0);\r\n end = Math.min(start + diff, this._values.length);\r\n return new IndexedIterable(this._values, start, end);\r\n }\r\n else {\r\n throw new Error(\"Start index must be lower than end index\");\r\n }\r\n };\r\n /**\r\n * Returns an iterator that has list items sorted backwards.\r\n *\r\n * @ignore Exclude from docs\r\n * @return List\r\n */\r\n List.prototype.backwards = function () {\r\n return new IndexedIterable(this._values, this._values.length, 0);\r\n };\r\n return List;\r\n}());\r\nexport { List };\r\n/**\r\n * A version of a [[List]] that has a \"template\".\r\n *\r\n * A template is an instance of an object, that can be used to create new\r\n * elements in the list without actually needing to create instances for those.\r\n *\r\n * When new element is created in the list, e.g. by calling its `create()`\r\n * method, an exact copy of the element is created (including properties and\r\n * other attributes), inserted into the list and returned.\r\n */\r\nvar ListTemplate = /** @class */ (function (_super) {\r\n __extends(ListTemplate, _super);\r\n /**\r\n * Constructor\r\n *\r\n * @param t Template object\r\n */\r\n function ListTemplate(t) {\r\n var _this = _super.call(this) || this;\r\n _this.template = t;\r\n return _this;\r\n }\r\n Object.defineProperty(ListTemplate.prototype, \"template\", {\r\n /**\r\n * @return Template object\r\n */\r\n get: function () {\r\n return this._template;\r\n },\r\n /**\r\n * A \"template\" object to copy all properties from when creating new list\r\n * items.\r\n *\r\n * @param v Template object\r\n */\r\n set: function (v) {\r\n v.isTemplate = true;\r\n this._template = v;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies all elements from other list.\r\n *\r\n * @param source Source list\r\n */\r\n ListTemplate.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n $iter.each(source.iterator(), function (value) {\r\n _this.push(value.clone());\r\n });\r\n };\r\n ListTemplate.prototype.create = function (make) {\r\n var clone = (make != null\r\n ? new make()\r\n : this.template.clone());\r\n this.push(clone);\r\n return clone;\r\n };\r\n /**\r\n * Creates an exact clone of the list, including its items and template.\r\n *\r\n * @return New list\r\n */\r\n ListTemplate.prototype.clone = function () {\r\n var out = new ListTemplate(this.template);\r\n var values = this.values;\r\n var length = values.length;\r\n for (var i = 0; i < length; ++i) {\r\n out.push(values[i].clone());\r\n }\r\n return out;\r\n };\r\n return ListTemplate;\r\n}(List));\r\nexport { ListTemplate };\r\n//# sourceMappingURL=List.js.map","import { __extends, __generator } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { EventDispatcher } from \"./EventDispatcher\";\r\nimport * as $array from \"./Array\";\r\nimport * as $iter from \"./Iterator\";\r\nimport * as $type from \"./Type\";\r\n/**\r\n * Ordered list contains values of any type in an indexed array.\r\n */\r\nvar OrderedList = /** @class */ (function () {\r\n /**\r\n * Constructor\r\n *\r\n * @param initial Inital list of values to add to list\r\n */\r\n function OrderedList(initial) {\r\n /**\r\n * Holds list values.\r\n */\r\n this._values = [];\r\n /**\r\n * Event dispatcher.\r\n */\r\n this.events = new EventDispatcher();\r\n if (initial != null) {\r\n this.setAll(initial);\r\n }\r\n }\r\n Object.defineProperty(OrderedList.prototype, \"values\", {\r\n /**\r\n * All items of the list.\r\n *\r\n * Do not modify the list directly. Rather use `insert()` and `remove()`\r\n * methods.\r\n *\r\n * @return List values\r\n */\r\n get: function () {\r\n return this._values;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Inserts a value into list item array.\r\n *\r\n * @param value Value\r\n */\r\n OrderedList.prototype._insert = function (value) {\r\n this._values.push(value);\r\n return this._values.length - 1;\r\n };\r\n Object.defineProperty(OrderedList.prototype, \"length\", {\r\n /**\r\n * Number of items in the list.\r\n *\r\n * @readonly\r\n * @return Length\r\n */\r\n get: function () {\r\n return this._values.length;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns the index of the specific `value`.\r\n *\r\n * -1 if not found.\r\n *\r\n * @param value Value\r\n * @return Index\r\n */\r\n OrderedList.prototype.indexOf = function (value) {\r\n return $array.indexOf(this._values, value);\r\n };\r\n /**\r\n * Checks if list contains the `value`.\r\n *\r\n * @param value Value\r\n * @return In the list?\r\n */\r\n OrderedList.prototype.contains = function (value) {\r\n return this.indexOf(value) !== -1;\r\n };\r\n /**\r\n * Returns an item at specific `index`.\r\n *\r\n * @param index Index\r\n * @return Item\r\n */\r\n OrderedList.prototype.getIndex = function (index) {\r\n return this._values[index];\r\n };\r\n Object.defineProperty(OrderedList.prototype, \"first\", {\r\n /**\r\n * First item in the list.\r\n *\r\n * @return Item\r\n */\r\n get: function () {\r\n return this._values[0];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(OrderedList.prototype, \"last\", {\r\n /**\r\n * Last item in the list.\r\n *\r\n * @return Item\r\n */\r\n get: function () {\r\n return this._values[this._values.length - 1];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Inserts a value into list.\r\n *\r\n * @param value Value\r\n */\r\n OrderedList.prototype.insert = function (value) {\r\n var index = this._insert(value);\r\n if (this.events.isEnabled(\"inserted\")) {\r\n this.events.dispatchImmediately(\"inserted\", {\r\n type: \"inserted\",\r\n target: this,\r\n index: index,\r\n newValue: value\r\n });\r\n }\r\n };\r\n /**\r\n * Removes an item with the `value` from the list.\r\n *\r\n * @param value Value\r\n */\r\n OrderedList.prototype.remove = function (value) {\r\n var index = this.indexOf(value);\r\n if (index !== -1) {\r\n var oldValue = this._values[index];\r\n $array.removeIndex(this._values, index);\r\n if (this.events.isEnabled(\"removed\")) {\r\n this.events.dispatchImmediately(\"removed\", {\r\n type: \"removed\",\r\n target: this,\r\n index: index,\r\n oldValue: oldValue,\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * Sets multiple items to the list.\r\n *\r\n * All current items are removed.\r\n *\r\n * @param newArray New items\r\n */\r\n OrderedList.prototype.setAll = function (newArray) {\r\n var _this = this;\r\n $array.eachReverse(this._values, function (x, i) {\r\n _this._values.pop();\r\n if (_this.events.isEnabled(\"removed\")) {\r\n _this.events.dispatchImmediately(\"removed\", {\r\n type: \"removed\",\r\n target: _this,\r\n index: i,\r\n oldValue: x\r\n });\r\n }\r\n });\r\n $array.each(newArray, function (value) {\r\n _this.insert(value);\r\n });\r\n };\r\n /**\r\n * Removes all items from the list.\r\n */\r\n OrderedList.prototype.clear = function () {\r\n this.setAll([]);\r\n };\r\n /**\r\n * Returns part of the list between `start` and `end` indexes, as a new\r\n * [[OrderedList]].\r\n *\r\n * @param start Start index\r\n * @param end End index\r\n * @return Items in range\r\n */\r\n OrderedList.prototype.slice = function (start, end) {\r\n var out = new OrderedList();\r\n out._values = this._values.slice(start, end);\r\n return out;\r\n };\r\n /**\r\n * Finds a closest available index to the `value` in specified direction.\r\n *\r\n * @ignore exclude from docs\r\n * @param value value to search for\r\n * @param fn A callback function that returns value of the item\r\n * @param direction Direciton\r\n * @return Index\r\n */\r\n OrderedList.prototype.findClosestIndex = function (value, fn, direction) {\r\n if (direction === void 0) { direction = \"any\"; }\r\n // Init temporary values\r\n var closestIndex = -1;\r\n var closestValue;\r\n var closestDifference;\r\n var i = 0;\r\n $iter.eachContinue(this.iterator(), function (element) {\r\n var item = fn(element);\r\n // Calc difference\r\n if (direction === \"any\") {\r\n // Exact match?\r\n if (item === value) {\r\n // Found exact value - don't bother searching further\r\n closestIndex = i;\r\n return false;\r\n }\r\n var difference = Math.abs(value - item);\r\n if (!$type.hasValue(closestDifference) || (closestDifference > difference)) {\r\n closestIndex = i;\r\n closestValue = item;\r\n closestDifference = difference;\r\n }\r\n }\r\n else if (direction === \"left\" && (item < value)) {\r\n if (!$type.hasValue(closestValue) || (closestValue < item)) {\r\n closestIndex = i;\r\n closestValue = item;\r\n }\r\n }\r\n else if (direction === \"right\" && (item >= value)) {\r\n if (!$type.hasValue(closestValue) || (closestValue >= item)) {\r\n closestIndex = i;\r\n closestValue = item;\r\n }\r\n }\r\n ++i;\r\n return true;\r\n });\r\n // Found nothing?\r\n if (closestIndex === -1) {\r\n if (direction === \"left\") {\r\n // Use First one\r\n closestIndex = 0;\r\n }\r\n else if (direction === \"right\") {\r\n // Use last item\r\n closestIndex = this.length - 1;\r\n }\r\n }\r\n return closestIndex;\r\n };\r\n /**\r\n * Returns a list iterator.\r\n *\r\n * @return Iterator\r\n */\r\n OrderedList.prototype.iterator = function () {\r\n return $iter.fromArray(this._values);\r\n };\r\n /**\r\n * Returns an ES6 iterator for the list.\r\n */\r\n OrderedList.prototype[Symbol.iterator] = function () {\r\n var length, i;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n length = this._values.length;\r\n i = 0;\r\n _a.label = 1;\r\n case 1:\r\n if (!(i < length)) return [3 /*break*/, 4];\r\n return [4 /*yield*/, this._values[i]];\r\n case 2:\r\n _a.sent();\r\n _a.label = 3;\r\n case 3:\r\n ++i;\r\n return [3 /*break*/, 1];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n };\r\n /**\r\n * Calls `f` for each element in the list.\r\n */\r\n OrderedList.prototype.each = function (f) {\r\n $array.each(this._values, f);\r\n };\r\n return OrderedList;\r\n}());\r\nexport { OrderedList };\r\n/**\r\n * A list where all items are ordered according to specific ordering function,\r\n * which is passed in via constructor parameter, when creating an instance of\r\n * [[SortedList]].\r\n */\r\nvar SortedList = /** @class */ (function (_super) {\r\n __extends(SortedList, _super);\r\n /**\r\n * Constructor.\r\n *\r\n * @param sort Ordering function\r\n */\r\n function SortedList(sort) {\r\n var _this = _super.call(this) || this;\r\n _this._ordering = sort;\r\n return _this;\r\n }\r\n /**\r\n * Inserts item into the list.\r\n *\r\n * @param value Item\r\n */\r\n SortedList.prototype._insert = function (value) {\r\n var index = $array.getSortedIndex(this._values, this._ordering, value).index;\r\n $array.insertIndex(this._values, index, value);\r\n return index;\r\n };\r\n /**\r\n * Returns index of the item in list if found.\r\n *\r\n * -1 if item is not in the list.\r\n *\r\n * @param value Item to search for\r\n * @return Index\r\n */\r\n SortedList.prototype.indexOf = function (value) {\r\n var _a = $array.getSortedIndex(this._values, this._ordering, value), found = _a.found, index = _a.index;\r\n if (found) {\r\n return index;\r\n }\r\n else {\r\n return -1;\r\n }\r\n };\r\n /**\r\n * [udpate description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param value [description]\r\n */\r\n SortedList.prototype.update = function (value) {\r\n // @todo test this\r\n var index = $array.indexOf(this._values, value);\r\n // @todo throw an error if it doesn't exist ?\r\n if (index !== -1) {\r\n var last = this._values.length - 1;\r\n // Check if the current ordering is correct\r\n if (!((index === 0 || this._ordering(this._values[index - 1], value) < 0) &&\r\n (index === last || this._ordering(value, this._values[index + 1]) < 0))) {\r\n // TODO send remove/insert/move events\r\n $array.removeIndex(this._values, index);\r\n this._insert(value);\r\n }\r\n }\r\n };\r\n return SortedList;\r\n}(OrderedList));\r\nexport { SortedList };\r\n/**\r\n * A version of a [[OrderedList]] that has a \"template\".\r\n *\r\n * A template is an instance of an object, that can be used to create new\r\n * elements in the list without actually needing to create instances for those.\r\n *\r\n * When new element is created in the list, e.g. by calling its `create()`\r\n * method, an exact copy of the element is created (including properties and\r\n * other attributes), inserted into the list and returned.\r\n */\r\nvar OrderedListTemplate = /** @class */ (function (_super) {\r\n __extends(OrderedListTemplate, _super);\r\n /**\r\n * Constructor\r\n *\r\n * @param t Template object\r\n */\r\n function OrderedListTemplate(t) {\r\n var _this = _super.call(this) || this;\r\n _this.template = t;\r\n return _this;\r\n }\r\n Object.defineProperty(OrderedListTemplate.prototype, \"template\", {\r\n /**\r\n * @return Template object\r\n */\r\n get: function () {\r\n return this._template;\r\n },\r\n /**\r\n * A \"template\" object to copy all properties from when creating new list\r\n * items.\r\n *\r\n * @param v Template object\r\n */\r\n set: function (v) {\r\n v.isTemplate = true;\r\n this._template = v;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies all elements from other list.\r\n *\r\n * @param source Source list\r\n */\r\n OrderedListTemplate.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n $iter.each(source.iterator(), function (value) {\r\n _this.insert(value.clone());\r\n });\r\n };\r\n /**\r\n * Returns part of the list, starting at `start` and ending at `end` indexes,\r\n * as a new [[OrderedListTemplate]].\r\n *\r\n * @param start Start index\r\n * @param end End index\r\n * @return New list\r\n */\r\n OrderedListTemplate.prototype.slice = function (start, end) {\r\n var out = new OrderedListTemplate(this.template);\r\n out._values = this._values.slice(start, end);\r\n return out;\r\n };\r\n OrderedListTemplate.prototype.create = function (make) {\r\n var clone = (make != null\r\n ? new make()\r\n : this.template.clone());\r\n this.insert(clone);\r\n return clone;\r\n };\r\n return OrderedListTemplate;\r\n}(OrderedList));\r\nexport { OrderedListTemplate };\r\n/**\r\n * A version of a [[SortedList]] that has a \"template\".\r\n *\r\n * A template is an instance of an object, that can be used to create new\r\n * elements in the list without actually needing to create instances for those.\r\n *\r\n * When new element is created in the list, e.g. by calling its `create()`\r\n * method, an exact copy of the element is created (including properties and\r\n * other attributes), inserted into the list and returned.\r\n */\r\nvar SortedListTemplate = /** @class */ (function (_super) {\r\n __extends(SortedListTemplate, _super);\r\n /**\r\n * Constructor\r\n *\r\n * @param t Template object\r\n * @param sort Ordering function\r\n */\r\n function SortedListTemplate(t, sort) {\r\n var _this = _super.call(this, sort) || this;\r\n _this.template = t;\r\n return _this;\r\n }\r\n Object.defineProperty(SortedListTemplate.prototype, \"template\", {\r\n /**\r\n * @return Template object\r\n */\r\n get: function () {\r\n return this._template;\r\n },\r\n /**\r\n * A \"template\" object to copy all properties from when creating new list\r\n * items.\r\n *\r\n * @param v Template object\r\n */\r\n set: function (v) {\r\n v.isTemplate = true;\r\n this._template = v;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies all elements from other list.\r\n *\r\n * @param source Source list\r\n */\r\n SortedListTemplate.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n $iter.each(source.iterator(), function (value) {\r\n _this.insert(value.clone());\r\n });\r\n };\r\n SortedListTemplate.prototype.create = function (make) {\r\n var clone = (make != null\r\n ? new make()\r\n : this.template.clone());\r\n this.insert(clone);\r\n return clone;\r\n };\r\n return SortedListTemplate;\r\n}(SortedList));\r\nexport { SortedListTemplate };\r\n//# sourceMappingURL=SortedList.js.map","/**\r\n * ============================================================================\r\n * COMPARING FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Comparing function used for ordering.\r\n *\r\n * @ignore Exclude from docs\r\n * @param a Number 1\r\n * @param b Number 2\r\n * @return Result\r\n */\r\nexport function order(a, b) {\r\n if (a === b) {\r\n return 0;\r\n }\r\n else if (a < b) {\r\n return -1;\r\n }\r\n else {\r\n return 1;\r\n }\r\n}\r\n//# sourceMappingURL=Number.js.map","/**\r\n * A collection of functions for ordering.\r\n */\r\n/**\r\n * [reverse description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param a [description]\r\n * @return [description]\r\n */\r\nexport function reverse(a) {\r\n switch (a) {\r\n case 0:\r\n return 0;\r\n case -1:\r\n return 1;\r\n case 1:\r\n return -1;\r\n }\r\n}\r\n/**\r\n * [or description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param a Item 1\r\n * @param b Item 2\r\n * @return [description]\r\n */\r\nexport function or(a, b) {\r\n if (a === 0) {\r\n return b;\r\n }\r\n else {\r\n return a;\r\n }\r\n}\r\n//# sourceMappingURL=Order.js.map","/**\r\n * An Adapter can be used to apply chained synchronous transformations to any\r\n * value at runtime.\r\n *\r\n * Each type class using Adapters must have `adapters` property and adapter\r\n * interface defined.\r\n *\r\n * Adapters can be used to allow external code to apply transformations to any\r\n * value at any time.\r\n *\r\n * For example we have a Weather class which has a method `now()` which returns\r\n * current temperature.\r\n *\r\n * ```\r\n * function now() {\r\n * // ... calculate temperature\r\n * let temp = \"Temperature now is \" + degrees + \"F\";\r\n * return temp;\r\n * }\r\n * ```\r\n *\r\n * Now, supposed we want to let other classes to modify the output of the\r\n * `now()`? We just apply an adapter to the `temp` before it is returned:\r\n *\r\n * ```\r\n * temp = this.adapters.apply(\"now\", {\r\n * temp: temp,\r\n * degrees: degrees\r\n * }).temp;\r\n * ```\r\n *\r\n * Some other class might tap onto it by defining an Adapter that calculates\r\n * the temperature in Celsius:\r\n *\r\n * weather.adapters.add(\"now\", (arg) => {\r\n * arg.temp += \"(\" + farenheitToCelsius(arg.degrees) + \"C)\";\r\n * return arh;\r\n * });\r\n *\r\n * Furthermore some time-related class could add time:\r\n *\r\n * weather.adapters.add(\"now\", (arg) => {\r\n * arg.temp += \"; the time now is \" + (new Date().toLocaleString());\r\n * return arh;\r\n * });\r\n *\r\n * So without adapters we would get output like this:\r\n *\r\n * ```\r\n * Temperature now is 90F\r\n * ```\r\n *\r\n * With adapters applied we now have:\r\n *\r\n * ```\r\n * Temperature now is 90F (32C); the time now is 12/11/2012, 7:00:00 PM\r\n * ```\r\n */\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { SortedList } from \"./SortedList\";\r\nimport * as $number from \"./Number\";\r\nimport * as $order from \"./Order\";\r\nimport * as $iter from \"../utils/Iterator\";\r\nimport * as $array from \"../utils/Array\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $object from \"../utils/Object\";\r\n/**\r\n * ============================================================================\r\n * GLOBAL ADAPTER\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A global adapter is an adpater that is attached to a class type rather than\r\n * specific object instance.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nvar GlobalAdapter = /** @class */ (function () {\r\n function GlobalAdapter() {\r\n /**\r\n * Callback id iterator.\r\n */\r\n this._callbackId = 0;\r\n /**\r\n * A list of if callbacks (adapters).\r\n */\r\n this._callbacks = new SortedList(function (left, right) {\r\n return $order.or($number.order(left.priority, right.priority), $number.order(left.id, right.id));\r\n });\r\n }\r\n /**\r\n * Adds a global callback which is not specific to any particular object.\r\n * Whenever an adapter in any object of the specific class type is invoked\r\n * global adapters will kick in.\r\n *\r\n * @param type Class type\r\n * @param key Adapter key\r\n * @param callback Callback function\r\n * @param priority Priority (higher priority meaning adapter will be applied later)\r\n * @param scope Callback function scaope\r\n */\r\n GlobalAdapter.prototype.addAll = function (type, key, callback, priority, scope) {\r\n if (priority === void 0) { priority = 0; }\r\n this._callbacks.insert({\r\n id: ++this._callbackId,\r\n key: key,\r\n callback: callback,\r\n priority: priority,\r\n scope: scope,\r\n type: type\r\n });\r\n };\r\n /**\r\n * Returns if there are adapters for specific type available.\r\n *\r\n * @param type Adapter type\r\n * @param key Adapter key\r\n * @return {boolean}\r\n */\r\n GlobalAdapter.prototype.isEnabled = function (type, key) {\r\n return $array.any(this._callbacks.values, function (x) { return x.key === key && type instanceof x.type; });\r\n };\r\n /**\r\n * Applies global adapters for the object of the specific type.\r\n *\r\n * @param type Class type\r\n * @param key Adapter key\r\n * @param value Value\r\n */\r\n GlobalAdapter.prototype.applyAll = function (type, key, value) {\r\n // This is needed to improve the performance and reduce garbage collection\r\n var callbacks = this._callbacks.values;\r\n var length = callbacks.length;\r\n if (length == 0) {\r\n return value;\r\n }\r\n // Cycle through all callbacks and find the ones we need to use\r\n for (var i = 0; i < length; ++i) {\r\n var item = callbacks[i];\r\n if (item.key === key && type instanceof item.type) {\r\n value = item.callback.call(item.scope, value, type, key);\r\n }\r\n }\r\n return value;\r\n };\r\n return GlobalAdapter;\r\n}());\r\nexport { GlobalAdapter };\r\n/**\r\n * A global Adapter for plugins that want to add specific\r\n * functionality for any chart, not just specific instance.\r\n *\r\n * If you want to add an adapter which applies to all instances of the same\r\n * object type, like, for instance all slices in PieSeries, you can use\r\n * global adapter.\r\n *\r\n * Global adapter is a system-wide instance, accessible via `globalAdapter`.\r\n *\r\n * ```TypeScript\r\n * am4core.globalAdapter.addAll(am4charts.PieSeries, \"fill\", (value, target, key) => {\r\n * return am4core.color(\"#005500\");\r\n * });\r\n * ```\r\n * ```JavaScript\r\n * am4core.globalAdapter.addAll(am4charts.PieSeries, \"fill\", (value, target, key) => {\r\n * return am4core.color(\"#005500\");\r\n * });\r\n * ```\r\n *\r\n * @ignore\r\n */\r\nexport var globalAdapter = new GlobalAdapter();\r\n/**\r\n * ============================================================================\r\n * REGULAR ADAPTER\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Adapter allows adding ordered callback functions and associating them with a\r\n * string-based key. An Adapter user can then easily invoke those callbacks to\r\n * apply custom functions on its input, output or intermediate values.\r\n *\r\n * Custom code and plugins can add their own callbacks to modify and enhance\r\n * core functionality.\r\n *\r\n * See the description of `add()` for an example.\r\n *\r\n * Almost any object in amCharts4 has own adapter, accessible with `adapter`\r\n * property.\r\n *\r\n * Any adapters added to it will be applied to that object only.\r\n *\r\n * ### Global Adapters\r\n *\r\n * If you want to add an adapter which applies to all instances of the same\r\n * object type, like, for instance all slices in PieSeries, you can use\r\n * global adapter.\r\n *\r\n * Global adapter is a system-wide instance, accessible via `globalAdapter`.\r\n *\r\n * ```TypeScript\r\n * am4core.globalAdapter.addAll(am4charts.PieSeries. \"fill\", (value, target, key) => {\r\n * return am4core.color(\"#005500\");\r\n * });\r\n * ```\r\n * ```JavaScript\r\n * am4core.globalAdapter.addAll(am4charts.PieSeries. \"fill\", (value, target, key) => {\r\n * return am4core.color(\"#005500\");\r\n * });\r\n * ```\r\n *\r\n * {@link https://www.amcharts.com/docs/v4/reference/adapter_module/#globalAdapter_property More info}.\r\n *\r\n * @important\r\n */\r\nvar Adapter = /** @class */ (function () {\r\n /**\r\n * Constructor, sets the object referece this Adapter should be used for.\r\n *\r\n * @param c Object\r\n */\r\n function Adapter(c) {\r\n /**\r\n * Internal counter for callback ids.\r\n */\r\n this._callbackId = 0;\r\n /**\r\n * A list of adapter callbacks.\r\n *\r\n * @param $number.order(left.priority, right.priority) [description]\r\n * @param $number.order(left.id, right.id));\t} [description]\r\n */\r\n this._callbacks = new SortedList(function (left, right) {\r\n return $order.or($number.order(left.priority, right.priority), $number.order(left.id, right.id));\r\n });\r\n this._disabled = {};\r\n this.object = c;\r\n // TODO this exposes the internal events\r\n this.events = this._callbacks.events;\r\n }\r\n /**\r\n * Adds a callback for a specific key.\r\n *\r\n * ```TypeScript\r\n * // Override fill color value and make all slices green\r\n * chart.series.template.adapter.add(\"fill\", (value, target, key) => {\r\n * return am4core.color(\"#005500\");\r\n * });\r\n * ```\r\n * ```JavaScript\r\n * // Override fill color value and make all slices green\r\n * chart.series.template.adapter.add(\"fill\", function(value, target, key) {\r\n * return am4core.color(\"#005500\");\r\n * });\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"series\": [{\r\n * // ...\r\n * \"adapter\": {\r\n * \t// Override fill color value and make all slices green\r\n * \t\"fill\": function(value, target, key) {\r\n * \t return am4core.color(\"#005500\");\r\n * \t}\r\n * }\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * The above will call user-defined function (adapter) whenever `fill` value\r\n * is requested from the Pie series, allowing it to override the default\r\n * using custom code and any fuzzy logic.\r\n *\r\n * There can be any number of adapters set on one property key.\r\n *\r\n * In this case adapters will be applied in daisy-chain fashion. The first\r\n * adapter in queue will make its transformation. The next one will have\r\n * the output of the first adapter as a starting value, etc.\r\n *\r\n * The order of the adapters are determined either by the order they were\r\n * added in, or their `priority` value.\r\n *\r\n * The heigher the `priority`, the later in the game adapter will be applied.\r\n *\r\n * @param key Key\r\n * @param callback A callback function\r\n * @param priority The higher priority, the more chance the adapter will be applied last\r\n * @param scope Scope for the callback function\r\n */\r\n Adapter.prototype.add = function (key, callback, priority, scope) {\r\n if (priority === void 0) { priority = 0; }\r\n this._callbacks.insert({\r\n id: ++this._callbackId,\r\n key: key,\r\n callback: callback,\r\n priority: priority,\r\n scope: scope\r\n });\r\n };\r\n /**\r\n * Checks whether specific adapter is already set.\r\n *\r\n * @param key Key\r\n * @param callback A callback function\r\n * @param priority The higher priority, the more chance the adapter will be applied last\r\n * @param scope Scope for the callback function\r\n * @returns Adapter set?\r\n */\r\n Adapter.prototype.has = function (key, callback, priority, scope) {\r\n if (priority === void 0) { priority = 0; }\r\n return $iter.contains(this._callbacks.iterator(), function (item) {\r\n return item.key === key && item.callback === callback && item.priority === priority && item.scope === scope;\r\n });\r\n };\r\n /**\r\n * Removes adapter callbacks for the specific `key`.\r\n *\r\n * If `priority` is specified, only callbacks for that priority are removed.\r\n *\r\n * @param key Key\r\n * @param priority Priority\r\n * @todo Implement\r\n */\r\n Adapter.prototype.remove = function (key, priority) {\r\n var _this = this;\r\n // It has to make a copy because it removes the elements while iterating\r\n // TODO inefficient\r\n // TODO should this re-enable the key ?\r\n $array.each($iter.toArray(this._callbacks.iterator()), function (item) {\r\n // TODO test this\r\n if (item.key === key && (!$type.isNumber(priority) || priority === item.priority)) {\r\n _this._callbacks.remove(item);\r\n }\r\n });\r\n };\r\n /**\r\n * Enable applying adapters for a certain key, if it was disabled before by\r\n * `disableKey()`.\r\n *\r\n * @param key Key\r\n */\r\n Adapter.prototype.enableKey = function (key) {\r\n delete this._disabled[key];\r\n };\r\n /**\r\n * Disable applying adapters for a certain key.\r\n *\r\n * Optionally, can set how many applies to skip before automatically\r\n * re-enabling the applying.\r\n *\r\n * @param key Key\r\n * @param amount Number of applies to skip\r\n */\r\n Adapter.prototype.disableKey = function (key, amount) {\r\n if (amount === void 0) { amount = Infinity; }\r\n this._disabled[key] = amount;\r\n };\r\n Adapter.prototype._hasListenersByType = function (key) {\r\n return $array.any(this._callbacks.values, function (x) { return x.key === key; });\r\n };\r\n /**\r\n * Returns if there are any enabled adapters set for the specific `key`.\r\n *\r\n * @returns Are there any adapters for the key?\r\n */\r\n Adapter.prototype.isEnabled = function (key) {\r\n return this._disabled[key] == null && (this._hasListenersByType(key) || globalAdapter.isEnabled(this.object, key));\r\n };\r\n Adapter.prototype._shouldDispatch = function (key) {\r\n var count = this._disabled[key];\r\n if (!$type.isNumber(count)) {\r\n return true;\r\n }\r\n else {\r\n if (count <= 1) {\r\n delete this._disabled[key];\r\n }\r\n else {\r\n --this._disabled[key];\r\n }\r\n return false;\r\n }\r\n };\r\n /**\r\n * Passes the input value through all the callbacks for the defined `key`.\r\n *\r\n * @param key Key\r\n * @param value Input value\r\n * @param ...rest Rest of the parameters to be passed into callback\r\n * @return Output value\r\n */\r\n Adapter.prototype.apply = function (key, value) {\r\n if (this._shouldDispatch(key)) {\r\n // This is needed to improve the performance and reduce garbage collection\r\n var callbacks = this._callbacks.values;\r\n var length_1 = callbacks.length;\r\n if (length_1 > 0) {\r\n for (var i = 0; i < length_1; ++i) {\r\n var item = callbacks[i];\r\n if (item.key === key) {\r\n value = item.callback.call(item.scope, value, this.object, key);\r\n }\r\n }\r\n }\r\n // Apply global adapters\r\n value = globalAdapter.applyAll(this.object, key, value);\r\n return value;\r\n }\r\n else {\r\n return value;\r\n }\r\n };\r\n /**\r\n * Returns all adapter keys which are in this adapter.\r\n *\r\n * @return Adapter keys\r\n */\r\n Adapter.prototype.keys = function () {\r\n // TODO inefficient\r\n return $iter.toArray($iter.map(this._callbacks.iterator(), function (x) { return x.key; }));\r\n };\r\n /**\r\n * Copies all the adapter callbacks from `source`.\r\n *\r\n * @param source An Adapter to copy items from\r\n */\r\n Adapter.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n $iter.each(source._callbacks.iterator(), function (x) {\r\n _this.add(x.key, x.callback, x.priority, x.scope);\r\n });\r\n $object.each(source._disabled, function (key, val) {\r\n _this._disabled[key] = val;\r\n });\r\n };\r\n /**\r\n * Clears all callbacks from this Adapter.\r\n */\r\n Adapter.prototype.clear = function () {\r\n // TODO should this also re-enable all the keys ?\r\n this._callbacks.clear();\r\n };\r\n return Adapter;\r\n}());\r\nexport { Adapter };\r\n//# sourceMappingURL=Adapter.js.map","/**\r\n * A collection of color-related functions\r\n */\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport * as $math from \"./Math\";\r\nimport * as $type from \"./Type\";\r\n/**\r\n * Define named colors for easy resolution to RGB.\r\n */\r\nvar namedColors = {\r\n aliceblue: { r: 240, g: 248, b: 255 },\r\n antiquewhite: { r: 250, g: 235, b: 215 },\r\n aqua: { r: 0, g: 255, b: 255 },\r\n aquamarine: { r: 127, g: 255, b: 212 },\r\n azure: { r: 240, g: 255, b: 255 },\r\n beige: { r: 245, g: 245, b: 220 },\r\n bisque: { r: 255, g: 228, b: 196 },\r\n black: { r: 0, g: 0, b: 0 },\r\n blanchedalmond: { r: 255, g: 235, b: 205 },\r\n blue: { r: 0, g: 0, b: 255 },\r\n blueviolet: { r: 138, g: 43, b: 226 },\r\n brown: { r: 165, g: 42, b: 42 },\r\n burlywood: { r: 222, g: 184, b: 135 },\r\n cadetblue: { r: 95, g: 158, b: 160 },\r\n chartreuse: { r: 127, g: 255, b: 0 },\r\n chocolate: { r: 210, g: 105, b: 30 },\r\n coral: { r: 255, g: 127, b: 80 },\r\n cornflowerblue: { r: 100, g: 149, b: 237 },\r\n cornsilk: { r: 255, g: 248, b: 220 },\r\n crimson: { r: 220, g: 20, b: 60 },\r\n cyan: { r: 0, g: 255, b: 255 },\r\n darkblue: { r: 0, g: 0, b: 139 },\r\n darkcyan: { r: 0, g: 139, b: 139 },\r\n darkgoldenrod: { r: 184, g: 134, b: 11 },\r\n darkgray: { r: 169, g: 169, b: 169 },\r\n darkgrey: { r: 169, g: 169, b: 169 },\r\n darkgreen: { r: 0, g: 100, b: 0 },\r\n darkkhaki: { r: 189, g: 183, b: 107 },\r\n darkmagenta: { r: 139, g: 0, b: 139 },\r\n darkolivegreen: { r: 85, g: 107, b: 47 },\r\n darkorange: { r: 255, g: 140, b: 0 },\r\n darkorchid: { r: 153, g: 50, b: 204 },\r\n darkred: { r: 139, g: 0, b: 0 },\r\n darksalmon: { r: 233, g: 150, b: 122 },\r\n darkseagreen: { r: 143, g: 188, b: 143 },\r\n darkslateblue: { r: 72, g: 61, b: 139 },\r\n darkslategray: { r: 47, g: 79, b: 79 },\r\n darkslategrey: { r: 47, g: 79, b: 79 },\r\n darkturquoise: { r: 0, g: 206, b: 209 },\r\n darkviolet: { r: 148, g: 0, b: 211 },\r\n deeppink: { r: 255, g: 20, b: 147 },\r\n deepskyblue: { r: 0, g: 191, b: 255 },\r\n dimgray: { r: 105, g: 105, b: 105 },\r\n dimgrey: { r: 105, g: 105, b: 105 },\r\n dodgerblue: { r: 30, g: 144, b: 255 },\r\n firebrick: { r: 178, g: 34, b: 34 },\r\n floralwhite: { r: 255, g: 250, b: 240 },\r\n forestgreen: { r: 34, g: 139, b: 34 },\r\n fuchsia: { r: 255, g: 0, b: 255 },\r\n gainsboro: { r: 220, g: 220, b: 220 },\r\n ghostwhite: { r: 248, g: 248, b: 255 },\r\n gold: { r: 255, g: 215, b: 0 },\r\n goldenrod: { r: 218, g: 165, b: 32 },\r\n gray: { r: 128, g: 128, b: 128 },\r\n grey: { r: 128, g: 128, b: 128 },\r\n green: { r: 0, g: 128, b: 0 },\r\n greenyellow: { r: 173, g: 255, b: 47 },\r\n honeydew: { r: 240, g: 255, b: 240 },\r\n hotpink: { r: 255, g: 105, b: 180 },\r\n indianred: { r: 205, g: 92, b: 92 },\r\n indigo: { r: 75, g: 0, b: 130 },\r\n ivory: { r: 255, g: 255, b: 240 },\r\n khaki: { r: 240, g: 230, b: 140 },\r\n lavender: { r: 230, g: 230, b: 250 },\r\n lavenderblush: { r: 255, g: 240, b: 245 },\r\n lawngreen: { r: 124, g: 252, b: 0 },\r\n lemonchiffon: { r: 255, g: 250, b: 205 },\r\n lightblue: { r: 173, g: 216, b: 230 },\r\n lightcoral: { r: 240, g: 128, b: 128 },\r\n lightcyan: { r: 224, g: 255, b: 255 },\r\n lightgoldenrodyellow: { r: 250, g: 250, b: 210 },\r\n lightgray: { r: 211, g: 211, b: 211 },\r\n lightgrey: { r: 211, g: 211, b: 211 },\r\n lightgreen: { r: 144, g: 238, b: 144 },\r\n lightpink: { r: 255, g: 182, b: 193 },\r\n lightsalmon: { r: 255, g: 160, b: 122 },\r\n lightseagreen: { r: 32, g: 178, b: 170 },\r\n lightskyblue: { r: 135, g: 206, b: 250 },\r\n lightslategray: { r: 119, g: 136, b: 153 },\r\n lightslategrey: { r: 119, g: 136, b: 153 },\r\n lightsteelblue: { r: 176, g: 196, b: 222 },\r\n lightyellow: { r: 255, g: 255, b: 224 },\r\n lime: { r: 0, g: 255, b: 0 },\r\n limegreen: { r: 50, g: 205, b: 50 },\r\n linen: { r: 250, g: 240, b: 230 },\r\n magenta: { r: 255, g: 0, b: 255 },\r\n maroon: { r: 128, g: 0, b: 0 },\r\n mediumaquamarine: { r: 102, g: 205, b: 170 },\r\n mediumblue: { r: 0, g: 0, b: 205 },\r\n mediumorchid: { r: 186, g: 85, b: 211 },\r\n mediumpurple: { r: 147, g: 112, b: 219 },\r\n mediumseagreen: { r: 60, g: 179, b: 113 },\r\n mediumslateblue: { r: 123, g: 104, b: 238 },\r\n mediumspringgreen: { r: 0, g: 250, b: 154 },\r\n mediumturquoise: { r: 72, g: 209, b: 204 },\r\n mediumvioletred: { r: 199, g: 21, b: 133 },\r\n midnightblue: { r: 25, g: 25, b: 112 },\r\n mintcream: { r: 245, g: 255, b: 250 },\r\n mistyrose: { r: 255, g: 228, b: 225 },\r\n moccasin: { r: 255, g: 228, b: 181 },\r\n navajowhite: { r: 255, g: 222, b: 173 },\r\n navy: { r: 0, g: 0, b: 128 },\r\n oldlace: { r: 253, g: 245, b: 230 },\r\n olive: { r: 128, g: 128, b: 0 },\r\n olivedrab: { r: 107, g: 142, b: 35 },\r\n orange: { r: 255, g: 165, b: 0 },\r\n orangered: { r: 255, g: 69, b: 0 },\r\n orchid: { r: 218, g: 112, b: 214 },\r\n palegoldenrod: { r: 238, g: 232, b: 170 },\r\n palegreen: { r: 152, g: 251, b: 152 },\r\n paleturquoise: { r: 175, g: 238, b: 238 },\r\n palevioletred: { r: 219, g: 112, b: 147 },\r\n papayawhip: { r: 255, g: 239, b: 213 },\r\n peachpuff: { r: 255, g: 218, b: 185 },\r\n peru: { r: 205, g: 133, b: 63 },\r\n pink: { r: 255, g: 192, b: 203 },\r\n plum: { r: 221, g: 160, b: 221 },\r\n powderblue: { r: 176, g: 224, b: 230 },\r\n purple: { r: 128, g: 0, b: 128 },\r\n rebeccapurple: { r: 102, g: 51, b: 153 },\r\n red: { r: 255, g: 0, b: 0 },\r\n rosybrown: { r: 188, g: 143, b: 143 },\r\n royalblue: { r: 65, g: 105, b: 225 },\r\n saddlebrown: { r: 139, g: 69, b: 19 },\r\n salmon: { r: 250, g: 128, b: 114 },\r\n sandybrown: { r: 244, g: 164, b: 96 },\r\n seagreen: { r: 46, g: 139, b: 87 },\r\n seashell: { r: 255, g: 245, b: 238 },\r\n sienna: { r: 160, g: 82, b: 45 },\r\n silver: { r: 192, g: 192, b: 192 },\r\n skyblue: { r: 135, g: 206, b: 235 },\r\n slateblue: { r: 106, g: 90, b: 205 },\r\n slategray: { r: 112, g: 128, b: 144 },\r\n slategrey: { r: 112, g: 128, b: 144 },\r\n snow: { r: 255, g: 250, b: 250 },\r\n springgreen: { r: 0, g: 255, b: 127 },\r\n steelblue: { r: 70, g: 130, b: 180 },\r\n tan: { r: 210, g: 180, b: 140 },\r\n teal: { r: 0, g: 128, b: 128 },\r\n thistle: { r: 216, g: 191, b: 216 },\r\n tomato: { r: 255, g: 99, b: 71 },\r\n turquoise: { r: 64, g: 224, b: 208 },\r\n violet: { r: 238, g: 130, b: 238 },\r\n wheat: { r: 245, g: 222, b: 179 },\r\n white: { r: 255, g: 255, b: 255 },\r\n whitesmoke: { r: 245, g: 245, b: 245 },\r\n yellow: { r: 255, g: 255, b: 0 },\r\n yellowgreen: { r: 154, g: 205, b: 50 }\r\n};\r\n/**\r\n * Tries to resolve a named color into a hex color representation.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Color name\r\n * @return Color\r\n * @deprecated\r\n * @hidden\r\n */\r\n/*export function resolveNamedColor(value: string): Color {\r\n return (namedColors)[value] ? (namedColors)[value] : undefined;\r\n}*/\r\n/**\r\n * Converts a proper color hex code (i.e. \"#FF5500\") or named color (i.e. \"red\")\r\n * into an {iRGB} object. If the code is not correctly formatted, an RGB of\r\n * black is returned.\r\n *\r\n * @ignore Exclude from docs\r\n * @param color Color code\r\n * @param alpha Alpha (0-1)\r\n * @return RGB\r\n */\r\nexport function rgb(color, alpha) {\r\n // Init return value\r\n var rgb;\r\n // Try resolving color format\r\n // Named color?\r\n if (namedColors[color]) {\r\n rgb = namedColors[color];\r\n }\r\n // Hex code?\r\n else if (color.charAt(0) === \"#\") {\r\n rgb = hexToRgb(color);\r\n }\r\n // rgb() format?\r\n else if (color.match(/^rgba?\\(/)) {\r\n rgb = rgbaToRgb(color);\r\n }\r\n // Was not able to resolve?\r\n if (!rgb) {\r\n rgb = { r: 0, g: 0, b: 0, a: 1 };\r\n }\r\n // Set alpha\r\n if ($type.hasValue(alpha)) {\r\n rgb.a = alpha;\r\n }\r\n return rgb;\r\n}\r\n/**\r\n * Converts a hex color code (i.e. \"#FF5500\") to an [[iRGB]] object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param hex Hex color code\r\n * @return RGB\r\n */\r\nexport function hexToRgb(hex) {\r\n // Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\r\n var 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 var 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 } : hexToRgbWithAlpha(hex);\r\n}\r\n/**\r\n * Converts a hex color code with alpha (i.e. \"#FF5500128\") to an [[iRGB]] object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param hex Hex color code\r\n * @return RGB\r\n */\r\nexport function hexToRgbWithAlpha(hex) {\r\n // Expand shorthand form (e.g. \"03FA\") to full form (e.g. \"0033FFAA\")\r\n var shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])([a-f\\d])$/i;\r\n hex = hex.replace(shorthandRegex, function (m, r, g, b, a) {\r\n return r + r + g + g + b + b + a + a;\r\n });\r\n var result = /^#?([a-f\\d]{2})([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 a: parseInt(result[4], 16) / 256\r\n } : undefined;\r\n}\r\n/**\r\n * Converts color strings in format like `rgb()` and `rgba()` to [[iRGB]].\r\n *\r\n * @ignore Exclude from docs\r\n * @param color Color code\r\n * @return RGB\r\n */\r\nexport function rgbaToRgb(color) {\r\n color = color.replace(/[ ]/g, \"\");\r\n // Init\r\n var matches = color.match(/^rgb\\(([0-9]*),([0-9]*),([0-9]*)\\)/i);\r\n // Try rgb() format\r\n if (matches) {\r\n matches.push(\"1\");\r\n }\r\n else {\r\n matches = color.match(/^rgba\\(([0-9]*),([0-9]*),([0-9]*),([.0-9]*)\\)/i);\r\n if (!matches) {\r\n return;\r\n }\r\n }\r\n return {\r\n r: parseInt(matches[1]),\r\n g: parseInt(matches[2]),\r\n b: parseInt(matches[3]),\r\n a: parseFloat(matches[4])\r\n };\r\n}\r\n/**\r\n * Converts an [[iRGB]] object into a hex color code.\r\n *\r\n * @ignore Exclude from docs\r\n * @param rgb RGB\r\n * @return Hex color code\r\n */\r\nexport function rgbToHex(rgb) {\r\n return \"#\" + pad2(rgb.r.toString(16)) + pad2(rgb.g.toString(16)) + pad2(rgb.b.toString(16));\r\n}\r\n/**\r\n * Converts an [[iRGB]] object into its `rgb()` or `rgba()` representation.\r\n *\r\n * @ignore Exclude from docs\r\n * @param rgb RGB\r\n * @return `rgba()` syntax\r\n */\r\nexport function rgbToRGBA(rgb) {\r\n if ($type.hasValue(rgb.a) && rgb.a !== 1) {\r\n return \"rgba(\" + rgb.r + \",\" + rgb.g + \",\" + rgb.b + \",\" + rgb.a + \")\";\r\n }\r\n else {\r\n return \"rgb(\" + rgb.r + \",\" + rgb.g + \",\" + rgb.b + \")\";\r\n }\r\n}\r\n/**\r\n * Pads a 1-digit string with a zero.\r\n *\r\n * @ignore Exclude from docs\r\n * @param c Input string\r\n * @return Padded string\r\n */\r\nexport function pad2(c) {\r\n return c.length == 1 ? \"0\" + c : \"\" + c;\r\n}\r\n/**\r\n * Returns an intermediate color between two colors based on the relative\r\n * position. Position needs to be in range between 0 and 1. Zero meaning the\r\n * resulting color will be closest to the first reference color.\r\n *\r\n * @ignore Exclude from docs\r\n * @param color1 First reference color\r\n * @param color2 Second reference color\r\n * @param percent Relative position (0-1)\r\n * @return Interpolated color\r\n */\r\nexport function interpolate(rgb1, rgb2, percent) {\r\n percent = $math.fitToRange(percent, 0, 1);\r\n if (rgb1) {\r\n if (rgb2) {\r\n return {\r\n r: rgb1.r + Math.round((rgb2.r - rgb1.r) * percent),\r\n g: rgb1.g + Math.round((rgb2.g - rgb1.g) * percent),\r\n b: rgb1.b + Math.round((rgb2.b - rgb1.b) * percent),\r\n a: (rgb1.a || 1) + Math.round(((rgb2.a || 1) - (rgb1.a || 1)) * percent)\r\n };\r\n }\r\n else {\r\n return rgb1;\r\n }\r\n }\r\n else if (rgb2) {\r\n return rgb2;\r\n }\r\n else {\r\n return rgb1;\r\n }\r\n}\r\n/**\r\n * Returns a color that is `percent` brighter than the reference color.\r\n *\r\n * @ignore Exclude from docs\r\n * @param color Reference color\r\n * @param percent Brightness percent\r\n * @return Hex code of the new color\r\n */\r\nexport function lighten(rgb, percent) {\r\n if (rgb) {\r\n return {\r\n r: Math.max(0, Math.min(255, rgb.r + getLightnessStep(rgb.r, percent))),\r\n g: Math.max(0, Math.min(255, rgb.g + getLightnessStep(rgb.g, percent))),\r\n b: Math.max(0, Math.min(255, rgb.b + getLightnessStep(rgb.b, percent))),\r\n a: rgb.a\r\n };\r\n }\r\n else {\r\n // TODO is this correct ?\r\n return rgb;\r\n }\r\n}\r\n;\r\n/**\r\n * Gets lightness step.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Value\r\n * @param percent Percent\r\n * @return Step\r\n */\r\nexport function getLightnessStep(value, percent) {\r\n var base = percent > 0 ? 255 - value : value;\r\n return Math.round(base * percent);\r\n}\r\n/**\r\n * Returns a color that is `percent` brighter than the source `color`.\r\n *\r\n * @ignore Exclude from docs\r\n * @param color Source color\r\n * @param percent Brightness percent\r\n * @return New color\r\n */\r\nexport function brighten(rgb, percent) {\r\n if (rgb) {\r\n var base = Math.min(Math.max(rgb.r, rgb.g, rgb.b), 230);\r\n //let base = Math.max(rgb.r, rgb.g, rgb.b);\r\n var step = getLightnessStep(base, percent);\r\n return {\r\n r: Math.max(0, Math.min(255, Math.round(rgb.r + step))),\r\n g: Math.max(0, Math.min(255, Math.round(rgb.g + step))),\r\n b: Math.max(0, Math.min(255, Math.round(rgb.b + step))),\r\n a: rgb.a\r\n };\r\n }\r\n else {\r\n // TODO is this correct ?\r\n return rgb;\r\n }\r\n}\r\n;\r\n/**\r\n * Returns brightness step.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Value\r\n * @param percent Percent\r\n * @return Step\r\n */\r\nexport function getBrightnessStep(value, percent) {\r\n var base = 255; //percent > 0 ? 255 - value : value;\r\n return Math.round(base * percent);\r\n}\r\n/**\r\n * Returns a new [[iRGB]] object based on `rgb` parameter with specific\r\n * saturation applied.\r\n *\r\n * `saturation` can be in the range of 0 (fully desaturated) to 1 (fully\r\n * saturated).\r\n *\r\n * @ignore Exclude from docs\r\n * @param color Base color\r\n * @param saturation Saturation (0-1)\r\n * @return New color\r\n */\r\nexport function saturate(rgb, saturation) {\r\n if (rgb == null || saturation == 1) {\r\n return rgb;\r\n }\r\n var hsl = rgbToHsl(rgb);\r\n hsl.s = saturation;\r\n return hslToRgb(hsl);\r\n}\r\n/*\r\n// not used\r\nexport function rgbToMatrix(rgb: iRGB): string {\r\n let r = $type.toText($math.round((rgb.r || 0) / 255, 10));\r\n let g = $type.toText($math.round((rgb.g || 0) / 255, 10));\r\n let b = $type.toText($math.round((rgb.b || 0) / 255, 10));\r\n let a = $type.toText(rgb.a || 1);\r\n return\t r + \" 0 0 0 0\" +\r\n \" 0 \" + g + \" 0 0 0\" +\r\n \" 0 0 \" + b + \" 0 0\" +\r\n \" 0 0 0 \" + a + \" 0\";\r\n}\r\n*/\r\n/**\r\n * The functions below are taken and adapted from Garry Tan's blog post:\r\n * http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c\r\n *\r\n * The further attributions go mjijackson.com, which now seems to be defunct.\r\n */\r\n/**\r\n * Converts an HSL color value to RGB. Conversion formula\r\n * adapted from http://en.wikipedia.org/wiki/HSL_color_space.\r\n * Assumes h, s, and l are contained in the set [0, 1] and\r\n * returns r, g, and b in the set [0, 255].\r\n *\r\n * Function adapted from:\r\n * http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c\r\n *\r\n * @ignore Exclude from docs\r\n * @param h The hue\r\n * @param s The saturation\r\n * @param l The lightness\r\n * @return The RGB representation\r\n */\r\nexport function hslToRgb(color) {\r\n var r, g, b;\r\n var h = color.h;\r\n var s = color.s;\r\n var l = color.l;\r\n if (s == 0) {\r\n r = g = b = l; // achromatic\r\n }\r\n else {\r\n var hue2rgb = function hue2rgb(p, q, t) {\r\n if (t < 0) {\r\n t += 1;\r\n }\r\n if (t > 1) {\r\n t -= 1;\r\n }\r\n if (t < 1 / 6) {\r\n return p + (q - p) * 6 * t;\r\n }\r\n if (t < 1 / 2) {\r\n return q;\r\n }\r\n if (t < 2 / 3) {\r\n return p + (q - p) * (2 / 3 - t) * 6;\r\n }\r\n return p;\r\n };\r\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\r\n var p = 2 * l - q;\r\n r = hue2rgb(p, q, h + 1 / 3);\r\n g = hue2rgb(p, q, h);\r\n b = hue2rgb(p, q, h - 1 / 3);\r\n }\r\n return {\r\n r: Math.round(r * 255),\r\n g: Math.round(g * 255),\r\n b: Math.round(b * 255)\r\n };\r\n}\r\n/**\r\n * Converts an RGB color value to HSL. Conversion formula\r\n * adapted from http://en.wikipedia.org/wiki/HSL_color_space.\r\n * Assumes r, g, and b are contained in the set [0, 255] and\r\n * returns h, s, and l in the set [0, 1].\r\n *\r\n * Function adapted from:\r\n * http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c\r\n *\r\n * @ignore Exclude from docs\r\n * @param r The red color value\r\n * @param g The green color value\r\n * @param b The blue color value\r\n * @return The HSL representation\r\n */\r\nexport function rgbToHsl(color) {\r\n var r = color.r / 255;\r\n var g = color.g / 255;\r\n var b = color.b / 255;\r\n var max = Math.max(r, g, b);\r\n var min = Math.min(r, g, b);\r\n var h = 0;\r\n var s = 0;\r\n var l = (max + min) / 2;\r\n if (max === min) {\r\n h = s = 0; // achromatic\r\n }\r\n else {\r\n var d = max - min;\r\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\r\n switch (max) {\r\n case r:\r\n h = (g - b) / d + (g < b ? 6 : 0);\r\n break;\r\n case g:\r\n h = (b - r) / d + 2;\r\n break;\r\n case b:\r\n h = (r - g) / d + 4;\r\n break;\r\n }\r\n h /= 6;\r\n }\r\n return {\r\n h: h,\r\n s: s,\r\n l: l\r\n };\r\n}\r\n/**\r\n * Converts an RGB color value to HSV. Conversion formula\r\n * adapted from http://en.wikipedia.org/wiki/HSV_color_space.\r\n * Assumes r, g, and b are contained in the set [0, 255] and\r\n * returns h, s, and v in the set [0, 1].\r\n *\r\n * @ignore Exclude from docs\r\n * @param Number r The red color value\r\n * @param Number g The green color value\r\n * @param Number b The blue color value\r\n * @return Array The HSV representation\r\n */\r\nexport function rgbToHsv(color) {\r\n var r = color.r / 255;\r\n var g = color.g / 255;\r\n var b = color.b / 255;\r\n var max = Math.max(r, g, b), min = Math.min(r, g, b);\r\n var h = 0;\r\n var s = 0;\r\n var v = max;\r\n var d = max - min;\r\n s = max == 0 ? 0 : d / max;\r\n if (max == min) {\r\n h = 0; // achromatic\r\n }\r\n else {\r\n switch (max) {\r\n case r:\r\n h = (g - b) / d + (g < b ? 6 : 0);\r\n break;\r\n case g:\r\n h = (b - r) / d + 2;\r\n break;\r\n case b:\r\n h = (r - g) / d + 4;\r\n break;\r\n }\r\n h /= 6;\r\n }\r\n return {\r\n h: h,\r\n s: s,\r\n v: v\r\n };\r\n}\r\n/**\r\n * Converts an HSV color value to RGB. Conversion formula\r\n * adapted from http://en.wikipedia.org/wiki/HSV_color_space.\r\n * Assumes h, s, and v are contained in the set [0, 1] and\r\n * returns r, g, and b in the set [0, 255].\r\n *\r\n * @ignore Exclude from docs\r\n * @param Number h The hue\r\n * @param Number s The saturation\r\n * @param Number v The value\r\n * @return Array The RGB representation\r\n */\r\nexport function hsvToRgb(color) {\r\n var r = 0;\r\n var g = 0;\r\n var b = 0;\r\n var h = color.h;\r\n var s = color.s;\r\n var v = color.v;\r\n var i = Math.floor(h * 6);\r\n var f = h * 6 - i;\r\n var p = v * (1 - s);\r\n var q = v * (1 - f * s);\r\n var t = v * (1 - (1 - f) * s);\r\n switch (i % 6) {\r\n case 0:\r\n r = v;\r\n g = t;\r\n b = p;\r\n break;\r\n case 1:\r\n r = q;\r\n g = v;\r\n b = p;\r\n break;\r\n case 2:\r\n r = p;\r\n g = v;\r\n b = t;\r\n break;\r\n case 3:\r\n r = p;\r\n g = q;\r\n b = v;\r\n break;\r\n case 4:\r\n r = t;\r\n g = p;\r\n b = v;\r\n break;\r\n case 5:\r\n r = v;\r\n g = p;\r\n b = q;\r\n break;\r\n }\r\n return {\r\n r: Math.round(r * 255),\r\n g: Math.round(g * 255),\r\n b: Math.round(b * 255)\r\n };\r\n}\r\n/**\r\n * Returns `true` if color is \"light\". Useful indetermining which contrasting\r\n * color to use for elements over this color. E.g.: you would want to use\r\n * black text over light background, and vice versa.\r\n *\r\n * @ignore Exclude from docs\r\n * @param color Source color\r\n * @return Light?\r\n */\r\nexport function isLight(color) {\r\n return ((color.r * 299) + (color.g * 587) + (color.b * 114)) / 1000 >= 128;\r\n}\r\n//# sourceMappingURL=Colors.js.map","/**\r\n * This module contains Color object definition\r\n */\r\nimport { registry } from \"../Registry\";\r\nimport * as $colors from \"./Colors\";\r\nimport * as $type from \"./Type\";\r\n/**\r\n * Represents a color.\r\n *\r\n * `Color` accepts value only in [[iRGB]] object format. To create `Color`\r\n * object by parsing it from any supported string-based formats, use helper\r\n * [[color]] function:\r\n *\r\n * ```TypeScript\r\n * am4core.color(\"#ff0000\");\r\n * am4core.color(\"#f00\");\r\n * am4core.color(\"rgb(255, 0, 0)\");\r\n * am4core.color(\"rgba(255, 0, 0, 0.5)\");\r\n * am4core.color({ r: 255, g: 0, b: 0 });\r\n * am4core.color(\"red\");\r\n * ```\r\n * ```JavaScript\r\n * am4core.color(\"#ff0000\");\r\n * am4core.color(\"#f00\");\r\n * am4core.color(\"rgb(255, 0, 0)\");\r\n * am4core.color(\"rgba(255, 0, 0, 0.5)\");\r\n * am4core.color({ r: 255, g: 0, b: 0 });\r\n * am4core.color(\"red\");\r\n * ```\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/colors/} for color-related info\r\n */\r\nvar Color = /** @class */ (function () {\r\n /**\r\n * Constructor\r\n *\r\n * @param color Source color\r\n */\r\n function Color(color) {\r\n this._value = color;\r\n }\r\n Object.defineProperty(Color.prototype, \"rgb\", {\r\n /**\r\n * Returns [[iRGB]] representation of the color.\r\n *\r\n * @return RGB object\r\n */\r\n get: function () {\r\n return this._value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Color.prototype, \"hex\", {\r\n /**\r\n * Returns color hex value string, e.g. \"#FF0000\".\r\n *\r\n * @return Hex color code\r\n */\r\n get: function () {\r\n return this._value ? $colors.rgbToHex(this._value) : \"none\";\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Color.prototype, \"rgba\", {\r\n /**\r\n * Returns an `rgba()` representation of the color, e.g.:\r\n * `rgba(255, 0, 0, 0.5)`.\r\n *\r\n * @return rgba color string\r\n */\r\n get: function () {\r\n return this._value ? $colors.rgbToRGBA(this._value) : \"none\";\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Color.prototype, \"alpha\", {\r\n /**\r\n * Returns current transparency.\r\n *\r\n * @return Alpha (0-1)\r\n */\r\n get: function () {\r\n if (this._value != null && this._value.a != null) {\r\n return this._value.a;\r\n }\r\n else {\r\n return 1;\r\n }\r\n },\r\n /**\r\n * Set alpha (transparency) of the color.\r\n *\r\n * @param value Alpha (0-1)\r\n */\r\n set: function (value) {\r\n if (this._value) {\r\n this._value.a = value;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Color.prototype, \"lightColor\", {\r\n /**\r\n * Returns current light color setting.\r\n *\r\n * @return Color\r\n */\r\n get: function () {\r\n if (!this._lightColor) {\r\n this._lightColor = new Color({ r: 255, g: 255, b: 255 });\r\n }\r\n return this._lightColor;\r\n },\r\n /**\r\n * Sets \"light\" color. Used when determining contrasting color.\r\n *\r\n * @param color Color\r\n */\r\n set: function (color) {\r\n this._lightColor = color;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Color.prototype, \"darkColor\", {\r\n /**\r\n * Returns current dark color setting.\r\n *\r\n * @return Color\r\n */\r\n get: function () {\r\n if (!this._darkColor) {\r\n this._darkColor = new Color({ r: 0, g: 0, b: 0 });\r\n }\r\n return this._darkColor;\r\n },\r\n /**\r\n * Sets \"dark\" color. Used when determining contrasting color.\r\n *\r\n * @param color Color\r\n */\r\n set: function (color) {\r\n this._darkColor = color;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Overrides `toString` method so that [[Color]] object can be used as\r\n * string.\r\n *\r\n * @ignore Exclude from docs\r\n * @return String represantion of color (usable in CSS)\r\n */\r\n Color.prototype.toString = function () {\r\n return this.alpha < 1 ? this.rgba : this.hex;\r\n };\r\n /**\r\n * Returns a new [[Color]] which is percent lighter (positive value),\r\n * or darker (negative value).\r\n *\r\n * Parameter is in the scale of -1 to 1.\r\n *\r\n * @param percent Increase/decrease lightness by X\r\n * @return New Color\r\n */\r\n Color.prototype.lighten = function (percent) {\r\n return new Color($colors.lighten(this.rgb, percent));\r\n };\r\n /**\r\n * Returns a new [[Color]] which is percent brighter (positive value),\r\n * or darker (negative value).\r\n *\r\n * Parameter is in the scale of -1 to 1.\r\n *\r\n * @param percent Increase/decrease brightness by X\r\n * @return New Color\r\n */\r\n Color.prototype.brighten = function (percent) {\r\n return new Color($colors.brighten(this.rgb, percent));\r\n };\r\n /**\r\n * Returns a new [[Color]] based on current color with specific saturation\r\n * applied.\r\n *\r\n * `saturation` can be in the range of 0 (fully desaturated) to 1 (fully\r\n * saturated).\r\n *\r\n * @param saturation Saturation (0-1)\r\n * @return New (saturated) color\r\n */\r\n Color.prototype.saturate = function (saturation) {\r\n return new Color($colors.saturate(this.rgb, saturation));\r\n };\r\n Object.defineProperty(Color.prototype, \"alternative\", {\r\n /**\r\n * Returns a either light or dark color that contrasts specifically with\r\n * this color.\r\n *\r\n * Uses properties `darkColor` (default black) and `lightColor` (default\r\n * white).\r\n *\r\n * Useful when determining which color label should be on a colored\r\n * background, so that it stands out.\r\n *\r\n * @return Contrasting color\r\n */\r\n get: function () {\r\n if (this.rgb != null) {\r\n return $colors.isLight(this.rgb) ? this.darkColor : this.lightColor;\r\n }\r\n else {\r\n throw new Error(\"Color does not exist\");\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Color;\r\n}());\r\nexport { Color };\r\n/**\r\n * Resolves an input variable to a normal [[iRGB]] color and creates [[Color]]\r\n * object for it.\r\n *\r\n * @param value Input value\r\n * @param alpha Alpha (0-1)\r\n * @return Color object\r\n */\r\nexport function color(value, alpha) {\r\n if (!$type.hasValue(value)) {\r\n return new Color(undefined);\r\n }\r\n if (typeof value == \"string\") {\r\n var cacheId = \"_color_\" + value + \"_\" + (alpha || \"1\");\r\n var cached = registry.getCache(cacheId);\r\n if (cached) {\r\n return new Color({\r\n r: cached.r,\r\n g: cached.g,\r\n b: cached.b,\r\n a: cached.a\r\n });\r\n }\r\n var rgb = $colors.rgb(value, alpha);\r\n registry.setCache(cacheId, rgb);\r\n return new Color(rgb);\r\n }\r\n // Check if it's already a Color object\r\n if (value instanceof Color) {\r\n if ($type.hasValue(alpha)) {\r\n value.alpha = alpha;\r\n }\r\n return value;\r\n }\r\n // Not a string or Color instance, it's the iRGB object then\r\n return new Color(value);\r\n}\r\n/**\r\n * Checks if supplied argument is instance of [[Color]].\r\n *\r\n * @param value Input value\r\n * @return Is Color?\r\n */\r\nexport function isColor(value) {\r\n return value instanceof Color;\r\n}\r\n/**\r\n * Converts any value to [[Color]].\r\n *\r\n * @param value Input value\r\n * @return Color\r\n */\r\nexport function castColor(value) {\r\n return color(value);\r\n}\r\n/**\r\n * Converts any value into a [[Color]].\r\n *\r\n * @param value Source value\r\n * @return Color object\r\n */\r\nexport function toColor(value) {\r\n if ($type.hasValue(value) && !isColor(value)) {\r\n return castColor(value);\r\n }\r\n return value;\r\n}\r\n//# sourceMappingURL=Color.js.map","/**\r\n * Base functionality\r\n*/\r\nimport { __extends } from \"tslib\";\r\nimport { List, ListTemplate } from \"./utils/List\";\r\nimport { OrderedListTemplate, SortedListTemplate } from \"./utils/SortedList\";\r\nimport { Dictionary, DictionaryTemplate } from \"./utils/Dictionary\";\r\nimport { Disposer } from \"./utils/Disposer\";\r\nimport { EventDispatcher } from \"./utils/EventDispatcher\";\r\nimport { Adapter } from \"./utils/Adapter\";\r\nimport { Color, color } from \"./utils/Color\";\r\nimport { Percent, percent } from \"./utils/Percent\";\r\nimport { registry } from \"./Registry\";\r\nimport { cache } from \"./utils/Cache\";\r\nimport * as $array from \"./utils/Array\";\r\nimport * as $object from \"./utils/Object\";\r\nimport * as $type from \"./utils/Type\";\r\n//import * as $debug from \"./utils/Debug\";\r\n/**\r\n * Provides base functionality for all derivative objects, like generating ids,\r\n * handling cache, etc.\r\n */\r\nvar BaseObject = /** @class */ (function () {\r\n //protected _classes: { [index: string]: any } = {};\r\n /**\r\n * Constructor\r\n * * Sets class name\r\n */\r\n function BaseObject() {\r\n /**\r\n * Indicates if this object has already been deleted. Any\r\n * destruction/disposal code should take this into account when deciding\r\n * wheter to run potentially costly disposal operations if they already have\r\n * been run.\r\n */\r\n this._disposed = false;\r\n /**\r\n * List of IDisposer which will be disposed when the BaseObject is disposed.\r\n */\r\n this._disposers = [];\r\n this.className = \"BaseObject\";\r\n //this.debug();\r\n }\r\n BaseObject.prototype.debug = function () {\r\n //$debug.debug(this);\r\n };\r\n Object.defineProperty(BaseObject.prototype, \"uid\", {\r\n /**\r\n * Returns object's internal unique ID.\r\n *\r\n * @return Unique ID\r\n */\r\n get: function () {\r\n if (!this._uid) {\r\n this._uid = registry.getUniqueId();\r\n registry.map.setKey(this._uid, this);\r\n }\r\n return this._uid;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(BaseObject.prototype, \"id\", {\r\n /**\r\n * @return Id\r\n */\r\n get: function () {\r\n return this._id;\r\n },\r\n /**\r\n * Sets the user-defined id of the element.\r\n *\r\n * @param value Id\r\n */\r\n set: function (value) {\r\n //registry.map.setKey(value, this); // registry.map only stores by uid\r\n this._id = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(BaseObject.prototype, \"map\", {\r\n /**\r\n * Returns a universal collection for mapping ids with objects.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Map collection\r\n */\r\n get: function () {\r\n if (!this._map) {\r\n this._map = new Dictionary();\r\n }\r\n return this._map;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(BaseObject.prototype, \"delayedMap\", {\r\n /**\r\n * Returns mapping for objects referenced by id in JSON config that are not yet\r\n * available at processing time.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Map collection\r\n */\r\n get: function () {\r\n if (!this._delayedMap) {\r\n this._delayedMap = new Dictionary();\r\n }\r\n return this._delayedMap;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Logs an id and property of the target element that is not yet available\r\n * for later assignment.\r\n *\r\n * @ignore\r\n * @param property Property to set\r\n * @param id ID of the target element\r\n */\r\n BaseObject.prototype.addDelayedMap = function (property, id) {\r\n var map = this.delayedMap;\r\n if (!map.hasKey(id)) {\r\n map.setKey(id, []);\r\n }\r\n var list = map.getKey(id);\r\n list.push({\r\n property: property,\r\n target: this\r\n });\r\n };\r\n /**\r\n * Processes delayed JSON config items.\r\n *\r\n * @ignore\r\n */\r\n BaseObject.prototype.processDelayedMap = function () {\r\n var _this = this;\r\n this.delayedMap.each(function (id, list) {\r\n if (_this.map.hasKey(id)) {\r\n var target_1 = _this.map.getKey(id);\r\n $array.each(list, function (item) {\r\n item.target[item.property] = target_1;\r\n });\r\n _this.delayedMap.removeKey(id);\r\n }\r\n });\r\n };\r\n /**\r\n * Applies properties from all assigned themes.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n BaseObject.prototype.applyTheme = function () {\r\n var _this = this;\r\n // TODO is this needed ?\r\n if (registry) {\r\n var themes = this.getCurrentThemes();\r\n // TODO is this needed ?\r\n if (themes) {\r\n $array.each(themes, function (theme, index) {\r\n theme(_this);\r\n });\r\n }\r\n }\r\n };\r\n Object.defineProperty(BaseObject.prototype, \"themes\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return An array of themes\r\n */\r\n get: function () {\r\n return this._themes;\r\n },\r\n /**\r\n * A list of themes to be used for this element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value An array of themes\r\n */\r\n set: function (value) {\r\n this._themes = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns a list of themes that should be applied to this element. It could\r\n * either be a list of themes set explicitly on this element, or system-wide.\r\n *\r\n * @return List of themes\r\n */\r\n BaseObject.prototype.getCurrentThemes = function () {\r\n return this.themes || registry.themes;\r\n };\r\n /**\r\n * Returns if this object has been already been disposed.\r\n *\r\n * @return Is disposed?\r\n */\r\n BaseObject.prototype.isDisposed = function () {\r\n return this._disposed;\r\n };\r\n /**\r\n * Destroys this object and all related data.\r\n */\r\n BaseObject.prototype.dispose = function () {\r\n if (!this._disposed) {\r\n this._disposed = true;\r\n var a = this._disposers;\r\n this._disposers = null;\r\n while (a.length !== 0) {\r\n var disposer = a.shift();\r\n disposer.dispose();\r\n }\r\n // Clear cache\r\n this.clearCache();\r\n // remove from clones list\r\n if (this.clonedFrom) {\r\n this.clonedFrom.clones.removeValue(this);\r\n }\r\n var uid = this._uid;\r\n if (uid != null) {\r\n registry.map.removeKey(uid);\r\n }\r\n }\r\n };\r\n /**\r\n * Adds an IDisposer, which will be disposed when this object is disposed.\r\n *\r\n * @param target Object to dispose\r\n * @ignore Exclude from docs\r\n */\r\n BaseObject.prototype.addDisposer = function (target) {\r\n this._disposers.push(target);\r\n };\r\n /**\r\n * Disposes disposable object and removes it from `_disposers`.\r\n *\r\n * @param target Object to dispose\r\n * @ignore Exclude from docs\r\n */\r\n BaseObject.prototype.removeDispose = function (target) {\r\n //if(target){\r\n if (!this._disposed) {\r\n var index = $array.indexOf(this._disposers, target);\r\n if (index > -1) {\r\n this._disposers.splice(index, 1);\r\n }\r\n }\r\n target.dispose();\r\n //}\r\n };\r\n /**\r\n * Makes a copy of this object and returns the clone. Try to avoid cloning complex objects like chart, create new instances if you need them.\r\n *\r\n * @param cloneId An id to use for clone (if not set a unique id will be generated)\r\n * @returns Clone\r\n */\r\n BaseObject.prototype.clone = function (cloneId) {\r\n if (!cloneId) {\r\n cloneId = \"clone-\" + registry.getUniqueId();\r\n }\r\n var newObject = new this.constructor();\r\n newObject.cloneId = cloneId;\r\n newObject.copyFrom(this);\r\n // add to clones list\r\n // this.clones.push(newObject); // moved this to copyFrom\r\n return newObject;\r\n };\r\n Object.defineProperty(BaseObject.prototype, \"clones\", {\r\n /**\r\n * Returns a collection of object's clones.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Clones\r\n */\r\n get: function () {\r\n if (!this._clones) {\r\n this._clones = new List();\r\n }\r\n return this._clones;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies all properties and related data from different element.\r\n *\r\n * @param object Source element\r\n */\r\n BaseObject.prototype.copyFrom = function (object) {\r\n object.clones.push(this); // do not moveValue, as it is expensive! even if there will be several items in clones list, it's not that bad.\r\n this.clonedFrom = object;\r\n };\r\n Object.defineProperty(BaseObject.prototype, \"className\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Class name\r\n */\r\n get: function () {\r\n return this._className;\r\n },\r\n /**\r\n * Element's class name. (a class that was used to instantiate the element)\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Class name\r\n */\r\n set: function (value) {\r\n this._className = value;\r\n /*if (registry) {\r\n registry.registeredClasses[value] = typeof this;\r\n }*/\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Caches value in object's cache.\r\n *\r\n * @ignore Exclude from docs\r\n * @param key Key\r\n * @param value Value\r\n * @param ttl TTL in seconds\r\n */\r\n BaseObject.prototype.setCache = function (key, value, ttl) {\r\n cache.set(this.uid, key, value, ttl);\r\n };\r\n /**\r\n * Retrieves cached value.\r\n *\r\n * If optional second padarameter is specified, it will return that value\r\n * if cache is not available or is expired.\r\n *\r\n * @ignore Exclude from docs\r\n * @param key Key\r\n * @param value Value to return if cache is not available\r\n * @return Value\r\n */\r\n BaseObject.prototype.getCache = function (key, value) {\r\n if (value === void 0) { value = undefined; }\r\n return cache.get(this.uid, key, value);\r\n };\r\n /**\r\n * Clears object's local cache.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n BaseObject.prototype.clearCache = function () {\r\n cache.clear(this.uid);\r\n };\r\n /**\r\n * Creates [[Disposer]] for `setTimeout` function call. This ensures that all\r\n * timeouts created by the object will be cleared when object itself is\r\n * disposed.\r\n *\r\n * @ignore Exclude from docs\r\n * @param fn Callback function\r\n * @param delay Timeout (ms)\r\n * @return Disposer for timeout\r\n */\r\n BaseObject.prototype.setTimeout = function (fn, delay) {\r\n var _this = this;\r\n var id = setTimeout(function () {\r\n _this.removeDispose(disposer);\r\n fn();\r\n }, delay);\r\n var disposer = new Disposer(function () {\r\n clearTimeout(id);\r\n });\r\n this._disposers.push(disposer);\r\n return disposer;\r\n };\r\n /**\r\n * Creates [[Disposer]] for `setInterval` function call. This ensures that all\r\n * timeouts created by the object will be cleared when object itself is\r\n * disposed.\r\n *\r\n * @ignore Exclude from docs\r\n * @param fn Callback function\r\n * @param delay Timeout (ms)\r\n * @return Disposer for timeout\r\n */\r\n BaseObject.prototype.setInterval = function (fn, delay) {\r\n var _this = this;\r\n var id = setInterval(function () {\r\n _this.removeDispose(disposer);\r\n fn();\r\n }, delay);\r\n var disposer = new Disposer(function () {\r\n clearTimeout(id);\r\n });\r\n this._disposers.push(disposer);\r\n return disposer;\r\n };\r\n Object.defineProperty(BaseObject.prototype, \"config\", {\r\n /**\r\n * ==========================================================================\r\n * JSON-BASED CONFIG PROCESSING\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Use this property to set JSON-based config. When set, triggers processing\r\n * routine, which will go through all properties, and try to apply values,\r\n * create instances, etc.\r\n *\r\n * Use this with caution, as it is a time-consuming process. It's used for\r\n * initialchart setup only, not routine operations.\r\n *\r\n * @param json JSON config\r\n */\r\n set: function (config) {\r\n try {\r\n this.processConfig(config);\r\n }\r\n catch (e) {\r\n /*if (this instanceof Sprite) {\r\n this.raiseCriticalError(e);\r\n }*/\r\n this.raiseCriticalError(e);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Processes the JSON config.\r\n *\r\n * @param json JSON config\r\n * @ignore Exclude from docs\r\n */\r\n BaseObject.prototype.processConfig = function (config) {\r\n var _this = this;\r\n if (!config) {\r\n return;\r\n }\r\n // Get target\r\n var target = this;\r\n // Iterate through all of the items\r\n $object.eachOrdered(config, function (configKey, value) {\r\n var configValue = value;\r\n // Is this a callback?\r\n if (configKey == \"callback\" && typeof value == \"function\") {\r\n value.call(target);\r\n }\r\n // Check if there's a property in target\r\n if (_this.hasProperty(configKey)) {\r\n var item_1;\r\n // Do we have instructions to create an object?\r\n // We create a new object if \"type\" key is set, but only if the\r\n // target object is of different type.\r\n if ($type.isObject(configValue)\r\n && $type.hasValue(configValue[\"type\"])\r\n && (!$type.isObject(target[configKey])\r\n || !$type.hasValue(target[configKey].className)\r\n || configValue[\"forceCreate\"]\r\n || target[configKey].className != configValue[\"type\"])\r\n && !_this.asIs(configKey)) {\r\n item_1 = _this.createClassInstance(configValue[\"type\"]);\r\n // Create new instance\r\n if (item_1) {\r\n target[configKey] = item_1;\r\n }\r\n else {\r\n item_1 = target[configKey];\r\n }\r\n }\r\n else {\r\n // Get item from the object\r\n item_1 = target[configKey];\r\n }\r\n /**\r\n * It is...\r\n * --------------------------------------------------------------------\r\n */\r\n if (item_1 instanceof Adapter) {\r\n // ... an Adapter, try to add handlers to it\r\n // ------------------------------------------------------------------\r\n _this.processAdapters(item_1, configValue);\r\n }\r\n else if (item_1 instanceof EventDispatcher) {\r\n // ... an EventDispatcher, try to add handlers to it\r\n // ------------------------------------------------------------------\r\n _this.processEvents(item_1, configValue);\r\n }\r\n else if (configKey == \"locale\" && $type.isString(configValue)) {\r\n // ... a locale specified as string, e.g. \"fr_FR\"\r\n // ------------------------------------------------------------------\r\n if (window[\"am4lang_\" + configValue]) {\r\n target[configKey] = window[\"am4lang_\" + configValue];\r\n }\r\n }\r\n else if (configKey == \"parent\" && $type.isString(configValue)) {\r\n // ... a parent referred via its it\r\n // ------------------------------------------------------------------\r\n var parent_1 = _this.map.getKey(configValue);\r\n if (parent_1) {\r\n target[configKey] = parent_1;\r\n }\r\n else {\r\n _this.addDelayedMap(\"parent\", configValue);\r\n }\r\n }\r\n else if (_this.asIs(configKey)) {\r\n // ... a special field, just set it to new value\r\n // ------------------------------------------------------------------\r\n // (no need to add each indvidual item)\r\n target[configKey] = configValue;\r\n }\r\n else if (_this.asFunction(configKey) && $type.isString(configValue)) {\r\n // ... a field indicating function name to look for in registry\r\n // ------------------------------------------------------------------\r\n if ($type.hasValue(registry.registeredClasses[configValue])) {\r\n target[configKey] = registry.registeredClasses[configValue];\r\n }\r\n else {\r\n throw Error(\"Invalid easing function: \" + configValue);\r\n }\r\n }\r\n else if (configValue instanceof BaseObject) {\r\n // ... a BaseObject object, we just going to use it as it is\r\n // ------------------------------------------------------------------\r\n target[configKey] = configValue;\r\n }\r\n else if (item_1 instanceof BaseObject) {\r\n // ... another child BaseObject\r\n // ------------------------------------------------------------------\r\n // Let's just pass in config part in and let itself deal with it\r\n item_1.config = configValue;\r\n }\r\n else if (item_1 instanceof ListTemplate || item_1 instanceof OrderedListTemplate || item_1 instanceof SortedListTemplate) {\r\n // ... a list with template\r\n // ------------------------------------------------------------------\r\n // Let's see what we can do with it\r\n if ($type.isArray(configValue)) {\r\n // It's an array.\r\n // Create a list item for entry, or try to apply properties to an\r\n // existing entry if possible and it is present.\r\n if (item_1 instanceof ListTemplate) {\r\n _this.processListTemplate(configValue, item_1);\r\n }\r\n else {\r\n _this.processOrderedTemplate(configValue, item_1);\r\n }\r\n }\r\n else if ($type.isObject(configValue)) {\r\n // It's a single oject.\r\n // Treat it as a template.\r\n if (configValue instanceof BaseObject) {\r\n // Item is already a BaseObject, no need to process it further\r\n item_1.template = configValue;\r\n }\r\n else {\r\n // Now let's find out if the whole object if a template, or we\r\n // need to get it from `template` key\r\n var templateValue = void 0;\r\n if ($type.hasValue(configValue.template)) {\r\n templateValue = configValue.template;\r\n }\r\n else {\r\n templateValue = configValue;\r\n }\r\n if (item_1.template instanceof BaseObject) {\r\n // Template is a BaseObject so we will just let its config\r\n // deal with the configuration\r\n item_1.template.config = templateValue;\r\n }\r\n else {\r\n $object.each(templateValue, function (entryKey, entryValue) {\r\n var listItem = item_1.template[entryKey];\r\n if (listItem instanceof Adapter) {\r\n _this.processAdapters(listItem, entryValue);\r\n }\r\n else if (listItem instanceof EventDispatcher) {\r\n _this.processEvents(listItem, entryValue);\r\n }\r\n else if (listItem instanceof DictionaryTemplate) {\r\n _this.processDictionaryTemplate(listItem, entryValue);\r\n }\r\n else if (item_1.template[entryKey] instanceof BaseObject) {\r\n // Template is a BaseObject. Let it deal with its own config.\r\n item_1.template[entryKey].config = entryValue;\r\n }\r\n else if ($type.isObject(entryValue) && $type.hasValue(entryValue[\"type\"])) {\r\n listItem = _this.createClassInstance(entryValue[\"type\"]);\r\n if (listItem) {\r\n if (listItem instanceof BaseObject) {\r\n listItem.config = entryValue;\r\n }\r\n item_1.template[entryKey] = listItem;\r\n }\r\n else {\r\n item_1.template[entryKey] = entryValue;\r\n }\r\n }\r\n else if (listItem instanceof List) {\r\n // It's List, process it\r\n _this.processList(entryValue, listItem);\r\n }\r\n else {\r\n // Aything else. Just assing and be done with it.\r\n item_1.template[entryKey] = _this.maybeColorOrPercent(entryValue);\r\n }\r\n });\r\n }\r\n // Check maybe there are `values` to insert\r\n if ($type.hasValue(configValue.values)) {\r\n if (item_1 instanceof ListTemplate) {\r\n _this.processListTemplate(configValue.values, item_1);\r\n }\r\n else {\r\n _this.processOrderedTemplate(configValue.values, item_1);\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n // Something else?\r\n // Not sure what to do with it on a list - ignore\r\n }\r\n }\r\n else if (item_1 instanceof List) {\r\n // ... a list\r\n // ------------------------------------------------------------------\r\n if (configKey == \"children\") {\r\n _this.processList(configValue, item_1, _this);\r\n }\r\n else {\r\n _this.processList(configValue, item_1);\r\n }\r\n }\r\n else if (item_1 instanceof DictionaryTemplate) {\r\n // ... a dictionary with template\r\n // ------------------------------------------------------------------\r\n _this.processDictionaryTemplate(item_1, configValue);\r\n }\r\n else if (item_1 instanceof Dictionary) {\r\n // ... a dictionary\r\n // ------------------------------------------------------------------\r\n _this.processDictionary(item_1, configValue);\r\n }\r\n else if (item_1 instanceof Color || item_1 instanceof Percent) {\r\n // ... it's a Color or Percent\r\n // ------------------------------------------------------------------\r\n target[configKey] = _this.maybeColorOrPercent(configValue);\r\n }\r\n else if ($type.isObject(item_1) && $type.isObject(configValue)) {\r\n // ... a regular object\r\n // ------------------------------------------------------------------\r\n $object.copyAllProperties(configValue, item_1);\r\n }\r\n else {\r\n // ... something else - probably a simple property or object\r\n // ------------------------------------------------------------------\r\n // Maybe convert to `Percent` or `Color`?\r\n configValue = _this.maybeColorOrPercent(configValue);\r\n // Assign\r\n target[configKey] = configValue;\r\n }\r\n }\r\n else if (!_this.isReserved(configKey)) {\r\n // Doesn't have property set. But we're going to assume JSON config\r\n // creator knows what he/she is doing and set it anyway.\r\n target[configKey] = configValue;\r\n }\r\n }, this.configOrder);\r\n // Any errors?\r\n if (this.processingErrors.length) {\r\n var errors = this.processingErrors.join(\"\\n\");\r\n this._processingErrors = [];\r\n throw Error(errors);\r\n }\r\n };\r\n /**\r\n * Tries to detect if value is color or percent and converts to proper object\r\n * if necessary.\r\n *\r\n * Returns the same source value if no color/percent detected\r\n *\r\n * @param value Source value\r\n * @return Converted value\r\n */\r\n BaseObject.prototype.maybeColorOrPercent = function (value) {\r\n if ($type.isString(value)) {\r\n if (value.match(/^[\\-]?[0-9.]+\\%$/)) {\r\n return percent($type.toNumber(value));\r\n }\r\n else if (value.match(/^\\#[0-9abcdef]{3,}$/i)) {\r\n return color(value);\r\n }\r\n }\r\n return value;\r\n };\r\n BaseObject.prototype.processAdapters = function (item, config) {\r\n var _this = this;\r\n if ($type.isArray(config)) {\r\n $array.each(config, function (entry, index) {\r\n item.add(entry.key, entry.callback, entry.priority || 0, _this);\r\n });\r\n }\r\n else if ($type.isObject(config)) {\r\n $object.each(config, function (key, entry) {\r\n if (!item.has(key, entry)) {\r\n item.add(key, entry);\r\n }\r\n });\r\n }\r\n };\r\n BaseObject.prototype.processEvents = function (item, config) {\r\n var _this = this;\r\n if ($type.isArray(config)) {\r\n $array.each(config, function (entry, index) {\r\n item.on(entry.type, entry.callback, _this);\r\n });\r\n }\r\n else if ($type.isObject(config)) {\r\n $object.each(config, function (key, entry) {\r\n if (!item.has(key, entry)) {\r\n item.on(key, entry);\r\n }\r\n });\r\n }\r\n };\r\n /**\r\n * Processes JSON config for a [[DictionaryTemplate]] item.\r\n *\r\n * @todo Description\r\n * @param item Item\r\n * @param config Config\r\n */\r\n BaseObject.prototype.processDictionaryTemplate = function (item, config) {\r\n // We can only process object\r\n // Not sure what to do with other types - ignore\r\n if ($type.isObject(config)) {\r\n // Create an entry for each item, or override properties for\r\n // existing one.\r\n $object.each(config, function (entryKey, entryValue) {\r\n var listItem;\r\n // Get existing one, or create a new one\r\n if (entryKey == \"template\") {\r\n listItem = item.template;\r\n }\r\n else if (item.hasKey(entryKey)) {\r\n listItem = item.getKey(entryKey);\r\n }\r\n else {\r\n listItem = item.create(entryKey);\r\n }\r\n // Set data\r\n if (listItem instanceof BaseObject) {\r\n listItem.config = entryValue;\r\n }\r\n else if ($type.isObject(listItem) && $type.isObject(entryValue)) {\r\n $object.copyAllProperties(entryValue, listItem);\r\n }\r\n else {\r\n listItem.setKey(entryKey, entryValue);\r\n }\r\n });\r\n }\r\n };\r\n /**\r\n * Processes JSON config for a [[Dictionary]] item.\r\n *\r\n * @todo Description\r\n * @param item Item\r\n * @param config Config\r\n */\r\n BaseObject.prototype.processDictionary = function (item, config) {\r\n // We can only process object\r\n // Not sure what to do with other types - ignore\r\n if ($type.isObject(config)) {\r\n // Create an entry for each item, or override properties for\r\n // existing one.\r\n // @todo support for non-basic types\r\n $object.each(config, function (entryKey, entryValue) {\r\n item.setKey(entryKey, entryValue);\r\n });\r\n }\r\n };\r\n /**\r\n * Processes [[ListTemplate]].\r\n *\r\n * @param configValue Config value\r\n * @param item Item\r\n */\r\n BaseObject.prototype.processListTemplate = function (configValue, item) {\r\n var _this = this;\r\n $array.each(configValue, function (entry, index) {\r\n var type = _this.getConfigEntryType(entry);\r\n var listItem;\r\n if (item.hasIndex(index) && !entry[\"forceCreate\"]) {\r\n listItem = item.getIndex(index);\r\n }\r\n else if (entry instanceof BaseObject) {\r\n // Item is already a BaseObject, no need to process it further\r\n item.push(entry);\r\n return;\r\n }\r\n else if (type) {\r\n listItem = item.create(type);\r\n }\r\n else {\r\n listItem = item.create();\r\n }\r\n if (entry === listItem) {\r\n // It's already the same item, do nothing\r\n }\r\n else {\r\n if ($type.isObject(entry)) {\r\n // If the list item is BaseObject, we just need to let it\r\n // deal if its own config\r\n if (listItem instanceof BaseObject) {\r\n listItem.config = entry;\r\n }\r\n else if ($type.isObject(listItem) && $type.isObject(entry)) {\r\n $object.copyAllProperties(entry, listItem);\r\n }\r\n else {\r\n item.setIndex(item.indexOf(listItem), entry);\r\n }\r\n }\r\n }\r\n });\r\n // Truncate the list if it contains less items than the config\r\n // array\r\n while (configValue.length > item.length) {\r\n item.pop();\r\n }\r\n };\r\n /**\r\n * Processes [[OrdererListTemplate]] or [[SortedListTemplate]].\r\n *\r\n * @param configValue Config value\r\n * @param item Item\r\n */\r\n BaseObject.prototype.processOrderedTemplate = function (configValue, item) {\r\n var _this = this;\r\n $array.each(configValue, function (entry, index) {\r\n var type = _this.getConfigEntryType(entry);\r\n var listItem;\r\n if (type) {\r\n listItem = item.create(type);\r\n }\r\n else {\r\n listItem = item.create();\r\n }\r\n if ($type.isObject(entry)) {\r\n // If the list item is BaseObject, we just need to let it\r\n // deal if its own config\r\n if (listItem instanceof BaseObject) {\r\n listItem.config = entry;\r\n }\r\n else if ($type.isObject(listItem) && $type.isObject(entry)) {\r\n $object.copyAllProperties(entry, listItem);\r\n }\r\n else {\r\n item.insert(entry);\r\n }\r\n }\r\n });\r\n };\r\n /**\r\n * Processes [[List]].\r\n *\r\n * @param configValue Config value\r\n * @param item Item\r\n */\r\n BaseObject.prototype.processList = function (configValue, item, parent) {\r\n var _this = this;\r\n // Convert to array if necessary\r\n if (!$type.isArray(configValue)) {\r\n configValue = [configValue];\r\n }\r\n // It's an array\r\n // Create a list item for entry\r\n var itemCount = item.length;\r\n var extraCount = 0;\r\n $array.each(configValue, function (entry, index) {\r\n if ($type.isObject(entry)) {\r\n // An object.\r\n //\r\n // Let's see if we can instantiate a class out of it, or we need\r\n // to push it into list as it is.\r\n //\r\n // If there are items already at the specified index in the list,\r\n // apply properties rather than create a new one.\r\n var listItem = void 0;\r\n if ((index < itemCount) && !entry[\"forceCreate\"]) {\r\n listItem = item.getIndex(index);\r\n }\r\n else if (entry instanceof BaseObject) {\r\n // Item is already a BaseObject, no need to process it further\r\n item.push(entry);\r\n return;\r\n }\r\n else {\r\n extraCount++;\r\n listItem = _this.createEntryInstance(entry);\r\n if (parent) {\r\n listItem.parent = parent;\r\n }\r\n else {\r\n item.push(listItem);\r\n }\r\n }\r\n // If the list item is BaseObject, we just need to let it\r\n // deal if its own config\r\n if (listItem instanceof BaseObject) {\r\n listItem.config = entry;\r\n }\r\n else if ($type.isObject(listItem) && $type.isObject(entry)) {\r\n $object.copyAllProperties(entry, listItem);\r\n }\r\n }\r\n else {\r\n // Basic value.\r\n // Just push it into list, or override existing value\r\n if (item.hasIndex(index)) {\r\n item.setIndex(index, entry);\r\n }\r\n else {\r\n item.push(entry);\r\n }\r\n }\r\n });\r\n // Truncate the list if it contains less items than the config\r\n // array\r\n while (!parent && (configValue.length + extraCount) < item.length) {\r\n item.pop();\r\n }\r\n };\r\n /**\r\n * This function is used to sort element's JSON config properties, so that\r\n * some properties that absolutely need to be processed last, can be put at\r\n * the end.\r\n *\r\n * @ignore Exclude from docs\r\n * @param a Element 1\r\n * @param b Element 2\r\n * @return Sorting number\r\n */\r\n BaseObject.prototype.configOrder = function (a, b) {\r\n if (a == b) {\r\n return 0;\r\n }\r\n // Language must come first, so it's all set up when the rest of the\r\n // elements are being instantiated\r\n else if (a == \"language\") {\r\n return -1;\r\n }\r\n else if (b == \"language\") {\r\n return 1;\r\n }\r\n else {\r\n return 0;\r\n }\r\n };\r\n /**\r\n * Checks if field should be just assigned as is, without any checking when\r\n * processing JSON config.\r\n *\r\n * Extending functions can override this function to do their own checks.\r\n *\r\n * @param field Field name\r\n * @return Assign as is?\r\n */\r\n BaseObject.prototype.asIs = function (field) {\r\n return $array.indexOf([\"locale\"], field) != -1;\r\n };\r\n /**\r\n * Checks if field needs to be converted to function, if it is specified\r\n * as string.\r\n *\r\n * @param field Field name\r\n * @return Assign as function?\r\n */\r\n BaseObject.prototype.asFunction = function (field) {\r\n return false;\r\n };\r\n /**\r\n * Creates a relevant class instance if such class definition exists.\r\n *\r\n * @ignore Exclude from docs\r\n * @param className Class name\r\n * @return Instance\r\n */\r\n BaseObject.prototype.createClassInstance = function (className) {\r\n if ($type.hasValue(registry.registeredClasses[className])) {\r\n return new registry.registeredClasses[className]();\r\n }\r\n else {\r\n throw Error(\"Invalid type: \\\"\" + className + \"\\\".\");\r\n }\r\n };\r\n /**\r\n * Creates a class instance for a config entry using it's type. (as set in\r\n * `type` property)\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config part\r\n * @return Instance\r\n */\r\n BaseObject.prototype.createEntryInstance = function (config) {\r\n var res;\r\n if ($type.hasValue(config[\"type\"])) {\r\n res = this.createClassInstance(config[\"type\"]);\r\n }\r\n if (!res) {\r\n return config;\r\n }\r\n return res;\r\n };\r\n /**\r\n * Determines config object type.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config part\r\n * @return Type\r\n */\r\n BaseObject.prototype.getConfigEntryType = function (config) {\r\n if ($type.hasValue(config[\"type\"])) {\r\n if ($type.hasValue(registry.registeredClasses[config[\"type\"]])) {\r\n return registry.registeredClasses[config[\"type\"]];\r\n }\r\n else {\r\n throw Error(\"Invalid type: \\\"\" + config[\"type\"] + \"\\\".\");\r\n }\r\n }\r\n return;\r\n };\r\n /**\r\n * Checks if this element has a property.\r\n *\r\n * @ignore Exclude from docs\r\n * @param prop Property name\r\n * @return Has property?\r\n */\r\n BaseObject.prototype.hasProperty = function (prop) {\r\n return prop in this ? true : false;\r\n };\r\n /**\r\n * Checkes whether JSON key is a reserved keyword.\r\n *\r\n * @param key Key\r\n * @return Reserved\r\n */\r\n BaseObject.prototype.isReserved = function (key) {\r\n return [\"type\", \"forceCreate\"].indexOf(key) !== -1;\r\n };\r\n Object.defineProperty(BaseObject.prototype, \"processingErrors\", {\r\n /**\r\n * A list of errors that happened during JSON processing.\r\n *\r\n * @return Errors\r\n */\r\n get: function () {\r\n if (!this._processingErrors) {\r\n this._processingErrors = [];\r\n }\r\n return this._processingErrors;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return BaseObject;\r\n}());\r\nexport { BaseObject };\r\n;\r\n/**\r\n * A version of [[BaseObject]] with events properties and methods.\r\n * Classes that use [[EventDispatcher]] should extend this instead of\r\n * [[BaseObject]] directly.\r\n */\r\nvar BaseObjectEvents = /** @class */ (function (_super) {\r\n __extends(BaseObjectEvents, _super);\r\n /**\r\n * Constructor\r\n */\r\n function BaseObjectEvents() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"BaseObjectEvents\";\r\n return _this;\r\n }\r\n Object.defineProperty(BaseObjectEvents.prototype, \"events\", {\r\n /**\r\n * An [[EventDispatcher]] instance\r\n */\r\n get: function () {\r\n if (!this._eventDispatcher) {\r\n this._eventDispatcher = new EventDispatcher();\r\n this._disposers.push(this._eventDispatcher);\r\n }\r\n return this._eventDispatcher;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n //public set events(value:EventDispatcher>){\r\n //\tthis._eventDispatcher = value;\r\n //}\r\n /**\r\n * Dispatches an event using own event dispatcher. Will automatically\r\n * populate event data object with event type and target (this element).\r\n * It also checks if there are any handlers registered for this sepecific\r\n * event.\r\n *\r\n * @param eventType Event type (name)\r\n * @param data Data to pass into event handler(s)\r\n */\r\n BaseObjectEvents.prototype.dispatch = function (eventType, data) {\r\n // @todo Implement proper type check\r\n if (this._eventDispatcher) {\r\n if (this.events.isEnabled(eventType)) {\r\n if (data) {\r\n data.type = eventType;\r\n data.target = data.target || this;\r\n this.events.dispatch(eventType, {\r\n type: eventType,\r\n target: this\r\n });\r\n }\r\n else {\r\n this.events.dispatch(eventType, {\r\n type: eventType,\r\n target: this\r\n });\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Works like `dispatch`, except event is triggered immediately, without\r\n * waiting for the next frame cycle.\r\n *\r\n * @param eventType Event type (name)\r\n * @param data Data to pass into event handler(s)\r\n */\r\n BaseObjectEvents.prototype.dispatchImmediately = function (eventType, data) {\r\n // @todo Implement proper type check\r\n if (this._eventDispatcher) {\r\n if (this.events.isEnabled(eventType)) {\r\n if (data) {\r\n data.type = eventType;\r\n data.target = data.target || this;\r\n this.events.dispatchImmediately(eventType, data);\r\n }\r\n else {\r\n this.events.dispatchImmediately(eventType, {\r\n type: eventType,\r\n target: this\r\n });\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Copies all parameters from another [[Sprite]].\r\n *\r\n * @param source Source object\r\n */\r\n BaseObjectEvents.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n if (source._eventDispatcher) {\r\n this.events.copyFrom(source._eventDispatcher);\r\n }\r\n };\r\n return BaseObjectEvents;\r\n}(BaseObject));\r\nexport { BaseObjectEvents };\r\n//# sourceMappingURL=Base.js.map","/**\r\n * A collection of String-based constants.\r\n * @hidden\r\n * @ignore Exclude from docs\r\n */\r\n/**\r\n * @ignore Exclude from docs\r\n */\r\nexport var PX = \"px\";\r\n/**\r\n * @ignore Exclude from docs\r\n */\r\nexport var STRING = \"string\";\r\n/**\r\n * @ignore Exclude from docs\r\n */\r\nexport var NUMBER = \"number\";\r\n/**\r\n * @ignore Exclude from docs\r\n */\r\nexport var DATE = \"date\";\r\n/**\r\n * @ignore Exclude from docs\r\n */\r\nexport var DURATION = \"duration\";\r\n/**\r\n * @ignore Exclude from docs\r\n */\r\nexport var PLACEHOLDER = \"__§§§__\";\r\n/**\r\n * @ignore Exclude from docs\r\n */\r\nexport var PLACEHOLDER2 = \"__§§§§__\";\r\n//# sourceMappingURL=Strings.js.map","/**\r\n * A collection of universal utility functions.\r\n */\r\nimport { Percent } from \"./Percent\";\r\nimport { isSafari } from \"./Browser\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $string from \"./String\";\r\nimport * as $strings from \"./Strings\";\r\nimport * as $object from \"./Object\";\r\nimport * as $array from \"./Array\";\r\n/**\r\n * ============================================================================\r\n * MISC FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Marks a value as being used (e.g. because the value has side effects).\r\n */\r\nexport function used(value) { }\r\n/**\r\n * Copies all properties of one object to the other, omitting undefined.\r\n *\r\n * @param fromObject Source object\r\n * @param toObject Target object\r\n * @return Updated target object\r\n * @todo Maybe consolidate with utils.copy?\r\n */\r\nexport function copyProperties(source, target) {\r\n $object.each(source, function (key, value) {\r\n // only if value is set\r\n if ($type.hasValue(value)) {\r\n target[key] = value;\r\n }\r\n });\r\n return target;\r\n}\r\n/**\r\n * Removes target from url\r\n */\r\nexport function stripHash(url) {\r\n return /^[^#]*/.exec(url)[0];\r\n}\r\nexport function getBaseURI() {\r\n var url = \"#\";\r\n // Needed until https://bugs.webkit.org/show_bug.cgi?id=189499 is fixed\r\n if (isSafari()) {\r\n var baseURI = document.baseURI;\r\n if (baseURI) {\r\n baseURI = stripHash(baseURI);\r\n var loc = stripHash(location.href);\r\n if (baseURI !== loc) {\r\n url = loc + url;\r\n }\r\n }\r\n }\r\n return url;\r\n}\r\n/**\r\n * Copies all properties of one object to the other, omitting undefined, but only if property in target object doesn't have a value set.\r\n *\r\n * @param fromObject Source object\r\n * @param toObject Target object\r\n * @return Updated target object\r\n * @todo Maybe consolidate with utils.copy?\r\n */\r\nexport function softCopyProperties(source, target) {\r\n $object.each(source, function (key, value) {\r\n // only if value is set\r\n if ($type.hasValue(value) && !($type.hasValue(target[key]))) {\r\n target[key] = value;\r\n }\r\n });\r\n return target;\r\n}\r\n/**\r\n * Copies all properties of one object to the other.\r\n *\r\n * @param source Source object\r\n * @param recipient Target object\r\n * @return Updated target object\r\n */\r\nexport function copy(source, target) {\r\n $object.each(source, function (key, value) {\r\n target[key] = value;\r\n });\r\n return target;\r\n}\r\n/**\r\n * Checks if value is not empty (undefined or zero-length string).\r\n *\r\n * @param value Value to check\r\n * @return `true` if value is not \"empty\"\r\n */\r\nexport function isNotEmpty(value) {\r\n return $type.hasValue(value) && (value.toString() !== \"\");\r\n}\r\n/**\r\n * [relativeToValue description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param percent [description]\r\n * @param full [description]\r\n * @return [description]\r\n */\r\nexport function relativeToValue(percent, full) {\r\n if ($type.isNumber(percent)) {\r\n return percent;\r\n }\r\n else if (percent != null && $type.isNumber(percent.value) && $type.isNumber(full)) {\r\n return full * percent.value;\r\n }\r\n else {\r\n return 0;\r\n }\r\n}\r\n/**\r\n * [relativeRadiusToValue description]\r\n *\r\n * Differs from relativeToValue so that if a value is negative, it subtracts\r\n * it from full value.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param percent [description]\r\n * @param full [description]\r\n * @param subtractIfNegative [description]\r\n * @return [description]\r\n */\r\nexport function relativeRadiusToValue(percent, full, subtractIfNegative) {\r\n var value;\r\n if ($type.isNumber(percent)) {\r\n value = percent;\r\n if (value < 0) {\r\n if (subtractIfNegative) {\r\n value = full + value;\r\n }\r\n else {\r\n value = full - value;\r\n }\r\n }\r\n }\r\n else if (percent != null && $type.isNumber(percent.value)) {\r\n value = full * percent.value;\r\n }\r\n return value;\r\n}\r\n/**\r\n * [valueToRelative description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param value [description]\r\n * @param full [description]\r\n * @return [description]\r\n */\r\nexport function valueToRelative(value, full) {\r\n if (value instanceof Percent) {\r\n return value.value;\r\n }\r\n else {\r\n return value / full;\r\n }\r\n}\r\n/**\r\n * Returns pixel ratio of the current screen (used on retina displays).\r\n *\r\n * @return Pixel ratio\r\n */\r\nexport function getPixelRatio() {\r\n var ratio = window.devicePixelRatio || 1;\r\n return ratio;\r\n}\r\n/**\r\n * ============================================================================\r\n * STRING FORMATTING FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Converts camelCased text to dashed version:\r\n * (\"thisIsString\" > \"this-is-string\")\r\n *\r\n * @param str Input\r\n * @return Output\r\n */\r\nexport function camelToDashed(str) {\r\n return str.replace(/\\W+/g, '-').replace(/([a-z\\d])([A-Z])/g, '$1-$2').toLowerCase();\r\n}\r\n/**\r\n * Converts tring to uppercase.\r\n *\r\n * @param str String to convert\r\n * @return uppercased string\r\n * @todo Maybe make it better\r\n */\r\nexport function capitalize(str) {\r\n var arr = str.split(\"\");\r\n arr[0] = arr[0].toUpperCase();\r\n return arr.join(\"\");\r\n}\r\n/**\r\n * Converts any value into its string representation.\r\n *\r\n * @param value Value\r\n * @return String represantation of the value\r\n */\r\nexport function stringify(value) {\r\n return JSON.stringify(value);\r\n}\r\n/**\r\n * Escapes string so it can safely be used in a Regex.\r\n *\r\n * @param value Unsescaped string\r\n * @return Escaped string\r\n */\r\nexport function escapeForRgex(value) {\r\n return value.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\r\n}\r\n/**\r\n * Splits the text into multiple lines, respecting maximum character count.\r\n * Prioretizes splitting on spaces and punctuation. Falls back on splitting\r\n * mid-word if there's no other option.\r\n *\r\n * @param text Text\r\n * @param maxChars Maximum number of characters per line\r\n * @return An array of split text\r\n */\r\nexport function splitTextByCharCount(text, maxChars, fullWords, rtl, fullWordFallback) {\r\n // Maybe the text fits?\r\n if (text.length <= maxChars) {\r\n return [text];\r\n }\r\n // Init result\r\n var res = [];\r\n // Split by words or by charts\r\n if (fullWords) {\r\n // Split by words first\r\n // Split by spacing\r\n var currentIndex = -1;\r\n //let tmpText = text.replace(/([,;:!?\\\\\\/\\.]+[\\s]+|[\\s])/g, $strings.PLACEHOLDER + \"$1\" + $strings.PLACEHOLDER);\r\n var tmpText = text.replace(/([,;:!?\\\\\\/]+|[\\s])/g, $strings.PLACEHOLDER + \"$1\" + $strings.PLACEHOLDER);\r\n var words = tmpText.split($strings.PLACEHOLDER);\r\n // Glue end-of-word punctuation to the word itself\r\n for (var i = 1; i < words.length; i++) {\r\n var word = words[i];\r\n if ((word == \".\" || word == \",\") && words[i - 1].match(/[\\w]+$/)) {\r\n words[i - 1] += word;\r\n words[i] = \"\";\r\n }\r\n }\r\n // Process each word\r\n for (var i = 0; i < words.length; i++) {\r\n // Get word and symbol count\r\n var word = words[i];\r\n var wordLength = word.length;\r\n // Ignore empty words\r\n if (wordLength === 0) {\r\n continue;\r\n }\r\n // Check word length\r\n if ((wordLength > maxChars) && (fullWords !== true || fullWordFallback != false)) {\r\n //if (wordLength > maxChars) {\r\n // A single word is longer than allowed symbol count\r\n // Break it up\r\n if (rtl) {\r\n word = reverseString(word);\r\n }\r\n var parts = word.match(new RegExp(\".{1,\" + maxChars + \"}\", \"g\"));\r\n // TODO is this correct ?\r\n if (parts) {\r\n if (rtl) {\r\n for (var x = 0; x < parts.length; x++) {\r\n parts[x] = reverseString(parts[x]);\r\n }\r\n //parts.reverse();\r\n }\r\n res = res.concat(parts);\r\n }\r\n }\r\n else {\r\n // Init current line\r\n if (currentIndex === -1) {\r\n res.push(\"\");\r\n currentIndex = 0;\r\n }\r\n // Check if we need to break into another line\r\n if (((res[currentIndex].length + wordLength + 1) > maxChars) && res[currentIndex] !== \"\") {\r\n res.push(\"\");\r\n currentIndex++;\r\n }\r\n // Add word\r\n res[currentIndex] += word;\r\n }\r\n // Update index\r\n currentIndex = res.length - 1;\r\n }\r\n }\r\n else {\r\n // Splitting by anywhere (living la vida facil)\r\n var parts = text.match(new RegExp(\".{1,\" + maxChars + \"}\", \"g\"));\r\n if (parts) {\r\n if (rtl) {\r\n for (var x = 0; x < parts.length; x++) {\r\n if (!rtl) {\r\n parts[x] = reverseString(parts[x]);\r\n }\r\n }\r\n }\r\n res = parts;\r\n }\r\n }\r\n // Do we have only one word that does not fit?\r\n // Since fullWords is set and we can't split the word, we end up with empty\r\n // set.\r\n if (res.length == 1 && fullWords && fullWordFallback && (res[0].length > maxChars)) {\r\n res = [];\r\n }\r\n return res;\r\n}\r\n/**\r\n * Truncates the text to certain character count.\r\n *\r\n * Will add ellipsis if the string is truncated. Optionally, can truncate on\r\n * full words only.\r\n *\r\n * For RTL support, pass in the fifth parameter as `true`.\r\n *\r\n * @param text Input text\r\n * @param maxChars Maximum character count of output\r\n * @param ellipsis Ellipsis string, i.e. \"...\"\r\n * @param fullWords If `true`, will not break mid-word, unless there's a single word and it does not with into `maxChars`\r\n * @param rtl Is this an RTL text?\r\n * @return Truncated text\r\n */\r\nexport function truncateWithEllipsis(text, maxChars, ellipsis, fullWords, rtl) {\r\n if (text.length <= maxChars) {\r\n return text;\r\n }\r\n // Calc max chars\r\n maxChars -= ellipsis.length;\r\n if (maxChars < 1) {\r\n maxChars = 1;\r\n //ellipsis = \"\";\r\n }\r\n // Get lines\r\n var lines = splitTextByCharCount(text, maxChars, fullWords, rtl);\r\n // Use first line\r\n return (lines[0] || \"\") + ellipsis;\r\n}\r\n/**\r\n * Removes whitespace from beginning and end of the string.\r\n *\r\n * @param str Input\r\n * @return Output\r\n */\r\nexport function trim(str) {\r\n return str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, \"\");\r\n}\r\n;\r\n/**\r\n * Removes whitespace from end of the string.\r\n *\r\n * @param str Input\r\n * @return Output\r\n */\r\nexport function rtrim(str) {\r\n return str.replace(/[\\s\\uFEFF\\xA0]+$/g, \"\");\r\n}\r\n;\r\n/**\r\n * Removes whitespace from beginning of the string.\r\n *\r\n * @param str Input\r\n * @return Output\r\n */\r\nexport function ltrim(str) {\r\n return str.replace(/^[\\s\\uFEFF\\xA0]+/g, \"\");\r\n}\r\n;\r\n/**\r\n * Reverses string.\r\n *\r\n * @param str Input\r\n * @return Output\r\n */\r\nexport function reverseString(str) {\r\n return str.split(\"\").reverse().join(\"\");\r\n}\r\n/**\r\n * Removes quotes from the string.\r\n *\r\n * @param str Input\r\n * @return Output\r\n */\r\nexport function unquote(str) {\r\n var res = str.trim();\r\n res = str.replace(/^'(.*)'$/, \"$1\");\r\n if (res == str) {\r\n res = str.replace(/^\"(.*)\"$/, \"$1\");\r\n }\r\n return res;\r\n}\r\n/**\r\n * Pads a string with additional characters to certain length.\r\n *\r\n * @param value A numeric value\r\n * @param len Result string length in characters\r\n * @param char A character to use for padding\r\n * @return Padded value as string\r\n */\r\nexport function padString(value, len, char) {\r\n if (len === void 0) { len = 0; }\r\n if (char === void 0) { char = \"0\"; }\r\n if (typeof value !== \"string\") {\r\n value = value.toString();\r\n }\r\n return len > value.length ? Array(len - value.length + 1).join(char) + value : value;\r\n}\r\n/**\r\n * Tries to determine format type.\r\n *\r\n * @ignore Exclude from docs\r\n * @param format Format string\r\n * @return Format type (\"string\" | \"number\" | \"date\" | \"duration\")\r\n */\r\nexport function getFormat(format) {\r\n // Undefined?\r\n if (typeof format === \"undefined\") {\r\n return $strings.STRING;\r\n }\r\n // Cleanup and lowercase format\r\n format = format.toLowerCase().replace(/^\\[[^\\]]*\\]/, \"\");\r\n // Remove style tags\r\n format = format.replace(/\\[[^\\]]+\\]/, \"\");\r\n // Trim\r\n format = format.trim();\r\n // Check for any explicit format hints (i.e. /Date)\r\n var hints = format.match(/\\/(date|number|duration)$/);\r\n if (hints) {\r\n return hints[1];\r\n }\r\n // Check for explicit hints\r\n if (format === $strings.NUMBER) {\r\n return $strings.NUMBER;\r\n }\r\n if (format === $strings.DATE) {\r\n return $strings.DATE;\r\n }\r\n if (format === $strings.DURATION) {\r\n return $strings.DURATION;\r\n }\r\n // Detect number formatting symbols\r\n if (format.match(/[#0]/)) {\r\n return $strings.NUMBER;\r\n }\r\n // Detect date formatting symbols\r\n if (format.match(/[ymwdhnsqaxkzgtei]/)) {\r\n return $strings.DATE;\r\n }\r\n // Nothing? Let's display as string\r\n return $strings.STRING;\r\n}\r\n/**\r\n * Cleans up format:\r\n * * Strips out formatter hints\r\n *\r\n * @ignore Exclude from docs\r\n * @param format Format\r\n * @return Cleaned format\r\n */\r\nexport function cleanFormat(format) {\r\n return format.replace(/\\/(date|number|duration)$/i, \"\");\r\n}\r\n/**\r\n * Strips all tags from the string.\r\n *\r\n * @param text Source string\r\n * @return String without tags\r\n */\r\nexport function stripTags(text) {\r\n return text ? text.replace(/<[^>]*>/g, \"\") : text;\r\n}\r\n/**\r\n * Removes new lines and tags from a string.\r\n *\r\n * @param text String to conver\r\n * @return Converted string\r\n */\r\nexport function plainText(text) {\r\n return text ? stripTags((\"\" + text).replace(/[\\n\\r]+/g, \". \")) : text;\r\n}\r\n/**\r\n * ============================================================================\r\n * TYPE CONVERSION FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Converts numeric value into string. Deals with large or small numbers that\r\n * would otherwise use exponents.\r\n *\r\n * @param value Numeric value\r\n * @return Numeric value as string\r\n */\r\nexport function numberToString(value) {\r\n // TODO handle Infinity and -Infinity\r\n if ($type.isNaN(value)) {\r\n return \"NaN\";\r\n }\r\n if (value === Infinity) {\r\n return \"Infinity\";\r\n }\r\n if (value === -Infinity) {\r\n return \"-Infinity\";\r\n }\r\n // Negative 0\r\n if ((value === 0) && (1 / value === -Infinity)) {\r\n return \"-0\";\r\n }\r\n // Preserve negative and deal with absoute values\r\n var negative = value < 0;\r\n value = Math.abs(value);\r\n // TODO test this\r\n var parsed = $type.getValue(/^([0-9]+)(?:\\.([0-9]+))?(?:e[\\+\\-]([0-9]+))?$/.exec(\"\" + value));\r\n var digits = parsed[1];\r\n var decimals = parsed[2] || \"\";\r\n var res;\r\n // Leave the nummber as it is if it does not use exponents\r\n if (parsed[3] == null) {\r\n res = (decimals === \"\" ? digits : digits + \".\" + decimals);\r\n }\r\n else {\r\n var exponent = +parsed[3];\r\n // Deal with decimals\r\n if (value < 1) {\r\n var zeros = exponent - 1;\r\n res = \"0.\" + $string.repeat(\"0\", zeros) + digits + decimals;\r\n // Deal with integers\r\n }\r\n else {\r\n var zeros = exponent - decimals.length;\r\n if (zeros === 0) {\r\n res = digits + decimals;\r\n }\r\n else if (zeros < 0) {\r\n res = digits + decimals.slice(0, zeros) + \".\" + decimals.slice(zeros);\r\n }\r\n else {\r\n res = digits + decimals + $string.repeat(\"0\", zeros);\r\n }\r\n }\r\n }\r\n return negative ? \"-\" + res : res;\r\n}\r\n/**\r\n * Converts anything to Date object.\r\n *\r\n * @param value A value of any type\r\n * @return Date object representing a value\r\n */\r\nexport function anyToDate(value) {\r\n if ($type.isDate(value)) {\r\n // TODO maybe don't create a new Date ?\r\n var date = new Date(value);\r\n // This is needed because IE does not copy over milliseconds\r\n date.setMilliseconds(value.getMilliseconds());\r\n return date;\r\n }\r\n else if ($type.isNumber(value)) {\r\n return new Date(value);\r\n }\r\n else {\r\n // Try converting to number (assuming timestamp)\r\n var num = Number(value);\r\n if (!$type.isNumber(num)) {\r\n return new Date(value);\r\n }\r\n else {\r\n return new Date(num);\r\n }\r\n }\r\n}\r\n/**\r\n * Tries converting any value to a number.\r\n *\r\n * @param value Source value\r\n * @return Number\r\n */\r\nexport function anyToNumber(value) {\r\n if ($type.isDate(value)) {\r\n return value.getTime();\r\n }\r\n else if ($type.isNumber(value)) {\r\n return value;\r\n }\r\n else if ($type.isString(value)) {\r\n // Try converting to number (assuming timestamp)\r\n var num = Number(value);\r\n if (!$type.isNumber(num)) {\r\n // Failing\r\n return undefined;\r\n }\r\n else {\r\n return num;\r\n }\r\n }\r\n}\r\n/**\r\n * ============================================================================\r\n * DATE-RELATED FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Returns a year day.\r\n *\r\n * @param date Date\r\n * @param utc Assume UTC dates?\r\n * @return Year day\r\n * @todo Account for UTC\r\n */\r\nexport function getYearDay(date, utc) {\r\n if (utc === void 0) { utc = false; }\r\n var start = new Date(date.getFullYear(), 0, 0);\r\n var diff = (date.getTime() - start.getTime()) + ((start.getTimezoneOffset() - date.getTimezoneOffset()) * 60 * 1000);\r\n var oneDay = 1000 * 60 * 60 * 24;\r\n return Math.floor(diff / oneDay);\r\n}\r\n/**\r\n * Returns week number for a given date.\r\n *\r\n * @param date Date\r\n * @param utc Assume UTC dates?\r\n * @return Week number\r\n * @todo Account for UTC\r\n */\r\nexport function getWeek(date, _utc) {\r\n if (_utc === void 0) { _utc = false; }\r\n var d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));\r\n var day = d.getUTCDay() || 7;\r\n d.setUTCDate(d.getUTCDate() + 4 - day);\r\n var firstDay = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));\r\n return Math.ceil((((d.getTime() - firstDay.getTime()) / 86400000) + 1) / 7);\r\n}\r\n/**\r\n * Returns a week number in the month.\r\n *\r\n * @param date Source Date\r\n * @param utc Assume UTC dates?\r\n * @return Week number in month\r\n */\r\nexport function getMonthWeek(date, utc) {\r\n if (utc === void 0) { utc = false; }\r\n var firstWeek = getWeek(new Date(date.getFullYear(), date.getMonth(), 1), utc);\r\n var currentWeek = getWeek(date, utc);\r\n if (currentWeek == 1) {\r\n currentWeek = 53;\r\n }\r\n return currentWeek - firstWeek + 1;\r\n}\r\n/**\r\n * Returns a year day out of the given week number.\r\n *\r\n * @param week Week\r\n * @param year Year\r\n * @param weekday Weekday\r\n * @param utc Assume UTC dates\r\n * @return Day in a year\r\n */\r\nexport function getDayFromWeek(week, year, weekday, utc) {\r\n if (weekday === void 0) { weekday = 1; }\r\n if (utc === void 0) { utc = false; }\r\n var date = new Date(year, 0, 4, 0, 0, 0, 0);\r\n if (utc) {\r\n date.setUTCFullYear(year);\r\n }\r\n var day = week * 7 + weekday - ((date.getDay() || 7) + 3);\r\n return day;\r\n}\r\n/**\r\n * Returns 12-hour representation out of the 24-hour hours.\r\n *\r\n * @param hours 24-hour number\r\n * @return 12-hour number\r\n */\r\nexport function get12Hours(hours, base) {\r\n if (hours > 12) {\r\n hours -= 12;\r\n }\r\n else if (hours === 0) {\r\n hours = 12;\r\n }\r\n return $type.hasValue(base) ? hours + (base - 1) : hours;\r\n}\r\n/**\r\n * Returns a string name of the tome zone.\r\n *\r\n * @param date Date object\r\n * @param long Should return long (\"Pacific Standard Time\") or short abbreviation (\"PST\")\r\n * @param savings Include information if it's in daylight savings mode\r\n * @param utc Assume UTC dates\r\n * @return Time zone name\r\n */\r\nexport function getTimeZone(date, long, savings, utc) {\r\n if (long === void 0) { long = false; }\r\n if (savings === void 0) { savings = false; }\r\n if (utc === void 0) { utc = false; }\r\n if (utc) {\r\n return long ? \"Coordinated Universal Time\" : \"UTC\";\r\n }\r\n var wotz = date.toLocaleString(\"UTC\");\r\n var wtz = date.toLocaleString(\"UTC\", { timeZoneName: long ? \"long\" : \"short\" }).substr(wotz.length);\r\n //wtz = wtz.replace(/[+-]+[0-9]+$/, \"\");\r\n if (savings === false) {\r\n wtz = wtz.replace(/ (standard|daylight|summer|winter) /i, \" \");\r\n }\r\n return wtz;\r\n}\r\n/**\r\n * ============================================================================\r\n * NUMBER-RELATED FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Returns a random number between `from` and `to`.\r\n *\r\n * @param from From number\r\n * @param to To number\r\n * @return Random number\r\n */\r\nexport function random(from, to) {\r\n return Math.floor(Math.random() * (to - from)) + from;\r\n}\r\n/**\r\n * Fits the number into specific `min` and `max` bounds.\r\n *\r\n * @param value Input value\r\n * @param min Minimum value\r\n * @param max Maximum value\r\n * @return Possibly adjusted value\r\n */\r\nexport function fitNumber(value, min, max) {\r\n if (value > max) {\r\n return max;\r\n }\r\n else if (value < min) {\r\n return min;\r\n }\r\n return value;\r\n}\r\n/**\r\n * Fits the number into specific `min` and `max` bounds.\r\n *\r\n * If the value is does not fit withing specified range, it \"wraps\" around the\r\n * values.\r\n *\r\n * For example, if we have input value 10 with min set at 1 and max set at 8,\r\n * the value will not fit. The remainder that does not fit (2) will be added\r\n * to `min`, resulting in 3.\r\n *\r\n * The output of regular `fitNumber()` would return 8 instead.\r\n *\r\n * @param value Input value\r\n * @param min Minimum value\r\n * @param max Maximum value\r\n * @return Possibly adjusted value\r\n */\r\nexport function fitNumberRelative(value, min, max) {\r\n var gap = max - min;\r\n if (value > max) {\r\n value = min + (value - gap * Math.floor(value / gap));\r\n }\r\n else if (value < min) {\r\n value = min + (value - gap * Math.floor(value / gap));\r\n }\r\n return value;\r\n}\r\n/**\r\n * ============================================================================\r\n * SPRITE-RELATED FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Converts SVG element coordinates to coordinates within specific [[Sprite]].\r\n *\r\n * @param point SVG coordinates\r\n * @param sprite Sprite\r\n * @return Sprite coordinates\r\n */\r\nexport function svgPointToSprite(point, sprite) {\r\n var x = point.x;\r\n var y = point.y;\r\n var sprites = [];\r\n if (sprite) {\r\n while ($type.hasValue(sprite.parent)) {\r\n sprites.push(sprite);\r\n sprite = sprite.parent;\r\n }\r\n sprites.reverse();\r\n for (var i = 0; i < sprites.length; i++) {\r\n var sprite_1 = sprites[i];\r\n var angle = sprite_1.rotation;\r\n var relativeX = x - sprite_1.pixelX - sprite_1.ex;\r\n var relativeY = y - sprite_1.pixelY - sprite_1.ey;\r\n if (sprite_1.dx) {\r\n x -= sprite_1.dx;\r\n }\r\n if (sprite_1.dy) {\r\n y -= sprite_1.dy;\r\n }\r\n var scale = sprite_1.scale;\r\n // this handles nonscaling\r\n if (sprite_1.group) {\r\n scale = sprite_1.group.scale;\r\n }\r\n x = ($math.cos(-angle) * relativeX - $math.sin(-angle) * relativeY) / scale - sprite_1.pixelPaddingLeft;\r\n y = ($math.cos(-angle) * relativeY + $math.sin(-angle) * relativeX) / scale - sprite_1.pixelPaddingTop;\r\n }\r\n }\r\n return { x: x, y: y };\r\n}\r\n/**\r\n * Converts coordinates within [[Sprite]] to coordinates relative to the whole\r\n * SVG element.\r\n *\r\n * @param point Sprite coordinates\r\n * @param sprite Sprite\r\n * @return SVG coordinates\r\n */\r\nexport function spritePointToSvg(point, sprite) {\r\n var x = point.x;\r\n var y = point.y;\r\n if (sprite) {\r\n while ($type.hasValue(sprite.parent)) {\r\n var angle = sprite.rotation;\r\n x += sprite.pixelPaddingLeft + sprite.ex;\r\n y += sprite.pixelPaddingTop + sprite.ey;\r\n var scale = sprite.scale;\r\n // this handles nonscaling\r\n if (sprite.group) {\r\n scale = sprite.group.scale;\r\n }\r\n var relativeX = sprite.pixelX + ((x * $math.cos(angle) - y * $math.sin(angle))) * scale;\r\n var relativeY = sprite.pixelY + ((x * $math.sin(angle) + y * $math.cos(angle))) * scale;\r\n if (sprite.dx) {\r\n relativeX += sprite.dx;\r\n }\r\n if (sprite.dy) {\r\n relativeY += sprite.dy;\r\n }\r\n x = relativeX;\r\n y = relativeY;\r\n sprite = sprite.parent;\r\n }\r\n }\r\n return { x: x, y: y };\r\n}\r\n/**\r\n * Converts coordinates of one sprite to another.\r\n *\r\n * @param point Sprite coordinates\r\n * @param sprite Sprite\r\n * @param toSprite Sprite\r\n * @return converted coordinates\r\n */\r\nexport function spritePointToSprite(point, sprite, toSprite) {\r\n return svgPointToSprite(spritePointToSvg(point, sprite), toSprite);\r\n}\r\n/**\r\n * Converts a rectangle expressed in SVG element coordinates to coordinates\r\n * within specific [[Sprite]].\r\n *\r\n * @param rect SVG rectangle\r\n * @param sprite Sprite\r\n * @return Sprite rectangle\r\n */\r\nexport function svgRectToSprite(rect, sprite) {\r\n var p1 = svgPointToSprite(rect, sprite);\r\n var p2 = svgPointToSprite({ x: rect.x + rect.width, y: rect.y + rect.height }, sprite);\r\n return { x: p1.x, y: p1.y, width: p2.x - p1.x, height: p2.y - p1.y };\r\n}\r\n/**\r\n * Converts a rectangle expressed in [[Sprite]] coordinates to SVG coordinates.\r\n *\r\n * @param rect Sprite rectangle\r\n * @param sprite Sprite\r\n * @return SVG rectangle\r\n */\r\nexport function spriteRectToSvg(rect, sprite) {\r\n var p1 = spritePointToSvg(rect, sprite);\r\n var p2 = spritePointToSvg({ x: rect.x + rect.width, y: rect.y + rect.height }, sprite);\r\n return { x: p1.x, y: p1.y, width: p2.x - p1.x, height: p2.y - p1.y };\r\n}\r\n/**\r\n * Converts global document-wide coordinates to coordinates within SVG element.\r\n *\r\n * @param point Global coordinates\r\n * @param svgContainer SVG element\r\n * @return SVG coordinates\r\n */\r\nexport function documentPointToSvg(point, svgContainer, cssScale) {\r\n try {\r\n var bbox = svgContainer.getBoundingClientRect();\r\n if (!$type.isNumber(cssScale)) {\r\n cssScale = 1;\r\n }\r\n return {\r\n \"x\": (point.x - bbox.left) / cssScale,\r\n \"y\": (point.y - bbox.top) / cssScale\r\n };\r\n }\r\n catch (e) {\r\n return point;\r\n }\r\n}\r\n/**\r\n * Converts SVG coordinates to global document-wide coordinates.\r\n *\r\n * @param point SVG coordinates\r\n * @param svgContainer SVG element\r\n * @return Global coordinates\r\n */\r\nexport function svgPointToDocument(point, svgContainer) {\r\n try {\r\n var bbox = svgContainer.getBoundingClientRect();\r\n return {\r\n \"x\": point.x + bbox.left,\r\n \"y\": point.y + bbox.top\r\n };\r\n }\r\n catch (e) {\r\n return point;\r\n }\r\n}\r\n/**\r\n * Converts document-wide global coordinates to coordinates within specific\r\n * [[Sprite]].\r\n *\r\n * @param point Global coordinates\r\n * @param sprite Sprite\r\n * @return Sprite coordinates\r\n */\r\nexport function documentPointToSprite(point, sprite) {\r\n if (sprite && sprite.htmlContainer) {\r\n var svgPoint = documentPointToSvg(point, $type.getValue(sprite.htmlContainer), sprite.svgContainer.cssScale);\r\n return svgPointToSprite(svgPoint, sprite);\r\n }\r\n else {\r\n return point;\r\n }\r\n}\r\n/**\r\n * Converts coordinates within [[Sprite]] to global document coordinates.\r\n *\r\n * @param point Sprite coordinates\r\n * @param sprite Sprite\r\n * @return Global coordinates\r\n */\r\nexport function spritePointToDocument(point, sprite) {\r\n if (sprite && sprite.htmlContainer) {\r\n var svgPoint = spritePointToSvg(point, sprite);\r\n return svgPointToDocument(svgPoint, $type.getValue(sprite.htmlContainer));\r\n }\r\n else {\r\n return point;\r\n }\r\n}\r\n/**\r\n * ============================================================================\r\n * DEPRECATED FUNCTIONS\r\n * @todo Review and remove\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Returns element's width.\r\n *\r\n * @ignore Exclude from docs\r\n * @param element Element\r\n * @return Width (px)\r\n * @deprecated Not used anywhere\r\n */\r\nexport function width(element) {\r\n var cs = getComputedStyle(element);\r\n var paddingX = parseFloat(cs.paddingLeft) + parseFloat(cs.paddingRight);\r\n var borderX = parseFloat(cs.borderLeftWidth) + parseFloat(cs.borderRightWidth);\r\n return element.clientWidth - paddingX - borderX;\r\n}\r\n/**\r\n * Returns element's height.\r\n *\r\n * @ignore Exclude from docs\r\n * @param element Element\r\n * @return Height (px)\r\n * @deprecated Not used anywhere\r\n */\r\nexport function height(element) {\r\n var cs = getComputedStyle(element);\r\n var paddingY = parseFloat(cs.paddingTop) + parseFloat(cs.paddingBottom);\r\n var borderY = parseFloat(cs.borderTopWidth) + parseFloat(cs.borderBottomWidth);\r\n return element.clientHeight - paddingY - borderY;\r\n}\r\n/**\r\n * Returns number of decimals\r\n *\r\n * @ignore Exclude from docs\r\n * @param number Input number\r\n * @return Number of decimals\r\n */\r\nexport function decimalPlaces(number) {\r\n var match = ('' + number).match(/(?:\\.(\\d+))?(?:[eE]([+-]?\\d+))?$/);\r\n if (!match) {\r\n return 0;\r\n }\r\n return Math.max(0, (match[1] ? match[1].length : 0) - (match[2] ? +match[2] : 0));\r\n}\r\nvar urlRegexp = /^([a-zA-Z][a-zA-Z0-9\\+\\.\\-]*:)?(?:(\\/\\/)([^\\@]+\\@)?([^\\/\\?\\#\\:]*)(\\:[0-9]+)?)?([^\\?\\#]*)(\\?[^\\#]*)?(\\#.*)?$/;\r\n/**\r\n * Parses a URL\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n// TODO test this\r\nexport function parseUrl(url) {\r\n var match = urlRegexp.exec(url);\r\n return {\r\n protocol: (match && match[1]) || \"\",\r\n separator: (match && match[2]) || \"\",\r\n authority: (match && match[3]) || \"\",\r\n domain: (match && match[4]) || \"\",\r\n port: (match && match[5]) || \"\",\r\n path: (match && match[6]) || \"\",\r\n query: (match && match[7]) || \"\",\r\n hash: (match && match[8]) || \"\"\r\n };\r\n}\r\n/**\r\n * Serializes a Url into a string\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport function serializeUrl(url) {\r\n return url.protocol + url.separator + url.authority + url.domain + url.port + url.path + url.query + url.hash;\r\n}\r\n/**\r\n * Checks whether a Url is relative or not\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n// TODO is this correct ?\r\nfunction isRelativeUrl(url) {\r\n return url.protocol === \"\" &&\r\n url.separator === \"\" &&\r\n url.authority === \"\" &&\r\n url.domain === \"\" &&\r\n url.port === \"\";\r\n}\r\n/**\r\n * Joins together two URLs, resolving relative URLs correctly\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n// TODO test this\r\nexport function joinUrl(left, right) {\r\n var parsedLeft = parseUrl(left);\r\n var parsedRight = parseUrl(right);\r\n if (isRelativeUrl(parsedLeft)) {\r\n throw new Error(\"Left URL is not absolute\");\r\n }\r\n if (isRelativeUrl(parsedRight)) {\r\n // TODO is this correct ?\r\n if (parsedRight.path !== \"\") {\r\n if (parsedRight.path[0] === \"/\") {\r\n parsedLeft.path = parsedRight.path;\r\n // TODO is this correct ?\r\n }\r\n else {\r\n var leftPath = parsedLeft.path.split(/\\//);\r\n var rightPath = parsedRight.path.split(/\\//);\r\n // TODO is this correct ?\r\n if (leftPath.length === 0) {\r\n if (rightPath.length !== 0) {\r\n leftPath.push(\"\");\r\n }\r\n }\r\n else if (leftPath.length > 1) {\r\n leftPath.pop();\r\n }\r\n $array.pushAll(leftPath, rightPath);\r\n parsedLeft.path = leftPath.join(\"/\");\r\n if (parsedLeft.path !== \"\" && parsedLeft.path[0] !== \"/\") {\r\n throw new Error(\"URL path must start with /\");\r\n }\r\n }\r\n }\r\n // TODO is this correct ?\r\n parsedLeft.query = parsedRight.query;\r\n parsedLeft.hash = parsedRight.hash;\r\n return serializeUrl(parsedLeft);\r\n }\r\n else {\r\n return serializeUrl(parsedRight);\r\n }\r\n}\r\n/**\r\n * Detects MSIE.\r\n *\r\n * @return Is IE?\r\n */\r\nexport function isIE() {\r\n return !!window.MSInputMethodContext && !!document.documentMode;\r\n}\r\n//# sourceMappingURL=Utils.js.map","// Also detects iOS\r\nexport function isSafari() {\r\n return /apple/i.test(navigator.vendor);\r\n}\r\nexport function isInternetExplorer() {\r\n return /MSIE |Trident\\//.test(navigator.userAgent);\r\n}\r\n//# sourceMappingURL=Browser.js.map","/**\r\n * A collection of easing functions\r\n *\r\n * Parts of this collection are taken from D3.js library (https://d3js.org/)\r\n */\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport * as $math from \"../utils/Math\";\r\nimport { registry } from \"../Registry\";\r\n/**\r\n * The functions below are from D3.js library (https://d3js.org/)\r\n *\r\n * ----------------------------------------------------------------------------\r\n * Copyright 2017 Mike Bostock\r\n *\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * 1. Redistributions of source code must retain the above copyright notice,\r\n * this list of conditions and the following disclaimer.\r\n *\r\n * 2. Redistributions in binary form must reproduce the above copyright notice,\r\n * this list of conditions and the following disclaimer in the documentation\r\n * and/or other materials provided with the distribution.\r\n *\r\n * 3. Neither the name of the copyright holder nor the names of its\r\n * contributors may be used to endorse or promote products derived from this\r\n * software without specific prior written permission.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n * ----------------------------------------------------------------------------\r\n * @hidden\r\n */\r\n/**\r\n * ============================================================================\r\n * LINEAR FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Easing function: \"linear\".\r\n */\r\nexport function linear(t) {\r\n return +t;\r\n}\r\nregistry.registeredClasses[\"ease.linear\"] = linear;\r\n/**\r\n * Easing function: \"quadIn\".\r\n */\r\nexport function quadIn(t) {\r\n return t * t;\r\n}\r\nregistry.registeredClasses[\"ease.quadIn\"] = quadIn;\r\n/**\r\n * Easing function: \"quadOut\".\r\n */\r\nexport function quadOut(t) {\r\n return t * (2 - t);\r\n}\r\nregistry.registeredClasses[\"ease.quadOut\"] = quadOut;\r\n/**\r\n * Easing function: \"quadInOut\".\r\n */\r\nexport function quadInOut(t) {\r\n t *= 2;\r\n return (t <= 1 ? t * t : --t * (2 - t) + 1) / 2;\r\n}\r\nregistry.registeredClasses[\"ease.quadInOut\"] = quadInOut;\r\n/**\r\n * Easing function: \"polyIn\".\r\n */\r\nexport function polyIn(t, e) {\r\n return Math.pow(t, e);\r\n}\r\nregistry.registeredClasses[\"ease.polyIn\"] = polyIn;\r\n/**\r\n * Easing function: \"polyOut\".\r\n */\r\nexport function polyOut(t, e) {\r\n return 1 - Math.pow(1 - t, e);\r\n}\r\nregistry.registeredClasses[\"ease.polyOut\"] = polyOut;\r\n/**\r\n * Easing function: \"polyInOut\".\r\n */\r\nexport function polyInOut(t, e) {\r\n t *= 2;\r\n return (t <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2;\r\n}\r\nregistry.registeredClasses[\"ease.polyInOut\"] = polyInOut;\r\n/**\r\n * Easing function: \"polyIn3\".\r\n */\r\nexport function polyIn3(t) {\r\n return polyIn(t, 3);\r\n}\r\nregistry.registeredClasses[\"ease.polyIn3\"] = polyIn3;\r\n/**\r\n * Easing function: \"polyOut3\".\r\n */\r\nexport function polyOut3(t) {\r\n return polyOut(t, 3);\r\n}\r\nregistry.registeredClasses[\"ease.polyOut3\"] = polyOut3;\r\n/**\r\n * Easing function: \"polyInOut3\".\r\n */\r\nexport function polyInOut3(t) {\r\n return polyInOut(t, 3);\r\n}\r\nregistry.registeredClasses[\"ease.polyInOut3\"] = polyInOut3;\r\n/**\r\n * ============================================================================\r\n * EXPONENTIAL FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Easing function: \"expIn\".\r\n */\r\nexport function expIn(t) {\r\n return Math.pow(2, 10 * t - 10);\r\n}\r\nregistry.registeredClasses[\"ease.expIn\"] = expIn;\r\n/**\r\n * Easing function: \"expOut\".\r\n */\r\nexport function expOut(t) {\r\n return 1 - Math.pow(2, -10 * t);\r\n}\r\nregistry.registeredClasses[\"ease.expOut\"] = expOut;\r\n/**\r\n * Easing function: \"expInOut\".\r\n */\r\nexport function expInOut(t) {\r\n t *= 2;\r\n return (t <= 1 ? Math.pow(2, 10 * t - 10) : 2 - Math.pow(2, 10 - 10 * t)) / 2;\r\n}\r\nregistry.registeredClasses[\"ease.expInOut\"] = expInOut;\r\n/**\r\n * ============================================================================\r\n * SINE FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Easing function: \"sinIn\".\r\n */\r\nexport function sinIn(t) {\r\n return 1 - Math.cos(t * $math.HALFPI);\r\n}\r\nregistry.registeredClasses[\"ease.sinIn\"] = sinIn;\r\n/**\r\n * Easing function: \"sinOut\".\r\n */\r\nexport function sinOut(t) {\r\n return Math.sin(t * $math.HALFPI);\r\n}\r\nregistry.registeredClasses[\"ease.sinOut\"] = sinOut;\r\n/**\r\n * Easing function: \"sinInOut\".\r\n */\r\nexport function sinInOut(t) {\r\n return (1 - Math.cos($math.PI * t)) / 2;\r\n}\r\nregistry.registeredClasses[\"ease.sinInOut\"] = sinInOut;\r\n/**\r\n * ============================================================================\r\n * CUBIC FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Easing function: \"cubicIn\".\r\n */\r\nexport function cubicIn(t) {\r\n return t * t * t;\r\n}\r\nregistry.registeredClasses[\"ease.cubicIn\"] = cubicIn;\r\n/**\r\n * Easing function: \"cubicOut\".\r\n */\r\nexport function cubicOut(t) {\r\n return --t * t * t + 1;\r\n}\r\nregistry.registeredClasses[\"ease.cubicOut\"] = cubicOut;\r\n/**\r\n * Easing function: \"cubicInOut\".\r\n */\r\nexport function cubicInOut(t) {\r\n t *= 2;\r\n return (t <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;\r\n}\r\nregistry.registeredClasses[\"ease.cubicInOut\"] = cubicInOut;\r\n/**\r\n * ============================================================================\r\n * CIRCLE FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Easing function: \"circleIn\".\r\n */\r\nexport function circleIn(t) {\r\n return 1 - Math.sqrt(1 - t * t);\r\n}\r\nregistry.registeredClasses[\"ease.circleIn\"] = circleIn;\r\n/**\r\n * Easing function: \"circleOut\".\r\n */\r\nexport function circleOut(t) {\r\n return Math.sqrt(1 - --t * t);\r\n}\r\nregistry.registeredClasses[\"ease.circleOut\"] = circleOut;\r\n/**\r\n * Easing function: \"circleInOut\".\r\n */\r\nexport function circleInOut(t) {\r\n t *= 2;\r\n return (t <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2;\r\n}\r\nregistry.registeredClasses[\"ease.circleInOut\"] = circleInOut;\r\n/**\r\n * ============================================================================\r\n * BOUNCE FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nvar b1 = 4 / 11, b2 = 6 / 11, b3 = 8 / 11, b4 = 3 / 4, b5 = 9 / 11, b6 = 10 / 11, b7 = 15 / 16, b8 = 21 / 22, b9 = 63 / 64, b0 = 1 / b1 / b1;\r\n/**\r\n * Easing function: \"bounceIn\".\r\n */\r\nexport function bounceIn(t) {\r\n return 1 - bounceOut(1 - t);\r\n}\r\nregistry.registeredClasses[\"ease.bounceIn\"] = bounceIn;\r\n/**\r\n * Easing function: \"bounceOut\".\r\n */\r\nexport function bounceOut(t) {\r\n t = +t;\r\n return t < b1 ? b0 * t * t : t < b3 ? b0 * (t -= b2) * t + b4 : t < b6 ? b0 * (t -= b5) * t + b7 : b0 * (t -= b8) * t + b9;\r\n}\r\nregistry.registeredClasses[\"ease.bounceOut\"] = bounceOut;\r\n/**\r\n * Easing function: \"bounceInOut\".\r\n */\r\nexport function bounceInOut(t) {\r\n t *= 2;\r\n return (t <= 1 ? 1 - bounceOut(1 - t) : bounceOut(t - 1) + 1) / 2;\r\n}\r\nregistry.registeredClasses[\"ease.bounceInOut\"] = bounceInOut;\r\n/**\r\n * ============================================================================\r\n * ELASTIC FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nvar tau = 2 * Math.PI;\r\nvar amplitude = 1;\r\nvar period = 0.3 / tau;\r\nvar s = Math.asin(1 / amplitude) * period;\r\n/**\r\n * Easing function: \"elasticIn\".\r\n *\r\n * @function elasticIn\r\n * @param a Amplitude\r\n * @param p period\r\n */\r\nexport function elasticIn(t) {\r\n return amplitude * Math.pow(2, 10 * --t) * Math.sin((s - t) / period);\r\n}\r\nregistry.registeredClasses[\"ease.elasticIn\"] = elasticIn;\r\n/**\r\n * Easing function: \"elasticOut\".\r\n *\r\n * @function elasticOut\r\n * @param a Amplitude\r\n * @param p period\r\n */\r\nexport function elasticOut(t) {\r\n return 1 - amplitude * Math.pow(2, -10 * (t = +t)) * Math.sin((t + s) / period);\r\n}\r\nregistry.registeredClasses[\"ease.elasticOut\"] = elasticOut;\r\n/**\r\n * Easing function: \"elasticInOut\".\r\n *\r\n * @function elasticInOut\r\n * @param a Amplitude\r\n * @param p period\r\n */\r\nexport function elasticInOut(t) {\r\n t = t * 2 - 1;\r\n return (t < 0\r\n ? amplitude * Math.pow(2, 10 * t) * Math.sin((s - t) / period)\r\n : 2 - amplitude * Math.pow(2, -10 * t) * Math.sin((s + t) / period)) / 2;\r\n}\r\nregistry.registeredClasses[\"ease.elasticInOut\"] = elasticInOut;\r\n//# sourceMappingURL=Ease.js.map","/**\r\n * Module contains functionality related to [[Sprite]] states.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"./Base\";\r\nimport { registry } from \"./Registry\";\r\nimport { Adapter } from \"./utils/Adapter\";\r\nimport { List, ListDisposer } from \"./utils/List\";\r\nimport { toColor } from \"./utils/Color\";\r\nimport { percent } from \"./utils/Percent\";\r\nimport * as $utils from \"./utils/Utils\";\r\nimport * as $ease from \"./utils/Ease\";\r\nimport * as $object from \"./utils/Object\";\r\nimport * as $type from \"./utils/Type\";\r\n/**\r\n * Defines a state for [[Sprite]].\r\n *\r\n * A \"state\" is a special object that has all the same properties as the\r\n * [[Sprite]] of the same type, and which can be used to quickly apply a set\r\n * of property values. (set state)\r\n *\r\n * When [[Sprite]] (or any object that extends Sprite) is created it creates a\r\n * \"default\" state. You can modify the \"default\" state so that when the Sprite\r\n * returns to default state certain properties are added.\r\n *\r\n * Default state can be accessed using Sprite's `defaultState` getter.\r\n *\r\n * ```TypeScript\r\n * sprite.defaultState.properties.fillOpacity = 0.5;\r\n * ```\r\n * ```JavaScript\r\n * sprite.defaultState.properties.fillOpacity = 0.5;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"defaultState\": {\r\n * \"properties\": {\r\n * \"fillOpacity\": 0.5\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * If Sprite is \"hoverable\", it automatically adds a \"hover\" state, which is\r\n * applied when it has a cursor over it.\r\n *\r\n * ```TypeScript\r\n * let hoverstate = sprite.states.create(\"hover\");\r\n * hoverstate.properties.fillOpacity = 1;\r\n * ```\r\n * ```JavaScript\r\n * var hoverstate = sprite.states.create(\"hover\");\r\n * hoverstate.properties.fillOpacity = 1;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"states\": {\r\n * \"hover\": {\r\n * \"properties\": {\r\n * \"fillOpacity\": 0.5\r\n * }\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * The above will automatically apply \"hover\" state when the Sprite is hovered,\r\n * thus will set its `fillOpacity` property to 1, and will reset it to 0.5 when\r\n * it's no longer hovered.\r\n *\r\n * Every object that inherits from [[Sprite]] can and will add their own\r\n * properties to the available list.\r\n *\r\n * User can create their own states, and apply them as needed:\r\n *\r\n * ```TypeScript\r\n * let myCustomState = sprite.states.create(\"mystate\");\r\n * myCustomState.properties.fillOpacity = 0.5;\r\n * myCustomState.properties.strokeOpacity = 0.8;\r\n * sprite.setState(\"mystate\");\r\n * ```\r\n * ```JavaScript\r\n * var myCustomState = sprite.states.create(\"mystate\");\r\n * myCustomState.properties.fillOpacity = 0.5;\r\n * myCustomState.properties.strokeOpacity = 0.8;\r\n * sprite.setState(\"mystate\");\r\n * ```\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/states/}\r\n * @important\r\n */\r\nvar SpriteState = /** @class */ (function (_super) {\r\n __extends(SpriteState, _super);\r\n /**\r\n * Constructor\r\n */\r\n function SpriteState() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * Duration of the transition to this state. 0 means instantenous transition.\r\n * Any number means the [[Sprite]] will transit smoothly to this state,\r\n * animating all animatable properties.\r\n *\r\n * @default 0\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n */\r\n _this.transitionDuration = 0;\r\n /**\r\n * Easing function to use when transitioning to this state.\r\n *\r\n * @default cubicOut\r\n * @see {@link Ease}\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n */\r\n _this.transitionEasing = $ease.cubicOut;\r\n /**\r\n * Collection of properties and their values that should be applied to [[Sprite]]\r\n * when switching to this State.\r\n *\r\n * The property values set on a [[SpriteState]] will override the ones set\r\n * directly on a [[Sprite]].\r\n */\r\n _this.properties = {};\r\n /**\r\n * A collection of key/value pairs that can be used to bind specific Sprite\r\n * properties to [[DataItem]].\r\n *\r\n * For example: `fill` property can be bound to `myCustomColor` field in\r\n * DataItem. The Sprite will automatically get the value for `fill` from its\r\n * DataItem.\r\n *\r\n * SpriteState-specific binding will override binding set directly on\r\n * [[Sprite]]. I.e. you can make Sprite use different fill color on hover by\r\n * adding a `fill` binding to a different DataItem key for Sprite's \"hover\"\r\n * state object.\r\n *\r\n * @see {@link Sprite}\r\n */\r\n _this.propertyFields = {};\r\n //public propertyFields: Dictionary = new Dictionary();;\r\n /**\r\n * A list of [[Filter]] elements to be applied to the relative [[Sprite]]\r\n * when switching to this State.\r\n *\r\n * @param {List}\r\n */\r\n _this.filters = new List();\r\n /**\r\n * Identifies if this object is a \"template\" and should not be treated as\r\n * real object that is drawn or actually used in the chart.\r\n */\r\n _this.isTemplate = false;\r\n _this.className = \"SpriteState\";\r\n // Make filter list disposable\r\n _this._disposers.push(new ListDisposer(_this.filters));\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(SpriteState.prototype, \"adapter\", {\r\n /**\r\n * Holds Adapter.\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._adapterO) {\r\n this._adapterO = new Adapter(this);\r\n // Decorate adapter with events so that we can apply its settings whenever\r\n // it is modified\r\n this._adapterO.events.on(\"inserted\", function (ev) {\r\n _this[ev.newValue.key] = _this[ev.newValue.key];\r\n }, undefined, false);\r\n this._adapterO.events.on(\"removed\", function (ev) {\r\n _this[ev.newValue.key] = _this[ev.newValue.key];\r\n }, undefined, false);\r\n }\r\n return this._adapterO;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns [[Sprite]] element's property value.\r\n *\r\n * Will check if there are any bindings with [[DataItem]] and if there are\r\n * any method callbacks set up for the specific property.\r\n *\r\n * @param propertyName Property name\r\n * @return Property value\r\n */\r\n SpriteState.prototype.getPropertyValue = function (propertyName) {\r\n var propValue = this.properties[propertyName];\r\n var sprite = this.sprite;\r\n if (sprite) {\r\n var fieldName = this.propertyFields[propertyName];\r\n if ($type.hasValue(fieldName)) {\r\n if (sprite.dataItem) {\r\n propValue = sprite.dataItem.dataContext[fieldName];\r\n }\r\n if (propValue == undefined) {\r\n propValue = \"__unset\";\r\n }\r\n }\r\n // Apply adapters\r\n // If the value itself is undefined, we're going to pass in Sprite's\r\n // value to adapters\r\n // @todo get rid of \r\n if (!$type.hasValue(propValue)) {\r\n var spriteValue = sprite.getPropertyValue(propertyName);\r\n if (this._adapterO) {\r\n propValue = this._adapterO.apply(propertyName, spriteValue);\r\n }\r\n else {\r\n propValue = spriteValue;\r\n }\r\n if (propValue == spriteValue) {\r\n propValue = undefined;\r\n }\r\n }\r\n else {\r\n if (this._adapterO) {\r\n propValue = this._adapterO.apply(propertyName, propValue);\r\n }\r\n }\r\n /*let method = this.propertyMethods.getKey(propertyName);\r\n if (method) {\r\n propValue = method(sprite, propertyName);\r\n }*/\r\n }\r\n return propValue;\r\n };\r\n /**\r\n * Copies all property and style values from another [[SpriteState]] object.\r\n *\r\n * @param source Source [[SpriteState]]\r\n */\r\n SpriteState.prototype.copyFrom = function (source) {\r\n if (source && source != this) {\r\n this.transitionDuration = source.transitionDuration;\r\n this.transitionEasing = source.transitionEasing;\r\n $utils.copyProperties(source.properties, this.properties);\r\n $utils.copyProperties(source.propertyFields, this.propertyFields);\r\n this.filters.copyFrom(source.filters);\r\n if (source._adapterO) {\r\n this.adapter.copyFrom(source._adapterO);\r\n }\r\n }\r\n };\r\n Object.defineProperty(SpriteState.prototype, \"allValues\", {\r\n /**\r\n * Returns all values that should be applied by the SpriteState.\r\n *\r\n * It takes adapters into account.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Properties\r\n * @todo Add adapter values\r\n * @todo proper type this[\"_properties\"]\r\n */\r\n get: function () {\r\n var _this = this;\r\n // Init return value\r\n var res = {};\r\n // Apply adapters to all values\r\n $object.each(this.properties, function (prop, value) {\r\n res[prop] = _this.getPropertyValue(prop);\r\n });\r\n // Cycle through all adapters and add values for missing properties\r\n if (this._adapterO) {\r\n var keys = this._adapterO.keys();\r\n $object.each(keys, function (_x, prop) {\r\n var value = _this.getPropertyValue(prop);\r\n res[prop] = value;\r\n });\r\n }\r\n // Cycle through all property fileds and add values for missing properties\r\n var propertyFields = this.propertyFields;\r\n $object.each(propertyFields, function (prop) {\r\n var value = _this.getPropertyValue(prop);\r\n res[prop] = value;\r\n });\r\n return res;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Resets the State to initial state - no values or Filters applied.\r\n */\r\n SpriteState.prototype.reset = function () {\r\n this.properties = {};\r\n this.filters.clear();\r\n };\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n SpriteState.prototype.processConfig = function (config) {\r\n if ($type.hasValue(config) && $type.hasValue(config[\"properties\"])) {\r\n $object.each(config[\"properties\"], function (key, value) {\r\n if ($type.isString(value)) {\r\n if (value.match(/^[0-9.\\-]+\\%$/)) {\r\n config[\"properties\"][key] = percent($type.toNumber(value));\r\n }\r\n else if (value.match(/^\\#[0-9abcdef]{3,}$/i)) {\r\n config[\"properties\"][key] = toColor(value);\r\n }\r\n }\r\n });\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n /**\r\n * Adds easing functions to \"function\" fields.\r\n *\r\n * @param field Field name\r\n * @return Assign as function?\r\n */\r\n SpriteState.prototype.asFunction = function (field) {\r\n return field == \"transitionEasing\" || _super.prototype.asIs.call(this, field);\r\n };\r\n return SpriteState;\r\n}(BaseObject));\r\nexport { SpriteState };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"SpriteState\"] = SpriteState;\r\n//# sourceMappingURL=SpriteState.js.map","import { __extends } from \"tslib\";\r\nimport { Dictionary } from \"./utils/Dictionary\";\r\nimport { TargetedEventDispatcher } from \"./utils/EventDispatcher\";\r\nimport { MultiDisposer, CounterDisposer } from \"./utils/Disposer\";\r\nimport * as $utils from \"./utils/Utils\";\r\nimport * as $object from \"./utils/Object\";\r\n/**\r\n * An [[EventDispatcher]] for [[Sprite]].\r\n *\r\n * @important\r\n */\r\nvar SpriteEventDispatcher = /** @class */ (function (_super) {\r\n __extends(SpriteEventDispatcher, _super);\r\n function SpriteEventDispatcher() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n /**\r\n * [_interactionEvents description]\r\n *\r\n * @todo Description\r\n */\r\n _this._interactionEvents = new Dictionary();\r\n return _this;\r\n }\r\n /**\r\n * [_dispatchSpriteEvent description]\r\n *\r\n * @todo Description\r\n */\r\n SpriteEventDispatcher.prototype._dispatchSpriteEvent = function (ev) {\r\n if (this.target.disabled || this.target.isTemplate) {\r\n return;\r\n }\r\n // TODO remove this later\r\n if (this.target.events.isEnabled(ev.type)) {\r\n var imev = $object.merge(ev, {\r\n target: this.target\r\n });\r\n this.target.events.dispatchImmediately(imev.type, imev);\r\n }\r\n };\r\n /**\r\n * [_dispatchSpritePointEvent description]\r\n *\r\n * @todo Description\r\n */\r\n SpriteEventDispatcher.prototype._dispatchSpritePointEvent = function (ev) {\r\n if (this.target.disabled || this.target.isTemplate) {\r\n return;\r\n }\r\n // TODO remove this later\r\n if (this.target.events.isEnabled(ev.type)) {\r\n var imev = $object.merge(ev, {\r\n target: this.target,\r\n spritePoint: ev.point ? $utils.documentPointToSprite(ev.point, this.target) : undefined,\r\n svgPoint: this.target.getSvgPoint(ev.point)\r\n });\r\n this.target.events.dispatchImmediately(imev.type, imev);\r\n }\r\n };\r\n /**\r\n * [_addInteractionObjectEvent description]\r\n *\r\n * @todo Description\r\n */\r\n SpriteEventDispatcher.prototype._addInteractionObjectEvent = function (type, callback, context, shouldClone) {\r\n var _this = this;\r\n var key = shouldClone + \"-\" + type;\r\n var counter = this._interactionEvents.insertKeyIfEmpty(key, function () {\r\n var disposer = _this.target.interactions.events.on(type, callback, context, shouldClone);\r\n return new CounterDisposer(function () {\r\n _this._interactionEvents.removeKey(key);\r\n disposer.dispose();\r\n });\r\n });\r\n return counter.increment();\r\n };\r\n /**\r\n * [_on description]\r\n *\r\n * @todo Description\r\n */\r\n SpriteEventDispatcher.prototype._on = function (once, type, callback, context, shouldClone, dispatch) {\r\n var info = _super.prototype._on.call(this, once, type, callback, context, shouldClone, dispatch);\r\n var disposers = [info.disposer];\r\n /**\r\n * Catching Sprite-related events, converting them to [[SpriteEvent]] and\r\n * triggering them on sprite\r\n */\r\n switch (type) {\r\n case \"hit\":\r\n case \"track\":\r\n case \"doublehit\":\r\n case \"wheel\":\r\n case \"wheelup\":\r\n case \"wheeldown\":\r\n case \"wheelleft\":\r\n case \"wheelright\":\r\n disposers.push(this._addInteractionObjectEvent(type, this._dispatchSpritePointEvent, this, shouldClone));\r\n break;\r\n case \"rightclick\":\r\n case \"down\":\r\n //case \"hold\":\r\n case \"up\":\r\n case \"drag\":\r\n case \"dragged\":\r\n case \"dragstart\":\r\n case \"dragstop\":\r\n case \"over\":\r\n case \"out\":\r\n case \"swipe\":\r\n case \"swipeleft\":\r\n case \"swiperight\":\r\n case \"resize\":\r\n //case \"rotate\":\r\n case \"focus\":\r\n case \"blur\":\r\n case \"toggled\":\r\n disposers.push(this._addInteractionObjectEvent(type, this._dispatchSpriteEvent, this, shouldClone));\r\n break;\r\n }\r\n /**\r\n * Set functional properties based on events. For example if we add a\r\n * \"drag\" event handler, we want to make the Sprite draggable, even if we\r\n * don't explicitly set \"draggable\"\r\n */\r\n switch (type) {\r\n case \"hit\":\r\n case \"doublehit\":\r\n case \"rightclick\":\r\n case \"down\":\r\n case \"up\":\r\n this.target.clickable = true;\r\n break;\r\n case \"toggled\":\r\n this.target.togglable = true;\r\n break;\r\n case \"drag\":\r\n case \"dragstart\":\r\n case \"dragstop\":\r\n this.target.draggable = true;\r\n break;\r\n case \"track\":\r\n this.target.trackable = true;\r\n break;\r\n case \"resize\":\r\n this.target.resizable = true;\r\n break;\r\n case \"swipe\":\r\n case \"swipeleft\":\r\n case \"swiperight\":\r\n this.target.swipeable = true;\r\n break;\r\n case \"wheel\":\r\n case \"wheelup\":\r\n case \"wheeldown\":\r\n case \"wheelleft\":\r\n case \"wheelright\":\r\n this.target.wheelable = true;\r\n break;\r\n case \"over\":\r\n this.target.hoverable = true;\r\n case \"out\":\r\n this.target.hoverable = true;\r\n break;\r\n case \"focus\":\r\n case \"blur\":\r\n this.target.focusable = true;\r\n break;\r\n }\r\n info.disposer = new MultiDisposer(disposers);\r\n return info;\r\n };\r\n return SpriteEventDispatcher;\r\n}(TargetedEventDispatcher));\r\nexport { SpriteEventDispatcher };\r\n//# sourceMappingURL=SpriteEvents.js.map","/**\r\n */\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { color } from \"../utils/Color\";\r\n/**\r\n * Defines a class that holds default properties for new SVG elements\r\n */\r\nvar SVGDefaults = /** @class */ (function () {\r\n function SVGDefaults() {\r\n }\r\n SVGDefaults.opacity = 1;\r\n SVGDefaults.strokeOpacity = 1;\r\n SVGDefaults.strokeWidth = 1;\r\n SVGDefaults.fillOpacity = 1;\r\n SVGDefaults.fill = color(\"#000000\");\r\n SVGDefaults.stroke = color(\"#000000\");\r\n SVGDefaults.focusable = undefined;\r\n SVGDefaults.tabindex = 0;\r\n return SVGDefaults;\r\n}());\r\nexport { SVGDefaults };\r\n//# sourceMappingURL=SVGDefaults.js.map","/**\r\n * Global options.\r\n */\r\nexport var options = {\r\n verbose: true,\r\n commercialLicense: false,\r\n classNamePrefix: \"amcharts-\",\r\n autoSetClassName: false,\r\n minPolylineStep: 0.5,\r\n onlyShowOnViewport: false,\r\n queue: false,\r\n autoDispose: false,\r\n licenses: [],\r\n suppressErrors: false,\r\n suppressWarnings: false,\r\n animationsEnabled: true,\r\n nonce: \"\",\r\n deferredDelay: 100,\r\n disableHoverOnTransform: \"never\",\r\n pixelPerfectPrecision: 0\r\n};\r\n//# sourceMappingURL=Options.js.map","/**\r\n * Animation module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObjectEvents } from \"../Base\";\r\nimport { SVGDefaults } from \"../defs/SVGDefaults\";\r\nimport { Disposer } from \"../utils/Disposer\";\r\nimport { Color } from \"../utils/Color\";\r\nimport { Percent, percent } from \"../utils/Percent\";\r\nimport * as $async from \"../utils/AsyncPending\";\r\nimport * as $ease from \"../utils/Ease\";\r\nimport * as $colors from \"../utils/Colors\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $array from \"../utils/Array\";\r\nimport * as $type from \"../utils/Type\";\r\nimport { system } from \"../System\";\r\nimport { options } from \"../Options\";\r\n/**\r\n * Calls a `callback` function for the `duration` of milliseconds.\r\n *\r\n * @todo Needed?\r\n * @deprecated Not used anywhere\r\n * @ignore Exclude from docs\r\n * @param duration Duration (ms)\r\n * @param callback Callback function\r\n * @return Disposer\r\n */\r\nexport function animate(duration, callback) {\r\n var disposed = false;\r\n // TODO use performance.now() ?\r\n var startTime = Date.now();\r\n function loop(now) {\r\n if (!disposed) {\r\n var diff = now - startTime;\r\n if (diff >= duration) {\r\n callback(1);\r\n }\r\n else {\r\n $async.nextFrame(loop);\r\n callback(diff / duration);\r\n }\r\n }\r\n }\r\n $async.nextFrame(loop);\r\n return new Disposer(function () {\r\n disposed = true;\r\n });\r\n}\r\n/**\r\n * Returns numeric value accoring to progress between start and end values.\r\n *\r\n * @param progress Progress (0-1)\r\n * @param from\r\n * @param to\r\n * @return Value according to progress\r\n */\r\nfunction getProgressNumber(progress, from, to) {\r\n return from + ((to - from) * progress);\r\n}\r\n/**\r\n * Returns [[Percent]] value accoring to progress between start and end\r\n * values.\r\n *\r\n * @param progress Progress (0-1)\r\n * @param from\r\n * @param to\r\n * @return Value according to progress\r\n */\r\nfunction getProgressPercent(progress, from, to) {\r\n return new Percent(getProgressNumber(progress, from.percent, to.percent));\r\n}\r\n/**\r\n * Returns color value accoring to progress between start and end values.\r\n *\r\n * @param progress Progress (0-1)\r\n * @param from\r\n * @param to\r\n * @return Color according to progress\r\n */\r\nfunction getProgressColor(progress, from, to) {\r\n var color = new Color($colors.interpolate(from.rgb, to.rgb, progress));\r\n if (from.alpha != to.alpha) {\r\n color.alpha = from.alpha + (to.alpha - from.alpha) * progress;\r\n }\r\n return color;\r\n}\r\n/**\r\n * [getHybridProperty description]\r\n *\r\n * @todo Description\r\n * @param property [description]\r\n * @param type [description]\r\n * @return [description]\r\n */\r\nfunction getHybridProperty(property, type) {\r\n return type + property.charAt(0).toUpperCase() + property.substr(1);\r\n}\r\nvar AnimationDisposer = /** @class */ (function () {\r\n function AnimationDisposer(array) {\r\n this._disposer = new Disposer(function () {\r\n while (array.length !== 0) {\r\n array[0].dispose();\r\n }\r\n });\r\n }\r\n AnimationDisposer.prototype.isDisposed = function () {\r\n return this._disposer.isDisposed();\r\n };\r\n AnimationDisposer.prototype.dispose = function () {\r\n this._disposer.dispose();\r\n };\r\n return AnimationDisposer;\r\n}());\r\nexport { AnimationDisposer };\r\n/**\r\n * Animation can be used to transition certain properties on an object that\r\n * implements [[IAnimatable]] interface.\r\n *\r\n * @see {@link IAnimationEvents} for a list of available events\r\n */\r\nvar Animation = /** @class */ (function (_super) {\r\n __extends(Animation, _super);\r\n /**\r\n * Constructor\r\n *\r\n * @param object An object animation should run on\r\n * @param animationOptions One or several (array) of animation options\r\n * @param duration Duration (ms)\r\n * @param easing Easing function\r\n */\r\n function Animation(object, animationOptions, duration, easing) {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * Duration of the animation in milliseconds.\r\n */\r\n _this.duration = 0;\r\n /**\r\n * Easing function to use.\r\n *\r\n * @see {@link Ease}\r\n */\r\n _this.easing = $ease.linear;\r\n /**\r\n * Contains progress of the current animation: 0 (start) to 1 (end).\r\n */\r\n _this.progress = 0;\r\n /**\r\n * Indicated how many times animation should loop.\r\n */\r\n _this._loop = 0;\r\n /**\r\n * Animation is paused.\r\n */\r\n _this._pause = false;\r\n /**\r\n * Holds reference to timeout for delayed play.\r\n */\r\n _this._delayTimeout = null;\r\n /**\r\n * Elapsed time in currently playing animation.\r\n */\r\n _this._time = 0;\r\n _this._isFinished = false;\r\n _this.className = \"Animation\";\r\n // Override duration if animations disabled system-wide\r\n if (options.animationsEnabled === false) {\r\n duration = 0;\r\n }\r\n // Set parameters\r\n _this.object = object;\r\n _this.animationOptions = $array.toArray(animationOptions);\r\n _this.duration = duration;\r\n if (easing) {\r\n _this.easing = easing;\r\n }\r\n // Run check if there are already animations playing on the same properties\r\n // and stop them - the last animation takes precedence\r\n //this.stopSameAnimations();\r\n /*if ($type.hasValue(callback)) {\r\n // TODO don't use .call\r\n this.events.on(\"animationended\", callback, object);\r\n }*/\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n // TODO verify that this is correct\r\n Animation.prototype.debug = function () { };\r\n /**\r\n * Disposes this object, clears up after itself.\r\n */\r\n Animation.prototype.dispose = function () {\r\n _super.prototype.dispose.call(this);\r\n this.pause();\r\n };\r\n /**\r\n * Delays animation start by X milliseconds.\r\n *\r\n * @param delay Delay (ms)\r\n * @return Animation\r\n */\r\n Animation.prototype.delay = function (delay) {\r\n var _this = this;\r\n //@todo Maybe not use `bind()`\r\n if (delay > 0) {\r\n this.pause();\r\n // This is so that it will get disposed if `this.object` is disposed\r\n // TODO hacky, figure out a better way\r\n $array.move(this.object.animations, this);\r\n var id_1 = setTimeout(function () {\r\n _this._delayTimeout = null;\r\n _this.start();\r\n }, delay);\r\n this._delayTimeout = new Disposer(function () {\r\n clearTimeout(id_1);\r\n });\r\n }\r\n return this;\r\n };\r\n Animation.prototype._start = function () {\r\n this._isFinished = false;\r\n // Clear delay timeout if there was one\r\n if (this._delayTimeout) {\r\n this.removeDispose(this._delayTimeout);\r\n this._delayTimeout = null;\r\n }\r\n // Run check if there are already animations playing on the same properties\r\n // and stop them - the last animation takes precedence\r\n this.stopSameAnimations();\r\n // Reset counters\r\n this._pause = false;\r\n // Register animation\r\n $array.move(system.animations, this);\r\n // Register this animation in object's `animations` list\r\n $array.move(this.object.animations, this);\r\n system.requestFrame();\r\n };\r\n /**\r\n * Starts animation.\r\n *\r\n * @return Animation\r\n */\r\n Animation.prototype.start = function () {\r\n this._start();\r\n this._startTime = Date.now();\r\n this._time = 0;\r\n this.staticOptions = [];\r\n // Process initial property values\r\n for (var i = this.animationOptions.length - 1; i >= 0; i--) {\r\n var options_1 = this.animationOptions[i];\r\n if (!$type.hasValue(options_1.from)) {\r\n if (options_1.childObject) {\r\n options_1.from = options_1.childObject[options_1.property];\r\n }\r\n else {\r\n options_1.from = this.object[options_1.property];\r\n if (!$type.hasValue(options_1.from)) {\r\n options_1.from = SVGDefaults[options_1.property];\r\n }\r\n }\r\n /*if (!$type.hasValue(options.from)) {\r\n throw Error(\"Could not get initial transition value.\");\r\n }*/\r\n }\r\n if (options_1.from == options_1.to) { // || options.to == (this.object)[options.property]){ this is not good, as dataItem.value is set to final at once, and we animate workingValue\r\n $array.remove(this.animationOptions, options_1);\r\n }\r\n else if (!$type.hasValue(options_1.from) || (!(options_1.from instanceof Percent) && (options_1.to instanceof Percent)) || ((options_1.from instanceof Percent) && !(options_1.to instanceof Percent))) {\r\n // Initial value is undefined, treat it as static\r\n this.staticOptions.push(options_1);\r\n $array.remove(this.animationOptions, options_1);\r\n }\r\n else {\r\n // Use different update methods for different value types\r\n if ($type.isNumber(options_1.to)) {\r\n // Numeric value\r\n options_1.updateMethod = getProgressNumber;\r\n // Check if initial value is not Percent\r\n if (options_1.from instanceof Percent) {\r\n // It is. Let's convert it to pixel value\r\n // @todo Check if we can do this in a less hacky way\r\n var convertedFrom = this.object[getHybridProperty(options_1.property, \"pixel\")];\r\n if (!isNaN(convertedFrom)) {\r\n options_1.from = convertedFrom;\r\n }\r\n else {\r\n this.staticOptions.push(options_1);\r\n $array.remove(this.animationOptions, options_1);\r\n }\r\n }\r\n else if (isNaN(options_1.from)) {\r\n // Static value\r\n this.staticOptions.push(options_1);\r\n $array.remove(this.animationOptions, options_1);\r\n }\r\n }\r\n else {\r\n // Check if maybe we have a color or percent value\r\n if (options_1.to instanceof Color) {\r\n // Yup - set resolved named color\r\n //options.from = $colors.stringToColor(options.from);\r\n if (options_1.from) {\r\n options_1.updateMethod = getProgressColor;\r\n }\r\n else {\r\n // Static value\r\n this.staticOptions.push(options_1);\r\n $array.remove(this.animationOptions, options_1);\r\n }\r\n }\r\n else if (options_1.to instanceof Percent) {\r\n // Percent\r\n options_1.updateMethod = getProgressPercent;\r\n // Check if the initial value is maybe in pixels\r\n if (!isNaN(options_1.from)) {\r\n // It is. Let's convert it\r\n // @todo Check if we can do this in a less hacky way\r\n var convertedFrom = this.object[getHybridProperty(options_1.property, \"relative\")];\r\n if (!isNaN(convertedFrom)) {\r\n options_1.from = percent(convertedFrom * 100);\r\n }\r\n }\r\n }\r\n else {\r\n // Static value\r\n this.staticOptions.push(options_1);\r\n $array.remove(this.animationOptions, options_1);\r\n }\r\n }\r\n }\r\n }\r\n // Apply static options (just in case they were reset by previous\r\n // animation loop)\r\n this.applyStaticOptions();\r\n if (this.events.isEnabled(\"animationstarted\")) {\r\n var event_1 = {\r\n type: \"animationstarted\",\r\n target: this,\r\n progress: this.progress\r\n };\r\n this.events.dispatchImmediately(\"animationstarted\", event_1);\r\n }\r\n this.update();\r\n // If duration is 0, just end animation\r\n if (this.duration === 0) {\r\n this.end();\r\n }\r\n return this;\r\n };\r\n /**\r\n * Sets loop count for the animation. If parameter is not a valid number the\r\n * animation will keep on looping indefinitely.\r\n *\r\n * @param count Number of times to loop animation\r\n * @return Animation\r\n */\r\n Animation.prototype.loop = function (count) {\r\n if (!$type.isNumber(count)) {\r\n count = Infinity;\r\n }\r\n this._loop = count;\r\n return this;\r\n };\r\n /**\r\n * Pauses animation.\r\n *\r\n * @return Animation\r\n */\r\n Animation.prototype.pause = function () {\r\n this._pause = true;\r\n if (this._delayTimeout) {\r\n this.removeDispose(this._delayTimeout);\r\n this._delayTimeout = null;\r\n }\r\n $array.remove(system.animations, this);\r\n $array.remove(this.object.animations, this);\r\n return this;\r\n };\r\n /**\r\n * Resumes paused animation.\r\n *\r\n * @return Animation\r\n */\r\n Animation.prototype.resume = function () {\r\n this._start();\r\n this._startTime = Date.now() - this._time;\r\n return this;\r\n };\r\n /**\r\n * Jumps to animation end. If animation is set to loop, this will start\r\n * another round of animation from start.\r\n *\r\n * @return Animation\r\n */\r\n Animation.prototype.end = function () {\r\n // Pause and complete the progress\r\n if (this._loop == 0) {\r\n this.pause();\r\n }\r\n this.setProgress(1);\r\n // Apply static options\r\n this.applyStaticOptions();\r\n if (this.events.isEnabled(\"animationended\")) {\r\n var event_2 = {\r\n type: \"animationended\",\r\n target: this,\r\n progress: this.progress\r\n };\r\n this.events.dispatchImmediately(\"animationended\", event_2);\r\n }\r\n // Check if we should loop\r\n if (this._loop > 0) {\r\n this._loop--;\r\n this.start();\r\n }\r\n else {\r\n this.stop();\r\n this._isFinished = true;\r\n }\r\n return this;\r\n };\r\n /**\r\n * Stops animation immediately leaving properties in their current values.\r\n */\r\n Animation.prototype.kill = function () {\r\n this.pause();\r\n this._isFinished = true;\r\n };\r\n /**\r\n * Returns indicator if this animation is finished or not\r\n *\r\n * @return Is finished?\r\n */\r\n Animation.prototype.isFinished = function () {\r\n return this._isFinished;\r\n };\r\n /**\r\n * Applies static options that can't be animated.\r\n */\r\n Animation.prototype.applyStaticOptions = function () {\r\n var _this = this;\r\n $array.each(this.staticOptions, function (options) {\r\n if (options.childObject) {\r\n options.childObject[options.property] = _this.progress == 1 ? options.to : options.from;\r\n }\r\n else {\r\n _this.object[options.property] = _this.progress == 1 ? options.to : options.from;\r\n }\r\n });\r\n };\r\n /**\r\n * Stops animation.\r\n *\r\n * When animation is stopped, the properties of the target object will remain\r\n * where they were at the moment when `stop()` was called.\r\n *\r\n * @param skipEvent Do not trigger `animationstopped` event\r\n * @return Animation\r\n */\r\n Animation.prototype.stop = function (skipEvent) {\r\n this.pause();\r\n if (!skipEvent) {\r\n if (this.events.isEnabled(\"animationstopped\")) {\r\n var event_3 = {\r\n type: \"animationstopped\",\r\n target: this,\r\n progress: this.progress\r\n };\r\n this.events.dispatchImmediately(\"animationstopped\", event_3);\r\n }\r\n }\r\n return this;\r\n };\r\n /**\r\n * Sets current progress and updates object's numeric and color values.\r\n *\r\n * @param progress Progress (0-1)\r\n */\r\n Animation.prototype.setProgress = function (progress) {\r\n var _this = this;\r\n this._time = this.duration * progress; // just in case we call this from outside\r\n $array.each(this.animationOptions, function (options) {\r\n if (options.updateMethod && $type.hasValue(options.from)) {\r\n var value = options.updateMethod(progress, options.from, options.to);\r\n if (options.childObject) {\r\n options.childObject[options.property] = value;\r\n }\r\n else {\r\n _this.object[options.property] = value;\r\n }\r\n }\r\n });\r\n this.progress = progress;\r\n if (this.events.isEnabled(\"animationprogress\")) {\r\n var event_4 = {\r\n type: \"animationprogress\",\r\n target: this,\r\n progress: this.progress\r\n };\r\n this.events.dispatchImmediately(\"animationprogress\", event_4);\r\n }\r\n system.requestFrame();\r\n };\r\n /**\r\n * Tracks and sets progress according to time or frames.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Animation\r\n */\r\n Animation.prototype.update = function () {\r\n if (!this._pause) {\r\n var progress = void 0;\r\n this._time = $math.fitToRange(Date.now() - this._startTime, 0, this.duration);\r\n var timeProgress = this._time / this.duration;\r\n progress = this.easing(timeProgress);\r\n if (this.duration == 0 || !$type.isNumber(progress) || timeProgress >= 1) {\r\n progress = 1;\r\n }\r\n this.setProgress(progress);\r\n if ($math.round(this._time / this.duration, 6) == 1) {\r\n this.end();\r\n }\r\n }\r\n return this;\r\n };\r\n Object.defineProperty(Animation.prototype, \"delayed\", {\r\n /**\r\n * Returns `true` if this animation is delayed.\r\n *\r\n * @readonly\r\n * @return [description]\r\n */\r\n get: function () {\r\n return this._delayTimeout ? true : false;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Checks other animations currently running on the same object and removes\r\n * overlapping options from those other animations that are contained in\r\n * this animation.\r\n *\r\n * This is needed to ensure that no two confurent animations step on each\r\n * other's toes by trying to animate the same property.\r\n */\r\n Animation.prototype.stopSameAnimations = function () {\r\n var _this = this;\r\n // stop animation of the same property\r\n // TODO make this more efficient\r\n // TODO don't copy the array\r\n $array.each($array.copy(this.object.animations), function (animation) {\r\n if (animation !== _this && !animation.delayed) {\r\n var killed_1 = [];\r\n $array.each(_this.animationOptions, function (newOptions) {\r\n $array.each(animation.animationOptions, function (oldOptions) {\r\n if (newOptions.property == oldOptions.property && newOptions.childObject == oldOptions.childObject) {\r\n killed_1.push(oldOptions);\r\n if (animation.animationOptions.length == 0) {\r\n animation.kill();\r\n }\r\n }\r\n });\r\n });\r\n $array.each(killed_1, function (oldOptions) {\r\n $array.remove(animation.animationOptions, oldOptions);\r\n });\r\n }\r\n });\r\n };\r\n /**\r\n * Adds easing functions to \"function\" fields.\r\n *\r\n * @param field Field name\r\n * @return Assign as function?\r\n */\r\n Animation.prototype.asFunction = function (field) {\r\n return field == \"easing\" || _super.prototype.asIs.call(this, field);\r\n };\r\n return Animation;\r\n}(BaseObjectEvents));\r\nexport { Animation };\r\n//# sourceMappingURL=Animation.js.map","/**\r\n * A collection of DOM-related functions.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Disposer } from \"./Disposer\";\r\nimport { readFrame, writeFrame } from \"./AsyncPending\";\r\nimport { options } from \"../Options\";\r\nimport * as $object from \"./Object\";\r\nimport * as $array from \"./Array\";\r\nimport * as $type from \"./Type\";\r\n/**\r\n * SVG namespace.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport var SVGNS = \"http://www.w3.org/2000/svg\";\r\n/**\r\n * XML namespace.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport var XMLNS = \"http://www.w3.org/2000/xmlns/\";\r\n/**\r\n * XLINK namespace.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport var XLINK = \"http://www.w3.org/1999/xlink\";\r\n/**\r\n * Function that adds a disposable event listener directly to a DOM element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param dom A DOM element to add event to\r\n * @param type Event type\r\n * @param listener Event listener\r\n * @returns Disposable event\r\n */\r\nexport function addEventListener(dom, type, listener, options) {\r\n //@todo proper type check for options: EventListenerOptions | boolean (TS for some reason gives error on passive parameter)\r\n //console.log(type, dom);\r\n dom.addEventListener(type, listener, options || false);\r\n return new Disposer(function () {\r\n dom.removeEventListener(type, listener, options || false);\r\n });\r\n}\r\n/**\r\n * Finds and returns an element reference using following logic:\r\n * * If we pass in an element instance, we just return it back.\r\n * * If we pass in a string, the function looks for an element with such id.\r\n * * If no element with such id is found, we grab the first element with a tag name like this.\r\n *\r\n * @ignore Exclude from docs\r\n * @param el Element definition (reference, or id, or tag name)\r\n * @return Element reference\r\n * @todo Review this function as it seems pretty fuzzy and hacky\r\n */\r\nexport function getElement(el) {\r\n if ($type.isString(el)) {\r\n var e = document.getElementById(el);\r\n if (e == null) {\r\n e = document.getElementsByClassName(el)[0];\r\n }\r\n if (e instanceof HTMLElement) {\r\n return e;\r\n }\r\n }\r\n else if (el instanceof HTMLElement) {\r\n return el;\r\n }\r\n}\r\n/**\r\n * Adds a class name to an HTML or SVG element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param element Element\r\n * @param className Class name to add\r\n */\r\nexport function addClass(element, className) {\r\n if (!element) {\r\n return;\r\n }\r\n if (element.classList) {\r\n var classes = className.split(\" \");\r\n $array.each(classes, function (name) {\r\n element.classList.add(name);\r\n });\r\n }\r\n else {\r\n var currentClassName = element.getAttribute(\"class\");\r\n if (currentClassName) {\r\n element.setAttribute(\"class\", currentClassName.split(\" \").filter(function (item) {\r\n return item !== className;\r\n }).join(\" \") + \" \" + className);\r\n }\r\n else {\r\n element.setAttribute(\"class\", className);\r\n }\r\n //element.className = element.className.replace(new RegExp(\"^\" + className + \"| \" + className), \"\") + \" \" + className;\r\n }\r\n}\r\n/**\r\n * Removes a class name from an HTML or SVG element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param element Element\r\n * @param className Class name to add\r\n */\r\nexport function removeClass(element, className) {\r\n if (!element) {\r\n return;\r\n }\r\n if (element.classList) {\r\n element.classList.remove(className);\r\n }\r\n else {\r\n var currentClassName = element.getAttribute(\"class\");\r\n if (currentClassName) {\r\n element.setAttribute(\"class\", currentClassName.split(\" \").filter(function (item) {\r\n return item !== className;\r\n }).join(\" \"));\r\n }\r\n //element.className = element.className.replace(new RegExp(\"^\" + className + \"| \" + className), \"\");\r\n }\r\n}\r\n/**\r\n * Sets style property on DOM element.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Still needed?\r\n */\r\nexport function setStyle(element, property, value) {\r\n element.style[property] = value;\r\n}\r\n/**\r\n * Gets the computed style value for an element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport function getComputedStyle(element, property) {\r\n if (element.currentStyle) {\r\n return element.currentStyle[property];\r\n }\r\n return document.defaultView.getComputedStyle(element, null).getPropertyValue(property);\r\n}\r\n/**\r\n * Removes focus from any element by shifting focus to body.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport function blur() {\r\n if (document.activeElement && document.activeElement != document.body) {\r\n if (document.activeElement.blur) {\r\n document.activeElement.blur();\r\n }\r\n else {\r\n var input = document.createElement(\"button\");\r\n input.style.position = \"fixed\";\r\n input.style.top = \"0px\";\r\n input.style.left = \"-10000px\";\r\n document.body.appendChild(input);\r\n input.focus();\r\n input.blur();\r\n document.body.removeChild(input);\r\n }\r\n }\r\n}\r\n/**\r\n * Tries to focus the element.\r\n *\r\n * @ignore Exlude from docs\r\n * @param element Element to focus\r\n */\r\nexport function focus(element) {\r\n if (element instanceof HTMLElement) {\r\n element.focus();\r\n }\r\n else {\r\n var input = document.createElement(\"input\");\r\n var fo = document.createElementNS(SVGNS, \"foreignObject\");\r\n fo.appendChild(input);\r\n element.appendChild(fo);\r\n input.focus();\r\n input.disabled = true;\r\n fo.remove();\r\n }\r\n /*if ((element).focus != undefined) {\r\n (element).focus();\r\n }\r\n else if (element instanceof SVGSVGElement) {\r\n // Not implemented\r\n // @todo implement focus fallback\r\n }*/\r\n}\r\n/**\r\n * Returns markup for the element including the element tag itself.\r\n * SVG elements do not support `outerHTML` so this functions applies of\r\n * a workaround which creates a new temporary wrapper, clones element and uses\r\n * wrapper's `innerHTML`.\r\n *\r\n * @ignore Exclude from docs\r\n * @param element Element to get full markup for\r\n * @return Markup\r\n * @deprecated Not in use anywhere\r\n */\r\nexport function outerHTML(element) {\r\n if (element.outerHTML) {\r\n return element.outerHTML;\r\n }\r\n else {\r\n var twrap = document.createElement(\"div\");\r\n var tnode = element.cloneNode(true);\r\n twrap.appendChild(tnode);\r\n var content = twrap.innerHTML;\r\n return content;\r\n }\r\n}\r\n/**\r\n * Checks if element is a valid DOM node.\r\n *\r\n * @ignore Exclude from docs\r\n * @param el Element\r\n * @return `true` if element is a valid DOM node\r\n */\r\nexport function isElement(el) {\r\n return el instanceof Object && el && el.nodeType === 1;\r\n}\r\n/**\r\n * Checks of element `a` contains element `b`.\r\n *\r\n * @param a Aleged ascendant\r\n * @param b Aleged descendant\r\n * @return Contains?\r\n */\r\nexport function contains(a, b) {\r\n var cursor = b;\r\n while (true) {\r\n if (a === cursor) {\r\n return true;\r\n }\r\n else if (cursor.parentNode == null) {\r\n // TODO better ShadowRoot detection\r\n if (cursor.host == null) {\r\n return false;\r\n }\r\n else {\r\n cursor = cursor.host;\r\n }\r\n }\r\n else {\r\n cursor = cursor.parentNode;\r\n }\r\n }\r\n}\r\n/**\r\n * Returns the shadow root of the element or null\r\n *\r\n * @param a Node\r\n * @return Root\r\n */\r\nexport function getShadowRoot(a) {\r\n var cursor = a;\r\n while (true) {\r\n if (cursor.parentNode == null) {\r\n // TODO better ShadowRoot detection\r\n if (cursor.host != null) {\r\n return cursor;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n else {\r\n cursor = cursor.parentNode;\r\n }\r\n }\r\n}\r\n/**\r\n * Returns the root of the element (either the Document or the ShadowRoot)\r\n *\r\n * @param a Node\r\n * @return Root\r\n */\r\nexport function getRoot(a) {\r\n // TODO replace with Node.prototype.getRootNode\r\n var owner = a.ownerDocument;\r\n var cursor = a;\r\n while (true) {\r\n if (cursor.parentNode == null) {\r\n // If the cursor is the document, or it is a ShadowRoot\r\n // TODO better ShadowRoot detection\r\n if (cursor === owner || cursor.host != null) {\r\n return cursor;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n else {\r\n cursor = cursor.parentNode;\r\n }\r\n }\r\n}\r\n/**\r\n * Gets the true target of the Event.\r\n *\r\n * This is needed to make events work with the shadow DOM.\r\n *\r\n * @param event Event\r\n * @return EventTarget\r\n */\r\nexport function eventTarget(event) {\r\n if (typeof event.composedPath === \"function\") {\r\n return event.composedPath()[0];\r\n }\r\n else {\r\n return event.target;\r\n }\r\n}\r\n/**\r\n * Copies attributes from one element to another.\r\n *\r\n * @ignore Exclude from docs\r\n * @param source Element to copy attributes from\r\n * @param target Element to copy attributes to\r\n */\r\nexport function copyAttributes(source, target) {\r\n $array.each(source.attributes, function (attr) {\r\n // TODO what if it's null ?\r\n if (attr.value != null) {\r\n target.setAttribute(attr.name, attr.value);\r\n }\r\n });\r\n}\r\n/**\r\n * [fixPixelPerfect description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param el Element\r\n */\r\nexport function fixPixelPerfect(el) {\r\n readFrame(function () {\r\n // sometimes IE doesn't like this\r\n // TODO figure out a way to remove this\r\n try {\r\n var rect = el.getBoundingClientRect();\r\n var left_1 = rect.left - Math.round(rect.left);\r\n var top_1 = rect.top - Math.round(rect.top);\r\n if (left_1 !== 0) {\r\n writeFrame(function () {\r\n el.style.left = left_1 + \"px\";\r\n });\r\n }\r\n if (top_1 !== 0) {\r\n writeFrame(function () {\r\n el.style.top = top_1 + \"px\";\r\n });\r\n }\r\n }\r\n catch (e) { }\r\n });\r\n}\r\n/**\r\n * [rootStylesheet description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nvar rootStylesheet;\r\n/**\r\n * [getStylesheet description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @return [description]\r\n */\r\nfunction getStylesheet(element) {\r\n if (element == null) {\r\n if (!$type.hasValue(rootStylesheet)) {\r\n // TODO use createElementNS ?\r\n var e = document.createElement(\"style\");\r\n e.type = \"text/css\";\r\n if (options.nonce != \"\") {\r\n e.setAttribute(\"nonce\", options.nonce);\r\n }\r\n document.head.appendChild(e);\r\n rootStylesheet = e.sheet;\r\n }\r\n return rootStylesheet;\r\n }\r\n else {\r\n // TODO use createElementNS ?\r\n var e = document.createElement(\"style\");\r\n e.type = \"text/css\";\r\n if (options.nonce != \"\") {\r\n e.setAttribute(\"nonce\", options.nonce);\r\n }\r\n element.appendChild(e);\r\n return e.sheet;\r\n }\r\n}\r\n/**\r\n * [makeStylesheet description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param selector [description]\r\n * @return [description]\r\n */\r\nfunction appendStylesheet(root, selector) {\r\n var index = root.cssRules.length;\r\n root.insertRule(selector + \"{}\", index);\r\n return root.cssRules[index];\r\n}\r\n/**\r\n * Defines a class for a CSS rule.\r\n *\r\n * Can be used to dynamically add CSS to the document.\r\n */\r\nvar StyleRule = /** @class */ (function (_super) {\r\n __extends(StyleRule, _super);\r\n /**\r\n * Constructor.\r\n *\r\n * @param selector CSS selector\r\n * @param styles An object of style attribute - value pairs\r\n */\r\n function StyleRule(element, selector, styles) {\r\n var _this = this;\r\n var root = getStylesheet(element);\r\n // TODO test this\r\n _this = _super.call(this, function () {\r\n // TODO a bit hacky\r\n var index = $array.indexOf(root.cssRules, _this._rule);\r\n if (index === -1) {\r\n throw new Error(\"Could not dispose StyleRule\");\r\n }\r\n else {\r\n // TODO if it's empty remove it from the DOM ?\r\n root.deleteRule(index);\r\n }\r\n }) || this;\r\n _this._rule = appendStylesheet(root, selector);\r\n $object.each(styles, function (key, value) {\r\n _this.setStyle(key, value);\r\n });\r\n return _this;\r\n }\r\n Object.defineProperty(StyleRule.prototype, \"selector\", {\r\n /**\r\n * @return CSS selector\r\n */\r\n get: function () {\r\n return this._rule.selectorText;\r\n },\r\n /**\r\n * A CSS selector text.\r\n *\r\n * E.g.: `.myClass p`\r\n *\r\n * @param selector CSS selector\r\n */\r\n set: function (selector) {\r\n this._rule.selectorText = selector;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets the same style properties with browser-specific prefixes.\r\n *\r\n * @param name Attribute name\r\n * @param value Attribute value\r\n */\r\n StyleRule.prototype._setVendorPrefixName = function (name, value) {\r\n var style = this._rule.style;\r\n style.setProperty(\"-webkit-\" + name, value, \"\");\r\n style.setProperty(\"-moz-\" + name, value, \"\");\r\n style.setProperty(\"-ms-\" + name, value, \"\");\r\n style.setProperty(\"-o-\" + name, value, \"\");\r\n style.setProperty(name, value, \"\");\r\n };\r\n /**\r\n * Sets a value for specific style attribute.\r\n *\r\n * @param name Attribute\r\n * @param value Value\r\n */\r\n StyleRule.prototype.setStyle = function (name, value) {\r\n if (name === \"transition\") {\r\n this._setVendorPrefixName(name, value);\r\n }\r\n else {\r\n this._rule.style.setProperty(name, value, \"\");\r\n }\r\n };\r\n return StyleRule;\r\n}(Disposer));\r\nexport { StyleRule };\r\n/**\r\n * An internal counter for unique style ids.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nvar styleId = 0;\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nvar StyleClass = /** @class */ (function (_super) {\r\n __extends(StyleClass, _super);\r\n /**\r\n * Constructor.\r\n *\r\n * @param styles An object of style attribute - value pairs\r\n * @param name Class name\r\n */\r\n function StyleClass(element, styles, name) {\r\n var _this = this;\r\n var className = (!$type.hasValue(name)\r\n // TODO generate the classname randomly\r\n ? \"__style_\" + (++styleId) + \"__\"\r\n : name);\r\n _this = _super.call(this, element, \".\" + className, styles) || this;\r\n _this._className = className;\r\n return _this;\r\n }\r\n Object.defineProperty(StyleClass.prototype, \"className\", {\r\n /**\r\n * @return Class name\r\n */\r\n get: function () {\r\n return this._className;\r\n },\r\n /**\r\n * Class name.\r\n *\r\n * @param name Class name\r\n */\r\n set: function (name) {\r\n this._className = name;\r\n this.selector = \".\" + name;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Converts the whole class to\r\n * @ignore Exclude from docs\r\n */\r\n StyleClass.prototype.toString = function () {\r\n return this._className;\r\n };\r\n return StyleClass;\r\n}(StyleRule));\r\nexport { StyleClass };\r\nexport function ready(f) {\r\n if (document.readyState !== \"loading\") {\r\n f();\r\n }\r\n else {\r\n var listener_1 = function () {\r\n if (document.readyState !== \"loading\") {\r\n document.removeEventListener(\"readystatechange\", listener_1);\r\n f();\r\n }\r\n };\r\n document.addEventListener(\"readystatechange\", listener_1);\r\n }\r\n}\r\n/**\r\n * Returns a font fmaily name for the element (directly set or\r\n * computed/inherited).\r\n *\r\n * @ignore Exclude from docs\r\n * @param element Element\r\n * @return Font family\r\n */\r\nexport function findFont(element) {\r\n // Check if element has styles set\r\n var font = getComputedStyle(element, \"font-family\");\r\n if (!font) {\r\n // Completely transparent. Look for a parent\r\n var parent_1 = element.parentElement || element.parentNode;\r\n if (parent_1) {\r\n return findFont(parent_1);\r\n }\r\n else {\r\n return undefined;\r\n }\r\n }\r\n else {\r\n return font;\r\n }\r\n}\r\n/**\r\n * Returns a font fmaily name for the element (directly set or\r\n * computed/inherited).\r\n *\r\n * @ignore Exclude from docs\r\n * @param element Element\r\n * @return Font family\r\n */\r\nexport function findFontSize(element) {\r\n // Check if element has styles set\r\n var font = getComputedStyle(element, \"font-size\");\r\n if (!font) {\r\n // Completely transparent. Look for a parent\r\n var parent_2 = element.parentElement || element.parentNode;\r\n if (parent_2) {\r\n return findFontSize(parent_2);\r\n }\r\n else {\r\n return undefined;\r\n }\r\n }\r\n else {\r\n return font;\r\n }\r\n}\r\n/**\r\n * Checks whether element is not visible, whether directly or via its\r\n * ascendants.\r\n *\r\n * @param element Target element\r\n * @return Hidden?\r\n */\r\nexport function isHidden(element) {\r\n return (element.offsetParent === null);\r\n}\r\n/**\r\n * Checks wthether element is in the current viewport.\r\n *\r\n * @since 2.5.5\r\n * @param el Element\r\n * @return Within viewport?\r\n */\r\nexport function isElementInViewport(el, viewportTarget) {\r\n // Get position data of the element\r\n var rect = el.getBoundingClientRect();\r\n // Convert to array\r\n var targets = $type.isArray(viewportTarget) ? viewportTarget : viewportTarget ? [viewportTarget] : [];\r\n // Should we measure against specific viewport element?\r\n if (targets.length) {\r\n for (var i = 0; i < targets.length; i++) {\r\n var target = targets[i];\r\n // Check if viewport itself is visible\r\n if (!isElementInViewport(target)) {\r\n return false;\r\n }\r\n // Check if element is visible within the viewport\r\n var viewportRect = target.getBoundingClientRect();\r\n if (rect.top >= 0 &&\r\n rect.left >= 0 &&\r\n rect.top <= (viewportRect.top + viewportRect.height) &&\r\n rect.left <= (viewportRect.left + viewportRect.width)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n return (rect.top >= 0 &&\r\n rect.left >= 0 &&\r\n rect.top <= (window.innerHeight || document.documentElement.clientHeight) &&\r\n rect.left <= (window.innerWidth || document.documentElement.clientWidth));\r\n}\r\n//# sourceMappingURL=DOM.js.map","/**\r\n * [[AMElement]] represents any SVG element and related functionality.\r\n */\r\nimport * as $dom from \"../utils/DOM\";\r\nimport * as $object from \"../utils/Object\";\r\nimport * as $type from \"../utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A base class for all SVG elements. Provides low-level DOM functionality.\r\n *\r\n * All visual elements extend this class.\r\n */\r\nvar AMElement = /** @class */ (function () {\r\n /**\r\n * Constructor creates a new element or uses the one that was passed in.\r\n *\r\n * @param element Element reference node type\r\n */\r\n function AMElement(element) {\r\n /**\r\n * Indicates if the element was already disposed.\r\n */\r\n this._isDisposed = false;\r\n /**\r\n * Current X coordinate.\r\n */\r\n this._x = 0;\r\n /**\r\n * Current Y coordinate.\r\n */\r\n this._y = 0;\r\n /**\r\n *\r\n */\r\n this._rotationY = 0;\r\n /**\r\n *\r\n */\r\n this._rotationX = 0;\r\n /**\r\n * Current rotation.\r\n */\r\n this._rotation = 0;\r\n /**\r\n * Current scale.\r\n */\r\n this._scale = 1;\r\n if (typeof element === \"string\") {\r\n this.node = document.createElementNS($dom.SVGNS, element);\r\n }\r\n else {\r\n this.node = element;\r\n }\r\n }\r\n /**\r\n * Removes element's node from DOM.\r\n */\r\n AMElement.prototype.removeNode = function () {\r\n if (this.node) {\r\n if (this.node.parentNode) {\r\n this.node.parentNode.removeChild(this.node);\r\n }\r\n }\r\n };\r\n Object.defineProperty(AMElement.prototype, \"transformString\", {\r\n /**\r\n * Returns `transform` attribute of the element.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Transform attribute value\r\n */\r\n get: function () {\r\n if (this.node) {\r\n return this._transformString;\r\n /*\r\n const value = this.node.getAttribute(\"transform\");\r\n \r\n if (value !== null) {\r\n return value;\r\n }*/\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Appply position, rotation and scale properties via elemen's `transform`\r\n * property\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n AMElement.prototype.transform = function () {\r\n var transfromString = \"translate(\" + this._x + \",\" + this._y + \")\";\r\n if (this._scale != 1) {\r\n transfromString += ((transfromString ? \" \" : \"\") + \"scale(\" + this._scale + \")\");\r\n }\r\n if (this._rotation != 0) {\r\n var rotateString = \"rotate(\" + this._rotation + \")\";\r\n if (this._rotationX && this._rotationY) {\r\n rotateString = \"rotate(\" + this._rotation + \" \" + this._rotationX + \" \" + this._rotationY + \")\";\r\n }\r\n transfromString += ((transfromString ? \" \" : \"\") + rotateString);\r\n }\r\n this._transformString = transfromString;\r\n this.node.setAttribute(\"transform\", transfromString);\r\n };\r\n /**\r\n * Returns bounding box of the element.\r\n *\r\n * ATTENTION: Bounding box calculations are extremely costly so should be\r\n * used sparingly and cached whenever possible.\r\n *\r\n * @return Bounding rectangle\r\n */\r\n AMElement.prototype.getBBox = function () {\r\n var bbox = {\r\n width: 0,\r\n height: 0,\r\n x: 0,\r\n y: 0\r\n };\r\n // FF would fail if getBBox() is called without node added to parent\r\n if (this.node && this.node.parentNode) {\r\n try { // again for ff. TODO: check if this doesn't slow down\r\n var svgbbox = this.node.getBBox();\r\n bbox.x = svgbbox.x;\r\n bbox.y = svgbbox.y;\r\n bbox.width = svgbbox.width;\r\n bbox.height = svgbbox.height;\r\n }\r\n catch (err) { }\r\n }\r\n return bbox;\r\n };\r\n /**\r\n * Moves the element to new coordinates.\r\n *\r\n * @param x Target X\r\n * @param y Target Y\r\n */\r\n AMElement.prototype.moveTo = function (point) {\r\n if (point) {\r\n var x = point.x;\r\n var y = point.y;\r\n if (this._x != x || this._y != y) {\r\n this._x = x;\r\n this._y = y;\r\n this.transform();\r\n }\r\n }\r\n };\r\n Object.defineProperty(AMElement.prototype, \"content\", {\r\n /**\r\n * Returns element's contents as SVG markup.\r\n *\r\n * @return Contents\r\n */\r\n get: function () {\r\n // @todo Do not use `innerHTML` as this is not reliable and will not work on all browsers\r\n return this.node.innerHTML || \"\";\r\n },\r\n /**\r\n * Element's SVG contents.\r\n *\r\n * @param value Contents\r\n */\r\n set: function (value) {\r\n // @todo Do not use `innerHTML` as this is not reliable and will not work on all browsers\r\n this.node.innerHTML = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AMElement.prototype, \"textContent\", {\r\n /**\r\n * @return Text contents\r\n */\r\n get: function () {\r\n return this.node.textContent || \"\";\r\n },\r\n /**\r\n * Text contents of the SVG element.\r\n *\r\n * @param value Text contents\r\n */\r\n set: function (value) {\r\n this.node.textContent = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AMElement.prototype, \"x\", {\r\n /**\r\n * @return X coordinate (px)\r\n */\r\n get: function () {\r\n return this._x;\r\n },\r\n /**\r\n * Element's X position in pixels.\r\n *\r\n * @param value X coordinate (px)\r\n */\r\n set: function (value) {\r\n if (this._x != value) {\r\n this._x = value;\r\n this.transform();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AMElement.prototype, \"y\", {\r\n /**\r\n * @return Y coordinate (px)\r\n */\r\n get: function () {\r\n return this._y;\r\n },\r\n /**\r\n * Element's Y position in pixels.\r\n *\r\n * @param value Y coordinate (px)\r\n */\r\n set: function (value) {\r\n if (this._y != value) {\r\n this._y = value;\r\n this.transform();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AMElement.prototype, \"rotation\", {\r\n /**\r\n * @return Rotation\r\n */\r\n get: function () {\r\n return this._rotation;\r\n },\r\n /**\r\n * Element's rotation in degrees.\r\n *\r\n * @param value Rotation\r\n */\r\n set: function (angle) {\r\n if (this._rotation != angle) {\r\n this._rotation = angle;\r\n this.transform();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AMElement.prototype, \"rotationX\", {\r\n /**\r\n * @ignore\r\n */\r\n get: function () {\r\n return this._rotationX;\r\n },\r\n /**\r\n * @ignore\r\n */\r\n set: function (x) {\r\n if (this._rotationX != x) {\r\n this._rotationX = x;\r\n this.transform();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AMElement.prototype, \"rotationY\", {\r\n /**\r\n * @ignore\r\n */\r\n get: function () {\r\n return this._rotationY;\r\n },\r\n /**\r\n * @ignore\r\n */\r\n set: function (y) {\r\n if (this._rotationY != y) {\r\n this._rotationY = y;\r\n this.transform();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AMElement.prototype, \"scale\", {\r\n /**\r\n * @return Scale\r\n */\r\n get: function () {\r\n return this._scale;\r\n },\r\n /**\r\n * Element's scale where 1 is original size.\r\n *\r\n * Setting to 0.5 will reduce element's size by 50%, 2 will make element\r\n * twice as large, etc.\r\n *\r\n * @param value Scale\r\n */\r\n set: function (value) {\r\n if (this._scale != value) {\r\n this._scale = value;\r\n this.transform();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Removes an attribute from element.\r\n *\r\n * @param attribute Attribute to remove\r\n */\r\n AMElement.prototype.removeAttr = function (attribute) {\r\n this.node.removeAttribute(attribute);\r\n };\r\n /**\r\n * Sets a set of attributes on a element.\r\n *\r\n * @param attributes An object with attribute names (key) and values\r\n * @return The same element\r\n */\r\n AMElement.prototype.attr = function (attributes) {\r\n var _this = this;\r\n $object.each(attributes, function (attributeName, attributeValue) {\r\n if (!$type.hasValue(attributeValue)) {\r\n _this.node.removeAttribute(attributeName);\r\n }\r\n else {\r\n // this is for performance testing\r\n //if(attributeValue == this.node.getAttribute(attributeName)){\r\n //\tconsole.log(attributeName, attributeValue)\r\n //}\r\n _this.node.setAttribute(attributeName, attributeValue);\r\n }\r\n });\r\n return this;\r\n };\r\n /**\r\n * Returns a value of a node attribute.\r\n *\r\n * @param attribute Attribute name\r\n * @return Attribute value\r\n */\r\n AMElement.prototype.getAttr = function (attribute) {\r\n return this.node.getAttribute(attribute);\r\n };\r\n /**\r\n * Sets a single attribute of the element's node using namesspace.\r\n *\r\n * @param ns Namespace\r\n * @param attribute Attribute\r\n * @param value Value\r\n * @return The same element\r\n */\r\n AMElement.prototype.attrNS = function (ns, attribute, value) {\r\n this.node.setAttributeNS(ns, attribute, value);\r\n return this;\r\n };\r\n /**\r\n * Returns a namespaced attribute value from node.\r\n *\r\n * @param ns Namespace\r\n * @param attribute Attribute\r\n * @return Attribute value\r\n */\r\n AMElement.prototype.getAttrNS = function (ns, attribute) {\r\n return this.node.getAttributeNS(ns, attribute);\r\n };\r\n /**\r\n * Removes `style` attribute from node.\r\n *\r\n * @param attribute Attribute to remove\r\n */\r\n AMElement.prototype.removeStyle = function (attribute) {\r\n // @todo Review because it's a bit messy and maybe not needed (pratically not used)\r\n this.node.style[attribute] = null;\r\n delete this.node.style[attribute];\r\n };\r\n /**\r\n * Returns style attribute value.\r\n *\r\n * @param attribute Style attribute value\r\n * @return Attribute value\r\n */\r\n AMElement.prototype.getStyle = function (attribute) {\r\n // @todo Review because it's a bit messy and maybe not needed (pratically not used)\r\n return this.node.style[attribute];\r\n };\r\n /**\r\n * Adds style attributes to element's node.\r\n *\r\n * @param attributes Object containing attribute: value pairs\r\n * @return The same element\r\n */\r\n AMElement.prototype.addStyle = function (attributes) {\r\n var _this = this;\r\n // @todo Review because it's a bit messy and maybe not needed (pratically not used)\r\n $object.each(attributes, function (attributeName, attributeValue) {\r\n if (!$type.hasValue(attributeValue)) {\r\n _this.removeStyle(attributeName);\r\n }\r\n else {\r\n _this.node.style[attributeName] = attributeValue;\r\n }\r\n });\r\n return this;\r\n };\r\n /**\r\n * Adds a class to element.\r\n *\r\n * @param name Class name\r\n */\r\n AMElement.prototype.addClass = function (name) {\r\n $dom.addClass(this.node, name);\r\n };\r\n /**\r\n * Removes a class from element.\r\n *\r\n * @param name Class name\r\n */\r\n AMElement.prototype.removeClass = function (name) {\r\n $dom.removeClass(this.node, name);\r\n };\r\n /**\r\n * Sets a class name on element.\r\n *\r\n * @param name Class name\r\n */\r\n AMElement.prototype.setClass = function (name) {\r\n this.node.setAttribute(\"class\", name);\r\n };\r\n /**\r\n * Removes all element's child nodes, basically leaving it empty.\r\n */\r\n AMElement.prototype.removeChildNodes = function () {\r\n // remove all children\r\n while (this.node.childNodes.length > 0) {\r\n this.node.removeChild(this.node.firstChild);\r\n }\r\n };\r\n /**\r\n * Was this element already been disposed?\r\n *\r\n * @return Disposed?\r\n */\r\n AMElement.prototype.isDisposed = function () {\r\n return this._isDisposed;\r\n };\r\n /**\r\n * Disposes element.\r\n */\r\n AMElement.prototype.dispose = function () {\r\n this.removeNode();\r\n };\r\n return AMElement;\r\n}());\r\nexport { AMElement };\r\n//# sourceMappingURL=AMElement.js.map","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { AMElement } from \"./AMElement\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates an SVG `` element.\r\n *\r\n * SVG groups are used for elements that need more elements just one.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Element/g} About `` element\r\n */\r\nvar Group = /** @class */ (function (_super) {\r\n __extends(Group, _super);\r\n /**\r\n * Constructor.\r\n *\r\n * @param elementName Element type (should be \"g\")\r\n */\r\n function Group(elementName) {\r\n return _super.call(this, elementName) || this;\r\n }\r\n /**\r\n * Adds an element to group.\r\n *\r\n * This will manipulate DOM. `element` will be physically moved into group.\r\n *\r\n * @param element Element\r\n */\r\n Group.prototype.add = function (element) {\r\n if (element) {\r\n this.node.appendChild(element.node);\r\n }\r\n };\r\n /**\r\n * Adds an element to group.\r\n *\r\n * This will manipulate DOM. `element` will be physically moved into group.\r\n *\r\n * @param element Element\r\n */\r\n Group.prototype.addToBack = function (element) {\r\n if (element) {\r\n var first = this.node.childNodes[0];\r\n if (first) {\r\n if (first != element.node) {\r\n this.node.insertBefore(element.node, first);\r\n }\r\n }\r\n else {\r\n this.node.appendChild(element.node);\r\n }\r\n }\r\n };\r\n /**\r\n * Removes the `element` from group.\r\n *\r\n * Please note that this will not dispose the element itself, it will just\r\n * remove it from the group.\r\n *\r\n * @param element Element\r\n */\r\n Group.prototype.removeElement = function (element) {\r\n // todo: not sure about the speed, need to investigate, maybe it's faster to check if node is a child\r\n if (element) {\r\n try {\r\n if (element.node && element.node.parentNode == this.node) {\r\n this.node.removeChild(element.node);\r\n }\r\n }\r\n catch (err) {\r\n }\r\n }\r\n };\r\n /**\r\n * Checks if this group already has the child element added\r\n *\r\n * @param element\r\n * @return {boolean}\r\n */\r\n Group.prototype.hasChild = function (element) {\r\n for (var i = 0; i < this.node.childNodes.length; i++) {\r\n if (this.node.childNodes[i] == element.node) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n Object.defineProperty(Group.prototype, \"content\", {\r\n /**\r\n * @return SVG markup\r\n */\r\n get: function () {\r\n return this.node.innerHTML;\r\n },\r\n /**\r\n * Content of the group element.\r\n *\r\n * Can be used to add a lot of proprietary SVG markup into group.\r\n *\r\n * @param value SVG markup\r\n */\r\n set: function (value) {\r\n this.node.innerHTML = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Removes all children from the group.\r\n */\r\n Group.prototype.removeChildren = function () {\r\n if (this.node.childNodes) {\r\n while (this.node.childNodes.length > 0) {\r\n var childNode = this.node.firstChild;\r\n if (childNode && childNode.parentNode) {\r\n childNode.parentNode.removeChild(childNode);\r\n }\r\n }\r\n }\r\n };\r\n Group.prototype.removeChildrenByTag = function (tag) {\r\n if (this.node.childNodes) {\r\n var remove = this.node.getElementsByTagName(tag);\r\n for (var i = 0; i < remove.length; i++) {\r\n this.node.removeChild(remove[i]);\r\n }\r\n }\r\n };\r\n return Group;\r\n}(AMElement));\r\nexport { Group };\r\n//# sourceMappingURL=Group.js.map","/**\r\n * This module contains a version of ColorSet that can (and should) be used for\r\n * coloring UI elements.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../Base\";\r\nimport { registry } from \"../Registry\";\r\nimport { color } from \"./Color\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * This module contains a version of ColorSet that can (and should) be used for\r\n * coloring UI elements.\r\n *\r\n * The main difference from the basic [[ColorSet]] is that instead of sequenced\r\n * colors, it uses a concept of named colors.\r\n *\r\n * This way, every element in the UI can extract an exact color theme author\r\n * meant for the specific purpose, like strokes, backgrounds, etc.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/colors/} for color-related info\r\n */\r\nvar InterfaceColorSet = /** @class */ (function (_super) {\r\n __extends(InterfaceColorSet, _super);\r\n /**\r\n * Constructor\r\n */\r\n function InterfaceColorSet() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Maps the list of purposes (like \"stroke\") to an index of color of the\r\n * color set.\r\n */\r\n _this._purposes = {\r\n stroke: color(\"#e5e5e5\"),\r\n fill: color(\"#f3f3f3\"),\r\n primaryButton: color(\"#6794dc\"),\r\n primaryButtonHover: color(\"#6771dc\"),\r\n primaryButtonDown: color(\"#68dc75\"),\r\n primaryButtonActive: color(\"#68dc75\"),\r\n primaryButtonText: color(\"#FFFFFF\"),\r\n primaryButtonStroke: color(\"#FFFFFF\"),\r\n secondaryButton: color(\"#d9d9d9\"),\r\n secondaryButtonHover: color(\"#d9d9d9\").brighten(-0.25),\r\n secondaryButtonDown: color(\"#d9d9d9\").brighten(-0.35),\r\n secondaryButtonActive: color(\"#d9d9d9\").brighten(0.35),\r\n secondaryButtonText: color(\"#000000\"),\r\n secondaryButtonStroke: color(\"#FFFFFF\"),\r\n grid: color(\"#000000\"),\r\n background: color(\"#ffffff\"),\r\n alternativeBackground: color(\"#000000\"),\r\n text: color(\"#000000\"),\r\n alternativeText: color(\"#FFFFFF\"),\r\n disabledBackground: color(\"#999999\"),\r\n positive: color(\"#67dc75\"),\r\n negative: color(\"#dc6788\")\r\n };\r\n _this.className = \"InterfaceColorSet\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n InterfaceColorSet.prototype.debug = function () { };\r\n /**\r\n * Returns a color to be used for the specific purpose.\r\n *\r\n * ```TypeScript\r\n * let uicolors = new am4core.InterfaceColorSet();\r\n * console.log(uicolors.getFor(\"stroke\"));\r\n * ```\r\n * ```JavaScript\r\n * var uicolors = new am4core.InterfaceColorSet();\r\n * console.log(uicolors.getFor(\"stroke\"));\r\n * ```\r\n *\r\n * @param purpose Color use purpuse\r\n * @return Color\r\n */\r\n InterfaceColorSet.prototype.getFor = function (purpose) {\r\n return this._purposes[purpose];\r\n };\r\n /**\r\n * Sets color to be used for the specific purpose.\r\n *\r\n * @param purpose Color use purpose\r\n * @param color Color\r\n */\r\n InterfaceColorSet.prototype.setFor = function (purpose, color) {\r\n this._purposes[purpose] = color;\r\n };\r\n return InterfaceColorSet;\r\n}(BaseObject));\r\nexport { InterfaceColorSet };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"InterfaceColorSet\"] = InterfaceColorSet;\r\n//# sourceMappingURL=InterfaceColorSet.js.map","import { StyleRule } from \"../utils/DOM\";\r\nimport { Dictionary } from \"../utils/Dictionary\";\r\nimport { MultiDisposer, CounterDisposer } from \"../utils/Disposer\";\r\nimport { InterfaceColorSet } from \"../utils/InterfaceColorSet\";\r\nvar rules = new Dictionary();\r\n/**\r\n * Default CSS for Popup.\r\n *\r\n * @ignore Exclude from docs\r\n * @param prefix Prefix for CSS classes\r\n * @return Disposer for the CSS definition\r\n */\r\nexport default function (element, prefix) {\r\n if (!prefix) {\r\n prefix = \"ampopup\";\r\n }\r\n var cs = new InterfaceColorSet();\r\n var fg = cs.getFor(\"text\");\r\n var bg = cs.getFor(\"background\");\r\n bg.alpha = 0.8;\r\n var abg = cs.getFor(\"alternativeBackground\");\r\n abg.alpha = 0.05;\r\n var counter = rules.insertKeyIfEmpty(prefix, function () {\r\n var disposer = new MultiDisposer([\r\n new StyleRule(element, \".\" + prefix, {\r\n //\"width\": \"100%\",\r\n //\"height\": \"100%\",\r\n \"overflow\": \"visible\",\r\n \"position\": \"absolute\",\r\n \"top\": \"0\",\r\n \"left\": \"0\",\r\n \"z-index\": \"2000\"\r\n }),\r\n new StyleRule(element, \".\" + prefix + \"-curtain\", {\r\n \"width\": \"100%\",\r\n \"height\": \"100%\",\r\n \"position\": \"absolute\",\r\n \"top\": \"0\",\r\n \"left\": \"0\",\r\n \"z-index\": \"2001\",\r\n \"background-color\": bg.hex,\r\n \"opacity\": \"0.5\"\r\n }),\r\n new StyleRule(element, \".\" + prefix + \"-header\", {\r\n \"display\": \"block\",\r\n \"width\": \"100%\",\r\n \"min-height\": \"1.8em\",\r\n \"background\": abg.rgba\r\n }),\r\n new StyleRule(element, \".\" + prefix + \"-title\", {\r\n \"font-weight\": \"bold\",\r\n \"font-size\": \"110%\",\r\n \"padding\": \"0.5em 1.2em 0.5em 1em\"\r\n }),\r\n new StyleRule(element, \".\" + prefix + \"-content\", {\r\n /*\"width\": \"100%\",\r\n \"height\": \"100%\",*/\r\n // \"padding\": \"2em 1em 1em 1em\",\r\n \"background\": bg.hex,\r\n \"background-color\": bg.rgba,\r\n \"color\": fg.hex,\r\n \"display\": \"inline-block\",\r\n \"position\": \"absolute\",\r\n \"top\": \"0\",\r\n \"left\": \"0\",\r\n \"max-width\": \"90%\",\r\n \"max-height\": \"90%\",\r\n \"overflow\": \"auto\",\r\n \"z-index\": \"2002\"\r\n }),\r\n new StyleRule(element, \".\" + prefix + \"-inside\", {\r\n \"padding\": \"1em\"\r\n }),\r\n new StyleRule(element, \".\" + prefix + \"-close\", {\r\n \"display\": \"block\",\r\n \"position\": \"absolute\",\r\n \"top\": \"0.3em\",\r\n \"right\": \"0.3em\",\r\n \"background-color\": \"rgb(100, 100, 100)\",\r\n \"background\": \"rgba(100, 100, 100, 0.1) url(data:image/svg+xml;charset=utf-8;base64,PHN2ZyBoZWlnaHQ9IjUxMiIgdmVyc2lvbj0iMSIgdmlld0JveD0iMCAwIDUxMiA1MTIiIHdpZHRoPSI1MTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQ0NS4yIDEwOS4ybC00Mi40LTQyLjRMMjU2IDIxMy42IDEwOS4yIDY2LjhsLTQyLjQgNDIuNEwyMTMuNiAyNTYgNjYuOCA0MDIuOGw0Mi40IDQyLjRMMjU2IDI5OC40bDE0Ni44IDE0Ni44IDQyLjQtNDIuNEwyOTguNCAyNTYiLz48L3N2Zz4=) no-repeat center\",\r\n \"background-size\": \"80%\",\r\n \"width\": \"1.2em\",\r\n \"height\": \"1.2em\",\r\n \"cursor\": \"pointer\"\r\n }),\r\n ]);\r\n return new CounterDisposer(function () {\r\n rules.removeKey(prefix);\r\n disposer.dispose();\r\n });\r\n });\r\n return counter.increment();\r\n}\r\n//# sourceMappingURL=PopupCSS.js.map","import { __extends } from \"tslib\";\r\nimport { TargetedEventDispatcher } from \"../utils/EventDispatcher\";\r\nimport { MultiDisposer, CounterDisposer } from \"../utils/Disposer\";\r\n/**\r\n * Represents an Event Dispatcher for [[InteractionObject]].\r\n *\r\n * Besides regular [[EventDispatcher]] functionality it adds new events with\r\n * direct application to DOM nodes. Primarily used to handle keyboard events,\r\n * but can turn into something else moving forward.\r\n */\r\nvar InteractionObjectEventDispatcher = /** @class */ (function (_super) {\r\n __extends(InteractionObjectEventDispatcher, _super);\r\n function InteractionObjectEventDispatcher() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n /**\r\n * Holds a list of Disposers for DOM events added.\r\n */\r\n _this._domEvents = {};\r\n return _this;\r\n }\r\n /**\r\n * Adds a DOM event and returns Disposer.\r\n *\r\n * @return Disposer\r\n */\r\n InteractionObjectEventDispatcher.prototype._addDOMEvent = function (type, key, listener, context) {\r\n var _this = this;\r\n if (!this._domEvents[type]) {\r\n var callback_1 = function (e) {\r\n listener.call(context, key, e);\r\n };\r\n this.target.element.addEventListener(type, callback_1, false);\r\n this._domEvents[type] = new CounterDisposer(function () {\r\n delete _this._domEvents[type];\r\n _this.target.element.removeEventListener(type, callback_1, false);\r\n });\r\n }\r\n return this._domEvents[type].increment();\r\n };\r\n InteractionObjectEventDispatcher.prototype._dispatchKeyboardEvent = function (key, ev) {\r\n // TODO use this.dispatchImmediately ?\r\n if (this.target.events.isEnabled(key)) {\r\n this.target.events.dispatchImmediately(key, {\r\n type: key,\r\n target: this.target,\r\n event: ev\r\n });\r\n }\r\n };\r\n InteractionObjectEventDispatcher.prototype._on = function (once, type, callback, context, shouldClone, dispatch) {\r\n var info = _super.prototype._on.call(this, once, type, callback, context, shouldClone, dispatch);\r\n var disposers = [info.disposer];\r\n switch (type) {\r\n case \"hit\":\r\n case \"doublehit\":\r\n case \"rightclick\":\r\n case \"down\":\r\n case \"up\":\r\n this.target.clickable = true;\r\n break;\r\n case \"drag\":\r\n case \"dragstart\":\r\n case \"dragstop\":\r\n this.target.draggable = true;\r\n break;\r\n case \"track\":\r\n this.target.trackable = true;\r\n break;\r\n case \"resize\":\r\n this.target.resizable = true;\r\n break;\r\n case \"swipe\":\r\n case \"swipeleft\":\r\n case \"swiperight\":\r\n this.target.swipeable = true;\r\n break;\r\n case \"wheel\":\r\n case \"wheelup\":\r\n case \"wheeldown\":\r\n case \"wheelleft\":\r\n case \"wheelright\":\r\n this.target.wheelable = true;\r\n break;\r\n case \"over\":\r\n case \"out\":\r\n this.target.hoverable = true;\r\n break;\r\n case \"focus\":\r\n case \"blur\":\r\n case \"focusin\":\r\n case \"focusout\":\r\n this.target.focusable = true;\r\n break;\r\n case \"keydown\":\r\n disposers.push(this._addDOMEvent(type, type, this._dispatchKeyboardEvent, this));\r\n break;\r\n case \"keyup\":\r\n disposers.push(this._addDOMEvent(type, type, this._dispatchKeyboardEvent, this));\r\n break;\r\n case \"keypress\":\r\n disposers.push(this._addDOMEvent(type, type, this._dispatchKeyboardEvent, this));\r\n break;\r\n case \"input\":\r\n disposers.push(this._addDOMEvent(type, type, this._dispatchKeyboardEvent, this));\r\n break;\r\n }\r\n info.disposer = new MultiDisposer(disposers);\r\n return info;\r\n };\r\n return InteractionObjectEventDispatcher;\r\n}(TargetedEventDispatcher));\r\nexport { InteractionObjectEventDispatcher };\r\n//# sourceMappingURL=InteractionObjectEvents.js.map","/**\r\n * Interaction Object module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { InteractionObjectEventDispatcher } from \"./InteractionObjectEvents\";\r\nimport { BaseObjectEvents } from \"../Base\";\r\nimport { List } from \"../utils/List\";\r\nimport { Dictionary, DictionaryDisposer } from \"../utils/Dictionary\";\r\nimport { getInteraction } from \"./Interaction\";\r\nimport * as $type from \"../utils/Type\";\r\n/**\r\n * Re-exports\r\n */\r\nexport { InteractionObjectEventDispatcher };\r\n/**\r\n * Interaction object represents an object that is subject for any kind of\r\n * interaction with it with any input devices: mouse, touch or keyboard.\r\n *\r\n * Any DOM element can be wrapped into an Internaction object which in turn\r\n * enables attaching various interaction events to it, such as: hit, drag,\r\n * swipe, etc.\r\n *\r\n * To create an [[InteractionObject]] out of a [[Sprite]], use:\r\n * `interaction.getInteractionFromSprite(sprite: Sprite)`\r\n *\r\n * To create an [[InteractionObject]] out of a a regular element:\r\n * `interaction.getInteraction(element: HTMLElement)`\r\n */\r\nvar InteractionObject = /** @class */ (function (_super) {\r\n __extends(InteractionObject, _super);\r\n /**\r\n * Constructor\r\n */\r\n function InteractionObject(element) {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * @ignore\r\n * An [[EventDispatcher]] instance which holds events for this object\r\n */\r\n _this._eventDispatcher = new InteractionObjectEventDispatcher(_this);\r\n /**\r\n * Collection of Disposers for various events. (so that those get disposed\r\n * when the whole InteractionObject is disposed)\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this.eventDisposers = new Dictionary();\r\n /**\r\n * A [[Dictionary]] that holds temporarily replaced original style values for\r\n * HTML element, so that they can be restored when the functionality that\r\n * replaced them is done.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this.replacedStyles = new Dictionary();\r\n _this._clickable = false;\r\n _this._contextMenuDisabled = false;\r\n _this._hoverable = false;\r\n _this._trackable = false;\r\n _this._draggable = false;\r\n _this._swipeable = false;\r\n _this._resizable = false;\r\n _this._wheelable = false;\r\n _this._inert = false;\r\n /**\r\n * Is element currently hovered?\r\n */\r\n _this._isHover = false;\r\n /**\r\n * Was this element hovered via pointer or is it just \"pretenting\" to be\r\n * hovered.\r\n *\r\n * @ignore\r\n */\r\n _this.isRealHover = false;\r\n /**\r\n * Is the element hovered by touch pointer?\r\n */\r\n _this._isHoverByTouch = false;\r\n /**\r\n * Has element got any pointers currently pressing down on it?\r\n */\r\n _this._isDown = false;\r\n /**\r\n * Does element have focus?\r\n */\r\n _this._isFocused = false;\r\n /**\r\n * Is element currently protected from touch interactions?\r\n */\r\n _this._isTouchProtected = false;\r\n /**\r\n * Options used for inertia functionality.\r\n */\r\n _this._inertiaOptions = new Dictionary();\r\n /**\r\n * A collection of different inertia types, currently playing out.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this.inertias = new Dictionary();\r\n /**\r\n * Click/tap options.\r\n */\r\n _this._hitOptions = {};\r\n /**\r\n * Hover options.\r\n */\r\n _this._hoverOptions = {};\r\n /**\r\n * Swipe gesture options.\r\n */\r\n _this._swipeOptions = {};\r\n /**\r\n * Keyboard options.\r\n */\r\n _this._keyboardOptions = {};\r\n /**\r\n * Mouse options.\r\n */\r\n _this._mouseOptions = {};\r\n /**\r\n * Cursor options.\r\n */\r\n _this._cursorOptions = {\r\n \"defaultStyle\": [{\r\n \"property\": \"cursor\",\r\n \"value\": \"default\"\r\n }]\r\n };\r\n _this._disposers.push(_this._eventDispatcher);\r\n _this._element = element;\r\n _this.className = \"InteractionObject\";\r\n _this._disposers.push(new DictionaryDisposer(_this.inertias));\r\n _this._disposers.push(new DictionaryDisposer(_this.eventDisposers));\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n ;\r\n Object.defineProperty(InteractionObject.prototype, \"events\", {\r\n /**\r\n * An [[EventDispatcher]] instance which holds events for this object\r\n */\r\n get: function () {\r\n return this._eventDispatcher;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"isHover\", {\r\n /**\r\n * @return Hovered?\r\n */\r\n get: function () {\r\n return this._isHover;\r\n },\r\n /**\r\n * Indicates if this element is currently hovered.\r\n *\r\n * @param value Hovered?\r\n */\r\n set: function (value) {\r\n if (this.isHover != value) {\r\n this._isHover = value;\r\n if (value) {\r\n getInteraction().overObjects.moveValue(this);\r\n }\r\n else {\r\n this.isRealHover = false;\r\n getInteraction().overObjects.removeValue(this);\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"isHoverByTouch\", {\r\n /**\r\n * @return Hovered?\r\n */\r\n get: function () {\r\n return this._isHoverByTouch;\r\n },\r\n /**\r\n * Indicates if this element is currently hovered.\r\n *\r\n * @param value Hovered?\r\n */\r\n set: function (value) {\r\n if (this.isHoverByTouch != value) {\r\n this._isHoverByTouch = value;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"overPointers\", {\r\n /**\r\n * A list of pointers currently over the element.\r\n *\r\n * @see {@link Pointer}\r\n * @return List if pointers currently hovering the element\r\n */\r\n get: function () {\r\n if (!this._overPointers) {\r\n this._overPointers = new List();\r\n }\r\n return this._overPointers;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"isDown\", {\r\n /**\r\n * @return Has down pointers?\r\n */\r\n get: function () {\r\n return this._isDown;\r\n },\r\n /**\r\n * Indicates if this element has currently any pointers pressing on it.\r\n *\r\n * @param value Has down pointers?\r\n */\r\n set: function (value) {\r\n if (this.isDown != value) {\r\n this._isDown = value;\r\n if (value) {\r\n getInteraction().downObjects.moveValue(this);\r\n }\r\n else {\r\n getInteraction().downObjects.removeValue(this);\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"downPointers\", {\r\n /**\r\n * A list of pointers currently pressing down on this element.\r\n *\r\n * @see {@link Pointer}\r\n * @return List of down pointers\r\n */\r\n get: function () {\r\n if (!this._downPointers) {\r\n this._downPointers = new List();\r\n }\r\n return this._downPointers;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"isFocused\", {\r\n /**\r\n * @return Focused?\r\n */\r\n get: function () {\r\n return this._isFocused;\r\n },\r\n /**\r\n * Indicates if this element is currently focused.\r\n *\r\n * @param value Focused?\r\n */\r\n set: function (value) {\r\n if (this.isFocused != value) {\r\n this._isFocused = value;\r\n if (value) {\r\n getInteraction().focusedObject = this;\r\n }\r\n else {\r\n getInteraction().focusedObject = undefined;\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"isTouchProtected\", {\r\n /**\r\n * @ignore\r\n * @return Touch protected?\r\n */\r\n get: function () {\r\n return this._isTouchProtected;\r\n },\r\n /**\r\n * Indicates if this element is currently being protected from touch actions.\r\n *\r\n * @ignore\r\n * @param value Touch protected?\r\n */\r\n set: function (value) {\r\n if (this._isTouchProtected != value) {\r\n this._isTouchProtected = value;\r\n if (value) {\r\n getInteraction().unprepElement(this);\r\n }\r\n else if (this.draggable || this.swipeable || this.trackable || this.resizable) {\r\n getInteraction().prepElement(this);\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"clickable\", {\r\n /**\r\n * @return Clickable?\r\n */\r\n get: function () {\r\n return this._clickable;\r\n },\r\n /**\r\n * Is element clickable? Clickable elements will generate \"hit\" events when\r\n * clicked or tapped.\r\n *\r\n * @param value Clickable?\r\n */\r\n set: function (value) {\r\n if (this._clickable !== value) {\r\n this._clickable = value;\r\n getInteraction().processClickable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"contextMenuDisabled\", {\r\n /**\r\n * @return Context menu disabled?\r\n */\r\n get: function () {\r\n return this._contextMenuDisabled;\r\n },\r\n /**\r\n * Should element prevent context menu to be displayed, e.g. when\r\n * right-clicked?\r\n *\r\n * @default false\r\n * @param value Context menu disabled?\r\n */\r\n set: function (value) {\r\n if (this._contextMenuDisabled !== value) {\r\n this._contextMenuDisabled = value;\r\n getInteraction().processContextMenu(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"hoverable\", {\r\n /**\r\n * @return Hoverable?\r\n */\r\n get: function () {\r\n return this._hoverable;\r\n },\r\n /**\r\n * Indicates if element should generate hover events.\r\n *\r\n * @param value Hoverable?\r\n */\r\n set: function (value) {\r\n if (this._hoverable !== value) {\r\n this._hoverable = value;\r\n getInteraction().processHoverable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"trackable\", {\r\n /**\r\n * @return Track pointer?\r\n */\r\n get: function () {\r\n return this._trackable;\r\n },\r\n /**\r\n * Indicates if pointer movement over element should be tracked.\r\n *\r\n * @param value Track pointer?\r\n */\r\n set: function (value) {\r\n if (this._trackable !== value) {\r\n this._trackable = value;\r\n getInteraction().processTrackable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"draggable\", {\r\n /**\r\n * @return Draggable?\r\n */\r\n get: function () {\r\n return this._draggable;\r\n },\r\n /**\r\n * Indicates if element can be dragged. (moved)\r\n *\r\n * @param value Draggable?\r\n */\r\n set: function (value) {\r\n if (this._draggable !== value) {\r\n this._draggable = value;\r\n getInteraction().processDraggable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"swipeable\", {\r\n /**\r\n * @return Track swipe?\r\n */\r\n get: function () {\r\n return this._swipeable;\r\n },\r\n /**\r\n * Indicates whether element should react to swipe gesture.\r\n *\r\n * @param value Track swipe?\r\n */\r\n set: function (value) {\r\n if (this._swipeable !== value) {\r\n this._swipeable = value;\r\n getInteraction().processSwipeable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"resizable\", {\r\n /**\r\n * @return Resizeble?\r\n */\r\n get: function () {\r\n return this._resizable;\r\n },\r\n /**\r\n * Indicates if element can be resized.\r\n *\r\n * @param value Resizeable?\r\n */\r\n set: function (value) {\r\n if (this._resizable !== value) {\r\n this._resizable = value;\r\n getInteraction().processResizable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"wheelable\", {\r\n /**\r\n * @return Track wheel?\r\n */\r\n get: function () {\r\n return this._wheelable;\r\n },\r\n /**\r\n * Indicates whether track moouse wheel rotation over element.\r\n *\r\n * @param value Track wheel?\r\n */\r\n set: function (value) {\r\n if (this._wheelable !== value) {\r\n this._wheelable = value;\r\n getInteraction().processWheelable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"inert\", {\r\n /**\r\n * @return Inert?\r\n */\r\n get: function () {\r\n return this._inert;\r\n },\r\n /**\r\n * Indicates if element is inert, i.e. if it should carry movement momentum\r\n * after it is dragged and released.\r\n *\r\n * @param value Inert?\r\n */\r\n set: function (value) {\r\n if (this._inert !== value) {\r\n this._inert = value;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"focusable\", {\r\n /**\r\n * @return Focusable?\r\n */\r\n get: function () {\r\n return this._focusable;\r\n },\r\n /**\r\n * Indicates if element can gain focus.\r\n *\r\n * @param value Focusable?\r\n */\r\n set: function (value) {\r\n if (this._focusable !== value) {\r\n this._focusable = value;\r\n if (this._focusable && this.tabindex == -1) {\r\n this._tabindex = 1;\r\n }\r\n getInteraction().processFocusable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"tabindex\", {\r\n /**\r\n * @return Tab index\r\n */\r\n get: function () {\r\n return $type.getValueDefault(this._tabindex, -1);\r\n },\r\n /**\r\n * Element's tab index.\r\n *\r\n * @param value Tab index\r\n */\r\n set: function (value) {\r\n if (this._tabindex !== value) {\r\n this._tabindex = value;\r\n if (value > -1) {\r\n this.focusable = true;\r\n }\r\n getInteraction().processFocusable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"element\", {\r\n /**\r\n * @return Element\r\n */\r\n get: function () {\r\n return this._element;\r\n },\r\n /**\r\n * A DOM element associated with this element.\r\n *\r\n * @param element Element\r\n */\r\n set: function (element) {\r\n this._element = element;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"originalPosition\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Position.\r\n */\r\n get: function () {\r\n return this._originalPosition || { x: 0, y: 0 };\r\n },\r\n /**\r\n * Element's original position.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Position\r\n */\r\n set: function (value) {\r\n this._originalPosition = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"originalScale\", {\r\n /**\r\n * @return Scale\r\n */\r\n get: function () {\r\n return $type.getValueDefault(this._originalScale, 1);\r\n },\r\n /**\r\n * Element's original scale.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Scale\r\n */\r\n set: function (value) {\r\n if (this._originalScale !== value) {\r\n this._originalScale = value;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"originalAngle\", {\r\n /**\r\n * @return Angle\r\n */\r\n get: function () {\r\n return $type.getValueDefault(this._originalAngle, 0);\r\n },\r\n /**\r\n * Element's original angle.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Angle\r\n */\r\n set: function (value) {\r\n if (this._originalAngle !== value) {\r\n this._originalAngle = value;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"inertiaOptions\", {\r\n /**\r\n * @return Options\r\n */\r\n get: function () {\r\n if (this.sprite && this.sprite._adapterO) {\r\n return this.sprite._adapterO.apply(\"inertiaOptions\", this._inertiaOptions);\r\n }\r\n else {\r\n return this._inertiaOptions;\r\n }\r\n },\r\n /**\r\n * Inertia options.\r\n *\r\n * @param value Options\r\n */\r\n set: function (value) {\r\n this._inertiaOptions = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"hitOptions\", {\r\n /**\r\n * @return Options\r\n */\r\n get: function () {\r\n if (this.sprite && this.sprite._adapterO) {\r\n return this.sprite._adapterO.apply(\"hitOptions\", this._hitOptions);\r\n }\r\n else {\r\n return this._hitOptions;\r\n }\r\n },\r\n /**\r\n * Hit options.\r\n *\r\n * @param value Options\r\n */\r\n set: function (value) {\r\n this._hitOptions = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"hoverOptions\", {\r\n /**\r\n * @return Options\r\n */\r\n get: function () {\r\n if (this.sprite && this.sprite._adapterO) {\r\n return this.sprite._adapterO.apply(\"hoverOptions\", this._hoverOptions);\r\n }\r\n else {\r\n return this._hoverOptions;\r\n }\r\n },\r\n /**\r\n * Hover options.\r\n *\r\n * @param value Options\r\n */\r\n set: function (value) {\r\n this._hoverOptions = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"swipeOptions\", {\r\n /**\r\n * @return Options\r\n */\r\n get: function () {\r\n if (this.sprite && this.sprite._adapterO) {\r\n return this.sprite._adapterO.apply(\"swipeOptions\", this._swipeOptions);\r\n }\r\n else {\r\n return this._swipeOptions;\r\n }\r\n },\r\n /**\r\n * Swipe options.\r\n *\r\n * @param value Options\r\n */\r\n set: function (value) {\r\n this._swipeOptions = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"keyboardOptions\", {\r\n /**\r\n * @return Options\r\n */\r\n get: function () {\r\n if (this.sprite && this.sprite._adapterO) {\r\n return this.sprite._adapterO.apply(\"keyboardOptions\", this._keyboardOptions);\r\n }\r\n else {\r\n return this._keyboardOptions;\r\n }\r\n },\r\n /**\r\n * Keyboard options.\r\n *\r\n * @param value Options\r\n */\r\n set: function (value) {\r\n this._keyboardOptions = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"mouseOptions\", {\r\n /**\r\n * @return Options\r\n */\r\n get: function () {\r\n if (this.sprite && this.sprite._adapterO) {\r\n return this.sprite._adapterO.apply(\"mouseOptions\", this._mouseOptions);\r\n }\r\n else {\r\n return this._mouseOptions;\r\n }\r\n },\r\n /**\r\n * Mouse options.\r\n *\r\n * Enables controlling options related to the mouse, for example sensitivity\r\n * of its mouse wheel.\r\n *\r\n * E.g. the below will reduce chart's wheel-zoom speed to half its default\r\n * speed:\r\n *\r\n * ```TypeScript\r\n * chart.plotContainer.mouseOptions.sensitivity = 0.5;\r\n * ```\r\n * ```JavaScript\r\n * chart.plotContainer.mouseOptions.sensitivity = 0.5;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"plotContainer\": {\r\n * \"mouseOptions\": {\r\n * \"sensitivity\": 0.5\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * @since 4.5.14\r\n * @param value Options\r\n */\r\n set: function (value) {\r\n this._mouseOptions = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"cursorOptions\", {\r\n /**\r\n * @return Options\r\n */\r\n get: function () {\r\n if (this.sprite && this.sprite._adapterO) {\r\n return this.sprite._adapterO.apply(\"cursorOptions\", this._cursorOptions);\r\n }\r\n else {\r\n return this._cursorOptions;\r\n }\r\n },\r\n /**\r\n * Cursor options.\r\n *\r\n * @param value Options\r\n */\r\n set: function (value) {\r\n this._cursorOptions = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies all properties and related assets from another object of the same\r\n * type.\r\n *\r\n * @param source Source object\r\n */\r\n InteractionObject.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.inertiaOptions = source.inertiaOptions;\r\n this.hitOptions = source.hitOptions;\r\n this.hoverOptions = source.hoverOptions;\r\n this.swipeOptions = source.swipeOptions;\r\n this.keyboardOptions = source.keyboardOptions;\r\n this.cursorOptions = source.cursorOptions;\r\n this.contextMenuDisabled = source.contextMenuDisabled;\r\n getInteraction().applyCursorOverStyle(this);\r\n };\r\n /**\r\n * @ignore Exclude from docs\r\n */\r\n InteractionObject.prototype.setEventDisposer = function (key, value, f) {\r\n var disposer = this.eventDisposers.getKey(key);\r\n if (value) {\r\n if (disposer == null) {\r\n this.eventDisposers.setKey(key, f());\r\n }\r\n }\r\n else {\r\n if (disposer != null) {\r\n disposer.dispose();\r\n this.eventDisposers.removeKey(key);\r\n }\r\n }\r\n };\r\n /**\r\n * Disposes object.\r\n */\r\n InteractionObject.prototype.dispose = function () {\r\n _super.prototype.dispose.call(this);\r\n // Remove from all interaction registries\r\n var interaction = getInteraction();\r\n interaction.overObjects.removeValue(this);\r\n interaction.downObjects.removeValue(this);\r\n interaction.trackedObjects.removeValue(this);\r\n interaction.transformedObjects.removeValue(this);\r\n // Unlock document wheel\r\n if (this.isHover && this.wheelable) {\r\n interaction.unlockWheel();\r\n }\r\n if (interaction.focusedObject === this) {\r\n interaction.focusedObject = undefined;\r\n }\r\n };\r\n return InteractionObject;\r\n}(BaseObjectEvents));\r\nexport { InteractionObject };\r\n//# sourceMappingURL=InteractionObject.js.map","/**\r\n * Functionality related simulating of dragging of elements using keyboard.\r\n */\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { getInteraction } from \"./Interaction\";\r\nimport { system } from \"../System\";\r\nimport * as $array from \"../utils/Array\";\r\n/**\r\n * [[InteractionKeyboardObject]] is used to simulate dragging of the `draggable`\r\n * element using keyboard arrows.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nvar InteractionKeyboardObject = /** @class */ (function () {\r\n /**\r\n * Constructor.\r\n *\r\n * @param io An InteractionObject\r\n */\r\n function InteractionKeyboardObject(io, ev) {\r\n /**\r\n * Indicates if this object has already been deleted. Any\r\n * destruction/disposal code should take this into account when deciding\r\n * wheter to run potentially costly disposal operations if they already have\r\n * been run.\r\n */\r\n this._disposed = false;\r\n /**\r\n * Indicates direction of current horizontal movement.\r\n *\r\n * 0 - not moving horizontally\r\n * 1 - moving right\r\n * -1 - moving left\r\n */\r\n this.directionX = 0;\r\n /**\r\n * Indicates direction of current vertical movement.\r\n *\r\n * 0 - not moving vertically\r\n * 1 - moving down\r\n * -1 - moving up\r\n */\r\n this.directionY = 0;\r\n this.interaction = io;\r\n this.keyboardEvent = ev;\r\n this._startedOn = new Date().getTime();\r\n getInteraction().processDragStart(io);\r\n system.animations.push(this);\r\n this.update();\r\n }\r\n /**\r\n * It's an update method which is called by the system if\r\n * [[InteractionObject]] is used as animation.\r\n *\r\n * This will update coordinates of the element based on the movement\r\n * directions.\r\n */\r\n InteractionKeyboardObject.prototype.update = function () {\r\n // Init and get settings\r\n var io = this.interaction;\r\n var speed = getInteraction().getKeyboardOption(io, \"speed\"), accelleration = getInteraction().getKeyboardOption(io, \"accelleration\"), accellerationDelay = getInteraction().getKeyboardOption(io, \"accellerationDelay\"), shift = {\r\n x: 0,\r\n y: 0\r\n };\r\n // If SHIFT key is pressed we slash speed by half and disable accelleration\r\n if (this.keyboardEvent.shiftKey) {\r\n speed *= 0.5;\r\n accelleration = 1;\r\n }\r\n // If CTRL is pressed we increase speed by x2\r\n else if (this.keyboardEvent.ctrlKey) {\r\n speed *= 2;\r\n }\r\n // Get elapsed time\r\n var ms = new Date().getTime() - this._startedOn;\r\n var accelleratedMs = ms - accellerationDelay;\r\n // Add accellerated movement\r\n if ((accelleration > 0) && (accelleratedMs > 0)) {\r\n var accellerationFactor = ms / accellerationDelay;\r\n ms = accellerationDelay;\r\n shift.x += this.directionX * (speed * accelleration * accellerationFactor * accelleratedMs);\r\n shift.y += this.directionY * (speed * accelleration * accellerationFactor * accelleratedMs);\r\n }\r\n // Calculate position\r\n shift.x += this.directionX * (speed * ms);\r\n shift.y += this.directionY * (speed * ms);\r\n // Simulate move on Interaction\r\n getInteraction().handleTransformMove(io, shift, { x: 0, y: 0 }, this.keyboardEvent, true, false);\r\n };\r\n /**\r\n * Returns if this object has been already been disposed.\r\n *\r\n * @return Is disposed?\r\n */\r\n InteractionKeyboardObject.prototype.isDisposed = function () {\r\n return this._disposed;\r\n };\r\n /**\r\n * Disposes this object. Removes from system animations.\r\n */\r\n InteractionKeyboardObject.prototype.dispose = function () {\r\n if (!this._disposed) {\r\n getInteraction().processDragStop(this.interaction);\r\n $array.remove(system.animations, this);\r\n }\r\n };\r\n return InteractionKeyboardObject;\r\n}());\r\nexport { InteractionKeyboardObject };\r\n//# sourceMappingURL=InteractionKeyboardObject.js.map","/**\r\n * Functionality related to inertia\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../Base\";\r\nimport { getInteraction } from \"./Interaction\";\r\nimport { AnimationDisposer } from \"../utils/Animation\";\r\nimport * as $type from \"../utils/Type\";\r\n/**\r\n * A point of inertia is to simulate gradually drecreasing motion even after\r\n * actual interaction by user, that caused it, has already ended.\r\n *\r\n * [[Inertia]] object will continue triggering the same [[Sprite]] handlers\r\n * as if the interaction was still happening, gradually reducing\r\n * shift/angle/scale values until full stop.\r\n *\r\n * Basically, from the target element's point of view, while inertia is\r\n * playing, it is still being interacted with by user, albeit with a\r\n * decreasing speed.\r\n */\r\nvar Inertia = /** @class */ (function (_super) {\r\n __extends(Inertia, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Inertia(interaction, type, point, startPoint) {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * List of animations currently playing.\r\n */\r\n _this.animations = [];\r\n _this.className = \"Inertia\";\r\n _this.interaction = interaction;\r\n _this.type = type;\r\n _this.point = point;\r\n _this.startPoint = startPoint;\r\n // Make animations disposable\r\n _this._disposers.push(new AnimationDisposer(_this.animations));\r\n return _this;\r\n }\r\n Object.defineProperty(Inertia.prototype, \"x\", {\r\n /**\r\n * Returns current X coordinate.\r\n *\r\n * @return X\r\n */\r\n get: function () {\r\n return this.point.x;\r\n },\r\n /**\r\n * Sets current X coordinate.\r\n *\r\n * Will trigger \"drag\" event for the target element.\r\n *\r\n * @param value X\r\n */\r\n set: function (value) {\r\n if ($type.isNumber(value)) {\r\n this.point.x = value;\r\n this.handleMove();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Inertia.prototype, \"y\", {\r\n /**\r\n * Returns current Y coordinate.\r\n *\r\n * @return Y\r\n */\r\n get: function () {\r\n return this.point.y;\r\n },\r\n /**\r\n * Sets current Y coordinate.\r\n *\r\n * Will trigger \"drag\" event for the target element.\r\n *\r\n * @param value Y\r\n */\r\n set: function (value) {\r\n if ($type.isNumber(value)) {\r\n this.point.y = value;\r\n this.handleMove();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Simulates dragging of element.\r\n */\r\n Inertia.prototype.handleMove = function () {\r\n // Prepare {InteractionEvent} object\r\n if (this.interaction.events.isEnabled(\"drag\")) {\r\n var imev = {\r\n type: \"drag\",\r\n target: this.interaction,\r\n shift: {\r\n x: this.x - this.startPoint.x,\r\n y: this.y - this.startPoint.y\r\n },\r\n startPoint: this.startPoint,\r\n point: {\r\n x: this.x,\r\n y: this.y\r\n },\r\n touch: false\r\n };\r\n // Call handler\r\n this.interaction.events.dispatchImmediately(\"drag\", imev);\r\n }\r\n };\r\n /**\r\n * Finishes up the inertia animation. (removes reference to this animation\r\n * object)\r\n */\r\n Inertia.prototype.done = function () {\r\n // Remove inertia animation from the object\r\n this.interaction.inertias.removeKey(this.type);\r\n // Move ended\r\n if (this.type === \"move\") {\r\n getInteraction().processDragStop(this.interaction);\r\n }\r\n // Destroy\r\n this.dispose();\r\n };\r\n return Inertia;\r\n}(BaseObject));\r\nexport { Inertia };\r\n//# sourceMappingURL=Inertia.js.map","/**\r\n * A collection of keyboard-related utilities accessible via `keyboard`\r\n * instance.\r\n */\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport * as $type from \"./Type\";\r\n/**\r\n * A class that represents collection of keyboard-related utilities.\r\n *\r\n * Do not instantiate this class directly, but rather use `keyboard` variable.\r\n */\r\nvar Keyboard = /** @class */ (function () {\r\n function Keyboard() {\r\n }\r\n /**\r\n * Returns a named key based on information contained in the event or\r\n * \"other\".\r\n *\r\n * @param ev A keyboard event\r\n * @return Keyboard named key\r\n */\r\n Keyboard.prototype.getEventKey = function (ev) {\r\n // Get the key code\r\n var code = ev.keyCode || ev.which, key;\r\n // Map to internal key\r\n switch (code) {\r\n case 38:\r\n key = \"up\";\r\n break;\r\n case 40:\r\n key = \"down\";\r\n break;\r\n case 37:\r\n key = \"left\";\r\n break;\r\n case 39:\r\n key = \"right\";\r\n break;\r\n case 13:\r\n key = \"enter\";\r\n break;\r\n case 27:\r\n key = \"esc\";\r\n break;\r\n case 36:\r\n key = \"home\";\r\n break;\r\n case 35:\r\n key = \"end\";\r\n break;\r\n case 9:\r\n key = \"tab\";\r\n break;\r\n case 17:\r\n key = \"ctrl\";\r\n break;\r\n case 18:\r\n key = \"alt\";\r\n break;\r\n case 16:\r\n key = \"shift\";\r\n break;\r\n case 32:\r\n key = \"space\";\r\n break;\r\n case 36:\r\n key = \"home\";\r\n break;\r\n case 35:\r\n key = \"end\";\r\n break;\r\n case 33:\r\n key = \"pgup\";\r\n break;\r\n case 34:\r\n key = \"pgdn\";\r\n break;\r\n case 45:\r\n key = \"ins\";\r\n break;\r\n case 46:\r\n key = \"del\";\r\n break;\r\n case 107:\r\n key = \"plus\";\r\n break;\r\n case 109:\r\n key = \"minus\";\r\n break;\r\n default:\r\n key = \"other\";\r\n break;\r\n }\r\n return key;\r\n };\r\n /**\r\n * Checks if event key is one or more of the selected named keys.\r\n *\r\n * @param ev Keyboard event\r\n * @param key Named key or array of keys\r\n * @return Is event key one of the list?\r\n */\r\n Keyboard.prototype.isKey = function (ev, key) {\r\n var eventKey = this.getEventKey(ev);\r\n if ($type.isString(key)) {\r\n key = [key];\r\n }\r\n return key.indexOf(eventKey) !== -1;\r\n };\r\n /**\r\n * Returns `true` if shift key was presset at the moment of the event.\r\n *\r\n * @param ev Event object\r\n * @return Was shift pressed?\r\n */\r\n Keyboard.prototype.shiftKey = function (ev) {\r\n return ev.shiftKey;\r\n };\r\n /**\r\n * Returns `true` if ctrl key was presset at the moment of the event.\r\n *\r\n * @param ev Event object\r\n * @return Was ctrl pressed?\r\n */\r\n Keyboard.prototype.ctrlKey = function (ev) {\r\n return ev.ctrlKey;\r\n };\r\n /**\r\n * Returns `true` if alt key was presset at the moment of the event\r\n * @param ev Event object\r\n * @return Was alt pressed?\r\n */\r\n Keyboard.prototype.altKey = function (ev) {\r\n return ev.altKey;\r\n };\r\n /**\r\n * Returns `true` if meta key was presset at the moment of the event\r\n * @param ev Event object\r\n * @return Was meta pressed?\r\n */\r\n Keyboard.prototype.metaKey = function (ev) {\r\n return ev.metaKey;\r\n };\r\n return Keyboard;\r\n}());\r\nexport { Keyboard };\r\n/**\r\n * A single [[Keyboard]] instance to be reused across all elements so that\r\n * they don't need to instantiate their own.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport var keyboard = new Keyboard();\r\n//# sourceMappingURL=Keyboard.js.map","import * as $type from \"../utils/Type\";\r\n/**\r\n * Maps time period names to their numeric representations in milliseconds.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport var timeUnitDurations = {\r\n millisecond: 1,\r\n second: 1000,\r\n minute: 60000,\r\n hour: 3600000,\r\n day: 86400000,\r\n week: 604800000,\r\n month: 2592000000,\r\n year: 31536000000\r\n};\r\n/**\r\n * Returns the next time unit that goes after source `unit`.\r\n *\r\n * E.g. \"hour\" is the next unit after \"minute\", etc.\r\n *\r\n * @ignore Exclude from docs\r\n * @param unit Source time unit\r\n * @return Next time unit\r\n */\r\nexport function getNextUnit(unit) {\r\n switch (unit) {\r\n case \"year\":\r\n return;\r\n case \"month\":\r\n return \"year\";\r\n case \"week\":\r\n return \"month\";\r\n case \"day\":\r\n return \"month\"; // not a mistake\r\n case \"hour\":\r\n return \"day\";\r\n case \"minute\":\r\n return \"hour\";\r\n case \"second\":\r\n return \"minute\";\r\n case \"millisecond\":\r\n return \"second\";\r\n }\r\n}\r\n/**\r\n * Returns number of milliseconds in the `count` of time `unit`.\r\n *\r\n * Available units: \"millisecond\", \"second\", \"minute\", \"hour\", \"day\", \"week\",\r\n * \"month\", and \"year\".\r\n *\r\n * @ignore Exclude from docs\r\n * @param unit Time unit\r\n * @param count Number of units\r\n * @return Milliseconds\r\n */\r\nexport function getDuration(unit, count) {\r\n if (!$type.hasValue(count)) {\r\n count = 1;\r\n }\r\n return timeUnitDurations[unit] * count;\r\n}\r\n/**\r\n * Returns current `Date` object.\r\n *\r\n * @return Current date\r\n */\r\nexport function now() {\r\n return new Date();\r\n}\r\n/**\r\n * Returns current timestamp.\r\n *\r\n * @return Current timestamp\r\n */\r\nexport function getTime() {\r\n return now().getTime();\r\n}\r\n/**\r\n * Returns a copy of the `Date` object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param date Source date\r\n * @return Copy\r\n */\r\nexport function copy(date) {\r\n return new Date(date.getTime()); // todo: check if this is ok. new Date(date) used to strip milliseconds on FF in v3\r\n}\r\n/**\r\n * Checks if the `unit` part of two `Date` objects do not match. Two dates\r\n * represent a \"range\" of time, rather the same time date.\r\n *\r\n * @ignore Exclude from docs\r\n * @param dateOne Date 1\r\n * @param dateTwo Date 2\r\n * @param unit Time unit to check\r\n * @return Range?\r\n */\r\nexport function checkChange(dateOne, dateTwo, unit, utc) {\r\n dateOne = new Date(dateOne.getTime());\r\n dateTwo = new Date(dateTwo.getTime());\r\n var timeZoneOffset1 = 0;\r\n var timeZoneOffset2 = 0;\r\n if (!utc && unit != \"millisecond\") {\r\n timeZoneOffset1 = dateOne.getTimezoneOffset();\r\n dateOne.setUTCMinutes(dateOne.getUTCMinutes() - timeZoneOffset1);\r\n timeZoneOffset2 = dateTwo.getTimezoneOffset();\r\n dateTwo.setUTCMinutes(dateTwo.getUTCMinutes() - timeZoneOffset2);\r\n }\r\n var changed = false;\r\n switch (unit) {\r\n case \"year\":\r\n if (dateOne.getUTCFullYear() != dateTwo.getUTCFullYear()) {\r\n changed = true;\r\n }\r\n break;\r\n case \"month\":\r\n if (dateOne.getUTCFullYear() != dateTwo.getUTCFullYear()) {\r\n changed = true;\r\n }\r\n else if (dateOne.getUTCMonth() != dateTwo.getUTCMonth()) {\r\n changed = true;\r\n }\r\n break;\r\n case \"day\":\r\n if (dateOne.getUTCMonth() != dateTwo.getUTCMonth()) {\r\n changed = true;\r\n }\r\n else if (dateOne.getUTCDate() != dateTwo.getUTCDate()) {\r\n changed = true;\r\n }\r\n break;\r\n case \"hour\":\r\n if (dateOne.getUTCHours() != dateTwo.getUTCHours()) {\r\n changed = true;\r\n }\r\n break;\r\n case \"minute\":\r\n if (dateOne.getUTCMinutes() != dateTwo.getUTCMinutes()) {\r\n changed = true;\r\n }\r\n break;\r\n case \"second\":\r\n if (dateOne.getUTCSeconds() != dateTwo.getUTCSeconds()) {\r\n changed = true;\r\n }\r\n break;\r\n case \"millisecond\":\r\n if (dateOne.getTime() != dateTwo.getTime()) {\r\n changed = true;\r\n }\r\n break;\r\n }\r\n if (changed) {\r\n return true;\r\n }\r\n var nextUnit = getNextUnit(unit);\r\n if (nextUnit) {\r\n dateOne.setUTCMinutes(dateOne.getUTCMinutes() + timeZoneOffset1);\r\n dateTwo.setUTCMinutes(dateTwo.getUTCMinutes() + timeZoneOffset2);\r\n return checkChange(dateOne, dateTwo, nextUnit, utc);\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n/**\r\n * Adds `count` of time `unit` to the source date. Returns a modified `Date` object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param date Source date\r\n * @param unit Time unit\r\n * @param count Number of units to add\r\n * @return Modified date\r\n */\r\nexport function add(date, unit, count, utc) {\r\n var timeZoneOffset = 0;\r\n if (!utc && unit != \"millisecond\") {\r\n timeZoneOffset = date.getTimezoneOffset();\r\n date.setUTCMinutes(date.getUTCMinutes() - timeZoneOffset);\r\n }\r\n switch (unit) {\r\n case \"day\":\r\n var day = date.getUTCDate();\r\n date.setUTCDate(day + count);\r\n break;\r\n case \"second\":\r\n var seconds = date.getUTCSeconds();\r\n date.setUTCSeconds(seconds + count);\r\n break;\r\n case \"millisecond\":\r\n var milliseconds = date.getUTCMilliseconds();\r\n date.setUTCMilliseconds(milliseconds + count);\r\n break;\r\n case \"hour\":\r\n var hours = date.getUTCHours();\r\n date.setUTCHours(hours + count);\r\n break;\r\n case \"minute\":\r\n var minutes = date.getUTCMinutes();\r\n date.setUTCMinutes(minutes + count);\r\n break;\r\n case \"year\":\r\n var year = date.getUTCFullYear();\r\n date.setUTCFullYear(year + count);\r\n break;\r\n case \"month\":\r\n var month = date.getUTCMonth();\r\n date.setUTCMonth(month + count);\r\n break;\r\n case \"week\":\r\n var wday = date.getUTCDate();\r\n date.setUTCDate(wday + count * 7);\r\n break;\r\n }\r\n if (!utc && unit != \"millisecond\") {\r\n date.setUTCMinutes(date.getUTCMinutes() + timeZoneOffset);\r\n if (unit == \"day\" || unit == \"week\" || unit == \"month\" || unit == \"year\") {\r\n var newTimeZoneOffset = date.getTimezoneOffset();\r\n if (newTimeZoneOffset != timeZoneOffset) {\r\n var diff = newTimeZoneOffset - timeZoneOffset;\r\n date.setUTCMinutes(date.getUTCMinutes() + diff);\r\n // solves issues if newe time falls back to old time zone\r\n if (date.getTimezoneOffset() != newTimeZoneOffset) {\r\n date.setUTCMinutes(date.getUTCMinutes() - diff);\r\n }\r\n }\r\n }\r\n }\r\n return date;\r\n}\r\n/**\r\n * \"Rounds\" the date to specific time unit.\r\n *\r\n * @ignore Exclude from docs\r\n * @param date Source date\r\n * @param unit Time unit\r\n * @param count Number of units to round to\r\n * @param firstDateOfWeek First day of week\r\n * @param roundMinutes Minutes to round to (some timezones use non-whole hour)\r\n * @param timezone Use specific named timezone when rounding\r\n * @return New date\r\n */\r\nexport function round(date, unit, count, firstDateOfWeek, utc, firstDate, roundMinutes, timezone) {\r\n if (roundMinutes === void 0) { roundMinutes = 0; }\r\n if (!$type.isNumber(count)) {\r\n count = 1;\r\n }\r\n var timeZoneOffset = 0;\r\n if (timezone && [\"day\", \"month\", \"week\", \"year\"].indexOf(unit) != -1) {\r\n date = setTimezone(date, timezone);\r\n }\r\n if (!utc && unit != \"millisecond\") {\r\n timeZoneOffset = date.getTimezoneOffset();\r\n date.setUTCMinutes(date.getUTCMinutes() - timeZoneOffset);\r\n }\r\n switch (unit) {\r\n case \"day\":\r\n var day = date.getUTCDate();\r\n if (count > 1) {\r\n //\tday = Math.floor(day / count) * count;\r\n if (firstDate) {\r\n firstDate = round(firstDate, \"day\", 1);\r\n var difference = date.getTime() - firstDate.getTime();\r\n var unitCount = Math.floor(difference / getDuration(\"day\") / count);\r\n var duration = getDuration(\"day\", unitCount * count);\r\n date.setTime(firstDate.getTime() + duration - timeZoneOffset * getDuration(\"minute\"));\r\n }\r\n }\r\n else {\r\n date.setUTCDate(day);\r\n }\r\n date.setUTCHours(0, 0, 0, 0);\r\n break;\r\n case \"second\":\r\n var seconds = date.getUTCSeconds();\r\n if (count > 1) {\r\n seconds = Math.floor(seconds / count) * count;\r\n }\r\n date.setUTCSeconds(seconds, 0);\r\n break;\r\n case \"millisecond\":\r\n if (count == 1) {\r\n return date; // much better for perf!\r\n }\r\n var milliseconds = date.getUTCMilliseconds();\r\n milliseconds = Math.floor(milliseconds / count) * count;\r\n date.setUTCMilliseconds(milliseconds);\r\n break;\r\n case \"hour\":\r\n var hours = date.getUTCHours();\r\n if (count > 1) {\r\n hours = Math.floor(hours / count) * count;\r\n }\r\n date.setUTCHours(hours, roundMinutes, 0, 0);\r\n break;\r\n case \"minute\":\r\n var minutes = date.getUTCMinutes();\r\n milliseconds = date.getUTCMilliseconds();\r\n if (count > 1) {\r\n minutes = Math.floor(minutes / count) * count;\r\n }\r\n date.setUTCMinutes(minutes, 0, 0);\r\n break;\r\n case \"month\":\r\n var month = date.getUTCMonth();\r\n if (count > 1) {\r\n month = Math.floor(month / count) * count;\r\n }\r\n date.setUTCMonth(month, 1);\r\n date.setUTCHours(0, roundMinutes, 0, 0);\r\n break;\r\n case \"year\":\r\n var year = date.getUTCFullYear();\r\n if (count > 1) {\r\n year = Math.floor(year / count) * count;\r\n }\r\n date.setUTCFullYear(year, 0, 1);\r\n date.setUTCHours(0, roundMinutes, 0, 0);\r\n //let nonUTCDateY = new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\r\n //timeZoneOffset = nonUTCDateY.getTimezoneOffset();\r\n break;\r\n case \"week\":\r\n var wday = date.getUTCDate();\r\n var weekDay = date.getUTCDay();\r\n if (!$type.isNumber(firstDateOfWeek)) {\r\n firstDateOfWeek = 1;\r\n }\r\n // todo: rounding when count is not 1\r\n if (weekDay >= firstDateOfWeek) {\r\n wday = wday - weekDay + firstDateOfWeek;\r\n }\r\n else {\r\n wday = wday - (7 + weekDay) + firstDateOfWeek;\r\n }\r\n date.setUTCDate(wday);\r\n date.setUTCHours(0, roundMinutes, 0, 0);\r\n break;\r\n }\r\n if (!utc && unit != \"millisecond\") {\r\n date.setUTCMinutes(date.getUTCMinutes() + timeZoneOffset);\r\n if (unit == \"day\" || unit == \"week\" || unit == \"month\" || unit == \"year\") {\r\n var newTimeZoneOffset = date.getTimezoneOffset();\r\n if (newTimeZoneOffset != timeZoneOffset) {\r\n var diff = newTimeZoneOffset - timeZoneOffset;\r\n date.setUTCMinutes(date.getUTCMinutes() + diff);\r\n }\r\n }\r\n }\r\n return date;\r\n}\r\n/**\r\n * Returns a new `Date` object which corresponds to the source date in a\r\n * specific timezone.\r\n *\r\n * @since 4.10.1\r\n * @param date Source date\r\n * @param timezone Timezone identifier\r\n * @return Recalculated new Date\r\n */\r\nexport function setTimezone(date, timezone) {\r\n var d = new Date(date.toLocaleString(\"en-US\", { timeZone: timezone }));\r\n return d;\r\n}\r\n/**\r\n * Returns minute fraction of the set timezone.\r\n *\r\n * @since 4.10.12\r\n * @param timezone Timezone identifier\r\n * @return Minutes\r\n */\r\nexport function getTimezoneMinutes(timezone) {\r\n var d = new Date();\r\n d.setHours(0, 0, 0, 0);\r\n var d2 = setTimezone(d, timezone);\r\n return d2.getMinutes();\r\n}\r\n//# sourceMappingURL=Time.js.map","/**\r\n * Interaction manages all aspects of user interaction - mouse move,\r\n * click, hover, drag events, touch gestures.\r\n *\r\n * [[InteractionObject]] elements that want to use certain events, must attach event\r\n * listeners to Interaction instance.\r\n *\r\n * Interaction itself will not modify [[InteractionObject]] elements, it will be up to\r\n * those elements to handle interaction information received via event triggers.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObjectEvents } from \"../Base\";\r\nimport { List } from \"../utils/List\";\r\nimport { Animation } from \"../utils/Animation\";\r\nimport { MultiDisposer } from \"../utils/Disposer\";\r\nimport { InteractionObject } from \"./InteractionObject\";\r\nimport { InteractionKeyboardObject } from \"./InteractionKeyboardObject\";\r\nimport { Dictionary } from \"../utils/Dictionary\";\r\nimport { Inertia } from \"./Inertia\";\r\nimport { addEventListener } from \"../utils/DOM\";\r\nimport { keyboard } from \"../utils/Keyboard\";\r\nimport { system } from \"./../System\";\r\nimport { options } from \"./../Options\";\r\nimport * as $ease from \"../utils/Ease\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $array from \"../utils/Array\";\r\nimport * as $dom from \"../utils/DOM\";\r\nimport * as $iter from \"../utils/Iterator\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $time from \"../utils/Time\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n* Interaction manages all aspects of user interaction - mouse move,\r\n* click, hover, drag events, touch gestures.\r\n*\r\n* [[InteractionObject]] elements that want to use certain events, must attach event\r\n* listeners to Interaction instance.\r\n*\r\n* Interaction itself will not modify [[InteractionObject]] elements, it will be up to\r\n* those elements to handle interaction information received via event triggers.\r\n*\r\n* @see {@link IInteractionEvents} for a list of available events\r\n*/\r\nvar Interaction = /** @class */ (function (_super) {\r\n __extends(Interaction, _super);\r\n /**\r\n * Constructor. Sets up universal document-wide move events to handle stuff\r\n * outside particular chart container.\r\n */\r\n function Interaction() {\r\n var _this = \r\n // Call super\r\n _super.call(this) || this;\r\n /**\r\n * An indicator of global events were already initialized.\r\n */\r\n _this._globalEventsAdded = false;\r\n /**\r\n * Holds which mouse event listeners to use.\r\n */\r\n _this._pointerEvents = {\r\n \"pointerdown\": \"mousedown\",\r\n \"pointerup\": \"mouseup\",\r\n \"pointermove\": \"mousemove\",\r\n \"pointercancel\": \"mouseup\",\r\n \"pointerover\": \"mouseover\",\r\n \"pointerout\": \"mouseout\",\r\n \"wheel\": \"wheel\"\r\n };\r\n /**\r\n * Indicates if Interaction should use only \"pointer\" type events, like\r\n * \"pointermove\", available in all modern browsers, ignoring \"legacy\"\r\n * events, like \"touchmove\".\r\n */\r\n _this._usePointerEventsOnly = false;\r\n /**\r\n * Use only touch events (for touch only devices such as tablets and phones)\r\n */\r\n _this._useTouchEventsOnly = false;\r\n /**\r\n * Add special hover events. Normally, touch device tap will also simulate\r\n * hover event. On some devices (ahem iOS) we want to prevent that so that\r\n * over/out events are not duplicated.\r\n */\r\n _this._addHoverEvents = true;\r\n /**\r\n * Indicates if passive mode options is supported by this browser.\r\n */\r\n _this._passiveSupported = false;\r\n /**\r\n * Holds list of delayed events\r\n */\r\n _this._delayedEvents = { out: [] };\r\n /**\r\n * List of objects that current have a pointer hovered over them.\r\n */\r\n _this.overObjects = new List();\r\n /**\r\n * List of objects that currently has a pressed pointer.\r\n */\r\n _this.downObjects = new List();\r\n /**\r\n * List of objects that need mouse position to be reported to them.\r\n */\r\n _this.trackedObjects = new List();\r\n /**\r\n * List of objects that are currently being dragged.\r\n */\r\n _this.transformedObjects = new List();\r\n /**\r\n * Holds all known pointers.\r\n */\r\n _this.pointers = new Dictionary();\r\n /**\r\n * Inertia options that need to be applied to after element drag, if it's\r\n * `inert = true`.\r\n *\r\n * This is just a default, which can and probably will be overridden by\r\n * actual elements.\r\n */\r\n _this.inertiaOptions = new Dictionary();\r\n /**\r\n * Default options for click events. These can be overridden in\r\n * [[InteractionObject]].\r\n */\r\n _this.hitOptions = {\r\n \"doubleHitTime\": 300,\r\n //\"delayFirstHit\": false,\r\n \"hitTolerance\": 10,\r\n \"noFocus\": true\r\n };\r\n /**\r\n * Default options for hover events. These can be overridden in\r\n * [[InteractionObject]].\r\n */\r\n _this.hoverOptions = {\r\n \"touchOutBehavior\": \"leave\",\r\n \"touchOutDelay\": 1000\r\n };\r\n /**\r\n * Default options for detecting a swipe gesture. These can be overridden in\r\n * [[InteractionObject]].\r\n */\r\n _this.swipeOptions = {\r\n \"time\": 500,\r\n \"verticalThreshold\": 75,\r\n \"horizontalThreshold\": 30\r\n };\r\n /**\r\n * Default options for keyboard operations. These can be overridden in\r\n * [[InteractionObject]].\r\n */\r\n _this.keyboardOptions = {\r\n \"speed\": 0.1,\r\n \"accelleration\": 1.2,\r\n \"accellerationDelay\": 2000\r\n };\r\n /**\r\n * Default options for keyboard operations. These can be overridden in\r\n * [[InteractionObject]].\r\n *\r\n * @since 4.5.14\r\n */\r\n _this.mouseOptions = {\r\n \"sensitivity\": 1\r\n };\r\n // Set class name\r\n _this.className = \"Interaction\";\r\n // Create InteractionObject for \r\n _this.body = _this.getInteraction(document.body);\r\n _this._disposers.push(_this.body);\r\n // Detect browser capabilities and determine what event listeners to use\r\n if (window.hasOwnProperty(\"PointerEvent\")) {\r\n // IE10+/Edge without touch controls enabled\r\n _this._pointerEvents.pointerdown = \"pointerdown\";\r\n _this._pointerEvents.pointerup = \"pointerup\";\r\n _this._pointerEvents.pointermove = \"pointermove\";\r\n _this._pointerEvents.pointercancel = \"pointercancel\";\r\n _this._pointerEvents.pointerover = \"pointerover\";\r\n _this._pointerEvents.pointerout = \"pointerout\";\r\n //this._usePointerEventsOnly = true;\r\n }\r\n else if (window.hasOwnProperty(\"MSPointerEvent\")) {\r\n // IE9\r\n _this._pointerEvents.pointerdown = \"MSPointerDown\";\r\n _this._pointerEvents.pointerup = \"MSPointerUp\";\r\n _this._pointerEvents.pointermove = \"MSPointerMove\";\r\n _this._pointerEvents.pointercancel = \"MSPointerUp\";\r\n _this._pointerEvents.pointerover = \"MSPointerOver\";\r\n _this._pointerEvents.pointerout = \"MSPointerOut\";\r\n //this._usePointerEventsOnly = true;\r\n }\r\n else if ((typeof matchMedia !== \"undefined\") && matchMedia('(pointer:fine)').matches) {\r\n // This is only for Safari as it does not support PointerEvent\r\n // Do nothing and let it use regular `mouse*` events\r\n // Hi Apple ;)\r\n // Additionally disable hover events for iOS devices\r\n if ('ontouchstart' in window) {\r\n _this._addHoverEvents = false;\r\n _this._useTouchEventsOnly = true;\r\n }\r\n }\r\n else if (window.navigator.userAgent.match(/MSIE /)) {\r\n // Oh looky, an MSIE that does not support PointerEvent. Hi granpa IE9!\r\n _this._usePointerEventsOnly = true;\r\n }\r\n else if (_this.fullFF()) {\r\n // Old FF, let's use regular events.\r\n // (Newer FFs would be detected by the PointerEvent availability check)\r\n _this._usePointerEventsOnly = true;\r\n }\r\n else {\r\n // Uses defaults for normal browsers\r\n // We also assume that this must be a touch device that does not have\r\n // any pointer events\r\n _this._useTouchEventsOnly = true;\r\n }\r\n // Detect if device has a mouse\r\n // This is turning out to be not reliable\r\n // @todo remove\r\n /*if (!window.navigator.msPointerEnabled && (typeof matchMedia !== \"undefined\") && !matchMedia('(pointer:fine)').matches && !this.fullFF()) {\r\n this._useTouchEventsOnly = true;\r\n }*/\r\n // Detect proper mouse wheel events\r\n if (\"onwheel\" in document.createElement(\"div\")) {\r\n // Modern browsers\r\n _this._pointerEvents.wheel = \"wheel\";\r\n }\r\n else if ($type.hasValue(document.onmousewheel)) {\r\n // Webkit and IE support at least \"mousewheel\"\r\n _this._pointerEvents.wheel = \"mousewheel\";\r\n }\r\n // Set up default inertia options\r\n _this.inertiaOptions.setKey(\"move\", {\r\n \"time\": 100,\r\n \"duration\": 500,\r\n \"factor\": 1,\r\n \"easing\": $ease.polyOut3\r\n });\r\n _this.inertiaOptions.setKey(\"resize\", {\r\n \"time\": 100,\r\n \"duration\": 500,\r\n \"factor\": 1,\r\n \"easing\": $ease.polyOut3\r\n });\r\n // Set the passive mode support\r\n _this._passiveSupported = Interaction.passiveSupported;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * This is a nasty detection for Firefox. The reason why we have is that\r\n * Firefox ESR version does not support matchMedia correctly.\r\n *\r\n * On iOS, Firefox uses different userAgent, so we don't have to detect iOS.\r\n *\r\n * @return Full Firefox?\r\n */\r\n Interaction.prototype.fullFF = function () {\r\n return (window.navigator.userAgent.match(/Firefox/)) && !(window.navigator.userAgent.match(/Android/));\r\n };\r\n Interaction.prototype.debug = function () { };\r\n /**\r\n * ==========================================================================\r\n * Processing\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Sets up global events.\r\n *\r\n * We need this so that we can track drag movement beyond chart's container.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Interaction.prototype.addGlobalEvents = function () {\r\n var _this = this;\r\n if (!this._globalEventsAdded) {\r\n if (!this._useTouchEventsOnly) {\r\n this._disposers.push(addEventListener(document, this._pointerEvents.pointerdown, function (ev) { _this.handleGlobalPointerDown(ev); }));\r\n this._disposers.push(addEventListener(document, this._pointerEvents.pointermove, function (ev) { _this.handleGlobalPointerMove(ev); }));\r\n this._disposers.push(addEventListener(document, this._pointerEvents.pointerup, function (ev) { _this.handleGlobalPointerUp(ev); }));\r\n this._disposers.push(addEventListener(document, this._pointerEvents.pointercancel, function (ev) { _this.handleGlobalPointerUp(ev, true); }));\r\n this._disposers.push(addEventListener(document, \"mouseenter\", function (ev) {\r\n if (!$type.hasValue(ev.relatedTarget) && (ev.buttons == 0 || ev.which == 0)) {\r\n _this.handleDocumentLeave(ev);\r\n }\r\n }));\r\n }\r\n // No need to duplicate events for hubrid systems that support both\r\n // pointer events and touch events. Touch events are need only for\r\n // some touch-only systems, like Mobile Safari.\r\n if (!this._usePointerEventsOnly) {\r\n this._disposers.push(addEventListener(document, \"touchstart\", function (ev) { _this.handleGlobalTouchStart(ev); }));\r\n this._disposers.push(addEventListener(document, \"touchmove\", function (ev) { _this.handleGlobalTouchMove(ev); }));\r\n this._disposers.push(addEventListener(document, \"touchend\", function (ev) { _this.handleGlobalTouchEnd(ev); }));\r\n }\r\n this._disposers.push(addEventListener(document, \"keydown\", function (ev) { _this.handleGlobalKeyDown(ev); }));\r\n this._disposers.push(addEventListener(document, \"keyup\", function (ev) { _this.handleGlobalKeyUp(ev); }));\r\n this._globalEventsAdded = true;\r\n }\r\n };\r\n /**\r\n * Sets if [[InteractionObject]] is clickable.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io [[InteractionObject]] instance\r\n */\r\n Interaction.prototype.processClickable = function (io) {\r\n // Add or remove touch events\r\n this.processTouchable(io);\r\n };\r\n /**\r\n * Sets if [[InteractionObject]] will display context menu when right-clicked.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io [[InteractionObject]] instance\r\n */\r\n Interaction.prototype.processContextMenu = function (io) {\r\n if (io.contextMenuDisabled) {\r\n if (!io.eventDisposers.hasKey(\"contextMenuDisabled\")) {\r\n io.eventDisposers.setKey(\"contextMenuDisabled\", addEventListener(io.element, \"contextmenu\", function (e) {\r\n e.preventDefault();\r\n }));\r\n }\r\n }\r\n else {\r\n if (io.eventDisposers.hasKey(\"contextMenuDisabled\")) {\r\n io.eventDisposers.getKey(\"contextMenuDisabled\").dispose();\r\n }\r\n }\r\n };\r\n /**\r\n * Sets if [[InteractionObject]] is hoverable.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io [[InteractionObject]] instance\r\n */\r\n Interaction.prototype.processHoverable = function (io) {\r\n var _this = this;\r\n if (io.hoverable || io.trackable) {\r\n // Add global events\r\n this.addGlobalEvents();\r\n // Add hover styles\r\n this.applyCursorOverStyle(io);\r\n // Add local events\r\n if (!io.eventDisposers.hasKey(\"hoverable\") && this._addHoverEvents) {\r\n io.eventDisposers.setKey(\"hoverable\", new MultiDisposer([\r\n addEventListener(io.element, this._pointerEvents.pointerout, function (e) { return _this.handlePointerOut(io, e); }),\r\n addEventListener(io.element, this._pointerEvents.pointerover, function (e) { return _this.handlePointerOver(io, e); })\r\n ]));\r\n }\r\n if (io.trackable) {\r\n //sprite.addEventListener(\"touchmove\", this.handleTouchMove, false, this);\r\n }\r\n }\r\n else {\r\n var disposer = io.eventDisposers.getKey(\"hoverable\");\r\n if (disposer != null) {\r\n disposer.dispose();\r\n io.eventDisposers.removeKey(\"hoverable\");\r\n }\r\n }\r\n // Add or remove touch events\r\n this.processTouchable(io);\r\n };\r\n /**\r\n * Sets up [[InteractionObject]] as movable. Movable can be any\r\n * transformation, e.g. drag, swipe, resize, track.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n */\r\n Interaction.prototype.processMovable = function (io) {\r\n // Add unified events\r\n if (io.draggable || io.swipeable || io.trackable || io.resizable) {\r\n // Prep the element\r\n if (!this.isGlobalElement(io) && !io.isTouchProtected) {\r\n this.prepElement(io);\r\n }\r\n // Add hover styles\r\n this.applyCursorOverStyle(io);\r\n }\r\n // Add or remove touch events\r\n this.processTouchable(io);\r\n };\r\n /**\r\n * Checks if [[InteractionObject]] is trackable and sets relative events.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n */\r\n Interaction.prototype.processTrackable = function (io) {\r\n this.processHoverable(io);\r\n this.processMovable(io);\r\n if (io.trackable) {\r\n this.trackedObjects.moveValue(io);\r\n }\r\n else {\r\n this.trackedObjects.removeValue(io);\r\n }\r\n };\r\n /**\r\n * Checks if [[InteractionObject]] is draggable.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n */\r\n Interaction.prototype.processDraggable = function (io) {\r\n this.processMovable(io);\r\n };\r\n /**\r\n * Checks if [[InteractionObject]] is swipeable and sets relative events.\r\n *\r\n * A swipe event is triggered when a horizontal drag of 75px or more (and\r\n * less than 30px vertically) occurs within 700 milliseconds. This can be\r\n * overridden in sprites [[swipeOptions]].\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n */\r\n Interaction.prototype.processSwipeable = function (io) {\r\n this.processMovable(io);\r\n };\r\n /**\r\n * Checks if [[InteractionObject]] is resizable and attaches required events\r\n * to it.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n */\r\n Interaction.prototype.processResizable = function (io) {\r\n this.processMovable(io);\r\n };\r\n /**\r\n * Checks if [[InteractionObject]] is supposed to capture mouse wheel events\r\n * and prepares it to catch those events.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n */\r\n Interaction.prototype.processWheelable = function (io) {\r\n var _this = this;\r\n if (io.wheelable) {\r\n //io.hoverable = true;\r\n if (!io.eventDisposers.hasKey(\"wheelable\")) {\r\n io.eventDisposers.setKey(\"wheelable\", new MultiDisposer([\r\n addEventListener(io.element, this._pointerEvents.wheel, function (e) { return _this.handleMouseWheel(io, e); }, this._passiveSupported ? { passive: false } : false),\r\n io.events.on(\"out\", function (e) {\r\n if (io.wheelable) {\r\n _this.unlockWheel();\r\n }\r\n }),\r\n io.events.on(\"over\", function (e) {\r\n //console.log(\"whelab over\")\r\n if (io.wheelable) {\r\n _this.lockWheel();\r\n }\r\n })\r\n ]));\r\n }\r\n }\r\n else {\r\n var disposer = io.eventDisposers.getKey(\"wheelable\");\r\n if (disposer != null) {\r\n disposer.dispose();\r\n io.eventDisposers.removeKey(\"wheelable\");\r\n }\r\n }\r\n };\r\n /**\r\n * Checks if [[InteractionObject]] is focusable. A focusable element is an\r\n * element that will be highlighted when users presses TAB key. If the\r\n * element is focusable, this function will attach relative focus/blur\r\n * events to it.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n */\r\n Interaction.prototype.processFocusable = function (io) {\r\n var _this = this;\r\n if (io.focusable === true && (io.tabindex > -1) && !this._useTouchEventsOnly) {\r\n if (!io.eventDisposers.hasKey(\"focusable\")) {\r\n io.eventDisposers.setKey(\"focusable\", new MultiDisposer([\r\n addEventListener(io.element, \"focus\", function (e) { return _this.handleFocus(io, e); }),\r\n addEventListener(io.element, \"blur\", function (e) { return _this.handleBlur(io, e); }),\r\n addEventListener(io.element, this._pointerEvents.pointerdown, function (e) { return _this.handleFocusBlur(io, e); }),\r\n addEventListener(io.element, \"touchstart\", function (e) { return _this.handleFocusBlur(io, e); }, this._passiveSupported ? { passive: false } : false)\r\n ]));\r\n }\r\n }\r\n else {\r\n var disposer = io.eventDisposers.getKey(\"focusable\");\r\n if (disposer != null) {\r\n disposer.dispose();\r\n io.eventDisposers.removeKey(\"focusable\");\r\n }\r\n }\r\n };\r\n /**\r\n * Checks if [[InteractionObject]] is \"touchable\". It means any interaction\r\n * whatsoever: mouse click, touch screen tap, swipe, drag, resize, etc.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n */\r\n Interaction.prototype.processTouchable = function (io) {\r\n var _this = this;\r\n // Add unified events\r\n if (io.clickable || io.hoverable || io.trackable || io.draggable || io.swipeable || io.resizable) {\r\n // Add global events\r\n this.addGlobalEvents();\r\n // Add local events\r\n if (!io.eventDisposers.hasKey(\"touchable\")) {\r\n if (!this._useTouchEventsOnly && !this._usePointerEventsOnly) {\r\n io.eventDisposers.setKey(\"touchable\", new MultiDisposer([\r\n addEventListener(io.element, this._pointerEvents.pointerdown, function (e) { return _this.handlePointerDown(io, e); }),\r\n addEventListener(io.element, \"touchstart\", function (e) { return _this.handleTouchDown(io, e); }, this._passiveSupported ? { passive: false } : false)\r\n ]));\r\n }\r\n else if (!this._useTouchEventsOnly) {\r\n io.eventDisposers.setKey(\"touchable\", addEventListener(io.element, this._pointerEvents.pointerdown, function (e) { return _this.handlePointerDown(io, e); }));\r\n }\r\n else if (!this._usePointerEventsOnly) {\r\n io.eventDisposers.setKey(\"touchable\", addEventListener(io.element, \"touchstart\", function (e) { return _this.handleTouchDown(io, e); }, this._passiveSupported ? { passive: false } : false));\r\n }\r\n }\r\n }\r\n else {\r\n var disposer = io.eventDisposers.getKey(\"touchable\");\r\n if (disposer != null) {\r\n disposer.dispose();\r\n io.eventDisposers.removeKey(\"touchable\");\r\n }\r\n }\r\n };\r\n /**\r\n * ==========================================================================\r\n * Non-pointer events\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Dispatches \"focus\" event when element gains focus.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleFocus = function (io, ev) {\r\n if (!io.focusable) {\r\n ev.preventDefault();\r\n return;\r\n }\r\n io.isFocused = true;\r\n if (io.events.isEnabled(\"focus\") && !system.isPaused) {\r\n var imev = {\r\n type: \"focus\",\r\n target: io,\r\n event: ev\r\n };\r\n io.events.dispatchImmediately(\"focus\", imev);\r\n }\r\n };\r\n /**\r\n * Used by regular click events to prevent focus if \"noFocus\" is set.\r\n *\r\n * This should not be called by \"focus\" handlers.\r\n *\r\n * @param io Element\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleFocusBlur = function (io, ev) {\r\n if (io.focusable !== false && this.getHitOption(io, \"noFocus\")) {\r\n io.events.once(\"focus\", function () {\r\n io.events.disableType(\"blur\");\r\n $dom.blur();\r\n if (io.sprite) {\r\n io.sprite.handleBlur();\r\n }\r\n io.events.enableType(\"blur\");\r\n });\r\n }\r\n };\r\n /**\r\n * Dispatches \"blur\" event when element loses focus.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleBlur = function (io, ev) {\r\n if (!io.focusable) {\r\n ev.preventDefault();\r\n return;\r\n }\r\n io.isFocused = false;\r\n if (io.events.isEnabled(\"blur\") && !system.isPaused) {\r\n var imev = {\r\n type: \"blur\",\r\n target: io,\r\n event: ev\r\n };\r\n io.events.dispatchImmediately(\"blur\", imev);\r\n }\r\n };\r\n /**\r\n * ==========================================================================\r\n * Global keyboard-related even handlers\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Checks if there is an item that has currently focus and that they key is\r\n * one of the directional keys. If both of the conditions are true, it\r\n * creates an object to simulate movement of dragable element with keyboard.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev An original keyboard event\r\n */\r\n Interaction.prototype.handleGlobalKeyDown = function (ev) {\r\n if (this.focusedObject) {\r\n if (keyboard.isKey(ev, \"esc\")) {\r\n // ESC removes focus\r\n $dom.blur();\r\n }\r\n else if (this.focusedObject.draggable && keyboard.isKey(ev, [\"up\", \"down\", \"left\", \"right\"])) {\r\n // Prevent scrolling of the document\r\n ev.preventDefault();\r\n // Get focused object\r\n var io = this.focusedObject;\r\n // Get particular key\r\n var disposerKey = \"interactionKeyboardObject\";\r\n // If such disposer already exists we know the event is going on so we\r\n // just move on\r\n if (io.eventDisposers.hasKey(disposerKey)) {\r\n return;\r\n }\r\n // Create a keyboard mover\r\n var ko = new InteractionKeyboardObject(io, ev);\r\n io.eventDisposers.setKey(disposerKey, ko);\r\n switch (keyboard.getEventKey(ev)) {\r\n case \"up\":\r\n ko.directionY = -1;\r\n break;\r\n case \"down\":\r\n ko.directionY = 1;\r\n break;\r\n case \"left\":\r\n ko.directionX = -1;\r\n break;\r\n case \"right\":\r\n ko.directionX = 1;\r\n break;\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Dispatches related events when the keyboard key is realeasd.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev An original keyboard event\r\n */\r\n Interaction.prototype.handleGlobalKeyUp = function (ev) {\r\n var disposerKey = \"interactionKeyboardObject\";\r\n if (this.focusedObject) {\r\n var disposer = this.focusedObject.eventDisposers.getKey(disposerKey);\r\n if (disposer != null) {\r\n // Prevent scrolling of the document\r\n ev.preventDefault();\r\n // Dispose stuff\r\n disposer.dispose();\r\n this.focusedObject.eventDisposers.removeKey(disposerKey);\r\n }\r\n // Does focused object have \"hit\" event?\r\n var sprite = this.focusedObject.sprite;\r\n if (keyboard.isKey(ev, \"enter\") && sprite) {\r\n if (sprite.events.isEnabled(\"hit\") || sprite.events.isEnabled(\"toggled\")) {\r\n this.focusedObject.dispatchImmediately(\"hit\");\r\n }\r\n else if (sprite.showTooltipOn == \"hit\") {\r\n this.focusedObject.dispatchImmediately(\"up\");\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * ==========================================================================\r\n * Global pointer-related even handlers\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Handler for a global \"pointermove\" event.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n */\r\n Interaction.prototype.handleGlobalPointerMove = function (ev) {\r\n // Get pointer\r\n var pointer = this.getPointer(ev);\r\n // Update current point position\r\n pointer.point = this.getPointerPoint(ev);\r\n // Prepare and fire global event\r\n if (this.events.isEnabled(\"track\") && !system.isPaused) {\r\n var imev = {\r\n type: \"track\",\r\n target: this,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n this.events.dispatchImmediately(\"track\", imev);\r\n }\r\n // Track\r\n this.addBreadCrumb(pointer, pointer.point);\r\n // Process further\r\n this.handleGlobalMove(pointer, ev);\r\n };\r\n /**\r\n * Handler for a global \"pointerdown\" event.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n */\r\n Interaction.prototype.handleGlobalPointerDown = function (ev) {\r\n // Remove delayed hovers\r\n this.processDelayed();\r\n // Get pointer\r\n var pointer = this.getPointer(ev);\r\n // Prepare and fire global event\r\n if (this.events.isEnabled(\"down\") && !system.isPaused) {\r\n var imev = {\r\n type: \"down\",\r\n target: this,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n this.events.dispatchImmediately(\"down\", imev);\r\n }\r\n };\r\n /**\r\n * Prevents touch action from firing.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event\r\n */\r\n Interaction.prototype.preventTouchAction = function (ev) {\r\n if (!ev.defaultPrevented) {\r\n ev.preventDefault();\r\n }\r\n };\r\n /**\r\n * Handler for a global \"pointerup\" event.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n */\r\n Interaction.prototype.handleGlobalPointerUp = function (ev, cancelled) {\r\n if (cancelled === void 0) { cancelled = false; }\r\n // Get pointer\r\n var pointer = this.getPointer(ev);\r\n // Prepare and fire global event\r\n if (this.events.isEnabled(\"up\") && !system.isPaused) {\r\n var imev = {\r\n type: \"up\",\r\n target: this,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n this.events.dispatchImmediately(\"up\", imev);\r\n }\r\n // Process further\r\n this.handleGlobalUp(pointer, ev, cancelled);\r\n };\r\n /**\r\n * ==========================================================================\r\n * Global touch-related even handlers\r\n * ==========================================================================\r\n */\r\n /**\r\n * Handler for a global \"touchmove\" event.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n */\r\n Interaction.prototype.handleGlobalTouchMove = function (ev) {\r\n // Process each changed touch point\r\n for (var i = 0; i < ev.changedTouches.length; i++) {\r\n // Get pointer\r\n var pointer = this.getPointer(ev.changedTouches[i]);\r\n // Update current point position\r\n pointer.point = this.getPointerPoint(ev.changedTouches[i]);\r\n // Prepare and fire global event\r\n if (this.events.isEnabled(\"track\") && !system.isPaused) {\r\n var imev = {\r\n type: \"track\",\r\n target: this,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n this.events.dispatchImmediately(\"track\", imev);\r\n }\r\n // Track\r\n this.addBreadCrumb(pointer, pointer.point);\r\n // Process further\r\n this.handleGlobalMove(pointer, ev);\r\n }\r\n };\r\n /**\r\n * Handler for a global \"touchstart\" event.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n */\r\n Interaction.prototype.handleGlobalTouchStart = function (ev) {\r\n // Remove delayed hovers\r\n this.processDelayed();\r\n // Process each changed touch point\r\n for (var i = 0; i < ev.changedTouches.length; i++) {\r\n // Get pointer\r\n var pointer = this.getPointer(ev.changedTouches[i]);\r\n // Prepare and fire global event\r\n if (!this._usePointerEventsOnly && this.events.isEnabled(\"down\") && !system.isPaused) {\r\n var imev = {\r\n type: \"down\",\r\n target: this,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n this.events.dispatchImmediately(\"down\", imev);\r\n }\r\n }\r\n };\r\n /**\r\n * Handler for a global \"touchend\" event.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n */\r\n Interaction.prototype.handleGlobalTouchEnd = function (ev) {\r\n // Process each changed touch point\r\n for (var i = 0; i < ev.changedTouches.length; i++) {\r\n // Get pointer\r\n var pointer = this.getPointer(ev.changedTouches[i]);\r\n // Prepare and fire global event\r\n if (this.events.isEnabled(\"up\") && !system.isPaused) {\r\n var imev = {\r\n type: \"up\",\r\n target: this,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n this.events.dispatchImmediately(\"up\", imev);\r\n }\r\n // Handle element-related events\r\n this.handleGlobalUp(pointer, ev);\r\n }\r\n };\r\n /**\r\n * ==========================================================================\r\n * Element-specific pointer-related even handlers\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Handles event when pointer is over [[InteractionObject]] and button is\r\n * pressed.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handlePointerDown = function (io, ev) {\r\n // Stop further propagation so we don't get multiple triggers on hybrid\r\n // devices (both mouse and touch capabilities)\r\n //ev.preventDefault();\r\n //ev.stopPropagation();\r\n //if (ev.defaultPrevented) {\r\n //}\r\n // Get pointer\r\n var pointer = this.getPointer(ev);\r\n // Ignore if it's anything but mouse's primary button\r\n if (!pointer.touch && ev.which != 1 && ev.which != 3) {\r\n return;\r\n }\r\n // Set mouse button\r\n pointer.button = ev.which;\r\n // Reset pointer\r\n this.resetPointer(pointer, ev);\r\n // Process down\r\n this.handleDown(io, pointer, ev);\r\n };\r\n /**\r\n * Handles event when [[InteractionObject]] is hovered by a mouse pointer.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handlePointerOver = function (io, ev) {\r\n // Get pointer\r\n var pointer = this.getPointer(ev);\r\n // Process down\r\n this.handleOver(io, pointer, ev);\r\n };\r\n /**\r\n * Handles event when [[InteractionObject]] loses hover from a mouse pointer.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handlePointerOut = function (io, ev) {\r\n // Get pointer\r\n var pointer = this.getPointer(ev);\r\n // Process down\r\n this.handleOut(io, pointer, ev);\r\n };\r\n /**\r\n * Handles event when mouse wheel is crolled over the [[InteractionObject]].\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param ev Original event\r\n * @todo Investigate more-cross browser stuff https://developer.mozilla.org/en-US/docs/Web/Events/wheel\r\n */\r\n Interaction.prototype.handleMouseWheel = function (io, ev) {\r\n // Get pointer\r\n var pointer = this.getPointer(ev);\r\n // Update current point position\r\n pointer.point = this.getPointerPoint(ev);\r\n // Init delta values\r\n var deltaX = 0, deltaY = 0;\r\n // Set up modifier\r\n // This is needed because FireFox reports wheel deltas in \"lines\" instead\r\n // of pixels so we have to approximate pixel value\r\n var mod = 1;\r\n if (ev.deltaMode == 1) {\r\n mod = 50;\r\n }\r\n // Adjust configurable sensitivity\r\n mod *= this.getMouseOption(io, \"sensitivity\");\r\n // Calculate deltas\r\n if (ev instanceof WheelEvent) {\r\n deltaX = Math.round((-1 * ev.wheelDeltaX) || (ev.deltaX * mod));\r\n deltaY = Math.round((-1 * ev.wheelDeltaY) || (ev.deltaY * mod));\r\n }\r\n else {\r\n throw new Error(\"Invalid event type\");\r\n }\r\n // Handle the event\r\n this.handleWheel(io, pointer, deltaX, deltaY, ev);\r\n };\r\n /**\r\n * ==========================================================================\r\n * Element-specific touch-related even handlers\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Handles an event when an [[InteractionObject]] is touched on a touch\r\n * device.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleTouchDown = function (io, ev) {\r\n // Stop further propagation so we don't get multiple triggers on hybrid\r\n // devices (both mouse and touch capabilities)\r\n //this.maybePreventDefault(io, ev);\r\n //return;\r\n // Process each changed touch point\r\n for (var i = 0; i < ev.changedTouches.length; i++) {\r\n // Get pointer\r\n var pointer = this.getPointer(ev.changedTouches[i]);\r\n this.maybePreventDefault(io, ev, pointer);\r\n // Reset pointer\r\n this.resetPointer(pointer, ev.changedTouches[i]);\r\n // Process down\r\n this.handleDown(io, pointer, ev);\r\n }\r\n };\r\n /**\r\n * ==========================================================================\r\n * Universal handlers\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Handles click/tap. Checks for doublehit.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Interaction object\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleHit = function (io, pointer, ev) {\r\n // Check if this is a double-hit\r\n var now = $time.getTime();\r\n if (io.lastHit && (io.lastHit >= (now - this.getHitOption(io, \"doubleHitTime\")))) {\r\n // Yup - it's a double-hit\r\n // Cancel the hit\r\n //clearTimeout(io.lastHitPointer.hitTimeout);\r\n // If it happened too fast it probably means that hybrid device just\r\n // generated two events for the same tap\r\n if ((now - io.lastHit) < 100) {\r\n // Ignore\r\n return;\r\n }\r\n // Clear last hit\r\n io.lastHit = undefined;\r\n io.lastHitPointer = undefined;\r\n // Dispatch event\r\n if (io.events.isEnabled(\"doublehit\") && !system.isPaused) {\r\n var imev = {\r\n type: \"doublehit\",\r\n target: io,\r\n point: pointer.point,\r\n event: ev,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"doublehit\", imev);\r\n }\r\n }\r\n else {\r\n // Log last hit\r\n io.lastHit = now;\r\n io.lastHitPointer = pointer;\r\n if (pointer.button === 3) {\r\n // Execute HIT now\r\n if (io.events.isEnabled(\"rightclick\") && !system.isPaused) {\r\n var imev = {\r\n type: \"rightclick\",\r\n target: io,\r\n event: ev\r\n };\r\n io.events.dispatchImmediately(\"rightclick\", imev);\r\n }\r\n }\r\n else {\r\n if (io.events.isEnabled(\"hit\") && !system.isPaused) {\r\n var imev = {\r\n type: \"hit\",\r\n target: io,\r\n event: ev,\r\n point: pointer.point,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"hit\", imev);\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Handles pointer hovering over [[InteractionObject]].\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Interaction object\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n * @param soft Invoked by helper function\r\n */\r\n Interaction.prototype.handleOver = function (io, pointer, ev, soft) {\r\n if (soft === void 0) { soft = false; }\r\n if (!io.hoverable) {\r\n return;\r\n }\r\n var hoversPaused = false;\r\n if (this.shouldCancelHovers(pointer) && this.areTransformed() && this.moved(pointer, this.getHitOption(io, \"hitTolerance\"))) {\r\n hoversPaused = true;\r\n this.cancelAllHovers(ev);\r\n }\r\n // Remove any delayed outs\r\n this.processDelayed();\r\n // Add pointer\r\n io.overPointers.moveValue(pointer);\r\n // Check if object is not yet hovered\r\n if (!io.isRealHover) {\r\n // Set element as hovered\r\n if (!hoversPaused) {\r\n io.isHover = true;\r\n io.isRealHover = true;\r\n this.overObjects.moveValue(io);\r\n }\r\n // Generate body track event. This is needed so that if element loads\r\n // under unmoved mouse cursor, we still need all the actions that are\r\n // required to happen to kick in.\r\n this.handleTrack(this.body, pointer, ev, true);\r\n // Event\r\n if (io.events.isEnabled(\"over\") && !system.isPaused && !hoversPaused) {\r\n var imev = {\r\n type: \"over\",\r\n target: io,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"over\", imev);\r\n }\r\n }\r\n };\r\n /**\r\n * Handles when [[InteractionObject]] is no longer hovered.\r\n *\r\n * If `soft = true`, this means that method is being invoked by some other\r\n * code, not hard \"out\" function, like `handleUp` which implies we need to\r\n * run additional checks before unhovering the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Interaction object\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n * @param soft Invoked by helper function\r\n * @param force Force imediate out\r\n */\r\n Interaction.prototype.handleOut = function (io, pointer, ev, soft, force) {\r\n var _this = this;\r\n if (soft === void 0) { soft = false; }\r\n if (force === void 0) { force = false; }\r\n if (!io.hoverable) {\r\n return;\r\n }\r\n // Remove pointer\r\n io.overPointers.removeValue(pointer);\r\n // Check if element is still hovered\r\n if (io.isHover && (!io.hasDelayedOut || force)) {\r\n // Should we run additional checks?\r\n if (soft && io.overPointers.length) {\r\n // There are still pointers hovering - don't do anything else and\r\n // wait until either no over pointers are there or we get a hard out\r\n // event.\r\n return;\r\n }\r\n // Should we delay \"out\" if this is happening on a touch device?\r\n if (pointer && pointer.touch && !force && !this.old(pointer)) {\r\n // This is a touch pointer, and it hasn't moved, let's pretend\r\n // the object is still hovered, and act as per \"behavior\" setting\r\n var behavior = this.getHoverOption(io, \"touchOutBehavior\");\r\n if (behavior == \"leave\") {\r\n // Set to \"leave\", so we do not execute any \"out\" event.\r\n // It will be handled by any other interaction that happens\r\n // afterwards.\r\n this._delayedEvents.out.push({\r\n type: \"out\",\r\n io: io,\r\n pointer: pointer,\r\n event: ev,\r\n keepUntil: $time.getTime() + 500\r\n });\r\n io.hasDelayedOut = true;\r\n return;\r\n }\r\n else if (behavior == \"delay\" && this.getHoverOption(io, \"touchOutDelay\")) {\r\n this._delayedEvents.out.push({\r\n type: \"out\",\r\n io: io,\r\n pointer: pointer,\r\n event: ev,\r\n keepUntil: $time.getTime() + 500,\r\n timeout: this.setTimeout(function () {\r\n _this.handleOut(io, pointer, ev, true);\r\n }, this.getHoverOption(io, \"touchOutDelay\"))\r\n });\r\n return;\r\n }\r\n else {\r\n // Nothing for \"remove\" - that's how it works \"out-of-the-box\"\r\n }\r\n }\r\n // Set element as not hovered\r\n io.isHover = false;\r\n this.overObjects.removeValue(io);\r\n // Invoke event\r\n if (!io.isDisposed() && io.events.isEnabled(\"out\") && !system.isPaused) {\r\n var imev = {\r\n type: \"out\",\r\n target: io,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"out\", imev);\r\n }\r\n // Reset object from lefover delayed outs, pointers\r\n io.overPointers.clear();\r\n io.hasDelayedOut = false;\r\n // @todo (clean delayed)\r\n }\r\n };\r\n /**\r\n * Processes dalyed events, such as \"out\" event that was initiated for\r\n * elements by touch.\r\n */\r\n Interaction.prototype.processDelayed = function () {\r\n var delayedEvent;\r\n while (true) {\r\n delayedEvent = this._delayedEvents.out.pop();\r\n if (!delayedEvent) {\r\n break;\r\n }\r\n if (delayedEvent.timeout) {\r\n delayedEvent.timeout.dispose();\r\n }\r\n this.handleOut(delayedEvent.io, delayedEvent.pointer, delayedEvent.event, false, true);\r\n }\r\n };\r\n /**\r\n * Performs tasks on pointer down.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleDown = function (io, pointer, ev) {\r\n // Need to prevent default event from happening on transformable objects\r\n this.maybePreventDefault(io, ev, pointer);\r\n // Stop inertia animations if they're currently being played out\r\n if (io.inert) {\r\n this.stopInertia(io);\r\n }\r\n // Trigger hover because some touch devices won't trigger over events\r\n // on their own\r\n this.handleOver(io, pointer, ev, true);\r\n // Add pointer to list\r\n io.downPointers.moveValue(pointer);\r\n // Apply styles if necessary\r\n this.applyCursorDownStyle(io, pointer);\r\n // Check if object is already down\r\n if (!io.isDown) {\r\n // Lose focus if needed\r\n if (io.focusable !== false && this.getHitOption(io, \"noFocus\") && this.focusedObject) {\r\n $dom.blur();\r\n }\r\n // Set object as hovered\r\n io.isDown = true;\r\n this.downObjects.moveValue(io);\r\n // Prep object for dragging and/or resizing\r\n if (io.draggable) {\r\n this.processDragStart(io, pointer, ev);\r\n }\r\n if (io.resizable) {\r\n this.processResizeStart(io, pointer, ev);\r\n }\r\n }\r\n // Dispatch \"down\" event\r\n if (io.events.isEnabled(\"down\") && !system.isPaused) {\r\n var imev = {\r\n type: \"down\",\r\n target: io,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"down\", imev);\r\n }\r\n };\r\n /**\r\n * Performs tasks on pointer up.\r\n *\r\n * @ignore Exclude from docs\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleGlobalUp = function (pointer, ev, cancelled) {\r\n var _this = this;\r\n if (cancelled === void 0) { cancelled = false; }\r\n var sorted = this.downObjects.values.slice();\r\n sorted.sort(function (x, y) {\r\n if (x && y) {\r\n var pos = x.element.compareDocumentPosition(y.element);\r\n if (pos & Node.DOCUMENT_POSITION_CONTAINED_BY) {\r\n return 1;\r\n }\r\n else if (pos & Node.DOCUMENT_POSITION_CONTAINS) {\r\n return -1;\r\n }\r\n else {\r\n return 0;\r\n }\r\n }\r\n else {\r\n return 0;\r\n }\r\n });\r\n // Process all down objects\r\n $array.each(sorted, function (io) {\r\n // Check if this particular pointer is pressing down\r\n // on object\r\n if (io && io.downPointers.contains(pointer)) {\r\n _this.handleUp(io, pointer, ev, cancelled);\r\n }\r\n });\r\n };\r\n /**\r\n * Simulates all pointers being up once mouse leaves document area.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleDocumentLeave = function (ev) {\r\n var _this = this;\r\n // Process all down objects\r\n $iter.each(this.downObjects.backwards().iterator(), function (io) {\r\n io.downPointers.each(function (pointer) {\r\n _this.handleUp(io, pointer, ev);\r\n });\r\n });\r\n };\r\n /**\r\n * Handles when [[InteractionObject]] is no longer hovered.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Interaction object\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleUp = function (io, pointer, ev, cancelled) {\r\n if (cancelled === void 0) { cancelled = false; }\r\n // Restore cursor style\r\n this.restoreCursorDownStyle(io, pointer);\r\n // Remove pointer from the list\r\n io.downPointers.removeValue(pointer);\r\n // Trigger out because some touch devices won't trigger out events\r\n // on their own\r\n if ((pointer && pointer.touch) || this._useTouchEventsOnly) {\r\n this.handleOut(io, pointer, ev, true);\r\n }\r\n // Check if object still down\r\n if (io.isDown) {\r\n // Check if there are no other pointers hovering this element\r\n if (io.downPointers.length == 0) {\r\n // Set element as no longer down\r\n io.isDown = false;\r\n this.downObjects.removeValue(io);\r\n }\r\n // Dispatch \"up\" event\r\n if (io.events.isEnabled(\"up\") && !system.isPaused && pointer) {\r\n var imev = {\r\n type: \"up\",\r\n target: io,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"up\", imev);\r\n }\r\n // Check if this was not a cancelled event.\r\n // If event was canelled (which might happen if gesture resulted in\r\n // navigation or page scroll) there's no point in triggering hit and\r\n // other actions.\r\n if (!cancelled) {\r\n // Handle swiping-related stuff\r\n if (io.swipeable && this.swiped(io, pointer)) {\r\n // Swiped - nothing else should happen\r\n this.handleSwipe(io, pointer, ev);\r\n }\r\n else {\r\n // Check if it maybe a click\r\n if (io.clickable && !this.moved(pointer, this.getHitOption(io, \"hitTolerance\"))) {\r\n this.handleHit(io, pointer, ev);\r\n }\r\n // Handle inertia\r\n if (io.inert && this.moved(pointer, this.getHitOption(io, \"hitTolerance\"))) {\r\n this.handleInertia(io, pointer);\r\n }\r\n else if (io.draggable) {\r\n this.processDragStop(io, pointer, ev);\r\n }\r\n if (io.resizable) {\r\n this.processResizeStop(io, pointer, ev);\r\n }\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Checks if event needs to be prevented on draggable and such items, so that\r\n * touch gestures like navigation and scroll do not kick in.\r\n *\r\n * @param io Object\r\n * @param ev Event\r\n */\r\n Interaction.prototype.maybePreventDefault = function (io, ev, pointer) {\r\n if ($type.hasValue(ev)\r\n && (io.draggable || io.swipeable || io.trackable || io.resizable)\r\n && !this.isGlobalElement(io)\r\n && ev.cancelable !== false\r\n && (!io.isTouchProtected || !pointer || !pointer.touch)) {\r\n ev.preventDefault();\r\n }\r\n };\r\n /**\r\n * Cancels all hovers on all currently hovered objects.\r\n *\r\n * @param pointer Pointer\r\n * @param ev Event\r\n */\r\n Interaction.prototype.cancelAllHovers = function (ev) {\r\n var _this = this;\r\n //this.overObjects.each((io) => {\r\n $iter.each(this.overObjects.backwards().iterator(), function (io) {\r\n if (io) {\r\n var pointer = io.overPointers.getIndex(0);\r\n _this.handleOut(io, pointer, ev, true, true);\r\n }\r\n });\r\n };\r\n /**\r\n * Checks if hovers should be cancelled on transform as per global options.\r\n * @param pointer Pointer\r\n * @return Cancel?\r\n */\r\n Interaction.prototype.shouldCancelHovers = function (pointer) {\r\n return options.disableHoverOnTransform == \"always\" || (options.disableHoverOnTransform == \"touch\" && pointer.touch);\r\n };\r\n /**\r\n * Handles pointer move.\r\n *\r\n * @ignore Exclude from docs\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleGlobalMove = function (pointer, ev) {\r\n var _this = this;\r\n // Process hovered elements\r\n // We check if the element became unhovered without reporting the mouseout\r\n // event. (it happens in some cases)\r\n if (!pointer.touch) {\r\n var target_1 = $dom.eventTarget(pointer.lastEvent);\r\n $iter.each(this.overObjects.backwards().iterator(), function (io) {\r\n // Is this pointer relevant to element?\r\n if (io && io.overPointers.contains(pointer) && io.hoverable) {\r\n // Check if the element is still hovered\r\n var reset = false;\r\n if (io.element && pointer.lastEvent) {\r\n if (!$dom.contains(io.element, target_1)) {\r\n reset = true;\r\n }\r\n }\r\n else {\r\n reset = true;\r\n }\r\n if (reset) {\r\n _this.handleOut(io, pointer, ev, true);\r\n }\r\n }\r\n });\r\n }\r\n // Process down elements\r\n $iter.each(this.transformedObjects.backwards().iterator(), function (io) {\r\n // Is this pointer relevant to element?\r\n if (io.downPointers.contains(pointer) &&\r\n // Swipe still happening?\r\n !(io.swipeable && _this.swiping(io, pointer)) &&\r\n (io.draggable || io.resizable)) {\r\n _this.handleTransform(io, ev);\r\n }\r\n });\r\n // Process tracked elements\r\n $iter.each(this.trackedObjects.backwards().iterator(), function (io) {\r\n // Is this pointer relevant to element?\r\n if (!io.overPointers.contains(pointer)) {\r\n _this.handleTrack(io, pointer, ev);\r\n }\r\n });\r\n };\r\n /**\r\n * Handles reporting of pointer movement.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n * @param skipCheck Sould we skip check if cursor actually moved\r\n */\r\n Interaction.prototype.handleTrack = function (io, pointer, ev, skipCheck) {\r\n if (skipCheck === void 0) { skipCheck = false; }\r\n // Do nothing if the cursor did not actually move\r\n if (!skipCheck && !this.moved(pointer, 0)) {\r\n return;\r\n }\r\n // Initiate TRACK event\r\n if (io.events.isEnabled(\"track\") && !system.isPaused) {\r\n var imev = {\r\n type: \"track\",\r\n target: io,\r\n event: ev,\r\n point: pointer.point,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"track\", imev);\r\n }\r\n };\r\n /**\r\n * Handles swipe action.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleSwipe = function (io, pointer, ev) {\r\n // We pass in InteractionEvent with shift in mouse coordinates\r\n // between when the drag started and ended\r\n if (io.events.isEnabled(\"swipe\") && !system.isPaused) {\r\n var imev = {\r\n type: \"swipe\",\r\n target: io,\r\n event: ev,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"swipe\", imev);\r\n }\r\n if (pointer.startPoint.x < pointer.point.x) {\r\n if (io.events.isEnabled(\"swiperight\") && !system.isPaused) {\r\n var imev = {\r\n type: \"swiperight\",\r\n target: io,\r\n event: ev,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"swiperight\", imev);\r\n }\r\n }\r\n else {\r\n if (io.events.isEnabled(\"swipeleft\") && !system.isPaused) {\r\n var imev = {\r\n type: \"swipeleft\",\r\n target: io,\r\n event: ev,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"swipeleft\", imev);\r\n }\r\n }\r\n };\r\n /**\r\n * Handles event triggering for wheel rotation.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n * @param deltaX Horizontal shift\r\n * @param deltaY Vertical shift\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleWheel = function (io, pointer, deltaX, deltaY, ev) {\r\n var shift = {\r\n x: deltaX,\r\n y: deltaY\r\n };\r\n // Trigger generic WHEEL event\r\n if (io.events.isEnabled(\"wheel\") && !system.isPaused) {\r\n io.events.dispatchImmediately(\"wheel\", {\r\n type: \"wheel\",\r\n target: io,\r\n event: ev,\r\n point: pointer.point,\r\n shift: shift\r\n });\r\n }\r\n // Trigger direction-specific events\r\n // Horizontal\r\n if (deltaX < 0) {\r\n if (io.events.isEnabled(\"wheelleft\") && !system.isPaused) {\r\n io.events.dispatchImmediately(\"wheelleft\", {\r\n type: \"wheelleft\",\r\n target: io,\r\n event: ev,\r\n point: pointer.point,\r\n shift: shift\r\n });\r\n }\r\n }\r\n else if (deltaX > 0) {\r\n if (io.events.isEnabled(\"swiperight\") && !system.isPaused) {\r\n io.events.dispatchImmediately(\"wheelright\", {\r\n type: \"wheelright\",\r\n target: io,\r\n event: ev,\r\n point: pointer.point,\r\n shift: shift\r\n });\r\n }\r\n // Vertical\r\n }\r\n else if (deltaY < 0) {\r\n if (io.events.isEnabled(\"wheelup\") && !system.isPaused) {\r\n io.events.dispatchImmediately(\"wheelup\", {\r\n type: \"wheelup\",\r\n target: io,\r\n event: ev,\r\n point: pointer.point,\r\n shift: shift\r\n });\r\n }\r\n }\r\n else if (deltaY > 0) {\r\n if (io.events.isEnabled(\"wheeldown\") && !system.isPaused) {\r\n io.events.dispatchImmediately(\"wheeldown\", {\r\n type: \"wheeldown\",\r\n target: io,\r\n event: ev,\r\n point: pointer.point,\r\n shift: shift\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * Initiates inertia checking sub-routines for different movement types:\r\n * drag, resize.\r\n *\r\n * @ignore Exclude from docs\r\n * @param sprite\r\n * @param pointer\r\n */\r\n Interaction.prototype.handleInertia = function (io, pointer) {\r\n if (io.draggable && io.downPointers.length === 0) {\r\n this.handleMoveInertia(io, pointer);\r\n }\r\n if (io.resizable && io.downPointers.length > 1) {\r\n this.handleResizeInertia(io, pointer);\r\n }\r\n };\r\n /**\r\n * Continues moving the element to simulate the effect of inertia. Happens\r\n * when `inert` and `draggable` object is dragged and then released.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n */\r\n Interaction.prototype.handleMoveInertia = function (io, pointer) {\r\n var interaction = io;\r\n var type = \"move\";\r\n var point = {\r\n \"x\": pointer.point.x,\r\n \"y\": pointer.point.y\r\n };\r\n var startPoint = {\r\n \"x\": pointer.startPoint.x,\r\n \"y\": pointer.startPoint.y\r\n };\r\n // Init inertia object\r\n var inertia = new Inertia(interaction, type, point, startPoint);\r\n // Get inertia data\r\n var ref = this.getTrailPoint(pointer, $time.getTime() - this.getInertiaOption(io, \"move\", \"time\"));\r\n if (typeof ref === \"undefined\") {\r\n this.processDragStop(io, pointer, pointer.lastUpEvent);\r\n return;\r\n }\r\n // Init animation options\r\n var factor = this.getInertiaOption(io, \"move\", \"factor\");\r\n var animationOptions = [{\r\n \"to\": pointer.point.x + (pointer.point.x - ref.point.x) * factor,\r\n \"property\": \"x\"\r\n }, {\r\n \"to\": pointer.point.y + (pointer.point.y - ref.point.y) * factor,\r\n \"property\": \"y\"\r\n }];\r\n // Start animation\r\n var animation = new Animation(inertia, animationOptions, this.getInertiaOption(io, \"move\", \"duration\"), this.getInertiaOption(io, \"move\", \"easing\")).start();\r\n this._disposers.push(animation.events.on(\"animationended\", function (ev) {\r\n inertia.done();\r\n }));\r\n // Add inertia object\r\n io.inertias.setKey(\"move\", inertia);\r\n };\r\n /**\r\n * Continues resizing of a `resizable` element after it is resized and\r\n * released.\r\n *\r\n * **NOTE:** this is is just a placeholder function. No actual fucntionality\r\n * is implemented, yet.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n */\r\n Interaction.prototype.handleResizeInertia = function (io, pointer) {\r\n // Some day, folks. Some day...\r\n };\r\n /**\r\n * Recalculates element's position and size based on position of\r\n * all its related pointers.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleTransform = function (io, ev) {\r\n // Get primary pointer and its respective points\r\n var pointer1 = io.downPointers.getIndex(0);\r\n var point1 = null;\r\n var startPoint1 = null;\r\n if (pointer1) {\r\n point1 = pointer1.point;\r\n startPoint1 = pointer1.startPoint;\r\n }\r\n // Init secondary pointer\r\n var pointer2;\r\n var point2;\r\n var startPoint2;\r\n // Use center of the sprite to simulate \"second\" point of touch\r\n point2 = {\r\n \"x\": io.originalPosition.x,\r\n \"y\": io.originalPosition.y\r\n };\r\n startPoint2 = point2;\r\n // Determine if it's a sinngle pointer or multi\r\n var singlePoint = true;\r\n for (var i = 1; i < io.downPointers.length; i++) {\r\n // Get pointer\r\n var nextPointer = io.downPointers.getIndex(i);\r\n // Doublecheck if it's not the same pointer by comparing original position\r\n if (startPoint1.x != nextPointer.startPoint.x && startPoint1.y != nextPointer.startPoint.y) {\r\n // Several pointers down\r\n singlePoint = false;\r\n // Get second pointer\r\n pointer2 = nextPointer;\r\n point2 = pointer2.point;\r\n startPoint2 = pointer2.startPoint;\r\n // Stop looking\r\n break;\r\n }\r\n }\r\n // Primary touch point moved?\r\n var pointer1Moved = pointer1 && this.moved(pointer1, 0);\r\n // Report DRAG_START if necessary\r\n if (io.draggable && pointer1 && pointer1.dragStartEvents && pointer1.dragStartEvents.length && pointer1Moved) {\r\n if (io.events.isEnabled(\"dragstart\") && !system.isPaused) {\r\n io.events.dispatchImmediately(\"dragstart\", pointer1.dragStartEvents.shift());\r\n }\r\n //delete pointer1.dragStartEvents;\r\n }\r\n // Determine what we do in order of superiority\r\n if (singlePoint && io.draggable) {\r\n // We have only one pointer and the Sprite is draggable\r\n // There's nothing else to be done - just move it\r\n this.handleTransformMove(io, point1, startPoint1, ev, pointer1Moved, pointer1.touch);\r\n if (this.shouldCancelHovers(pointer1) && this.moved(pointer1, this.getHitOption(io, \"hitTolerance\"))) {\r\n this.cancelAllHovers(ev);\r\n }\r\n }\r\n else {\r\n // Check if second touch point moved\r\n var pointer2Moved = pointer2 && this.moved(pointer2, 0);\r\n if ((this.shouldCancelHovers(pointer1) && this.moved(pointer1, this.getHitOption(io, \"hitTolerance\")))\r\n ||\r\n (this.shouldCancelHovers(pointer2) && this.moved(pointer2, this.getHitOption(io, \"hitTolerance\")))) {\r\n this.cancelAllHovers(ev);\r\n }\r\n if (io.draggable && io.resizable) {\r\n //this.handleTransformAll(io, point1, startPoint1, point2, startPoint2, ev, pointer1Moved && pointer2Moved);\r\n this.handleTransformMove(io, point1, startPoint1, ev, pointer1Moved && pointer2Moved, pointer1.touch);\r\n this.handleTransformResize(io, point1, startPoint1, point2, startPoint2, ev, pointer1Moved && pointer2Moved, pointer1.touch);\r\n }\r\n else {\r\n if (io.draggable) {\r\n this.handleTransformMove(io, point1, startPoint1, ev, pointer1Moved, pointer1.touch);\r\n }\r\n if (io.resizable && (!singlePoint || ev.ctrlKey)) {\r\n this.handleTransformResize(io, point1, startPoint1, point2, startPoint2, ev, pointer1Moved && pointer2Moved, pointer1.touch);\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Handles movement of the dragged element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param point Current point of the pointer\r\n * @param startPoint Starting point of the pointer\r\n * @param ev Original event\r\n * @param pointerMoved Did pointer move?\r\n */\r\n Interaction.prototype.handleTransformMove = function (io, point, startPoint, ev, pointerMoved, touch) {\r\n if (pointerMoved) {\r\n if (io.events.isEnabled(\"drag\") && !system.isPaused && (!io.isTouchProtected || !touch)) {\r\n var imev = {\r\n type: \"drag\",\r\n target: io,\r\n event: ev,\r\n shift: {\r\n \"x\": point.x - startPoint.x,\r\n \"y\": point.y - startPoint.y\r\n },\r\n startPoint: startPoint,\r\n point: point,\r\n touch: touch\r\n };\r\n io.events.dispatchImmediately(\"drag\", imev);\r\n }\r\n }\r\n };\r\n /**\r\n * Handles resizing of the element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param point1 Current position of reference point #1\r\n * @param startPoint1 Original position of reference point #1\r\n * @param point2 Current position of reference point #2\r\n * @param startPoint2 Original position of reference point #2\r\n * @param ev Original event\r\n * @param pointerMoved Did pointer move?\r\n */\r\n Interaction.prototype.handleTransformResize = function (io, point1, startPoint1, point2, startPoint2, ev, pointerMoved, touch) {\r\n if (io.events.isEnabled(\"resize\") && !system.isPaused && (!io.isTouchProtected || !touch)) {\r\n var imev = {\r\n type: \"resize\",\r\n target: io,\r\n event: ev,\r\n scale: $math.getScale(point1, startPoint1, point2, startPoint2),\r\n startPoint1: startPoint1,\r\n point1: point1,\r\n startPoint2: startPoint2,\r\n point2: point2,\r\n touch: touch\r\n };\r\n io.events.dispatchImmediately(\"resize\", imev);\r\n }\r\n };\r\n /**\r\n * Handles all the preparations of the element when it starts to be dragged.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.processDragStart = function (io, pointer, ev) {\r\n // Add to draggedObjects\r\n this.transformedObjects.moveValue(io);\r\n if (this.shouldCancelHovers(pointer)) {\r\n this.cancelAllHovers(ev);\r\n }\r\n // Report \"dragstart\"\r\n var imev = {\r\n type: \"dragstart\",\r\n target: io,\r\n event: ev,\r\n touch: pointer ? pointer.touch : false\r\n };\r\n // Log object that we are starting to drag, so we can check against and\r\n // avoid hovers on other objects that might be in the path of movement.\r\n if (pointer) {\r\n pointer.dragTarget = io;\r\n //pointer.startPoint = pointer.point;\r\n }\r\n /**\r\n * If pointer is set we will not fire the event until the pointer has\r\n * actually moved. If it's not set we don't have to wait for anything, so we\r\n * just fire off the event right away.\r\n */\r\n if (pointer && pointer.dragStartEvents) {\r\n pointer.dragStartEvents.push(imev);\r\n }\r\n else {\r\n if (!system.isPaused) {\r\n io.dispatchImmediately(\"dragstart\", imev);\r\n }\r\n }\r\n };\r\n /**\r\n * Finishes up element drag operation.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.processDragStop = function (io, pointer, ev) {\r\n // Pointer set?\r\n if (!pointer) {\r\n pointer = this.getDragPointer(io);\r\n }\r\n // Unset drag object\r\n if (pointer) {\r\n pointer.dragTarget = undefined;\r\n }\r\n // Removed from transformedObjects\r\n this.transformedObjects.removeValue(io);\r\n // Unlock document\r\n //this.unlockDocument();\r\n // Report dragstop\r\n if (!pointer || this.moved(pointer, 0)) {\r\n if (io.events.isEnabled(\"dragstop\") && !system.isPaused) {\r\n var imev = {\r\n type: \"dragstop\",\r\n target: io,\r\n touch: pointer ? pointer.touch : false\r\n };\r\n io.events.dispatchImmediately(\"dragstop\", imev);\r\n }\r\n }\r\n };\r\n /**\r\n * Handles all the preparations of the element when it starts to be resized.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.processResizeStart = function (io, pointer, ev) {\r\n // Add to draggedObjects\r\n this.transformedObjects.moveValue(io);\r\n };\r\n /**\r\n * Finishes up element drag operation.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.processResizeStop = function (io, pointer, ev) {\r\n // Removed from transformedObjects\r\n this.transformedObjects.removeValue(io);\r\n };\r\n /**\r\n * ==========================================================================\r\n * Controls for InteractionObjects initiating directly\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Manually triggers drag start on the element. Could be useful in cases\r\n * where tracking or dragging one element can also influence dragging another\r\n * element.\r\n *\r\n * Passing in `pointer` reference is advisable. If not passed in it will try\r\n * to determine which pointer to attach to. However, it's better to specify\r\n * it explicitly.\r\n *\r\n * @param io Element\r\n * @param pointer Pointer\r\n */\r\n Interaction.prototype.dragStart = function (io, pointer) {\r\n if (!pointer) {\r\n pointer = this.getDragPointer(io);\r\n }\r\n if (pointer) {\r\n this.handleDown(io, pointer, pointer.lastDownEvent);\r\n }\r\n };\r\n /**\r\n * Manually ends drag on the element.\r\n *\r\n * @param io Element\r\n * @param pointer Pointer\r\n */\r\n Interaction.prototype.dragStop = function (io, pointer, cancelled) {\r\n if (!pointer) {\r\n pointer = this.getDragPointer(io);\r\n }\r\n if (pointer && !cancelled) {\r\n this.handleGlobalUp(pointer, pointer.lastUpEvent, cancelled);\r\n }\r\n };\r\n /**\r\n * This method uses a fuzzy logic to find the pointer to be used for dragging.\r\n * Beware that this is not a rock-solid solution. If there are a few objects\r\n * being dragged at the same time, you may get unexepected results.\r\n *\r\n * @param io InteractionObject to get pointers from\r\n * @return Pointer currently being used for dragging\r\n */\r\n Interaction.prototype.getDragPointer = function (io) {\r\n if (io) {\r\n // InteractionObject is supplied\r\n // Use it's first down pointer\r\n return io.downPointers.getIndex(0);\r\n }\r\n else if (this.transformedObjects.length) {\r\n // Use first dragged object\r\n return this.getDragPointer(this.transformedObjects.getIndex(0));\r\n }\r\n else {\r\n return undefined;\r\n }\r\n };\r\n /**\r\n * ==========================================================================\r\n * Utils\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns pointer id for the given event object.\r\n *\r\n * @param ev Event\r\n * @return Pointer ID\r\n */\r\n Interaction.prototype.getPointerId = function (ev) {\r\n var id = \"\";\r\n if ($type.hasValue(ev.identifier)) {\r\n id = \"\" + ev.identifier;\r\n }\r\n else if ($type.hasValue(ev.pointerId)) {\r\n id = \"\" + ev.pointerId;\r\n }\r\n else {\r\n id = \"m\";\r\n }\r\n return id.replace(\"-\", \"\");\r\n };\r\n /**\r\n * Returns a cursor position of the event.\r\n *\r\n * @param ev Original event\r\n * @return Event point\r\n */\r\n Interaction.prototype.getPointerPoint = function (ev) {\r\n return {\r\n \"x\": ev.clientX,\r\n \"y\": ev.clientY\r\n };\r\n };\r\n /**\r\n * Returns [[Pointer]] object that is associated with the Event.\r\n *\r\n * If no such [[Pointer]] object exists, it is created.\r\n *\r\n * @param ev Event\r\n * @return Pointer\r\n */\r\n Interaction.prototype.getPointer = function (ev) {\r\n // Get pointer id\r\n var id = this.getPointerId(ev);\r\n // Get current coordinates\r\n var point = this.getPointerPoint(ev);\r\n // Look for the pointer in the Dictionary if it maybe already exists\r\n var pointer;\r\n if (this.pointers.hasKey(id)) {\r\n // We already have such pointer\r\n pointer = this.pointers.getKey(id);\r\n // We need this, because Edge reuses pointer ids across touch and mouse\r\n pointer.touch = this.isPointerTouch(ev);\r\n // Reset pointer\r\n //pointer.point = point;\r\n }\r\n else {\r\n // Init pointer\r\n pointer = {\r\n \"id\": id,\r\n //\"touch\": !(ev instanceof MouseEvent) || ((ev).pointerType && (ev).pointerType != \"pointer\"),\r\n //\"touch\": !(ev instanceof MouseEvent) || ((ev).pointerType && (ev).pointerType != \"mouse\"),\r\n \"touch\": this.isPointerTouch(ev),\r\n \"startPoint\": point,\r\n \"startTime\": $time.getTime(),\r\n \"point\": point,\r\n \"track\": [],\r\n \"swipeCanceled\": false,\r\n \"dragStartEvents\": []\r\n };\r\n // Add first breadcrumb\r\n this.addBreadCrumb(pointer, point);\r\n // Add for re-use later\r\n this.pointers.setKey(id, pointer);\r\n }\r\n // Log last event\r\n pointer.lastEvent = ev;\r\n this.lastPointer = pointer;\r\n return pointer;\r\n };\r\n /**\r\n * Determines if pointer event originated from a touch pointer or mouse.\r\n *\r\n * @param ev Original event\r\n * @return Touch pointer?\r\n */\r\n Interaction.prototype.isPointerTouch = function (ev) {\r\n if (typeof Touch !== \"undefined\" && ev instanceof Touch) {\r\n return true;\r\n }\r\n else if (typeof PointerEvent !== \"undefined\" && ev instanceof PointerEvent && $type.hasValue(ev.pointerType)) {\r\n switch (ev.pointerType) {\r\n case \"touch\":\r\n case \"pen\":\r\n case 2:\r\n return true;\r\n case \"mouse\":\r\n case 4:\r\n return false;\r\n default:\r\n return !(ev instanceof MouseEvent);\r\n }\r\n }\r\n else if ($type.hasValue(ev.type)) {\r\n if (ev.type.match(/^mouse/)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n /**\r\n * Resets the poiner to original state, i.e. cleans movement information,\r\n * starting point, etc.\r\n *\r\n * @param pointer Pointer\r\n */\r\n Interaction.prototype.resetPointer = function (pointer, ev) {\r\n // Get current coordinates\r\n var point = this.getPointerPoint(ev);\r\n ;\r\n pointer.startTime = $time.getTime();\r\n pointer.startPoint = { x: point.x, y: point.y };\r\n pointer.point = { x: point.x, y: point.y };\r\n pointer.track = [];\r\n pointer.swipeCanceled = false;\r\n //clearTimeout(pointer.swipeTimeout);\r\n //clearTimeout(pointer.holdTimeout);\r\n };\r\n /**\r\n * Adds a \"breadcrumb\" point to the [[Pointer]] to log its movement path.\r\n *\r\n * @param pointer Pointer\r\n * @param point Point coordinates\r\n */\r\n Interaction.prototype.addBreadCrumb = function (pointer, point) {\r\n pointer.track.push({\r\n \"timestamp\": $time.getTime(),\r\n \"point\": point\r\n });\r\n };\r\n /**\r\n * Prepares the document for various touch-related operations.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Interaction.prototype.lockDocument = function () {\r\n this.prepElement(this.body);\r\n };\r\n /**\r\n * Restores document functionality.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Interaction.prototype.unlockDocument = function () {\r\n if (this.transformedObjects.length == 0) {\r\n this.restoreAllStyles(this.body);\r\n }\r\n };\r\n /**\r\n * Lock element (disable all touch)\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Interaction.prototype.lockElement = function (io) {\r\n this.prepElement(io);\r\n };\r\n /**\r\n * Restores element's functionality.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Interaction.prototype.unlockElement = function (io) {\r\n this.restoreAllStyles(io);\r\n };\r\n /**\r\n * Locks document's wheel scroll.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Interaction.prototype.lockWheel = function () {\r\n window.addEventListener(this._pointerEvents.wheel, this.wheelLockEvent, this._passiveSupported ? { passive: false } : false);\r\n };\r\n /**\r\n * Unlocks document's wheel scroll.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Interaction.prototype.unlockWheel = function () {\r\n window.removeEventListener(this._pointerEvents.wheel, this.wheelLockEvent);\r\n };\r\n /**\r\n * Checks if top element at pointer's position belongs to the SVG.\r\n *\r\n * @ignore Exlude from docs\r\n * @param pointer Pointer\r\n * @param svg The element\r\n * @param id A unique identifier of the object that is checking for locality\r\n * @return Belongs to SVG\r\n */\r\n Interaction.prototype.isLocalElement = function (pointer, svg, id) {\r\n var cached = this.getCache(\"local_pointer_\" + pointer.id);\r\n if ($type.hasValue(cached)) {\r\n return cached;\r\n }\r\n var doc = ($dom.getRoot(svg) || document);\r\n if (doc.elementFromPoint) {\r\n var target = doc.elementFromPoint(pointer.point.x, pointer.point.y);\r\n var local = target && $dom.contains(svg, target);\r\n this.setCache(\"local_pointer_\" + pointer.id + \"_\" + id, local, 100);\r\n return local;\r\n }\r\n return false;\r\n };\r\n /**\r\n * A function that cancels mouse wheel scroll.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n * @return Returns `false` to cancel\r\n */\r\n Interaction.prototype.wheelLockEvent = function (ev) {\r\n ev.preventDefault();\r\n return false;\r\n };\r\n /**\r\n * Applies a set of styles to an element. Stores the original styles so they\r\n * can be restored later.\r\n *\r\n * @ignore\r\n * @param io Element\r\n */\r\n Interaction.prototype.prepElement = function (io) {\r\n var el = io.element;\r\n if (el) {\r\n // Define possible props\r\n var props = [\r\n \"touchAction\", \"webkitTouchAction\", \"MozTouchAction\", \"MSTouchAction\", \"msTouchAction\", \"oTouchAction\",\r\n \"userSelect\", \"webkitUserSelect\", \"MozUserSelect\", \"MSUserSelect\", \"msUserSelect\", \"oUserSelect\",\r\n \"touchSelect\", \"webkitTouchSelect\", \"MozTouchSelect\", \"MSTouchSelect\", \"msTouchSelect\", \"oTouchSelect\",\r\n \"touchCallout\", \"webkitTouchCallout\", \"MozTouchCallout\", \"MSTouchCallout\", \"msTouchCallout\", \"oTouchCallout\",\r\n \"contentZooming\", \"webkitContentZooming\", \"MozContentZooming\", \"MSContentZooming\", \"msContentZooming\", \"oContentZooming\",\r\n \"userDrag\", \"webkitUserDrag\", \"MozUserDrag\", \"MSUserDrag\", \"msUserDrag\", \"oUserDrag\"\r\n ];\r\n for (var i = 0; i < props.length; i++) {\r\n if (props[i] in el.style) {\r\n this.setTemporaryStyle(io, props[i], \"none\");\r\n }\r\n }\r\n // Remove iOS-specific selection;\r\n this.setTemporaryStyle(io, \"tapHighlightColor\", \"rgba(0, 0, 0, 0)\");\r\n //this.setTemporaryStyle(io, \"webkitOverflowScrolling\", \"none\");\r\n }\r\n };\r\n /**\r\n * Restores replaced styles\r\n *\r\n * @ignore\r\n * @param io Element\r\n */\r\n Interaction.prototype.unprepElement = function (io) {\r\n var el = io.element;\r\n if (el) {\r\n // Define possible props\r\n var props = [\r\n \"touchAction\", \"webkitTouchAction\", \"MozTouchAction\", \"MSTouchAction\", \"msTouchAction\", \"oTouchAction\",\r\n \"userSelect\", \"webkitUserSelect\", \"MozUserSelect\", \"MSUserSelect\", \"msUserSelect\", \"oUserSelect\",\r\n \"touchSelect\", \"webkitTouchSelect\", \"MozTouchSelect\", \"MSTouchSelect\", \"msTouchSelect\", \"oTouchSelect\",\r\n \"touchCallout\", \"webkitTouchCallout\", \"MozTouchCallout\", \"MSTouchCallout\", \"msTouchCallout\", \"oTouchCallout\",\r\n \"contentZooming\", \"webkitContentZooming\", \"MozContentZooming\", \"MSContentZooming\", \"msContentZooming\", \"oContentZooming\",\r\n \"userDrag\", \"webkitUserDrag\", \"MozUserDrag\", \"MSUserDrag\", \"msUserDrag\", \"oUserDrag\"\r\n ];\r\n for (var i = 0; i < props.length; i++) {\r\n if (props[i] in el.style) {\r\n this.restoreStyle(io, props[i]);\r\n }\r\n }\r\n // Remove iOS-specific selection;\r\n this.restoreStyle(io, \"tapHighlightColor\");\r\n //this.restoreStyle(io, \"webkitOverflowScrolling\");\r\n }\r\n };\r\n /**\r\n * Returns an option associated with hit events.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param option Option key\r\n * @return Option value\r\n */\r\n Interaction.prototype.getHitOption = function (io, option) {\r\n var res = io.hitOptions[option];\r\n if (typeof res === \"undefined\") {\r\n res = this.hitOptions[option];\r\n }\r\n return res;\r\n };\r\n /**\r\n * Returns an option associated with hover events.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param option Option key\r\n * @return Option value\r\n */\r\n Interaction.prototype.getHoverOption = function (io, option) {\r\n var res = io.hoverOptions[option];\r\n if (typeof res === \"undefined\") {\r\n res = this.hoverOptions[option];\r\n }\r\n return res;\r\n };\r\n /**\r\n * Returns an option associated with swipe events.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param option Option key\r\n * @return Option value\r\n */\r\n Interaction.prototype.getSwipeOption = function (io, option) {\r\n var res = io.swipeOptions[option];\r\n if (typeof res === \"undefined\") {\r\n res = this.swipeOptions[option];\r\n }\r\n return res;\r\n };\r\n /**\r\n * Returns an option for keyboard.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param option Option key\r\n * @return Option value\r\n */\r\n Interaction.prototype.getKeyboardOption = function (io, option) {\r\n var res = io.keyboardOptions[option];\r\n if (typeof res === \"undefined\") {\r\n res = this.keyboardOptions[option];\r\n }\r\n return res;\r\n };\r\n /**\r\n * Returns an option for mouse.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param option Option key\r\n * @return Option value\r\n */\r\n Interaction.prototype.getMouseOption = function (io, option) {\r\n var res = io.mouseOptions[option];\r\n if (typeof res === \"undefined\") {\r\n res = this.mouseOptions[option];\r\n }\r\n return res;\r\n };\r\n /**\r\n * Returns an option associated with inertia.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param type Inertia type\r\n * @param option Option key\r\n * @return Option value\r\n */\r\n Interaction.prototype.getInertiaOption = function (io, type, option) {\r\n var options = io.inertiaOptions.getKey(type);\r\n var res;\r\n if (options && $type.hasValue(options[option])) {\r\n res = options[option];\r\n }\r\n else {\r\n res = this.inertiaOptions.getKey(type)[option];\r\n }\r\n return res;\r\n };\r\n /**\r\n * Stops currently going on inertia. Useful if inertia is currently being\r\n * animated and the object is being interacted with.\r\n *\r\n * @param io Element\r\n */\r\n Interaction.prototype.stopInertia = function (io) {\r\n var x;\r\n var inertias = [\"move\", \"resize\"];\r\n for (var i = 0; i < inertias.length; i++) {\r\n x = inertias[i];\r\n if (io.inertias.hasKey(x)) {\r\n var inertia = io.inertias.getKey(x);\r\n if (inertia) {\r\n inertia.dispose();\r\n //io.inertiaAnimations.removeKey(x);\r\n //this.processDragStop(io);\r\n continue;\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Check if swiping is currently being performed on an object.\r\n *\r\n * @param io Element\r\n * @param pointer Pointer to check\r\n * @return `true` if swiping\r\n */\r\n Interaction.prototype.swiping = function (io, pointer) {\r\n var now = $time.getTime();\r\n if (pointer.swipeCanceled || !io.swipeable) {\r\n return false;\r\n }\r\n else if ((Math.abs(pointer.startPoint.y - pointer.point.y) < this.getSwipeOption(io, \"verticalThreshold\")) &&\r\n (pointer.startTime > (now - this.getSwipeOption(io, \"time\")))) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n };\r\n /**\r\n * Returns `true` if a successfull swipe action was performed on an element.\r\n *\r\n * @param io Element\r\n * @param pointer Pointer\r\n * @return Swiped?\r\n */\r\n Interaction.prototype.swiped = function (io, pointer) {\r\n var now = $time.getTime();\r\n if (pointer.swipeCanceled) {\r\n return false;\r\n }\r\n else if ((Math.abs(pointer.startPoint.x - pointer.point.x) > this.getSwipeOption(io, \"horizontalThreshold\")) &&\r\n (Math.abs(pointer.startPoint.y - pointer.point.y) < this.getSwipeOption(io, \"verticalThreshold\")) &&\r\n (pointer.startTime > (now - this.getSwipeOption(io, \"time\")))) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n };\r\n /**\r\n * Applies style to mouse cursor based on its stage in relation to\r\n * [[InteractionObject]].\r\n *\r\n * @ignore Exclude from docs\r\n * @param Element\r\n */\r\n Interaction.prototype.applyCursorOverStyle = function (io) {\r\n // Get sprite's cursor ooptions\r\n var options = io.cursorOptions;\r\n if (!$type.hasValue(options.overStyle)) {\r\n return;\r\n }\r\n // Apply cursor down styles\r\n for (var i = 0; i < options.overStyle.length; i++) {\r\n $dom.setStyle(io.element, options.overStyle[i].property, options.overStyle[i].value);\r\n }\r\n };\r\n /**\r\n * Applies style to mouse cursor based on its stage in relation to\r\n * [[InteractionObject]].\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n */\r\n Interaction.prototype.applyCursorDownStyle = function (io, pointer) {\r\n // Not applicable for touch pointers since they don't display a cursor\r\n if (pointer && pointer.touch) {\r\n return;\r\n }\r\n var downStyle = io.cursorOptions.downStyle;\r\n // Is down?\r\n if (io.downPointers.contains(pointer) && $type.hasValue(downStyle)) {\r\n // Apply cursor down styles\r\n for (var i = 0; i < downStyle.length; i++) {\r\n this.setTemporaryStyle(this.body, downStyle[i].property, downStyle[i].value);\r\n this.setTemporaryStyle(io, downStyle[i].property, downStyle[i].value);\r\n }\r\n }\r\n };\r\n /**\r\n * Restores original cursor style for the element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n */\r\n Interaction.prototype.restoreCursorDownStyle = function (io, pointer) {\r\n // Not applicable for touch pointers since they don't display a cursor\r\n if (pointer && pointer.touch) {\r\n return;\r\n }\r\n var downStyle = io.cursorOptions.downStyle;\r\n // Is down?\r\n if (io.downPointers.contains(pointer) && $type.hasValue(downStyle)) {\r\n // Apply cursor down styles\r\n for (var i = 0; i < downStyle.length; i++) {\r\n this.restoreStyle(this.body, downStyle[i].property);\r\n this.restoreStyle(io, downStyle[i].property);\r\n }\r\n }\r\n };\r\n /**\r\n * Sets style on the body of the document.\r\n *\r\n * @ignore Exclude from docs\r\n * @param style Style definitions\r\n */\r\n Interaction.prototype.setGlobalStyle = function (style) {\r\n var body = getInteraction().body;\r\n var styles = ($type.isArray(style) ? style : [style]);\r\n for (var i = 0; i < styles.length; i++) {\r\n this.setTemporaryStyle(body, styles[i].property, styles[i].value);\r\n }\r\n };\r\n /**\r\n * Restores style on the body of the document.\r\n *\r\n * @ignore Exclude from docs\r\n * @param style Style definitions\r\n */\r\n Interaction.prototype.restoreGlobalStyle = function (style) {\r\n var body = getInteraction().body;\r\n var styles = ($type.isArray(style) ? style : [style]);\r\n for (var i = 0; i < styles.length; i++) {\r\n this.restoreStyle(body, styles[i].property);\r\n }\r\n };\r\n /**\r\n * Checks if element is a non-cahrt element.\r\n *\r\n * @param io InteractionObject\r\n * @return Global element?\r\n */\r\n Interaction.prototype.isGlobalElement = function (io) {\r\n return document.body === io.element;\r\n };\r\n /**\r\n * Checks if pointer has moved since it was created.\r\n *\r\n * @param pointer Pointer\r\n * @param tolerance Tolerance in pixels\r\n * @param minTime Minimum time required for the pointer to be down to be considered moved\r\n * @return `true` if the pointer has moved\r\n */\r\n Interaction.prototype.moved = function (pointer, tolerance, minTime) {\r\n /*// If there was more time, we don't care if cursor actually moved\r\n let duration = $time.getTime() - pointer.startTime;\r\n if ($type.hasValue(minTime) && (minTime > duration)) {\r\n return false;\r\n }*/\r\n if (minTime === void 0) { minTime = 300; }\r\n // That was quick measure shift\r\n var shift = this.getShift(pointer);\r\n return (Math.abs(shift.x) > tolerance) || (Math.abs(shift.y) > tolerance);\r\n };\r\n /**\r\n * Returns if pointer is \"old\", meaning it has been pressing for more than\r\n * X milliseconds.\r\n *\r\n * @ignore\r\n * @param pointer Pointer\r\n * @param minTime Minimum time to consider pointer old\r\n * @return {boolean}\r\n */\r\n Interaction.prototype.old = function (pointer, minTime) {\r\n if (minTime === void 0) { minTime = 300; }\r\n return $time.getTime() - pointer.startTime > minTime;\r\n };\r\n /**\r\n * Returns total a shift in pointers coordinates between its original\r\n * position and now.\r\n *\r\n * @param pointer Pointer\r\n * @return Shift in coordinates (x/y)\r\n */\r\n Interaction.prototype.getShift = function (pointer) {\r\n return {\r\n \"x\": pointer.startPoint.x - pointer.point.x,\r\n \"y\": pointer.startPoint.y - pointer.point.y\r\n };\r\n };\r\n /**\r\n * Returns a point from [[Pointer]]'s move history at a certain timetamp.\r\n *\r\n * @param pointer Pointer\r\n * @param timestamp Timestamp\r\n * @return Point\r\n */\r\n Interaction.prototype.getTrailPoint = function (pointer, timestamp) {\r\n var res;\r\n for (var i = 0; i < pointer.track.length; i++) {\r\n if (pointer.track[i].timestamp >= timestamp) {\r\n res = pointer.track[i];\r\n break;\r\n }\r\n }\r\n return res;\r\n };\r\n /**\r\n * Checks if same pointer already exists in the list.\r\n *\r\n * @param list List to check agains\r\n * @param pointer Pointer\r\n * @return Exists?\r\n */\r\n Interaction.prototype.pointerExists = function (list, pointer) {\r\n var exists = false;\r\n list.each(function (item) {\r\n if (item == pointer) {\r\n return;\r\n }\r\n exists = item.point.x == pointer.point.x && item.point.y == pointer.point.y;\r\n });\r\n return exists;\r\n };\r\n /**\r\n * Returns an [[InteractionObject]] representation of a DOM element.\r\n *\r\n * You can use this on any HTML or SVG element, to add interactive features\r\n * to it.\r\n *\r\n * @param element Element\r\n * @return InteractionObject\r\n */\r\n Interaction.prototype.getInteraction = function (element) {\r\n return new InteractionObject(element);\r\n };\r\n /**\r\n * Sets a style property on an element. Stores original value to be restored\r\n * later with [[restoreStyle]].\r\n *\r\n * @see {@link restoreStyle}\r\n * @param io Element\r\n * @param property Property\r\n * @param value Value\r\n */\r\n Interaction.prototype.setTemporaryStyle = function (io, property, value) {\r\n // Get element\r\n //let el = io.element.tagName == \"g\" ? io.element.parentNode : io.element;\r\n var el = io.element;\r\n // Save original property if it is set and hasn't been saved before already\r\n if ($type.hasValue(el.style[property]) && !io.replacedStyles.hasKey(property)) {\r\n io.replacedStyles.setKey(property, el.style[property]);\r\n }\r\n // Replace with the new one\r\n $dom.setStyle(el, property, value);\r\n };\r\n /**\r\n * Restores specific style on an element.\r\n *\r\n * @param io Element\r\n * @param property Style property\r\n */\r\n Interaction.prototype.restoreStyle = function (io, property) {\r\n // Reset style\r\n if (io.replacedStyles.hasKey(property)) {\r\n io.element.style[property] = io.replacedStyles.getKey(property);\r\n io.replacedStyles.removeKey(property);\r\n }\r\n else {\r\n delete io.element.style[property];\r\n }\r\n };\r\n /**\r\n * Restore temporarily reset styles on an element.\r\n *\r\n * @param io Element\r\n */\r\n Interaction.prototype.restoreAllStyles = function (io) {\r\n $iter.each(io.replacedStyles.iterator(), function (a) {\r\n var key = a[0];\r\n var value = a[1];\r\n io.element.style[key] = value;\r\n io.replacedStyles.removeKey(key);\r\n });\r\n };\r\n /**\r\n * Disposes this object and cleans up after itself.\r\n */\r\n Interaction.prototype.dispose = function () {\r\n if (!this.isDisposed()) {\r\n _super.prototype.dispose.call(this);\r\n this.restoreAllStyles(this.body);\r\n this.unlockWheel();\r\n }\r\n };\r\n // @ts-ignore Used for debugging\r\n Interaction.prototype.log = function (text, ev, io) {\r\n var show = true;\r\n if (show) {\r\n // Touchlist?\r\n if (ev.changedTouches) {\r\n for (var i = 0; i < ev.changedTouches.length; i++) {\r\n this.logTouch(text, ev.type, ev.changedTouches[i]);\r\n }\r\n return;\r\n }\r\n // Get type\r\n var type = \"\";\r\n if (ev.pointerType) {\r\n switch (ev.pointerType) {\r\n case 2:\r\n type = \"touch\";\r\n break;\r\n case 4:\r\n type = \"mouse\";\r\n break;\r\n default:\r\n type = ev.pointerType;\r\n break;\r\n }\r\n }\r\n else if (typeof TouchEvent != \"undefined\" && ev instanceof TouchEvent) {\r\n type = \"touch\";\r\n }\r\n else if (ev.type.match(/^mouse/)) {\r\n type = \"mouse\";\r\n }\r\n else {\r\n type = \"???\";\r\n }\r\n // Get ID\r\n var id = \"\";\r\n if ($type.hasValue(ev.identifier)) {\r\n id = ev.identifier;\r\n }\r\n else if ($type.hasValue(ev.pointerId)) {\r\n id = ev.pointerId;\r\n }\r\n else {\r\n id = \"???\";\r\n }\r\n if (io) {\r\n console.log(text + \" (\" + io.uid + \") \" + ev.type + \" \" + type + \" \" + id);\r\n }\r\n else {\r\n console.log(text + \" \" + ev.type + \" \" + type + \" \" + id);\r\n }\r\n }\r\n };\r\n /**\r\n * Checks whether there are currently any objects being transformed (dragged\r\n * or resized).\r\n *\r\n * If `except` is set, that object will be ignored.\r\n *\r\n * @since 4.9.3\r\n * @param except Ignore this object(s)\r\n * @return Objects are being transformed\r\n */\r\n Interaction.prototype.areTransformed = function (except) {\r\n var count = this.transformedObjects.length;\r\n if (except) {\r\n var ex = $type.isArray(except) ? except : [except];\r\n for (var i = 0; i < ex.length; i++) {\r\n if (this.transformedObjects.contains(ex[i])) {\r\n count--;\r\n }\r\n }\r\n }\r\n return count > 0;\r\n };\r\n /**\r\n * Log.\r\n */\r\n Interaction.prototype.logTouch = function (text, type, ev) {\r\n console.log(text + \" \" + type + \" \" + \"touch\" + \" \" + ev.identifier);\r\n };\r\n Object.defineProperty(Interaction, \"passiveSupported\", {\r\n /**\r\n * Indicates if passive mode options is supported by this browser.\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (this._passiveSupported == null) {\r\n // Check for passive mode support\r\n try {\r\n var options_1 = Object.defineProperty({}, \"passive\", {\r\n get: function () {\r\n _this._passiveSupported = true;\r\n }\r\n });\r\n window.addEventListener(\"test\", options_1, options_1);\r\n window.removeEventListener(\"test\", options_1, options_1);\r\n }\r\n catch (err) {\r\n this._passiveSupported = false;\r\n }\r\n }\r\n return this._passiveSupported;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Interaction;\r\n}(BaseObjectEvents));\r\nexport { Interaction };\r\nvar interaction = null;\r\n/**\r\n * Returns a single unified global instance of [[Interaction]].\r\n *\r\n * All code should use this function, rather than create their own instances\r\n * of [[Interaction]].\r\n */\r\nexport function getInteraction() {\r\n if (interaction == null) {\r\n interaction = new Interaction();\r\n }\r\n return interaction;\r\n}\r\n//# sourceMappingURL=Interaction.js.map","/**\r\n * Popup class is used to display information over chart area.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport popupCSS from \"./PopupCSS\";\r\nimport { Adapter } from \"../utils/Adapter\";\r\nimport { BaseObjectEvents } from \"../Base\";\r\nimport { getInteraction } from \"../interaction/Interaction\";\r\nimport { keyboard } from \"../utils/Keyboard\";\r\nimport { MultiDisposer } from \"../utils/Disposer\";\r\nimport { getShadowRoot } from \"../utils/DOM\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $object from \"../utils/Object\";\r\n/**\r\n * Shows an HTML popup which covers window or a chart area.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/popups-and-modals/} For examples and docs on Popups and Modals.\r\n * @todo Positioning over whole window\r\n */\r\nvar Popup = /** @class */ (function (_super) {\r\n __extends(Popup, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Popup() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Adapter.\r\n */\r\n _this.adapter = new Adapter(_this);\r\n /**\r\n * Holds references to various HTML elements, Popup consists of.\r\n */\r\n _this._elements = {};\r\n /**\r\n * Holdes Interaction objects for various Popup's elements.\r\n */\r\n _this._IOs = {};\r\n /**\r\n * Contents of popup window.\r\n */\r\n _this._content = \"\";\r\n /**\r\n * Title of the popup window.\r\n */\r\n _this._title = \"\";\r\n /**\r\n * Prefix to apply to class names for popup elements.\r\n */\r\n _this._classPrefix = \"ampopup\";\r\n /**\r\n * If set to `true` [[Popup]] will use default styles.\r\n */\r\n _this._defaultStyles = true;\r\n /**\r\n * If set to `true` [[Popup]] will dim out all chart content behind it by\r\n * showing a semi-transparent fill. (curtain)\r\n */\r\n _this._showCurtain = false;\r\n /**\r\n * Indicates whether popup can be dragged.\r\n */\r\n _this._draggable = true;\r\n /**\r\n * Horizontal position of the content window.\r\n */\r\n _this._align = \"center\";\r\n /**\r\n * Resize popup as images are being loaded.\r\n */\r\n _this._dynamicResize = true;\r\n /**\r\n * Vertical position of the content window.\r\n */\r\n _this._verticalAlign = \"middle\";\r\n /**\r\n * Shift in position of the element. (used for dragging)\r\n */\r\n _this._shift = {\r\n x: 0,\r\n y: 0\r\n };\r\n /**\r\n * Temporary shift in position of the element. (used for dragging)\r\n */\r\n _this._tempShift = {\r\n x: 0,\r\n y: 0\r\n };\r\n /**\r\n * A title for screen readers. It is very highly recommended to set that title\r\n * so that people using screen reader tools can get an immediate summary of\r\n * the information in the popup.\r\n */\r\n _this._readerTitle = \"\";\r\n /**\r\n * Is popup closable?\r\n */\r\n _this._closable = true;\r\n /**\r\n * Was CSS already loaded?\r\n */\r\n _this._cssLoaded = false;\r\n /**\r\n * If set to other than \"none\" will try to re-adjust the position of the\r\n * popop to fit within chart container or browser window.\r\n *\r\n * @ignore Feature not yet implemented\r\n * @todo Implement\r\n */\r\n _this._fitTo = \"window\";\r\n /**\r\n * Identifies if this object is a \"template\" and should not be treated as\r\n * real object that is drawn or actually used in the chart.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this.isTemplate = false;\r\n /**\r\n * Indicates if the element was already sized and should not be measured for\r\n * size again, saving some precious resources.\r\n */\r\n _this._sized = false;\r\n _this.className = \"Popup\";\r\n return _this;\r\n }\r\n /**\r\n * Shows popup window.\r\n */\r\n Popup.prototype.open = function () {\r\n if (this.container) {\r\n if (this._elements.wrapper) {\r\n this.container.appendChild(this._elements.wrapper);\r\n }\r\n if (this._elements.curtain) {\r\n this.container.appendChild(this._elements.curtain);\r\n this.showCurtain = this.showCurtain;\r\n }\r\n this.positionElement();\r\n this.dispatchImmediately(\"opened\");\r\n }\r\n };\r\n /**\r\n * Hides popup window.\r\n */\r\n Popup.prototype.close = function () {\r\n if (this._elements.wrapper) {\r\n if (this._elements.wrapper.parentElement) {\r\n this._elements.wrapper.parentElement.removeChild(this._elements.wrapper);\r\n }\r\n }\r\n if (this._elements.curtain) {\r\n if (this._elements.curtain.parentElement) {\r\n this._elements.curtain.parentElement.removeChild(this._elements.curtain);\r\n }\r\n }\r\n this.dispatchImmediately(\"closed\");\r\n this.releasePointers();\r\n };\r\n /**\r\n * Destroy (dispose) popup.\r\n */\r\n Popup.prototype.dispose = function () {\r\n this.close();\r\n _super.prototype.dispose.call(this);\r\n };\r\n /**\r\n * Positions content element in the center of popup based on its actual size.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Popup.prototype.positionElement = function (forceResize) {\r\n var _this = this;\r\n if (forceResize === void 0) { forceResize = true; }\r\n if (!this._elements.wrapper) {\r\n return;\r\n }\r\n setTimeout(function () {\r\n if (!_this._elements.wrapper) {\r\n return;\r\n }\r\n if (forceResize || !_this._sized) {\r\n _this._elements.wrapper.style.opacity = \"0.01\";\r\n _this._elements.wrapper.style.left = \"0\";\r\n _this._elements.wrapper.style.top = \"0\";\r\n _this._elements.wrapper.style.margin = \"0 0 0 0\";\r\n _this._elements.wrapper.style.width = \"\";\r\n _this._elements.wrapper.style.height = \"\";\r\n var bbox = _this._elements.wrapper.getBoundingClientRect();\r\n _this._elements.wrapper.style.width = bbox.width + \"px\";\r\n _this._elements.wrapper.style.height = bbox.height + \"px\";\r\n _this._sized = true;\r\n }\r\n // Check for any images that are not yet loaded\r\n if (_this.dynamicResize) {\r\n var images = _this._elements.wrapper.getElementsByTagName(\"img\");\r\n for (var i = 0; i < images.length; i++) {\r\n var image = images[i];\r\n if (!image.complete) {\r\n // Resize popup once again when image is loaded\r\n image.addEventListener(\"load\", function () {\r\n _this.positionElement(true);\r\n });\r\n // Do this for one image only as it will be checked again next time\r\n // anyway\r\n break;\r\n }\r\n }\r\n }\r\n setTimeout(function () {\r\n if (!_this._elements.wrapper) {\r\n return;\r\n }\r\n var bbox;\r\n if ((forceResize || !_this._sized) && _this._bbox) {\r\n bbox = _this._bbox;\r\n }\r\n else {\r\n bbox = _this._elements.wrapper.getBoundingClientRect();\r\n _this._elements.wrapper.style.opacity = \"\";\r\n }\r\n // Set horizontal positioning\r\n switch (_this.align) {\r\n case \"left\":\r\n _this._elements.wrapper.style.left = \"0\";\r\n _this._elements.wrapper.style.right = \"auto\";\r\n _this._elements.wrapper.style.marginLeft = _this.toStyle(_this._shift.x + _this._tempShift.x);\r\n break;\r\n case \"center\":\r\n _this._elements.wrapper.style.left = \"50%\";\r\n _this._elements.wrapper.style.right = \"auto\";\r\n _this._elements.wrapper.style.marginLeft = _this.toStyle(Math.round(-bbox.width / 2) + (_this._shift.x + _this._tempShift.x));\r\n break;\r\n case \"right\":\r\n _this._elements.wrapper.style.left = \"auto\";\r\n _this._elements.wrapper.style.right = \"0\";\r\n _this._elements.wrapper.style.marginLeft = _this.toStyle(_this._shift.x + _this._tempShift.x);\r\n break;\r\n default:\r\n _this._elements.wrapper.style.left = _this.toStyle(_this.left) || \"auto\";\r\n _this._elements.wrapper.style.right = _this.toStyle(_this.right) || \"auto\";\r\n _this._elements.wrapper.style.marginLeft = _this.toStyle(_this._shift.x + _this._tempShift.x);\r\n break;\r\n }\r\n // Set vertical positioning\r\n switch (_this.verticalAlign) {\r\n case \"top\":\r\n _this._elements.wrapper.style.top = \"0\";\r\n _this._elements.wrapper.style.bottom = \"auto\";\r\n _this._elements.wrapper.style.marginTop = _this.toStyle(_this._shift.y + _this._tempShift.y);\r\n break;\r\n case \"middle\":\r\n _this._elements.wrapper.style.top = \"50%\";\r\n _this._elements.wrapper.style.bottom = \"auto\";\r\n _this._elements.wrapper.style.marginTop = _this.toStyle(Math.round(-bbox.height / 2) + (_this._shift.y + _this._tempShift.y));\r\n break;\r\n case \"bottom\":\r\n _this._elements.wrapper.style.top = \"auto\";\r\n _this._elements.wrapper.style.bottom = \"0\";\r\n _this._elements.wrapper.style.marginTop = _this.toStyle(_this._shift.y + _this._tempShift.y);\r\n break;\r\n default:\r\n _this._elements.wrapper.style.top = _this.toStyle(_this.top) || \"auto\";\r\n _this._elements.wrapper.style.bottom = _this.toStyle(_this.bottom) || \"auto\";\r\n _this._elements.wrapper.style.marginTop = _this.toStyle(_this._shift.y + _this._tempShift.y);\r\n break;\r\n }\r\n }, 1);\r\n }, 1);\r\n };\r\n Popup.prototype.setupDragging = function () {\r\n var _this = this;\r\n if (this.draggable) {\r\n if (!this._IOs.header.events.has(\"drag\")) {\r\n this._IOs.header.events.on(\"drag\", function (ev) {\r\n _this._tempShift.x = ev.shift.x;\r\n _this._tempShift.y = ev.shift.y;\r\n _this.positionElement(false);\r\n });\r\n }\r\n if (!this._IOs.header.events.has(\"dragstop\")) {\r\n this._IOs.header.events.on(\"dragstop\", function (ev) {\r\n _this._shift.x += _this._tempShift.x;\r\n _this._shift.y += _this._tempShift.y;\r\n _this._tempShift.x = 0;\r\n _this._tempShift.y = 0;\r\n _this.positionElement(false);\r\n });\r\n }\r\n }\r\n else {\r\n if (this._IOs.header) {\r\n getInteraction().unprepElement(this._IOs.header);\r\n if (this._IOs.header.events.has(\"drag\")) {\r\n this._IOs.header.events.off(\"drag\");\r\n }\r\n if (this._IOs.header.events.has(\"dragstop\")) {\r\n this._IOs.header.events.off(\"dragstop\");\r\n }\r\n }\r\n }\r\n };\r\n Popup.prototype.toStyle = function (value) {\r\n if (!$type.hasValue(value)) {\r\n return null;\r\n }\r\n else if ($type.isNumber(value)) {\r\n return \"\" + value + \"px\";\r\n }\r\n else {\r\n return value.toString();\r\n }\r\n };\r\n Object.defineProperty(Popup.prototype, \"classPrefix\", {\r\n /**\r\n * A prefix that is applied to class names of various popup elements.\r\n *\r\n * @return Class name prefix\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"classPrefix\", this._classPrefix);\r\n },\r\n /**\r\n * @param value Class name prefix\r\n */\r\n set: function (value) {\r\n this._classPrefix = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"classPrefixRaw\", {\r\n /**\r\n * Returns raw prefix (without adapters applied).\r\n *\r\n * @ignore Exclude from docs\r\n * @return Class name prefix\r\n */\r\n get: function () {\r\n return this._classPrefix;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"content\", {\r\n /**\r\n * @return Popup content\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"content\", this._content);\r\n },\r\n /**\r\n * Popup content.\r\n *\r\n * Popup content can be any valid HTML, including CSS.\r\n *\r\n * @param value Popup content\r\n */\r\n set: function (value) {\r\n if (this._content != value) {\r\n this._content = value;\r\n if (!this._elements.content) {\r\n this.createContentElement();\r\n }\r\n this._elements.content.innerHTML = value;\r\n this.positionElement();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Popup.prototype.getClassNames = function () {\r\n return this.adapter.apply(\"classNames\", {\r\n wrapperClass: this.classPrefix + \"\",\r\n headerClass: this.classPrefix + \"-header\",\r\n titleClass: this.classPrefix + \"-title\",\r\n contentClass: this.classPrefix + \"-content\",\r\n insideClass: this.classPrefix + \"-inside\",\r\n curtainClass: this.classPrefix + \"-curtain\",\r\n closeClass: this.classPrefix + \"-close\"\r\n });\r\n };\r\n /**\r\n * Creates content element.\r\n */\r\n Popup.prototype.createContentElement = function () {\r\n // Check if it's created already\r\n if (this._elements.wrapper) {\r\n return;\r\n }\r\n // Get class names for popup elements\r\n var classNames = this.getClassNames();\r\n // Create content element\r\n var wrapper = document.createElement(\"div\");\r\n wrapper.className = classNames.contentClass;\r\n wrapper.style.opacity = \"0.01\";\r\n // Create close button\r\n var close = document.createElement(\"a\");\r\n close.className = classNames.closeClass;\r\n // header title\r\n var header = document.createElement(\"div\");\r\n header.className = classNames.headerClass;\r\n // Content title\r\n var title = document.createElement(\"div\");\r\n title.innerHTML = this.title;\r\n title.className = classNames.titleClass;\r\n if (!this.title) {\r\n title.style.display = \"none\";\r\n }\r\n // Content div\r\n var content = document.createElement(\"div\");\r\n content.className = classNames.insideClass;\r\n content.innerHTML = this.content;\r\n // Set up events for content\r\n this._IOs.wrapper = getInteraction().getInteraction(wrapper);\r\n this._IOs.header = getInteraction().getInteraction(header);\r\n this._disposers.push(this._IOs.wrapper);\r\n // Set hover/out events\r\n this._IOs.wrapper.events.on(\"over\", this.disablePointers, this);\r\n this._IOs.wrapper.events.on(\"out\", this.releasePointers, this);\r\n // Create an InteractionObject for close\r\n this._IOs.close = getInteraction().getInteraction(close);\r\n this._disposers.push(this._IOs.close);\r\n // Hide close for now\r\n close.style.visibility = \"hidden\";\r\n // Add accessible stuff\r\n wrapper.setAttribute(\"role\", \"dialog\");\r\n // Add to wrapper\r\n header.appendChild(close);\r\n header.appendChild(title);\r\n wrapper.appendChild(header);\r\n wrapper.appendChild(content);\r\n this.container.appendChild(wrapper);\r\n // Save for later access\r\n this._elements.wrapper = wrapper;\r\n this._elements.header = header;\r\n this._elements.content = content;\r\n this._elements.title = title;\r\n this._elements.close = close;\r\n // Load CSS\r\n if (this.defaultStyles) {\r\n this.loadDefaultCSS();\r\n }\r\n // Create curtain as well\r\n this.createCurtainElement();\r\n // Apply events\r\n this.applyEvents();\r\n this.applyReaderSettings();\r\n // Draggable?\r\n this.setupDragging();\r\n };\r\n Object.defineProperty(Popup.prototype, \"title\", {\r\n /**\r\n * @return Popup title\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"title\", this._title);\r\n },\r\n /**\r\n * Popup title.\r\n *\r\n * Popup title can be any valid HTML, including CSS.\r\n *\r\n * @param value Popup title\r\n */\r\n set: function (value) {\r\n if (this._title != value) {\r\n this._title = value;\r\n if (!this._elements.content) {\r\n this.createContentElement();\r\n }\r\n this._elements.title.innerHTML = value;\r\n this.positionElement();\r\n this.applyReaderSettings();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"readerTitle\", {\r\n /**\r\n * @return Popup content\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"readerTitle\", this._readerTitle != \"\" ? this._readerTitle : this.title);\r\n },\r\n /**\r\n * A title for screen readers. It is very highly recommended to set that title\r\n * so that people using screen reader tools can get an immediate summary of\r\n * the information in the popup.\r\n *\r\n * @param value Reader title\r\n */\r\n set: function (value) {\r\n if (this._readerTitle != value) {\r\n this._readerTitle = value;\r\n this.applyReaderSettings();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"closable\", {\r\n /**\r\n * @return Closable?\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"closable\", this._closable);\r\n },\r\n /**\r\n * Is popup closable?\r\n *\r\n * If it is, it can be closed in a number of ways, e.g. by hitting ESC key,\r\n * clicking curtain, or clicking the close button.\r\n *\r\n * If it is not closable, the only way to close it is via `close()` call.\r\n *\r\n * @param value Closable?\r\n */\r\n set: function (value) {\r\n if (value !== this._closable) {\r\n this._closable = value;\r\n this.applyEvents();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"fitTo\", {\r\n /**\r\n * @ignore\r\n * @todo Implement\r\n * @return Fit option\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"fitTo\", this._fitTo);\r\n },\r\n /**\r\n * If set to other than \"none\" will try to re-adjust the position of the\r\n * popop to fit within chart container or browser window.\r\n *\r\n * @ignore\r\n * @todo Implement\r\n * @default \"window\"\r\n * @param value Fit option\r\n */\r\n set: function (value) {\r\n if (value != this._fitTo) {\r\n this._fitTo = value;\r\n this.positionElement();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"defaultStyles\", {\r\n /**\r\n * @return Use default CSS?\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"defaultStyles\", this._defaultStyles);\r\n },\r\n /**\r\n * Should popup use default CSS?\r\n *\r\n * If default CSS is disabled, an external CSS should handle the look of the\r\n * popup, since it will look quite out of place otherwise.\r\n *\r\n * @default true\r\n * @param Use default CSS?\r\n */\r\n set: function (value) {\r\n if (this._defaultStyles != value) {\r\n this._defaultStyles = value;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"showCurtain\", {\r\n /**\r\n * @return Show curtain?\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"showCurtain\", this._showCurtain);\r\n },\r\n /**\r\n * Should popup use dim out all content behind it?\r\n *\r\n * @default false\r\n * @param Show curtain?\r\n */\r\n set: function (value) {\r\n if (this._showCurtain != value) {\r\n this._showCurtain = value;\r\n if (this._elements.curtain) {\r\n this._elements.curtain.style.display = value ? \"block\" : \"none\";\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates curtain element.\r\n */\r\n Popup.prototype.createCurtainElement = function () {\r\n // Get class names for popup elements\r\n var classNames = this.getClassNames();\r\n // Create the curtain\r\n var curtain = document.createElement(\"div\");\r\n curtain.className = classNames.curtainClass;\r\n // Append curtain to wrapper\r\n this.container.appendChild(curtain);\r\n // Create an InteractionObject for curtain because we might need to\r\n // set interactions on it\r\n this._IOs.curtain = getInteraction().getInteraction(curtain);\r\n // Add Curtain IO to disposers\r\n this._disposers.push(this._IOs.curtain);\r\n // Set events to disable underlying interactivity\r\n this._IOs.curtain.events.on(\"over\", this.disablePointers, this);\r\n this._IOs.curtain.events.on(\"out\", this.releasePointers, this);\r\n // Hide it?\r\n curtain.style.display = this.showCurtain ? \"block\" : \"none\";\r\n // Save for later\r\n this._elements.curtain = curtain;\r\n };\r\n Object.defineProperty(Popup.prototype, \"draggable\", {\r\n /**\r\n * @return Show curtain?\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"draggable\", this._draggable);\r\n },\r\n /**\r\n * Can the popup be dragged with a pointer?\r\n *\r\n * @default false\r\n * @param Show curtain?\r\n */\r\n set: function (value) {\r\n if (this._draggable != value) {\r\n this._draggable = value;\r\n this.setupDragging();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"dynamicResize\", {\r\n /**\r\n * @return Resize dynamically?\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"dynamicResize\", this._dynamicResize);\r\n },\r\n /**\r\n * Resize popup as images are being loaded.\r\n *\r\n * @default true\r\n * @since 4.9.17\r\n * @param Resize dynamically?\r\n */\r\n set: function (value) {\r\n if (this._dynamicResize != value) {\r\n this._dynamicResize = value;\r\n this.positionElement(true);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"align\", {\r\n /**\r\n * @return Horizontal position\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"align\", this._align);\r\n },\r\n /**\r\n * Horizontal positioning of the content window.\r\n *\r\n * Available options: \"left\", \"center\" (default), \"right\", and \"none\".\r\n *\r\n * @default \"center\"\r\n * @param Horizontal position\r\n */\r\n set: function (value) {\r\n if (this._align != value) {\r\n this._align = value;\r\n this.positionElement();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"verticalAlign\", {\r\n /**\r\n * @return Vertical position\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"verticalAlign\", this._verticalAlign);\r\n },\r\n /**\r\n * Vertical positioning of the content window.\r\n *\r\n * Available options: \"top\", \"middle\" (default), \"bottom\", and \"none\".\r\n *\r\n * @default \"middle\"\r\n * @param Vertical position\r\n */\r\n set: function (value) {\r\n if (this._verticalAlign != value) {\r\n this._verticalAlign = value;\r\n this.positionElement();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"left\", {\r\n /**\r\n * @return Left\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"left\", this._left);\r\n },\r\n /**\r\n * \"left\" coordinate of a non-aligned (`align = \"none\"`) popup.\r\n *\r\n * Can be either absolute pixel value, or relative (`Percent`).\r\n *\r\n * Setting this property will automatically set `align` to \"none\".\r\n *\r\n * NOTE: The position is relative to the chart container.\r\n *\r\n * @param Left\r\n */\r\n set: function (value) {\r\n if (this.left != value) {\r\n this._left = value;\r\n this._align = \"none\";\r\n this.positionElement();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"right\", {\r\n /**\r\n * @return Right\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"right\", this._right);\r\n },\r\n /**\r\n * \"right\" coordinate of a non-aligned (`align = \"none\"`) popup.\r\n *\r\n * Can be either absolute pixel value, or relative (`Percent`).\r\n *\r\n * Setting this property will automatically set `align` to \"none\".\r\n *\r\n * NOTE: The position is relative to the chart container.\r\n *\r\n * @param Right\r\n */\r\n set: function (value) {\r\n if (this.right != value) {\r\n this._right = value;\r\n this._align = \"none\";\r\n this.positionElement();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"top\", {\r\n /**\r\n * @return Top\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"top\", this._top);\r\n },\r\n /**\r\n * \"top\" coordinate of a non-aligned (`verticalAlign = \"none\"`) popup.\r\n *\r\n * Can be either absolute pixel value, or relative (`Percent`).\r\n *\r\n * Setting this property will automatically set `verticalAlign` to \"none\".\r\n *\r\n * NOTE: The position is relative to the chart container.\r\n *\r\n * @param Top\r\n */\r\n set: function (value) {\r\n if (this.top != value) {\r\n this._top = value;\r\n this._verticalAlign = \"none\";\r\n this.positionElement();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"bottom\", {\r\n /**\r\n * @return Bottom\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"bottom\", this._bottom);\r\n },\r\n /**\r\n * \"bottom\" coordinate of a non-aligned (`verticalAlign = \"none\"`) popup.\r\n *\r\n * Can be either absolute pixel value, or relative (`Percent`).\r\n *\r\n * Setting this property will automatically set `verticalAlign` to \"none\".\r\n *\r\n * NOTE: The position is relative to the chart container.\r\n *\r\n * @param Bottom\r\n */\r\n set: function (value) {\r\n if (this.bottom != value) {\r\n this._bottom = value;\r\n this._verticalAlign = \"none\";\r\n this.positionElement();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"elements\", {\r\n /**\r\n * Returns an object with references to various elements of the Popup.\r\n *\r\n * * `wrapper`\r\n * * `title`\r\n * * `content`\r\n * * `close`\r\n * * `curtain`\r\n */\r\n get: function () {\r\n return this._elements;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Loads popup CSS.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Popup.prototype.loadDefaultCSS = function () {\r\n if (!this._cssLoaded) {\r\n this._disposers.push(popupCSS(getShadowRoot(this.container), this.classPrefix));\r\n $object.each(this._elements, function (key, el) {\r\n el.style.display = \"\";\r\n });\r\n this._cssLoaded = true;\r\n }\r\n };\r\n /**\r\n * If popup is closable, this method adds various events to popup elements.\r\n */\r\n Popup.prototype.applyEvents = function () {\r\n var _this = this;\r\n if (this._IOs.close) {\r\n if (this.closable) {\r\n this._IOs.close.element.style.visibility = \"visible\";\r\n var disposers = [\r\n getInteraction().body.events.on(\"keyup\", function (ev) {\r\n if (keyboard.isKey(ev.event, \"esc\") && _this.closable) {\r\n _this.close();\r\n }\r\n }),\r\n this._IOs.close.events.on(\"hit\", function (ev) {\r\n _this.close();\r\n })\r\n ];\r\n disposers.push(this._IOs.curtain.events.on(\"hit\", function (ev) {\r\n if (_this.showCurtain && _this.closable) {\r\n _this.close();\r\n }\r\n }));\r\n this._disposers.push(new MultiDisposer(disposers));\r\n }\r\n else {\r\n this._IOs.close.element.style.visibility = \"hidden\";\r\n }\r\n }\r\n };\r\n /**\r\n * Disables interactivity on parent chart.\r\n */\r\n Popup.prototype.disablePointers = function () {\r\n if (this.sprite) {\r\n this._spriteInteractionsEnabled = this.sprite.interactionsEnabled;\r\n this.sprite.interactionsEnabled = false;\r\n }\r\n };\r\n /**\r\n * Releases temporarily disabled pointers on parent chart.\r\n */\r\n Popup.prototype.releasePointers = function () {\r\n if ($type.hasValue(this._spriteInteractionsEnabled)) {\r\n this.sprite.interactionsEnabled = this._spriteInteractionsEnabled;\r\n this._spriteInteractionsEnabled = undefined;\r\n }\r\n };\r\n /**\r\n * Sets screen reader related settings.\r\n */\r\n Popup.prototype.applyReaderSettings = function () {\r\n this.elements.wrapper.setAttribute(\"aria-label\", this.readerTitle);\r\n };\r\n /**\r\n * Copies all properties and related data from different element.\r\n *\r\n * @param object Source element\r\n */\r\n Popup.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.container = source.container;\r\n this.sprite = source.sprite;\r\n this.classPrefix = source.classPrefixRaw;\r\n this.content = source.content;\r\n this.title = source.title;\r\n this.readerTitle = source.readerTitle;\r\n this.defaultStyles = source.defaultStyles;\r\n this.showCurtain = source.showCurtain;\r\n this.align = source.align;\r\n this.verticalAlign = source.verticalAlign;\r\n this.left = source.left;\r\n this.right = source.right;\r\n this.top = source.top;\r\n this.bottom = source.bottom;\r\n this.adapter.copyFrom(source.adapter);\r\n };\r\n return Popup;\r\n}(BaseObjectEvents));\r\nexport { Popup };\r\n//# sourceMappingURL=Popup.js.map","/**\r\n * Modal class is used to display information over chart area.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Popup } from \"./Popup\";\r\nimport { Adapter } from \"../utils/Adapter\";\r\n/**\r\n * Shows an HTML modal which covers window or a chart area.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/popups-and-modals/} For examples and docs on Popups and Modals.\r\n */\r\nvar Modal = /** @class */ (function (_super) {\r\n __extends(Modal, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Modal() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Adapter.\r\n */\r\n _this.adapter = new Adapter(_this);\r\n _this.className = \"Modal\";\r\n _this.showCurtain = true;\r\n _this.draggable = false;\r\n return _this;\r\n }\r\n return Modal;\r\n}(Popup));\r\nexport { Modal };\r\n//# sourceMappingURL=Modal.js.map","import { __read, __spread } from \"tslib\";\r\nimport { options } from \"../Options\";\r\n/**\r\n * Outputs string to console if `verbose` is `true`.\r\n */\r\nexport function log() {\r\n var messages = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n messages[_i] = arguments[_i];\r\n }\r\n if (options.verbose) {\r\n if (console) {\r\n console.log.apply(console, __spread(messages));\r\n }\r\n }\r\n}\r\n/**\r\n * Outputs a warning to the console.\r\n */\r\nexport function warn() {\r\n var messages = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n messages[_i] = arguments[_i];\r\n }\r\n if (!options.suppressWarnings) {\r\n if (console) {\r\n console.warn.apply(console, __spread(messages));\r\n }\r\n }\r\n}\r\n//# sourceMappingURL=Log.js.map","import * as $array from \"./Array\";\r\nimport * as $log from \"./Log\";\r\nvar Native = /** @class */ (function () {\r\n function Native() {\r\n var _this = this;\r\n this._targets = [];\r\n this._observer = new ResizeObserver(function (entries) {\r\n $array.each(entries, function (entry) {\r\n $array.each(_this._targets, function (x) {\r\n if (x.target === entry.target) {\r\n x.callback();\r\n }\r\n });\r\n });\r\n });\r\n }\r\n Native.prototype.addTarget = function (target, callback) {\r\n this._observer.observe(target, { box: \"content-box\" });\r\n this._targets.push({ target: target, callback: callback });\r\n };\r\n Native.prototype.removeTarget = function (target) {\r\n this._observer.unobserve(target);\r\n $array.keepIf(this._targets, function (x) {\r\n return x.target !== target;\r\n });\r\n };\r\n return Native;\r\n}());\r\nvar Raf = /** @class */ (function () {\r\n function Raf() {\r\n this._targets = [];\r\n }\r\n Raf.prototype.addTarget = function (target, callback) {\r\n var _this = this;\r\n if (this._targets.length === 0) {\r\n var lastTime_1 = null;\r\n var loop_1 = function () {\r\n var currentTime = Date.now();\r\n if (lastTime_1 === null || currentTime > (lastTime_1 + Raf.delay)) {\r\n lastTime_1 = currentTime;\r\n $array.each(_this._targets, function (x) {\r\n var newSize = x.target.getBoundingClientRect();\r\n if (newSize.width !== x.size.width || newSize.height !== x.size.height) {\r\n x.size = newSize;\r\n x.callback();\r\n }\r\n });\r\n }\r\n _this._timer = requestAnimationFrame(loop_1);\r\n };\r\n this._timer = requestAnimationFrame(loop_1);\r\n }\r\n var size = target.getBoundingClientRect();\r\n this._targets.push({ target: target, callback: callback, size: size });\r\n };\r\n Raf.prototype.removeTarget = function (target) {\r\n $array.keepIf(this._targets, function (x) {\r\n return x.target !== target;\r\n });\r\n if (this._targets.length === 0) {\r\n cancelAnimationFrame(this._timer);\r\n }\r\n };\r\n Raf.delay = 200;\r\n return Raf;\r\n}());\r\nvar observer = null;\r\nfunction makeSensor() {\r\n if (observer === null) {\r\n if (typeof ResizeObserver !== \"undefined\") {\r\n observer = new Native();\r\n }\r\n else {\r\n observer = new Raf();\r\n }\r\n }\r\n return observer;\r\n}\r\nvar ResizeSensor = /** @class */ (function () {\r\n function ResizeSensor(element, callback) {\r\n this._disposed = false;\r\n this._sensor = makeSensor();\r\n this._element = element;\r\n this._sensor.addTarget(element, callback);\r\n }\r\n ResizeSensor.prototype.isDisposed = function () {\r\n return this._disposed;\r\n };\r\n ResizeSensor.prototype.dispose = function () {\r\n if (!this._disposed) {\r\n this._disposed = true;\r\n this._sensor.removeTarget(this._element);\r\n }\r\n };\r\n Object.defineProperty(ResizeSensor.prototype, \"sensor\", {\r\n get: function () {\r\n return this._sensor;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Deprecated: do not use.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n ResizeSensor.prototype.reset = function () {\r\n $log.warn(\"resizeSensor.reset() is no longer needed and can be removed\");\r\n };\r\n return ResizeSensor;\r\n}());\r\nexport { ResizeSensor };\r\n//# sourceMappingURL=ResizeSensor.js.map","/**\r\n * This functionality is related to the HTML wrapper that houses `` tag.\r\n */\r\nimport { Popup } from \"../elements/Popup\";\r\nimport { Modal } from \"../elements/Modal\";\r\nimport { ListTemplate, ListDisposer } from \"../utils/List\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $dom from \"../utils/DOM\";\r\nimport * as $array from \"../utils/Array\";\r\nimport * as $type from \"../utils/Type\";\r\nimport { ResizeSensor } from \"../utils/ResizeSensor\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A array of all SVG Containers (one SVG container per chart instance).\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport var svgContainers = [];\r\n/**\r\n * A class used to create an HTML wrapper for the SVG contents.\r\n */\r\nvar SVGContainer = /** @class */ (function () {\r\n /**\r\n * Constructor\r\n *\r\n * * Creates an HTML wrapper for SVG\r\n */\r\n function SVGContainer(htmlElement, ghost) {\r\n var _this = this;\r\n /**\r\n * Indicates if this object has already been deleted. Any\r\n * destruction/disposal code should take this into account when deciding\r\n * wheter to run potentially costly disposal operations if they already have\r\n * been run.\r\n */\r\n this._disposed = false;\r\n /**\r\n * If this component is in a separate HTML container, `autoResize` means the\r\n * module will constantly measure container's size and adopt contents to it.\r\n */\r\n this.autoResize = true;\r\n /**\r\n * Holds list of references to [[Sprite]] objects that should not be exported\r\n * when exporting chart to an image.\r\n *\r\n * @ignore\r\n */\r\n this.nonExportableSprites = [];\r\n /**\r\n * List of objects that need to be disposed when this one is disposed.\r\n */\r\n this._disposers = [];\r\n this.cssScale = 1;\r\n // This is needed so that it won't resize while printing, so that way printing works correctly.\r\n this._printing = false;\r\n // Log parent HTML element\r\n this.htmlElement = htmlElement;\r\n if (!ghost) {\r\n this._printing = false;\r\n this.initSensor();\r\n this._disposers.push($dom.addEventListener(window, \"beforeprint\", function () {\r\n _this._printing = true;\r\n }));\r\n this._disposers.push($dom.addEventListener(window, \"afterprint\", function () {\r\n _this._printing = false;\r\n }));\r\n }\r\n // Adds to containers array\r\n svgContainers.push(this);\r\n /**\r\n * Create child div for the container - it will have svg node\r\n * It might seem that this container is not necessay, however having it solves\r\n * a problems with mouse position detection and some other.\r\n */\r\n var svgContainer = document.createElement(\"div\");\r\n var style = svgContainer.style;\r\n style.width = \"100%\";\r\n style.height = \"100%\";\r\n style.position = \"relative\";\r\n htmlElement.appendChild(svgContainer);\r\n this.SVGContainer = svgContainer;\r\n }\r\n /**\r\n * (Re)Initializes a resize sensor.\r\n */\r\n SVGContainer.prototype.initSensor = function () {\r\n var _this = this;\r\n if (this.resizeSensor) {\r\n this.resizeSensor.dispose();\r\n }\r\n var callback = function () {\r\n if (_this.autoResize && !_this._printing) {\r\n _this.measure();\r\n }\r\n };\r\n this.resizeSensor = new ResizeSensor(this.htmlElement, callback);\r\n this._disposers.push(this.resizeSensor);\r\n };\r\n /**\r\n * Measures size of parent HTML element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n SVGContainer.prototype.measure = function () {\r\n var width = $utils.width(this.htmlElement);\r\n var height = $utils.height(this.htmlElement);\r\n var container = this.container;\r\n if (container) {\r\n if (this.width != width || this.height != height) {\r\n this.width = width;\r\n this.height = height;\r\n if (width > 0) {\r\n container.maxWidth = width;\r\n }\r\n if (height > 0) {\r\n container.maxHeight = height;\r\n }\r\n $dom.fixPixelPerfect(this.SVGContainer);\r\n }\r\n if (!container.maxWidth) {\r\n container.maxWidth = 0;\r\n }\r\n if (!container.maxHeight) {\r\n container.maxHeight = 0;\r\n }\r\n this.cssScale = 1;\r\n this.checkTransform(this.htmlElement);\r\n }\r\n };\r\n Object.defineProperty(SVGContainer.prototype, \"container\", {\r\n /**\r\n * @return Container\r\n */\r\n get: function () {\r\n return this._container;\r\n },\r\n /**\r\n * A [[Container]] element which is placed into container.\r\n *\r\n * @param container Container\r\n */\r\n set: function (container) {\r\n this._container = container;\r\n this.measure();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns if this object has been already been disposed.\r\n *\r\n * @return Is disposed?\r\n */\r\n SVGContainer.prototype.isDisposed = function () {\r\n return this._disposed;\r\n };\r\n /**\r\n * Removes this container from SVG container list in system, which\r\n * effectively disables size change monitoring for it.\r\n */\r\n SVGContainer.prototype.dispose = function () {\r\n if (!this._disposed) {\r\n $array.remove(svgContainers, this);\r\n }\r\n $array.each(this._disposers, function (item) {\r\n item.dispose();\r\n });\r\n };\r\n Object.defineProperty(SVGContainer.prototype, \"hideOverflow\", {\r\n /**\r\n * Indicates if chart container should have its style set\r\n * to `overflow: hidden`.\r\n *\r\n * Normally, we don't want that, so that certain elements, such as tooltips,\r\n * would be able to go outside chart area.\r\n *\r\n * There is one issue though. Some browsers ignore SVG masks and would\r\n * display scrollbars if chart elements, that go outside chart area extend\r\n * outside window.\r\n *\r\n * This is especially true for [[MapChart]], which can have its elements\r\n * extend very widely when zoomed in. Even if those parts are not visible\r\n * because of SVG masks, some browsers might still display window scrollbars.\r\n *\r\n * This is why we set this setting to `true` in [[MapChart]].\r\n *\r\n * Other charts use default of `false`.\r\n */\r\n set: function (value) {\r\n if (value) {\r\n this.SVGContainer.style.overflow = \"hidden\";\r\n }\r\n else {\r\n this.SVGContainer.style.overflow = \"\";\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SVGContainer.prototype, \"modal\", {\r\n /**\r\n * ==========================================================================\r\n * MODAL/POPUP RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns a [[Modal]] instance, associated with this chart.\r\n * (elements top parent)\r\n *\r\n * Accessing modal does not make it appear. To make a modal appear, use\r\n * `showModal()` method.\r\n *\r\n * @see {@link Modal} for more information about using Modal windows\r\n * @return Modal instance\r\n */\r\n get: function () {\r\n if (!$type.hasValue(this._modal)) {\r\n // Create new modal\r\n this._modal = new Modal();\r\n this._modal.container = this.SVGContainer;\r\n // Add to disposers\r\n this._disposers.push(this._modal);\r\n }\r\n return this._modal;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Opens a modal window with specific content (`text` parameter) and,\r\n * optionally, `title`.\r\n *\r\n * The `text` parameter can contain HTML content.\r\n *\r\n * @see {@link Modal} for more information about using Modal windows\r\n * @param text Modal contents\r\n * @param title Title for the modal window\r\n */\r\n SVGContainer.prototype.openModal = function (text, title) {\r\n // Hide previous modal\r\n this.closeModal();\r\n // Create modal\r\n var modal = this.modal;\r\n modal.content = text;\r\n modal.readerTitle = title || \"\";\r\n modal.title = title || \"\";\r\n modal.open();\r\n return modal;\r\n };\r\n /**\r\n * Hides modal window if there is one currently open.\r\n */\r\n SVGContainer.prototype.closeModal = function () {\r\n if (this._modal) {\r\n this.modal.close();\r\n }\r\n };\r\n Object.defineProperty(SVGContainer.prototype, \"popups\", {\r\n /**\r\n * A list of popups for this chart.\r\n *\r\n * @return Popups\r\n */\r\n get: function () {\r\n if (!$type.hasValue(this._popups)) {\r\n // Create popup template\r\n var popupTemplate = new Popup();\r\n popupTemplate.container = this.SVGContainer;\r\n // Create the list\r\n this._popups = new ListTemplate(popupTemplate);\r\n // Add to disposers\r\n this._disposers.push(new ListDisposer(this._popups));\r\n this._disposers.push(this._popups.template);\r\n }\r\n return this._popups;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates, opens, and returns a new [[Popup]] window.\r\n *\r\n * `text` can be any valid HTML.\r\n *\r\n * `title` is currently not supported.\r\n *\r\n * @param text Popup contents\r\n * @param title Popup title\r\n * @return Popup instance\r\n */\r\n SVGContainer.prototype.openPopup = function (text, title) {\r\n var popup = this.popups.create();\r\n popup.content = text;\r\n if ($type.hasValue(title)) {\r\n popup.title = title;\r\n }\r\n popup.open();\r\n return popup;\r\n };\r\n /**\r\n * Closes all currently open popup windows\r\n */\r\n SVGContainer.prototype.closeAllPopups = function () {\r\n this.popups.each(function (popup) {\r\n popup.close();\r\n });\r\n };\r\n Object.defineProperty(SVGContainer.prototype, \"readerAlertElement\", {\r\n /**\r\n * ==========================================================================\r\n * ACCESSIBILITY STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * A `
` element used as as placeholder to trigger screen alerts.\r\n *\r\n * @sunce 4.9.2\r\n * @return Element\r\n */\r\n get: function () {\r\n if (!$type.hasValue(this._readerAlertElement)) {\r\n // Create element\r\n var div = document.createElement(\"div\");\r\n div.setAttribute(\"role\", \"alert\");\r\n div.style.zIndex = \"-100000\";\r\n div.style.opacity = \"0\";\r\n div.style.position = \"absolute\";\r\n div.style.top = \"0\";\r\n this.SVGContainer.appendChild(div);\r\n this._readerAlertElement = div;\r\n }\r\n return this._readerAlertElement;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Triggers screen reader read out a message.\r\n *\r\n * @since 4.9.2\r\n * @param text Alert text\r\n */\r\n SVGContainer.prototype.readerAlert = function (text) {\r\n this.readerAlertElement.innerHTML = text;\r\n };\r\n /**\r\n * ==========================================================================\r\n * OTHER STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n SVGContainer.prototype.checkTransform = function (div) {\r\n if (window.getComputedStyle) {\r\n if (div && div.style) {\r\n var style = window.getComputedStyle(div, null);\r\n if (style) {\r\n var matrix = style.getPropertyValue(\"-webkit-transform\") ||\r\n style.getPropertyValue(\"-moz-transform\") ||\r\n style.getPropertyValue(\"-ms-transform\") ||\r\n style.getPropertyValue(\"-o-transform\") ||\r\n style.getPropertyValue(\"transform\");\r\n if (matrix && matrix !== \"none\") {\r\n var values = matrix.split('(')[1].split(')')[0].split(',');\r\n var a = Number(values[0]);\r\n var b = Number(values[1]);\r\n var scale = Math.sqrt(a * a + b * b);\r\n if (!isNaN(scale)) {\r\n this.cssScale *= scale;\r\n }\r\n }\r\n }\r\n }\r\n if (div.parentNode && div.parentNode instanceof HTMLElement) {\r\n this.checkTransform(div.parentNode);\r\n }\r\n }\r\n };\r\n return SVGContainer;\r\n}());\r\nexport { SVGContainer };\r\n//# sourceMappingURL=SVGContainer.js.map","/**\r\n * Paper class just like the white sheet of pressed fiber it draws its name\r\n * inspiration from is used as a starting point to start a drawing.\r\n *\r\n * Before we can start adding elements (drawing) we need to take out a new sheet\r\n * of paper, or in this instance create a blank SVG element.\r\n *\r\n * This class creates such element, as well as implements methods needed to\r\n * start adding elements to it.\r\n */\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { AMElement } from \"./AMElement\";\r\nimport { Group } from \"./Group\";\r\nimport { SVGContainer } from \"./SVGContainer\";\r\nimport * as $dom from \"../utils/DOM\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Paper class which when instantiated will create an SVG element as well as\r\n * some of the sub-elements like ``, ``.\r\n *\r\n * Use its methods like `addGroup` and `append` to add elements to the paper.\r\n */\r\nvar Paper = /** @class */ (function () {\r\n /**\r\n * Creates main `` container and related elements.\r\n *\r\n * @param container A reference to HTML element to create `` in\r\n */\r\n function Paper(container, id) {\r\n // Store container reference\r\n this.container = container;\r\n this.id = id;\r\n // Create SVG element\r\n var svg = document.createElementNS($dom.SVGNS, \"svg\");\r\n svg.setAttribute(\"version\", \"1.1\");\r\n svg.setAttributeNS($dom.XMLNS, \"xmlns\", $dom.SVGNS);\r\n svg.setAttributeNS($dom.XMLNS, \"xmlns:xlink\", $dom.XLINK);\r\n svg.setAttribute(\"role\", \"group\");\r\n this.container.appendChild(svg);\r\n // Add description\r\n //let desc: SVGElement = document.createElementNS($dom.SVGNS, \"desc\");\r\n //desc.appendChild(document.createTextNode(\"JavaScript chart by amCharts\"));\r\n //svg.appendChild(desc);\r\n // Add defs\r\n this.defs = document.createElementNS($dom.SVGNS, \"defs\");\r\n svg.appendChild(this.defs);\r\n // Set width and height to fit container\r\n svg.style.width = \"100%\";\r\n svg.style.height = \"100%\";\r\n svg.style.overflow = \"visible\";\r\n // Store variable\r\n this.svg = svg;\r\n }\r\n /**\r\n * Creates and returns a new element. Does not attach it to Paper yet.\r\n *\r\n * @param elementName Element name\r\n * @return New element\r\n */\r\n Paper.prototype.add = function (elementName) {\r\n return new AMElement(elementName);\r\n };\r\n /**\r\n * Creates and returns a new Group element. Does not attach it to Paper.\r\n *\r\n * @param groupName Element name\r\n * @return New Group\r\n */\r\n Paper.prototype.addGroup = function (groupName) {\r\n return new Group(groupName);\r\n };\r\n /**\r\n * Appends an element to Paper.\r\n *\r\n * @param element Element to append\r\n */\r\n Paper.prototype.append = function (element) {\r\n if (element) {\r\n this.svg.appendChild(element.node);\r\n }\r\n };\r\n /**\r\n * Appends an element to `` block of the Paper.\r\n *\r\n * @param element Element\r\n */\r\n Paper.prototype.appendDef = function (element) {\r\n if (element) {\r\n this.defs.appendChild(element.node);\r\n }\r\n };\r\n /**\r\n * Creates and returns new `` element. Does not append it to\r\n * Paper.\r\n *\r\n * @return A foreignObject element\r\n */\r\n Paper.prototype.foreignObject = function () {\r\n var element = new AMElement(\"foreignObject\");\r\n //this.append(element);\r\n return element;\r\n };\r\n /**\r\n * Checks if browser supports `` elements.\r\n *\r\n * @return Supports `foreignObject`?\r\n */\r\n Paper.prototype.supportsForeignObject = function () {\r\n return document.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#Extensibility\", \"1.1\");\r\n };\r\n return Paper;\r\n}());\r\nexport { Paper };\r\nvar ghostPaper = null;\r\n/**\r\n * A [[Paper]] instance to create elements, that are not yet ready to be\r\n * placed in visible DOM.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport function getGhostPaper() {\r\n if (ghostPaper === null) {\r\n // ghost is used to draw elements while real paper is not yet created or Sprite doesn't know parent yet\r\n var ghostDiv = document.createElement(\"div\");\r\n ghostDiv.hidden = true;\r\n ghostDiv.style.width = \"1px\";\r\n ghostDiv.style.height = \"1px\";\r\n ghostDiv.style.position = \"absolute\";\r\n ghostDiv.style.zIndex = \"-1000000\";\r\n document.body.appendChild(ghostDiv);\r\n var ghostSvgContainer = new SVGContainer(ghostDiv, true);\r\n ghostPaper = new Paper(ghostSvgContainer.SVGContainer, \"ghost\");\r\n }\r\n return ghostPaper;\r\n}\r\n//# sourceMappingURL=Paper.js.map","/**\r\n * Pattern module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../../Base\";\r\nimport { getGhostPaper } from \"../Paper\";\r\nimport { List, ListDisposer } from \"../../utils/List\";\r\nimport { Animation, AnimationDisposer } from \"../../utils/Animation\";\r\nimport { registry } from \"../../Registry\";\r\nimport { InterfaceColorSet } from \"../../utils/InterfaceColorSet\";\r\nimport * as $iter from \"../../utils/Iterator\";\r\nimport * as $object from \"../../utils/Object\";\r\nimport * as $type from \"../../utils/Type\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Base class to define patterns.\r\n */\r\nvar Pattern = /** @class */ (function (_super) {\r\n __extends(Pattern, _super);\r\n //public propertyValues = new Dictionary();\r\n /**\r\n * Constructor\r\n */\r\n function Pattern() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * List of elements the pattern consists of.\r\n */\r\n _this._elements = new List();\r\n /**\r\n * A storage for Filter property/value pairs.\r\n *\r\n * @ignore Exclude from docs\r\n * @see {@link PatternProperties}\r\n */\r\n _this.properties = {};\r\n _this.className = \"Pattern\";\r\n // Set defaults\r\n _this.width = 10;\r\n _this.height = 10;\r\n _this.x = 0;\r\n _this.y = 0;\r\n _this.patternUnits = \"userSpaceOnUse\";\r\n var interfaceColors = new InterfaceColorSet();\r\n _this.backgroundFill = interfaceColors.getFor(\"background\");\r\n _this.backgroundOpacity = 0;\r\n _this.fillOpacity = 1;\r\n _this.fill = interfaceColors.getFor(\"alternativeBackground\");\r\n _this.stroke = interfaceColors.getFor(\"alternativeBackground\");\r\n _this.strokeOpacity = 1;\r\n _this.strokeWidth = 1;\r\n _this.shapeRendering = \"crispEdges\";\r\n _this.rotation = 0;\r\n // Create main group to store pattern elements inelements\r\n _this.element = _this.paper.addGroup(\"pattern\");\r\n _this.id = \"pattern-\" + registry.getUniqueId();\r\n _this.element.attr({ \"id\": _this.id });\r\n _this._disposers.push(_this.element);\r\n // Make elements disposable\r\n _this._disposers.push(new ListDisposer(_this._elements));\r\n // Request again to trigger getter/setter code\r\n _this.patternUnits = _this.patternUnits;\r\n _this.width = _this.width;\r\n _this.height = _this.height;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the pattern.\r\n */\r\n Pattern.prototype.draw = function () {\r\n var _this = this;\r\n var patternElement = this.element;\r\n if (patternElement) {\r\n patternElement.removeChildNodes();\r\n var background = this.paper.add(\"rect\");\r\n background.attr({ \"width\": this.width, \"height\": this.height, \"shape-rendering\": \"crispEdges\", \"fill\": this.backgroundFill.hex, \"fill-opacity\": this.backgroundOpacity, \"stroke\": this.backgroundFill.hex, \"stroke-opacity\": 0 });\r\n patternElement.add(background);\r\n patternElement.attr({ \"x\": this.x, \"y\": this.y, \"width\": this.width, \"height\": this.height, \"stroke\": this.stroke.hex, \"fill\": this.fill.hex, \"fill-opacity\": this.fillOpacity, \"stroke-opacity\": this.strokeOpacity, \"stroke-width\": this.strokeWidth, \"shape-rendering\": this.shapeRendering, \"patternUnits\": this.patternUnits, \"stroke-dasharray\": this.strokeDasharray });\r\n $iter.each(this._elements.iterator(), function (element) {\r\n element.rotation = _this.rotation;\r\n element.rotationX = _this.properties[\"rotationX\"];\r\n element.rotationY = _this.properties[\"rotationY\"];\r\n _this.element.add(element);\r\n });\r\n }\r\n };\r\n /**\r\n * Animate pattern properties.\r\n *\r\n * @see {@link Animation}\r\n * @param animationOptions Animation options\r\n * @param duration Duration (ms)\r\n * @param easing Easing function\r\n * @return Animation instance\r\n */\r\n Pattern.prototype.animate = function (animationOptions, duration, easing) {\r\n return new Animation(this, animationOptions, duration, easing).start();\r\n };\r\n /**\r\n * Adds an element to the pattern.\r\n *\r\n * @param element Element\r\n */\r\n Pattern.prototype.addElement = function (element) {\r\n this._elements.push(element);\r\n this._disposers.push(element);\r\n };\r\n /**\r\n * Remove an element from the pattern.\r\n *\r\n * @param element Element\r\n */\r\n Pattern.prototype.removeElement = function (element) {\r\n this._elements.removeValue(element);\r\n this.removeDispose(element);\r\n };\r\n Object.defineProperty(Pattern.prototype, \"elements\", {\r\n /**\r\n * Returns the list of SVG elements comprising the pattern.\r\n *\r\n * @return Pattern elements\r\n */\r\n get: function () {\r\n return this._elements;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"fillOpacity\", {\r\n /**\r\n * @return Opacity (0-1)\r\n */\r\n get: function () {\r\n return this.properties[\"fillOpacity\"];\r\n },\r\n /**\r\n * Pattern fill opacity. (0-1)\r\n *\r\n * @param value Opacity (0-1)\r\n */\r\n set: function (value) {\r\n this.properties[\"fillOpacity\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"fill\", {\r\n /**\r\n * @return Fill color\r\n */\r\n get: function () {\r\n return this.properties[\"fill\"];\r\n },\r\n /**\r\n * Fill color of the pattern.\r\n *\r\n * @param value Fill color\r\n */\r\n set: function (value) {\r\n this.properties[\"fill\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"backgroundFill\", {\r\n /**\r\n * @return Background color\r\n */\r\n get: function () {\r\n return this.properties[\"backgroundFill\"];\r\n },\r\n /**\r\n * Pattern background fill color.\r\n *\r\n * @param value Background color\r\n */\r\n set: function (value) {\r\n this.properties[\"backgroundFill\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"backgroundOpacity\", {\r\n /**\r\n * @return Background opacity (0-1)\r\n */\r\n get: function () {\r\n return this.properties[\"backgroundOpacity\"];\r\n },\r\n /**\r\n * Pattern backgorund opacity. (0-1)\r\n *\r\n * @param value Background opacity (0-1)\r\n */\r\n set: function (value) {\r\n this.properties[\"backgroundOpacity\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"stroke\", {\r\n /**\r\n * @return Color\r\n */\r\n get: function () {\r\n return this.properties[\"stroke\"];\r\n },\r\n /**\r\n * Pattern stroke (border) color.\r\n *\r\n * @param value Color\r\n */\r\n set: function (value) {\r\n this.properties[\"stroke\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"strokeOpacity\", {\r\n /**\r\n * @return Opacity (0-1)\r\n */\r\n get: function () {\r\n return this.properties[\"strokeOpacity\"];\r\n },\r\n /**\r\n * Pattern stroke opacity. (0-1)\r\n *\r\n * @param value Opacity (0-1)\r\n */\r\n set: function (value) {\r\n this.properties[\"strokeOpacity\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"strokeWidth\", {\r\n /**\r\n * @return Stroke thickness (px)\r\n */\r\n get: function () {\r\n return this.properties[\"strokeWidth\"];\r\n },\r\n /**\r\n * Pattern stroke thickness in pixels.\r\n *\r\n * @param value Stroke thickness (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"strokeWidth\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"shapeRendering\", {\r\n get: function () {\r\n return this.properties[\"shapeRendering\"];\r\n },\r\n /**\r\n * Shape rendering\r\n * @param value [description]\r\n */\r\n set: function (value) {\r\n this.properties[\"shapeRendering\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"rotation\", {\r\n /**\r\n * @return Rotation\r\n */\r\n get: function () {\r\n return this.properties[\"rotation\"];\r\n },\r\n /**\r\n * Pattern rotation in degrees.\r\n *\r\n * @param value Rotation\r\n */\r\n set: function (value) {\r\n this.properties[\"rotation\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"patternUnits\", {\r\n /**\r\n * @return Units\r\n */\r\n get: function () {\r\n return this.properties[\"patternUnits\"];\r\n },\r\n /**\r\n * Pattern measuring units.\r\n *\r\n * Available options: \"userSpaceOnUse\" | \"objectBoundingBox\".\r\n *\r\n * @param value Units\r\n */\r\n set: function (value) {\r\n this.properties[\"patternUnits\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"width\", {\r\n /**\r\n * @return Width (px)\r\n */\r\n get: function () {\r\n return this.properties[\"width\"];\r\n },\r\n /**\r\n * Pattern width in pixels.\r\n *\r\n * @param value Width (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"width\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"height\", {\r\n /**\r\n * @return Height (px)\r\n */\r\n get: function () {\r\n return this.properties[\"height\"];\r\n },\r\n /**\r\n * Pattern height in pixels.\r\n *\r\n * @param value Height (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"height\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"x\", {\r\n /**\r\n * @return X (px)\r\n */\r\n get: function () {\r\n return this.properties[\"x\"];\r\n },\r\n /**\r\n * X position. (pixels)\r\n *\r\n * @param value X (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"x\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"y\", {\r\n /**\r\n * @return Y (px)\r\n */\r\n get: function () {\r\n return this.properties[\"y\"];\r\n },\r\n /**\r\n * Y position (px).\r\n *\r\n * @param value Y (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"y\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"paper\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Paper\r\n */\r\n get: function () {\r\n if (this._paper) {\r\n return this._paper;\r\n }\r\n return getGhostPaper();\r\n },\r\n /**\r\n * [[Paper]] instance to draw pattern in.\r\n *\r\n * @ignore Exclude from docs\r\n * @param paper Paper\r\n */\r\n set: function (paper) {\r\n if (this._paper != paper) {\r\n this._paper = paper;\r\n this.draw();\r\n paper.appendDef(this.element);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies properties from another Pattern instance.\r\n *\r\n * @param source Source pattern\r\n */\r\n Pattern.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n _super.prototype.copyFrom.call(this, source);\r\n $object.each(source.properties, function (key, value) {\r\n _this[key] = value;\r\n });\r\n };\r\n Object.defineProperty(Pattern.prototype, \"animations\", {\r\n /**\r\n * A list of animations currently running on the patter.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Animation list\r\n */\r\n get: function () {\r\n if (!this._animations) {\r\n this._animations = [];\r\n this._disposers.push(new AnimationDisposer(this._animations));\r\n }\r\n return this._animations;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"strokeDasharray\", {\r\n /**\r\n * @return `stroke-dasharray`\r\n */\r\n get: function () {\r\n return this.properties[\"strokeDashArray\"];\r\n },\r\n /**\r\n * A `stroke-dasharray` for the stroke (outline).\r\n *\r\n * \"Dasharray\" allows setting rules to make lines dashed, dotted, etc.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray} for more info on `stroke-dasharray`\r\n * @param value `stroke-dasharray`\r\n */\r\n set: function (value) {\r\n this.properties[\"strokeDashArray\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n Pattern.prototype.processConfig = function (config) {\r\n if (config) {\r\n // Set up series\r\n if ($type.hasValue(config.elements) && $type.isArray(config.elements)) {\r\n for (var i = 0, len = config.elements.length; i < len; i++) {\r\n var element = config.elements[i];\r\n if ($type.hasValue(element[\"type\"])) {\r\n var sprite = this.createEntryInstance(element);\r\n if (sprite instanceof BaseObject) {\r\n sprite.config = element;\r\n }\r\n this.addElement($type.hasValue(element[\"typeProperty\"])\r\n ? sprite[element[\"typeProperty\"]]\r\n : sprite.element);\r\n }\r\n }\r\n }\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n return Pattern;\r\n}(BaseObject));\r\nexport { Pattern };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Pattern\"] = Pattern;\r\n//# sourceMappingURL=Pattern.js.map","/**\r\n * Contains code and logic for generating linear gradients.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../../Base\";\r\nimport { List } from \"../../utils/List\";\r\nimport { getGhostPaper } from \"../Paper\";\r\nimport { registry } from \"../../Registry\";\r\nimport * as $iter from \"../../utils/Iterator\";\r\nimport * as $math from \"../../utils/Math\";\r\nimport * as $type from \"../../utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Linear gradient class.\r\n */\r\nvar LinearGradient = /** @class */ (function (_super) {\r\n __extends(LinearGradient, _super);\r\n /**\r\n * Constructor.\r\n */\r\n function LinearGradient() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * List of colors switch definitions in a gradient.\r\n */\r\n _this._stops = new List();\r\n /**\r\n * Gradient direction.\r\n */\r\n _this._rotation = 0;\r\n _this.className = \"LinearGradient\";\r\n _this._stops.events.on(\"setIndex\", _this.validate, _this);\r\n _this._stops.events.on(\"inserted\", _this.validate, _this);\r\n // Create element\r\n _this.element = _this.paper.addGroup(\"linearGradient\");\r\n _this.id = \"gradient-\" + registry.getUniqueId();\r\n _this.element.attr({ \"id\": _this.id });\r\n _this._disposers.push(_this.element);\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws gradient.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n LinearGradient.prototype.validate = function () {\r\n var _this = this;\r\n var rotation = (this._rotation + 90) * $math.RADIANS;\r\n var x1 = Math.round(50 + Math.sin(rotation + Math.PI) * 50) + '%';\r\n var y1 = Math.round(50 + Math.cos(rotation) * 50) + '%';\r\n var x2 = Math.round(50 + Math.sin(rotation) * 50) + '%';\r\n var y2 = Math.round(50 + Math.cos(rotation + Math.PI) * 50) + '%';\r\n var gradientElement = this.element;\r\n gradientElement.removeChildNodes();\r\n gradientElement.attr({ \"x1\": x1, \"x2\": x2, \"y1\": y1, \"y2\": y2 });\r\n $iter.each($iter.indexed(this._stops.iterator()), function (a) {\r\n var i = a[0];\r\n var stop = a[1];\r\n var offset = stop.offset;\r\n if (!$type.isNumber(offset)) {\r\n offset = i / (_this._stops.length - 1);\r\n }\r\n var gradientStop = _this.paper.add(\"stop\");\r\n if ($type.hasValue(stop.color)) {\r\n gradientStop.attr({ \"stop-color\": stop.color.toString() });\r\n }\r\n if ($type.isNumber(stop.opacity)) {\r\n gradientStop.attr({ \"stop-opacity\": stop.opacity });\r\n }\r\n if ($type.isNumber(offset)) {\r\n gradientStop.attr({ \"offset\": offset });\r\n }\r\n gradientElement.add(gradientStop);\r\n });\r\n };\r\n /**\r\n * Clears the gradient.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n LinearGradient.prototype.clear = function () {\r\n this._stops.clear();\r\n };\r\n /**\r\n * Adds a color step to the gradient.\r\n *\r\n * @param color Color (hex code or named color)\r\n * @param opacity Opacity (value from 0 to 1; 0 completely transaprent, 1 fully opaque)\r\n * @param offset Position of color in the gradient (value 0 to 1; 0 meaning start of the gradient and 1 end)\r\n */\r\n LinearGradient.prototype.addColor = function (color, opacity, offset) {\r\n this._stops.push({ color: color, opacity: opacity, offset: offset });\r\n };\r\n Object.defineProperty(LinearGradient.prototype, \"stops\", {\r\n /**\r\n * A list of color stops in the gradient.\r\n *\r\n * @return Stops\r\n */\r\n get: function () {\r\n return this._stops;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(LinearGradient.prototype, \"paper\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Paper\r\n */\r\n get: function () {\r\n if (this._paper) {\r\n return this._paper;\r\n }\r\n return getGhostPaper();\r\n },\r\n /**\r\n * [[Paper]] instace to use for the gradient.\r\n *\r\n * @ignore Exclude from docs\r\n * @param paper Paper\r\n */\r\n set: function (paper) {\r\n if (this._paper != paper) {\r\n this._paper = paper;\r\n this.validate();\r\n paper.appendDef(this.element);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(LinearGradient.prototype, \"rotation\", {\r\n /**\r\n * @return Rotation\r\n */\r\n get: function () {\r\n return this._rotation;\r\n },\r\n /**\r\n * Rotation (direction) of the gradient in degrees.\r\n *\r\n * @param value Rotation\r\n */\r\n set: function (value) {\r\n //this.element.attr({ \"gradientTransform\": \"rotate(\" + value + \" 10 100)\" });\r\n this._rotation = value;\r\n this.validate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n LinearGradient.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.stops.copyFrom(source.stops);\r\n this._rotation = source.rotation;\r\n };\r\n Object.defineProperty(LinearGradient.prototype, \"gradientUnits\", {\r\n /**\r\n * Which units are used when drawing gradient filter.\r\n *\r\n * Use `\"userSpaceOnUse\"` when applying gradient on a perfectly straight line.\r\n *\r\n * @since 4.9.17\r\n * @default objectBoundingBox\r\n * @param value Filter units\r\n */\r\n set: function (value) {\r\n this.element.attr({ gradientUnits: value });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return LinearGradient;\r\n}(BaseObject));\r\nexport { LinearGradient };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"LinearGradient\"] = LinearGradient;\r\n//# sourceMappingURL=LinearGradient.js.map","/**\r\n * Contains code and logic for generating radial gradients.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../../Base\";\r\nimport { List } from \"../../utils/List\";\r\nimport { getGhostPaper } from \"../Paper\";\r\nimport { registry } from \"../../Registry\";\r\nimport * as $iter from \"../../utils/Iterator\";\r\nimport * as $type from \"../../utils/Type\";\r\nimport { Percent } from \"../../utils/Percent\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Radial gradient class.\r\n */\r\nvar RadialGradient = /** @class */ (function (_super) {\r\n __extends(RadialGradient, _super);\r\n /**\r\n * Constructor\r\n */\r\n function RadialGradient() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * List of colors switch definitions in a gradient.\r\n */\r\n _this._stops = new List();\r\n _this.element = _this.paper.addGroup(\"radialGradient\");\r\n _this.id = \"gradient-\" + registry.getUniqueId();\r\n _this.element.attr({ \"id\": _this.id });\r\n _this._disposers.push(_this.element);\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws gradient.\r\n */\r\n RadialGradient.prototype.draw = function () {\r\n var _this = this;\r\n var gradientElement = this.element;\r\n if ($type.isNumber(this.cx)) {\r\n var value = this.cx;\r\n if (value instanceof Percent) {\r\n value = value.percent + \"%\";\r\n }\r\n gradientElement.attr({ \"cx\": value });\r\n }\r\n if ($type.isNumber(this.cy)) {\r\n var value = this.cy;\r\n if (value instanceof Percent) {\r\n value = value.percent + \"%\";\r\n }\r\n gradientElement.attr({ \"cy\": value });\r\n }\r\n if (this.fx) {\r\n var value = this.fx;\r\n if (value instanceof Percent) {\r\n value = value.percent + \"%\";\r\n }\r\n gradientElement.attr({ \"fx\": value });\r\n }\r\n if (this.fy) {\r\n var value = this.fy;\r\n if (value instanceof Percent) {\r\n value = value.percent + \"%\";\r\n }\r\n gradientElement.attr({ \"fy\": value });\r\n }\r\n gradientElement.removeChildNodes();\r\n $iter.each($iter.indexed(this._stops.iterator()), function (a) {\r\n var i = a[0];\r\n var stop = a[1];\r\n var offset = stop.offset;\r\n if (!$type.isNumber(offset)) {\r\n offset = i / (_this._stops.length - 1);\r\n }\r\n var gradientStop = _this.paper.add(\"stop\");\r\n if ($type.hasValue(stop.color)) {\r\n gradientStop.attr({ \"stop-color\": stop.color.toString() });\r\n }\r\n if ($type.isNumber(stop.opacity)) {\r\n gradientStop.attr({ \"stop-opacity\": stop.opacity });\r\n }\r\n if ($type.isNumber(offset)) {\r\n gradientStop.attr({ \"offset\": offset });\r\n }\r\n gradientElement.add(gradientStop);\r\n });\r\n };\r\n /**\r\n * Adds a color step to the gradient.\r\n *\r\n * @param color Color (hex code or named color)\r\n * @param opacity Opacity (value from 0 to 1; 0 completely transaprent, 1 fully opaque)\r\n * @param offset Position of color in the gradient (value 0 to 1; 0 meaning start of the gradient and 1 end)\r\n */\r\n RadialGradient.prototype.addColor = function (color, opacity, offset) {\r\n this._stops.push({ color: color, opacity: opacity, offset: offset });\r\n this.draw();\r\n };\r\n Object.defineProperty(RadialGradient.prototype, \"paper\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Paper\r\n */\r\n get: function () {\r\n if (this._paper) {\r\n return this._paper;\r\n }\r\n return getGhostPaper();\r\n },\r\n /**\r\n * A [[Paper]] instace to use for the gradient.\r\n *\r\n * @ignore Exclude from docs\r\n * @param paper Paper\r\n */\r\n set: function (paper) {\r\n if (this._paper != paper) {\r\n this._paper = paper;\r\n this.draw();\r\n paper.appendDef(this.element);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RadialGradient.prototype, \"cx\", {\r\n get: function () {\r\n return this._cx;\r\n },\r\n /**\r\n * Center x coordinate of the gradient, can be set as number or Percent\r\n *\r\n * @param point Center point\r\n */\r\n set: function (value) {\r\n this._cx = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RadialGradient.prototype, \"cy\", {\r\n get: function () {\r\n return this._cy;\r\n },\r\n /**\r\n * Center y coordinate of the gradient, can be set as number or Percent\r\n *\r\n * @param point Center point\r\n */\r\n set: function (value) {\r\n this._cy = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RadialGradient.prototype, \"fx\", {\r\n get: function () {\r\n return this._fx;\r\n },\r\n /**\r\n * y coordinate of the focal point of a gradient, can be set in pixels or as Percent\r\n *\r\n * @param point Center point\r\n */\r\n set: function (value) {\r\n this._fx = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RadialGradient.prototype, \"fy\", {\r\n get: function () {\r\n return this._fy;\r\n },\r\n /**\r\n * y coordinate of the focal point of a gradient, can be set in pixels or as Percent\r\n *\r\n * @param point Center point\r\n */\r\n set: function (value) {\r\n this._fy = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n RadialGradient.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.stops.copyFrom(source.stops);\r\n this.cx = source.cx;\r\n this.cy = source.cy;\r\n this.fx = source.fx;\r\n this.fy = source.fy;\r\n };\r\n Object.defineProperty(RadialGradient.prototype, \"stops\", {\r\n /**\r\n * A list of color stops in the gradient.\r\n *\r\n * @return Stops\r\n */\r\n get: function () {\r\n return this._stops;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Clears the gradient.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n RadialGradient.prototype.clear = function () {\r\n this._stops.clear();\r\n };\r\n return RadialGradient;\r\n}(BaseObject));\r\nexport { RadialGradient };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"RadialGradient\"] = RadialGradient;\r\n//# sourceMappingURL=RadialGradient.js.map","/**\r\n * Mouse-related functionality\r\n */\r\n/**\r\n * Defines static methods that hold style list for various mouse cursor styles,\r\n * maintaining browser compatibility.\r\n */\r\nvar MouseCursorStyle = /** @class */ (function () {\r\n function MouseCursorStyle() {\r\n }\r\n /**\r\n * Styles for \"grab\" mouse cursor.\r\n */\r\n MouseCursorStyle.grab = [{\r\n \"property\": \"cursor\",\r\n \"value\": \"move\"\r\n }, {\r\n \"property\": \"cursor\",\r\n \"value\": \"grab\"\r\n }, {\r\n \"property\": \"cursor\",\r\n \"value\": \"-webkit-grab\"\r\n }];\r\n /**\r\n * Styles for \"grabbing\" mouse cursor.\r\n */\r\n MouseCursorStyle.grabbing = [{\r\n \"property\": \"cursor\",\r\n \"value\": \"move\"\r\n }, {\r\n \"property\": \"cursor\",\r\n \"value\": \"grabbing\"\r\n }, {\r\n \"property\": \"cursor\",\r\n \"value\": \"-webkit-grabbing\"\r\n }];\r\n /**\r\n * Styles for \"pointer\" mouse cursor. (usually used for links)\r\n */\r\n MouseCursorStyle.pointer = [{\r\n \"property\": \"cursor\",\r\n \"value\": \"pointer\"\r\n }];\r\n /**\r\n * Styles for default mouse cursor. (browser determines style)\r\n */\r\n MouseCursorStyle.default = [{\r\n \"property\": \"cursor\",\r\n \"value\": \"default\"\r\n }];\r\n /**\r\n * Styles for horizontal bi-directional resize mouse cursor.\r\n */\r\n MouseCursorStyle.horizontalResize = [{\r\n \"property\": \"cursor\",\r\n \"value\": \"ew-resize\"\r\n }];\r\n /**\r\n * Styles for vertical bi-directional mouse cursor.\r\n */\r\n MouseCursorStyle.verticalResize = [{\r\n \"property\": \"cursor\",\r\n \"value\": \"ns-resize\"\r\n }];\r\n /**\r\n * Styles for \"no-allowed\" cursor.\r\n * @since 4.7.15\r\n */\r\n MouseCursorStyle.notAllowed = [{\r\n \"property\": \"cursor\",\r\n \"value\": \"not-allowed\"\r\n }];\r\n /**\r\n * Styles for \"text\" cursor.\r\n * @since 4.9.12\r\n */\r\n MouseCursorStyle.text = [{\r\n \"property\": \"cursor\",\r\n \"value\": \"text\"\r\n }];\r\n return MouseCursorStyle;\r\n}());\r\nexport { MouseCursorStyle };\r\n//# sourceMappingURL=Mouse.js.map","/**\r\n * Handles formatting of pseudo-markup in text.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../Base\";\r\nimport { AMElement } from \"../rendering/AMElement\";\r\nimport { Adapter } from \"../utils/Adapter\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $strings from \"../utils/Strings\";\r\nimport * as $type from \"../utils/Type\";\r\n/**\r\n * Handles formatting of pseudo-markdown in text.\r\n *\r\n * @todo Encode < > in output\r\n * @todo Add more adapters\r\n * @important\r\n */\r\nvar TextFormatter = /** @class */ (function (_super) {\r\n __extends(TextFormatter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function TextFormatter() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Adapter.\r\n */\r\n _this.adapter = new Adapter(_this);\r\n _this.className = \"TextFormatter\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n TextFormatter.prototype.debug = function () { };\r\n /**\r\n * Formats the text according to specifications passed in.\r\n *\r\n * @param text Text to format\r\n * @param output Output format (svg, html)\r\n * @return Formatted text\r\n */\r\n TextFormatter.prototype.format = function (text, output) {\r\n // Apply default\r\n if (!$type.hasValue(output)) {\r\n output = \"svg\";\r\n }\r\n // Init return value\r\n var formatted = \"\";\r\n // Replace double (escaped) square spaces with remporary codes\r\n text = this.escape(text);\r\n // Divvy up the string by style tags\r\n var styles = text.match(/\\[([^\\]]*?)\\]/gm);\r\n if (!styles) {\r\n // Nothing to do here - no formatting elements\r\n return this.wrap(text, \"\", output);\r\n }\r\n // Get pure text - no style tags\r\n var texts = text.split(/\\[[^\\[\\]]*\\]/);\r\n // Go through each of the texts and wrap it in style tags\r\n for (var i = 0, len = texts.length; i < len; i++) {\r\n // Get text bit\r\n var t = texts[i];\r\n // Check if string is empty\r\n if (t === \"\") {\r\n continue;\r\n }\r\n // Run through an adapter\r\n t = this.adapter.apply(\"chunk\", t);\r\n // Get related style\r\n var s = \"\";\r\n if (i > 0) {\r\n s = styles[i - 1].replace('[', '').replace(']', '');\r\n }\r\n // Wrap text in tag\r\n formatted += this.wrap(t, s, output);\r\n }\r\n // Replace placeholders back\r\n formatted = this.unescape(formatted);\r\n // Return result\r\n return this.cleanUp(formatted);\r\n };\r\n /**\r\n * Replaces brackets with temporary placeholders.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Input text\r\n * @return Escaped text\r\n */\r\n TextFormatter.prototype.escape = function (text) {\r\n return text.\r\n replace(/\\[\\[/g, registry.getPlaceholder(\"1\")).\r\n replace(/([^\\/\\]]{1})\\]\\]/g, \"$1\" + registry.getPlaceholder(\"2\")).\r\n replace(/\\]\\]/g, registry.getPlaceholder(\"2\")).\r\n replace(/\\{\\{/g, registry.getPlaceholder(\"3\")).\r\n replace(/\\}\\}/g, registry.getPlaceholder(\"4\")).\r\n replace(/\\'\\'/g, registry.getPlaceholder(\"5\"));\r\n };\r\n /**\r\n * Replaces placeholders back to brackets.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Escaped text\r\n * @return Unescaped text\r\n */\r\n TextFormatter.prototype.unescape = function (text) {\r\n return text.\r\n replace(new RegExp(registry.getPlaceholder(\"1\"), \"g\"), \"[[\").\r\n replace(new RegExp(registry.getPlaceholder(\"2\"), \"g\"), \"]]\").\r\n replace(new RegExp(registry.getPlaceholder(\"3\"), \"g\"), \"{{\").\r\n replace(new RegExp(registry.getPlaceholder(\"4\"), \"g\"), \"}}\").\r\n replace(new RegExp(registry.getPlaceholder(\"5\"), \"g\"), \"''\");\r\n };\r\n /**\r\n * Cleans up the text text for leftover double square brackets.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Input text\r\n * @return Cleaned up text\r\n */\r\n TextFormatter.prototype.cleanUp = function (text) {\r\n return text.\r\n replace(/\\[\\[/g, \"[\").\r\n replace(/\\]\\]/g, \"]\").\r\n replace(/\\{\\{/g, \"{\").\r\n replace(/\\}\\}/g, \"}\").\r\n replace(/\\'\\'/g, \"'\");\r\n };\r\n /**\r\n * Wraps text into corresponding tags.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Text to wrap\r\n * @param style Styles\r\n * @param output Format to output in (svg, html)\r\n * @return Formatted string\r\n */\r\n TextFormatter.prototype.wrap = function (text, style, output) {\r\n if (style === \"\" || style === \"/\") {\r\n //return text;\r\n style = \"\";\r\n }\r\n switch (output) {\r\n case \"html\":\r\n return this.wrapHtml(text, this.translateStyleShortcuts(style));\r\n default:\r\n return this.wrapSvg(text, this.translateStyleShortcuts(style));\r\n }\r\n };\r\n /**\r\n * Wraps text in styled SVG tag.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Text to wrap\r\n * @param style Style property\r\n * @return Formatted tag\r\n */\r\n TextFormatter.prototype.wrapSvg = function (text, style) {\r\n if (style === \"\") {\r\n return \"\" + text + \"\";\r\n }\r\n else {\r\n return \"\" + text + \"\";\r\n }\r\n };\r\n /**\r\n * Returns an SVG `` element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Text\r\n * @param style Style\r\n * @return Element\r\n */\r\n TextFormatter.prototype.getSvgElement = function (text, style) {\r\n var element = new AMElement(\"tspan\");\r\n element.textContent = text;\r\n if (style) {\r\n element.node.setAttribute(\"style\", style);\r\n }\r\n return element;\r\n };\r\n /**\r\n * Wraps text in HTML tag.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Text to wrap\r\n * @param style Style property\r\n * @return Formatted tag\r\n * @todo Translate SVG styles into HTML ones\r\n */\r\n TextFormatter.prototype.wrapHtml = function (text, style) {\r\n if (style === \"\") {\r\n return \"\" + text + \"\";\r\n }\r\n else {\r\n return \"\" + text + \"\";\r\n }\r\n };\r\n /**\r\n * Returns an HTML `` element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Text/HTML\r\n * @param style Style definition\r\n * @return HTML element\r\n */\r\n TextFormatter.prototype.getHtmlElement = function (text, style) {\r\n var element = document.createElement(\"span\");\r\n element.innerHTML = text;\r\n if (style) {\r\n element.setAttribute(\"style\", style);\r\n }\r\n return element;\r\n };\r\n /**\r\n * Trabslates SVG CSS into HTML CSS.\r\n *\r\n * @ignore Exclude from docs\r\n * @param style SVG CSS\r\n * @return HTML CSS\r\n * @todo Implement actual translation\r\n */\r\n TextFormatter.prototype.styleSvgToHtml = function (style) {\r\n style = style.replace(/fill:/, \"color:\");\r\n return style;\r\n };\r\n /**\r\n * Translates style shortcuts into full styles, i.e.:\r\n * \"bold\" => \"font-weight: bold\"\r\n * \"#f00\" => \"fill: #f00\"\r\n *\r\n * @ignore Exclude from docs\r\n * @param style Untranslated style\r\n * @return Translated style\r\n * @todo Implement actual translation\r\n */\r\n TextFormatter.prototype.translateStyleShortcuts = function (style) {\r\n if (style == \"\" || style == \"[ ]\") {\r\n return \"\";\r\n }\r\n var cached = registry.getCache(\"translateStyleShortcuts_\" + style);\r\n if (cached) {\r\n return cached;\r\n }\r\n // Pre-process quoted text\r\n var q = style.match(/('[^']*')|(\"[^\"]*\")/gi);\r\n if (q) {\r\n for (var i = 0; i < q.length; i++) {\r\n style = style.replace(q[i], q[i].replace(/['\"]*/g, \"\").replace(/[ ]+/g, \"+\"));\r\n }\r\n }\r\n // Get style parts\r\n var b = style.match(/([\\w\\-]*:[\\s]?[^;\\s\\]]*)|(\\#[\\w]{1,6})|([\\w]+)|(\\/)/gi);\r\n // Empty?\r\n if (!b) {\r\n return style;\r\n }\r\n // Check each part\r\n for (var i = 0; i < b.length; i++) {\r\n if (b[i].match(/^bold$/i)) {\r\n // Bold\r\n b[i] = \"font-weight:\" + b[i];\r\n }\r\n else if (b[i] == \"/\") {\r\n // Just closing tag\r\n // Do nothing\r\n b[i] = \"\";\r\n }\r\n else if (!b[i].match(/:/)) {\r\n // Color\r\n b[i] = \"fill:\" + b[i];\r\n }\r\n else {\r\n b[i] = b[i].replace(/\\+/g, \" \");\r\n }\r\n }\r\n var res = b.join(';');\r\n registry.setCache(\"translateStyleShortcuts_\" + style, res);\r\n return res;\r\n };\r\n /**\r\n * Splits string into chunks. (style blocks, quoted blocks, regular blocks)\r\n *\r\n * If the second parameter `quotedBlocks` is set to `true` this method will\r\n * also single out text blocks enclosed within single quotes that no\r\n * formatting should be applied to, and they should be displayed as is.\r\n *\r\n * Default for the above is `false`, so that you can use single quote in text\r\n * without escaping it.\r\n *\r\n * If enabled, single quotes can be escaped by doubling it - adding two\r\n * single quotes, which will be replaced by a one single quote in the final\r\n * output.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Text to chunk\r\n * @param quotedBlocks Use quoted blocks\r\n * @param noFormatting Formatting blocks will be treated as regular text\r\n * @return Array of string chunks\r\n */\r\n TextFormatter.prototype.chunk = function (text, quotedBlocks, noFormatting) {\r\n if (quotedBlocks === void 0) { quotedBlocks = false; }\r\n if (noFormatting === void 0) { noFormatting = false; }\r\n // Init result\r\n var res = [];\r\n // Replace double (escaped) square spaces and quotes with temporary codes\r\n text = this.escape(text);\r\n // Deal with style blocks\r\n var chunks = quotedBlocks ? text.split(\"'\") : [text];\r\n for (var i = 0; i < chunks.length; i++) {\r\n var chunk = chunks[i];\r\n // Empty?\r\n if (chunk === \"\") {\r\n continue;\r\n }\r\n if ((i % 2) === 0) {\r\n // Text outside quotes\r\n // Parse for style blocks which are \"text\" chunks, the rest chunks are\r\n // \"value\"\r\n chunk = chunk.replace(/\\]\\[/g, \"]\" + $strings.PLACEHOLDER + \"[\");\r\n chunk = chunk.replace(/\\[\\]/g, \"[ ]\");\r\n var chunks2 = chunk.split(/[\\[\\]]+/);\r\n for (var i2 = 0; i2 < chunks2.length; i2++) {\r\n var chunk2 = this.cleanUp(this.unescape(chunks2[i2]));\r\n // Placeholder?\r\n if (chunk2 === $strings.PLACEHOLDER) {\r\n continue;\r\n }\r\n // Empty?\r\n if (chunk2 === \"\") {\r\n continue;\r\n }\r\n // Block or value\r\n if ((i2 % 2) === 0) {\r\n res.push({\r\n \"type\": \"value\",\r\n \"text\": this.adapter.apply(\"chunk\", chunk2)\r\n });\r\n }\r\n else {\r\n res.push({\r\n \"type\": noFormatting ? \"value\" : \"format\",\r\n \"text\": \"[\" + chunk2 + \"]\"\r\n });\r\n }\r\n }\r\n }\r\n else {\r\n // A text within doublequotes\r\n // All chunks are \"text\"\r\n var chunks2 = chunk.split(/[\\[\\]]+/);\r\n for (var i2 = 0; i2 < chunks2.length; i2++) {\r\n var chunk2 = this.cleanUp(this.unescape(chunks2[i2]));\r\n // Empty?\r\n if (chunk2 === \"\") {\r\n continue;\r\n }\r\n // Block or text\r\n if ((i2 % 2) === 0) {\r\n res.push({\r\n \"type\": \"text\",\r\n \"text\": chunk2\r\n });\r\n }\r\n else if (this.isImage(chunk2)) {\r\n res.push({\r\n \"type\": \"image\",\r\n \"text\": \"[\" + chunk2 + \"]\"\r\n });\r\n }\r\n else {\r\n res.push({\r\n \"type\": \"format\",\r\n \"text\": \"[\" + chunk2 + \"]\"\r\n });\r\n }\r\n }\r\n }\r\n }\r\n return res;\r\n };\r\n /**\r\n * Checks if supplied format contains image information and should be\r\n * formatted as such.\r\n * I.e.: `[img: myImage.png]`\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Format\r\n * @return `true` if it is an image\r\n */\r\n TextFormatter.prototype.isImage = function (text) {\r\n return text.match(/img[ ]?:/) ? true : false;\r\n };\r\n return TextFormatter;\r\n}(BaseObject));\r\nexport { TextFormatter };\r\nvar formatter;\r\n/**\r\n * Returns the global instance of [[TextFormatter]].\r\n *\r\n * All classes and instances should reuse this universal text formatter,\r\n * rather than create their own instance of it.\r\n */\r\nexport function getTextFormatter() {\r\n if (formatter == null) {\r\n formatter = new TextFormatter();\r\n }\r\n return formatter;\r\n}\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"TextFormatter\"] = TextFormatter;\r\n//# sourceMappingURL=TextFormatter.js.map","/**\r\n * amCharts 4 locale\r\n *\r\n * Locale: en\r\n * Language: International English\r\n * Author: Martynas Majeris\r\n *\r\n * Follow instructions in [on this page](https://www.amcharts.com/docs/v4/tutorials/creating-translations/) to make corrections or add new translations.\r\n *\r\n * ---\r\n * Edit but leave the header section above this line. You can remove any\r\n * subsequent comment sections.\r\n * ---\r\n *\r\n * Use this file as a template to create translations. Leave the key part in\r\n * English intact. Fill the value with a translation.\r\n *\r\n * Empty string means no translation, so default \"International English\"\r\n * will be used.\r\n *\r\n * If you need the translation to literally be an empty string, use `null`\r\n * instead.\r\n *\r\n * IMPORTANT:\r\n * When translating make good effort to keep the translation length\r\n * at least the same chartcount as the English, especially for short prompts.\r\n *\r\n * Having significantly longer prompts may distort the actual charts.\r\n *\r\n * NOTE:\r\n * Some prompts - like months or weekdays - come in two versions: full and\r\n * shortened.\r\n *\r\n * If there's no official shortened version of these in your language, and it\r\n * would not be possible to invent such short versions that don't seem weird\r\n * to native speakers of that language, fill those with the same as full\r\n * version.\r\n *\r\n * PLACEHOLDERS:\r\n * Some prompts have placeholders like \"%1\". Those will be replaced by actual\r\n * values during translation and should be retained in the translated prompts.\r\n *\r\n * Placeholder positions may be changed to better suit structure of the\r\n * sentence.\r\n *\r\n * For example \"From %1 to %2\", when actually used will replace \"%1\" with an\r\n * actual value representing range start, and \"%2\" will be replaced by end\r\n * value.\r\n *\r\n * E.g. in a Scrollbar for Value axis \"From %1 to %2\" will become\r\n * \"From 100 to 200\". You may translate \"From\" and \"to\", as well as re-arrange\r\n * the order of the prompt itself, but make sure the \"%1\" and \"%2\" remain, in\r\n * places where they will make sense.\r\n *\r\n * Save the file as language_LOCALE, i.e. `en_GB.ts`, `fr_FR.ts`, etc.\r\n */\r\nexport default {\r\n // Number formatting options.\r\n // \r\n // Please check with the local standards which separator is accepted to be\r\n // used for separating decimals, and which for thousands.\r\n \"_decimalSeparator\": \".\",\r\n \"_thousandSeparator\": \",\",\r\n // Position of the percent sign in numbers\r\n \"_percentPrefix\": null,\r\n \"_percentSuffix\": \"%\",\r\n // Suffixes for numbers\r\n // When formatting numbers, big or small numers might be reformatted to\r\n // shorter version, by applying a suffix.\r\n // \r\n // For example, 1000000 might become \"1m\".\r\n // Or 1024 might become \"1KB\" if we're formatting byte numbers.\r\n // \r\n // This section defines such suffixes for all such cases.\r\n \"_big_number_suffix_3\": \"k\",\r\n \"_big_number_suffix_6\": \"M\",\r\n \"_big_number_suffix_9\": \"G\",\r\n \"_big_number_suffix_12\": \"T\",\r\n \"_big_number_suffix_15\": \"P\",\r\n \"_big_number_suffix_18\": \"E\",\r\n \"_big_number_suffix_21\": \"Z\",\r\n \"_big_number_suffix_24\": \"Y\",\r\n \"_small_number_suffix_3\": \"m\",\r\n \"_small_number_suffix_6\": \"μ\",\r\n \"_small_number_suffix_9\": \"n\",\r\n \"_small_number_suffix_12\": \"p\",\r\n \"_small_number_suffix_15\": \"f\",\r\n \"_small_number_suffix_18\": \"a\",\r\n \"_small_number_suffix_21\": \"z\",\r\n \"_small_number_suffix_24\": \"y\",\r\n \"_byte_suffix_B\": \"B\",\r\n \"_byte_suffix_KB\": \"KB\",\r\n \"_byte_suffix_MB\": \"MB\",\r\n \"_byte_suffix_GB\": \"GB\",\r\n \"_byte_suffix_TB\": \"TB\",\r\n \"_byte_suffix_PB\": \"PB\",\r\n // Default date formats for various periods.\r\n // \r\n // This should reflect official or de facto formatting universally accepted\r\n // in the country translation is being made for\r\n // Available format codes here:\r\n // https://www.amcharts.com/docs/v4/concepts/formatters/formatting-date-time/#Format_codes\r\n // \r\n // This will be used when formatting date/time for particular granularity,\r\n // e.g. \"_date_hour\" will be shown whenever we need to show time as hours.\r\n // \r\n // \"date\" is used as in default date format when showing standalone dates.\r\n \"_date\": \"yyyy-MM-dd\",\r\n \"_date_millisecond\": \"mm:ss SSS\",\r\n \"_date_second\": \"HH:mm:ss\",\r\n \"_date_minute\": \"HH:mm\",\r\n \"_date_hour\": \"HH:mm\",\r\n \"_date_day\": \"MMM dd\",\r\n \"_date_week\": \"ww\",\r\n \"_date_month\": \"MMM\",\r\n \"_date_year\": \"yyyy\",\r\n // Default duration formats for various base units.\r\n // \r\n // This will be used by DurationFormatter to format numeric values into\r\n // duration.\r\n // \r\n // Notice how each duration unit comes in several versions. This is to ensure\r\n // that each base unit is shown correctly.\r\n // \r\n // For example, if we have baseUnit set to \"second\", meaning our duration is\r\n // in seconds.\r\n // \r\n // If we pass in `50` to formatter, it will know that we have just 50 seconds\r\n // (less than a minute) so it will use format in `\"_duration_second\"` (\"ss\"),\r\n // and the formatted result will be in like `\"50\"`.\r\n // \r\n // If we pass in `70`, which is more than a minute, the formatter will switch\r\n // to `\"_duration_second_minute\"` (\"mm:ss\"), resulting in \"01:10\" formatted\r\n // text.\r\n // \r\n // Available codes here:\r\n // https://www.amcharts.com/docs/v4/concepts/formatters/formatting-duration/#Available_Codes\r\n \"_duration_millisecond\": \"SSS\",\r\n \"_duration_millisecond_second\": \"ss.SSS\",\r\n \"_duration_millisecond_minute\": \"mm:ss SSS\",\r\n \"_duration_millisecond_hour\": \"hh:mm:ss SSS\",\r\n \"_duration_millisecond_day\": \"d'd' mm:ss SSS\",\r\n \"_duration_millisecond_week\": \"d'd' mm:ss SSS\",\r\n \"_duration_millisecond_month\": \"M'm' dd'd' mm:ss SSS\",\r\n \"_duration_millisecond_year\": \"y'y' MM'm' dd'd' mm:ss SSS\",\r\n \"_duration_second\": \"ss\",\r\n \"_duration_second_minute\": \"mm:ss\",\r\n \"_duration_second_hour\": \"hh:mm:ss\",\r\n \"_duration_second_day\": \"d'd' hh:mm:ss\",\r\n \"_duration_second_week\": \"d'd' hh:mm:ss\",\r\n \"_duration_second_month\": \"M'm' dd'd' hh:mm:ss\",\r\n \"_duration_second_year\": \"y'y' MM'm' dd'd' hh:mm:ss\",\r\n \"_duration_minute\": \"mm\",\r\n \"_duration_minute_hour\": \"hh:mm\",\r\n \"_duration_minute_day\": \"d'd' hh:mm\",\r\n \"_duration_minute_week\": \"d'd' hh:mm\",\r\n \"_duration_minute_month\": \"M'm' dd'd' hh:mm\",\r\n \"_duration_minute_year\": \"y'y' MM'm' dd'd' hh:mm\",\r\n \"_duration_hour\": \"hh'h'\",\r\n \"_duration_hour_day\": \"d'd' hh'h'\",\r\n \"_duration_hour_week\": \"d'd' hh'h'\",\r\n \"_duration_hour_month\": \"M'm' dd'd' hh'h'\",\r\n \"_duration_hour_year\": \"y'y' MM'm' dd'd' hh'h'\",\r\n \"_duration_day\": \"d'd'\",\r\n \"_duration_day_week\": \"d'd'\",\r\n \"_duration_day_month\": \"M'm' dd'd'\",\r\n \"_duration_day_year\": \"y'y' MM'm' dd'd'\",\r\n \"_duration_week\": \"w'w'\",\r\n \"_duration_week_month\": \"w'w'\",\r\n \"_duration_week_year\": \"w'w'\",\r\n \"_duration_month\": \"M'm'\",\r\n \"_duration_month_year\": \"y'y' MM'm'\",\r\n \"_duration_year\": \"y'y'\",\r\n // Era translations\r\n \"_era_ad\": \"AD\",\r\n \"_era_bc\": \"BC\",\r\n // Day part, used in 12-hour formats, e.g. 5 P.M.\r\n // Please note that these come in 3 variants:\r\n // * one letter (e.g. \"A\")\r\n // * two letters (e.g. \"AM\")\r\n // * two letters with dots (e.g. \"A.M.\")\r\n // \r\n // All three need to to be translated even if they are all the same. Some\r\n // users might use one, some the other.\r\n \"A\": \"\",\r\n \"P\": \"\",\r\n \"AM\": \"\",\r\n \"PM\": \"\",\r\n \"A.M.\": \"\",\r\n \"P.M.\": \"\",\r\n // Date-related stuff.\r\n // \r\n // When translating months, if there's a difference, use the form which is\r\n // best for a full date, e.g. as you would use it in \"2018 January 1\".\r\n // \r\n // Note that May is listed twice. This is because in English May is the same\r\n // in both long and short forms, while in other languages it may not be the\r\n // case. Translate \"May\" to full word, while \"May(short)\" to shortened\r\n // version.\r\n // \r\n // Should month names and weekdays be capitalized or not?\r\n // \r\n // Rule of thumb is this: if the names should always be capitalized,\r\n // regardless of name position within date (\"January\", \"21st January 2018\",\r\n // etc.) use capitalized names. Otherwise enter all lowercase.\r\n // \r\n // The date formatter will automatically capitalize names if they are the\r\n // first (or only) word in resulting date.\r\n \"January\": \"\",\r\n \"February\": \"\",\r\n \"March\": \"\",\r\n \"April\": \"\",\r\n \"May\": \"\",\r\n \"June\": \"\",\r\n \"July\": \"\",\r\n \"August\": \"\",\r\n \"September\": \"\",\r\n \"October\": \"\",\r\n \"November\": \"\",\r\n \"December\": \"\",\r\n \"Jan\": \"\",\r\n \"Feb\": \"\",\r\n \"Mar\": \"\",\r\n \"Apr\": \"\",\r\n \"May(short)\": \"May\",\r\n \"Jun\": \"\",\r\n \"Jul\": \"\",\r\n \"Aug\": \"\",\r\n \"Sep\": \"\",\r\n \"Oct\": \"\",\r\n \"Nov\": \"\",\r\n \"Dec\": \"\",\r\n // Weekdays.\r\n \"Sunday\": \"\",\r\n \"Monday\": \"\",\r\n \"Tuesday\": \"\",\r\n \"Wednesday\": \"\",\r\n \"Thursday\": \"\",\r\n \"Friday\": \"\",\r\n \"Saturday\": \"\",\r\n \"Sun\": \"\",\r\n \"Mon\": \"\",\r\n \"Tue\": \"\",\r\n \"Wed\": \"\",\r\n \"Thu\": \"\",\r\n \"Fri\": \"\",\r\n \"Sat\": \"\",\r\n // Date ordinal function.\r\n // \r\n // This is used when adding number ordinal when formatting days in dates.\r\n // \r\n // E.g. \"January 1st\", \"February 2nd\".\r\n // \r\n // The function accepts day number, and returns a string to be added to the\r\n // day, like in default English translation, if we pass in 2, we will receive\r\n // \"nd\" back.\r\n \"_dateOrd\": function (day) {\r\n var res = \"th\";\r\n if ((day < 11) || (day > 13)) {\r\n switch (day % 10) {\r\n case 1:\r\n res = \"st\";\r\n break;\r\n case 2:\r\n res = \"nd\";\r\n break;\r\n case 3:\r\n res = \"rd\";\r\n break;\r\n }\r\n }\r\n return res;\r\n },\r\n // Various chart controls.\r\n // Shown as a tooltip on zoom out button.\r\n \"Zoom Out\": \"\",\r\n // Timeline buttons\r\n \"Play\": \"\",\r\n \"Stop\": \"\",\r\n // Chart's Legend screen reader title.\r\n \"Legend\": \"\",\r\n // Legend's item screen reader indicator.\r\n \"Click, tap or press ENTER to toggle\": \"\",\r\n // Shown when the chart is busy loading something.\r\n \"Loading\": \"\",\r\n // Shown as the first button in the breadcrumb navigation, e.g.:\r\n // Home > First level > ...\r\n \"Home\": \"\",\r\n // Chart types.\r\n // Those are used as default screen reader titles for the main chart element\r\n // unless developer has set some more descriptive title.\r\n \"Chart\": \"\",\r\n \"Serial chart\": \"\",\r\n \"X/Y chart\": \"\",\r\n \"Pie chart\": \"\",\r\n \"Gauge chart\": \"\",\r\n \"Radar chart\": \"\",\r\n \"Sankey diagram\": \"\",\r\n \"Flow diagram\": \"\",\r\n \"Chord diagram\": \"\",\r\n \"TreeMap chart\": \"\",\r\n \"Force directed tree\": \"\",\r\n \"Sliced chart\": \"\",\r\n // Series types.\r\n // Used to name series by type for screen readers if they do not have their\r\n // name set.\r\n \"Series\": \"\",\r\n \"Candlestick Series\": \"\",\r\n \"OHLC Series\": \"\",\r\n \"Column Series\": \"\",\r\n \"Line Series\": \"\",\r\n \"Pie Slice Series\": \"\",\r\n \"Funnel Series\": \"\",\r\n \"Pyramid Series\": \"\",\r\n \"X/Y Series\": \"\",\r\n // Map-related stuff.\r\n \"Map\": \"\",\r\n \"Press ENTER to zoom in\": \"\",\r\n \"Press ENTER to zoom out\": \"\",\r\n \"Use arrow keys to zoom in and out\": \"\",\r\n \"Use plus and minus keys on your keyboard to zoom in and out\": \"\",\r\n // Export-related stuff.\r\n // These prompts are used in Export menu labels.\r\n // \r\n // \"Export\" is the top-level menu item.\r\n // \r\n // \"Image\", \"Data\", \"Print\" as second-level indicating type of export\r\n // operation.\r\n // \r\n // Leave actual format untranslated, unless you absolutely know that they\r\n // would convey more meaning in some other way.\r\n \"Export\": \"\",\r\n \"Image\": \"\",\r\n \"Data\": \"\",\r\n \"Print\": \"\",\r\n \"Press ENTER or use arrow keys to navigate\": \"\",\r\n \"Click, tap or press ENTER to open\": \"\",\r\n \"Click, tap or press ENTER to print.\": \"\",\r\n \"Click, tap or press ENTER to export as %1.\": \"\",\r\n 'To save the image, right-click this link and choose \"Save picture as...\"': \"\",\r\n 'To save the image, right-click thumbnail on the left and choose \"Save picture as...\"': \"\",\r\n \"(Press ESC to close this message)\": \"\",\r\n \"Image Export Complete\": \"\",\r\n \"Export operation took longer than expected. Something might have gone wrong.\": \"\",\r\n \"Saved from\": \"\",\r\n \"PNG\": \"\",\r\n \"JPG\": \"\",\r\n \"GIF\": \"\",\r\n \"SVG\": \"\",\r\n \"PDF\": \"\",\r\n \"JSON\": \"\",\r\n \"CSV\": \"\",\r\n \"XLSX\": \"\",\r\n // Scrollbar-related stuff.\r\n // \r\n // Scrollbar is a control which can zoom and pan the axes on the chart.\r\n // \r\n // Each scrollbar has two grips: left or right (for horizontal scrollbar) or\r\n // upper and lower (for vertical one).\r\n // \r\n // Prompts change in relation to whether Scrollbar is vertical or horizontal.\r\n // \r\n // The final section is used to indicate the current range of selection.\r\n \"Use TAB to select grip buttons or left and right arrows to change selection\": \"\",\r\n \"Use left and right arrows to move selection\": \"\",\r\n \"Use left and right arrows to move left selection\": \"\",\r\n \"Use left and right arrows to move right selection\": \"\",\r\n \"Use TAB select grip buttons or up and down arrows to change selection\": \"\",\r\n \"Use up and down arrows to move selection\": \"\",\r\n \"Use up and down arrows to move lower selection\": \"\",\r\n \"Use up and down arrows to move upper selection\": \"\",\r\n \"From %1 to %2\": \"\",\r\n \"From %1\": \"\",\r\n \"To %1\": \"\",\r\n // Data loader-related.\r\n \"No parser available for file: %1\": \"\",\r\n \"Error parsing file: %1\": \"\",\r\n \"Unable to load file: %1\": \"\",\r\n \"Invalid date\": \"\",\r\n // Common actions\r\n \"Close\": \"\",\r\n \"Minimize\": \"\"\r\n};\r\n//# sourceMappingURL=en.js.map","/**\r\n * Language module contains everything related to language-specific operations:\r\n * * Translating prompts\r\n * * Translating functions\r\n * * Date format localizations\r\n */\r\nimport { __extends, __read, __spread } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObjectEvents } from \"../Base\";\r\nimport { Adapter } from \"./Adapter\";\r\nimport * as $array from \"./Array\";\r\nimport * as $type from \"./Type\";\r\nimport en from \"../../../lang/en\";\r\nimport { options } from \"../Options\";\r\n;\r\n;\r\n/**\r\n * Handles all language-related tasks, like loading and storing translations,\r\n * translating prompts, lists of prompts and even functions.\r\n *\r\n * Almost every object in amCharts4 universe will have a `language` property,\r\n * which can be accessed for prompt translation.\r\n *\r\n * @see {@link ILanguageAdapters} for a list of available Adapters\r\n * @todo Make prompt keys case-insensitive\r\n * @important\r\n */\r\nvar Language = /** @class */ (function (_super) {\r\n __extends(Language, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Language() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Adapter.\r\n */\r\n _this.adapter = new Adapter(_this);\r\n /**\r\n * Current locale.\r\n */\r\n _this._locale = en;\r\n /**\r\n * Default locale. A locale to fall back to if none is specified, or\r\n * if there's no translation for the prompt for the current language.\r\n */\r\n _this._defaultLocale = en;\r\n _this.className = \"Language\";\r\n // Set default language if necessary\r\n if ($type.hasValue(options.defaultLocale)) {\r\n _this.locale = options.defaultLocale;\r\n }\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Returns locale that is currently used.\r\n *\r\n * @param locale Force locale. Will use current language if not set.\r\n * @return Locale\r\n */\r\n Language.prototype.getLocale = function (locale) {\r\n if (locale == null) {\r\n locale = this._locale;\r\n }\r\n return this.adapter.apply(\"locale\", {\r\n locale: locale\r\n }).locale;\r\n };\r\n /**\r\n * Returns the translation of the string.\r\n *\r\n * If the translation is empty, it will return untranslated prompt.\r\n *\r\n * Third parameter and up are strings that can be used to replace \"%X\"\r\n * placeholders in prompt.\r\n *\r\n * E.g.:\r\n *\r\n * ```TypeScript\r\n * // Results in \"This is a first translation test\"\r\n * chart.language.translate(\"This is a %1 translation %2\", null, \"first\", \"test\");\r\n * ```\r\n * ```JavaScriptScript\r\n * // Results in \"This is a first translation test\"\r\n * chart.language.translate(\"This is a %1 translation %2\", null, \"first\", \"test\");\r\n * ```\r\n *\r\n * @param prompt A string to translate\r\n * @param locale Force translation into specific locale, e.g. fr_FR\r\n * @param rest Parameters to replace in string\r\n * @return Translation\r\n */\r\n Language.prototype.translate = function (prompt, locale) {\r\n var rest = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n rest[_i - 2] = arguments[_i];\r\n }\r\n // Get langauge\r\n locale = this.getLocale(locale);\r\n // Init translation\r\n var translation = prompt;\r\n // Get translations for the locale\r\n var translations = this.getTranslations(locale);\r\n var value = translations[prompt];\r\n // Try to look for the translation\r\n if (value === null) {\r\n translation = \"\";\r\n }\r\n else if ($type.hasValue(value)) {\r\n // It might be an empty string\r\n if (value) {\r\n translation = value;\r\n }\r\n }\r\n else if (locale !== this._defaultLocale) {\r\n // Try to look in default language\r\n return this.translate.apply(this, __spread([prompt, this._defaultLocale], rest));\r\n }\r\n // Replace %1, %2, etc params\r\n if (rest.length) {\r\n for (var len = rest.length, i = 0; i < len; ++i) {\r\n translation = translation.split(\"%\" + (i + 1)).join(rest[i]);\r\n }\r\n }\r\n // Return the translation\r\n return this.adapter.apply(\"translate\", {\r\n translation: translation,\r\n locale: locale\r\n }).translation;\r\n };\r\n /**\r\n * Non-type-checked translation.\r\n *\r\n * Can be used by plugins and other code that may have their own non-standard\r\n * translation prompts.\r\n *\r\n * @since 4.5.5\r\n * @param prompt A string to translate\r\n * @param locale Force translation into specific locale, e.g. fr_FR\r\n * @param rest Parameters to replace in string\r\n * @return Translation\r\n */\r\n Language.prototype.translateAny = function (prompt, locale) {\r\n var rest = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n rest[_i - 2] = arguments[_i];\r\n }\r\n return this.translate.apply(this, __spread([prompt, locale], rest));\r\n };\r\n /**\r\n * Sets a prompt translation.\r\n *\r\n * @since 4.9.35\r\n * @param prompt Prompt in English\r\n * @param translation Translation\r\n * @param locale Locale\r\n */\r\n Language.prototype.setTranslationAny = function (prompt, translation, locale) {\r\n var localeTarget = locale || this.locale;\r\n localeTarget[prompt] = translation;\r\n };\r\n /**\r\n * Translates prompt.\r\n *\r\n * If translation is empty, it will return empty string, which is a different\r\n * behavior than that of regular `translate`.\r\n *\r\n * @param prompt A string to translate\r\n * @param locale Force translation into specific locale, e.g. fr_FR\r\n * @param ...rest Parameters to replace in string\r\n * @return Translation\r\n */\r\n Language.prototype.translateEmpty = function (prompt, locale) {\r\n var rest = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n rest[_i - 2] = arguments[_i];\r\n }\r\n var translation = this.translate.apply(this, __spread([prompt, locale], rest));\r\n return translation == prompt ? \"\" : translation;\r\n };\r\n /**\r\n * Translates a function.\r\n *\r\n * This method will return a function reference, but will not run it. It's\r\n * up to the caller script to run the function.\r\n *\r\n * @param prompt A function id to translate\r\n * @param locale Force translation into specific locale. e.g. fr_FR\r\n * @return A language-specific version of the function\r\n * @todo Apply adapter\r\n */\r\n Language.prototype.translateFunc = function (prompt, locale) {\r\n // Get langauge\r\n locale = this.getLocale(locale);\r\n // Get translations for the locale\r\n var translations = this.getTranslations(locale);\r\n var value = translations[prompt];\r\n // Try to look for the translation\r\n if (value != null) {\r\n return value;\r\n }\r\n // Try to look in default language\r\n if (locale !== this._defaultLocale) {\r\n return this.translateFunc(prompt, this._defaultLocale);\r\n }\r\n // Fail - return empty function\r\n return function () {\r\n return \"\";\r\n };\r\n };\r\n /**\r\n * Translates a list of prompts in one go.\r\n *\r\n * @param list An array of strings to translate\r\n * @param locale Force translation into specific locale. e.g. fr_FR\r\n * @return An array of translated strings in the same order as source list\r\n */\r\n Language.prototype.translateAll = function (list, locale) {\r\n var _this = this;\r\n // Translate all items in the list\r\n if (!this.isDefault()) {\r\n return $array.map(list, function (x) { return _this.translate(x, locale); });\r\n }\r\n else {\r\n return list;\r\n }\r\n };\r\n /**\r\n * Returns `true` if the currently selected locale is a default locale.\r\n *\r\n * @return `true` if locale is default; `false` if it is not.\r\n */\r\n Language.prototype.isDefault = function () {\r\n return this._defaultLocale === this._locale;\r\n };\r\n Object.defineProperty(Language.prototype, \"locale\", {\r\n /**\r\n * @return Locale definition\r\n */\r\n get: function () {\r\n return this._locale;\r\n },\r\n /**\r\n * Current locale.\r\n *\r\n * @param value Locale definition (translations)\r\n */\r\n set: function (value) {\r\n if (this._locale != value) {\r\n this._locale = value;\r\n if (this.events.isEnabled(\"localechanged\")) {\r\n var event_1 = {\r\n type: \"localechanged\",\r\n locale: value,\r\n target: this\r\n };\r\n this.events.dispatchImmediately(\"localechanged\", event_1);\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns translations for a given locale.\r\n *\r\n * @ignore\r\n * @deprecated\r\n * @param locale Locale\r\n * @return Translations\r\n */\r\n Language.prototype.getTranslations = function (locale) {\r\n return this.adapter.apply(\"translations\", {\r\n translations: locale,\r\n locale: locale\r\n }).translations;\r\n };\r\n return Language;\r\n}(BaseObjectEvents));\r\nexport { Language };\r\n//# sourceMappingURL=Language.js.map","/**\r\n * Number formatting-related functionality.\r\n */\r\nimport { __extends } from \"tslib\";\r\nimport { Language } from \"../utils/Language\";\r\nimport { BaseObject } from \"../Base\";\r\nimport { getTextFormatter } from \"../formatters/TextFormatter\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $strings from \"../utils/Strings\";\r\nimport * as $object from \"../utils/Object\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $math from \"../utils/Math\";\r\n/**\r\n * NumberFormatter class. Formats numbers according to specified formats.\r\n *\r\n * @todo Apply translations to suffixes/prefixes\r\n */\r\nvar NumberFormatter = /** @class */ (function (_super) {\r\n __extends(NumberFormatter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function NumberFormatter() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * A base value for negative numbers. Will treat all numbers below this value\r\n * as negative numbers.\r\n */\r\n _this._negativeBase = 0;\r\n /**\r\n * Holds number format.\r\n *\r\n * @default #,###.#####\r\n */\r\n _this._numberFormat = \"#,###.#####\";\r\n /**\r\n * Output format to produce. If the format calls for applying color to the\r\n * formatted value, this setting will determine what markup to use: SVG or\r\n * HTML.\r\n *\r\n * Available options: svg, html.\r\n *\r\n * @default \"svg\"\r\n */\r\n _this._outputFormat = \"svg\";\r\n /**\r\n * Any number smaller than this will be considered \"small\" number, which will\r\n * trigger special formatting if \"a\" format modifier is used.\r\n */\r\n _this._smallNumberThreshold = 1.00;\r\n _this._forceLTR = false;\r\n _this.className = \"NumberFormatter\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n NumberFormatter.prototype.dispose = function () {\r\n _super.prototype.dispose.call(this);\r\n if (this.language) {\r\n this.language.dispose();\r\n }\r\n };\r\n Object.defineProperty(NumberFormatter.prototype, \"language\", {\r\n /**\r\n * @return Language\r\n */\r\n get: function () {\r\n if (!this._language) {\r\n if (this.sprite) {\r\n this._language = this.sprite.language;\r\n }\r\n else {\r\n this._language = new Language;\r\n }\r\n }\r\n return this._language;\r\n },\r\n /**\r\n * A reference to [[Language]] instance.\r\n *\r\n * Formatter will use language to translate various items, like number\r\n * suffixes, etc.\r\n *\r\n * @param value Language\r\n */\r\n set: function (value) {\r\n this._language = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Formats the number according to specific format.\r\n *\r\n * @param value Value to format\r\n * @param format Format to apply\r\n * @return Formatted number\r\n */\r\n NumberFormatter.prototype.format = function (value, format, precision) {\r\n // no format passed in or \"Number\"\r\n if (typeof format === \"undefined\" || ($type.isString(format) && format.toLowerCase() === \"number\")) {\r\n format = this._numberFormat;\r\n }\r\n // Init return value\r\n var formatted;\r\n // Cast to number just in case\r\n // TODO: maybe use better casting\r\n var source = Number(value);\r\n // Is it a built-in format or Intl.NumberFormatOptions\r\n if ($type.isObject(format)) {\r\n try {\r\n if (this.intlLocales) {\r\n return new Intl.NumberFormat(this.intlLocales, format).format(source);\r\n }\r\n else {\r\n return new Intl.NumberFormat(undefined, format).format(source);\r\n }\r\n }\r\n catch (e) {\r\n return \"Invalid\";\r\n }\r\n }\r\n else {\r\n // Clean format\r\n format = $utils.cleanFormat(format);\r\n // Get format info (it will also deal with parser caching)\r\n var info = this.parseFormat(format, this.language);\r\n // format and replace the number\r\n var details = void 0;\r\n if (source > this._negativeBase) {\r\n details = info.positive;\r\n }\r\n else if (source < this._negativeBase) {\r\n details = info.negative;\r\n }\r\n else {\r\n details = info.zero;\r\n }\r\n // Adjust precision\r\n if ($type.hasValue(precision) && !details.mod) {\r\n details = $object.clone(details);\r\n details.decimals.active = source == 0 ? 0 : precision;\r\n }\r\n // Format\r\n formatted = details.template.split($strings.PLACEHOLDER).join(this.applyFormat(source, details));\r\n }\r\n if (this.forceLTR) {\r\n formatted = \"‎\" + formatted;\r\n }\r\n return formatted;\r\n };\r\n /**\r\n * Parses supplied format into structured object which can be used to format\r\n * the number.\r\n *\r\n * @param format Format string, i.e. \"#,###.00\"\r\n * @param language Language\r\n */\r\n NumberFormatter.prototype.parseFormat = function (format, language) {\r\n var _this = this;\r\n // Check cache\r\n var cached = this.getCache(format);\r\n if ($type.hasValue(cached)) {\r\n return cached;\r\n }\r\n // init format parse info holder\r\n var info = {\r\n \"positive\": {\r\n \"thousands\": {\r\n \"active\": -1,\r\n \"passive\": -1,\r\n \"interval\": -1,\r\n \"separator\": language.translateEmpty(\"_thousandSeparator\")\r\n },\r\n \"decimals\": {\r\n \"active\": -1,\r\n \"passive\": -1,\r\n \"separator\": language.translateEmpty(\"_decimalSeparator\")\r\n },\r\n \"template\": \"\",\r\n \"source\": \"\",\r\n \"parsed\": false\r\n },\r\n \"negative\": {\r\n \"thousands\": {\r\n \"active\": -1,\r\n \"passive\": -1,\r\n \"interval\": -1,\r\n \"separator\": language.translateEmpty(\"_thousandSeparator\")\r\n },\r\n \"decimals\": {\r\n \"active\": -1,\r\n \"passive\": -1,\r\n \"separator\": language.translateEmpty(\"_decimalSeparator\")\r\n },\r\n \"template\": \"\",\r\n \"source\": \"\",\r\n \"parsed\": false\r\n },\r\n \"zero\": {\r\n \"thousands\": {\r\n \"active\": -1,\r\n \"passive\": -1,\r\n \"interval\": -1,\r\n \"separator\": language.translateEmpty(\"_thousandSeparator\")\r\n },\r\n \"decimals\": {\r\n \"active\": -1,\r\n \"passive\": -1,\r\n \"separator\": language.translateEmpty(\"_decimalSeparator\")\r\n },\r\n \"template\": \"\",\r\n \"source\": \"\",\r\n \"parsed\": false\r\n }\r\n };\r\n // Escape double vertical bars (that mean display one vertical bar)\r\n format = format.replace(\"||\", $strings.PLACEHOLDER2);\r\n // Split it up and deal with different formats\r\n var parts = format.split(\"|\");\r\n info.positive.source = parts[0];\r\n if (typeof parts[2] === \"undefined\") {\r\n info.zero = info.positive;\r\n }\r\n else {\r\n info.zero.source = parts[2];\r\n }\r\n if (typeof parts[1] === \"undefined\") {\r\n info.negative = info.positive;\r\n }\r\n else {\r\n info.negative.source = parts[1];\r\n }\r\n // Parse each\r\n $object.each(info, function (part, item) {\r\n // Already parsed\r\n if (item.parsed) {\r\n return;\r\n }\r\n // Check cached\r\n if (typeof _this.getCache(item.source) !== \"undefined\") {\r\n info[part] = _this.getCache(item.source);\r\n return;\r\n }\r\n // Begin parsing\r\n var partFormat = item.source;\r\n // Just \"Number\"?\r\n if (partFormat.toLowerCase() === \"number\") {\r\n partFormat = $type.isString(_this._numberFormat) ? _this._numberFormat : \"#,###.#####\";\r\n }\r\n // Let TextFormatter split into chunks\r\n var chunks = getTextFormatter().chunk(partFormat, true);\r\n for (var i = 0; i < chunks.length; i++) {\r\n var chunk = chunks[i];\r\n // replace back double vertical bar\r\n chunk.text = chunk.text.replace($strings.PLACEHOLDER2, \"|\");\r\n if (chunk.type === \"value\") {\r\n // Parse format\r\n // Look for codes\r\n var matches = chunk.text.match(/[#0.,]+[ ]?[abespABESP%!]?[abespABESP‰!]?/);\r\n if (matches) {\r\n if (matches === null || matches[0] === \"\") {\r\n // no codes here - assume string\r\n // nothing to do here\r\n item.template += chunk.text;\r\n }\r\n else {\r\n // look for the format modifiers at the end\r\n var mods = matches[0].match(/[abespABESP%‰!]{2}|[abespABESP%‰]{1}$/);\r\n if (mods) {\r\n item.mod = mods[0].toLowerCase();\r\n item.modSpacing = matches[0].match(/[ ]{1}[abespABESP%‰!]{1}$/) ? true : false;\r\n }\r\n // break the format up\r\n var a = matches[0].split(\".\");\r\n // Deal with thousands\r\n if (a[0] === \"\") {\r\n // No directives for thousands\r\n // Leave default settings (no formatting)\r\n }\r\n else {\r\n // Counts\r\n item.thousands.active = (a[0].match(/0/g) || []).length;\r\n item.thousands.passive = (a[0].match(/\\#/g) || []).length + item.thousands.active;\r\n // Separator interval\r\n var b = a[0].split(\",\");\r\n if (b.length === 1) {\r\n // No thousands separators\r\n // Do nothing\r\n }\r\n else {\r\n // Use length fo the last chunk as thousands length\r\n item.thousands.interval = $type.getValue(b.pop()).length;\r\n if (item.thousands.interval === 0) {\r\n item.thousands.interval = -1;\r\n }\r\n }\r\n }\r\n // Deal with decimals\r\n if (typeof (a[1]) === \"undefined\") {\r\n // No directives for decimals\r\n // Leave at defaults (no formatting)\r\n }\r\n else {\r\n // Counts\r\n item.decimals.active = (a[1].match(/0/g) || []).length;\r\n item.decimals.passive = (a[1].match(/\\#/g) || []).length + item.decimals.active;\r\n }\r\n // Add special code to template\r\n item.template += chunk.text.split(matches[0]).join($strings.PLACEHOLDER);\r\n }\r\n }\r\n }\r\n else {\r\n // Quoted string - take it as it is\r\n item.template += chunk.text;\r\n }\r\n }\r\n // Apply style formatting\r\n //item.template = getTextFormatter().format(item.template, this.outputFormat);\r\n // Save cache\r\n _this.setCache(item.source, item);\r\n // Mark this as parsed\r\n item.parsed = true;\r\n });\r\n // Save cache (the whole thing)\r\n this.setCache(format, info);\r\n return info;\r\n };\r\n /**\r\n * Applies parsed format to a numeric value.\r\n *\r\n * @param value Value\r\n * @param details Parsed format as returned by parseFormat()\r\n * @return Formatted number\r\n */\r\n NumberFormatter.prototype.applyFormat = function (value, details) {\r\n // Use absolute values\r\n var negative = value < 0;\r\n value = Math.abs(value);\r\n // Recalculate according to modifier\r\n var prefix = \"\", suffix = \"\";\r\n var mods = details.mod ? details.mod.split(\"\") : [];\r\n if (mods.indexOf(\"b\") !== -1) {\r\n var a_1 = this.applyPrefix(value, this.bytePrefixes, mods.indexOf(\"!\") !== -1);\r\n value = a_1[0];\r\n prefix = a_1[1];\r\n suffix = a_1[2];\r\n if (details.modSpacing) {\r\n suffix = \" \" + suffix;\r\n }\r\n }\r\n else if (mods.indexOf(\"a\") !== -1) {\r\n var a_2 = this.applyPrefix(value, value < this.smallNumberThreshold ? this.smallNumberPrefixes : this.bigNumberPrefixes, mods.indexOf(\"!\") !== -1);\r\n value = a_2[0];\r\n prefix = a_2[1];\r\n suffix = a_2[2];\r\n if (details.modSpacing) {\r\n suffix = \" \" + suffix;\r\n }\r\n }\r\n else if (mods.indexOf(\"p\") !== -1) {\r\n var ol = Math.min(value.toString().length + 2, 21);\r\n //value *= 100;\r\n value = parseFloat(value.toPrecision(ol));\r\n prefix = this.language.translate(\"_percentPrefix\") || \"\";\r\n suffix = this.language.translate(\"_percentSuffix\") || \"\";\r\n if (prefix == \"\" && suffix == \"\") {\r\n suffix = \"%\";\r\n }\r\n }\r\n else if (mods.indexOf(\"%\") !== -1) {\r\n var ol = $math.min(value.toString().length + 2, 21);\r\n value *= 100;\r\n value = parseFloat(value.toPrecision(ol));\r\n suffix = \"%\";\r\n }\r\n else if (mods.indexOf(\"‰\") !== -1) {\r\n var ol = $math.min(value.toString().length + 3, 21);\r\n value *= 1000;\r\n value = parseFloat(value.toPrecision(ol));\r\n suffix = \"‰\";\r\n }\r\n // Round to passive\r\n if (mods.indexOf(\"e\") !== -1) {\r\n // convert the value to exponential\r\n var exp = void 0;\r\n if (details.decimals.passive >= 0) {\r\n exp = value.toExponential(details.decimals.passive).split(\"e\");\r\n }\r\n else {\r\n exp = value.toExponential().split(\"e\");\r\n }\r\n value = Number(exp[0]);\r\n suffix = \"e\" + exp[1];\r\n if (details.modSpacing) {\r\n suffix = \" \" + suffix;\r\n }\r\n }\r\n else if (details.decimals.passive === 0) {\r\n value = Math.round(value);\r\n }\r\n else if (details.decimals.passive > 0) {\r\n var d = Math.pow(10, details.decimals.passive);\r\n value = Math.round(value * d) / d;\r\n }\r\n // Init return value\r\n var res = \"\";\r\n // Calc integer and decimal parts\r\n var a = $utils.numberToString(value).split(\".\");\r\n // Format integers\r\n var ints = a[0];\r\n // Pad integers to active length\r\n if (ints.length < details.thousands.active) {\r\n ints = Array(details.thousands.active - ints.length + 1).join(\"0\") + ints;\r\n }\r\n // Insert thousands separators\r\n if (details.thousands.interval > 0) {\r\n var ip = [];\r\n var intsr = ints.split(\"\").reverse().join(\"\");\r\n for (var i = 0, len = ints.length; i <= len; i += details.thousands.interval) {\r\n var c = intsr.substr(i, details.thousands.interval).split(\"\").reverse().join(\"\");\r\n if (c !== \"\") {\r\n ip.unshift(c);\r\n }\r\n }\r\n ints = ip.join(details.thousands.separator);\r\n }\r\n // Add integers\r\n res += ints;\r\n // Add decimals\r\n if (a.length === 1) {\r\n a.push(\"\");\r\n }\r\n var decs = a[1];\r\n // Fill zeros?\r\n if (decs.length < details.decimals.active) {\r\n decs += Array(details.decimals.active - decs.length + 1).join(\"0\");\r\n }\r\n if (decs !== \"\") {\r\n res += details.decimals.separator + decs;\r\n }\r\n // Can't have empty return value\r\n if (res === \"\") {\r\n res = \"0\";\r\n }\r\n // Add minus sign back\r\n if (value !== 0 && negative && (mods.indexOf(\"s\") === -1)) {\r\n res = \"-\" + res;\r\n }\r\n // Add suffixes/prefixes\r\n if (prefix) {\r\n res = prefix + res;\r\n }\r\n if (suffix) {\r\n res += suffix;\r\n }\r\n return res;\r\n };\r\n /**\r\n * Chooses appropriate prefix and suffix based on the passed in rules.\r\n *\r\n * @param value Value\r\n * @param prefixes Prefix array\r\n * @param force Force application of a first prefix (@sice 4.5.4)\r\n * @return Result\r\n */\r\n NumberFormatter.prototype.applyPrefix = function (value, prefixes, force) {\r\n if (force === void 0) { force = false; }\r\n var newvalue = value;\r\n var prefix = \"\";\r\n var suffix = \"\";\r\n var applied = false;\r\n var k = 1;\r\n for (var i = 0, len = prefixes.length; i < len; i++) {\r\n if (prefixes[i].number <= value) {\r\n if (prefixes[i].number === 0) {\r\n newvalue = 0;\r\n }\r\n else {\r\n newvalue = value / prefixes[i].number;\r\n k = prefixes[i].number;\r\n }\r\n prefix = prefixes[i].prefix;\r\n suffix = prefixes[i].suffix;\r\n applied = true;\r\n }\r\n }\r\n if (!applied && force && prefixes.length && value != 0) {\r\n // Prefix was not applied. Use the first prefix.\r\n newvalue = value / prefixes[0].number;\r\n prefix = prefixes[0].prefix;\r\n suffix = prefixes[0].suffix;\r\n applied = true;\r\n }\r\n if (applied) {\r\n newvalue = parseFloat(newvalue.toPrecision($math.min(k.toString().length + Math.floor(newvalue).toString().replace(/[^0-9]*/g, \"\").length, 21)));\r\n }\r\n return [newvalue, prefix, suffix];\r\n };\r\n /**\r\n * Invalidates the parent [[Sprite]] object.\r\n */\r\n NumberFormatter.prototype.invalidateSprite = function () {\r\n if (this.sprite) {\r\n this.sprite.invalidate();\r\n }\r\n };\r\n Object.defineProperty(NumberFormatter.prototype, \"numberFormat\", {\r\n /**\r\n * @return A format to use for number formatting\r\n */\r\n get: function () {\r\n return this._numberFormat;\r\n },\r\n /**\r\n * Number format.\r\n *\r\n * @default \"#,###.#####\"\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-numbers/} Tutorial on number formatting\r\n * @param format A format to use for number formatting\r\n */\r\n set: function (format) {\r\n this._numberFormat = format;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"intlLocales\", {\r\n /**\r\n * @return Date format\r\n */\r\n get: function () {\r\n return this._intlLocales;\r\n },\r\n /**\r\n * Locales if you are using date formats in `Intl.NumberFormatOptions` syntax.\r\n *\r\n * @see (@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat) about using Intl for number formatting\r\n * @param value Locales\r\n */\r\n set: function (value) {\r\n this._intlLocales = value;\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"negativeBase\", {\r\n /**\r\n * @return A format to use for number formatting\r\n */\r\n get: function () {\r\n return this._negativeBase;\r\n },\r\n /**\r\n * Negative base for negative numbers.\r\n *\r\n * @default 0\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-numbers/} Tutorial on number formatting\r\n * @param format A format to use for number formatting\r\n */\r\n set: function (value) {\r\n this._negativeBase = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"bigNumberPrefixes\", {\r\n /**\r\n * @return Prefixes for big numbers\r\n */\r\n get: function () {\r\n if (!$type.hasValue(this._bigNumberPrefixes)) {\r\n this._bigNumberPrefixes = [\r\n { \"number\": 1e+3, \"suffix\": this.language.translate(\"_big_number_suffix_3\") },\r\n { \"number\": 1e+6, \"suffix\": this.language.translate(\"_big_number_suffix_6\") },\r\n { \"number\": 1e+9, \"suffix\": this.language.translate(\"_big_number_suffix_9\") },\r\n { \"number\": 1e+12, \"suffix\": this.language.translate(\"_big_number_suffix_12\") },\r\n { \"number\": 1e+15, \"suffix\": this.language.translate(\"_big_number_suffix_15\") },\r\n { \"number\": 1e+18, \"suffix\": this.language.translate(\"_big_number_suffix_18\") },\r\n { \"number\": 1e+21, \"suffix\": this.language.translate(\"_big_number_suffix_21\") },\r\n { \"number\": 1e+24, \"suffix\": this.language.translate(\"_big_number_suffix_24\") }\r\n ];\r\n }\r\n return this._bigNumberPrefixes;\r\n },\r\n /**\r\n * Prefixes for big numbers.\r\n *\r\n * It's an array of objects of number/prefix pairs.\r\n *\r\n * ```JSON\r\n * [\r\n * { \"number\": 1e+3, \"suffix\": \"K\" },\r\n * { \"number\": 1e+6, \"suffix\": \"M\" },\r\n * { \"number\": 1e+9, \"suffix\": \"G\" },\r\n * { \"number\": 1e+12, \"suffix\": \"T\" },\r\n * { \"number\": 1e+15, \"suffix\": \"P\" },\r\n * { \"number\": 1e+18, \"suffix\": \"E\" },\r\n * { \"number\": 1e+21, \"suffix\": \"Z\" },\r\n * { \"number\": 1e+24, \"suffix\": \"Y\" }\r\n * ]\r\n * ```\r\n *\r\n * If the number is bigger than the `number` ir will be converted to the\r\n * appropriate bigger number with prefix.\r\n *\r\n * E.g. as per above `1500` will be converted to `1.5K`.\r\n *\r\n * Please note that for this transformation to be enabled, you need to\r\n * enable it specific modifier in your format setting.\r\n *\r\n * The modifier for big/small number modification is \"a\":\r\n *\r\n * ```Text\r\n * {myfield.formatNumber(\"#,###.00a\")}\r\n * ```\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-numbers/} Tutorial on number formatting\r\n * @param prefixes Prefixes for big numbers\r\n */\r\n set: function (prefixes) {\r\n this._bigNumberPrefixes = prefixes;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"smallNumberPrefixes\", {\r\n /**\r\n * @return Prefixes for small numbers\r\n */\r\n get: function () {\r\n if (!$type.hasValue(this._smallNumberPrefixes)) {\r\n this._smallNumberPrefixes = [\r\n { \"number\": 1e-24, \"suffix\": this.language.translate(\"_small_number_suffix_24\") },\r\n { \"number\": 1e-21, \"suffix\": this.language.translate(\"_small_number_suffix_21\") },\r\n { \"number\": 1e-18, \"suffix\": this.language.translate(\"_small_number_suffix_18\") },\r\n { \"number\": 1e-15, \"suffix\": this.language.translate(\"_small_number_suffix_15\") },\r\n { \"number\": 1e-12, \"suffix\": this.language.translate(\"_small_number_suffix_12\") },\r\n { \"number\": 1e-9, \"suffix\": this.language.translate(\"_small_number_suffix_9\") },\r\n { \"number\": 1e-6, \"suffix\": this.language.translate(\"_small_number_suffix_6\") },\r\n { \"number\": 1e-3, \"suffix\": this.language.translate(\"_small_number_suffix_3\") }\r\n ];\r\n }\r\n return this._smallNumberPrefixes;\r\n },\r\n /**\r\n * Prefixes for big numbers.\r\n *\r\n * It's an array of objects of number/prefix pairs.\r\n *\r\n * ```JSON\r\n * [\r\n * { \"number\": 1e-24, \"suffix\": \"y\" },\r\n * { \"number\": 1e-21, \"suffix\": \"z\" },\r\n * { \"number\": 1e-18, \"suffix\": \"a\" },\r\n * { \"number\": 1e-15, \"suffix\": \"f\" },\r\n * { \"number\": 1e-12, \"suffix\": \"p\" },\r\n * { \"number\": 1e-9, \"suffix\": \"n\" },\r\n * { \"number\": 1e-6, \"suffix\": \"μ\" },\r\n * { \"number\": 1e-3, \"suffix\": \"m\" }\r\n * ]\r\n * ```\r\n *\r\n * If the number is smaller than the `number` ir will be converted to the\r\n * appropriate smaller number with prefix.\r\n *\r\n * E.g. as per above `0.0015` will be converted to `1.5m`.\r\n *\r\n * Please note that for this transformation to be enabled, you need to\r\n * enable it specific modifier in your format setting.\r\n *\r\n * The modifier for big/small number modification is \"a\":\r\n *\r\n * ```Text\r\n * {myfield.formatNumber(\"#,###.00a\")}\r\n * ```\r\n *\r\n * IMPORTANT: The order of the suffixes is important. The list must start\r\n * from the smallest number and work towards bigger ones.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-numbers/} Tutorial on number formatting\r\n * @param prefixes Prefixes for small numbers\r\n */\r\n set: function (prefixes) {\r\n this._smallNumberPrefixes = prefixes;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"smallNumberThreshold\", {\r\n /**\r\n * @return Small number threshold\r\n */\r\n get: function () {\r\n return this._smallNumberThreshold;\r\n },\r\n /**\r\n * Any number smaller than this will be considered \"small\" number, which will\r\n * trigger special formatting if \"a\" format modifier is used.\r\n *\r\n * @since 4.6.8\r\n * @param value Small number threshold\r\n */\r\n set: function (value) {\r\n this._smallNumberThreshold = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"bytePrefixes\", {\r\n /**\r\n * @return Prefixes for byte-size formatting\r\n */\r\n get: function () {\r\n if (!$type.hasValue(this._bytePrefixes)) {\r\n this._bytePrefixes = [\r\n { \"number\": 1, suffix: this.language.translate(\"_byte_suffix_B\") },\r\n { \"number\": 1024, suffix: this.language.translate(\"_byte_suffix_KB\") },\r\n { \"number\": 1048576, suffix: this.language.translate(\"_byte_suffix_MB\") },\r\n { \"number\": 1073741824, suffix: this.language.translate(\"_byte_suffix_GB\") },\r\n { \"number\": 1099511627776, suffix: this.language.translate(\"_byte_suffix_TB\") },\r\n { \"number\": 1125899906842624, suffix: this.language.translate(\"_byte_suffix_PB\") }\r\n ];\r\n }\r\n return this._bytePrefixes;\r\n },\r\n /**\r\n * Basically the same as `bigNumberPrefixes`, except base for calculation\r\n * is not thousand but byte (1024).\r\n *\r\n * The modifier is \"b\".\r\n *\r\n * ```Text\r\n * {myfield.formatNumber(\"#,###.00b\")}\r\n * ```\r\n *\r\n * The above `2048` will change to `2K`.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-numbers/} Tutorial on number formatting\r\n * @param prefixes Prefixes for byte-size formatting\r\n */\r\n set: function (prefixes) {\r\n this._bytePrefixes = prefixes;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"outputFormat\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Output format\r\n */\r\n get: function () {\r\n return this._outputFormat;\r\n },\r\n /**\r\n * Ooutput format: \"svg\" or \"html\".\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Output format\r\n */\r\n set: function (outputFormat) {\r\n this._outputFormat = outputFormat.toLowerCase();\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"forceLTR\", {\r\n get: function () {\r\n return this._forceLTR;\r\n },\r\n set: function (value) {\r\n this._forceLTR = value;\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Replaces brackets with temporary placeholders.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Input text\r\n * @return Escaped text\r\n */\r\n NumberFormatter.prototype.escape = function (text) {\r\n return text.replace(\"||\", $strings.PLACEHOLDER2);\r\n };\r\n /**\r\n * Replaces placeholders back to brackets.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Escaped text\r\n * @return Unescaped text\r\n */\r\n NumberFormatter.prototype.unescape = function (text) {\r\n return text.replace($strings.PLACEHOLDER2, \"|\");\r\n };\r\n return NumberFormatter;\r\n}(BaseObject));\r\nexport { NumberFormatter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"NumberFormatter\"] = NumberFormatter;\r\n//# sourceMappingURL=NumberFormatter.js.map","/**\r\n * Handles date and time formatting\r\n */\r\nimport { __extends } from \"tslib\";\r\nimport { Language } from \"../utils/Language\";\r\nimport { BaseObject } from \"../Base\";\r\nimport { getTextFormatter } from \"../formatters/TextFormatter\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $strings from \"../utils/Strings\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $time from \"../utils/Time\";\r\n/**\r\n * Handles date and time formatting.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-date-time/} Tutorial on date/time formatting\r\n * @todo Better type casting of passed in date?\r\n * @todo Quarter support?\r\n * @todo When parsing named months make the search case-insensitive\r\n * @todo Escape a.m./p.m. properly when used in RegEx\r\n */\r\nvar DateFormatter = /** @class */ (function (_super) {\r\n __extends(DateFormatter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function DateFormatter() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Date format.\r\n */\r\n _this._dateFormat = \"yyyy-MM-dd\";\r\n /**\r\n * Input date format.\r\n */\r\n _this._inputDateFormat = \"yyyy-MM-dd\";\r\n /**\r\n * Assume UTC time zone.\r\n */\r\n _this._utc = false;\r\n /**\r\n * If `timezone` is set, this will hold minute fraction of the timezone.\r\n *\r\n * @readonly\r\n * @ignore\r\n */\r\n _this.timezoneMinutes = 0;\r\n /**\r\n * First day of week.\r\n *\r\n * 0 - Sunday\r\n * 1 - Monday\r\n *\r\n * Etc.\r\n */\r\n _this._firstDayOfWeek = 1;\r\n /**\r\n * A list of month names.\r\n */\r\n _this.months = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\r\n /**\r\n * A list of short month names.\r\n */\r\n _this.monthsShort = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May(short)\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\r\n /**\r\n * A list of weekday names.\r\n */\r\n _this.weekdays = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\r\n /**\r\n * A list of short weekday names.\r\n */\r\n _this.weekdaysShort = [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"];\r\n /**\r\n * Output format to produce. If the format calls for applying color to the\r\n * formatted value, this setting will determine what markup to use: SVG or\r\n * HTML.\r\n *\r\n * Available options: svg, html.\r\n *\r\n * @default \"svg\"\r\n */\r\n _this._outputFormat = \"svg\";\r\n /**\r\n * Should the first letter of the formatted date be capitalized?\r\n *\r\n * @default true\r\n */\r\n _this.capitalize = true;\r\n _this.className = \"DateFormatter\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(DateFormatter.prototype, \"language\", {\r\n /**\r\n * @return Language\r\n */\r\n get: function () {\r\n return this._language;\r\n },\r\n /**\r\n * A reference to [[Language]] object.\r\n *\r\n * @param value Language\r\n */\r\n set: function (value) {\r\n this._language = value;\r\n this.dateFormat = this._language.translate(\"_date\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Formats the date value according to specified format.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-date-time/} Tutorial on date/time formatting\r\n * @param source Date value\r\n * @param format Format\r\n * @return Formatted date string\r\n */\r\n DateFormatter.prototype.format = function (source, format, applyTimezone) {\r\n // No language?\r\n if (!this.language) {\r\n if (this.sprite) {\r\n this.language = this.sprite.language;\r\n }\r\n else {\r\n this.language = new Language();\r\n }\r\n }\r\n // No format passed in or it's empty\r\n if (typeof format === \"undefined\" || format === \"\") {\r\n format = this._dateFormat;\r\n }\r\n // Init return value\r\n var formatted;\r\n // Do casting if required\r\n // This will take care of timestamps as well as Date objects\r\n var date;\r\n if ($type.isString(source)) {\r\n // If it's a string, let's try parsing it using our own functionality\r\n date = this.parse(source);\r\n }\r\n else {\r\n date = $utils.anyToDate(source);\r\n }\r\n // Is it a built-in format or Intl.DateTimeFormat\r\n if ($type.isObject(format)) {\r\n try {\r\n if (this.intlLocales) {\r\n return new Intl.DateTimeFormat(this.intlLocales, format).format(date);\r\n }\r\n else {\r\n return new Intl.DateTimeFormat(undefined, format).format(date);\r\n }\r\n }\r\n catch (e) {\r\n return \"Invalid\";\r\n }\r\n }\r\n else {\r\n // Clean format\r\n format = $utils.cleanFormat(format);\r\n // get format info (it will also deal with parser caching)\r\n var info = this.parseFormat(format);\r\n // Should we apply custom time zone?\r\n if ($type.hasValue(this.timezoneOffset)) {\r\n date.setMinutes(date.getMinutes() + date.getTimezoneOffset() - this.timezoneOffset);\r\n }\r\n else if ($type.hasValue(this.timezone) && applyTimezone !== false) {\r\n date = $time.setTimezone(date, this.timezone);\r\n }\r\n // Check if it's a valid date\r\n if (!$type.isNumber(date.getTime())) {\r\n return this.language.translate(\"Invalid date\");\r\n }\r\n // Apply format\r\n formatted = this.applyFormat(date, info, this.language);\r\n // Capitalize\r\n if (this.capitalize) {\r\n formatted = formatted.replace(/^.{1}/, formatted.substr(0, 1).toUpperCase());\r\n }\r\n }\r\n // We're done\r\n return formatted;\r\n };\r\n /**\r\n * Parses format into structured infromation.\r\n *\r\n * @param format Format template\r\n */\r\n DateFormatter.prototype.parseFormat = function (format) {\r\n // Check cache\r\n var cached = this.getCache(format);\r\n if ($type.hasValue(cached)) {\r\n return cached;\r\n }\r\n // Init format parse info holder\r\n var info = {\r\n \"template\": \"\",\r\n \"parts\": []\r\n };\r\n // Let TextFormatter split into chunks\r\n var chunks = getTextFormatter().chunk(format, true);\r\n for (var i = 0; i < chunks.length; i++) {\r\n var chunk = chunks[i];\r\n if (chunk.type === \"value\") {\r\n // Just \"Date\"?\r\n if (chunk.text.match(/^date$/i) && $type.isString(this._dateFormat)) {\r\n chunk.text = this._dateFormat;\r\n }\r\n // Find all possible parts\r\n var matches = chunk.text.match(/G|yyyy|yyy|yy|y|YYYY|YYY|YY|Y|u|q|MMMMM|MMMM|MMM|MM|M|ww|w|W|dd|d|DDD|DD|D|F|g|EEEEE|EEEE|EEE|EE|E|eeeee|eeee|eee|ee|e|aaa|aa|a|hh|h|HH|H|KK|K|kk|k|mm|m|ss|s|SSS|SS|S|A|zzzz|zzz|zz|z|ZZ|Z|t|x|nnn|nn|n|i|I/g);\r\n // Found?\r\n if (matches) {\r\n // Populate template\r\n for (var x = 0; x < matches.length; x++) {\r\n info.parts.push(matches[x]);\r\n chunk.text = chunk.text.replace(matches[x], $strings.PLACEHOLDER);\r\n }\r\n }\r\n }\r\n // Apply to template\r\n info.template += chunk.text;\r\n }\r\n // Apply style formatting\r\n //info.template = getTextFormatter().format(info.template, this.outputFormat);\r\n // Save cache\r\n this.setCache(format, info);\r\n return info;\r\n };\r\n /**\r\n * Applies format to Date.\r\n *\r\n * @param date Date object\r\n * @param info Parsed format information\r\n * @param language Language\r\n * @return Formatted date string\r\n */\r\n DateFormatter.prototype.applyFormat = function (date, info, language) {\r\n // Init return value\r\n var res = info.template;\r\n // Get values\r\n var fullYear, month, weekday, day, hours, minutes, seconds, milliseconds, offset = date.getTimezoneOffset(), timestamp = date.getTime();\r\n if (this.utc) {\r\n fullYear = date.getUTCFullYear();\r\n month = date.getUTCMonth();\r\n weekday = date.getUTCDay();\r\n day = date.getUTCDate();\r\n hours = date.getUTCHours();\r\n minutes = date.getUTCMinutes();\r\n seconds = date.getUTCSeconds();\r\n milliseconds = date.getUTCMilliseconds();\r\n }\r\n else {\r\n fullYear = date.getFullYear();\r\n month = date.getMonth();\r\n weekday = date.getDay();\r\n day = date.getDate();\r\n hours = date.getHours();\r\n minutes = date.getMinutes();\r\n seconds = date.getSeconds();\r\n milliseconds = date.getMilliseconds();\r\n }\r\n // Go through each part and format/replace it in template\r\n for (var i = 0, len = info.parts.length; i < len; i++) {\r\n var value = \"\";\r\n switch (info.parts[i]) {\r\n case \"G\":\r\n value = language.translate(fullYear < 0\r\n ? \"_era_bc\"\r\n : \"_era_ad\");\r\n break;\r\n case \"yyyy\":\r\n value = Math.abs(fullYear).toString();\r\n if (fullYear < 0) {\r\n value += language.translate(\"_era_bc\");\r\n }\r\n break;\r\n case \"yyy\":\r\n case \"yy\":\r\n case \"y\":\r\n value = Math.abs(fullYear).toString().substr(-info.parts[i].length);\r\n if (fullYear < 0) {\r\n value += language.translate(\"_era_bc\");\r\n }\r\n break;\r\n case \"YYYY\":\r\n case \"YYY\":\r\n case \"YY\":\r\n case \"Y\":\r\n var week = $utils.getWeek(date);\r\n var year = fullYear;\r\n if (week == 1 && (weekday > 4)) {\r\n year--;\r\n }\r\n if (info.parts[i] == \"YYYY\") {\r\n value = Math.abs(year).toString();\r\n }\r\n else {\r\n value = Math.abs(year).toString().substr(-info.parts[i].length);\r\n }\r\n if (year < 0) {\r\n value += language.translate(\"_era_bc\");\r\n }\r\n break;\r\n case \"u\":\r\n // @todo\r\n break;\r\n case \"q\":\r\n value = \"\" + Math.ceil((date.getMonth() + 1) / 3);\r\n break;\r\n case \"MMMMM\":\r\n value = language.translate(this.months[month]).substr(0, 1);\r\n break;\r\n case \"MMMM\":\r\n value = language.translate(this.months[month]);\r\n break;\r\n case \"MMM\":\r\n value = language.translate(this.monthsShort[month]);\r\n break;\r\n case \"MM\":\r\n value = $utils.padString(month + 1, 2, \"0\");\r\n break;\r\n case \"M\":\r\n value = (month + 1).toString();\r\n break;\r\n case \"ww\":\r\n value = $utils.padString($utils.getWeek(date, this.utc), 2, \"0\");\r\n break;\r\n case \"w\":\r\n value = $utils.getWeek(date, this.utc).toString();\r\n break;\r\n case \"W\":\r\n value = $utils.getMonthWeek(date, this.utc).toString();\r\n break;\r\n case \"dd\":\r\n value = $utils.padString(day, 2, \"0\");\r\n break;\r\n case \"d\":\r\n value = day.toString();\r\n break;\r\n case \"DD\":\r\n case \"DDD\":\r\n value = $utils.padString($utils.getYearDay(date, this.utc).toString(), info.parts[i].length, \"0\");\r\n break;\r\n case \"D\":\r\n value = $utils.getYearDay(date, this.utc).toString();\r\n break;\r\n case \"F\":\r\n // @todo\r\n break;\r\n case \"g\":\r\n // @todo\r\n break;\r\n case \"t\":\r\n value = language.translateFunc(\"_dateOrd\").call(this, day);\r\n break;\r\n case \"E\":\r\n value = (weekday || 7).toString();\r\n break;\r\n case \"EE\":\r\n value = $utils.padString((weekday || 7).toString(), 2, \"0\");\r\n break;\r\n case \"EEE\":\r\n case \"eee\":\r\n value = language.translate(this.weekdaysShort[weekday]);\r\n break;\r\n case \"EEEE\":\r\n case \"eeee\":\r\n value = language.translate(this.weekdays[weekday]);\r\n break;\r\n case \"EEEEE\":\r\n case \"eeeee\":\r\n value = language.translate(this.weekdays[weekday]).substr(0, 1);\r\n break;\r\n case \"e\":\r\n case \"ee\":\r\n value = (weekday - this.firstDayOfWeek + 1).toString();\r\n if (info.parts[i] == \"ee\") {\r\n value = $utils.padString(value, 2, \"0\");\r\n }\r\n break;\r\n case \"a\":\r\n if (hours >= 12) {\r\n value = language.translate(\"PM\");\r\n }\r\n else {\r\n value = language.translate(\"AM\");\r\n }\r\n break;\r\n case \"aa\":\r\n if (hours >= 12) {\r\n value = language.translate(\"P.M.\");\r\n }\r\n else {\r\n value = language.translate(\"A.M.\");\r\n }\r\n break;\r\n case \"aaa\":\r\n if (hours >= 12) {\r\n value = language.translate(\"P\");\r\n }\r\n else {\r\n value = language.translate(\"A\");\r\n }\r\n break;\r\n case \"h\":\r\n value = $utils.get12Hours(hours).toString();\r\n break;\r\n case \"hh\":\r\n value = $utils.padString($utils.get12Hours(hours), 2, \"0\");\r\n break;\r\n case \"H\":\r\n value = hours.toString();\r\n break;\r\n case \"HH\":\r\n value = $utils.padString(hours, 2, \"0\");\r\n break;\r\n case \"K\":\r\n value = $utils.get12Hours(hours, 0).toString();\r\n break;\r\n case \"KK\":\r\n value = $utils.padString($utils.get12Hours(hours, 0), 2, \"0\");\r\n break;\r\n case \"k\":\r\n value = (hours + 1).toString();\r\n break;\r\n case \"kk\":\r\n value = $utils.padString(hours + 1, 2, \"0\");\r\n break;\r\n case \"m\":\r\n value = minutes.toString();\r\n break;\r\n case \"mm\":\r\n value = $utils.padString(minutes, 2, \"0\");\r\n break;\r\n case \"s\":\r\n value = seconds.toString();\r\n break;\r\n case \"ss\":\r\n value = $utils.padString(seconds, 2, \"0\");\r\n break;\r\n case \"S\":\r\n case \"SS\":\r\n case \"SSS\":\r\n value = Math.round((milliseconds / 1000) * Math.pow(10, info.parts[i].length)).toString();\r\n break;\r\n case \"x\":\r\n value = timestamp.toString();\r\n break;\r\n case \"n\":\r\n case \"nn\":\r\n case \"nnn\":\r\n value = $utils.padString(milliseconds, info.parts[i].length, \"0\");\r\n break;\r\n case \"z\":\r\n value = $utils.getTimeZone(date, false, false, this.utc);\r\n break;\r\n case \"zz\":\r\n value = $utils.getTimeZone(date, true, false, this.utc);\r\n break;\r\n case \"zzz\":\r\n value = $utils.getTimeZone(date, false, true, this.utc);\r\n break;\r\n case \"zzzz\":\r\n value = $utils.getTimeZone(date, true, true, this.utc);\r\n break;\r\n case \"Z\":\r\n case \"ZZ\":\r\n var tz = Math.abs(offset) / 60;\r\n var tzh = Math.floor(tz);\r\n var tzm = tz * 60 - tzh * 60;\r\n if (this.utc) {\r\n tzh = 0;\r\n tzm = 0;\r\n }\r\n if (info.parts[i] == \"Z\") {\r\n value = \"GMT\";\r\n value += offset > 0 ? \"-\" : \"+\";\r\n value += $utils.padString(tzh, 2) + \":\" + $utils.padString(tzm, 2);\r\n }\r\n else {\r\n value = offset > 0 ? \"-\" : \"+\";\r\n value += $utils.padString(tzh, 2) + $utils.padString(tzm, 2);\r\n }\r\n break;\r\n case \"i\":\r\n value = date.toISOString();\r\n break;\r\n case \"I\":\r\n value = date.toUTCString();\r\n break;\r\n }\r\n res = res.replace($strings.PLACEHOLDER, value);\r\n }\r\n return res;\r\n };\r\n /**\r\n * Parses any input value into Date object.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-date-time/#Parsing_Dates} Tutorial on date/time parsing\r\n * @param source Source value\r\n * @param format Source format\r\n * @return Date object\r\n */\r\n DateFormatter.prototype.parse = function (source, format) {\r\n // Format set?\r\n if (!$type.hasValue(format)) {\r\n format = this.inputDateFormat;\r\n }\r\n // Is it already a Date\r\n if (source instanceof Date) {\r\n return source;\r\n }\r\n // Is it a numeric timestamp\r\n if (typeof source === \"number\") {\r\n return new Date(source);\r\n }\r\n // No? Let's check if it's string, and try converting to it if nec\r\n if (typeof source !== \"string\") {\r\n source = source.toString();\r\n }\r\n // no language?\r\n if (!this.language) {\r\n if (this.sprite) {\r\n this.language = this.sprite.language;\r\n }\r\n else {\r\n this.language = new Language;\r\n }\r\n }\r\n // Init return value\r\n var res;\r\n // Init RegEx for parsing\r\n var reg = \"\";\r\n // Clean format\r\n format = $utils.cleanFormat(format);\r\n // Clip format to length of the source string\r\n format = format.substr(0, source.length);\r\n // Parse format\r\n var info = this.parseFormat(format);\r\n // Init parsed items holder\r\n var parsedIndexes = {\r\n \"year\": -1,\r\n \"year3\": -1,\r\n \"year2\": -1,\r\n \"year1\": -1,\r\n \"month\": -1,\r\n \"monthShort\": -1,\r\n \"monthLong\": -1,\r\n \"weekdayShort\": -1,\r\n \"weekdayLong\": -1,\r\n \"day\": -1,\r\n \"yearDay\": -1,\r\n \"week\": -1,\r\n \"hourBase0\": -1,\r\n \"hour12Base0\": -1,\r\n \"hourBase1\": -1,\r\n \"hour12Base1\": -1,\r\n \"minute\": -1,\r\n \"second\": -1,\r\n \"millisecond\": -1,\r\n \"millisecondDigits\": -1,\r\n \"am\": -1,\r\n \"zone\": -1,\r\n \"timestamp\": -1,\r\n \"iso\": -1\r\n };\r\n // Init values\r\n var resValues = {\r\n \"year\": 1970,\r\n \"month\": 0,\r\n \"day\": 1,\r\n \"hour\": 0,\r\n \"minute\": 0,\r\n \"second\": 0,\r\n \"millisecond\": 0,\r\n \"timestamp\": null,\r\n \"offset\": 0,\r\n \"utc\": this.utc\r\n };\r\n // Index adjuster\r\n var indexAdjust = 0, index = 0;\r\n // Iterate through all of the parts\r\n for (var i = 0; i < info.parts.length; i++) {\r\n // Set current match index\r\n index = i + indexAdjust + 1;\r\n switch (info.parts[i]) {\r\n case \"yyyy\":\r\n case \"YYYY\":\r\n reg += \"([0-9]{4})\";\r\n parsedIndexes.year = index;\r\n break;\r\n case \"yyy\":\r\n case \"YYY\":\r\n reg += \"([0-9]{3})\";\r\n parsedIndexes.year3 = index;\r\n break;\r\n case \"yy\":\r\n case \"YY\":\r\n reg += \"([0-9]{2})\";\r\n parsedIndexes.year2 = index;\r\n break;\r\n case \"y\":\r\n case \"Y\":\r\n reg += \"([0-9]{1})\";\r\n parsedIndexes.year1 = index;\r\n break;\r\n case \"MMMM\":\r\n reg += \"(\" + this.getStringList(this.months).join(\"|\") + \")\";\r\n parsedIndexes.monthLong = index;\r\n break;\r\n case \"MMM\":\r\n reg += \"(\" + this.getStringList(this.monthsShort).join(\"|\") + \")\";\r\n parsedIndexes.monthShort = index;\r\n break;\r\n case \"MM\":\r\n case \"M\":\r\n reg += \"([0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.month = index;\r\n break;\r\n case \"ww\":\r\n case \"w\":\r\n reg += \"([0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.week = index;\r\n break;\r\n case \"dd\":\r\n case \"d\":\r\n reg += \"([0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.day = index;\r\n break;\r\n case \"DDD\":\r\n case \"DD\":\r\n case \"D\":\r\n reg += \"([0-9]{3}|[0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.yearDay = index;\r\n break;\r\n case \"dddd\":\r\n reg += \"(\" + this.getStringList(this.weekdays).join(\"|\") + \")\";\r\n parsedIndexes.weekdayLong = index;\r\n break;\r\n case \"ddd\":\r\n reg += \"(\" + this.getStringList(this.weekdaysShort).join(\"|\") + \")\";\r\n parsedIndexes.weekdayShort = index;\r\n break;\r\n case \"aaa\":\r\n case \"aa\":\r\n case \"a\":\r\n // TODO: fix (escape regex)\r\n reg += \"(\" + this.getStringList([\"AM\", \"PM\", \"A\\.M\\.\", \"P\\.M\\.\", \"A\", \"P\"]).join(\"|\") + \")\";\r\n parsedIndexes.am = index;\r\n break;\r\n case \"hh\":\r\n case \"h\":\r\n reg += \"([0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.hour12Base1 = index;\r\n break;\r\n case \"HH\":\r\n case \"H\":\r\n reg += \"([0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.hourBase0 = index;\r\n break;\r\n case \"KK\":\r\n case \"K\":\r\n reg += \"([0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.hour12Base0 = index;\r\n break;\r\n case \"kk\":\r\n case \"k\":\r\n reg += \"([0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.hourBase1 = index;\r\n break;\r\n case \"mm\":\r\n case \"m\":\r\n reg += \"([0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.minute = index;\r\n break;\r\n case \"ss\":\r\n case \"s\":\r\n reg += \"([0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.second = index;\r\n break;\r\n case \"SSS\":\r\n case \"SS\":\r\n case \"S\":\r\n reg += \"([0-9]{3}|[0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.millisecond = index;\r\n parsedIndexes.millisecondDigits = info.parts[i].length;\r\n break;\r\n case \"nnn\":\r\n case \"nn\":\r\n case \"n\":\r\n reg += \"([0-9]{3}|[0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.millisecond = index;\r\n break;\r\n case \"x\":\r\n reg += \"([0-9]{1,})\";\r\n parsedIndexes.timestamp = index;\r\n break;\r\n case \"Z\":\r\n reg += \"GMT([-+]+[0-9]{2}:[0-9]{2})\";\r\n parsedIndexes.zone = index;\r\n break;\r\n case \"ZZ\":\r\n reg += \"([\\\\-+]+[0-9]{2}[0-9]{2})\";\r\n parsedIndexes.zone = index;\r\n break;\r\n case \"i\":\r\n reg += \"([0-9]{4})-?([0-9]{2})-?([0-9]{2})T?([0-9]{2}):?([0-9]{2}):?([0-9]{2})\\.?([0-9]{0,3})([zZ]|[+\\-][0-9]{2}:?[0-9]{2}|$)\";\r\n parsedIndexes.iso = index;\r\n indexAdjust += 7;\r\n break;\r\n case \"G\":\r\n case \"YYYY\":\r\n case \"YYY\":\r\n case \"YY\":\r\n case \"Y\":\r\n case \"MMMMM\":\r\n case \"W\":\r\n case \"EEEEE\":\r\n case \"EEEE\":\r\n case \"EEE\":\r\n case \"EE\":\r\n case \"E\":\r\n case \"eeeee\":\r\n case \"eeee\":\r\n case \"eee\":\r\n case \"ee\":\r\n case \"e\":\r\n case \"zzzz\":\r\n case \"zzz\":\r\n case \"zz\":\r\n case \"z\":\r\n case \"t\":\r\n // Ignore\r\n indexAdjust--;\r\n break;\r\n }\r\n reg += \"[^0-9]*\";\r\n }\r\n // Try matching\r\n var regex = new RegExp(reg);\r\n var matches = source.match(regex);\r\n if (matches) {\r\n // Populate the date object\r\n // Full year\r\n if (parsedIndexes.year > -1) {\r\n resValues.year = parseInt(matches[parsedIndexes.year]);\r\n }\r\n // 3-digit year\r\n if (parsedIndexes.year3 > -1) {\r\n var val = parseInt(matches[parsedIndexes.year3]);\r\n val += 1000;\r\n resValues.year = val;\r\n }\r\n // 2-digit year\r\n if (parsedIndexes.year2 > -1) {\r\n var val = parseInt(matches[parsedIndexes.year2]);\r\n if (val > 50) {\r\n val += 1000;\r\n }\r\n else {\r\n val += 2000;\r\n }\r\n resValues.year = val;\r\n }\r\n // 1-digit year\r\n if (parsedIndexes.year1 > -1) {\r\n var val = parseInt(matches[parsedIndexes.year1]);\r\n val = Math.floor((new Date().getFullYear()) / 10) * 10 + val;\r\n resValues.year = val;\r\n }\r\n // Full month\r\n if (parsedIndexes.monthLong > -1) {\r\n resValues.month = this.resolveMonth(matches[parsedIndexes.monthLong]);\r\n }\r\n // Short month\r\n if (parsedIndexes.monthShort > -1) {\r\n resValues.month = this.resolveShortMonth(matches[parsedIndexes.monthShort]);\r\n }\r\n // Numeric month\r\n if (parsedIndexes.month > -1) {\r\n resValues.month = parseInt(matches[parsedIndexes.month]) - 1;\r\n }\r\n // Weekday\r\n // @todo\r\n // Week\r\n if ((parsedIndexes.week > -1) && (parsedIndexes.day === -1)) {\r\n // We parse weeks ONLY if day is not explicitly set\r\n // TODO: this needs work\r\n // (but maybe later - I can hardly imagine anyone passing their dates in weeks)\r\n resValues.month = 0;\r\n resValues.day = $utils.getDayFromWeek(parseInt(matches[parsedIndexes.week]), resValues.year, 1, this.utc);\r\n }\r\n // Day\r\n if (parsedIndexes.day > -1) {\r\n resValues.day = parseInt(matches[parsedIndexes.day]);\r\n }\r\n // Year day\r\n if (parsedIndexes.yearDay > -1) {\r\n resValues.month = 0;\r\n resValues.day = parseInt(matches[parsedIndexes.yearDay]);\r\n }\r\n // 24 Hour (0-23)\r\n if (parsedIndexes.hourBase0 > -1) {\r\n resValues.hour = parseInt(matches[parsedIndexes.hourBase0]);\r\n }\r\n // 24 Hour (1-24)\r\n if (parsedIndexes.hourBase1 > -1) {\r\n resValues.hour = parseInt(matches[parsedIndexes.hourBase1]) - 1;\r\n }\r\n // 12 Hour (0-11)\r\n if (parsedIndexes.hour12Base0 > -1) {\r\n var val = parseInt(matches[parsedIndexes.hour12Base0]);\r\n if (val == 11) {\r\n val = 0;\r\n }\r\n if ((parsedIndexes.am > -1) && !this.isAm(matches[parsedIndexes.am])) {\r\n val += 12;\r\n }\r\n resValues.hour = val;\r\n }\r\n // 12 Hour (1-12)\r\n if (parsedIndexes.hour12Base1 > -1) {\r\n var val = parseInt(matches[parsedIndexes.hour12Base1]);\r\n if (val == 12) {\r\n val = 0;\r\n }\r\n if ((parsedIndexes.am > -1) && !this.isAm(matches[parsedIndexes.am])) {\r\n val += 12;\r\n }\r\n resValues.hour = val;\r\n }\r\n // Minute\r\n if (parsedIndexes.minute > -1) {\r\n resValues.minute = parseInt(matches[parsedIndexes.minute]);\r\n }\r\n // Second\r\n if (parsedIndexes.second > -1) {\r\n resValues.second = parseInt(matches[parsedIndexes.second]);\r\n }\r\n // Millisecond\r\n if (parsedIndexes.millisecond > -1) {\r\n var val = parseInt(matches[parsedIndexes.millisecond]);\r\n if (parsedIndexes.millisecondDigits == 2) {\r\n val *= 10;\r\n }\r\n else if (parsedIndexes.millisecondDigits == 1) {\r\n val *= 100;\r\n }\r\n resValues.millisecond = val;\r\n }\r\n // Timestamp\r\n if (parsedIndexes.timestamp > -1) {\r\n resValues.timestamp = parseInt(matches[parsedIndexes.timestamp]);\r\n var ts = new Date(resValues.timestamp);\r\n resValues.year = ts.getUTCFullYear();\r\n resValues.month = ts.getUTCMonth();\r\n resValues.day = ts.getUTCDate();\r\n resValues.hour = ts.getUTCHours();\r\n resValues.minute = ts.getUTCMinutes();\r\n resValues.second = ts.getUTCSeconds();\r\n resValues.millisecond = ts.getUTCMilliseconds();\r\n }\r\n // Adjust time zone\r\n if (parsedIndexes.zone > -1) {\r\n resValues.offset = this.resolveTimezoneOffset(new Date(resValues.year, resValues.month, resValues.day), matches[parsedIndexes.zone]);\r\n }\r\n // ISO\r\n if (parsedIndexes.iso > -1) {\r\n resValues.year = $type.toNumber(matches[parsedIndexes.iso + 0]);\r\n resValues.month = $type.toNumber(matches[parsedIndexes.iso + 1]) - 1;\r\n resValues.day = $type.toNumber(matches[parsedIndexes.iso + 2]);\r\n resValues.hour = $type.toNumber(matches[parsedIndexes.iso + 3]);\r\n resValues.minute = $type.toNumber(matches[parsedIndexes.iso + 4]);\r\n resValues.second = $type.toNumber(matches[parsedIndexes.iso + 5]);\r\n resValues.millisecond = $type.toNumber(matches[parsedIndexes.iso + 6]);\r\n if (matches[parsedIndexes.iso + 7] == \"Z\" || matches[parsedIndexes.iso + 7] == \"z\") {\r\n resValues.utc = true;\r\n }\r\n else if (matches[parsedIndexes.iso + 7] != \"\") {\r\n resValues.offset = this.resolveTimezoneOffset(new Date(resValues.year, resValues.month, resValues.day), matches[parsedIndexes.iso + 7]);\r\n }\r\n }\r\n // Create Date object\r\n if (resValues.utc) {\r\n res = new Date(Date.UTC(resValues.year, resValues.month, resValues.day, resValues.hour, resValues.minute, resValues.second, resValues.millisecond));\r\n }\r\n else {\r\n res = new Date(resValues.year, resValues.month, resValues.day, resValues.hour, resValues.minute + resValues.offset, resValues.second, resValues.millisecond);\r\n }\r\n }\r\n else {\r\n // Didn't match anything\r\n // Let's try dropping it into Date constructor and hope for the best\r\n res = new Date(source);\r\n }\r\n return res;\r\n };\r\n DateFormatter.prototype.resolveTimezoneOffset = function (date, zone) {\r\n var value = zone.match(/([+\\-]?)([0-9]{2}):?([0-9]{2})/);\r\n if (value) {\r\n var match = $type.getValue(zone.match(/([+\\-]?)([0-9]{2}):?([0-9]{2})/));\r\n var dir = match[1];\r\n var hour = match[2];\r\n var minute = match[3];\r\n var offset = parseInt(hour) * 60 + parseInt(minute);\r\n // Adjust offset\r\n // Making it negative does not seem to make sense, but it's right\r\n // because of how JavaScript calculates GMT offsets\r\n if (dir == \"+\") {\r\n offset *= -1;\r\n }\r\n // Check the difference in offset\r\n var originalOffset = (date || new Date()).getTimezoneOffset();\r\n var diff = offset - originalOffset;\r\n return diff;\r\n }\r\n return 0;\r\n };\r\n /**\r\n * Resolves month name (i.e. \"December\") into a month number (11).\r\n *\r\n * @param value Month name\r\n * @return Month number\r\n */\r\n DateFormatter.prototype.resolveMonth = function (value) {\r\n // Let's try English first\r\n var month = this.months.indexOf(value);\r\n if (month > -1) {\r\n return month;\r\n }\r\n // Try the translation\r\n if (this.language && !this.language.isDefault()) {\r\n month = this.language.translateAll(this.months).indexOf(value);\r\n if (month > -1) {\r\n return month;\r\n }\r\n }\r\n return 0;\r\n };\r\n /**\r\n * Resolves short month name (i.e. \"Dec\") into a month number.\r\n *\r\n * @param value Short month name\r\n * @return Month number\r\n */\r\n DateFormatter.prototype.resolveShortMonth = function (value) {\r\n // Let's try English first\r\n var month = this.monthsShort.indexOf(value);\r\n if (month > -1) {\r\n return month;\r\n }\r\n // Maybe long month (workaround for May)\r\n month = this.months.indexOf(value);\r\n if (month > -1) {\r\n return month;\r\n }\r\n // Try the translation\r\n if (this.language && !this.language.isDefault()) {\r\n month = this.language.translateAll(this.monthsShort).indexOf(value);\r\n if (month > -1) {\r\n return month;\r\n }\r\n }\r\n return 0;\r\n };\r\n /**\r\n * Checks if passed in string represents AM/PM notation in many of its\r\n * versions.\r\n *\r\n * @param value Source string\r\n * @return Is it AM/PM?\r\n */\r\n DateFormatter.prototype.isAm = function (value) {\r\n var list = this.getStringList([\"AM\", \"A.M.\", \"A\"]);\r\n return list.indexOf(value.toUpperCase()) > -1;\r\n };\r\n /**\r\n * Invalidates related [[Sprite]] causing it to redraw.\r\n */\r\n DateFormatter.prototype.invalidateSprite = function () {\r\n if (this.sprite) {\r\n this.sprite.invalidate();\r\n }\r\n };\r\n /**\r\n * Translates list of strings.\r\n *\r\n * @param list Source strings\r\n * @return Translated strings\r\n */\r\n DateFormatter.prototype.getStringList = function (list) {\r\n var res = [];\r\n for (var i = 0; i < list.length; i++) {\r\n // translate?\r\n if (this.language) {\r\n res.push($utils.escapeForRgex(this.language.translate(list[i])));\r\n }\r\n else {\r\n res.push($utils.escapeForRgex(list[i]));\r\n }\r\n }\r\n return res;\r\n };\r\n Object.defineProperty(DateFormatter.prototype, \"dateFormat\", {\r\n /**\r\n * @return Date format\r\n */\r\n get: function () {\r\n return this._dateFormat;\r\n },\r\n /**\r\n * Date format to use.\r\n *\r\n * If format is not supplied in-line in the string, this setting will be\r\n * used.\r\n *\r\n * @default \"yyyy-MM-dd\"\r\n * @param value Date format\r\n */\r\n set: function (value) {\r\n this._dateFormat = value;\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DateFormatter.prototype, \"inputDateFormat\", {\r\n /**\r\n * @return Date format\r\n */\r\n get: function () {\r\n return this._inputDateFormat;\r\n },\r\n /**\r\n * Date format to use when parsing dates.\r\n *\r\n * @default \"yyyy-MM-dd\"\r\n * @param value Date format\r\n */\r\n set: function (value) {\r\n this._inputDateFormat = value;\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DateFormatter.prototype, \"intlLocales\", {\r\n /**\r\n * @return Date format\r\n */\r\n get: function () {\r\n return this._intlLocales;\r\n },\r\n /**\r\n * Locales if you are using date formats in `Intl.DateTimeFormatOptions` syntax.\r\n *\r\n * @param value Locales\r\n */\r\n set: function (value) {\r\n this._intlLocales = value;\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DateFormatter.prototype, \"utc\", {\r\n /**\r\n * @return Use UTC?\r\n */\r\n get: function () {\r\n return this._utc;\r\n },\r\n /**\r\n * Should formatter use UTC functions?\r\n *\r\n * If UTC is used, all date/time values will be independent on client's\r\n * time zone.\r\n *\r\n * @param value Use UTC?\r\n */\r\n set: function (value) {\r\n this._utc = value;\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DateFormatter.prototype, \"timezoneOffset\", {\r\n /**\r\n * @return Offset (minutes)\r\n */\r\n get: function () {\r\n return this._timezoneOffset;\r\n },\r\n /**\r\n * If set, will apply specific offset in minutes before formatting the date\r\n * text.\r\n *\r\n * The value is a number of minutes from target time zone to UTC.\r\n *\r\n * E.g. `300` will recalculate Dates in \"GMT-5\" time zone.\r\n *\r\n * @param value Offset (minutes)\r\n */\r\n set: function (value) {\r\n if (this._timezoneOffset != value) {\r\n this._timezoneOffset = value;\r\n this.invalidateSprite();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DateFormatter.prototype, \"timezone\", {\r\n /**\r\n * @return Timezone\r\n */\r\n get: function () {\r\n return this._timezone;\r\n },\r\n /**\r\n * If set, will format date/time in specific time zone.\r\n *\r\n * The value should be named time zone, e.g.:\r\n * `\"America/Vancouver\"`, `\"Australia/Sydney\"`, `\"UTC\"`.\r\n *\r\n * @since 4.10.1\r\n * @param value Timezone\r\n */\r\n set: function (value) {\r\n if (this._timezone != value) {\r\n this._timezone = value;\r\n this.timezoneMinutes = $time.getTimezoneMinutes(value);\r\n this.invalidateSprite();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DateFormatter.prototype, \"firstDayOfWeek\", {\r\n /**\r\n * @return First day of week\r\n */\r\n get: function () {\r\n return this._firstDayOfWeek;\r\n },\r\n /**\r\n * First day of the week:\r\n *\r\n * * 0 - Sunday\r\n * * 1 - Monday\r\n * * 2 - Tuesday\r\n *\r\n * Etc.\r\n *\r\n * @param value First day of week\r\n */\r\n set: function (value) {\r\n this._firstDayOfWeek = value;\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DateFormatter.prototype, \"outputFormat\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Format\r\n */\r\n get: function () {\r\n return this._outputFormat;\r\n },\r\n /**\r\n * Output format for the formatted date.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Format\r\n */\r\n set: function (value) {\r\n this._outputFormat = value.toLowerCase();\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return DateFormatter;\r\n}(BaseObject));\r\nexport { DateFormatter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"DateFormatter\"] = DateFormatter;\r\n//# sourceMappingURL=DateFormatter.js.map","/**\r\n * Duration formatting functionality.\r\n */\r\nimport { __extends } from \"tslib\";\r\nimport { Language } from \"../utils/Language\";\r\nimport { BaseObject } from \"../Base\";\r\nimport { getTextFormatter } from \"../formatters/TextFormatter\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $strings from \"../utils/Strings\";\r\nimport * as $object from \"../utils/Object\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $math from \"../utils/Math\";\r\n/**\r\n * DurationFormatter class. Formats numbers as durations.\r\n *\r\n * `1000` as `16:40`\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-duration/} Tutorial on duration formatting\r\n */\r\nvar DurationFormatter = /** @class */ (function (_super) {\r\n __extends(DurationFormatter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function DurationFormatter() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * A base value for negative numbers. Will treat all numbers below this value\r\n * as negative numbers.\r\n */\r\n _this._negativeBase = 0;\r\n /**\r\n * A base unit to consider values are in.\r\n *\r\n * @default \"s\"\r\n */\r\n _this._baseUnit = \"second\";\r\n /**\r\n * Output format to produce. If the format calls for applying color to the\r\n * formatted value, this setting will determine what markup to use: SVG or\r\n * HTML.\r\n *\r\n * Available options: svg, html.\r\n *\r\n * @default \"svg\"\r\n */\r\n _this._outputFormat = \"svg\";\r\n /**\r\n * How many milliseconds each unit represents.\r\n */\r\n _this._unitValues = {\r\n \"millisecond\": 1,\r\n \"second\": 1000,\r\n \"minute\": 60000,\r\n \"hour\": 3600000,\r\n \"day\": 86400000,\r\n \"week\": 604800000,\r\n \"month\": 2592000000,\r\n \"year\": 31536000000,\r\n };\r\n /**\r\n * Collection of aliases for units.\r\n */\r\n _this._unitAliases = {\r\n \"Y\": \"y\",\r\n \"D\": \"d\",\r\n \"H\": \"h\",\r\n \"K\": \"h\",\r\n \"k\": \"h\",\r\n \"n\": \"S\"\r\n };\r\n _this.className = \"DurationFormatter\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Formats the number according as duration.\r\n *\r\n * For example `1000` (base unit seconds) would be converted to `16:40` as in\r\n * 16 minutes and 40 seconds.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-duration/} Tutorial on duration formatting\r\n * @param value Value to format\r\n * @param format Format to apply\r\n * @param base Override base unit\r\n * @return Formatted number\r\n */\r\n DurationFormatter.prototype.format = function (value, format, base) {\r\n // no language?\r\n if (!this.language) {\r\n if (this.sprite) {\r\n this.language = this.sprite.language;\r\n }\r\n else {\r\n this.language = new Language;\r\n }\r\n }\r\n // no base unit?\r\n var baseUnit = base || this._baseUnit;\r\n // no format passed in or empty\r\n if (typeof format === \"undefined\" || format === \"\") {\r\n if ($type.hasValue(this.durationFormat)) {\r\n format = this.durationFormat;\r\n }\r\n else {\r\n format = this.getFormat($type.toNumber(value), null, baseUnit);\r\n }\r\n }\r\n // Clean format\r\n format = $utils.cleanFormat(format);\r\n // get format info (it will also deal with parser caching)\r\n var info = this.parseFormat(format, baseUnit);\r\n // cast to number just in case\r\n // TODO: maybe use better casting\r\n var source = Number(value);\r\n // format and replace the number\r\n var details;\r\n if (source > this._negativeBase) {\r\n details = info.positive;\r\n }\r\n else if (source < this._negativeBase) {\r\n details = info.negative;\r\n }\r\n else {\r\n details = info.zero;\r\n }\r\n // Format\r\n var formatted = this.applyFormat(source, details);\r\n // Apply color?\r\n if (details.color !== \"\") {\r\n if (this._outputFormat === \"svg\") {\r\n formatted = \"\" + formatted + \"\";\r\n }\r\n else if (this._outputFormat === \"html\") {\r\n formatted = \"\" + formatted + \"\";\r\n }\r\n }\r\n return formatted;\r\n };\r\n /**\r\n * Parses supplied format into structured object which can be used to format\r\n * the number.\r\n *\r\n * @param format Format string, i.e. \"#,###.00\"\r\n * @param base Override base unit\r\n * @return Parsed information\r\n */\r\n DurationFormatter.prototype.parseFormat = function (format, base) {\r\n var _this = this;\r\n // Check cache\r\n var cached = this.getCache(format);\r\n if ($type.hasValue(cached)) {\r\n return cached;\r\n }\r\n // no base unit?\r\n var baseUnit = base || this._baseUnit;\r\n // Initialize duration parsing info\r\n var info = {\r\n \"positive\": {\r\n \"color\": \"\",\r\n \"template\": \"\",\r\n \"parts\": [],\r\n \"source\": \"\",\r\n \"baseUnit\": baseUnit,\r\n \"parsed\": false,\r\n \"absolute\": false\r\n },\r\n \"negative\": {\r\n \"color\": \"\",\r\n \"template\": \"\",\r\n \"parts\": [],\r\n \"source\": \"\",\r\n \"baseUnit\": baseUnit,\r\n \"parsed\": false,\r\n \"absolute\": false\r\n },\r\n \"zero\": {\r\n \"color\": \"\",\r\n \"template\": \"\",\r\n \"parts\": [],\r\n \"source\": \"\",\r\n \"baseUnit\": baseUnit,\r\n \"parsed\": false,\r\n \"absolute\": false\r\n }\r\n };\r\n // Escape double vertical bars (that mean display one vertical bar)\r\n format = format.replace(\"||\", $strings.PLACEHOLDER2);\r\n // Split it up and deal with different formats\r\n var parts = format.split(\"|\");\r\n info.positive.source = parts[0];\r\n if (typeof parts[2] === \"undefined\") {\r\n info.zero = info.positive;\r\n }\r\n else {\r\n info.zero.source = parts[2];\r\n }\r\n if (typeof parts[1] === \"undefined\") {\r\n info.negative = info.positive;\r\n }\r\n else {\r\n info.negative.source = parts[1];\r\n }\r\n // Parse each\r\n $object.each(info, function (part, item) {\r\n // Already parsed\r\n if (item.parsed) {\r\n return;\r\n }\r\n // Check cached\r\n if (typeof _this.getCache(item.source) !== \"undefined\") {\r\n info[part] = _this.getCache(item.source);\r\n return;\r\n }\r\n // Begin parsing\r\n var partFormat = item.source;\r\n // Check for [] directives\r\n var dirs = [];\r\n dirs = item.source.match(/^\\[([^\\]]*)\\]/);\r\n if (dirs && dirs.length && dirs[0] !== \"\") {\r\n partFormat = item.source.substr(dirs[0].length);\r\n item.color = dirs[1];\r\n }\r\n // Let TextFormatter split into chunks\r\n var chunks = getTextFormatter().chunk(partFormat, true);\r\n for (var i = 0; i < chunks.length; i++) {\r\n var chunk = chunks[i];\r\n // replace back double vertical bar\r\n chunk.text = chunk.text.replace($strings.PLACEHOLDER2, \"|\");\r\n if (chunk.type === \"value\") {\r\n // Just \"Duration\"?\r\n // if (chunk.text.toLowerCase() === \"duration\") {\r\n // \tchunk.text = durationFormat;\r\n // }\r\n // Check for \"a\" (absolute) modifier\r\n if (chunk.text.match(/[yYMdDwhHKkmsSn]+a/)) {\r\n item.absolute = true;\r\n chunk.text = chunk.text.replace(/([yYMdDwhHKkmsSn]+)a/, \"$1\");\r\n }\r\n // Find all possible parts\r\n var matches = chunk.text.match(/y+|Y+|M+|d+|D+|w+|h+|H+|K+|k+|m+|s+|S+|n+/g);\r\n if (matches) {\r\n // Populate template\r\n for (var x = 0; x < matches.length; x++) {\r\n // Is it an alias?\r\n if (!$type.hasValue(matches[x])) {\r\n matches[x] = _this._unitAliases[matches[x]];\r\n }\r\n item.parts.push(matches[x]);\r\n chunk.text = chunk.text.replace(matches[x], $strings.PLACEHOLDER);\r\n }\r\n }\r\n }\r\n // Apply to template\r\n item.template += chunk.text;\r\n }\r\n // Apply style formatting\r\n //item.template = getTextFormatter().format(item.template, this.outputFormat);\r\n // Save cache\r\n _this.setCache(item.source, item);\r\n // Mark this as parsed\r\n item.parsed = true;\r\n });\r\n // Save cache (the whole thing)\r\n this.setCache(format, info);\r\n return info;\r\n };\r\n /**\r\n * Applies parsed format to a numeric value.\r\n *\r\n * @param value Value\r\n * @param details Parsed format as returned by {parseFormat}\r\n * @return Formatted duration\r\n */\r\n DurationFormatter.prototype.applyFormat = function (value, details) {\r\n // Use absolute values\r\n var negative = !details.absolute && (value < this._negativeBase);\r\n value = Math.abs(value);\r\n // Recalculate to milliseconds\r\n var tstamp = this.toTimeStamp(value, details.baseUnit);\r\n // Init return value\r\n var res = details.template;\r\n // Iterate through duration parts\r\n for (var i = 0, len = details.parts.length; i < len; i++) {\r\n // Gather the part\r\n var part = details.parts[i];\r\n var unit = this.toTimeUnit(part.substr(0, 1));\r\n var digits = part.length;\r\n // Calculate current unit value\r\n var ints = Math.floor(tstamp / this._unitValues[unit]);\r\n res = res.replace($strings.PLACEHOLDER, $utils.padString(ints, digits, \"0\"));\r\n // Reduce timestamp\r\n tstamp -= ints * this._unitValues[unit];\r\n }\r\n // Reapply negative sign\r\n if (negative) {\r\n res = \"-\" + res;\r\n }\r\n return res;\r\n };\r\n /**\r\n * Converts numeric value to timestamp in milliseconds.\r\n *\r\n * @param value A source value\r\n * @param baseUnit Base unit the source value is in: \"q\", \"s\", \"i\", \"h\", \"d\", \"w\", \"m\", \"y\"\r\n * @return Value representation as a timestamp in milliseconds\r\n */\r\n DurationFormatter.prototype.toTimeStamp = function (value, baseUnit) {\r\n return value * this._unitValues[baseUnit];\r\n };\r\n DurationFormatter.prototype.toTimeUnit = function (code) {\r\n switch (code) {\r\n case \"S\":\r\n return \"millisecond\";\r\n case \"s\":\r\n return \"second\";\r\n case \"m\":\r\n return \"minute\";\r\n case \"h\":\r\n return \"hour\";\r\n case \"d\":\r\n return \"day\";\r\n case \"w\":\r\n return \"week\";\r\n case \"M\":\r\n return \"month\";\r\n case \"y\":\r\n return \"year\";\r\n }\r\n ;\r\n };\r\n /**\r\n * Invalidates the parent [[Sprite]] object.\r\n */\r\n DurationFormatter.prototype.invalidateSprite = function () {\r\n if (this.sprite) {\r\n this.sprite.invalidate();\r\n }\r\n };\r\n Object.defineProperty(DurationFormatter.prototype, \"baseUnit\", {\r\n /**\r\n * @return Base unit\r\n */\r\n get: function () {\r\n return this._baseUnit;\r\n },\r\n /**\r\n * Base unit the values are in.\r\n *\r\n * A base unit will be used to recalculate the numeric value to millisecond\r\n * timestamps.\r\n *\r\n * Available options:\r\n *\r\n * * \"millisecond\"\r\n * * \"second\"\r\n * * \"minute\"\r\n * * \"hour\"\r\n * * \"day\"\r\n * * \"week\"\r\n * * \"month\"\r\n * * \"year\"\r\n *\r\n * @default \"s\"\r\n * @param baseUnit A base unit\r\n */\r\n set: function (baseUnit) {\r\n this._baseUnit = baseUnit;\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DurationFormatter.prototype, \"outputFormat\", {\r\n /**\r\n * Getter for output format.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Output format\r\n */\r\n get: function () {\r\n return this._outputFormat;\r\n },\r\n /**\r\n * Setter for output format: \"svg\" or \"html.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Output format\r\n */\r\n set: function (outputFormat) {\r\n this._outputFormat = outputFormat.toLowerCase();\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns appropriate default format for the value.\r\n *\r\n * If `maxValue` is sepcified, it will use that value to determine the time\r\n * unit for the format.\r\n *\r\n * For example if your `baseUnit` is `\"second\"` and you pass in `10`, you\r\n * will get `\"10\"`.\r\n *\r\n * However, you might want it to be formatted in the context of bigger scale,\r\n * say 10 minutes (600 seconds). If you pass in `600` as `maxValue`, all\r\n * values, including small ones will use format with minutes, e.g.:\r\n * `00:10`, `00:50`, `12: 30`, etc.\r\n *\r\n * @param value Value to format\r\n * @param maxValue Maximum value to be used to determine format\r\n * @param baseUnit Base unit of the value\r\n * @return Format\r\n */\r\n DurationFormatter.prototype.getFormat = function (value, maxValue, baseUnit) {\r\n // Is format override set?\r\n if ($type.hasValue(this.durationFormat)) {\r\n return this.durationFormat;\r\n }\r\n // Get base unit\r\n if (!baseUnit) {\r\n baseUnit = this.baseUnit;\r\n }\r\n if ($type.hasValue(maxValue) && value != maxValue) {\r\n value = Math.abs(value);\r\n maxValue = Math.abs(maxValue);\r\n var maxUnit = this.getValueUnit($math.max(value, maxValue), baseUnit);\r\n //let diffUnit = this.getValueUnit(Math.abs(maxValue - value), baseUnit);\r\n //console.log(maxUnit, diffUnit);\r\n return this.durationFormats[baseUnit][maxUnit];\r\n }\r\n else {\r\n var unit = this.getValueUnit(value, baseUnit);\r\n return this.durationFormats[baseUnit][unit];\r\n }\r\n };\r\n /**\r\n * Returns value's closest denominator time unit, e.g 100 seconds is\r\n * `\"minute\"`, while 59 seconds would still be `second`.\r\n *\r\n * @param value Source duration value\r\n * @param baseUnit Base unit\r\n * @return Denominator\r\n */\r\n DurationFormatter.prototype.getValueUnit = function (value, baseUnit) {\r\n // Get base unit\r\n if (!baseUnit) {\r\n baseUnit = this.baseUnit;\r\n }\r\n // Convert to milliseconds\r\n var currentUnit;\r\n var ms = this.getMilliseconds(value, baseUnit);\r\n $object.eachContinue(this._unitValues, function (key, val) {\r\n if (key == baseUnit || currentUnit) {\r\n var num = ms / val;\r\n if (num <= 1) {\r\n if (!currentUnit) {\r\n currentUnit = key;\r\n }\r\n return false;\r\n }\r\n currentUnit = key;\r\n }\r\n return true;\r\n });\r\n return currentUnit;\r\n };\r\n /**\r\n * Converts value to milliseconds according to `baseUnit`.\r\n *\r\n * @param value Source duration value\r\n * @param baseUnit Base unit\r\n * @return Value in milliseconds\r\n */\r\n DurationFormatter.prototype.getMilliseconds = function (value, baseUnit) {\r\n // Get base unit\r\n if (!baseUnit) {\r\n baseUnit = this.baseUnit;\r\n }\r\n return value * this._unitValues[baseUnit];\r\n };\r\n Object.defineProperty(DurationFormatter.prototype, \"durationFormat\", {\r\n /**\r\n * @return Format\r\n */\r\n get: function () {\r\n return this._durationFormat;\r\n },\r\n /**\r\n * If set, this format will be used instead of the one determined dynamically\r\n * based on the basedUnit and range of values.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-duration/} Available fomatting codes\r\n * @param value Format\r\n */\r\n set: function (value) {\r\n if (this._durationFormat != value) {\r\n this._durationFormat = value;\r\n this.invalidateSprite();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DurationFormatter.prototype, \"durationFormats\", {\r\n /**\r\n * @return Formats\r\n */\r\n get: function () {\r\n if (!this._durationFormats) {\r\n this._durationFormats = {\r\n \"millisecond\": {\r\n \"millisecond\": this.language.translate(\"_duration_millisecond\"),\r\n \"second\": this.language.translate(\"_duration_millisecond_second\"),\r\n \"minute\": this.language.translate(\"_duration_millisecond_minute\"),\r\n \"hour\": this.language.translate(\"_duration_millisecond_hour\"),\r\n \"day\": this.language.translate(\"_duration_millisecond_day\"),\r\n \"week\": this.language.translate(\"_duration_millisecond_week\"),\r\n \"month\": this.language.translate(\"_duration_millisecond_month\"),\r\n \"year\": this.language.translate(\"_duration_millisecond_year\")\r\n },\r\n \"second\": {\r\n \"second\": this.language.translate(\"_duration_second\"),\r\n \"minute\": this.language.translate(\"_duration_second_minute\"),\r\n \"hour\": this.language.translate(\"_duration_second_hour\"),\r\n \"day\": this.language.translate(\"_duration_second_day\"),\r\n \"week\": this.language.translate(\"_duration_second_week\"),\r\n \"month\": this.language.translate(\"_duration_second_month\"),\r\n \"year\": this.language.translate(\"_duration_second_year\")\r\n },\r\n \"minute\": {\r\n \"minute\": this.language.translate(\"_duration_minute\"),\r\n \"hour\": this.language.translate(\"_duration_minute_hour\"),\r\n \"day\": this.language.translate(\"_duration_minute_day\"),\r\n \"week\": this.language.translate(\"_duration_minute_week\"),\r\n \"month\": this.language.translate(\"_duration_minute_month\"),\r\n \"year\": this.language.translate(\"_duration_minute_year\")\r\n },\r\n \"hour\": {\r\n \"hour\": this.language.translate(\"_duration_hour\"),\r\n \"day\": this.language.translate(\"_duration_hour_day\"),\r\n \"week\": this.language.translate(\"_duration_hour_week\"),\r\n \"month\": this.language.translate(\"_duration_hour_month\"),\r\n \"year\": this.language.translate(\"_duration_hour_year\")\r\n },\r\n \"day\": {\r\n \"day\": this.language.translate(\"_duration_day\"),\r\n \"week\": this.language.translate(\"_duration_day_week\"),\r\n \"month\": this.language.translate(\"_duration_day_month\"),\r\n \"year\": this.language.translate(\"_duration_day_year\")\r\n },\r\n \"week\": {\r\n \"week\": this.language.translate(\"_duration_week\"),\r\n \"month\": this.language.translate(\"_duration_week_month\"),\r\n \"year\": this.language.translate(\"_duration_week_year\")\r\n },\r\n \"month\": {\r\n \"month\": this.language.translate(\"_duration_month\"),\r\n \"year\": this.language.translate(\"_duration_month_year\")\r\n },\r\n \"year\": {\r\n \"year\": this.language.translate(\"_duration_year\")\r\n }\r\n };\r\n }\r\n return this._durationFormats;\r\n },\r\n /**\r\n * Duration formats for various combination of base units.\r\n *\r\n * @param value Formats\r\n */\r\n set: function (value) {\r\n this._durationFormats = value;\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return DurationFormatter;\r\n}(BaseObject));\r\nexport { DurationFormatter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"DurationFormatter\"] = DurationFormatter;\r\n//# sourceMappingURL=DurationFormatter.js.map","import { StyleRule } from \"../utils/DOM\";\r\nimport { InterfaceColorSet } from \"../utils/InterfaceColorSet\";\r\nimport { Dictionary } from \"../utils/Dictionary\";\r\nimport { MultiDisposer, CounterDisposer } from \"../utils/Disposer\";\r\nvar rules = new Dictionary();\r\n/**\r\n * A dynamically-loadable CSS module for Export menu.\r\n *\r\n * @ignore Exclude from docs\r\n * @param prefix Prefix to addtach to class names\r\n * @return A MultiDisposer with style rules\r\n */\r\nexport default function (element, prefix) {\r\n var newPrefix = (prefix ? prefix : \"amexport\");\r\n var colorSet = new InterfaceColorSet();\r\n var counter = rules.insertKeyIfEmpty(newPrefix, function () {\r\n var disposer = new MultiDisposer([\r\n /*new StyleRule(`.${newPrefix}-menu`, {\r\n \"opacity\": \"0.3\",\r\n \"transition\": \"all 100ms ease-in-out\",\r\n }),\r\n\r\n new StyleRule(`div:hover .${newPrefix}-menu, .${newPrefix}-menu.active`, {\r\n \"opacity\": \"0.9\",\r\n }),*/\r\n new StyleRule(element, \".\" + newPrefix + \"-menu *\", {\r\n \"box-sizing\": \"border-box\"\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-menu-level-0\", {\r\n \"position\": \"absolute\",\r\n \"top\": \"5px\",\r\n \"right\": \"5px\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-menu-level-0.\" + newPrefix + \"-left\", {\r\n \"right\": \"auto\",\r\n \"left\": \"5px\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-menu-level-0.\" + newPrefix + \"-right\", {\r\n \"right\": \"5px\",\r\n \"left\": \"auto\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-menu-level-0.\" + newPrefix + \"-top\", {\r\n \"top\": \"5px\",\r\n \"bottom\": \"auto\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-menu-level-0.\" + newPrefix + \"-bottom\", {\r\n \"top\": \"auto\",\r\n \"bottom\": \"5px\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-item.\" + newPrefix + \"-item-level-0\", {\r\n \"opacity\": \"0.3\",\r\n \"width\": \"30px\",\r\n \"min-height\": \"30px\",\r\n \"transition\": \"all 100ms ease-in-out\",\r\n }),\r\n new StyleRule(element, \"div:hover > div > .\" + newPrefix + \"-menu .\" + newPrefix + \"-item.\" + newPrefix + \"-item-level-0, .\" + newPrefix + \"-item.\" + newPrefix + \"-item-level-0.active\", {\r\n \"opacity\": \"0.9\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-item.\" + newPrefix + \"-item-level-0 > a\", {\r\n \"padding\": \"0\",\r\n \"text-align\": \"center\",\r\n \"overflow\": \"hidden\"\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-item.\" + newPrefix + \"-item-level-0:before\", {\r\n \"display\": \"block\"\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-item\", {\r\n \"position\": \"relative\",\r\n \"display\": \"block\",\r\n \"opacity\": \"0\",\r\n \"z-index\": \"1\",\r\n \"border-radius\": \"3px\",\r\n \"background-color\": colorSet.getFor(\"secondaryButton\").hex,\r\n \"padding\": \"0\",\r\n \"margin\": \"1px 1px 0 0\",\r\n \"color\": colorSet.getFor(\"secondaryButton\").alternative.hex,\r\n \"transition\": \"all 100ms ease-in-out, opacity 0.5s ease 0.5s\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-left .\" + newPrefix + \"-item\", {\r\n \"margin\": \"1px 0 0 1px\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-item:hover, .\" + newPrefix + \"-item.active\", {\r\n \"background\": colorSet.getFor(\"secondaryButtonHover\").hex,\r\n \"color\": colorSet.getFor(\"secondaryButtonText\").hex,\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-item > .\" + newPrefix + \"-menu\", {\r\n \"position\": \"absolute\",\r\n \"top\": \"-1px\",\r\n \"right\": \"0\",\r\n \"margin-right\": \"100%\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-left .\" + newPrefix + \"-item > .\" + newPrefix + \"-menu\", {\r\n \"left\": \"0\",\r\n \"right\": \"auto\",\r\n \"margin-left\": \"100%\",\r\n \"margin-right\": \"auto\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-right .\" + newPrefix + \"-item > .\" + newPrefix + \"-menu\", {\r\n \"left\": \"auto\",\r\n \"right\": \"0\",\r\n \"margin-left\": \"auto\",\r\n \"margin-right\": \"100%\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-top .\" + newPrefix + \"-item > .\" + newPrefix + \"-menu\", {\r\n \"top\": \"-1px\",\r\n \"bottom\": \"auto\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-bottom .\" + newPrefix + \"-item > .\" + newPrefix + \"-menu\", {\r\n \"top\": \"auto\",\r\n \"bottom\": \"0\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-item > .\" + newPrefix + \"-menu\", {\r\n \"display\": \"none\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-item:hover > .\" + newPrefix + \"-menu, .\" + newPrefix + \"-item.active > .\" + newPrefix + \"-menu\", {\r\n \"display\": \"block\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-item:hover > .\" + newPrefix + \"-menu > .\" + newPrefix + \"-item, .\" + newPrefix + \"-item.active > .\" + newPrefix + \"-menu > .\" + newPrefix + \"-item\", {\r\n \"opacity\": \"1\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-menu\", {\r\n \"display\": \"block\",\r\n \"list-style\": \"none\",\r\n \"margin\": \"0\",\r\n \"padding\": \"0\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-label\", {\r\n \"display\": \"block\",\r\n \"cursor\": \"default\",\r\n \"padding\": \"0.5em 1em\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-icon\", {\r\n \"display\": \"block\",\r\n \"cursor\": \"default\",\r\n \"padding\": \"0.2em 0.4em\",\r\n \"width\": \"1.2em\",\r\n \"height\": \"1.2em\",\r\n \"min-width\": \"32px\",\r\n \"min-height\": \"32px\",\r\n \"margin\": \"auto auto\",\r\n \"border-radius\": \"3px\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-item-level-0 > .\" + newPrefix + \"-icon\", {\r\n \"padding\": \"0.1em 0.2em\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-clickable\", {\r\n \"cursor\": \"pointer\",\r\n }),\r\n ]);\r\n return new CounterDisposer(function () {\r\n rules.removeKey(newPrefix);\r\n disposer.dispose();\r\n });\r\n });\r\n return counter.increment();\r\n}\r\n//# sourceMappingURL=ExportCSS.js.map","/**\r\n * Export module.\r\n *\r\n * Parts of Export functionality rely on the following third party libraries:\r\n *\r\n * [canvg.js](https://github.com/canvg/canvg)\r\n * Copyright (c) Gabe Lerner\r\n * Licensed under [MIT](https://github.com/canvg/canvg/blob/master/LICENSE)\r\n *\r\n * [pdfmake](http://pdfmake.org/)\r\n * Copyright (c) 2014 bpampuch\r\n * Licensed under [MIT](https://github.com/bpampuch/pdfmake/blob/master/LICENSE)\r\n *\r\n * [SheetJS Community Edition](https://github.com/sheetjs/js-xlsx)\r\n * Licensed under [Apache License 2.0](https://github.com/SheetJS/js-xlsx/blob/master/LICENSE)\r\n *\r\n * [JSZip](http://stuartk.com/jszip)\r\n * Copyright (c) Stuart Knightley\r\n * Dual licenced under the [MIT license or GPLv3](https://raw.githubusercontent.com/Stuk/jszip/master/LICENSE.markdown).\r\n */\r\nimport { __awaiter, __extends, __generator } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { ExportMenu } from \"./ExportMenu\";\r\nimport { Adapter } from \"../utils/Adapter\";\r\nimport { Sprite } from \"../Sprite\";\r\nimport { Modal } from \"../elements/Modal\";\r\nimport { List } from \"../utils/List\";\r\nimport { Dictionary } from \"../utils/Dictionary\";\r\nimport { DateFormatter } from \"../formatters/DateFormatter\";\r\nimport { DurationFormatter } from \"../formatters/DurationFormatter\";\r\nimport { NumberFormatter } from \"../formatters/NumberFormatter\";\r\nimport { Language } from \"../utils/Language\";\r\nimport { Validatable } from \"../utils/Validatable\";\r\nimport { color } from \"../utils/Color\";\r\nimport { registry } from \"../Registry\";\r\nimport { options } from \"../Options\";\r\nimport { StyleRule, getComputedStyle } from \"../utils/DOM\";\r\nimport * as $browser from \"../utils/Browser\";\r\nimport * as $object from \"../utils/Object\";\r\nimport * as $net from \"../utils/Net\";\r\nimport * as $dom from \"../utils/DOM\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $log from \"../utils/Log\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $array from \"../utils/Array\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $strings from \"../utils/Strings\";\r\n// This is used to cache the pdfmake loading\r\nvar pdfmakePromise;\r\n/**\r\n * Loads pdfmake dynamic module\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Instance of pdfmake\r\n * @async\r\n */\r\nfunction _pdfmake() {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var a, pdfmake, vfs_fonts, global;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, Promise.all([\r\n import(/* webpackChunkName: \"pdfmake\" */ \"pdfmake/build/pdfmake.js\"),\r\n import(/* webpackChunkName: \"pdfmake\" */ \"../../pdfmake/vfs_fonts\")\r\n ])];\r\n case 1:\r\n a = _a.sent();\r\n pdfmake = a[0].default || a[0];\r\n vfs_fonts = a[1].default || a[1];\r\n global = window;\r\n global.pdfMake = global.pdfMake || {};\r\n global.pdfMake.vfs = vfs_fonts;\r\n pdfmake.vfs = vfs_fonts;\r\n return [2 /*return*/, pdfmake];\r\n }\r\n });\r\n });\r\n}\r\n// TODO better parsing\r\nvar fontFamilySrcRegexp = /src: ([^;]+);/;\r\n// TODO better checks\r\nfunction supportsBlobUri() {\r\n return window.navigator.msSaveOrOpenBlob != null;\r\n}\r\n// TODO move into utils or something ?\r\nfunction blobToDataUri(blob) {\r\n return new Promise(function (resolve, reject) {\r\n // TODO handle abort ?\r\n var f = new FileReader();\r\n f.onload = function (e) { resolve(f.result); };\r\n f.onerror = function (e) { reject(e); };\r\n f.readAsDataURL(blob);\r\n });\r\n}\r\nfunction getCssRules(s) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var sheet, e_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n sheet = s.sheet;\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 2, , 4]);\r\n return [2 /*return*/, sheet.cssRules];\r\n case 2:\r\n e_1 = _a.sent();\r\n return [4 /*yield*/, new Promise(function (success, error) {\r\n s.addEventListener(\"load\", function () {\r\n success(sheet.cssRules);\r\n }, true);\r\n s.addEventListener(\"error\", function (e) {\r\n error(e);\r\n }, true);\r\n setTimeout(function () {\r\n error(new Error(\"Timeout while waiting for \" + this.serializeElement(this.sprite.paper.defs) + this.serializeElement(this.sprite.dom), options, width, height, scale, font, fontSize);\r\n svg = new Blob([data], { type: \"image/svg+xml\" });\r\n url = DOMURL.createObjectURL(svg);\r\n return [4 /*yield*/, this.loadNewImage(url, width * scale * pixelRatio, height * scale * pixelRatio, \"anonymous\")];\r\n case 3:\r\n img = _a.sent();\r\n // Draw image on canvas\r\n ctx.drawImage(img, 0, 0);\r\n return [3 /*break*/, 5];\r\n case 4:\r\n if (url !== null) {\r\n DOMURL.revokeObjectURL(url);\r\n }\r\n if (blobs !== null) {\r\n $array.each(blobs, function (url) {\r\n DOMURL.revokeObjectURL(url);\r\n });\r\n }\r\n // Restore replaced tainted images in DOM\r\n this.restoreRemovedObjects();\r\n return [7 /*endfinally*/];\r\n case 5: return [2 /*return*/, canvas];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Returns canvas representation of the [[Sprite]] using canvg.\r\n *\r\n * @param options Options\r\n * @return Canvas\r\n */\r\n Export.prototype.getCanvasAdvanced = function (options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var background, canvg, width, height, font, fontSize, scale, pixelRatio, data, canvas, config;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n // Options are set?\r\n if (!$type.hasValue(options)) {\r\n options = {};\r\n }\r\n // Convert external images to data uris\r\n return [4 /*yield*/, this.imagesToDataURI(this.sprite.dom, options)];\r\n case 1:\r\n // Convert external images to data uris\r\n _a.sent();\r\n background = this.backgroundColor || this.findBackgroundColor(this.sprite.dom);\r\n return [4 /*yield*/, this.canvg];\r\n case 2:\r\n canvg = _a.sent();\r\n width = this.sprite.pixelWidth;\r\n height = this.sprite.pixelHeight;\r\n font = $dom.findFont(this.sprite.dom);\r\n fontSize = $dom.findFontSize(this.sprite.dom);\r\n scale = options.scale || 1;\r\n pixelRatio = this.getPixelRatio(options);\r\n // Check if scale needs to be updated as per min/max dimensions\r\n scale = this.getAdjustedScale(width * pixelRatio, height * pixelRatio, scale, options);\r\n data = this.normalizeSVG(this.serializeElement(this.sprite.paper.defs) + this.serializeElement(this.sprite.dom), options, width, height, scale, font, fontSize, background);\r\n canvas = this.getDisposableCanvas();\r\n // Set canvas width/height\r\n canvas.style.width = (width * pixelRatio * scale) + 'px';\r\n canvas.style.height = (height * pixelRatio * scale) + 'px';\r\n canvas.width = width * pixelRatio * scale;\r\n canvas.height = height * pixelRatio * scale;\r\n config = {\r\n //ignoreDimensions: true,\r\n useCORS: true\r\n };\r\n if (pixelRatio != 1) {\r\n config.ignoreDimensions = true;\r\n config.scaleWidth = width * pixelRatio * scale;\r\n config.scaleHeight = height * pixelRatio * scale;\r\n }\r\n return [4 /*yield*/, canvg.fromString(canvas.getContext(\"2d\"), data, config).render()];\r\n case 3:\r\n _a.sent();\r\n return [2 /*return*/, canvas];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Tries to dynamically load [canvg.js](https://github.com/canvg/canvg) and\r\n * export an image using its functions.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @param type Image format\r\n * @param options Options\r\n * @return Data uri\r\n */\r\n Export.prototype.getImageAdvanced = function (type, options, includeExtras) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var prehidden, canvas, uri;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n prehidden = this._objectsAlreadyHidden;\r\n if (!prehidden) {\r\n this.hideNonExportableSprites();\r\n }\r\n if (!$type.hasValue(options)) {\r\n options = this.getFormatOptions(type);\r\n }\r\n return [4 /*yield*/, this.getCanvasAdvanced(options)];\r\n case 1:\r\n canvas = _a.sent();\r\n if (!(includeExtras !== false)) return [3 /*break*/, 3];\r\n return [4 /*yield*/, this.addExtras(canvas, options, true)];\r\n case 2:\r\n canvas = _a.sent();\r\n _a.label = 3;\r\n case 3:\r\n uri = canvas.toDataURL(this.getContentType(type), options.quality);\r\n // Get rid of the canvas\r\n this.disposeCanvas(canvas);\r\n if (!prehidden) {\r\n this.restoreNonExportableSprites();\r\n }\r\n return [2 /*return*/, uri];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Creates a `` element and returns it.\r\n *\r\n * @return Canvas element\r\n */\r\n Export.prototype.getDisposableCanvas = function () {\r\n var canvas = document.createElement(\"canvas\");\r\n canvas.style.position = \"fixed\";\r\n canvas.style.top = \"-10000px\";\r\n document.body.appendChild(canvas);\r\n return canvas;\r\n };\r\n /**\r\n * Removes canvas.\r\n *\r\n * @param canvas Canvas element\r\n */\r\n Export.prototype.disposeCanvas = function (canvas) {\r\n if (document.body.contains(canvas)) {\r\n document.body.removeChild(canvas);\r\n }\r\n };\r\n /**\r\n * Returns pixel ratio for retina displays.\r\n *\r\n * @return Pixel ratio\r\n */\r\n Export.prototype.getPixelRatio = function (options) {\r\n // const scale = options && options.scale ? options.scale : 1;\r\n // return (this.useRetina ? $utils.getPixelRatio() : 1) * scale;\r\n return this.useRetina ? $utils.getPixelRatio() : 1;\r\n };\r\n /**\r\n * Calculates adjusted scale if image does not fit or is larger than min/max\r\n * settings.\r\n *\r\n * @param width Width of the source image\r\n * @param height Height of the source image\r\n * @param scale Current scale\r\n * @param options Options\r\n * @return Adjusted scale\r\n */\r\n Export.prototype.getAdjustedScale = function (width, height, scale, options) {\r\n if (!options) {\r\n return scale;\r\n }\r\n var adjWidth = width * scale;\r\n var adjHeight = width * scale;\r\n // Check max restrictions\r\n var widthScale;\r\n var heightScale;\r\n if (options.maxWidth && (adjWidth > options.maxWidth)) {\r\n widthScale = options.maxWidth / width;\r\n }\r\n if (options.maxHeight && (adjHeight > options.maxHeight)) {\r\n heightScale = options.maxHeight / height;\r\n }\r\n if (widthScale || heightScale) {\r\n return $math.min(widthScale, heightScale);\r\n }\r\n // Check min restrictions\r\n if (options.minWidth && (adjWidth < options.minWidth)) {\r\n widthScale = options.minWidth / width;\r\n }\r\n if (options.minHeight && (adjHeight < options.minHeight)) {\r\n heightScale = options.minHeight / height;\r\n }\r\n if (widthScale || heightScale) {\r\n return $math.max(widthScale, heightScale);\r\n }\r\n return scale;\r\n };\r\n /**\r\n * Converts all `` tags in SVG to use data uris instead of external\r\n * URLs\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @ignore Exclude from docs\r\n * @param el SVG node\r\n * @param options Options\r\n * @return Promise\r\n */\r\n Export.prototype.imagesToDataURI = function (el, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var images, promises, count, i, image, href;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n images = el.querySelectorAll(\"image\");\r\n if (!images.length) return [3 /*break*/, 2];\r\n promises = [];\r\n // There are images, process each of them\r\n for (count = images.length, i = 0; i < count; i++) {\r\n image = images[i];\r\n href = image.getAttributeNS(Export.XLINK, \"href\");\r\n // no href?\r\n if (!href) {\r\n continue;\r\n }\r\n if (href.indexOf(\"data:image\") !== -1) {\r\n // Ignore image if it's already in Data URI format\r\n }\r\n else {\r\n // SVG or bitmap image?\r\n if (href.indexOf(\".svg\") !== -1) {\r\n promises.push(this.svgToDataURI(image, options));\r\n }\r\n else {\r\n promises.push(this.imageToDataURI(image, options));\r\n }\r\n }\r\n }\r\n return [4 /*yield*/, Promise.all(promises)];\r\n case 1:\r\n _a.sent();\r\n return [2 /*return*/];\r\n case 2: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * `foreignObject` elements cannot be exported. This function hides them\r\n * temprarily. In the future it might try to convert them to SVG to make them\r\n * exportable.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @ignore Exclude from docs\r\n * @param el SVG node\r\n * @param options Options\r\n * @return Promise\r\n */\r\n Export.prototype.prepForeignObjects = function (el, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var objects, count, i;\r\n return __generator(this, function (_a) {\r\n objects = el.querySelectorAll(\"foreignObject\");\r\n if (objects.length) {\r\n // There are foreign objects, process each of them\r\n for (count = objects.length, i = 0; i < count; i++) {\r\n this.temporarilyRemoveObject(objects[i]);\r\n }\r\n }\r\n return [2 /*return*/];\r\n });\r\n });\r\n };\r\n /**\r\n * Converts an SVG `` to use its data uri for `href` instead of\r\n * external file.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @ignore Exclude from docs\r\n * @param el SVG element\r\n * @param options Options\r\n */\r\n Export.prototype.imageToDataURI = function (el, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var img, canvas, uri, e_5;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n _a.trys.push([0, 2, , 3]);\r\n return [4 /*yield*/, this.loadNewImage(el.getAttributeNS(Export.XLINK, \"href\"), null, null, \"anonymous\")];\r\n case 1:\r\n // Create image\r\n img = _a.sent();\r\n canvas = document.createElement(\"canvas\");\r\n canvas.width = img.width;\r\n canvas.height = img.height;\r\n // Draw new image on it via `toDataURL`\r\n canvas.getContext(\"2d\").drawImage(img, 0, 0);\r\n // Replace image `href` with data uri\r\n // If we got to this point it means image has loaded, however we might\r\n // still get an error with `toDataURL()`\r\n try {\r\n uri = canvas.toDataURL();\r\n el.setAttribute(\"href\", uri);\r\n return [2 /*return*/, uri];\r\n }\r\n catch (e) {\r\n // Give up and temporarily remove the element href temporarily\r\n if (options.keepTainted !== false) {\r\n /*this._removedObjects.push({\r\n \"element\": el,\r\n \"originalHref\": el.getAttributeNS(Export.XLINK, \"href\")\r\n });\r\n el.setAttributeNS(Export.XLINK, \"href\", \"\");*/\r\n this.temporarilyRemoveObject(el);\r\n }\r\n return [2 /*return*/, undefined];\r\n }\r\n return [3 /*break*/, 3];\r\n case 2:\r\n e_5 = _a.sent();\r\n // Give up and temporarily remove the element's href\r\n if (!options || options.keepTainted !== false) {\r\n /*this._removedObjects.push({\r\n \"element\": el,\r\n \"originalHref\": el.getAttributeNS(Export.XLINK, \"href\")\r\n });\r\n el.setAttributeNS(Export.XLINK, \"href\", \"\");*/\r\n this.temporarilyRemoveObject(el);\r\n }\r\n return [2 /*return*/, undefined];\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Converts `` with external SVG source to data uri. Loads external SVG\r\n * file, then converts it to data uri and replaces the `xlink:href` parameter.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @ignore Exclude from docs\r\n * @param el An SVG element\r\n * @param options Options\r\n */\r\n Export.prototype.svgToDataURI = function (el, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var href, data, charset, uri, e_6;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n href = el.getAttributeNS(Export.XLINK, \"href\");\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 3, , 4]);\r\n return [4 /*yield*/, $net.load(href)];\r\n case 2:\r\n data = _a.sent();\r\n charset = this.adapter.apply(\"charset\", {\r\n charset: \"base64\",\r\n type: \"svg\",\r\n options: options\r\n }).charset;\r\n uri = this.adapter.apply(\"svgToDataURI\", {\r\n data: \"data:\" + this.getContentType(\"svg\") + \";\" + charset + \",\" + btoa(data.response),\r\n options: options\r\n }).data;\r\n el.setAttributeNS(Export.XLINK, \"href\", uri);\r\n return [2 /*return*/, uri];\r\n case 3:\r\n e_6 = _a.sent();\r\n // Disable temporarily\r\n if (!options || options.keepTainted !== false) {\r\n /*this._removedObjects.push({\r\n \"element\": el,\r\n \"originalHref\": href\r\n });\r\n el.setAttributeNS(Export.XLINK, \"href\", \"\");*/\r\n this.temporarilyRemoveObject(el);\r\n }\r\n return [2 /*return*/, undefined];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Temporarily removes element from DOM, and replaces it with a dummy\r\n * placeholder, as well as stores it for later restoration.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @ignore Exclude from docs\r\n * @param el Node\r\n */\r\n Export.prototype.temporarilyRemoveObject = function (el, placeholder) {\r\n // Get parent\r\n var parent = el.parentElement || el.parentNode;\r\n // Create a placeholder group element if it has not been passed in\r\n if (!placeholder) {\r\n placeholder = this.sprite.paper.add(\"g\").node;\r\n }\r\n parent.insertBefore(placeholder, el);\r\n // Check if we have a textContents we can replace with\r\n // @todo Perhaps we should explore alternatives to creating text nodes\r\n // i.e. creating a text version of the HTML-based Text, just for export\r\n // purposes. Converting HTML into SVG is very complicated\r\n if (el.textContent) {\r\n /*let text = this.sprite.paper.add(\"text\").node;\r\n text.textContent = el.textContent;\r\n placeholder.appendChild(text);\r\n\r\n // Copy properties from the removing element to the placeholder\r\n $dom.copyAttributes(el, placeholder);*/\r\n }\r\n // Remove the old element\r\n parent.removeChild(el);\r\n // Log removed item\r\n this._removedObjects.push({\r\n \"element\": el,\r\n \"placeholder\": placeholder\r\n });\r\n };\r\n /**\r\n * Restores all (possibly tainted or unsupported) objects that were\r\n * temporarily removed when exporting.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Export.prototype.restoreRemovedObjects = function () {\r\n var obj;\r\n while (true) {\r\n obj = this._removedObjects.pop();\r\n if (!obj) {\r\n break;\r\n }\r\n //obj.element.setAttribute(\"href\", obj.originalHref);\r\n var parent_1 = obj.placeholder.parentElement || obj.placeholder.parentNode;\r\n parent_1.insertBefore(obj.element, obj.placeholder);\r\n //parent.removeChild(obj.placeholder);\r\n }\r\n };\r\n /**\r\n * Checkes if simplified export can be used using `createObjectURL` and SVG\r\n * document does not contain any external images.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @ignore Exclude from docs\r\n * @return `true` if simplified export can be used\r\n */\r\n Export.prototype.simplifiedImageExport = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var cache, canvas, ctx, DOMURL, svg, url, img, e_7, e_8;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (this.useSimplifiedExport === false) {\r\n return [2 /*return*/, false];\r\n }\r\n cache = registry.getCache(\"simplifiedImageExport\");\r\n if (cache === false || cache === true) {\r\n return [2 /*return*/, cache];\r\n }\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 6, , 7]);\r\n canvas = document.createElement(\"canvas\");\r\n canvas.width = 1;\r\n canvas.height = 1;\r\n ctx = canvas.getContext(\"2d\");\r\n DOMURL = this.getDOMURL();\r\n svg = new Blob([this.normalizeSVG(\"\", {}, 1, 1)], { type: \"image/svg+xml\" });\r\n url = DOMURL.createObjectURL(svg);\r\n img = void 0;\r\n _a.label = 2;\r\n case 2:\r\n _a.trys.push([2, 4, , 5]);\r\n return [4 /*yield*/, this.loadNewImage(url, 1, 1)];\r\n case 3:\r\n img = _a.sent();\r\n return [3 /*break*/, 5];\r\n case 4:\r\n e_7 = _a.sent();\r\n return [2 /*return*/, false];\r\n case 5:\r\n ctx.drawImage(img, 0, 0);\r\n DOMURL.revokeObjectURL(url);\r\n try {\r\n //let uri = canvas.toDataURL(\"image/png\");\r\n registry.setCache(\"simplifiedImageExport\", true);\r\n return [2 /*return*/, true];\r\n }\r\n catch (e) {\r\n registry.setCache(\"simplifiedImageExport\", false);\r\n return [2 /*return*/, false];\r\n }\r\n return [3 /*break*/, 7];\r\n case 6:\r\n e_8 = _a.sent();\r\n registry.setCache(\"simplifiedImageExport\", false);\r\n return [2 /*return*/, false];\r\n case 7: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Returns a new `` element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param url URL of the image\r\n * @param width Width (px)\r\n * @param height Height (px)\r\n * @param crossOrigin Cross-Origin setting\r\n * @return Promise\r\n */\r\n Export.prototype.loadNewImage = function (url, width, height, crossOrigin) {\r\n return new Promise(function (success, error) {\r\n // New image\r\n var image;\r\n if (width && height) {\r\n image = new Image(width, height);\r\n }\r\n else {\r\n image = new Image();\r\n }\r\n // Set crossorigin\r\n if (crossOrigin) {\r\n image.setAttribute(\"crossOrigin\", crossOrigin);\r\n }\r\n // Report success on load\r\n image.onload = function () {\r\n success(image);\r\n };\r\n function onerror() {\r\n // Error occurred. Just in case it's the crossOrigin issue, let's try\r\n // stripping off this attribute and trying again\r\n if (crossOrigin) {\r\n // Retain old uri\r\n var currentHref = image.src;\r\n // Set up another `onerror` to handle situations where image is not\r\n // loadable at all (i.e. protected by CORS)\r\n image.onerror = function () {\r\n // Nope, no luck\r\n error(new Error(\"Loading image \\\"\" + url + \"\\\" failed\"));\r\n };\r\n // remove the `crossOrigin` attribute\r\n image.removeAttribute(\"crossorigin\");\r\n // retry\r\n image.src = \"\";\r\n image.src = currentHref;\r\n }\r\n else {\r\n error(new Error(\"Loading image \\\"\" + url + \"\\\" failed\"));\r\n }\r\n }\r\n // Set image error handlers\r\n image.onabort = onerror;\r\n image.onerror = onerror;\r\n // Trigger load\r\n image.src = url;\r\n });\r\n };\r\n /**\r\n * Returns current DOM URL.\r\n *\r\n * @ignore Exclude from docs\r\n * @return URL\r\n */\r\n Export.prototype.getDOMURL = function () {\r\n return self.URL || self.webkitURL || self;\r\n };\r\n /**\r\n * Returns an SVG representation of the chart.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @param type Type of the export\r\n * @param options Options\r\n * @param encodeURI If true, will return result will be data URI\r\n * @return Promise\r\n */\r\n Export.prototype.getSVG = function (type, options, encodeURI) {\r\n if (encodeURI === void 0) { encodeURI = true; }\r\n return __awaiter(this, void 0, void 0, function () {\r\n var prehidden, width, height, font, fontSize, scale, pixelRatio, svg, charset, uri;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n prehidden = this._objectsAlreadyHidden;\r\n if (!prehidden) {\r\n this.hideNonExportableSprites();\r\n }\r\n if (!$type.hasValue(options)) {\r\n options = this.getFormatOptions(\"svg\");\r\n }\r\n // Wait for required elements to be ready before proceeding\r\n return [4 /*yield*/, this.awaitValidSprites()];\r\n case 1:\r\n // Wait for required elements to be ready before proceeding\r\n _a.sent();\r\n width = this.sprite.pixelWidth;\r\n height = this.sprite.pixelHeight;\r\n font = $dom.findFont(this.sprite.dom);\r\n fontSize = $dom.findFontSize(this.sprite.dom);\r\n scale = options.scale || 1;\r\n pixelRatio = this.getPixelRatio(options);\r\n // Check if scale needs to be updated as per min/max dimensions\r\n scale = this.getAdjustedScale(width * pixelRatio, height * pixelRatio, scale, options);\r\n svg = this.normalizeSVG(this.serializeElement(this.sprite.paper.defs) + this.serializeElement(this.sprite.dom), options, width, height, scale, font, fontSize);\r\n charset = this.adapter.apply(\"charset\", {\r\n charset: \"charset=utf-8\",\r\n type: \"svg\",\r\n options: options\r\n }).charset;\r\n uri = this.adapter.apply(\"getSVG\", {\r\n data: encodeURI ? \"data:\" + this.getContentType(type) + \";\" + charset + \",\" + encodeURIComponent(svg) : svg,\r\n options: options\r\n }).data;\r\n if (!prehidden) {\r\n this.restoreNonExportableSprites();\r\n }\r\n return [2 /*return*/, uri];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Checks if SVG is fully formatted. Encloses in `...` if\r\n * necessary.\r\n *\r\n * @ignore Exclude from docs\r\n * @param svg Input SVG\r\n * @param options Options\r\n * @param width Width of the SVG viewport\r\n * @param height Height of the SVG viewport\r\n * @param font Font family to use as a base\r\n * @param fontSize Font size to use as a base\r\n * @return Output SVG\r\n * @todo Add style params to existing \r\n */\r\n Export.prototype.normalizeSVG = function (svg, options, width, height, scale, font, fontSize, background) {\r\n // Construct width/height params\r\n var dimParams = \"\";\r\n if (width) {\r\n dimParams += \"width=\\\"\" + Math.round(width * (scale || 1)) + \"px\\\" \";\r\n }\r\n if (height) {\r\n dimParams += \"height=\\\"\" + Math.round(height * (scale || 1)) + \"px\\\" \";\r\n }\r\n // Apply font settings\r\n var styleParams = \"\";\r\n if (font) {\r\n styleParams += \"font-family: \" + font.replace(/\"/g, \"\") + \";\";\r\n }\r\n if (fontSize) {\r\n styleParams += \"font-size: \" + fontSize + \";\";\r\n }\r\n // Scale\r\n if (scale) {\r\n dimParams += \"viewBox=\\\"0 0 \" + (width) + \" \" + (height) + \"\\\" \";\r\n }\r\n // Remove foreign objects temporarily\r\n var fos = [];\r\n var ms = svg.match(//gi);\r\n if (ms) {\r\n for (var i = 0; i < ms.length; i++) {\r\n svg = svg.replace(ms[i], $strings.PLACEHOLDER);\r\n fos.push(ms[i]);\r\n }\r\n }\r\n // Add missing enclosure\r\n if (!svg.match(/\" + svg + \"\";\r\n }\r\n else {\r\n if (dimParams !== \"\") {\r\n // Clear current params\r\n svg = svg.replace(/(]*)width=\"[^\"]*\"/, \"$1\");\r\n svg = svg.replace(/(]*)height=\"[^\"]*\"/, \"$1\");\r\n // Add new params\r\n svg = svg.replace(/(]*)stylewidth=\"[^\"]*\"/, \"$1\");\r\n svg = svg.replace(/(]*)height=\"[^\"]*\"/, \"$1\");\r\n\r\n // Add new params\r\n svg = svg.replace(/(]*>)/, \"$1\");\r\n //svg = svg.replace(/<\\/svg>/, \"\");\r\n }\r\n if ($browser.isInternetExplorer()) {\r\n // IE can't handle exporting for some reason\r\n svg = svg.replace(/]*\\/>/gi, \"\");\r\n }\r\n // Remove base uri-related stuff\r\n var reg = new RegExp(\"url\\\\(\" + $utils.escapeForRgex($utils.getBaseURI()), \"g\");\r\n svg = svg.replace(reg, \"url(#\");\r\n // Remove escaped quotes in url() parameters\r\n svg = svg.replace(/url\\("([^)]*)"\\)/gm, \"url($1)\");\r\n // Put foreignObjects back in\r\n if (fos.length) {\r\n for (var i = 0; i < fos.length; i++) {\r\n svg = svg.replace($strings.PLACEHOLDER, fos[i]);\r\n }\r\n }\r\n svg = this.adapter.apply(\"normalizeSVG\", {\r\n data: svg,\r\n options: options\r\n }).data;\r\n return svg;\r\n };\r\n /**\r\n * Serializes an element and returns its contents.\r\n *\r\n * @ignore Exclude from docs\r\n * @param element An element to serialize\r\n * @return A serialized XML\r\n */\r\n Export.prototype.serializeElement = function (element) {\r\n return new XMLSerializer().serializeToString(element);\r\n };\r\n /**\r\n * Returns a PDF containing chart image.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @param type Type of the export\r\n * @param options Options\r\n * @return Promise\r\n * @async\r\n * @todo Account for header when calculating vertical fit\r\n */\r\n Export.prototype.getPDF = function (type, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n function addFont(font) {\r\n var paths = {};\r\n paths.normal = font.normal.path;\r\n vfs[font.normal.path] = font.normal.bytes;\r\n if (font.bold) {\r\n paths.bold = font.bold.path;\r\n vfs[font.bold.path] = font.bold.bytes;\r\n }\r\n else {\r\n paths.bold = font.normal.path;\r\n }\r\n if (font.italics) {\r\n paths.italics = font.italics.path;\r\n vfs[font.italics.path] = font.italics.bytes;\r\n }\r\n else {\r\n paths.italics = font.normal.path;\r\n }\r\n if (font.bolditalics) {\r\n paths.bolditalics = font.bolditalics.path;\r\n vfs[font.bolditalics.path] = font.bolditalics.bytes;\r\n }\r\n else {\r\n paths.bolditalics = font.normal.path;\r\n }\r\n fonts[font.name] = paths;\r\n }\r\n var image, pdfmake, defaultMargins, doc, title, extraMargin, _a, _b, _c, fonts, vfs;\r\n return __generator(this, function (_d) {\r\n switch (_d.label) {\r\n case 0: return [4 /*yield*/, this.getImage(options.imageFormat || \"png\", options)];\r\n case 1:\r\n image = _d.sent();\r\n return [4 /*yield*/, this.pdfmake];\r\n case 2:\r\n pdfmake = _d.sent();\r\n defaultMargins = [30, 30, 30, 30];\r\n doc = {\r\n pageSize: options.pageSize || \"A4\",\r\n pageOrientation: options.pageOrientation || \"portrait\",\r\n pageMargins: options.pageMargins || defaultMargins,\r\n defaultStyle: {\r\n font: options.font ? options.font.name : undefined\r\n },\r\n //header: [],\r\n content: []\r\n };\r\n title = this.adapter.apply(\"title\", {\r\n title: this.title,\r\n options: options\r\n }).title;\r\n extraMargin = 0;\r\n if (title) {\r\n doc.content.push({\r\n text: title,\r\n fontSize: options.fontSize || 14,\r\n bold: true,\r\n margin: [0, 0, 0, 15]\r\n });\r\n // Add some leftover margin for title\r\n extraMargin += 50;\r\n }\r\n // Add page URL?\r\n if (options.addURL) {\r\n doc.content.push({\r\n text: this.language.translate(\"Saved from\") + \": \" + document.location.href,\r\n fontSize: options.fontSize,\r\n margin: [0, 0, 0, 15]\r\n });\r\n // Add some leftover margin for URL\r\n extraMargin += 50;\r\n }\r\n // Add image\r\n if (type != \"pdfdata\") {\r\n doc.content.push({\r\n image: image,\r\n alignment: options.align || \"left\",\r\n fit: this.getPageSizeFit(doc.pageSize, doc.pageMargins, extraMargin)\r\n });\r\n }\r\n if (!(type == \"pdfdata\" || options.addData)) return [3 /*break*/, 4];\r\n _b = (_a = doc.content).push;\r\n _c = {};\r\n return [4 /*yield*/, this.getPDFData(\"pdf\", options)];\r\n case 3:\r\n _b.apply(_a, [(_c.table = _d.sent(),\r\n _c.fontSize = options.fontSize || 14,\r\n _c)]);\r\n _d.label = 4;\r\n case 4:\r\n // Apply adapters\r\n doc = this.adapter.apply(\"pdfmakeDocument\", {\r\n doc: doc,\r\n options: options\r\n }).doc;\r\n fonts = null;\r\n vfs = null;\r\n if (options.font) {\r\n fonts = {};\r\n vfs = {};\r\n addFont(options.font);\r\n if (options.extraFonts) {\r\n $array.each(options.extraFonts, addFont);\r\n }\r\n }\r\n return [4 /*yield*/, new Promise(function (success, error) {\r\n pdfmake.createPdf(doc, null, fonts, vfs).getDataUrl(function (uri) {\r\n success(uri);\r\n });\r\n })];\r\n case 5: \r\n // Create PDF\r\n return [2 /*return*/, _d.sent()];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Returns chart's data formatted suitable for PDF export (pdfmake).\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @since 4.7.0\r\n * @param type Type of the export\r\n * @param options Options\r\n * @return Promise\r\n * @async\r\n */\r\n Export.prototype.getPDFData = function (type, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var content, dataFields, data, dataFieldsOrder_1, len, i;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n content = {\r\n \"body\": []\r\n };\r\n dataFields = this.adapter.apply(\"formatDataFields\", {\r\n dataFields: this.dataFields,\r\n format: \"pdf\"\r\n }).dataFields;\r\n data = this.data;\r\n // Vertical or horizontal (default) layout\r\n if (options.pivot) {\r\n dataFieldsOrder_1 = this.adapter.apply(\"dataFieldsOrder\", {\r\n dataFieldsOrder: this.dataFieldsOrder,\r\n format: \"pdfdata\"\r\n }).dataFieldsOrder;\r\n $object.eachOrdered(dataFields, function (key, val) {\r\n var dataRow = [];\r\n if (options.addColumnNames) {\r\n dataRow.push(val);\r\n }\r\n for (var len = data.length, i = 0; i < len; i++) {\r\n var dataValue = data[i][key];\r\n dataRow.push(_this.convertToSpecialFormat(key, dataValue, options, true));\r\n }\r\n content.body.push(_this.getPDFDataRow(dataRow, options, undefined, true));\r\n }, function (a, b) {\r\n //console.log(a, b)\r\n var ai = dataFieldsOrder_1.indexOf(a);\r\n var bi = dataFieldsOrder_1.indexOf(b);\r\n if (ai > bi) {\r\n return 1;\r\n }\r\n else if (ai < bi) {\r\n return -1;\r\n }\r\n return 0;\r\n });\r\n }\r\n else {\r\n // Add column names?\r\n if (options.addColumnNames) {\r\n content.body.push(this.getPDFDataRow(dataFields, options, undefined, true));\r\n content.headerRows = 1;\r\n }\r\n for (len = data.length, i = 0; i < len; i++) {\r\n content.body.push(this.getPDFDataRow(data[i], options, dataFields));\r\n }\r\n }\r\n return [2 /*return*/, this.adapter.apply(\"pdfmakeTable\", {\r\n table: content,\r\n options: options\r\n }).table];\r\n });\r\n });\r\n };\r\n /**\r\n * Formats a row of data for use in PDF data table (pdfmake).\r\n *\r\n * @ignore Exclude from docs\r\n * @since 4.7.0\r\n * @param row An object holding data for the row\r\n * @param options Options\r\n * @param dataFields Data fields\r\n * @param asIs Do not try to convert to dates\r\n * @return Formated Data line\r\n */\r\n Export.prototype.getPDFDataRow = function (row, options, dataFields, asIs) {\r\n var _this = this;\r\n if (asIs === void 0) { asIs = false; }\r\n // Init\r\n var items = [];\r\n // Data fields\r\n if (!dataFields) {\r\n dataFields = row;\r\n }\r\n // Data fields order\r\n var dataFieldsOrder = this.adapter.apply(\"dataFieldsOrder\", {\r\n dataFieldsOrder: this.dataFieldsOrder,\r\n format: \"pdfdata\"\r\n }).dataFieldsOrder;\r\n // Process each row item\r\n $object.eachOrdered(dataFields, function (key, name) {\r\n // Get value\r\n var value = _this.convertEmptyValue(key, row[key], options);\r\n // Convert dates\r\n var item = asIs ? value : _this.convertToSpecialFormat(key, value, options);\r\n item = \"\" + item;\r\n // Add to item\r\n items.push(item);\r\n }, function (a, b) {\r\n //console.log(a, b)\r\n var ai = dataFieldsOrder.indexOf(a);\r\n var bi = dataFieldsOrder.indexOf(b);\r\n if (ai > bi) {\r\n return 1;\r\n }\r\n else if (ai < bi) {\r\n return -1;\r\n }\r\n return 0;\r\n });\r\n return items;\r\n };\r\n /**\r\n * Returns fit dimensions for available page sizes.\r\n *\r\n * @ignore Exclude from docs\r\n * @param pageSize Page size\r\n * @return `[width, height]` in pixels\r\n */\r\n Export.prototype.getPageSizeFit = function (pageSize, margins, extraMargin) {\r\n if (extraMargin === void 0) { extraMargin = 0; }\r\n // Check margins\r\n var newMargins = [0, 0, 0, 0];\r\n if (typeof margins == \"number\") {\r\n newMargins = [margins, margins, margins, margins];\r\n }\r\n else if (margins.length == 2) {\r\n newMargins = [margins[0], margins[1], margins[0], margins[1]];\r\n }\r\n else if (margins.length == 4) {\r\n newMargins = margins;\r\n }\r\n // Define available page sizes\r\n var sizes = {\r\n \"4A0\": [4767.87, 6740.79],\r\n \"2A0\": [3370.39, 4767.87],\r\n A0: [2383.94, 3370.39],\r\n A1: [1683.78, 2383.94],\r\n A2: [1190.55, 1683.78],\r\n A3: [841.89, 1190.55],\r\n A4: [595.28, 841.89],\r\n A5: [419.53, 595.28],\r\n A6: [297.64, 419.53],\r\n A7: [209.76, 297.64],\r\n A8: [147.40, 209.76],\r\n A9: [104.88, 147.40],\r\n A10: [73.70, 104.88],\r\n B0: [2834.65, 4008.19],\r\n B1: [2004.09, 2834.65],\r\n B2: [1417.32, 2004.09],\r\n B3: [1000.63, 1417.32],\r\n B4: [708.66, 1000.63],\r\n B5: [498.90, 708.66],\r\n B6: [354.33, 498.90],\r\n B7: [249.45, 354.33],\r\n B8: [175.75, 249.45],\r\n B9: [124.72, 175.75],\r\n B10: [87.87, 124.72],\r\n C0: [2599.37, 3676.54],\r\n C1: [1836.85, 2599.37],\r\n C2: [1298.27, 1836.85],\r\n C3: [918.43, 1298.27],\r\n C4: [649.13, 918.43],\r\n C5: [459.21, 649.13],\r\n C6: [323.15, 459.21],\r\n C7: [229.61, 323.15],\r\n C8: [161.57, 229.61],\r\n C9: [113.39, 161.57],\r\n C10: [79.37, 113.39],\r\n RA0: [2437.80, 3458.27],\r\n RA1: [1729.13, 2437.80],\r\n RA2: [1218.90, 1729.13],\r\n RA3: [864.57, 1218.90],\r\n RA4: [609.45, 864.57],\r\n SRA0: [2551.18, 3628.35],\r\n SRA1: [1814.17, 2551.18],\r\n SRA2: [1275.59, 1814.17],\r\n SRA3: [907.09, 1275.59],\r\n SRA4: [637.80, 907.09],\r\n EXECUTIVE: [521.86, 756.00],\r\n FOLIO: [612.00, 936.00],\r\n LEGAL: [612.00, 1008.00],\r\n LETTER: [612.00, 792.00],\r\n TABLOID: [792.00, 1224.00]\r\n };\r\n // Calculate size\r\n var fitSize = sizes[pageSize];\r\n fitSize[0] -= newMargins[0] + newMargins[2];\r\n fitSize[1] -= newMargins[1] + newMargins[3] + extraMargin;\r\n return fitSize;\r\n };\r\n /**\r\n * Returns an Excel file of chart's data.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @param type Type of the export\r\n * @param options Options\r\n * @return Promise\r\n * @async\r\n * @todo Handle dates\r\n * @todo Support for multi-sheet\r\n */\r\n Export.prototype.getExcel = function (type, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var XLSX, wbOptions, sheetName, wb, data, dataFields, dataFieldsOrder_2, len, i, uri;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!$type.hasValue(options)) {\r\n options = this.getFormatOptions(\"xlsx\");\r\n }\r\n return [4 /*yield*/, this.xlsx];\r\n case 1:\r\n XLSX = _a.sent();\r\n wbOptions = this.adapter.apply(\"xlsxWorkbookOptions\", {\r\n xlsx: XLSX,\r\n options: {\r\n bookType: \"xlsx\",\r\n bookSST: false,\r\n type: \"base64\",\r\n }\r\n }).options;\r\n sheetName = this.normalizeExcelSheetName(this.adapter.apply(\"xlsxSheetName\", {\r\n xlsx: XLSX,\r\n name: this.title || this.language.translate(\"Data\")\r\n }).name);\r\n wb = {\r\n SheetNames: [sheetName],\r\n Sheets: {}\r\n };\r\n data = [];\r\n dataFields = this.adapter.apply(\"formatDataFields\", {\r\n dataFields: this.dataFields,\r\n format: \"xslx\"\r\n }).dataFields;\r\n // Vertical or horizontal (default) layout\r\n if (options.pivot) {\r\n dataFieldsOrder_2 = this.adapter.apply(\"dataFieldsOrder\", {\r\n dataFieldsOrder: this.dataFieldsOrder,\r\n format: \"xlsx\"\r\n }).dataFieldsOrder;\r\n $object.eachOrdered(dataFields, function (key, val) {\r\n var dataRow = [];\r\n if (options.addColumnNames) {\r\n dataRow.push(val);\r\n }\r\n for (var len = _this.data.length, i = 0; i < len; i++) {\r\n var dataValue = _this.data[i][key];\r\n dataRow.push(_this.convertToSpecialFormat(key, dataValue, options, true));\r\n }\r\n data.push(_this.getExcelRow(dataRow, options, undefined, true));\r\n }, function (a, b) {\r\n //console.log(a, b)\r\n var ai = dataFieldsOrder_2.indexOf(a);\r\n var bi = dataFieldsOrder_2.indexOf(b);\r\n if (ai > bi) {\r\n return 1;\r\n }\r\n else if (ai < bi) {\r\n return -1;\r\n }\r\n return 0;\r\n });\r\n }\r\n else {\r\n // Add column names?\r\n if (options.addColumnNames) {\r\n data.push(this.getExcelRow(dataFields, options, undefined, true));\r\n }\r\n // Add lines\r\n for (len = this.data.length, i = 0; i < len; i++) {\r\n data.push(this.getExcelRow(this.data[i], options, dataFields));\r\n }\r\n }\r\n // Create sheet and add data\r\n wb.Sheets[sheetName] = XLSX.utils.aoa_to_sheet(data);\r\n // Apply adapters\r\n wb = this.adapter.apply(\"xlsxWorkbook\", {\r\n xlsx: XLSX,\r\n workbook: wb,\r\n options: options\r\n }).workbook;\r\n uri = this.adapter.apply(\"getExcel\", {\r\n data: \"data:\" + this.getContentType(type) + \";base64,\" + XLSX.write(wb, wbOptions),\r\n options: options\r\n }).data;\r\n return [2 /*return*/, uri];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * This is needed to work around Excel limitations.\r\n *\r\n * @param name Source name\r\n * @return Normalized name\r\n */\r\n Export.prototype.normalizeExcelSheetName = function (name) {\r\n name = name.replace(/([:\\\\\\/?*\\[\\]]+)/g, \" \");\r\n return $utils.truncateWithEllipsis(name, 31, \"...\", true);\r\n };\r\n /**\r\n * Rertuns an array of values to be used as Excel row.\r\n *\r\n * @ignore Exclude from docs\r\n * @param row Row data\r\n * @param options Options\r\n * @param dataFields Data fields\r\n * @param asIs Do not try to convert to dates\r\n * @return Array of values\r\n */\r\n Export.prototype.getExcelRow = function (row, options, dataFields, asIs) {\r\n var _this = this;\r\n if (asIs === void 0) { asIs = false; }\r\n // Init\r\n var items = [];\r\n // Data fields\r\n if (!dataFields) {\r\n dataFields = row;\r\n }\r\n // Data fields order\r\n var dataFieldsOrder = this.adapter.apply(\"dataFieldsOrder\", {\r\n dataFieldsOrder: this.dataFieldsOrder,\r\n format: \"xlsx\"\r\n }).dataFieldsOrder;\r\n // Process each row item\r\n $object.eachOrdered(dataFields, function (key, name) {\r\n // Get value\r\n var value = _this.convertEmptyValue(key, row[key], options);\r\n // Convert dates\r\n var item = asIs ? value : _this.convertToSpecialFormat(key, value, options, true);\r\n items.push(item);\r\n }, function (a, b) {\r\n //console.log(a, b)\r\n var ai = dataFieldsOrder.indexOf(a);\r\n var bi = dataFieldsOrder.indexOf(b);\r\n if (ai > bi) {\r\n return 1;\r\n }\r\n else if (ai < bi) {\r\n return -1;\r\n }\r\n return 0;\r\n });\r\n return items;\r\n };\r\n /**\r\n * Returns chart's data formatted as CSV.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @param type Type of the export\r\n * @param options Options\r\n * @param encodeURI If true, will return result will be data URI\r\n * @return Promise\r\n * @async\r\n */\r\n Export.prototype.getCSV = function (type, options, encodeURI) {\r\n if (encodeURI === void 0) { encodeURI = true; }\r\n return __awaiter(this, void 0, void 0, function () {\r\n var csv, dataFields, br, data, dataFieldsOrder_3, len, i, row, charset, uri;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n if (!$type.hasValue(options)) {\r\n options = this.getFormatOptions(\"csv\");\r\n }\r\n csv = \"\";\r\n dataFields = this.adapter.apply(\"formatDataFields\", {\r\n dataFields: this.dataFields,\r\n format: \"csv\"\r\n }).dataFields;\r\n br = \"\";\r\n data = this.data;\r\n // Vertical or horizontal (default) layout\r\n if (options.pivot) {\r\n dataFieldsOrder_3 = this.adapter.apply(\"dataFieldsOrder\", {\r\n dataFieldsOrder: this.dataFieldsOrder,\r\n format: \"csv\"\r\n }).dataFieldsOrder;\r\n $object.eachOrdered(dataFields, function (key, val) {\r\n var dataRow = [];\r\n if (options.addColumnNames) {\r\n dataRow.push(val);\r\n }\r\n for (var len = data.length, i = 0; i < len; i++) {\r\n var dataValue = data[i][key];\r\n dataRow.push(_this.convertToSpecialFormat(key, dataValue, options, true));\r\n }\r\n csv += br + _this.getCSVRow(dataRow, options, undefined, true);\r\n br = \"\\n\";\r\n }, function (a, b) {\r\n var ai = dataFieldsOrder_3.indexOf(a);\r\n var bi = dataFieldsOrder_3.indexOf(b);\r\n if (ai > bi) {\r\n return -1;\r\n }\r\n else if (ai < bi) {\r\n return 1;\r\n }\r\n return 0;\r\n });\r\n }\r\n else {\r\n for (len = data.length, i = 0; i < len; i++) {\r\n row = this.getCSVRow(data[i], options, dataFields);\r\n if (options.reverse) {\r\n csv = row + br + csv;\r\n }\r\n else {\r\n csv += br + row;\r\n }\r\n br = \"\\n\";\r\n }\r\n // Add column names?\r\n if (options.addColumnNames) {\r\n csv = this.getCSVRow(dataFields, options, undefined, true) + br + csv;\r\n }\r\n }\r\n charset = this.adapter.apply(\"charset\", {\r\n charset: \"charset=utf-8\",\r\n type: type,\r\n options: options\r\n }).charset;\r\n uri = this.adapter.apply(\"getCSV\", {\r\n data: encodeURI ? \"data:\" + this.getContentType(type) + \";\" + charset + \",\" + encodeURIComponent(csv) : csv,\r\n options: options\r\n }).data;\r\n return [2 /*return*/, uri];\r\n });\r\n });\r\n };\r\n /**\r\n * Formats a row of CSV data.\r\n *\r\n * @ignore Exclude from docs\r\n * @param row An object holding data for the row\r\n * @param options Options\r\n * @param dataFields Data fields\r\n * @param asIs Do not try to convert to dates\r\n * @return Formated CSV line\r\n */\r\n Export.prototype.getCSVRow = function (row, options, dataFields, asIs) {\r\n var _this = this;\r\n if (asIs === void 0) { asIs = false; }\r\n // Init\r\n var separator = options.separator || \",\";\r\n var items = [];\r\n // Data fields\r\n if (!dataFields) {\r\n dataFields = row;\r\n }\r\n // Data fields order\r\n var dataFieldsOrder = this.adapter.apply(\"dataFieldsOrder\", {\r\n dataFieldsOrder: this.dataFieldsOrder,\r\n format: \"csv\"\r\n }).dataFieldsOrder;\r\n // Process each row item\r\n $object.eachOrdered(dataFields, function (key, name) {\r\n // Get value\r\n var value = _this.convertEmptyValue(key, row[key], options);\r\n // Check if we need to skip\r\n // This is no longer required because we are iterating via dataFields anyway\r\n /*if ($type.hasValue(this.dataFields) && !$type.hasValue(this.dataFields[key])) {\r\n return;\r\n }*/\r\n // Convert dates\r\n var item = asIs ? value : _this.convertToSpecialFormat(key, value, options);\r\n // Cast and escape doublequotes\r\n item = \"\" + item;\r\n item = item.replace(/\"/g, '\"\"');\r\n // Enclose into double quotes\r\n if (options.forceQuotes || (item.search(new RegExp(\"\\\"|\\n|\" + separator, \"g\")) >= 0)) {\r\n item = \"\\\"\" + item + \"\\\"\";\r\n }\r\n // Add to item\r\n items.push(item);\r\n }, function (a, b) {\r\n //console.log(a, b)\r\n var ai = dataFieldsOrder.indexOf(a);\r\n var bi = dataFieldsOrder.indexOf(b);\r\n if (ai > bi) {\r\n return 1;\r\n }\r\n else if (ai < bi) {\r\n return -1;\r\n }\r\n return 0;\r\n });\r\n return items.join(separator);\r\n };\r\n /**\r\n * Returns chart's data formatted as HTML table.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @since 4.7.0\r\n * @param type Type of the export\r\n * @param options Options\r\n * @param encodeURI If true, will return result will be data URI\r\n * @return Promise\r\n * @async\r\n */\r\n Export.prototype.getHTML = function (type, options, encodeURI) {\r\n if (encodeURI === void 0) { encodeURI = true; }\r\n return __awaiter(this, void 0, void 0, function () {\r\n var html, dataFields, data, dataFieldsOrder_4, len, i, charset, uri;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n if (!$type.hasValue(options)) {\r\n options = this.getFormatOptions(\"html\");\r\n }\r\n html = \"\";\r\n if (options.tableClass) {\r\n html = \"
\";\r\n }\r\n dataFields = this.adapter.apply(\"formatDataFields\", {\r\n dataFields: this.dataFields,\r\n format: \"html\"\r\n }).dataFields;\r\n data = this.data;\r\n // Vertical or horizontal (default) layout\r\n if (options.pivot) {\r\n dataFieldsOrder_4 = this.adapter.apply(\"dataFieldsOrder\", {\r\n dataFieldsOrder: this.dataFieldsOrder,\r\n format: \"html\"\r\n }).dataFieldsOrder;\r\n html += \"\\n\";\r\n $object.eachOrdered(dataFields, function (key, val) {\r\n var dataRow = [];\r\n if (options.addColumnNames) {\r\n dataRow.push(val);\r\n }\r\n for (var len = data.length, i = 0; i < len; i++) {\r\n var dataValue = data[i][key];\r\n dataRow.push(_this.convertToSpecialFormat(key, dataValue, options, true));\r\n }\r\n html += \"\\n\" + _this.getHTMLRow(dataRow, options, undefined, true);\r\n }, function (a, b) {\r\n var ai = dataFieldsOrder_4.indexOf(a);\r\n var bi = dataFieldsOrder_4.indexOf(b);\r\n if (ai > bi) {\r\n return -1;\r\n }\r\n else if (ai < bi) {\r\n return 1;\r\n }\r\n return 0;\r\n });\r\n html += \"\\n\";\r\n }\r\n else {\r\n // Add column names?\r\n if (options.addColumnNames) {\r\n html += \"\\n\\n\" + this.getHTMLRow(dataFields, options, undefined, true, true) + \"\\n\";\r\n }\r\n html += \"\\n\";\r\n for (len = data.length, i = 0; i < len; i++) {\r\n html += \"\\n\" + this.getHTMLRow(data[i], options, dataFields);\r\n }\r\n html += \"\\n\";\r\n }\r\n html += \"\\n
\";\r\n charset = this.adapter.apply(\"charset\", {\r\n charset: \"charset=utf-8\",\r\n type: type,\r\n options: options\r\n }).charset;\r\n uri = this.adapter.apply(\"getHTML\", {\r\n data: encodeURI ? \"data:\" + this.getContentType(type) + \";\" + charset + \",\" + encodeURIComponent(html) : html,\r\n options: options\r\n }).data;\r\n return [2 /*return*/, uri];\r\n });\r\n });\r\n };\r\n /**\r\n * Formats a row of HTML data.\r\n *\r\n * @since 4.7.0\r\n * @ignore Exclude from docs\r\n * @param row An object holding data for the row\r\n * @param options Options\r\n * @param dataFields Data fields\r\n * @param asIs Do not try to convert to dates\r\n * @return Formated HTML row\r\n */\r\n Export.prototype.getHTMLRow = function (row, options, dataFields, asIs, headerRow) {\r\n var _this = this;\r\n if (asIs === void 0) { asIs = false; }\r\n if (headerRow === void 0) { headerRow = false; }\r\n // Init output\r\n var html = \"\\t\";\r\n if (options.rowClass) {\r\n html = \"\\t\";\r\n }\r\n // Data fields\r\n if (!dataFields) {\r\n dataFields = row;\r\n }\r\n // Data fields order\r\n var dataFieldsOrder = this.adapter.apply(\"dataFieldsOrder\", {\r\n dataFieldsOrder: this.dataFieldsOrder,\r\n format: \"html\"\r\n }).dataFieldsOrder;\r\n // th or dh?\r\n var tag = headerRow ? \"th\" : \"td\";\r\n // Process each row item\r\n var first = true;\r\n $object.eachOrdered(dataFields, function (key, name) {\r\n // Get value\r\n var value = _this.convertEmptyValue(key, row[key], options);\r\n // Convert dates\r\n var item = asIs ? value : _this.convertToSpecialFormat(key, value, options);\r\n // Escape HTML entities\r\n item = \"\" + item;\r\n item = item.replace(/[\\u00A0-\\u9999<>\\&]/gim, function (i) {\r\n return \"&#\" + i.charCodeAt(0) + \";\";\r\n });\r\n // Which tag to use\r\n var useTag = tag;\r\n if (options.pivot && first) {\r\n useTag = \"th\";\r\n }\r\n // Add cell\r\n if (options.cellClass) {\r\n html += \"\\n\\t\\t<\" + useTag + \" class=\\\"\" + options.cellClass + \"\\\">\" + item + \"\";\r\n }\r\n else {\r\n html += \"\\n\\t\\t<\" + useTag + \">\" + item + \"\";\r\n }\r\n first = false;\r\n }, function (a, b) {\r\n var ai = dataFieldsOrder.indexOf(a);\r\n var bi = dataFieldsOrder.indexOf(b);\r\n if (ai > bi) {\r\n return 1;\r\n }\r\n else if (ai < bi) {\r\n return -1;\r\n }\r\n return 0;\r\n });\r\n html += \"\\n\\t\";\r\n return html;\r\n };\r\n /**\r\n * Returns chart's data in JSON format.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @param type Type of the export\r\n * @param options Options\r\n * @param encodeURI If true, will return result will be data URI\r\n * @return Promise\r\n * @async\r\n */\r\n Export.prototype.getJSON = function (type, options, encodeURI) {\r\n if (encodeURI === void 0) { encodeURI = true; }\r\n return __awaiter(this, void 0, void 0, function () {\r\n var data, dataFields, sourceData, _loop_1, len, i, json, charset, uri;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n if (!$type.hasValue(options)) {\r\n options = this.getFormatOptions(\"json\");\r\n }\r\n dataFields = this.adapter.apply(\"formatDataFields\", {\r\n dataFields: this.dataFields,\r\n format: \"json\"\r\n }).dataFields;\r\n if (!this._dynamicDataFields) {\r\n data = [];\r\n sourceData = this.data;\r\n _loop_1 = function (len, i) {\r\n var value = sourceData[i];\r\n if (typeof value == \"object\") {\r\n var newValue_1 = {};\r\n $object.each(value, function (field, item) {\r\n if ($type.hasValue(dataFields[field])) {\r\n newValue_1[dataFields[field]] = _this.convertToSpecialFormat(field, item, options);\r\n }\r\n });\r\n data.push(newValue_1);\r\n }\r\n };\r\n for (len = sourceData.length, i = 0; i < len; i++) {\r\n _loop_1(len, i);\r\n }\r\n }\r\n else {\r\n data = this.data;\r\n }\r\n json = JSON.stringify(data, function (key, value) {\r\n if (typeof value == \"object\") {\r\n $object.each(value, function (field, item) {\r\n value[field] = _this.convertToSpecialFormat(field, item, options);\r\n });\r\n }\r\n return value;\r\n }, options.indent);\r\n charset = this.adapter.apply(\"charset\", {\r\n charset: \"charset=utf-8\",\r\n type: type,\r\n options: options\r\n }).charset;\r\n uri = this.adapter.apply(\"getJSON\", {\r\n data: encodeURI ? \"data:\" + this.getContentType(type) + \";\" + charset + \",\" + encodeURIComponent(json) : json,\r\n options: options\r\n }).data;\r\n return [2 /*return*/, uri];\r\n });\r\n });\r\n };\r\n /**\r\n * Converts the value to proper date format.\r\n *\r\n * @ignore Exclude from docs\r\n * @param field Field name\r\n * @param value Value\r\n * @param options Options\r\n * @param keepOriginal Will ignore formatting and will keep value as it is in data\r\n * @return Formatted date value or unmodified value\r\n */\r\n Export.prototype.convertToSpecialFormat = function (field, value, options, keepOriginal) {\r\n // Is this a timestamp or duration?\r\n if (typeof value == \"number\") {\r\n if (this.isDateField(field)) {\r\n value = new Date(value);\r\n }\r\n else if (this.isDurationField(field)) {\r\n return this.durationFormatter.format(value, this.durationFormat);\r\n }\r\n else if (this.isNumberField(field) && this.numberFormat) {\r\n return this.numberFormatter.format(value, this.numberFormat);\r\n }\r\n }\r\n if (value instanceof Date) {\r\n if (options.useTimestamps) {\r\n value = value.getTime();\r\n }\r\n else if (options.useLocale) {\r\n if (!keepOriginal) {\r\n value = value.toLocaleString();\r\n }\r\n }\r\n else {\r\n value = this.dateFormatter.format(value, this.dateFormat);\r\n }\r\n }\r\n else if ($type.isString(value) && this.isDateField(field) && this.dateFormat) {\r\n value = this.dateFormatter.format(this.dateFormatter.parse(value), this.dateFormat);\r\n }\r\n return value;\r\n };\r\n /**\r\n * Converts empty value based on `emptyAs` option.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Export.prototype.convertEmptyValue = function (field, value, options) {\r\n return $type.hasValue(value) ? value : options.emptyAs;\r\n };\r\n /**\r\n * Triggers download of the file.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @param uri Data URI with file content\r\n * @param fileName File name\r\n * @return Promise\r\n * @async\r\n */\r\n Export.prototype.download = function (uri, fileName, addBOM) {\r\n if (addBOM === void 0) { addBOM = false; }\r\n return __awaiter(this, void 0, void 0, function () {\r\n var parts, contentType, decoded, blob_1, chars, i, charCode, blob, link_1, parts, contentType, decoded, blob_2, url_2, chars, i, charCode, blob, url_3, link, parts, contentType, iframe, idoc;\r\n return __generator(this, function (_a) {\r\n if (this.msBlobDownloadSupport()) {\r\n parts = uri.split(\";\");\r\n contentType = parts.shift().replace(/data:/, \"\");\r\n uri = decodeURIComponent(parts.join(\";\").replace(/^[^,]*,/, \"\"));\r\n // Check if we need to Base64-decode\r\n if ([\"image/svg+xml\", \"application/json\", \"text/csv\"].indexOf(contentType) == -1) {\r\n try {\r\n decoded = atob(uri);\r\n uri = decoded;\r\n }\r\n catch (e) {\r\n // Error occurred, meaning string was not Base64-encoded. Do nothing.\r\n return [2 /*return*/, false];\r\n }\r\n }\r\n else {\r\n blob_1 = new Blob([uri], { type: contentType });\r\n window.navigator.msSaveBlob(blob_1, fileName);\r\n return [2 /*return*/, true];\r\n }\r\n chars = new Array(uri.length);\r\n for (i = 0; i < uri.length; ++i) {\r\n charCode = uri.charCodeAt(i);\r\n chars[i] = charCode;\r\n }\r\n blob = new Blob([new Uint8Array(chars)], { type: contentType });\r\n window.navigator.msSaveBlob(blob, fileName);\r\n }\r\n else if (this.blobDownloadSupport()) {\r\n link_1 = document.createElement(\"a\");\r\n link_1.download = fileName;\r\n document.body.appendChild(link_1);\r\n parts = uri.split(\";\");\r\n contentType = parts.shift().replace(/data:/, \"\");\r\n uri = decodeURIComponent(parts.join(\";\").replace(/^[^,]*,/, \"\"));\r\n if ([\"image/svg+xml\", \"application/json\", \"text/csv\", \"text/html\"].indexOf(contentType) == -1) {\r\n try {\r\n decoded = atob(uri);\r\n uri = decoded;\r\n }\r\n catch (e) {\r\n // Error occurred, meaning string was not Base64-encoded. Do nothing.\r\n return [2 /*return*/, false];\r\n }\r\n }\r\n else {\r\n if (addBOM) {\r\n uri = \"\\ufeff\" + uri;\r\n }\r\n blob_2 = new Blob([uri], { type: contentType });\r\n url_2 = window.URL.createObjectURL(blob_2);\r\n link_1.href = url_2;\r\n link_1.download = fileName;\r\n link_1.click();\r\n setTimeout(function () {\r\n document.body.removeChild(link_1);\r\n window.URL.revokeObjectURL(url_2);\r\n }, 100);\r\n return [2 /*return*/, true];\r\n }\r\n chars = new Array(uri.length);\r\n for (i = 0; i < uri.length; ++i) {\r\n charCode = uri.charCodeAt(i);\r\n chars[i] = charCode;\r\n }\r\n if (addBOM) {\r\n chars = [0xEF, 0xBB, 0xBF].concat(chars);\r\n }\r\n blob = new Blob([new Uint8Array(chars)], { type: contentType });\r\n url_3 = window.URL.createObjectURL(blob);\r\n link_1.href = url_3;\r\n link_1.download = fileName;\r\n document.body.appendChild(link_1);\r\n link_1.click();\r\n document.body.removeChild(link_1);\r\n setTimeout(function () {\r\n window.URL.revokeObjectURL(url_3);\r\n }, 100);\r\n }\r\n else if (this.linkDownloadSupport()) {\r\n link = document.createElement(\"a\");\r\n link.download = fileName;\r\n link.href = uri;\r\n document.body.appendChild(link);\r\n link.click();\r\n document.body.removeChild(link);\r\n }\r\n else if (this.legacyIE()) {\r\n parts = uri.match(/^data:(.*);[ ]*([^,]*),(.*)$/);\r\n if (parts.length === 4) {\r\n // Base64-encoded or text-based stuff?\r\n if (parts[2] == \"base64\") {\r\n // Base64-encoded - probably an image\r\n if (parts[1].match(/^image\\//)) {\r\n // Yep, an image. Let's create a temporary image placeholder,\r\n // so that user can use do Save As.\r\n this.showModal(\"\" +\r\n \"

\" + this.language.translate(\"To save the image, right-click thumbnail on the left and choose \\\"Save picture as...\\\"\") +\r\n \"

\" +\r\n \"

\" + this.language.translate(\"(Press ESC to close this message)\") + \"

\", this.language.translate(\"Image Export Complete\"));\r\n }\r\n }\r\n else {\r\n contentType = void 0;\r\n if (fileName.match(/\\.svg$/)) {\r\n contentType = \"image/svg+xml\";\r\n }\r\n else {\r\n contentType = \"text/plain\";\r\n fileName += \".txt\";\r\n }\r\n iframe = document.createElement(\"iframe\");\r\n iframe.width = \"1px\";\r\n iframe.height = \"1px\";\r\n iframe.style.display = \"none\";\r\n document.body.appendChild(iframe);\r\n idoc = iframe.contentDocument;\r\n idoc.open(contentType, \"replace\");\r\n // TODO test this with various encodings (e.g. UTF)\r\n //idoc.charset = parts[2].replace(/charset=/, \"\");\r\n idoc.write(decodeURIComponent(parts[3]));\r\n idoc.close();\r\n idoc.execCommand(\"SaveAs\", true, fileName);\r\n // Destroy the iframe\r\n document.body.removeChild(iframe);\r\n }\r\n }\r\n }\r\n else {\r\n /**\r\n * Something else - perhaps a mobile.\r\n * Let's just display it in the same page.\r\n * (hey we don't like it either)\r\n */\r\n window.location.href = uri;\r\n }\r\n return [2 /*return*/, true];\r\n });\r\n });\r\n };\r\n /**\r\n * Returns `true` if browser has any supported methods to trigger download\r\n * of a binary file.\r\n *\r\n * @return Supports downloads?\r\n */\r\n Export.prototype.downloadSupport = function () {\r\n //return !this.legacyIE();\r\n return this.linkDownloadSupport() || this.msBlobDownloadSupport();\r\n };\r\n /**\r\n * Checks if the browser supports \"download\" attribute on links.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Browser supports triggering downloads?\r\n */\r\n Export.prototype.linkDownloadSupport = function () {\r\n // Do we have this cached?\r\n var cache = registry.getCache(\"linkDownloadSupport\");\r\n if (cache === false || cache === true) {\r\n return cache;\r\n }\r\n var a = document.createElement(\"a\");\r\n var res = typeof a.download !== \"undefined\";\r\n registry.setCache(\"linkDownloadSupport\", res);\r\n return res;\r\n };\r\n /**\r\n * Checks if the browser supports download via `msBlob`.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Browser supports triggering downloads?\r\n */\r\n Export.prototype.blobDownloadSupport = function () {\r\n return $type.hasValue(window.Blob);\r\n };\r\n /**\r\n * Checks if the browser supports download via `msBlob`.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Browser supports triggering downloads?\r\n */\r\n Export.prototype.msBlobDownloadSupport = function () {\r\n return $type.hasValue(window.navigator.msSaveOrOpenBlob);\r\n };\r\n /**\r\n * Checks if this is a legacy version of IE.\r\n *\r\n * @ignore Exclude from docs\r\n * @return IE9 or less?\r\n */\r\n Export.prototype.legacyIE = function () {\r\n // Create a temporary
with conditional tags in it an an tag.\r\n // Count s. If there are some, we have IE9 or late on our hands.\r\n var div = document.createElement(\"div\");\r\n div.innerHTML = \"\";\r\n return div.getElementsByTagName(\"i\").length == 1;\r\n };\r\n /**\r\n * Initiates print of the chart.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @param data Data URI for the image\r\n * @param options Options\r\n * @param title Optional title to use (uses window's title by default)\r\n * @return Promise\r\n * @async\r\n */\r\n Export.prototype.print = function (data, options, title) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n if (options.printMethod == \"css\") {\r\n return [2 /*return*/, this.printViaCSS(data, options, title)];\r\n }\r\n else {\r\n return [2 /*return*/, this.printViaIframe(data, options, title)];\r\n }\r\n return [2 /*return*/];\r\n });\r\n });\r\n };\r\n Export.prototype.printViaCSS = function (data, options, title) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var scroll, rule, originalTitle, img, isIOS;\r\n return __generator(this, function (_a) {\r\n scroll = document.documentElement.scrollTop || document.body.scrollTop;\r\n rule = new StyleRule($dom.getShadowRoot(this.container), \"body > *\", {\r\n \"display\": \"none\",\r\n \"position\": \"fixed\",\r\n \"visibility\": \"hidden\",\r\n \"opacity\": \"0\",\r\n \"clipPath\": \"polygon(0px 0px,0px 0px,0px 0px,0px 0px);\"\r\n });\r\n if (title && document && document.title) {\r\n originalTitle = document.title;\r\n document.title = title;\r\n }\r\n img = new Image();\r\n img.src = data;\r\n img.style.maxWidth = \"100%\";\r\n img.style.display = \"block\";\r\n img.style.position = \"relative\";\r\n img.style.visibility = \"visible\";\r\n img.style.opacity = \"1\";\r\n img.style.clipPath = \"none\";\r\n document.body.appendChild(img);\r\n // Print\r\n this.setTimeout(function () {\r\n window.print();\r\n }, 50);\r\n isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\r\n if (isIOS && (options.delay < 1000)) {\r\n options.delay = 1000;\r\n }\r\n else if (options.delay < 100) {\r\n options.delay = 100;\r\n }\r\n // Delay function that resets back the document the way ot was before\r\n this.setTimeout(function () {\r\n // Remove image\r\n document.body.removeChild(img);\r\n // Reset back all elements\r\n /*for (let len = items.length, i = 0; i < len; i++) {\r\n let item = items[i];\r\n if ($dom.isElement(item)) {\r\n item.style.display = states[i];\r\n }\r\n }*/\r\n rule.dispose();\r\n // Restore title\r\n if (originalTitle) {\r\n document.title = document.title;\r\n }\r\n // Scroll back the document the way it was before\r\n document.documentElement.scrollTop = document.body.scrollTop = scroll;\r\n }, options.delay || 500);\r\n return [2 /*return*/, true];\r\n });\r\n });\r\n };\r\n Export.prototype.printViaIframe = function (data, options, title) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var iframe, img, isIOS;\r\n return __generator(this, function (_a) {\r\n iframe = document.createElement(\"iframe\");\r\n iframe.style.visibility = \"hidden\";\r\n document.body.appendChild(iframe);\r\n // This is needed for FireFox\r\n iframe.contentWindow.document.open();\r\n iframe.contentWindow.document.close();\r\n img = new Image();\r\n img.src = data;\r\n img.style.maxWidth = \"100%\";\r\n img.style.height = \"auto\";\r\n if (title) {\r\n iframe.contentWindow.document.title = title;\r\n }\r\n iframe.contentWindow.document.body.appendChild(img);\r\n iframe.load = function () {\r\n iframe.contentWindow.document.body.appendChild(img);\r\n };\r\n // Print\r\n this.setTimeout(function () {\r\n try {\r\n if (!iframe.contentWindow.document.execCommand(\"print\", false, null)) {\r\n iframe.contentWindow.print();\r\n }\r\n }\r\n catch (e) {\r\n iframe.contentWindow.print();\r\n }\r\n }, options.delay || 50);\r\n isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\r\n if (isIOS && (options.delay < 1000)) {\r\n options.delay = 1000;\r\n }\r\n else if (options.delay < 100) {\r\n options.delay = 100;\r\n }\r\n // Delay function that resets back the document the way ot was before\r\n this.setTimeout(function () {\r\n // Remove image\r\n document.body.removeChild(iframe);\r\n }, options.delay + 50 || 100);\r\n return [2 /*return*/, true];\r\n });\r\n });\r\n };\r\n /**\r\n * Finds a background color for the element. If element is transparent it goes\r\n * up the DOM hierarchy to find a parent element that does.\r\n *\r\n * @ignore Exclude from docs\r\n * @param element Element\r\n * @return Color code\r\n */\r\n Export.prototype.findBackgroundColor = function (element) {\r\n // Check if element has styles set\r\n var opacity = 1, currentColor = getComputedStyle(element, \"background-color\");\r\n // Check opacity\r\n if (currentColor.match(/[^,]*,[^,]*,[^,]*,[ ]?0/) || currentColor == \"transparent\") {\r\n opacity = 0;\r\n }\r\n if (opacity == 0) {\r\n var parent_2 = element.parentElement; // || element.parentNode;\r\n // Completely transparent. Look for a parent\r\n if (parent_2) {\r\n return this.findBackgroundColor(parent_2);\r\n }\r\n else {\r\n return color(\"#fff\");\r\n }\r\n }\r\n else {\r\n return color(currentColor, opacity);\r\n }\r\n };\r\n Object.defineProperty(Export.prototype, \"container\", {\r\n /**\r\n * @return Reference\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"container\", {\r\n container: this._container\r\n }).container;\r\n },\r\n /**\r\n * A reference to a container to be used to place [[ExportMenu]] in.\r\n *\r\n * @param value Reference\r\n */\r\n set: function (value) {\r\n this._container = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"sprite\", {\r\n /**\r\n * @return Sprite\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"sprite\", {\r\n sprite: this._sprite\r\n }).sprite;\r\n },\r\n /**\r\n * A reference to [[Sprite]] to export. Can be any Sprite, including some\r\n * internal elements.\r\n *\r\n * @param value Sprite\r\n */\r\n set: function (value) {\r\n this._sprite = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"extraSprites\", {\r\n /**\r\n * @return Sprite\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"extraSprites\", {\r\n extraSprites: this._extraSprites\r\n }).extraSprites;\r\n },\r\n /**\r\n * An array of extra [[Sprite]] elements to include in export.\r\n *\r\n * It can be used to export any external elements, or even other charts.\r\n *\r\n * E.g.:\r\n *\r\n * ```TypeScript\r\n * chart.exporting.extraSprites.push(chart2);\r\n * ```\r\n * ```JavaScript\r\n * chart.exporting.extraSprites.push(chart2);\r\n * ```\r\n *\r\n * IMPORTANT: This setting is ignored when exporting to SVG format.\r\n *\r\n * @since 4.2.0\r\n * @param value Sprite\r\n */\r\n set: function (value) {\r\n this._extraSprites = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"validateSprites\", {\r\n /**\r\n * @return Sprite\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"validateSprites\", {\r\n validateSprites: this._validateSprites\r\n }).validateSprites;\r\n },\r\n /**\r\n * An array of [[Sprite]] elements that need to be valid before export\r\n * commences.\r\n *\r\n * If any of those elements is not completely ready when export is triggered,\r\n * the export will wait until they are (their `validated` event triggers)\r\n * before going through with the export opertaion.\r\n *\r\n * This is useful if you need to modify chart appearance for the export.\r\n *\r\n * E.g.:\r\n *\r\n * ```TypeScript\r\n * // Add watermark\r\n * let watermark = chart.createChild(am4core.Label);\r\n * watermark.text = \"Copyright (C) 2019\";\r\n * watermark.disabled = true;\r\n *\r\n * // Add watermark to validated sprites\r\n * chart.exporting.validateSprites.push(watermark);\r\n *\r\n * // Enable watermark on export\r\n * chart.exporting.events.on(\"exportstarted\", function(ev) {\r\n * watermark.disabled = false;\r\n * });\r\n *\r\n * // Disable watermark when export finishes\r\n * chart.exporting.events.on(\"exportfinished\", function(ev) {\r\n * watermark.disabled = true;\r\n * });\r\n * ```\r\n * ```JavaScript\r\n * // Add watermark\r\n * var watermark = chart.createChild(am4core.Label);\r\n * watermark.text = \"Copyright (C) 2019\";\r\n * watermark.disabled = true;\r\n *\r\n * // Add watermark to validated sprites\r\n * chart.exporting.validateSprites.push(watermark);\r\n *\r\n * // Enable watermark on export\r\n * chart.exporting.events.on(\"exportstarted\", function(ev) {\r\n * watermark.disabled = false;\r\n * });\r\n *\r\n * // Disable watermark when export finishes\r\n * chart.exporting.events.on(\"exportfinished\", function(ev) {\r\n * watermark.disabled = true;\r\n * });\r\n * ```\r\n *\r\n * @since 4.6.8\r\n * @param value Sprite\r\n */\r\n set: function (value) {\r\n this._validateSprites = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"data\", {\r\n /**\r\n * @return Data\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"data\", {\r\n data: this._data\r\n }).data;\r\n },\r\n /**\r\n * Data to export.\r\n *\r\n * @param value Data\r\n */\r\n set: function (value) {\r\n this._data = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"dataFields\", {\r\n /**\r\n * @return Field names `{ field: fieldName }`\r\n */\r\n get: function () {\r\n if (!this._dataFields) {\r\n this.generateDataFields();\r\n }\r\n return this.adapter.apply(\"dataFields\", {\r\n dataFields: this._dataFields\r\n }).dataFields;\r\n },\r\n /**\r\n * Data fields in `{ field: fieldName }` format. Those are used for\r\n * exporting in data formats to name the columns.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/exporting/#Changing_order_and_names_of_columns} for examples and details\r\n * @param value Field names\r\n */\r\n set: function (value) {\r\n this._dataFields = value;\r\n this._dynamicDataFields = false;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Called after target chart's data updates.\r\n *\r\n * @ignore\r\n */\r\n Export.prototype.handleDataUpdated = function () {\r\n if (this._dynamicDataFields) {\r\n this._dataFields = undefined;\r\n }\r\n var hasData = this.data.length > 0;\r\n if (this._prevHasData != hasData) {\r\n this._prevHasData = hasData;\r\n if (this.menu) {\r\n this.menu.invalidate();\r\n }\r\n }\r\n };\r\n Object.defineProperty(Export.prototype, \"dateFormatter\", {\r\n /**\r\n * @return A DateFormatter instance\r\n */\r\n get: function () {\r\n if (!this._dateFormatter) {\r\n this._dateFormatter = new DateFormatter();\r\n this._dateFormatter.language = this.language;\r\n }\r\n return this.adapter.apply(\"dateFormatter\", {\r\n dateFormatter: this._dateFormatter\r\n }).dateFormatter;\r\n },\r\n /**\r\n * A [[DateFormatter]] to use when formatting dates when exporting data.\r\n *\r\n * @param value DateFormatter instance\r\n */\r\n set: function (value) {\r\n this._dateFormatter = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"dateFormat\", {\r\n /**\r\n * @return Date format\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"dateFormat\", {\r\n dateFormat: this._dateFormat\r\n }).dateFormat;\r\n },\r\n /**\r\n * A date format to use for exporting dates. Will use [[DateFormatter]]\r\n * format if not set.\r\n *\r\n * @param value Date format\r\n */\r\n set: function (value) {\r\n this._dateFormat = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"dateFields\", {\r\n /**\r\n * @return Date field list\r\n */\r\n get: function () {\r\n if (!this._dateFields) {\r\n this._dateFields = new List();\r\n }\r\n return this.adapter.apply(\"dateFields\", {\r\n dateFields: this._dateFields\r\n }).dateFields;\r\n },\r\n /**\r\n * A list of fields that hold date values.\r\n *\r\n * @param value Date field list\r\n */\r\n set: function (value) {\r\n this._dateFields = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"numberFormatter\", {\r\n /**\r\n * @return A NumberFormatter instance\r\n */\r\n get: function () {\r\n if (!this._numberFormatter) {\r\n this._numberFormatter = new NumberFormatter();\r\n this._numberFormatter.language = this.language;\r\n }\r\n return this.adapter.apply(\"numberFormatter\", {\r\n numberFormatter: this._numberFormatter\r\n }).numberFormatter;\r\n },\r\n /**\r\n * A [[NumberFormatter]] to use when formatting dates when exporting data.\r\n *\r\n * @since 4.5.15\r\n * @param value NumberFormatter instance\r\n */\r\n set: function (value) {\r\n this._numberFormatter = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"numberFormat\", {\r\n /**\r\n * @return Number format\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"numberFormat\", {\r\n numberFormat: this._numberFormat\r\n }).numberFormat;\r\n },\r\n /**\r\n * A number format to use for exporting dates. Will use [[NumberFormatter]]\r\n * format if not set.\r\n *\r\n * @since 4.5.15\r\n * @param value Number format\r\n */\r\n set: function (value) {\r\n this._numberFormat = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"numberFields\", {\r\n /**\r\n * @return Number field list\r\n */\r\n get: function () {\r\n if (!this._numberFields) {\r\n this._numberFields = new List();\r\n }\r\n return this.adapter.apply(\"numberFields\", {\r\n numberFields: this._numberFields\r\n }).numberFields;\r\n },\r\n /**\r\n * A list of fields that hold number values.\r\n *\r\n * @since 4.5.15\r\n * @param value Number field list\r\n */\r\n set: function (value) {\r\n this._numberFields = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"durationFormatter\", {\r\n /**\r\n * @return A DurationFormatter instance\r\n */\r\n get: function () {\r\n if (!this._durationFormatter) {\r\n this._durationFormatter = new DurationFormatter();\r\n this._durationFormatter.language = this.language;\r\n }\r\n return this.adapter.apply(\"durationFormatter\", {\r\n durationFormatter: this._durationFormatter\r\n }).durationFormatter;\r\n },\r\n /**\r\n * A [[DurationFormatter]] to use when formatting duration values when\r\n * exporting data.\r\n *\r\n * @param value DurationFormatter instance\r\n */\r\n set: function (value) {\r\n this._durationFormatter = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"durationFormat\", {\r\n /**\r\n * @return Duration format\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"durationFormat\", {\r\n durationFormat: this._durationFormat\r\n }).durationFormat;\r\n },\r\n /**\r\n * A format to use when formatting values from `durationFields`.\r\n * Will use [[DurationFormatter]] format if not set.\r\n *\r\n * @param value Duration format\r\n */\r\n set: function (value) {\r\n this._durationFormat = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"durationFields\", {\r\n /**\r\n * @return Duration field list\r\n */\r\n get: function () {\r\n if (!this._durationFields) {\r\n this._durationFields = new List();\r\n }\r\n return this.adapter.apply(\"durationFields\", {\r\n durationFields: this._durationFields\r\n }).durationFields;\r\n },\r\n /**\r\n * A list of fields that hold duration values.\r\n *\r\n * @param value Duration field list\r\n */\r\n set: function (value) {\r\n this._durationFields = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Generates data fields out of the first row of data.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Export.prototype.generateDataFields = function () {\r\n var _this = this;\r\n this._dataFields = {};\r\n if (this.data.length) {\r\n $array.each(this.data, function (row) {\r\n $object.each(row, function (key, value) {\r\n if (!$type.hasValue(_this._dataFields[key])) {\r\n _this._dataFields[key] = _this.adapter.apply(\"dataFieldName\", {\r\n name: key,\r\n field: key\r\n }).name;\r\n }\r\n });\r\n });\r\n }\r\n };\r\n /**\r\n * Cheks against `dateFields` property to determine if this field holds\r\n * dates.\r\n *\r\n * @ignore Exclude from docs\r\n * @param field Field name\r\n * @param options Options\r\n * @return `true` if it's a date field\r\n */\r\n Export.prototype.isDateField = function (field) {\r\n return this.adapter.apply(\"isDateField\", {\r\n isDateField: this.dateFields.contains(field),\r\n field: field\r\n }).isDateField;\r\n };\r\n /**\r\n * Cheks against `numberFields` property to determine if this field holds\r\n * numbers.\r\n *\r\n * @ignore Exclude from docs\r\n * @param field Field name\r\n * @param options Options\r\n * @return `true` if it's a number field\r\n */\r\n Export.prototype.isNumberField = function (field) {\r\n return this.adapter.apply(\"isNumberField\", {\r\n isNumberField: this.numberFields.contains(field),\r\n field: field\r\n }).isNumberField;\r\n };\r\n /**\r\n * Cheks against `durationFields` property to determine if this field holds\r\n * durations.\r\n *\r\n * @ignore Exclude from docs\r\n * @param field Field name\r\n * @param options Options\r\n * @return `true` if it's a date field\r\n */\r\n Export.prototype.isDurationField = function (field) {\r\n return this.adapter.apply(\"isDurationField\", {\r\n isDurationField: this.durationFields.contains(field),\r\n field: field\r\n }).isDurationField;\r\n };\r\n /**\r\n * Returns proper content type for the export type.\r\n *\r\n * @param type Export format/type\r\n * @return Proper content type, i.e. \"image/jpeg\"\r\n */\r\n Export.prototype.getContentType = function (type) {\r\n var contentType = \"\";\r\n switch (type) {\r\n case \"png\":\r\n case \"gif\":\r\n contentType = \"image/\" + type;\r\n break;\r\n case \"jpg\":\r\n contentType = \"image/jpeg\";\r\n break;\r\n case \"svg\":\r\n contentType = \"image/svg+xml\";\r\n break;\r\n case \"csv\":\r\n contentType = \"text/csv\";\r\n break;\r\n case \"json\":\r\n contentType = \"application/json\";\r\n break;\r\n case \"html\":\r\n contentType = \"text/html\";\r\n break;\r\n case \"pdf\":\r\n case \"pdfdata\":\r\n contentType = \"application/pdf\";\r\n break;\r\n case \"xlsx\":\r\n contentType = \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\";\r\n break;\r\n }\r\n return this.adapter.apply(\"contentType\", {\r\n contentType: contentType,\r\n type: type\r\n }).contentType;\r\n };\r\n Object.defineProperty(Export.prototype, \"filePrefix\", {\r\n /**\r\n * @return File prefix\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"filePrefix\", {\r\n filePrefix: this._filePrefix\r\n }).filePrefix;\r\n },\r\n /**\r\n * A file prefix to be used for all exported formats.\r\n *\r\n * Export will apply format-related extension to it. E.g. if this is set to\r\n * \"myExport\", the file name of the PNG exported image will be \"myExport.png\".\r\n *\r\n * @param value File prefix\r\n */\r\n set: function (value) {\r\n this._filePrefix = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"backgroundColor\", {\r\n /**\r\n * @return Background color\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"backgroundColor\", {\r\n backgroundColor: this._backgroundColor\r\n }).backgroundColor;\r\n },\r\n /**\r\n * A background color to be used for exported images. If set, this will\r\n * override the automatically acquired background color.\r\n *\r\n * @param value Color\r\n */\r\n set: function (value) {\r\n this._backgroundColor = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"title\", {\r\n /**\r\n * @return Title\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"title\", {\r\n title: this._title\r\n }).title;\r\n },\r\n /**\r\n * A title to be used when printing.\r\n *\r\n * @param value Title\r\n */\r\n set: function (value) {\r\n this._title = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Displays a preloader/exporting indicator.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Add ability to change text\r\n */\r\n Export.prototype.showPreloader = function () {\r\n var preloader = this.preloader;\r\n if (preloader) {\r\n preloader.progress = 0.5;\r\n preloader.label.text = \"...\";\r\n }\r\n };\r\n /**\r\n * Hides preloader/exporting indicator\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Export.prototype.hidePreloader = function () {\r\n var preloader = this.preloader;\r\n if (preloader) {\r\n preloader.progress = 1;\r\n }\r\n };\r\n Object.defineProperty(Export.prototype, \"preloader\", {\r\n /**\r\n * Returns a an instance of [[Preloader]] associated with the Sprite being\r\n * exported.\r\n *\r\n * @return Preloader\r\n */\r\n get: function () {\r\n return this._sprite && this._sprite.parent && this._sprite.parent.preloader ?\r\n this._sprite.parent.preloader :\r\n undefined;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Displays a modal saying export is taking longer than expected.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Export.prototype.showTimeout = function () {\r\n this.showModal(this.adapter.apply(\"timeoutMessage\", {\r\n message: this.language.translate(\"Export operation took longer than expected. Something might have gone wrong.\")\r\n }).message);\r\n };\r\n /**\r\n * Hides preloader/exporting indicator.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Export.prototype.hideTimeout = function () {\r\n if (this._timeoutTimeout) {\r\n this.removeDispose(this._timeoutTimeout);\r\n this._timeoutTimeout = null;\r\n }\r\n this.hideModal();\r\n };\r\n Object.defineProperty(Export.prototype, \"language\", {\r\n /**\r\n * @return A [[Language]] instance to be used\r\n */\r\n get: function () {\r\n if (!this._language) {\r\n this._language = new Language();\r\n }\r\n return this._language;\r\n },\r\n /**\r\n * A [[Language]] instance to be used for translations.\r\n *\r\n * @param value An instance of [[Language]]\r\n */\r\n set: function (value) {\r\n this._language = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"modal\", {\r\n /**\r\n * Returns (and creates) [[Modal]].\r\n *\r\n * @ignore Exclude from docs\r\n * @return Modal instance\r\n */\r\n get: function () {\r\n if (!this._modal) {\r\n this._modal = new Modal();\r\n // Prefix with Sprite's class name\r\n this._modal.adapter.add(\"classPrefix\", function (value) {\r\n value = options.classNamePrefix + value;\r\n return value;\r\n });\r\n }\r\n return this._modal;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Shows [[Modal]] with specific text.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Modal contents\r\n */\r\n Export.prototype.showModal = function (text, title) {\r\n // Hide previous modal and preloader\r\n this.hideModal();\r\n this.hidePreloader();\r\n // Create modal\r\n var modal = this.modal;\r\n modal.container = this.sprite.svgContainer.SVGContainer;\r\n modal.content = text;\r\n modal.readerTitle = title;\r\n modal.open();\r\n };\r\n /**\r\n * Hides modal window if one's currently open.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Export.prototype.hideModal = function () {\r\n if (this._modal) {\r\n this.modal.close();\r\n }\r\n };\r\n /**\r\n * Loads canvg dynamic module.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Instance of canvg\r\n * @async\r\n */\r\n Export.prototype._canvg = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var canvg;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, import(/* webpackChunkName: \"canvg\" */ \"../../canvg/index.js\")];\r\n case 1:\r\n canvg = (_a.sent());\r\n if (canvg.default != null) {\r\n return [2 /*return*/, canvg.default];\r\n }\r\n else {\r\n return [2 /*return*/, canvg];\r\n }\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n Object.defineProperty(Export.prototype, \"canvg\", {\r\n /**\r\n * Returns canvg instance.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Instance of canvg\r\n */\r\n get: function () {\r\n return this._canvg();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"pdfmake\", {\r\n /**\r\n * Returns pdfmake instance.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Instance of pdfmake\r\n */\r\n get: function () {\r\n if (pdfmakePromise == null) {\r\n pdfmakePromise = _pdfmake();\r\n }\r\n return pdfmakePromise;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Loads xlsx dynamic module.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Instance of pdfmake\r\n * @async\r\n */\r\n Export.prototype._xlsx = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, import(/* webpackChunkName: \"xlsx\" */ \"../../bundled/xlsx\")];\r\n case 1: return [2 /*return*/, _a.sent()];\r\n }\r\n });\r\n });\r\n };\r\n Object.defineProperty(Export.prototype, \"xlsx\", {\r\n /**\r\n * Returns xlsx instance.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Instance of pdfmake\r\n */\r\n get: function () {\r\n return this._xlsx();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets options for a format.\r\n */\r\n Export.prototype.setFormatOptions = function (type, options) {\r\n this._formatOptions.setKey(type, options);\r\n };\r\n /**\r\n * Returns current options for a format.\r\n */\r\n Export.prototype.getFormatOptions = function (type) {\r\n return this._formatOptions.getKey(type);\r\n };\r\n Object.defineProperty(Export.prototype, \"formatOptions\", {\r\n /**\r\n * A [[Dictionary]] object containing format-specific options.\r\n *\r\n * May be used to change specific option for the format:\r\n *\r\n * ```TypeScript\r\n * chart.exporting.formatOptions.getKey(\"csv\").disabled = true;\r\n * ```\r\n * ```JavaScript\r\n * chart.exporting.formatOptions.getKey(\"csv\").disabled = true;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"exporting\": {\r\n * // ...\r\n * \"formatOptions\": {\r\n * \"csv\": {\r\n * \"disabled\": true\r\n * }\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * @since 4.9.12\r\n * @return Options\r\n */\r\n get: function () {\r\n return this._formatOptions;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Disables interactivity on parent chart.\r\n */\r\n Export.prototype._disablePointers = function () {\r\n if (!$type.hasValue(this._spriteInteractionsEnabled)) {\r\n this._spriteInteractionsEnabled = this.sprite.interactionsEnabled;\r\n }\r\n this.sprite.interactionsEnabled = false;\r\n };\r\n /**\r\n * Releases temporarily disabled pointers on parent chart.\r\n */\r\n Export.prototype._releasePointers = function () {\r\n if ($type.hasValue(this._spriteInteractionsEnabled) && !this._exportRunning) {\r\n this.sprite.interactionsEnabled = this._spriteInteractionsEnabled;\r\n }\r\n };\r\n /**\r\n * Hides all elements that should not be included in the exported image.\r\n */\r\n Export.prototype.hideNonExportableSprites = function () {\r\n var _this = this;\r\n if (this._objectsAlreadyHidden) {\r\n return;\r\n }\r\n var svgContainer = this.sprite.svgContainer;\r\n if (svgContainer) {\r\n $array.each(svgContainer.nonExportableSprites, function (item) {\r\n if (!item.isHidden && !item.isHiding && item.visible) {\r\n _this._hiddenObjects.push(item);\r\n }\r\n item.hide(0);\r\n });\r\n }\r\n this._objectsAlreadyHidden = true;\r\n };\r\n /**\r\n * Respores elements that were hidden before export.\r\n */\r\n Export.prototype.restoreNonExportableSprites = function () {\r\n if (!this._objectsAlreadyHidden) {\r\n return;\r\n }\r\n $array.each(this._hiddenObjects, function (item) {\r\n item.show(0);\r\n });\r\n this._hiddenObjects = [];\r\n this._objectsAlreadyHidden = false;\r\n };\r\n /**\r\n * Checks if there are elements that absolutely need to be validated before\r\n * export.\r\n *\r\n * If there are invalid elements, it will await for them to be validated.\r\n *\r\n * @return Promise\r\n */\r\n Export.prototype.awaitValidSprites = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var promises;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n promises = [];\r\n if (this.validateSprites.length) {\r\n $array.each(this.validateSprites, function (sprite, index) {\r\n if (sprite.invalid) {\r\n promises.push(new Promise(function (resolve, reject) {\r\n sprite.events.once(\"validated\", function (ev) {\r\n resolve();\r\n });\r\n }));\r\n }\r\n });\r\n }\r\n if (!promises.length) return [3 /*break*/, 2];\r\n return [4 /*yield*/, Promise.all(promises)];\r\n case 1:\r\n _a.sent();\r\n _a.label = 2;\r\n case 2: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n Export.prototype.processConfig = function (config) {\r\n registry.registeredClasses[\"ExportMenu\"] = ExportMenu;\r\n if (config) {\r\n // Set up menu\r\n if ($type.hasValue(config.menu) && !$type.hasValue(config.menu.type)) {\r\n config.menu.type = \"ExportMenu\";\r\n }\r\n if ($type.hasValue(config.dataFields) && $type.isObject(config.dataFields)) {\r\n this.dataFields = config.dataFields;\r\n delete config.dataFields;\r\n }\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n /**\r\n * XLINK namespace definition.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Export.XLINK = \"http://www.w3.org/1999/xlink\";\r\n return Export;\r\n}(Validatable));\r\nexport { Export };\r\n//# sourceMappingURL=Export.js.map","/**\r\n * This module defines a [[Validatable]] class which can be used by all\r\n * non-[[Sprite]] classes to use system beats to revalidate themselves.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObjectEvents } from \"../Base\";\r\nimport { registry } from \"../Registry\";\r\n/**\r\n * This module defines a [[Validatable]] class which can be used by all\r\n * non-[[Sprite]] classes to use system update cycle to revalidate themselves.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nvar Validatable = /** @class */ (function (_super) {\r\n __extends(Validatable, _super);\r\n function Validatable() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n /**\r\n * Is invalid and should be revalidated?\r\n */\r\n _this._validateDisposer = null;\r\n return _this;\r\n }\r\n /**\r\n * Invalidates the element, so that it can re-validate/redraw itself in the\r\n * next cycle.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Validatable.prototype.invalidate = function () {\r\n if (this._validateDisposer === null) {\r\n this._validateDisposer = registry.events.on(\"exitframe\", this.validate, this);\r\n }\r\n };\r\n /**\r\n * Validates itself.\r\n *\r\n * Most probably the extending class will have an overriding `validate()`\r\n * method which will do actual work, as well as call this method using\r\n * `super.validate()`.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Validatable.prototype.validate = function () {\r\n if (this._validateDisposer !== null) {\r\n this._validateDisposer.dispose();\r\n this._validateDisposer = null;\r\n }\r\n };\r\n Validatable.prototype.dispose = function () {\r\n if (this._validateDisposer !== null) {\r\n this._validateDisposer.dispose();\r\n this._validateDisposer = null;\r\n }\r\n _super.prototype.dispose.call(this);\r\n };\r\n return Validatable;\r\n}(BaseObjectEvents));\r\nexport { Validatable };\r\n//# sourceMappingURL=Validatable.js.map","/**\r\n * ExportMenu provides functionality for building Export menu\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport exportCSS from \"./ExportCSS\";\r\nimport { Adapter } from \"../utils/Adapter\";\r\nimport { List } from \"../utils/List\";\r\nimport { getInteraction } from \"../interaction/Interaction\";\r\nimport { MutableValueDisposer } from \"../utils/Disposer\";\r\nimport { Language } from \"../utils/Language\";\r\nimport { Validatable } from \"../utils/Validatable\";\r\nimport { keyboard } from \"../utils/Keyboard\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $iter from \"../utils/Iterator\";\r\nimport * as $dom from \"../utils/DOM\";\r\nimport * as $type from \"../utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a menu for Export operations.\r\n *\r\n * To add an export menu to a chart, set this to a new instance of\r\n * [[ExportMenu]].\r\n *\r\n * ```TypeScript\r\n * chart.exporting.menu = new am4core.ExportMenu();\r\n * ```\r\n * ```JavaScript\r\n * chart.exporting.menu = new am4core.ExportMenu();\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"exporting\": {\r\n * \"menu\": {}\r\n * }\r\n * }\r\n * ```\r\n * @important\r\n */\r\nvar ExportMenu = /** @class */ (function (_super) {\r\n __extends(ExportMenu, _super);\r\n /**\r\n * Constructor\r\n */\r\n function ExportMenu() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * An [[Adapter]].\r\n */\r\n _this.adapter = new Adapter(_this);\r\n /**\r\n * How many milliseconds to hold menu/sub-menu open after it loses focus or\r\n * hover, before auto-closing it.\r\n *\r\n * @default 1000\r\n */\r\n _this.closeDelay = 1000;\r\n /**\r\n * Close the menu automatically when some export operation is triggered.\r\n *\r\n * @default true\r\n * @since 4.2.2\r\n */\r\n _this.closeOnClick = true;\r\n /**\r\n * An instance of [[Language]].\r\n */\r\n _this._language = new MutableValueDisposer();\r\n /**\r\n * What HTML tags to use to build menu.\r\n */\r\n _this._menuTag = \"ul\";\r\n /**\r\n * Which tag to use to enclose individual menu items.\r\n */\r\n _this._itemTag = \"li\";\r\n /**\r\n * Tag to wrap menu item labels in.\r\n */\r\n _this._labelTag = \"a\";\r\n /**\r\n * Tag to use for icons\r\n */\r\n _this._iconTag = \"img\";\r\n /**\r\n * Prefix for class names applied to menu elements.\r\n */\r\n _this._classPrefix = \"amexport\";\r\n /**\r\n * If set to `true` [[ExportMenu]] will load it's own external CSS when\r\n * instantiated.\r\n */\r\n _this._defaultStyles = true;\r\n /**\r\n * Horizontal positioning.\r\n */\r\n _this._align = \"right\";\r\n /**\r\n * Vertical positioning.\r\n */\r\n _this._verticalAlign = \"top\";\r\n /**\r\n * A tabindex to apply to Export Menu.\r\n */\r\n _this._tabindex = 0;\r\n /**\r\n * Whether next menu close event should be ignored.\r\n */\r\n _this._ignoreNextClose = false;\r\n /**\r\n * Default menu items.\r\n */\r\n _this._items = [\r\n {\r\n \"label\": \"...\",\r\n \"menu\": [\r\n {\r\n \"label\": \"Image\",\r\n \"menu\": [\r\n { \"type\": \"png\", \"label\": \"PNG\" },\r\n { \"type\": \"jpg\", \"label\": \"JPG\" },\r\n { \"type\": \"svg\", \"label\": \"SVG\" },\r\n { \"type\": \"pdf\", \"label\": \"PDF\" }\r\n ]\r\n }, {\r\n \"label\": \"Data\",\r\n \"menu\": [\r\n { \"type\": \"json\", \"label\": \"JSON\" },\r\n { \"type\": \"csv\", \"label\": \"CSV\" },\r\n { \"type\": \"xlsx\", \"label\": \"XLSX\" },\r\n { \"type\": \"html\", \"label\": \"HTML\" },\r\n { \"type\": \"pdfdata\", \"label\": \"PDF\" }\r\n ]\r\n }, {\r\n \"label\": \"Print\", \"type\": \"print\"\r\n }\r\n ]\r\n }\r\n ];\r\n _this.className = \"ExportMenu\";\r\n _this._disposers.push(_this._language);\r\n _this.invalidate();\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * (Re)draws the Export menu.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n ExportMenu.prototype.validate = function () {\r\n this.draw();\r\n _super.prototype.validate.call(this);\r\n };\r\n /**\r\n * Draws the menu based on current items.\r\n *\r\n * Normally, there's no need to call this explicitly. The chart, if it has\r\n * export menu enabled, will automatically draw the menu.\r\n */\r\n ExportMenu.prototype.draw = function () {\r\n var _this = this;\r\n // Create top-level menu item, or clear it\r\n if (!this._element) {\r\n this._element = this.createMenuElement(0);\r\n }\r\n else {\r\n this._element.innerHTML = \"\";\r\n this._element.className = this.getMenuItemClass(0);\r\n }\r\n // See if we're loading external CSS\r\n // Hide it until CSS is loaded\r\n if (this.defaultStyles) {\r\n this._element.style.display = \"none\";\r\n }\r\n // Append to container\r\n $type.getValue(this._container).appendChild(this._element);\r\n // Apply adapter to menu items before processing\r\n var items = this.adapter.apply(\"items\", {\r\n items: this._items\r\n }).items;\r\n for (var len = items.length, i = 0; i < len; i++) {\r\n this.drawBranch(this._element, items[i], 0);\r\n }\r\n // Apply adapter to finalized menu element\r\n this._element = this.adapter.apply(\"menuElement\", {\r\n menuElement: this._element\r\n }).menuElement;\r\n // Set up global \"down\" event\r\n this._disposers.push(getInteraction().body.events.on(\"down\", function (ev) {\r\n if (!ev.pointer.touch) {\r\n _this._ignoreNextClose = false;\r\n }\r\n _this.close();\r\n }));\r\n // Set up global event on ESC press to close the menu\r\n this._disposers.push(getInteraction().body.events.on(\"keydown\", function (ev) {\r\n var key = keyboard.getEventKey(ev.event);\r\n switch (key) {\r\n case \"esc\":\r\n _this.close();\r\n break;\r\n case \"up\":\r\n case \"down\":\r\n case \"left\":\r\n case \"right\":\r\n if (_this._currentSelection) {\r\n ev.event.preventDefault();\r\n }\r\n _this.moveSelection(key);\r\n break;\r\n }\r\n }));\r\n if (this.defaultStyles) {\r\n this.loadDefaultCSS();\r\n }\r\n };\r\n /**\r\n * Creates a new branch in export menu. This function is recursive for\r\n * building multi-level menus.\r\n *\r\n * @ignore Exclude from docs\r\n * @param container Container to put branch elements in\r\n * @param branch Menu item\r\n * @param level Current nesting level\r\n */\r\n ExportMenu.prototype.drawBranch = function (container, branch, level) {\r\n var _this = this;\r\n // Apply adapter\r\n branch = this.adapter.apply(\"branch\", {\r\n branch: branch,\r\n level: level\r\n }).branch;\r\n // Unsupported?\r\n // ExportMenu does not check or know for specific browser/system\r\n // capabilities. It must happen in some other code and applied via Adapter.\r\n // Export itself will check compatibility, but there might be other plugins\r\n // that influence it or even add any specific export functionality.\r\n if (branch.unsupported === true) {\r\n return;\r\n }\r\n // Init ascendants\r\n if (!branch.ascendants) {\r\n branch.ascendants = new List();\r\n }\r\n // Get type\r\n var type = branch.type;\r\n // Create an item\r\n var element = this.createItemElement(level, type);\r\n // Create label\r\n var label;\r\n // Create icon\r\n if (branch.icon) {\r\n label = this.createIconElement(level, type);\r\n label.src = branch.icon;\r\n if (branch.label || branch.title) {\r\n label.title = branch.title || branch.label;\r\n }\r\n }\r\n else if (branch.svg) {\r\n label = this.createSvgElement(level, type, branch.svg);\r\n if (branch.label || branch.title) {\r\n label.title = branch.title || branch.label;\r\n }\r\n }\r\n else {\r\n label = this.createLabelElement(level, type);\r\n label.innerHTML = (branch.label ? this.language.translate(branch.label) : \"\");\r\n if (branch.title) {\r\n label.title = branch.title;\r\n }\r\n }\r\n // Apply reader text to label\r\n var readerLabel = this.getReaderLabel(branch, label.innerHTML);\r\n label.setAttribute(\"aria-label\", readerLabel);\r\n // Add Label\r\n element.appendChild(label);\r\n // Create interaction object\r\n // TODO clean this up when it's disposed\r\n branch.interactions = getInteraction().getInteraction(element);\r\n branch.element = element;\r\n // Create interaction manager we can set event listeners to\r\n if (this.typeClickable(type)) {\r\n //branch.interactions.clickable = true;\r\n // TODO clean this up when it's disposed\r\n branch.interactions.events.on(\"hit\", function (ev) {\r\n if (_this.events.isEnabled(\"hit\") && !_this.isDisposed()) {\r\n var event_1 = {\r\n \"type\": \"hit\",\r\n \"event\": ev.event,\r\n \"target\": _this,\r\n \"branch\": branch\r\n };\r\n _this.events.dispatchImmediately(\"hit\", event_1);\r\n }\r\n });\r\n // TODO clean this up when it's disposed\r\n branch.interactions.events.on(\"keyup\", function (ev) {\r\n if (keyboard.isKey(ev.event, \"enter\")) {\r\n if (_this.events.isEnabled(\"enter\")) {\r\n var event_2 = {\r\n \"type\": \"enter\",\r\n \"event\": ev.event,\r\n \"target\": _this,\r\n \"branch\": branch\r\n };\r\n _this.events.dispatchImmediately(\"enter\", event_2);\r\n }\r\n }\r\n });\r\n }\r\n {\r\n var submenu_1 = this.getSubMenu(branch);\r\n // Add ENTER event to open sub-menus\r\n if (submenu_1 != null) {\r\n // TODO clean this up when it's disposed\r\n branch.interactions.events.on(\"keyup\", function (ev) {\r\n if (keyboard.isKey(ev.event, \"enter\")) {\r\n // This is item has sub-menu, activate the first child on ENTER\r\n _this.selectBranch(submenu_1[0]);\r\n // Attempt to set focus\r\n _this.setFocus(submenu_1[0]);\r\n }\r\n });\r\n branch.interactions.events.on(\"hit\", function (ev) {\r\n _this.selectBranch(branch);\r\n });\r\n }\r\n }\r\n // Add events\r\n // TODO clean this up when it's disposed\r\n branch.interactions.events.on(\"over\", function (ev) {\r\n if (ev.pointer.touch) {\r\n // Cancel pending menu closure\r\n _this._ignoreNextClose = true;\r\n }\r\n _this.selectBranch(branch);\r\n if (_this.events.isEnabled(\"over\")) {\r\n var event_3 = {\r\n \"type\": \"over\",\r\n \"event\": ev.event,\r\n \"target\": _this,\r\n \"branch\": branch\r\n };\r\n _this.events.dispatchImmediately(\"over\", event_3);\r\n }\r\n });\r\n // TODO clean this up when it's disposed\r\n branch.interactions.events.on(\"out\", function (ev) {\r\n if (_this.isDisposed()) {\r\n return;\r\n }\r\n if (!ev.pointer.touch) {\r\n _this.delayUnselectBranch(branch);\r\n }\r\n if (_this.events.isEnabled(\"out\")) {\r\n var event_4 = {\r\n \"type\": \"out\",\r\n \"event\": ev.event,\r\n \"target\": _this,\r\n \"branch\": branch\r\n };\r\n _this.events.dispatchImmediately(\"out\", event_4);\r\n }\r\n });\r\n // TODO clean this up when it's disposed\r\n branch.interactions.events.on(\"focus\", function (ev) {\r\n _this.selectBranch(branch);\r\n });\r\n // TODO clean this up when it's disposed\r\n branch.interactions.events.on(\"blur\", function (ev) {\r\n _this.delayUnselectBranch(branch);\r\n });\r\n // Increment level\r\n var local_level = level + 1;\r\n // Has sub-menu?\r\n if (branch.menu) {\r\n var submenu = this.createMenuElement(local_level);\r\n branch.submenuElement = submenu;\r\n for (var len = branch.menu.length, i = 0; i < len; i++) {\r\n var ascendants = new List();\r\n branch.menu[i].ascendants = ascendants;\r\n if (branch.ascendants.length) {\r\n ascendants.copyFrom(branch.ascendants);\r\n }\r\n ascendants.push(branch);\r\n this.drawBranch(submenu, branch.menu[i], local_level);\r\n }\r\n // Sub-menu is empty (all items are not supported)\r\n // Do not draw this menu item at all\r\n if (submenu.innerHTML == \"\") {\r\n return;\r\n }\r\n element.appendChild(submenu);\r\n }\r\n // Should this item be hidden?\r\n if (branch.hidden) {\r\n this.hideBranch(branch);\r\n }\r\n // Add id?\r\n if (branch.id) {\r\n element.setAttribute(\"id\", branch.id);\r\n }\r\n // Background color?\r\n if (branch.color) {\r\n element.style.backgroundColor = branch.color.hex;\r\n }\r\n // Append to container\r\n container.appendChild(element);\r\n };\r\n /**\r\n * Creates a menu element to hold its elements in. Usually it's an `
    `\r\n * tag.\r\n *\r\n * @ignore Exclude from docs\r\n * @param level Current nesting level\r\n * @return HTML element reference\r\n */\r\n ExportMenu.prototype.createMenuElement = function (level) {\r\n var element = document.createElement(this.menuTag);\r\n element.className = this.getMenuItemClass(level);\r\n // Accessibility\r\n if (level === 0) {\r\n element.setAttribute(\"role\", \"menubar\");\r\n }\r\n else {\r\n element.setAttribute(\"role\", \"menu\");\r\n }\r\n return element;\r\n };\r\n /**\r\n * Generates a class name for the menu element based on its nesting level.\r\n *\r\n * @ignore Exclude from docs\r\n * @param level Current nesting level\r\n * @return Class name(s)\r\n */\r\n ExportMenu.prototype.getMenuItemClass = function (level) {\r\n var className = this.classPrefix + \"-menu \" + this.classPrefix + \"-menu-level-\" + level;\r\n if (level === 0) {\r\n className += \" \" + this.classPrefix + \"-menu-root \" +\r\n this.classPrefix + \"-\" + this.align + \" \" +\r\n this.classPrefix + \"-\" + this.verticalAlign;\r\n }\r\n return this.adapter.apply(\"menuClass\", {\r\n className: className,\r\n level: level\r\n }).className;\r\n };\r\n /**\r\n * Creates menu item. Usually `
  • ` tag. Its label and sub-elements will go\r\n * into this element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param level Current nesting level\r\n * @param type Type of the menu item\r\n * @return HTML element reference\r\n */\r\n ExportMenu.prototype.createItemElement = function (level, type) {\r\n var element = document.createElement(this.itemTag);\r\n var className = this.classPrefix + \"-item \" + this.classPrefix\r\n + \"-item-level-\" + level\r\n + \" \" + this.classPrefix + \"-item-\" + (type || \"blank\");\r\n element.className = this.adapter.apply(\"itemClass\", {\r\n className: className,\r\n level: level,\r\n type: type\r\n }).className;\r\n element.setAttribute(\"role\", \"menuitem\");\r\n element.setAttribute(\"tabindex\", this.tabindex.toString());\r\n return element;\r\n };\r\n /**\r\n * Creates a \"label\" part of the menu item. It could be text or any HTML\r\n * content.\r\n *\r\n * @ignore Exclude from docs\r\n * @param level Current nesting level\r\n * @param type Type of the menu item\r\n * @return An HTML Element\r\n */\r\n ExportMenu.prototype.createLabelElement = function (level, type) {\r\n var element = document.createElement(this.labelTag);\r\n var className = this.classPrefix + \"-label \" + this.classPrefix\r\n + \"-label-level-\" + level\r\n + \" \" + this.classPrefix + \"-item-\" + (type || \"blank\");\r\n if (this.typeClickable(type)) {\r\n className += \" \" + this.classPrefix + \"-clickable\";\r\n }\r\n element.className = this.adapter.apply(\"labelClass\", {\r\n className: className,\r\n level: level,\r\n type: type\r\n }).className;\r\n // Accessible navigation\r\n //element.setAttribute(\"tabindex\", this.tabindex.toString());\r\n //element.setAttribute(\"role\", \"menuitem\");\r\n return element;\r\n };\r\n /**\r\n * Creates a \"icon\" part of the menu item.\r\n *\r\n * @ignore Exclude from docs\r\n * @param level Current nesting level\r\n * @param type Type of the menu item\r\n * @return An HTML Element\r\n */\r\n ExportMenu.prototype.createIconElement = function (level, type) {\r\n var element = document.createElement(this.iconTag);\r\n var className = this.classPrefix + \"-icon \" + this.classPrefix\r\n + \"-icon-level-\" + level\r\n + \" \" + this.classPrefix + \"-item-\" + (type || \"blank\");\r\n if (this.typeClickable(type)) {\r\n className += \" \" + this.classPrefix + \"-clickable\";\r\n }\r\n element.className = this.adapter.apply(\"labelClass\", {\r\n className: className,\r\n level: level,\r\n type: type\r\n }).className;\r\n // Accessible navigation\r\n element.setAttribute(\"tabindex\", this.tabindex.toString());\r\n element.setAttribute(\"role\", \"menuitem\");\r\n return element;\r\n };\r\n /**\r\n * Creates a a custom element out of raw HTML.\r\n *\r\n * @ignore Exclude from docs\r\n * @param level Current nesting level\r\n * @param type Type of the menu item\r\n * @return An HTML Element\r\n */\r\n ExportMenu.prototype.createSvgElement = function (level, type, svg) {\r\n var parser = new DOMParser();\r\n var element = parser.parseFromString(svg, \"image/svg+xml\").documentElement;\r\n var className = this.classPrefix + \"-icon \" + this.classPrefix\r\n + \"-icon-level-\" + level\r\n + \" \" + this.classPrefix + \"-item-\" + (type || \"blank\");\r\n if (this.typeClickable(type)) {\r\n className += \" \" + this.classPrefix + \"-clickable\";\r\n }\r\n element.setAttribute(\"class\", this.adapter.apply(\"labelClass\", {\r\n className: className,\r\n level: level,\r\n type: type\r\n }).className);\r\n // Accessible navigation\r\n element.setAttribute(\"tabindex\", this.tabindex.toString());\r\n element.setAttribute(\"role\", \"menuitem\");\r\n return element;\r\n };\r\n /**\r\n * Destroys the menu and all its elements.\r\n */\r\n ExportMenu.prototype.dispose = function () {\r\n if (!this._disposed) {\r\n _super.prototype.dispose.call(this);\r\n if (this._element && this._element.parentNode) {\r\n this._element.parentNode.removeChild(this._element);\r\n }\r\n }\r\n };\r\n /**\r\n * Checks whether menu item type is supposed to be clickable.\r\n *\r\n * @ignore Exclude from docs\r\n * @param type Menu item type\r\n * @return Is clickable?\r\n */\r\n ExportMenu.prototype.typeClickable = function (type) {\r\n return $type.hasValue(type);\r\n };\r\n /**\r\n * Checks whether menu item has any sub-items.\r\n *\r\n * @ignore Exclude from docs\r\n * @param branch A menu item\r\n * @return Has sub-items?\r\n */\r\n ExportMenu.prototype.hasSubMenu = function (branch) {\r\n return (branch.menu && branch.menu.length) ? true : false;\r\n };\r\n /**\r\n * Returns sub-items (if they exist).\r\n *\r\n * @ignore Exclude from docs\r\n * @param branch A menu item\r\n * @return Submenus\r\n */\r\n ExportMenu.prototype.getSubMenu = function (branch) {\r\n if (branch.menu && branch.menu.length) {\r\n return branch.menu;\r\n }\r\n };\r\n /**\r\n * Generates and returns an applicable label to be used for screen readers.\r\n *\r\n * @ignore Exclude from docs\r\n * @param item A menu item instance\r\n * @param label Current label\r\n * @return Reader text\r\n */\r\n ExportMenu.prototype.getReaderLabel = function (branch, label) {\r\n // Strip any HTML from the label\r\n label = $utils.stripTags(label);\r\n // Add textual note if the branch is clickable\r\n if (branch.ascendants.length == 0) {\r\n label = label == \"...\" ? this.language.translate(\"Export\") : label;\r\n label += \" [\" + this.language.translate(\"Press ENTER or use arrow keys to navigate\") + \"]\";\r\n }\r\n else if (this.hasSubMenu(branch)) {\r\n label += \" [\" + this.language.translate(\"Click, tap or press ENTER to open\") + \"]\";\r\n }\r\n else if (branch.type == \"print\") {\r\n label = this.language.translate(\"Click, tap or press ENTER to print.\");\r\n }\r\n else if (this.typeClickable(branch.type)) {\r\n label = this.language.translate(\"Click, tap or press ENTER to export as %1.\", undefined, label);\r\n }\r\n return this.adapter.apply(\"rederLabel\", {\r\n label: label,\r\n branch: branch\r\n }).label;\r\n };\r\n Object.defineProperty(ExportMenu.prototype, \"container\", {\r\n /**\r\n * @return Container\r\n */\r\n get: function () {\r\n return this._container;\r\n },\r\n /**\r\n * Getters and setters\r\n */\r\n /**\r\n * An HTML container to place the Menu in.\r\n *\r\n * A container must be an HTML element, because menu itself is HTML, and\r\n * cannot be placed into SVG.\r\n *\r\n * @param container Reference to container element\r\n * @todo Check if menu is already build. If it is, just move it to a new container\r\n */\r\n set: function (container) {\r\n this._container = container;\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ExportMenu.prototype, \"items\", {\r\n /**\r\n * @return Menu items\r\n */\r\n get: function () {\r\n return this._items;\r\n },\r\n /**\r\n * A list of menu items. Can be nested.\r\n *\r\n * @param items Menu items\r\n */\r\n set: function (items) {\r\n this._items = items;\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ExportMenu.prototype, \"tag\", {\r\n /**\r\n * Sets main menu tag to place menu in.\r\n *\r\n * This also sets up how menu items are built.\r\n *\r\n * If you set this to \"ul\", menu items will be wrapped into `
  • ` tags.\r\n *\r\n * If set to \"div\", menu items will be wrapped in `
    ` tags.\r\n *\r\n * @default \"ul\"\r\n * @param tag Tag to use for menu\r\n */\r\n set: function (tag) {\r\n this._menuTag = tag;\r\n this._itemTag = tag == \"ul\" ? \"li\" : \"div\";\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ExportMenu.prototype, \"menuTag\", {\r\n /**\r\n * Returns current menu tag.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Menu tag (item that contains sub-items)\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"menuTag\", {\r\n tag: this._menuTag\r\n }).tag;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ExportMenu.prototype, \"itemTag\", {\r\n /**\r\n * Returns tag to wrap items into.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Item tag\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"itemTag\", {\r\n tag: this._itemTag\r\n }).tag;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ExportMenu.prototype, \"labelTag\", {\r\n /**\r\n * Returns menu label tag.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Label tag\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"labelTag\", {\r\n tag: this._labelTag\r\n }).tag;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ExportMenu.prototype, \"iconTag\", {\r\n /**\r\n * Returns icon tag.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Icon tag\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"iconTag\", {\r\n tag: this._iconTag\r\n }).tag;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ExportMenu.prototype, \"align\", {\r\n /**\r\n * @return Horizontal alignment\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"align\", {\r\n align: this._align\r\n }).align;\r\n },\r\n /**\r\n * A horizontal alignment for the menu placement.\r\n *\r\n * @param value Horizontal alignment\r\n */\r\n set: function (value) {\r\n this._align = value;\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ExportMenu.prototype, \"verticalAlign\", {\r\n /**\r\n * @return Vertical alignment\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"verticalAlign\", {\r\n verticalAlign: this._verticalAlign\r\n }).verticalAlign;\r\n },\r\n /**\r\n * A vertical alignment for the menu placement.\r\n *\r\n * @param value Vertical alignment\r\n */\r\n set: function (value) {\r\n this._verticalAlign = value;\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ExportMenu.prototype, \"classPrefix\", {\r\n /**\r\n * @return Class name prefix\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"classPrefix\", {\r\n classPrefix: this._classPrefix\r\n }).classPrefix;\r\n },\r\n /**\r\n * Class name prefix.\r\n *\r\n * @default \"amexport\"\r\n * @param value Class name prefix\r\n */\r\n set: function (value) {\r\n this._classPrefix = value;\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ExportMenu.prototype, \"defaultStyles\", {\r\n /**\r\n * @return Should ExportMenu load its own CSS?\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"defaultStyles\", {\r\n defaultStyles: this._defaultStyles\r\n }).defaultStyles;\r\n },\r\n /**\r\n * Indicates whether [[ExportMenu]] should load external CSS to style itself.\r\n *\r\n * If set to `false`, the menu will not be styled, and will rely on some\r\n * external CSS.\r\n *\r\n * @default true\r\n * @param Should ExportMenu load its own CSS?\r\n */\r\n set: function (value) {\r\n if (this._defaultStyles != value) {\r\n this._defaultStyles = value;\r\n if (value) {\r\n this.loadDefaultCSS();\r\n }\r\n }\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Loads the default CSS.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n ExportMenu.prototype.loadDefaultCSS = function () {\r\n this._disposers.push(exportCSS($dom.getShadowRoot(this.container), this.classPrefix));\r\n if (this._element) {\r\n this._element.style.display = \"\";\r\n }\r\n };\r\n Object.defineProperty(ExportMenu.prototype, \"tabindex\", {\r\n /**\r\n * @return Tab index\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"tabindex\", {\r\n tabindex: this._tabindex\r\n }).tabindex;\r\n },\r\n /**\r\n * A tab index for the menu.\r\n *\r\n * Tab index will influence the order in which elements on the chart and\r\n * the whole page are selected when pressing TAB key.\r\n *\r\n * @param value Tab index\r\n */\r\n set: function (value) {\r\n this._tabindex = value;\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ExportMenu.prototype, \"language\", {\r\n /**\r\n * @return A [[Language]] instance to be used\r\n */\r\n get: function () {\r\n var _this = this;\r\n var language = this._language.get();\r\n if (language == null) {\r\n language = new Language();\r\n // TODO code duplication with `set language()`\r\n this._language.set(language, language.events.on(\"localechanged\", function (ev) {\r\n _this.invalidate();\r\n }));\r\n }\r\n return language;\r\n },\r\n /**\r\n * A [[Language]] instance.\r\n *\r\n * @param value An instance of [[Language]]\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n this._language.set(value, value.events.on(\"localechanged\", function (ev) {\r\n _this.invalidate();\r\n }));\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Controlling the menu\r\n */\r\n /**\r\n * Removes all active classes from menu items. Useful on touch devices and\r\n * keyboard navigation where open menu can be closed instantly by clicking or\r\n * tapping outside it.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n ExportMenu.prototype.close = function () {\r\n var _this = this;\r\n if (this.isDisposed()) {\r\n return;\r\n }\r\n if (this._ignoreNextClose) {\r\n this._ignoreNextClose = false;\r\n return;\r\n }\r\n if (this.closeOnClick) {\r\n this._element.style.pointerEvents = \"none\";\r\n setTimeout(function () {\r\n _this._element.style.pointerEvents = \"auto\";\r\n }, 100);\r\n }\r\n if (this._currentSelection) {\r\n this.setBlur(this._currentSelection);\r\n this._currentSelection = undefined;\r\n }\r\n if (this._element) {\r\n var items = this._element.getElementsByClassName(\"active\");\r\n for (var len = items.length, i = len - 1; i >= 0; i--) {\r\n if (items[i]) {\r\n $dom.removeClass(items[i], \"active\");\r\n }\r\n }\r\n }\r\n this.events.dispatchImmediately(\"closed\", {\r\n type: \"closed\",\r\n target: this\r\n });\r\n };\r\n /**\r\n * Selects a branch in the menu.\r\n *\r\n * Handles closing of currently open branch.\r\n *\r\n * @ignore Exclude from docs\r\n * @param branch Branch to select\r\n */\r\n ExportMenu.prototype.selectBranch = function (branch) {\r\n var _this = this;\r\n if (this.isDisposed()) {\r\n return;\r\n }\r\n // Cancel previous closure\r\n if (branch.closeTimeout) {\r\n this.removeDispose(branch.closeTimeout);\r\n branch.closeTimeout = undefined;\r\n }\r\n // Add active class\r\n $dom.addClass(branch.element, \"active\");\r\n // Set expanded\r\n if (branch.submenuElement) {\r\n branch.submenuElement.setAttribute(\"aria-expanded\", \"true\");\r\n }\r\n // Remove current selection\r\n if (this._currentSelection && this._currentSelection !== branch && this._currentSelection.ascendants) {\r\n $iter.each($iter.concat($iter.fromArray([this._currentSelection]), this._currentSelection.ascendants.iterator()), function (ascendant) {\r\n if (!branch.ascendants.contains(ascendant) && branch !== ascendant) {\r\n _this.unselectBranch(ascendant, true);\r\n }\r\n });\r\n }\r\n // Select and/or cancel timeout for current ascendants\r\n $iter.each(branch.ascendants.iterator(), function (ascendant) {\r\n if (ascendant.closeTimeout) {\r\n _this.removeDispose(ascendant.closeTimeout);\r\n ascendant.closeTimeout = undefined;\r\n }\r\n $dom.addClass(ascendant.element, \"active\");\r\n });\r\n // Log current selection\r\n this._currentSelection = branch;\r\n // Invoke event\r\n if (this.events.isEnabled(\"branchselected\")) {\r\n var event_5 = {\r\n type: \"branchselected\",\r\n target: this,\r\n branch: branch\r\n };\r\n this.events.dispatchImmediately(\"branchselected\", event_5);\r\n }\r\n };\r\n /**\r\n * Unselects a branch. Also selects a branch one level up if necessary.\r\n *\r\n * @ignore Exclude from docs\r\n * @param branch Branch to unselect\r\n * @param simple If `true`, only the branch will be unselected without selecting parent branch\r\n */\r\n ExportMenu.prototype.unselectBranch = function (branch, simple) {\r\n if (this.isDisposed()) {\r\n return;\r\n }\r\n // Remove active class\r\n $dom.removeClass(branch.element, \"active\");\r\n // Set expanded\r\n if (branch.submenuElement) {\r\n branch.submenuElement.removeAttribute(\"aria-expanded\");\r\n }\r\n // Remove current selection\r\n if (this._currentSelection == branch) {\r\n this._currentSelection = undefined;\r\n }\r\n // Invoke event\r\n if (this.events.isEnabled(\"branchunselected\")) {\r\n var event_6 = {\r\n type: \"branchunselected\",\r\n target: this,\r\n branch: branch\r\n };\r\n this.events.dispatchImmediately(\"branchunselected\", event_6);\r\n }\r\n };\r\n /**\r\n * Delay unselection of a branch. This can still be cancelled in some other\r\n * place if the branch or its children regain focus.\r\n *\r\n * @ignore Exclude from docs\r\n * @param branch Branch to unselect\r\n * @param simple If `true`, only the branch will be unselected without selecting parent branch\r\n */\r\n ExportMenu.prototype.delayUnselectBranch = function (branch, simple) {\r\n var _this = this;\r\n if (this.isDisposed()) {\r\n return;\r\n }\r\n // Schedule branch unselection\r\n if (branch.closeTimeout) {\r\n this.removeDispose(branch.closeTimeout);\r\n branch.closeTimeout = undefined;\r\n }\r\n branch.closeTimeout = this.setTimeout(function () {\r\n _this.unselectBranch(branch, simple);\r\n }, this.closeDelay);\r\n // Schedule unselection of all ascendants\r\n // In case focus went away from the export menu altogether, this will ensure\r\n // that all items will be closed.\r\n // In case we're jumping to other menu item, those delayed unselections will\r\n // be cancelled by `selectBranch`\r\n if (simple !== true && branch.ascendants) {\r\n $iter.each(branch.ascendants.iterator(), function (ascendant) {\r\n _this.delayUnselectBranch(ascendant, true);\r\n });\r\n }\r\n };\r\n /**\r\n * Navigates the menu based on which direction kayboard key was pressed.\r\n *\r\n * @ignore Exclude from docs\r\n * @param key A key that was pressed\r\n */\r\n ExportMenu.prototype.moveSelection = function (key) {\r\n if (this.isDisposed()) {\r\n return;\r\n }\r\n // Check if there's a current selection\r\n if (!this._currentSelection) {\r\n return;\r\n }\r\n var newSelection;\r\n if (key == \"up\") {\r\n // Try moving up in current menu list, or to the last item if already\r\n // at the top\r\n newSelection = this.getPrevSibling(this._currentSelection);\r\n }\r\n else if (key == \"down\") {\r\n // Try moving down in current menu list, or to the top item if already\r\n // at the bottom\r\n newSelection = this.getNextSibling(this._currentSelection);\r\n }\r\n else if ((key == \"left\" && this.align == \"right\") || (key == \"right\" && this.align == \"left\")) {\r\n var menu = this.getSubMenu(this._currentSelection);\r\n // Go one level-deeper\r\n if (menu != null) {\r\n newSelection = menu[0];\r\n }\r\n }\r\n else if ((key == \"right\" && this.align == \"right\") || (key == \"left\" && this.align == \"left\")) {\r\n // Go one level-deeper\r\n newSelection = this.getParentItem(this._currentSelection);\r\n }\r\n if (newSelection && newSelection !== this._currentSelection) {\r\n this.selectBranch(newSelection);\r\n this.setFocus(newSelection);\r\n this._currentSelection = newSelection;\r\n }\r\n };\r\n /**\r\n * Returns all siblings of a menu item, including this same menu item.\r\n *\r\n * @ignore Exclude from docs\r\n * @param branch Menu item\r\n * @return List of sibling menu items\r\n */\r\n ExportMenu.prototype.getSiblings = function (branch) {\r\n var parent = this.getParentItem(branch);\r\n if (parent && parent.menu) {\r\n return parent.menu;\r\n }\r\n else {\r\n return [];\r\n }\r\n };\r\n /**\r\n * Returns menu items parent item.\r\n *\r\n * @ignore Exclude from docs\r\n * @param branch Menu item\r\n * @return Parent menu item\r\n */\r\n ExportMenu.prototype.getParentItem = function (branch) {\r\n if (branch.ascendants && branch.ascendants.length) {\r\n return branch.ascendants.getIndex(branch.ascendants.length - 1);\r\n }\r\n else {\r\n return undefined;\r\n }\r\n };\r\n /**\r\n * Returns next sibling in the same menu branch. If there is no next sibling,\r\n * the first one is returned. If there is just one item, that item is\r\n * returned. Unsupported menu items are skipped.\r\n *\r\n * @ignore Exclude from docs\r\n * @param branch Menu item to search siblings for\r\n * @return Menu item\r\n */\r\n ExportMenu.prototype.getNextSibling = function (branch) {\r\n var siblings = this.getSiblings(branch);\r\n if (siblings.length > 1) {\r\n var next = siblings.indexOf(branch) + 1;\r\n next = siblings.length == next ? 0 : next;\r\n return siblings[next].unsupported ? this.getNextSibling(siblings[next]) : siblings[next];\r\n }\r\n else {\r\n return branch;\r\n }\r\n };\r\n /**\r\n * Returns previous sibling in the same menu branch. If there is no next\r\n * sibling, the first one is returned. If there is just one item, that item is\r\n * returned. Unsupported menu items are skipped.\r\n *\r\n * @ignore Exclude from docs\r\n * @param branch Menu item to search siblings for\r\n * @return Menu item\r\n */\r\n ExportMenu.prototype.getPrevSibling = function (branch) {\r\n var siblings = this.getSiblings(branch);\r\n if (siblings.length > 1) {\r\n var prev = siblings.indexOf(branch) - 1;\r\n prev = prev == -1 ? siblings.length - 1 : prev;\r\n return siblings[prev].unsupported ? this.getPrevSibling(siblings[prev]) : siblings[prev];\r\n }\r\n else {\r\n return branch;\r\n }\r\n };\r\n /**\r\n * Attempts to set focus on particular menu element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param branch Menu item\r\n */\r\n ExportMenu.prototype.setFocus = function (branch) {\r\n if (branch.interactions) {\r\n try {\r\n branch.interactions.element.focus();\r\n }\r\n catch (e) {\r\n // nothing\r\n }\r\n }\r\n };\r\n /**\r\n * Attempts to remove focus from the menu element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param branch Menu item\r\n */\r\n ExportMenu.prototype.setBlur = function (branch) {\r\n if (branch.interactions) {\r\n try {\r\n branch.interactions.element.blur();\r\n }\r\n catch (e) {\r\n // nothing\r\n }\r\n }\r\n };\r\n /**\r\n * Hides the whole branch of menu.\r\n *\r\n * @param branch branch\r\n */\r\n ExportMenu.prototype.hideBranch = function (branch) {\r\n branch.element.style.display = \"none\";\r\n };\r\n /**\r\n * Show the branch of menu.\r\n *\r\n * @param branch branch\r\n */\r\n ExportMenu.prototype.showBranch = function (branch) {\r\n branch.element.style.display = \"\";\r\n };\r\n Object.defineProperty(ExportMenu.prototype, \"element\", {\r\n /**\r\n * The main element o fthe menu - usually `
      `.\r\n *\r\n * @since 4.10.6\r\n * @return Menu element\r\n */\r\n get: function () {\r\n return this._element;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return ExportMenu;\r\n}(Validatable));\r\nexport { ExportMenu };\r\n//# sourceMappingURL=ExportMenu.js.map","/**\r\n * A collection of network-related functions\r\n */\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport * as $type from \"./Type\";\r\n/**\r\n * Loads an external file via its URL.\r\n *\r\n * Please note that this is an asynchronous function.\r\n *\r\n * It will not return the result, but rather a `Promise`.\r\n *\r\n * You can use the `await` notion, or `then()`.\r\n *\r\n * ```TypeScript\r\n * // Using await\r\n * let response = await Net.load( \"http://www.my.com/data.json\" );\r\n * console.log( response.response );\r\n *\r\n * // Using then()\r\n * Net.load( \"http://www.my.com/data.json\" ).then( ( response ) => {\r\n * console.log( response.response );\r\n * } );\r\n * ```\r\n * ```JavaScript\r\n * // Using then()\r\n * Net.load( \"http://www.my.com/data.json\" ).then( function( response ) {\r\n * console.log( response.response );\r\n * } );\r\n * ```\r\n *\r\n * @async\r\n * @param url URL for the file to load\r\n * @param target A target element that is requesting the net load\r\n * @param options Request options\r\n * @return Result (Promise)\r\n */\r\nexport function load(url, target, options) {\r\n return new Promise(function (success, error) {\r\n // Is return type Blob?\r\n var isBlob = $type.hasValue(options) && options.responseType == \"blob\";\r\n // Create request and set up handlers\r\n var xhr = new XMLHttpRequest();\r\n xhr.onload = function () {\r\n if (xhr.status === 200) {\r\n var response = void 0;\r\n var blob_1;\r\n if (isBlob) {\r\n blob_1 = xhr.response;\r\n readBlob(blob_1).then(function (response) {\r\n var output = {\r\n xhr: xhr,\r\n error: false,\r\n response: response,\r\n blob: blob_1,\r\n type: xhr.getResponseHeader(\"Content-Type\"),\r\n target: target\r\n };\r\n success(output);\r\n });\r\n return;\r\n }\r\n else {\r\n response = xhr.responseText || xhr.response;\r\n }\r\n var output = {\r\n xhr: xhr,\r\n error: false,\r\n response: response,\r\n blob: blob_1,\r\n type: xhr.getResponseHeader(\"Content-Type\"),\r\n target: target\r\n };\r\n success(output);\r\n }\r\n else {\r\n error({\r\n xhr: xhr,\r\n error: true,\r\n type: xhr.getResponseHeader(\"Content-Type\"),\r\n target: target\r\n });\r\n }\r\n };\r\n xhr.onerror = function () {\r\n error({\r\n xhr: xhr,\r\n error: true,\r\n type: xhr.getResponseHeader(\"Content-Type\"),\r\n target: target\r\n });\r\n };\r\n // Open request\r\n xhr.open(\"GET\", url, true);\r\n if (options && options.withCredentials) {\r\n xhr.withCredentials = true;\r\n }\r\n // Process options\r\n if ($type.hasValue(options)) {\r\n if ($type.hasValue(options.requestHeaders)) {\r\n for (var i = 0; i < options.requestHeaders.length; i++) {\r\n var header = options.requestHeaders[i];\r\n xhr.setRequestHeader(header.key, header.value);\r\n }\r\n }\r\n if ($type.hasValue(options.responseType)) {\r\n xhr.responseType = options.responseType;\r\n }\r\n }\r\n // Send request\r\n xhr.send();\r\n });\r\n}\r\n/**\r\n * Returns textual representation of a Blob object.\r\n *\r\n * @param blob Target blob\r\n * @return Text promise\r\n */\r\nexport function readBlob(blob) {\r\n return new Promise(function (success, error) {\r\n var reader = new FileReader();\r\n reader.onload = function (event) {\r\n success(reader.result);\r\n };\r\n reader.onerror = function (e) {\r\n error(e);\r\n };\r\n reader.readAsText(blob);\r\n });\r\n}\r\n//# sourceMappingURL=Net.js.map","/**\r\n * This is the main class that encapsulates every object on the chart.\r\n *\r\n * If it's an element that is to be displayed on the screen at some point, its\r\n * class must extend [[Sprite]] class.\r\n */\r\nimport { __extends, __values } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { SpriteState } from \"./SpriteState\";\r\nimport { SpriteEventDispatcher } from \"./SpriteEvents\";\r\nexport { SpriteEventDispatcher };\r\nimport { BaseObjectEvents } from \"./Base\";\r\nimport { Adapter, globalAdapter } from \"./utils/Adapter\";\r\nimport { Dictionary, DictionaryTemplate, DictionaryDisposer } from \"./utils/Dictionary\";\r\nimport { ListDisposer, List } from \"./utils/List\";\r\nimport { MultiDisposer, Disposer, MutableValueDisposer } from \"./utils/Disposer\";\r\nimport { Animation, AnimationDisposer } from \"./utils/Animation\";\r\nimport { getGhostPaper } from \"./rendering/Paper\";\r\nimport { Container } from \"./Container\";\r\nimport { Pattern } from \"./rendering/fills/Pattern\";\r\nimport { LinearGradient } from \"./rendering/fills/LinearGradient\";\r\nimport { RadialGradient } from \"./rendering/fills/RadialGradient\";\r\nimport { Color, color, toColor } from \"./utils/Color\";\r\nimport { getInteraction } from \"./interaction/Interaction\";\r\nimport { MouseCursorStyle } from \"./interaction/Mouse\";\r\nimport { options } from \"./Options\";\r\nimport { registry } from \"./Registry\";\r\nimport { NumberFormatter } from \"./formatters/NumberFormatter\";\r\nimport { DateFormatter } from \"./formatters/DateFormatter\";\r\nimport { DurationFormatter } from \"./formatters/DurationFormatter\";\r\nimport { getTextFormatter } from \"./formatters/TextFormatter\";\r\nimport { Language } from \"./utils/Language\";\r\nimport { Export } from \"./export/Export\";\r\nimport * as $utils from \"./utils/Utils\";\r\nimport * as $math from \"./utils/Math\";\r\nimport * as $strings from \"./utils/Strings\";\r\nimport * as $array from \"./utils/Array\";\r\nimport * as $object from \"./utils/Object\";\r\nimport * as $type from \"./utils/Type\";\r\nimport * as $iter from \"./utils/Iterator\";\r\nimport { system } from \"./System\";\r\nimport { Percent, percent } from \"./utils/Percent\";\r\n/**\r\n * Defines list ofvisual properties\r\n */\r\nexport var visualProperties = [\"fill\", \"fillOpacity\", \"stroke\", \"strokeOpacity\", \"strokeWidth\", \"strokeDasharray\", \"strokeDashoffset\", \"strokeLinecap\", \"strokeLinejoin\"]; // do not add opacity here, as it is used for showing/hiding\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Sprite represents any displayable element.\r\n *\r\n * This is the main class that encapsulates every object on the chart.\r\n *\r\n * If it's an element that is to be displayed on the screen at some point, its\r\n * class must extend [[Sprite]] class.\r\n *\r\n * [[Sprite]] class represents the a hierarchical structure. Every object that\r\n * extends [[Sprite]] can have children, that would inherit their properties,\r\n * such as language, formatters, etc.\r\n *\r\n * @see {@link SpriteState}\r\n * @see {@link ISpriteEvents} for a list of available events\r\n * @see {@link ISpriteAdapters} for a list of available Adapters\r\n *\r\n * @todo Review child elements that need to go into `_disposers`\r\n * @important\r\n */\r\nvar Sprite = /** @class */ (function (_super) {\r\n __extends(Sprite, _super);\r\n /**\r\n * Constructor:\r\n * * Creates initial node\r\n * * Sets default properties\r\n * * Creates required default states\r\n * * Inits accessibility\r\n */\r\n function Sprite() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * Holds values for Sprite's properties.\r\n */\r\n _this.properties = {};\r\n /**\r\n * @ignore\r\n */\r\n _this._eventDispatcher = new SpriteEventDispatcher(_this);\r\n /**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n _this._bindings = {};\r\n /**\r\n * Holds indicator if this Sprite is a \"template\" to be used for creating\r\n * other Sprites from and should not be treated as full-fledged element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._isTemplate = false;\r\n _this._isPath = false;\r\n /**\r\n * Holds indicator whether this sprite was already initialized.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._inited = false;\r\n /**\r\n * Holds indicator whether this sprite was already initialized and ready.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._ready = false;\r\n /**\r\n * If `sprite.hide()` is called and we have \"hidden\" state and\r\n * `transitionDuration > 0`, we set `isHiding` flag to `true` in order to\r\n * avoid restarting animations in case `hide()` method is called multiple\r\n * times.\r\n */\r\n _this.isHiding = false;\r\n /**\r\n * If `sprite.hide()` is called, we set isHidden to true when sprite is hidden.\r\n * This was added becaus hidden state might have visibility set to true and so\r\n * there would not be possible to find out if a sprite is technically hidden or not.\r\n */\r\n _this._isHidden = false;\r\n /**\r\n * This property indicates if Sprite is currently being revealed from hidden\r\n * state. This is used to prevent multiple calls to `sprite.show()` to\r\n * restart reveal animation. (if enabled)\r\n */\r\n _this.isShowing = false;\r\n /**\r\n * Indicates if this element is a standalone instance. A \"standalone\r\n * instance\" means this is a autonomous object which maintains its own\r\n * set of controls like Preloader, Export, etc.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this.isStandaloneInstance = false;\r\n /**\r\n * Indicates if togglable Sprite is currently active (toggled on).\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._isActive = false;\r\n /**\r\n * A Sprite element to use as a mask for this Sprite.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._mask = new MutableValueDisposer();\r\n /**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n _this._positionPrecision = 3;\r\n /**\r\n * An instance of [[Language]].\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._language = new MutableValueDisposer();\r\n /**\r\n * Holds [[Export]] object.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._exporting = new MutableValueDisposer();\r\n /**\r\n * Should this Sprite be included when exporting?\r\n */\r\n _this._exportable = true;\r\n /**\r\n * Defines bounding box (square) for this element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._bbox = { x: 0, y: 0, width: 0, height: 0 };\r\n /**\r\n * Indicates if this element is invalid and should be re-validated (redrawn).\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this.invalid = false;\r\n /**\r\n * Indicates if this elements position is invalid and should be repositioned\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this.positionInvalid = false;\r\n /**\r\n * A collection of key/value pairs that can be used to bind specific Sprite\r\n * properties to [[DataItem]].\r\n *\r\n * For example: `fill` property can be bound to `myCustomColor` field in\r\n * DataItem. The Sprite will automatically get the value for `fill` from its\r\n * DataItem.\r\n *\r\n * Can be set for each [[SpriteState]] individually to override default\r\n * bindings.\r\n *\r\n * @see {@link SpriteState}\r\n */\r\n _this.propertyFields = {};\r\n /**\r\n * Specifies if property changes on this object should be propagated to the\r\n * objects cloned from this object.\r\n *\r\n * This setting affects property changes *after* cloning, since at the moment\r\n * of cloning all of properties from source object are copied to the clone\r\n * anyway.\r\n *\r\n * @default false\r\n */\r\n _this.applyOnClones = false;\r\n // unrotated unscaled\r\n _this._measuredWidthSelf = 0;\r\n _this._measuredHeightSelf = 0;\r\n // read only, sprite extreme coordinates\r\n /**\r\n * @ignore\r\n */\r\n _this.maxLeft = 0;\r\n /**\r\n * @ignore\r\n */\r\n _this.maxRight = 0;\r\n /**\r\n * @ignore\r\n */\r\n _this.maxTop = 0;\r\n /**\r\n * @ignore\r\n */\r\n _this.maxBottom = 0;\r\n // not rotated and not scaled\r\n /**\r\n * @ignore\r\n */\r\n _this.maxLeftSelf = 0;\r\n /**\r\n * @ignore\r\n */\r\n _this.maxRightSelf = 0;\r\n /**\r\n * @ignore\r\n */\r\n _this.maxTopSelf = 0;\r\n /**\r\n * @ignore\r\n */\r\n _this.maxBottomSelf = 0;\r\n _this._isDragged = false;\r\n _this._isResized = false;\r\n /**\r\n * @deprecated Moved to [[SpriteProperties]]\r\n */\r\n _this._disabled = false;\r\n _this._internalDisabled = false;\r\n _this._updateDisabled = false;\r\n _this._internalDefaultsApplied = false;\r\n /**\r\n * Time in milliseconds after which rollout event happens when user rolls-out of the sprite. This helps to avoid flickering in some cases.\r\n */\r\n _this.rollOutDelay = 0;\r\n /**\r\n * This flag is set to `true` for the initial sprite you create and place\r\n * to the div so that we could clear all additional\r\n * sprites/containers when this sprite is disposed.\r\n *\r\n * @ignore\r\n */\r\n _this.isBaseSprite = false;\r\n /**\r\n * Indicates whether this sprite should be cloned when cloning its parent\r\n * container. We set this to `false` in those cases when a sprite is created\r\n * by the class, so that when cloning a duplicate sprite would not appear.\r\n */\r\n _this.shouldClone = true;\r\n /**\r\n * A read-only flag which indicates if a sprite has completed its initial\r\n * animation (if `showOnInit = true`).\r\n *\r\n * In case `showOnInit = false`, `appeared` is set to `true` on init.\r\n *\r\n * @readonly\r\n */\r\n _this.appeared = false;\r\n /**\r\n * [ex description]\r\n *\r\n * @todo Description\r\n * @ignore\r\n */\r\n _this.ex = 0;\r\n /**\r\n * [ey description]\r\n *\r\n * @todo Description\r\n * @ignore\r\n */\r\n _this.ey = 0;\r\n /**\r\n * Indicates if the sprite can be moved around when resizing it with two fingers (will only work if draggable = false)\r\n * @ignore\r\n */\r\n _this.dragWhileResize = false;\r\n /**\r\n * @ignore\r\n */\r\n _this.measureFailed = false;\r\n /**\r\n * If this flag is set to true, calling show() will not reveal the sprite.\r\n *\r\n * @ignore\r\n */\r\n _this.preventShow = false;\r\n /**\r\n * When cloning a sprite, if the template has it's own tooltip assigned, this tooltip is also cloned by default.\r\n * This is not good for cpu and sometimes you might only need one single tooltip for all clones. Set this to false in order not to clone tooltip.\r\n */\r\n _this.cloneTooltip = true;\r\n _this.className = \"Sprite\";\r\n _this._disposers.push(_this._eventDispatcher);\r\n // Generate a unique ID\r\n $utils.used(_this.uid);\r\n // Create SVG group to hold everything in\r\n _this.group = _this.paper.addGroup(\"g\");\r\n // Set defaults\r\n // it is better to set defauls like this in order to save invaliation calls and events\r\n _this.setPropertyValue(\"scale\", 1);\r\n _this.setPropertyValue(\"rotation\", 0);\r\n _this.setPropertyValue(\"align\", \"none\");\r\n _this.setPropertyValue(\"valign\", \"none\");\r\n _this.setPropertyValue(\"pixelPerfect\", false);\r\n _this.setPropertyValue(\"visible\", true);\r\n _this.setPropertyValue(\"tooltipPosition\", \"fixed\");\r\n _this.setPropertyValue(\"verticalCenter\", \"none\");\r\n _this.setPropertyValue(\"horizontalCenter\", \"none\");\r\n _this.setPropertyValue(\"tooltipX\", percent(50));\r\n _this.setPropertyValue(\"tooltipX\", percent(50));\r\n _this.setPropertyValue(\"marginTop\", 0);\r\n _this.setPropertyValue(\"marginBottom\", 0);\r\n _this.setPropertyValue(\"marginLeft\", 0);\r\n _this.setPropertyValue(\"marginRight\", 0);\r\n _this.setPropertyValue(\"dx\", 0);\r\n _this.setPropertyValue(\"dy\", 0);\r\n _this.setPropertyValue(\"paddingTop\", 0);\r\n _this.setPropertyValue(\"paddingBottom\", 0);\r\n _this.setPropertyValue(\"paddingRight\", 0);\r\n _this.setPropertyValue(\"paddingLeft\", 0);\r\n _this.setPropertyValue(\"togglable\", false);\r\n _this.setPropertyValue(\"hidden\", false);\r\n _this.setPropertyValue(\"urlTarget\", \"_self\");\r\n _this.setPropertyValue(\"alwaysShowTooltip\", false);\r\n _this.setPropertyValue(\"showTooltipOn\", \"hover\");\r\n _this._prevMeasuredWidth = 0;\r\n _this._prevMeasuredHeight = 0;\r\n _this._measuredWidth = 0;\r\n _this._measuredHeight = 0;\r\n _this._isMeasured = true;\r\n // Invalidate the Sprite so that renderer knows it needs to be drawn\r\n _this.invalidate();\r\n //this.states.create(\"default\").properties.opacity = 1;\r\n // Apply the theme\r\n _this.applyTheme();\r\n //this._disposers.push(this._clickable);\r\n // Decorate adapter with events so that we can apply its settings whenever\r\n // it is modified\r\n // @todo Think what to do here. We can't just apply the adapter value to\r\n // property since not all of those are for properties. Commented out for\r\n // now.\r\n /*this.adapter.events.on(\"inserted\", (ev: any) => {\r\n (this)[ev.newValue.key] = (this)[ev.newValue.key];\r\n });\r\n this.adapter.events.on(\"removed\", (ev: any) => {\r\n (this)[ev.newValue.key] = (this)[ev.newValue.key];\r\n });*/\r\n // Add disposable dependencies to `_disposers` so they are automatically\r\n // disposed of when this object is disposed\r\n _this._disposers.push(_this.events);\r\n _this._disposers.push(_this.group);\r\n _this._disposers.push(_this._mask);\r\n _this._disposers.push(_this._language);\r\n _this._disposers.push(_this._exporting);\r\n //this._disposers.push(this._parent);\r\n //this._disposers.push(this._modal);\r\n _this._disposers.push(new Disposer(function () {\r\n $object.each(_this._bindings, function (key, value) {\r\n value.dispose();\r\n });\r\n }));\r\n _this.setPropertyValue(\"interactionsEnabled\", true);\r\n return _this;\r\n }\r\n Object.defineProperty(Sprite.prototype, \"events\", {\r\n /**\r\n * Event dispatcher.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/event-listeners/} for more info about Events\r\n */\r\n get: function () {\r\n return this._eventDispatcher;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"adapter\", {\r\n /**\r\n * Holds Adapter.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/adapters/} for more info about Adapters\r\n */\r\n get: function () {\r\n if (!this._adapterO) {\r\n this._adapterO = new Adapter(this);\r\n }\r\n return this._adapterO;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * ==========================================================================\r\n * ELEMENT VALIDATION, INIT, AND DRAWING STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Applies properties from all assigned themes.\r\n *\r\n * We do this here so that we can apply class names as well.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.applyTheme = function () {\r\n _super.prototype.applyTheme.call(this);\r\n if (options.autoSetClassName) {\r\n this.setClassName();\r\n }\r\n };\r\n /**\r\n * Returns theme(s) used by this object either set explicitly on this\r\n * element, inherited from parent, or inherited from [[System]].\r\n *\r\n * @return An array of theme references\r\n */\r\n Sprite.prototype.getCurrentThemes = function () {\r\n var themes = this._themes;\r\n if (themes) {\r\n return themes;\r\n }\r\n else {\r\n var parent_1 = this._parent;\r\n if (parent_1) {\r\n return parent_1.getCurrentThemes();\r\n }\r\n else {\r\n return registry.themes;\r\n }\r\n }\r\n };\r\n /**\r\n * Called just before element's validation, this function allows setting\r\n * defaults.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.applyInternalDefaults = function () {\r\n // Nothing here, but extending classes might override this function\r\n // so that they can set their defaults\r\n this._internalDefaultsApplied = true;\r\n };\r\n /**\r\n * Invalidates element.\r\n *\r\n * Object will be redrawn during the next update cycle.\r\n *\r\n * Please note that in most cases elements will auto-invalidate when needed. If\r\n * everything works, DO NOT use this method. Use it only if some changes do\r\n * not take otherwise.\r\n */\r\n Sprite.prototype.invalidate = function () {\r\n if (this.disabled || this._isTemplate || this.__disabled) {\r\n return;\r\n }\r\n // We no longer reset this on each invalidate, so that they are applied\r\n // only once, and do not overwrite user-defined settings\r\n //this._internalDefaultsApplied = false;\r\n if (!this.invalid) {\r\n this.invalid = true;\r\n registry.addToInvalidSprites(this);\r\n system.requestFrame();\r\n }\r\n };\r\n /**\r\n * Validates element:\r\n * * Triggers events\r\n * * Redraws the element\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.validate = function () {\r\n this.dispatchImmediately(\"beforevalidated\");\r\n // prevents from drawing if topparent is 0x0\r\n /*\r\n let topParent = this.topParent;\r\n\r\n if (topParent) {\r\n if (!topParent.maxWidth || !topParent.maxHeight) {\r\n this._disposers.push(topParent.events.once(\"maxsizechanged\", this.invalidate, this));\r\n }\r\n }*/\r\n // Set internal defaults\r\n if (!this._internalDefaultsApplied) {\r\n this.applyInternalDefaults();\r\n }\r\n this.beforeDraw();\r\n this.draw();\r\n this.invalid = false;\r\n registry.removeFromInvalidSprites(this);\r\n this.afterDraw();\r\n };\r\n /**\r\n * Invalidates element's position.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.invalidatePosition = function () {\r\n if (this.disabled || this._isTemplate) {\r\n return;\r\n }\r\n if (!this.positionInvalid) {\r\n this.positionInvalid = true;\r\n registry.addToInvalidPositions(this);\r\n system.requestFrame();\r\n }\r\n };\r\n /**\r\n * Transforms the element.\r\n *\r\n * @todo Description (review)\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.validatePosition = function () {\r\n var pixelX = this.pixelX;\r\n var pixelY = this.pixelY;\r\n var dx = this.dx;\r\n var dy = this.dy;\r\n var x = pixelX + dx;\r\n var y = pixelY + dy;\r\n if (this._updateDisabled) {\r\n if (this._internalDisabled) {\r\n this.group.attr({ \"display\": \"none\" });\r\n }\r\n else {\r\n if (!this.disabled) {\r\n this.removeSVGAttribute(\"display\");\r\n }\r\n }\r\n this._updateDisabled = false;\r\n }\r\n var sizeChanged = this.measure();\r\n //if (!this.invalid) {\r\n var prevGroupTransform = this.group.transformString;\r\n this.group.moveTo({ x: x, y: y });\r\n this.group.rotation = this.rotation;\r\n if (this.nonScaling) {\r\n this.group.scale = this.scale / this.globalScale;\r\n }\r\n else {\r\n this.group.scale = this.scale;\r\n }\r\n if (prevGroupTransform != this.group.transformString || sizeChanged) {\r\n // not yet sure, this is to avoid many transforms=>container layout invalidation on initial buid\r\n if (prevGroupTransform == null) {\r\n this.dispatch(\"transformed\");\r\n }\r\n else {\r\n this.dispatchImmediately(\"transformed\");\r\n }\r\n // TODO clear existing positionchanged dispatches ?\r\n this.dispatch(\"positionchanged\");\r\n if (this.showTooltipOn == \"hit\" || this.showTooltipOn == \"always\") {\r\n this.updateTooltipPosition();\r\n }\r\n }\r\n //}\r\n // it might happen that x and y changed again, so we only remove if they didn't\r\n if (pixelX + dx == x && pixelY + dy == y) {\r\n registry.removeFromInvalidPositions(this);\r\n this.positionInvalid = false;\r\n }\r\n var maskRectangle = this._maskRectangle;\r\n // todo: verify this\r\n if (maskRectangle) {\r\n this._clipElement.moveTo({ x: maskRectangle.x - pixelX, y: maskRectangle.y - pixelY });\r\n }\r\n };\r\n /**\r\n * A placeholder method that is called **before** element begins to be drawn.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.beforeDraw = function () {\r\n };\r\n /**\r\n * A placeholder method that draws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.draw = function () {\r\n };\r\n /**\r\n * A placeholder method that is called **after** element finishes drawing\r\n * itself.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.afterDraw = function () {\r\n var e_1, _a;\r\n if (this.isMeasured || this.horizontalCenter !== \"none\" || this.verticalCenter !== \"none\") {\r\n this.measureElement();\r\n }\r\n //this.applyMask();\r\n if (!this._inited) {\r\n if (this._adapterO) {\r\n try {\r\n // used to be applySVGAttrbutes here, this is more efficient\r\n for (var _b = __values(this._adapterO.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var key = _c.value;\r\n switch (key) {\r\n case \"mask\":\r\n case \"fill\":\r\n case \"opacity\":\r\n case \"fillOpacity\":\r\n case \"stroke\":\r\n case \"strokeOpacity\":\r\n case \"strokeWidth\":\r\n case \"shapeRendering\":\r\n case \"strokeDasharray\":\r\n case \"strokeDashoffset\":\r\n case \"strokeLinecap\":\r\n case \"strokeLinejoin\":\r\n case \"textDecoration\":\r\n case \"fontSize\":\r\n case \"fontFamily\":\r\n case \"fontWeight\":\r\n //case \"focusable\":\r\n //case \"tabindex\":\r\n //case \"role\":\r\n this[key] = this[key];\r\n break;\r\n }\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n }\r\n this.applyFilters();\r\n this.visible = this.visible;\r\n this.interactionsEnabled = this.getPropertyValue(\"interactionsEnabled\"); // can't use .interactionsEnabled as it get's parent's\r\n this._inited = true;\r\n if (!this.showOnInit) {\r\n this.appeared = true;\r\n }\r\n if (this.hidden) {\r\n this.hide(0);\r\n }\r\n this.applyMask();\r\n this.dispatch(\"validated\");\r\n this.dispatch(\"inited\");\r\n this.dispatchReady();\r\n }\r\n else {\r\n this.dispatch(\"validated\");\r\n }\r\n if (this.showTooltipOn == \"always\") {\r\n if (this.visible && !this.disabled && !this.__disabled) {\r\n this.showTooltip();\r\n }\r\n else {\r\n this.hideTooltip(0);\r\n }\r\n }\r\n };\r\n /**\r\n * Dispatches `\"ready\"` event. Sprite dispatches it right after `\"inited\"` event.\r\n *\r\n * @ignore\r\n */\r\n Sprite.prototype.dispatchReady = function () {\r\n if (!this.isReady()) {\r\n this._ready = true;\r\n this.dispatch(\"ready\");\r\n }\r\n };\r\n /**\r\n * Triggers a re-initialization of this element.\r\n *\r\n * Will result in complete redrawing of the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.reinit = function () {\r\n this._inited = false;\r\n this.setState(this.defaultState);\r\n this.invalidate();\r\n };\r\n /**\r\n * Handles the situation where parent element is resized.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.handleGlobalScale = function () {\r\n this.dispatch(\"globalscalechanged\");\r\n if (this.nonScalingStroke) {\r\n this.strokeWidth = this.strokeWidth;\r\n }\r\n if (this.nonScaling) {\r\n this.validatePosition();\r\n }\r\n this.updateFilterScale();\r\n };\r\n /**\r\n * Updates filter properties which might depend on scale\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.updateFilterScale = function () {\r\n var _this = this;\r\n $iter.each(this.filters.iterator(), function (filter) {\r\n filter.scale = _this.globalScale;\r\n });\r\n };\r\n /**\r\n * Removes itself from system's invalid lists.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.removeFromInvalids = function () {\r\n registry.removeFromInvalidSprites(this);\r\n registry.removeFromInvalidPositions(this);\r\n };\r\n /**\r\n * Copies all parameters from another [[Sprite]].\r\n *\r\n * @param source Source Sprite\r\n */\r\n Sprite.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n _super.prototype.copyFrom.call(this, source);\r\n this.isMeasured = source.isMeasured;\r\n this.states.copyFrom(source.states);\r\n if (source.filters.length > 0) {\r\n source.filters.each(function (filter) {\r\n _this.filters.push(filter.clone());\r\n });\r\n }\r\n if (source._adapterO) {\r\n this.adapter.copyFrom(source._adapterO);\r\n }\r\n //helps to avoid calling getter which creates instance\r\n if (source[\"_interaction\"]) {\r\n this.interactions.copyFrom(source.interactions);\r\n }\r\n if (source[\"_plugins\"]) {\r\n this.plugins.copyFrom(source.plugins);\r\n }\r\n this.configField = source.configField;\r\n this.applyOnClones = source.applyOnClones;\r\n // this.numberFormatter = source.numberFormatter; // todo: this creates loose number formatter and copies it to all clones. somehow we need to know if source had numberFormatter explicitly created and not just because a getter was called.\r\n //this.mask = source.mask; need to think about this, generally this causes a lot of problems\r\n this.disabled = source.disabled;\r\n this.virtualParent = source.virtualParent;\r\n this.exportable = source.exportable;\r\n //@todo: create tooltip if it's on source but not on this?\r\n //const tooltip = this._tooltip;\r\n //if (tooltip) {\r\n //\ttooltip.copyFrom(source.tooltip);\r\n //}\r\n if (source._tooltip) {\r\n if (this._tooltip) {\r\n this._tooltip.copyFrom(source.tooltip);\r\n }\r\n else {\r\n if (source.cloneTooltip) {\r\n this.tooltip = source.tooltip.clone();\r\n }\r\n else {\r\n this._tooltip = source.tooltip;\r\n }\r\n }\r\n }\r\n //if ((source)[\"_tooltip\"] && !this._tooltip) {\r\n //\tthis._tooltip = (source)[\"_tooltip\"];\r\n //}\r\n this._showSystemTooltip = source.showSystemTooltip;\r\n $utils.copyProperties(source.propertyFields, this.propertyFields);\r\n $utils.copyProperties(source.properties, this);\r\n if (source.fillModifier) {\r\n this.fillModifier = source.fillModifier.clone();\r\n }\r\n if (source.strokeModifier) {\r\n this.strokeModifier = source.strokeModifier.clone();\r\n }\r\n if (source.focusFilter) {\r\n this.focusFilter = source.focusFilter.clone();\r\n }\r\n };\r\n /**\r\n * Destroys this object and all related data.\r\n */\r\n Sprite.prototype.dispose = function () {\r\n if (!this.isDisposed()) {\r\n if (this.showTooltipOn == \"always\" && this.tooltip) {\r\n this.tooltip.hide();\r\n }\r\n this.dispatchImmediately(\"beforedisposed\");\r\n if (this.isBaseSprite) {\r\n if (this.htmlContainer) {\r\n while (this.htmlContainer.childNodes.length > 0) {\r\n this.htmlContainer.removeChild(this.htmlContainer.firstChild);\r\n }\r\n }\r\n this.isBaseSprite = false;\r\n }\r\n _super.prototype.dispose.call(this);\r\n // Clear adapters\r\n if (this._adapterO) {\r\n this._adapterO.clear();\r\n }\r\n if (this.applyOnClones) {\r\n if (this._clones) {\r\n for (var i = this._clones.length - 1; i >= 0; i--) {\r\n var clone = this._clones.getIndex(i);\r\n clone.dispose();\r\n }\r\n }\r\n }\r\n if (this._svgContainer) {\r\n this._svgContainer.dispose();\r\n }\r\n if (this._interactionDisposer) {\r\n this._interactionDisposer.dispose();\r\n this._interactionDisposer = undefined;\r\n }\r\n if (this._urlDisposer) {\r\n this._urlDisposer.dispose();\r\n }\r\n this.removeFromInvalids();\r\n if (this.element) {\r\n this.element.dispose();\r\n }\r\n if (this.group) {\r\n this.group.dispose();\r\n }\r\n if (this._numberFormatter) {\r\n this._numberFormatter.dispose();\r\n }\r\n if (this._focusFilter) {\r\n this._focusFilter.dispose();\r\n }\r\n var stroke = this.stroke;\r\n if (stroke && !(stroke instanceof Color) && stroke.dispose) {\r\n if (this.clonedFrom && this.clonedFrom.stroke == stroke) {\r\n // do nothing\r\n }\r\n else {\r\n stroke.dispose();\r\n }\r\n }\r\n // TODO a bit hacky\r\n var fill = this.fill;\r\n if (fill && !(fill instanceof Color) && fill.dispose) {\r\n if (this.clonedFrom && this.clonedFrom.fill == fill) {\r\n // do nothing\r\n }\r\n else {\r\n fill.dispose();\r\n }\r\n }\r\n // remove from map\r\n if ($type.hasValue(this.id)) {\r\n this.map.removeKey(this.id);\r\n }\r\n this.parent = undefined;\r\n if (this._filters) {\r\n while (this._filters.length > 0) {\r\n var filter = this._filters.getIndex(0);\r\n filter.dispose();\r\n this._filters.removeValue(filter);\r\n }\r\n }\r\n this._alwaysShowDisposers = undefined;\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"isTemplate\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Is template?\r\n */\r\n get: function () {\r\n return this._isTemplate;\r\n },\r\n /**\r\n * Indicates if this element is a \"template\".\r\n *\r\n * Template Sprites act only as a holders for config for other \"real\"\r\n * elements to be cloned from.\r\n *\r\n * Templates are treated differently, as they are not validated, redrawn, or\r\n * otherwise are processed.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Is template?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this._isTemplate != value) {\r\n this._isTemplate = value;\r\n if (this instanceof Container) {\r\n $iter.each(this.children.iterator(), function (child) {\r\n child.isTemplate = value;\r\n });\r\n }\r\n if (value) {\r\n this.parent = this._parent;\r\n this.removeFromInvalids();\r\n }\r\n else {\r\n this.invalidate();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"showSystemTooltip\", {\r\n /**\r\n * @return Show system tooltip?\r\n */\r\n get: function () {\r\n if (!$type.hasValue(this._showSystemTooltip)) {\r\n if (this.virtualParent) {\r\n return this.virtualParent.showSystemTooltip;\r\n }\r\n else if (this._parent) {\r\n return this._parent.showSystemTooltip;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n return this._showSystemTooltip;\r\n },\r\n /**\r\n * Indicates whether the element should attempt to construct itself in a way\r\n * so that system tooltip is shown if its `readerTitle` is set.\r\n *\r\n * @param value Show system tooltip?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this._showSystemTooltip != value) {\r\n this._showSystemTooltip = value;\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"topParent\", {\r\n /**\r\n * ==========================================================================\r\n * HIERARCHY AND STRUCTURE RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Sprites's top-level [[Container]].\r\n *\r\n * Please note that in most cases it won't be the chart element.\r\n *\r\n * To access base chart element, use `baseSprite` instead.\r\n *\r\n * @return Top-level ascendant\r\n */\r\n get: function () {\r\n if (this._topParent) {\r\n return this._topParent;\r\n }\r\n else {\r\n if (this._parent) {\r\n return this._parent.topParent;\r\n }\r\n }\r\n },\r\n /**\r\n * @ignore\r\n * @param value {Container} top parent of a sprite\r\n */\r\n set: function (value) {\r\n this._topParent = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"parent\", {\r\n /**\r\n * @return Parent container\r\n */\r\n get: function () {\r\n return this._parent;\r\n },\r\n /**\r\n * Elements' parent [[Container]].\r\n *\r\n * @param parent Parent container\r\n */\r\n set: function (parent) {\r\n if (this._isTemplate) {\r\n return;\r\n }\r\n // TODO is this needed ?\r\n $utils.used(this.paper);\r\n var oldParent = this._parent;\r\n if (oldParent != parent) {\r\n if (oldParent) {\r\n oldParent.children.removeValue(this);\r\n }\r\n this._parent = parent;\r\n if (parent) {\r\n this.topParent = parent.topParent;\r\n if (parent.isTemplate) {\r\n this.isTemplate = true;\r\n }\r\n this.baseId = parent.baseId;\r\n parent.children.push(this);\r\n // insert handler at Container invalidates + invalidatesLayout + adds to group\r\n if (this._tooltip && !this._tooltipContainer) {\r\n this._tooltip.parent = parent.tooltipContainer;\r\n }\r\n if (!this._dataItem) {\r\n this.dataItem = parent.dataItem;\r\n }\r\n this.handleAlwaysShowTooltip();\r\n if (this.dataItem) {\r\n // No need to apply accessibility if there's no data item\r\n // The whole reason of applying it here is to populate data\r\n // placesholders, and if tehre's no data item, it won't work anyway\r\n this.applyAccessibility();\r\n }\r\n this.dispatchImmediately(\"parentset\");\r\n }\r\n else {\r\n this.topParent = undefined;\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n Sprite.prototype.handleAlwaysShow = function () {\r\n this.showTooltip();\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Sprite.prototype.handleAlwaysShowTooltip = function () {\r\n var sprite = this;\r\n var oldDisposers = this._alwaysShowDisposers;\r\n if (oldDisposers) {\r\n $array.each(oldDisposers, function (oldDisposer) {\r\n oldDisposer.dispose();\r\n });\r\n }\r\n this._alwaysShowDisposers = [];\r\n if (this.showTooltipOn == \"always\") {\r\n while (sprite != undefined) {\r\n var disposer = sprite.events.on(\"visibilitychanged\", this.handleAlwaysShow, this, false);\r\n this.addDisposer(disposer);\r\n this._alwaysShowDisposers.push(disposer);\r\n sprite = sprite.parent;\r\n }\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"virtualParent\", {\r\n /**\r\n * @return Virtual parent\r\n */\r\n get: function () {\r\n return this._virtualParent;\r\n },\r\n /**\r\n * Element's \"virtual\" parent.\r\n *\r\n * This is required in ordere to maintain proper inheritance (like\r\n * formatters).\r\n *\r\n * Sometimes an element is a \"logical\" parent, even though it's not a direct\r\n * ascendant.\r\n *\r\n * Example: a bullet is not a child of the axis, but it would make sense\r\n * for it to inherit series' formatters.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Virtual parent\r\n */\r\n set: function (value) {\r\n this._virtualParent = value;\r\n if (this.dataItem) {\r\n // No need to apply accessibility if there's no data item\r\n // The whole reason of applying it here is to populate data\r\n // placesholders, and if tehre's no data item, it won't work anyway\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Moves `` to correct place in DOM.\r\n *\r\n * Some elements are initially created in \"ghost\" container. When moving\r\n * those into proper place in DOM, their respective `` need to be moved\r\n * as well.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.appendDefs = function () {\r\n if (this.filterElement) {\r\n this.paper.appendDef(this.filterElement);\r\n }\r\n var fill = this.fill;\r\n if (fill && fill.element) {\r\n this.paper.appendDef(fill.element);\r\n }\r\n var stroke = this.stroke;\r\n if (stroke && stroke.element) {\r\n this.paper.appendDef(stroke.element);\r\n }\r\n if (this.fillModifier && this.fill instanceof Color) {\r\n var fill_1 = this.fillModifier.modify(this.fill);\r\n if (fill_1 && fill_1.element) {\r\n this.paper.appendDef(fill_1.element);\r\n }\r\n }\r\n if (this.strokeModifier && this.stroke instanceof Color) {\r\n var stroke_1 = this.strokeModifier.modify(this.stroke);\r\n if (stroke_1 && stroke_1.element) {\r\n this.paper.appendDef(stroke_1.element);\r\n }\r\n }\r\n if (this._clipPath) {\r\n this.paper.appendDef(this._clipPath);\r\n }\r\n if (this._exportable === false) {\r\n this.exportable = false;\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"map\", {\r\n /**\r\n * Returns a [[Dictionary]] which maps object ids with their respective\r\n * objects.\r\n *\r\n * Can be used to retrieve any object by id, e.g.:\r\n *\r\n * ```TypeScript\r\n * console.log(mySprite.map.getKey(\"myid\"));\r\n * ```\r\n * ```JavaScript\r\n * console.log(mySprite.map.getKey(\"myid\"));\r\n * ```\r\n *\r\n * @return Map collection\r\n */\r\n get: function () {\r\n var top = this.topParent;\r\n if (top) {\r\n return top.map;\r\n }\r\n else if (!this._map) {\r\n this._map = new Dictionary();\r\n }\r\n return this._map;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"delayedMap\", {\r\n /**\r\n * @ignore\r\n * @return Map collection\r\n */\r\n get: function () {\r\n var top = this.topParent;\r\n if (top) {\r\n return top.delayedMap;\r\n }\r\n else if (!this._delayedMap) {\r\n this._delayedMap = new Dictionary();\r\n }\r\n return this._delayedMap;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"id\", {\r\n /**\r\n * @return ID\r\n */\r\n get: function () {\r\n return this._id;\r\n },\r\n /**\r\n * Element's user-defined ID.\r\n *\r\n * Will throw an Error if there already is an object with the same ID.\r\n *\r\n * Please note that above check will be performed withing the scope of the\r\n * current chart instance. It will not do checks across other chart instances\r\n * or in globally in DOM.\r\n *\r\n * Make sure the IDs are unique.\r\n *\r\n * @param value ID\r\n */\r\n set: function (value) {\r\n if (this._id != value) {\r\n this._id = value;\r\n if (this.map.hasKey(value)) {\r\n throw Error(\"Duplicate id (\" + value + \") used on multiple objects.\");\r\n }\r\n else {\r\n this.map.setKey(value, this);\r\n }\r\n if (options.autoSetClassName) {\r\n this.setClassName();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"dom\", {\r\n /**\r\n * ==========================================================================\r\n * ELEMENT AND DOM TREE MANIPULATION AND MEASURING\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns DOM element reference associated with this element.\r\n *\r\n * @readonly\r\n * @return DOM element\r\n */\r\n get: function () {\r\n return this.group.node;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"paper\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Paper\r\n */\r\n get: function () {\r\n if (this._paper) {\r\n return this._paper;\r\n }\r\n else {\r\n var parent_2 = this._parent;\r\n if (parent_2) {\r\n return parent_2.paper;\r\n }\r\n }\r\n return getGhostPaper();\r\n },\r\n /**\r\n * A [[Paper]] instance to place elements on.\r\n *\r\n * If there's no Paper set for this element, it goes up the ascendant tree\r\n * until it finds one.\r\n *\r\n * This method is used by important `addChild()` method, so it's essential\r\n * to have a [[Paper]] instance.\r\n *\r\n * If this element has a separate `htmlContainer` set, it will have a\r\n * [[Paper]] instance itself.\r\n *\r\n * @ignore Exclude from docs\r\n * @param paper Paper\r\n */\r\n set: function (paper) {\r\n this.setPaper(paper);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets [[Paper]] instance to use to draw elements.\r\n * @ignore\r\n * @param paper Paper\r\n * @return true if paper was changed, false, if it's the same\r\n */\r\n Sprite.prototype.setPaper = function (paper) {\r\n var oldPaper = this._paper;\r\n if (oldPaper != paper) {\r\n this._paper = paper;\r\n this.appendDefs();\r\n return true;\r\n }\r\n return false;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"htmlContainer\", {\r\n /**\r\n * @return HTML element\r\n */\r\n get: function () {\r\n if (this._htmlContainer) {\r\n return this._htmlContainer;\r\n }\r\n else {\r\n var parent_3 = this._parent;\r\n if (parent_3) {\r\n return parent_3.htmlContainer;\r\n }\r\n }\r\n },\r\n /**\r\n * An HTML element to be used when placing wrapper element (`
      `)\r\n * for the whole chart.\r\n *\r\n * This is the same for **all** elements within the same chart.\r\n *\r\n * @param htmlContainer HTML element\r\n */\r\n set: function (htmlContainer) {\r\n this._htmlContainer = htmlContainer;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"titleElement\", {\r\n /**\r\n * Creates (if not yet created) and returns element's `` element.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Title element\r\n */\r\n get: function () {\r\n if (!this._titleElement) {\r\n this._titleElement = this.paper.add(\"title\");\r\n this.group.add(this._titleElement);\r\n }\r\n return this._titleElement;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"descriptionElement\", {\r\n /**\r\n * Creates (if not yet created) and returns element's `<desc>` element.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Desc element\r\n */\r\n get: function () {\r\n if (!this._descriptionElement) {\r\n this._descriptionElement = this.paper.add(\"desc\");\r\n this.group.add(this._descriptionElement);\r\n }\r\n return this._descriptionElement;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"filters\", {\r\n /**\r\n * Returns list of SVG filters (effects) applied to element. If the filter\r\n * list is not yet initilized, creates and returns an empty one.\r\n * Note, not all filters combine well with one another. We recommend using one filter per sprite.\r\n *\r\n * @return List of filters\r\n */\r\n get: function () {\r\n if (!this._filters) {\r\n this._filters = new List();\r\n // TODO only add certain events ?\r\n this._disposers.push(this._filters.events.onAll(this.applyFilters, this));\r\n this._disposers.push(new ListDisposer(this._filters));\r\n }\r\n return this._filters;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets required SVG attributes. Must be called every time an element is\r\n * redrawn so that attributes are (re)applied.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.setSVGAttributes = function () {\r\n this.fill = this.fill;\r\n this.opacity = this.opacity;\r\n this.fillOpacity = this.fillOpacity;\r\n this.stroke = this.stroke;\r\n this.strokeOpacity = this.strokeOpacity;\r\n this.shapeRendering = this.shapeRendering;\r\n this.strokeDasharray = this.strokeDasharray;\r\n this.strokeDashoffset = this.strokeDashoffset;\r\n this.strokeLinecap = this.strokeLinecap;\r\n this.strokeLinejoin = this.strokeLinejoin;\r\n this.focusable = this.focusable;\r\n this.tabindex = this.tabindex;\r\n this.role = this.role;\r\n };\r\n /**\r\n * Sets an attribute directly on an SVG element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param attribute Attribute object\r\n */\r\n Sprite.prototype.setSVGAttribute = function (attribute) {\r\n this.group.attr(attribute);\r\n };\r\n /**\r\n * Removes an attribute directly from SVG element.\r\n *\r\n * @param attribute Attribute key to remove\r\n */\r\n Sprite.prototype.removeSVGAttribute = function (attribute) {\r\n this.group.removeAttr(attribute);\r\n };\r\n /**\r\n * Sets `class` attribute of the elements SVG node.\r\n *\r\n * Uses `am4core.options.classNamePrefix`.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.setClassName = function () {\r\n var className = this.className;\r\n var classNamePrefix = options.classNamePrefix;\r\n if (this.element) {\r\n this.element.addClass(classNamePrefix + className);\r\n }\r\n this.group.addClass(classNamePrefix + className + \"-group\");\r\n if ($type.hasValue(this.id)) {\r\n this.group.addClass(classNamePrefix + this.id);\r\n }\r\n if (this.userClassName) {\r\n this.group.addClass(this.userClassName);\r\n }\r\n };\r\n /**\r\n * Adds an `id` attribute the the element and returns the id.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Element's ID\r\n */\r\n Sprite.prototype.uidAttr = function () {\r\n this.setSVGAttribute({ \"id\": this.uid });\r\n return this.uid;\r\n };\r\n /**\r\n * [updateClipPath description]\r\n *\r\n * @todo Description\r\n */\r\n Sprite.prototype.updateClipPath = function () {\r\n var element = this._clipElement;\r\n if (element) {\r\n element.moveTo({ x: this.mask.pixelX, y: this.mask.pixelY });\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Sprite.prototype.createClipPath = function () {\r\n if (!this._clipPath) {\r\n this._clipPath = this.paper.addGroup(\"clipPath\");\r\n this.paper.appendDef(this._clipPath);\r\n this._disposers.push(this._clipPath);\r\n var id = registry.getUniqueId();\r\n this._clipPath.attr({ \"id\": id });\r\n this.group.attr({ \"clip-path\": \"url(\\\"\" + $utils.getBaseURI() + id + \"\\\")\" });\r\n }\r\n };\r\n /**\r\n * Applies the mask Sprite.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.applyMask = function () {\r\n var mask = this.mask;\r\n if (this._clipPath && mask) {\r\n // Container\r\n if (mask instanceof Container) {\r\n this._clipElement.attr({ \"width\": $math.max(0, mask.pixelWidth), \"height\": $math.max(0, mask.pixelHeight) });\r\n var point = $utils.spritePointToSprite({ x: mask.pixelX, y: mask.pixelY }, mask.parent, this);\r\n this._clipPath.x = point.x;\r\n this._clipPath.y = point.y;\r\n }\r\n // Sprite\r\n else {\r\n if (mask.element && mask.element != this._clipElement) {\r\n this._clipElement = mask.element;\r\n this._clipPath.add(this._clipElement);\r\n }\r\n this._clipPath.scale = mask.scale;\r\n this._clipPath.x = mask.pixelX;\r\n this._clipPath.y = mask.pixelY;\r\n this._clipPath.rotation = mask.rotation;\r\n }\r\n }\r\n };\r\n /**\r\n * Applies filters to the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.applyFilters = function () {\r\n var _this = this;\r\n // we create a separate filter for each sprite as otherwise it would be impossible to animate filter.\r\n // svg doesn't support multiple filters applied to one element, so we put all the primitives to one filterElement of a sprite.\r\n if (this._filters && this._filters.length > 0) {\r\n var width_1 = 100;\r\n var height_1 = 100;\r\n if (!this.filterElement) {\r\n this.filterElement = this.paper.addGroup(\"filter\");\r\n this._disposers.push(this.filterElement);\r\n }\r\n else {\r\n this.filterElement.removeChildNodes();\r\n }\r\n this.paper.appendDef(this.filterElement);\r\n var id = \"filter-\" + this.uid;\r\n this.filterElement.attr({ \"id\": id });\r\n $iter.each(this.filters.iterator(), function (filter) {\r\n filter.sprite = _this;\r\n filter.paper = _this.paper;\r\n _this.filterElement.attr({ filterUnits: filter.filterUnits });\r\n filter.appendPrimitives(_this.filterElement);\r\n if (filter.width > width_1) {\r\n width_1 = filter.width;\r\n }\r\n if (filter.height > height_1) {\r\n height_1 = filter.height;\r\n }\r\n filter.scale = _this.globalScale;\r\n });\r\n var w = width_1 + \"%\";\r\n var h = height_1 + \"%\";\r\n /* temporarily removed as it is breaking tooltips on Safari @todo come back to this\r\n if (this._measuredHeight <= 1) {\r\n h = height + \"\";\r\n }\r\n\r\n if (this._measuredWidth <= 1) {\r\n h = width + \"\";\r\n }*/\r\n this.filterElement.attr({ \"width\": w, \"height\": h, \"x\": -(width_1 - 100) / 2 + \"%\", \"y\": -(height_1 - 100) / 2 + \"%\" });\r\n this.group.attr({ \"filter\": \"url(\\\"\" + $utils.getBaseURI() + id + \"\\\")\" });\r\n }\r\n else if (this.filterElement) {\r\n this.group.removeAttr(\"filter\");\r\n this.filterElement.removeChildNodes();\r\n }\r\n };\r\n /**\r\n * [removeClipPath description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n Sprite.prototype.removeClipPath = function () {\r\n if (this._clipPath) {\r\n //this._clipPath.dispose();\r\n this.removeDispose(this._clipPath);\r\n this._clipPath = undefined;\r\n }\r\n };\r\n /**\r\n * [setElement description]\r\n *\r\n * @ignore\r\n * @todo Description\r\n * @param element [description]\r\n */\r\n Sprite.prototype.setElement = function (element) {\r\n this.element = element;\r\n this.setSVGAttributes();\r\n this.applyAccessibility();\r\n };\r\n Object.defineProperty(Sprite.prototype, \"element\", {\r\n /**\r\n * @return Element\r\n */\r\n get: function () {\r\n return this._element;\r\n },\r\n /**\r\n * The main element for this Sprite, usually an SVG `<g>`.\r\n *\r\n * All other sub-elements are created in it.\r\n *\r\n * @param element Element\r\n */\r\n set: function (element) {\r\n // Destroy previous element if there was one before\r\n this.removeElement();\r\n // Set new element\r\n this._element = element;\r\n // Add element to group\r\n // Since we are adding Element to group, which is already in the\r\n // `.disposers` it will be removed automatically when Sprite is disposed\r\n // of\r\n this.group.add(element);\r\n if (element.node instanceof SVGPathElement) {\r\n this._isPath = true;\r\n }\r\n // This is needed if someone is setting element not in draw method but\r\n // from outside\r\n if (!this.invalid) {\r\n this.validate();\r\n }\r\n if (options.autoSetClassName) {\r\n this.setClassName();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"svgContainer\", {\r\n /**\r\n * HTML container (`<div>`) which is used to place chart's `<svg>` element\r\n * in.\r\n *\r\n * @return Container for chart elements\r\n */\r\n get: function () {\r\n if (this._svgContainer) {\r\n return this._svgContainer;\r\n }\r\n else if (this._parent) {\r\n return this._parent.svgContainer;\r\n }\r\n },\r\n /**\r\n * Sets HTML container to add SVG and other chart elements to.\r\n *\r\n * @param svgContainer Container for chart elements\r\n */\r\n set: function (svgContainer) {\r\n this._svgContainer = svgContainer;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Measures main element.\r\n *\r\n * Saves measurements into private `_bbox` property.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.measureElement = function () {\r\n if (this.element) {\r\n if (this.definedBBox) {\r\n this._bbox = this.definedBBox;\r\n }\r\n else {\r\n var svgBBox = this.element.getBBox();\r\n this._bbox = { x: svgBBox.x, y: svgBBox.y, width: svgBBox.width, height: svgBBox.height };\r\n }\r\n }\r\n };\r\n /**\r\n * Positions element according its center settings.\r\n *\r\n * @todo Description (review)\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.updateCenter = function () {\r\n if (this.element) {\r\n var prevElementTransform = this.element.transformString;\r\n var bbox = this.bbox;\r\n var ex = 0;\r\n var ey = 0;\r\n var elementX = bbox.x;\r\n var elementY = bbox.y;\r\n var elementWidth = bbox.width;\r\n var elementHeigth = bbox.height;\r\n var pixelPaddingLeft = this.pixelPaddingLeft;\r\n var pixelPaddingRight = this.pixelPaddingRight;\r\n var pixelPaddingTop = this.pixelPaddingTop;\r\n var pixelPaddingBottom = this.pixelPaddingBottom;\r\n // add padding to the measured size\r\n var measuredWidth = $math.max(elementWidth + pixelPaddingLeft + pixelPaddingRight, this.pixelWidth);\r\n var measuredHeight = $math.max(elementHeigth + pixelPaddingTop + pixelPaddingBottom, this.pixelHeight);\r\n // extremes\r\n var left = bbox.x;\r\n var right = bbox.x + measuredWidth;\r\n var top_1 = bbox.y;\r\n var bottom = bbox.y + measuredHeight;\r\n var horizontalCenter = this.horizontalCenter;\r\n var verticalCenter = this.verticalCenter;\r\n switch (horizontalCenter) {\r\n case \"none\":\r\n ex = elementX + pixelPaddingLeft;\r\n break;\r\n case \"left\":\r\n ex = pixelPaddingLeft;\r\n break;\r\n case \"middle\":\r\n ex = pixelPaddingLeft - (elementWidth + pixelPaddingRight + pixelPaddingLeft) / 2;\r\n break;\r\n case \"right\":\r\n ex = -pixelPaddingRight - elementWidth;\r\n break;\r\n }\r\n switch (verticalCenter) {\r\n case \"none\":\r\n ey = elementY + pixelPaddingTop;\r\n break;\r\n case \"top\":\r\n ey = pixelPaddingTop;\r\n break;\r\n case \"middle\":\r\n ey = pixelPaddingTop - (elementHeigth + pixelPaddingBottom + pixelPaddingTop) / 2;\r\n break;\r\n case \"bottom\":\r\n ey = -pixelPaddingBottom - elementHeigth;\r\n break;\r\n }\r\n this._measuredHeight = measuredHeight;\r\n this._measuredWidth = measuredWidth;\r\n var x = $math.round(ex - elementX, this._positionPrecision, true);\r\n var y = $math.round(ey - elementY, this._positionPrecision, true);\r\n this.ex = x - pixelPaddingLeft;\r\n this.ey = y - pixelPaddingTop;\r\n this.maxLeft = left + x - pixelPaddingLeft;\r\n this.maxRight = right + x - pixelPaddingLeft;\r\n this.maxTop = top_1 + y - pixelPaddingTop;\r\n this.maxBottom = bottom + y - pixelPaddingTop;\r\n if (this.pixelPerfect && options.pixelPerfectPrecision == 0) {\r\n x -= 0.5;\r\n y -= 0.5;\r\n }\r\n this.element.moveTo({ x: x, y: y });\r\n if (prevElementTransform != this.element.transformString) {\r\n this.dispatchImmediately(\"transformed\");\r\n }\r\n }\r\n };\r\n /**\r\n * Measures the whole element.\r\n *\r\n * Returns `true` if the size has changed from the last measurement.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Did the size changed from the last measurement?\r\n */\r\n Sprite.prototype.measure = function () {\r\n this.updateCenter();\r\n var measuredWidth = this._measuredWidth;\r\n var measuredHeight = this._measuredHeight;\r\n // extremes\r\n var left = this.maxLeft;\r\n var right = this.maxRight;\r\n var top = this.maxTop;\r\n var bottom = this.maxBottom;\r\n // non-parent wise size\r\n this._measuredWidthSelf = measuredWidth;\r\n this._measuredHeightSelf = measuredHeight;\r\n var positionPrecision = this._positionPrecision;\r\n this.maxLeftSelf = this.maxLeft;\r\n this.maxRightSelf = this.maxRight;\r\n this.maxTopSelf = this.maxTop;\r\n this.maxBottomSelf = this.maxBottom;\r\n // if a sprite is rotated or scaled, calculate measured size after transformations\r\n if (this.rotation !== 0 || this.scale !== 1 || this.nonScaling) {\r\n // not good to handleGlobalScale here.\r\n if (this.nonScalingStroke) {\r\n this.strokeWidth = this.strokeWidth;\r\n }\r\n var svg = this.paper.svg;\r\n var matrix = svg.createSVGMatrix();\r\n var rotation = this.rotation;\r\n var scale = this.scale;\r\n if (this.nonScaling) {\r\n scale = this.scale / this.globalScale;\r\n }\r\n matrix.a = $math.cos(rotation) * scale;\r\n matrix.c = -$math.sin(rotation) * scale;\r\n matrix.e = 0;\r\n matrix.b = $math.sin(rotation) * scale;\r\n matrix.d = $math.cos(rotation) * scale;\r\n matrix.f = 0;\r\n var p1 = svg.createSVGPoint();\r\n p1.x = left;\r\n p1.y = top;\r\n var p2 = svg.createSVGPoint();\r\n p2.x = right;\r\n p2.y = top;\r\n var p3 = svg.createSVGPoint();\r\n p3.x = right;\r\n p3.y = bottom;\r\n var p4 = svg.createSVGPoint();\r\n p4.x = left;\r\n p4.y = bottom;\r\n var pt1 = p1.matrixTransform(matrix);\r\n var pt2 = p2.matrixTransform(matrix);\r\n var pt3 = p3.matrixTransform(matrix);\r\n var pt4 = p4.matrixTransform(matrix);\r\n left = Math.min(pt1.x, pt2.x, pt3.x, pt4.x);\r\n right = Math.max(pt1.x, pt2.x, pt3.x, pt4.x);\r\n top = Math.min(pt1.y, pt2.y, pt3.y, pt4.y);\r\n bottom = Math.max(pt1.y, pt2.y, pt3.y, pt4.y);\r\n measuredWidth = right - left;\r\n measuredHeight = bottom - top;\r\n this.maxLeft = $math.round(left, positionPrecision, true);\r\n this.maxRight = $math.round(right, positionPrecision, true);\r\n this.maxTop = $math.round(top, positionPrecision, true);\r\n this.maxBottom = $math.round(bottom, positionPrecision, true);\r\n }\r\n this._measuredWidth = $math.round(measuredWidth, positionPrecision, true);\r\n this._measuredHeight = $math.round(measuredHeight, positionPrecision, true);\r\n // dispatch event\r\n if (this._measuredWidth != this._prevMeasuredWidth || this._measuredHeight != this._prevMeasuredHeight) {\r\n this._prevMeasuredHeight = this._measuredHeight;\r\n this._prevMeasuredWidth = this._measuredWidth;\r\n // TODO clear existing sizechanged dispatches ?\r\n this.dispatch(\"sizechanged\");\r\n if ((this.isHover || this.showTooltipOn == \"hit\" || this.showTooltipOn == \"always\") && this.tooltip && this.tooltip.visible && ($type.hasValue(this.tooltipText) || $type.hasValue(this.tooltipHTML))) {\r\n this.updateTooltipPosition();\r\n }\r\n return true;\r\n }\r\n return false;\r\n };\r\n /**\r\n * Insert this element before sibling element.\r\n *\r\n * @param sprite Target element\r\n * @return This element\r\n */\r\n Sprite.prototype.insertBefore = function (sprite) {\r\n var parent = this._parent;\r\n if (parent) {\r\n var index = parent.children.indexOf(sprite);\r\n if (index !== -1) {\r\n parent.children.moveValue(this, index);\r\n parent.sortChildren();\r\n }\r\n }\r\n return this;\r\n };\r\n /**\r\n * Insert this element after sibling element.\r\n *\r\n * @param sprite Target element\r\n * @return This element\r\n */\r\n Sprite.prototype.insertAfter = function (sprite) {\r\n var parent = this._parent;\r\n if (parent) {\r\n var index = parent.children.indexOf(sprite);\r\n if (index !== -1) {\r\n parent.children.moveValue(this, index + 1);\r\n parent.sortChildren();\r\n }\r\n }\r\n return this;\r\n };\r\n /**\r\n * Removes the main SVG element.\r\n *\r\n * This does not destroy the whole Sprite element. To do that use\r\n * `dispose()` instead.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.removeElement = function () {\r\n // remove visual element\r\n if (this._element) {\r\n this.removeDispose(this._element);\r\n this._element = undefined;\r\n }\r\n };\r\n /**\r\n * Returns relative (percent) value of the X coordindate within this element.\r\n *\r\n * A relative value is a hundredth of a percent. So 100% would result in a 1\r\n * as relative value.\r\n *\r\n * @param value Absolute or relative X coordinate\r\n * @return Relative value\r\n */\r\n Sprite.prototype.getRelativeX = function (value) {\r\n if (value instanceof Percent) {\r\n return value.value;\r\n }\r\n else if (this._parent) {\r\n return value / this._parent.innerWidth;\r\n }\r\n return 0;\r\n };\r\n /**\r\n * Returns relative (percent) value of the Y coordindate within this element.\r\n *\r\n * A relative value is a hundredth of a percent. So 100% would result in a 1\r\n * as relative value.\r\n *\r\n * @param value Absolute or relative Y coordinate\r\n * @return Relative value\r\n */\r\n Sprite.prototype.getRelativeY = function (value) {\r\n if (value instanceof Percent) {\r\n return value.value;\r\n }\r\n else if (this._parent) {\r\n return value / this._parent.innerHeight;\r\n }\r\n return 0;\r\n };\r\n /**\r\n * Returns an X coordinate in pixel within the element.\r\n *\r\n * If number is passed in as parameter, the same number will be returned\r\n * back.\r\n *\r\n * If [[Percent]] is passed in, it will be recalculated to pixels.\r\n *\r\n * @param value Absolute or relative X coordinate\r\n * @return X coordinate in pixels\r\n */\r\n Sprite.prototype.getPixelX = function (value) {\r\n // we don't use $utils.valueToRelative as this would mean that we should access parent.innerWidth\r\n // all the time and this would result chain of the same actions and will slow down the system a lot\r\n var pixel = 0;\r\n if ($type.isNumber(value)) {\r\n pixel = value;\r\n }\r\n else if (value instanceof Percent) {\r\n var relative = value.value;\r\n if (this._parent) {\r\n pixel = $math.round(this._parent.innerWidth * relative, this._positionPrecision, true);\r\n }\r\n }\r\n return pixel;\r\n };\r\n /**\r\n * Returns an Y coordinate in pixel within the element.\r\n *\r\n * If number is passed in as parameter, the same number will be returned\r\n * back.\r\n *\r\n * If [[Percent]] is passed in, it will be recalculated to pixels.\r\n *\r\n * @param value Absolute or relative Y coordinate\r\n * @return Y coordinate in pixels\r\n */\r\n Sprite.prototype.getPixelY = function (value) {\r\n // we don't use $utils.valueToRelative as this would mean that we should access parent.innerWidth\r\n // all the time and this would result chain of the same actions and will slow down the system a lot\r\n var pixel = 0;\r\n if ($type.isNumber(value)) {\r\n pixel = value;\r\n }\r\n else if (value instanceof Percent) {\r\n var relative = value.value;\r\n if (this._parent) {\r\n pixel = $math.round(this._parent.innerHeight * relative, this._positionPrecision, true);\r\n }\r\n }\r\n return pixel;\r\n };\r\n /**\r\n * Moves the element to a specified coordinates.\r\n *\r\n * Using this method is preferred method of moving element, as it saves some\r\n * CPU processing power over setting `x` and `y` properties separately.\r\n *\r\n * The method respects element's center settings. The element will be\r\n * positioned so that `point` coordinates come in whatever \"center\" of the\r\n * element is, as set in `horizontalCenter` and `verticalCenter`.\r\n *\r\n * Besides moving the element, you can also at the same time scale and\r\n * rotate the element.\r\n *\r\n * @param point New coordinates\r\n * @param rotation New rotation\r\n * @param scale New Scale\r\n */\r\n Sprite.prototype.moveTo = function (point, rotation, scale, isDragged) {\r\n if (this.isDragged && !isDragged) {\r\n return;\r\n }\r\n if (point) {\r\n if ($type.isNumber(point.x)) {\r\n this.setPropertyValue(\"x\", $math.round(point.x, this._positionPrecision, true));\r\n }\r\n if ($type.isNumber(point.y)) {\r\n this.setPropertyValue(\"y\", $math.round(point.y, this._positionPrecision, true));\r\n }\r\n }\r\n if ($type.isNumber(rotation)) {\r\n this.rotation = rotation;\r\n }\r\n if ($type.isNumber(scale)) {\r\n this.scale = scale;\r\n }\r\n // must leave this\r\n this.invalidatePosition();\r\n };\r\n Object.defineProperty(Sprite.prototype, \"mask\", {\r\n /**\r\n * Returns [[Sprite]] element currently used as mask for this element.\r\n *\r\n * @ignore Exclude from docs\r\n * @return A [[Sprite]] to use as mask\r\n */\r\n get: function () {\r\n if (!this._adapterO) {\r\n return this._mask.get();\r\n }\r\n else {\r\n return this._adapterO.apply(\"mask\", this._mask.get());\r\n }\r\n },\r\n /**\r\n * Sets another [[Sprite]] element as this elements mask.\r\n *\r\n * @ignore Exclude from docs\r\n * @param mask A [[Sprite]] to use as mask\r\n */\r\n set: function (mask) {\r\n var _this = this;\r\n if (this._mask.get() !== mask) {\r\n // this is good\r\n if (mask) {\r\n this.createClipPath();\r\n if (!(mask instanceof Container)) {\r\n mask.isMeasured = false;\r\n if (mask.element) {\r\n this._clipElement = mask.element;\r\n }\r\n }\r\n else {\r\n this._clipElement = this.paper.add(\"rect\");\r\n }\r\n if (this._clipElement) {\r\n this._clipPath.add(this._clipElement);\r\n }\r\n this._mask.set(mask, new MultiDisposer([\r\n //mask.addEventListener(SpriteEvent.TRANSFORMED, this.applyMask, false, this);\r\n mask.events.on(\"maxsizechanged\", function () { if (_this.inited) {\r\n _this.applyMask();\r\n } }, undefined, false),\r\n mask.events.on(\"validated\", this.applyMask, this, false),\r\n mask.events.on(\"positionchanged\", this.applyMask, this, false)\r\n ]));\r\n this.applyMask();\r\n }\r\n else {\r\n this._mask.reset();\r\n this.group.removeAttr(\"clip-path\");\r\n this.removeClipPath();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"maskRectangle\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Mask Rectangle\r\n */\r\n get: function () {\r\n return this._maskRectangle;\r\n },\r\n // you can set IRectangle as a mask instead o a sprite. Note, the changes of the object won't be monitored\r\n /**\r\n * Instead of creating a [[Sprite]] for mask, you can just use a\r\n * [[Rectangle]] by setting this accessor.\r\n *\r\n * Please note that the element will not monitor any changes to the mask\r\n * rectangle.\r\n *\r\n * @ignore Exclude from docs\r\n * @param rect Mask Rectangle\r\n */\r\n set: function (rect) {\r\n if (rect) {\r\n this.createClipPath();\r\n if (!this._clipElement) {\r\n this._clipElement = this.paper.add(\"rect\");\r\n this._clipPath.add(this._clipElement);\r\n }\r\n this._clipElement.attr({ \"width\": rect.width, \"height\": rect.height });\r\n }\r\n else {\r\n this.removeClipPath();\r\n this._clipElement = undefined;\r\n }\r\n this._maskRectangle = rect;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"isMeasured\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Was element already measured?\r\n */\r\n get: function () {\r\n return this._isMeasured;\r\n },\r\n /**\r\n * Indicates if this element was already measured.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Was element already measured?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (!value) {\r\n this._measuredWidth = 0;\r\n this._measuredHeight = 0;\r\n //this._pixelHeight = 0;\r\n //this._pixelWidth = 0;\r\n }\r\n if (this._isMeasured != value) {\r\n this._isMeasured = value;\r\n this.invalidatePosition();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Checks if the this element has any of its parts overlapping with another\r\n * element.\r\n *\r\n * @todo Description (review)\r\n * @param sprite Second element to test again\r\n * @return Overlapping?\r\n */\r\n Sprite.prototype.hitTest = function (sprite) {\r\n // validate, otherwise we will not know measuredWidth and measuredHeight\r\n if (this.invalid) {\r\n this.validate();\r\n }\r\n if (sprite.invalid) {\r\n sprite.validate();\r\n }\r\n var ax1 = this.pixelX + this.maxLeft;\r\n var ay1 = this.pixelY + this.maxTop;\r\n var ax2 = ax1 + this.maxRight;\r\n var ay2 = ay1 + this.maxBottom;\r\n var bx1 = sprite.pixelX + sprite.maxLeft;\r\n var by1 = sprite.pixelY + sprite.maxTop;\r\n var bx2 = bx1 + sprite.maxRight;\r\n var by2 = by1 + sprite.maxBottom;\r\n return !(bx1 > ax2 || bx2 < ax1 || by1 > ay2 || by2 < ay1);\r\n };\r\n Object.defineProperty(Sprite.prototype, \"inited\", {\r\n /**\r\n * ==========================================================================\r\n * STATE-RELATED\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns `true` if Sprite has already finished initializing.\r\n *\r\n * @return Initialized?\r\n */\r\n get: function () {\r\n return this._inited;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns `true` if Sprite has already finished initializing and is ready.\r\n *\r\n * If this object is a [[Container]] it will wait for all of its children\r\n * are ready before becoming ready itself and firing a `\"ready\"` event.\r\n *\r\n * @return is ready?\r\n */\r\n Sprite.prototype.isReady = function () {\r\n return this._ready;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"states\", {\r\n /**\r\n * Returns a collection of element's available [[SpriteState]] entries.\r\n *\r\n * @see {@link SpriteState}\r\n * @return States\r\n */\r\n get: function () {\r\n if (!this._states) {\r\n var state = new SpriteState();\r\n // works\r\n this._states = new DictionaryTemplate(state);\r\n // TODO what about removeKey ?\r\n this._disposers.push(this._states.events.on(\"insertKey\", this.processState, this, false));\r\n this._disposers.push(this._states.events.on(\"setKey\", this.processState, this, false));\r\n this._disposers.push(new DictionaryDisposer(this._states));\r\n this._disposers.push(state);\r\n }\r\n return this._states;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"hiddenState\", {\r\n /**\r\n * Returns a [[SpriteState]] object for \"hidden\" state.\r\n *\r\n * This is a shortcut to `this.states.getKey(\"hidden\")`.\r\n *\r\n * @return Hidden state\r\n */\r\n get: function () {\r\n if (!this.states.getKey(\"hidden\")) {\r\n var hiddenState = this.states.create(\"hidden\");\r\n hiddenState.properties.opacity = 0;\r\n hiddenState.properties.visible = false;\r\n }\r\n return this.states.getKey(\"hidden\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"defaultState\", {\r\n /**\r\n * Returns a [[SpriteState]] object for \"default\" state.\r\n *\r\n * This is a shortcut to `this.states.getKey(\"default\")`.\r\n *\r\n * @return Hidden state\r\n */\r\n get: function () {\r\n if (!this.states.getKey(\"default\")) {\r\n var defaultState = this.states.create(\"default\");\r\n defaultState.properties.opacity = 1;\r\n }\r\n return this.states.getKey(\"default\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Checks if some key states are defined and updates Sprite properties\r\n * accordingly.\r\n *\r\n * For example if there's a state \"down\" defined for Sprite, we automatically\r\n * make it \"clickable\".\r\n *\r\n * @ignore Exclude from docs\r\n * @param event An event which caused state list update\r\n */\r\n Sprite.prototype.processState = function (event) {\r\n var state = event.newValue;\r\n state.sprite = this;\r\n state.name = event.key;\r\n if (this.states.hasKey(\"hover\") || (this.showTooltipOn == \"hover\" && ($type.hasValue(this.tooltipHTML) || $type.hasValue(this.tooltipText)))) {\r\n this.hoverable = true;\r\n }\r\n if (this.states.hasKey(\"down\") || (this.showTooltipOn == \"hover\" && ($type.hasValue(this.tooltipHTML) || $type.hasValue(this.tooltipText)))) {\r\n this.clickable = true;\r\n }\r\n if (this.states.hasKey(\"focus\")) {\r\n this.focusable = true;\r\n }\r\n // Propagate the new state to clones\r\n if (this.applyOnClones) {\r\n var clones = this.clones.values;\r\n var length_1 = clones.length;\r\n for (var i = 0; i < length_1; ++i) {\r\n var clone = clones[i];\r\n if (!clone.isDisposed()) {\r\n clone.states.setKey(state.name, state);\r\n }\r\n }\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"animations\", {\r\n /**\r\n * Returns a list elements's animations currently being played.\r\n *\r\n * If the list has not been initialized it is created.\r\n *\r\n * @return List of animations\r\n */\r\n get: function () {\r\n if (!this._animations) {\r\n this._animations = [];\r\n this._disposers.push(new AnimationDisposer(this._animations));\r\n }\r\n return this._animations;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Converts element's local coordinates to the coordinates within the main\r\n * chart container.\r\n *\r\n * @param point Local point\r\n * @return Global point\r\n */\r\n Sprite.prototype.getSvgPoint = function (point) {\r\n try {\r\n // Calculate SVG point\r\n var bbox = this.htmlContainer.getBoundingClientRect();\r\n return {\r\n \"x\": point.x - bbox.left,\r\n \"y\": point.y - bbox.top\r\n };\r\n }\r\n catch (e) {\r\n return point;\r\n }\r\n };\r\n /**\r\n * Creates and starts an [[Animation]] with given `animationOptions`.\r\n *\r\n * @see {@link Animation} for additional information about available options\r\n * @param animationOptions Animation options\r\n * @param duration Duration in milliseconds\r\n * @param easing Easing function\r\n * @return Animation instance\r\n */\r\n Sprite.prototype.animate = function (animationOptions, duration, easing) {\r\n return new Animation(this, animationOptions, duration, easing).start();\r\n };\r\n /**\r\n * Applies a [[SpriteState]] on this element.\r\n *\r\n * The first parameter can either be a name state or a [[SpriteState]]\r\n * instance.\r\n *\r\n * When run, this method will apply SVG properties defined in a\r\n * [[SpriteState]], but only those that are relevant to this particular\r\n * element, i.e. are in the `properties` array.\r\n *\r\n * @see {@link SpriteState}\r\n * @param value A state - name key or instance\r\n * @param transitionDuration Duration of the transition between current and new state\r\n * @param easing An easing function\r\n */\r\n Sprite.prototype.setState = function (value, transitionDuration, easing) {\r\n var state;\r\n if (value instanceof SpriteState) {\r\n this.states.setKey(value.name, value);\r\n state = value;\r\n }\r\n else {\r\n state = this.states.getKey(value);\r\n if (!state) {\r\n return;\r\n }\r\n }\r\n // stop previous transition\r\n // not good - foe expample, we are animating to some \"active\" state and in them middle \"hover\" state happens. then \"active\" stat won't be applied\r\n //if (this._transition) {\r\n //this._transition.stop();\r\n //}\r\n if (state.name == \"hover\") {\r\n if (this.isHidden) {\r\n return;\r\n }\r\n this.isHover = true;\r\n }\r\n if (state.name == \"hidden\") {\r\n this.isHiding = true;\r\n }\r\n else {\r\n if (!this.visible) {\r\n this.setVisibility(state.properties.visible || this.defaultState.properties.visible);\r\n }\r\n }\r\n if (state.name == \"active\") {\r\n this.isActive = true;\r\n }\r\n // we do not set isActive = false here if it's not active, but container does that if setStateOnChildren = true\r\n if (!$type.isNumber(transitionDuration)) {\r\n transitionDuration = state.transitionDuration;\r\n }\r\n if (!$type.hasValue(easing)) {\r\n easing = state.transitionEasing;\r\n }\r\n return this.transitTo(state, transitionDuration, easing);\r\n };\r\n /**\r\n * Applies proper state based on the condition of the element. A condition is\r\n * deducted in this order:\r\n * * \"hover\" if Sprite has currently any pointers over it\r\n * * \"down\" if Sprite has any pointers (touch or mouse) currently pressed over it\r\n * * \"focus\" if Sprite has currently got focus (accessibility)\r\n * * \"hidden\" if Sprite is currently hidden\r\n *\r\n * Returns an [[Animation]] object, which is handling gradual transition from\r\n * current values of properties, to the new target state(s).\r\n *\r\n * @param duration Duration for the animation (ms)\r\n * @return [[Animation]] object which is handling the transition\r\n */\r\n Sprite.prototype.applyCurrentState = function (duration) {\r\n //if (!this.isHidden) { // this was done for hover state not to take effect if \"hidden\" is actually visible, need to think about it.\r\n var animation = this.setState(this.defaultState, duration);\r\n if (this.isHover) {\r\n animation = this.setState(\"hover\", duration);\r\n }\r\n if (this.isDown && this.interactions.downPointers.length) {\r\n animation = this.setState(\"down\", duration);\r\n }\r\n this.isFocused = this.isFocused;\r\n if (this.isActive) {\r\n animation = this.setState(\"active\", duration);\r\n if (this.isHover && this.states.hasKey(\"hoverActive\")) {\r\n animation = this.setState(\"hoverActive\", duration);\r\n }\r\n }\r\n return animation;\r\n //}\r\n };\r\n /**\r\n * Starts an [[Animation]] of the properties to specific values as they are\r\n * set in `state`.\r\n *\r\n * @ignore Exclude from docs\r\n * @param state Target State\r\n * @param duration Duration in milliseconds\r\n * @param easing Easing function\r\n * @return Transition Animation\r\n */\r\n Sprite.prototype.transitTo = function (state, duration, easing) {\r\n var _this = this;\r\n // Init\r\n var options = [], propValues = state.allValues, transition;\r\n // todo: do this for numeric/color properties only?\r\n // @todo use state.getPropertyValue instead\r\n $object.each(propValues, function (propertyName, finalValue) {\r\n var currentValue = _this[propertyName];\r\n // save current value to default state. this solves a big problem where values must be set both on sprite and default state\r\n if (finalValue != currentValue && _this.defaultState.properties[propertyName] == undefined) {\r\n _this.defaultState.properties[propertyName] = currentValue;\r\n }\r\n //if (finalValue != currentValue && $type.hasValue(finalValue)) {\r\n if (finalValue != \"__unset\") {\r\n var option = { from: currentValue, to: finalValue, property: propertyName };\r\n options.push(option);\r\n }\r\n });\r\n if (options.length > 0) {\r\n transition = this.animate(options, duration, easing);\r\n if (transition && !transition.isFinished()) {\r\n // TODO should this use events.once ?\r\n // TODO push onto _disposers array ?\r\n this._disposers.push(transition.events.on(\"animationended\", function () {\r\n _this.dispatchImmediately(\"transitionended\");\r\n }));\r\n }\r\n else {\r\n this.dispatchImmediately(\"transitionended\");\r\n }\r\n }\r\n // apply filters if set\r\n if (state.filters.length > 0) {\r\n var newFilters_1 = [];\r\n // check for the same filters\r\n $iter.each(state.filters.iterator(), function (stateFilter) {\r\n var newFilter = stateFilter.clone();\r\n newFilters_1.push(newFilter);\r\n var animationOptions = [];\r\n $iter.each(_this.filters.iterator(), function (currentFilter) {\r\n // if we have the same filters\r\n if (currentFilter.className == newFilter.className) {\r\n if (!$iter.contains(_this.defaultState.filters.iterator(), function (x) { return x.className === newFilter.className; })) {\r\n _this.defaultState.filters.push(currentFilter);\r\n }\r\n $object.each(newFilter.properties, function (propertyName, newValue) {\r\n var currentValue = currentFilter.properties[propertyName];\r\n // if values are not the same, push to animation options array\r\n if (currentValue != newValue) {\r\n animationOptions.push({ property: propertyName, from: currentValue, to: newValue });\r\n }\r\n });\r\n }\r\n });\r\n // animate to new value\r\n newFilter.animate(animationOptions, duration, easing);\r\n });\r\n this.filters.clear();\r\n this.filters.pushAll(newFilters_1);\r\n }\r\n return transition;\r\n };\r\n /**\r\n * Returns `true` if Sprite is currently transiting from one state/value to\r\n * another.\r\n *\r\n * @return Is in transition?\r\n */\r\n Sprite.prototype.isInTransition = function () {\r\n return this.animations.length > 0;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"isHover\", {\r\n /**\r\n * @return Is hovered?\r\n */\r\n get: function () {\r\n if (this.isInteractive()) {\r\n return this.interactions.isHover;\r\n }\r\n return false;\r\n },\r\n /**\r\n * Indicates if this element has a mouse pointer currently hovering\r\n * over it, or if it has any touch pointers pressed on it.\r\n *\r\n * You can force element to be \"hovered\" manually, by setting this property\r\n * to `true`.\r\n *\r\n * @param value Is hovered?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (value !== this.isHover) {\r\n if (this.isInteractive()) {\r\n this.interactions.isHover = value;\r\n if (value) {\r\n this.handleOver();\r\n }\r\n else {\r\n this.interactions.isRealHover = false;\r\n this.handleOut();\r\n }\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"isDragged\", {\r\n /**\r\n * Returns indicator if this element is being dragged at the moment.\r\n *\r\n * @return Is dragged?\r\n */\r\n get: function () {\r\n return this._isDragged;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"isResized\", {\r\n /**\r\n * Returns indicator if this element is being resized at the moment.\r\n *\r\n * @return Is resized?\r\n */\r\n get: function () {\r\n return this._isResized;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"isDown\", {\r\n /**\r\n * @return Is down?\r\n */\r\n get: function () {\r\n if (this.isInteractive()) {\r\n return this.interactions.isDown;\r\n }\r\n return false;\r\n },\r\n /**\r\n * Indicates if this element has any pointers (mouse or touch) pressing down\r\n * on it.\r\n *\r\n * @param value Is down?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.isInteractive() && this.isDown != value) {\r\n this.interactions.isDown = value;\r\n if (value) {\r\n this.handleDown();\r\n }\r\n else {\r\n this.handleUp();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"isFocused\", {\r\n /**\r\n * @return Is focused?\r\n */\r\n get: function () {\r\n if (this.isInteractive()) {\r\n return this.interactions.isFocused;\r\n }\r\n return false;\r\n },\r\n /**\r\n * Indicates if this element is focused (possibly by tab navigation).\r\n *\r\n * @param value Is focused?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.focusable && this.isFocused != value) {\r\n if (this.isInteractive()) {\r\n this.interactions.isFocused = value;\r\n if (value === true) {\r\n this.handleFocus();\r\n }\r\n else {\r\n this.handleBlur();\r\n }\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"isActive\", {\r\n /**\r\n * @return Is active?\r\n */\r\n get: function () {\r\n return this._isActive;\r\n },\r\n /**\r\n * Indicates if this element is currently active (toggled on) or not\r\n * (toggled off).\r\n *\r\n * @param value Is active?\r\n */\r\n set: function (value) {\r\n this.setActive(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Sprite.prototype.setActive = function (value) {\r\n value = $type.toBoolean(value);\r\n if (this._isActive !== value) {\r\n this._isActive = value;\r\n if (value && this.states.hasKey(\"active\")) {\r\n this.setState(\"active\");\r\n if (this.isHover && this.states.hasKey(\"hoverActive\")) {\r\n this.setState(\"hoverActive\");\r\n }\r\n }\r\n else {\r\n this.applyCurrentState();\r\n }\r\n this.dispatchImmediately(\"toggled\");\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"disabled\", {\r\n /**\r\n * @return Disabled?\r\n */\r\n get: function () {\r\n //if(this._internalDisabled){\r\n //\treturn true;\r\n //}\r\n var current = this.getPropertyValue(\"disabled\");\r\n if ($type.hasValue(current)) {\r\n return current;\r\n }\r\n else {\r\n if (this.virtualParent) {\r\n return this.virtualParent.disabled;\r\n }\r\n if (this._parent) {\r\n return this._parent.disabled;\r\n }\r\n }\r\n return false;\r\n },\r\n /**\r\n * Controls if element is disabled.\r\n *\r\n * A disabled element is hidden, and is removed from any processing, layout\r\n * calculations, and generally treated as if it does not exist.\r\n *\r\n * The element itself is not destroyed, though. Setting this back to `false`,\r\n * will \"resurrect\" the element.\r\n *\r\n * @param value Disabled?\r\n */\r\n set: function (value) {\r\n this.setDisabled(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Sprite.prototype.setDisabled = function (value) {\r\n value = $type.toBoolean(value);\r\n var current = this.getPropertyValue(\"disabled\");\r\n if (current != value) {\r\n this.setPropertyValue(\"disabled\", value, true);\r\n if (value) {\r\n this.parent = this._parent;\r\n this.removeFromInvalids();\r\n this.group.attr({ \"display\": \"none\" });\r\n this.dispatch(\"disabled\");\r\n }\r\n else {\r\n if (this._parent) {\r\n var group = this._parent.element;\r\n if (!group.hasChild(this.group)) {\r\n group.add(this.group);\r\n }\r\n }\r\n if (this instanceof Container) {\r\n this.deepInvalidate();\r\n if (this._background) {\r\n this._background.invalidate();\r\n }\r\n }\r\n else {\r\n this.invalidate();\r\n }\r\n if (!this.__disabled) {\r\n this.removeSVGAttribute(\"display\");\r\n }\r\n this.dispatch(\"enabled\");\r\n }\r\n this.dispatch(\"transformed\");\r\n system.requestFrame();\r\n return true;\r\n }\r\n return false;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"__disabled\", {\r\n /**\r\n * @ignore\r\n * @return Disabled?\r\n */\r\n get: function () {\r\n return this._internalDisabled;\r\n },\r\n /**\r\n * Internal disable method.\r\n *\r\n * Do not use it for disabling elements. Use `disabled` accessor instead.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Disabled?\r\n */\r\n set: function (value) {\r\n if (this._internalDisabled != value) {\r\n this._internalDisabled = value;\r\n this._updateDisabled = true;\r\n this.invalidatePosition(); // better use this instead of invalidate()\r\n if (!value) {\r\n this.invalidate();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"numberFormatter\", {\r\n /**\r\n * @return A [[NumberFormatter]] instance to be used\r\n */\r\n get: function () {\r\n if (this._numberFormatter) {\r\n return this._numberFormatter;\r\n }\r\n else if (this.virtualParent) {\r\n return this.virtualParent.numberFormatter;\r\n }\r\n else if (this._parent) {\r\n return this._parent.numberFormatter;\r\n }\r\n this._numberFormatter = new NumberFormatter();\r\n this._numberFormatter.language = this.language;\r\n return this.numberFormatter;\r\n },\r\n /**\r\n * ==========================================================================\r\n * FORMATTERS AND OTHER EXTERNAL HELPERS\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * A [[NumberFormatter]] instance.\r\n *\r\n * This is used to format numbers.\r\n *\r\n * ```TypeScript\r\n * chart.numberFormatter.numberFormat = \"#,###.#####\";\r\n * ```\r\n * ```JavaScript\r\n * chart.numberFormatter.numberFormat = \"#,###.#####\";\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"numberFormatter\": {\r\n * \"numberFormat\": \"#,###.#####\"\r\n * }\r\n * }\r\n * ```\r\n *\r\n * You can set a separate instance of formatter for each\r\n * individual element. However that would be unnecessary overhead as\r\n * all elements would automatically inherit formatter from their parents,\r\n * all the way up to the chart itself.\r\n *\r\n *\r\n * @see {@link NumberFormatter} for more info on formatting numbers\r\n * @param value An instance of NumberFormatter\r\n */\r\n set: function (value) {\r\n this._numberFormatter = value;\r\n this._numberFormatter.language = this.language;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"dateFormatter\", {\r\n /**\r\n * @return An instance of DateFormatter\r\n */\r\n get: function () {\r\n if (this._dateFormatter) {\r\n return this._dateFormatter;\r\n }\r\n else if (this.virtualParent) {\r\n return this.virtualParent.dateFormatter;\r\n }\r\n else if (this._parent) {\r\n return this._parent.dateFormatter;\r\n }\r\n this._dateFormatter = new DateFormatter();\r\n this._dateFormatter.language = this.language;\r\n return this.dateFormatter;\r\n },\r\n /**\r\n * A [[DateFormatter]] instance.\r\n *\r\n * This is used to format dates, e.g. on a date axes, balloons, etc.\r\n *\r\n * ```TypeScript\r\n * chart.dateFormatter.dateFormat = \"yyyy-MM-dd\";\r\n * ```\r\n * ```JavaScript\r\n * chart.dateFormatter.dateFormat = \"yyyy-MM-dd\";\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"dateFormatter\": {\r\n * \"dateFormat\": \"yyyy-MM-dd\"\r\n * }\r\n * }\r\n * ```\r\n *\r\n * You can set a separate instance of formatter for each\r\n * individual element. However that would be unnecessary overhead as\r\n * all elements would automatically inherit formatter from their parents,\r\n * all the way up to the chart itself.\r\n *\r\n * @see {@link DateFormatter} for more info on dates formatting\r\n * @param value An instance of DateFormatter\r\n */\r\n set: function (value) {\r\n this._dateFormatter = value;\r\n this._dateFormatter.language = this.language;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"durationFormatter\", {\r\n /**\r\n * @return An instance of DurationFormatter\r\n */\r\n get: function () {\r\n if (this._durationFormatter) {\r\n return this._durationFormatter;\r\n }\r\n else if (this.virtualParent) {\r\n return this.virtualParent.durationFormatter;\r\n }\r\n else if (this._parent) {\r\n return this._parent.durationFormatter;\r\n }\r\n this._durationFormatter = new DurationFormatter();\r\n this._durationFormatter.language = this.language;\r\n return this.durationFormatter;\r\n },\r\n /**\r\n * A [[DurationFormatter]] instance.\r\n *\r\n * This is used to format numbers as durations, e.g. on a value axes.\r\n *\r\n * You can set a separate instance of formatter for each\r\n * individual element. However that would be unnecessary overhead as\r\n * all elements would automatically inherit formatter from their parents,\r\n * all the way up to the chart itself.\r\n *\r\n * @see {@link DurationFormatter} for more info on durations\r\n * @param value An instance of DurationFormatter\r\n */\r\n set: function (value) {\r\n this._durationFormatter = value;\r\n this._durationFormatter.language = this.language;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"language\", {\r\n /**\r\n * @return An instance of Language\r\n */\r\n get: function () {\r\n var language = this._language.get();\r\n if (language) {\r\n return language;\r\n }\r\n else if (this.virtualParent) {\r\n return this.virtualParent.language;\r\n }\r\n else if (this._parent) {\r\n return this._parent.language;\r\n }\r\n language = new Language();\r\n this.language = language;\r\n return language;\r\n },\r\n /**\r\n * A [[Language]] instance to use for translations.\r\n *\r\n * Normally it is enough to set language for the top-most element - chart.\r\n *\r\n * All other element child elements will automatically re-use that language\r\n * object.\r\n *\r\n * @param value An instance of Language\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n if (this._language.get() !== value) {\r\n this._language.set(value, value.events.on(\"localechanged\", function (ev) {\r\n if (_this._numberFormatter) {\r\n _this._numberFormatter.language = _this.language;\r\n }\r\n if (_this._dateFormatter) {\r\n _this._dateFormatter.language = _this.language;\r\n }\r\n if (_this._durationFormatter) {\r\n _this._durationFormatter.language = _this.language;\r\n }\r\n if (_this._exporting.get()) {\r\n var exporting = _this._exporting.get();\r\n exporting.numberFormatter.language = _this.language;\r\n exporting.dateFormatter.language = _this.language;\r\n exporting.durationFormatter.language = _this.language;\r\n exporting.language = _this.language;\r\n }\r\n if (_this instanceof Container) {\r\n _this.deepInvalidate();\r\n }\r\n }));\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * ==========================================================================\r\n * DATA-RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Parses the string for meta tags `{tag}` and replaces them with a real\r\n * value. Supports straight up tags referring to the field in data, i.e.\r\n * `{value}` or tags with additional formatting info. E.g.:\r\n *\r\n * ```Text\r\n * {myfield.formatDate(\"yyyy-MM-dd\")}\r\n * {myfield.formatDate()}\r\n * {myfield.formatNumber(\"#,####.00\")}\r\n * {myfield.formatNumber()}\r\n * {myField.formatDuration(\"mm:ss\")}\r\n * ```\r\n *\r\n * Etc.\r\n *\r\n * This method Will automatically detect and use proper formatter for the\r\n * value.\r\n *\r\n * The source value will be looked up in various places: (in order)\r\n * * Sprite's own `dataItem`\r\n * * Sprite's properties\r\n * * Parent's `dataItem`\r\n * * Parent's properties\r\n *\r\n * @ignore Exclude from docs\r\n * @param string A string to format\r\n * @param dataItem DataItem\r\n * @return Formatted string\r\n */\r\n Sprite.prototype.populateString = function (string, dataItem) {\r\n if ($type.hasValue(string)) {\r\n string = $type.castString(string);\r\n string = getTextFormatter().escape(string);\r\n var tags = string.match(/\\{([^}]+)\\}/g);\r\n var i = void 0;\r\n if (tags) {\r\n for (i = 0; i < tags.length; i++) {\r\n var tag = tags[i].replace(/\\{([^}]+)\\}/, \"$1\");\r\n var value = this.getTagValue(tag, \"\", dataItem);\r\n if (!$type.hasValue(value)) {\r\n value = \"\";\r\n }\r\n string = string.split(tags[i]).join(value);\r\n }\r\n }\r\n string = getTextFormatter().unescape(string);\r\n }\r\n else {\r\n string = \"\";\r\n }\r\n if (!this._adapterO) {\r\n return string;\r\n }\r\n else {\r\n return this._adapterO.apply(\"populateString\", string);\r\n }\r\n };\r\n /**\r\n * Gets the value from data item and formats it according to specified format.\r\n *\r\n * If `format` is specified, it will use its contents to choose formatter for\r\n * the value. Otherwise it will select formatter accordingly to actual value\r\n * type.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Ability to force certain formatter on known numeric and date values\r\n * @see {@link NumberFormatter}\r\n * @see {@link DateFormatter}\r\n * @see {@link DurationFormatter}\r\n * @param tagName Tag name to replace\r\n * @param format Format to use\r\n * @param dataItem DataItem\r\n * @return Formatted value\r\n */\r\n Sprite.prototype.getTagValue = function (tagName, format, dataItem) {\r\n var value;\r\n if (!$type.hasValue(dataItem)) {\r\n dataItem = this.dataItem;\r\n }\r\n // Parse parts\r\n var parts = [];\r\n var reg = /([^.]+)\\(([^)]*)\\)|([^.]+)/g;\r\n ;\r\n var matches;\r\n while (true) {\r\n matches = reg.exec(tagName);\r\n if (matches === null) {\r\n break;\r\n }\r\n if (matches[3]) {\r\n // Simple property\r\n parts.push({\r\n prop: matches[3]\r\n });\r\n }\r\n else {\r\n // Method\r\n // Parse parameters\r\n var params = [];\r\n if ($utils.trim(matches[2]) != \"\") {\r\n var reg2 = /'([^']*)'|\"([^\"]*)\"|([0-9\\-]+)/g;\r\n var matches2 = void 0;\r\n while (true) {\r\n matches2 = reg2.exec(matches[2]);\r\n if (matches2 === null) {\r\n break;\r\n }\r\n params.push(matches2[1] || matches2[2] || matches2[3]);\r\n }\r\n }\r\n parts.push({\r\n method: matches[1],\r\n params: params\r\n });\r\n }\r\n }\r\n // Check if we can retrieve the value from data item\r\n if (dataItem) {\r\n // Check values\r\n value = this.getTagValueFromObject(parts, dataItem.values);\r\n // Check properties\r\n if (!$type.hasValue(value) || $type.isObject(value)) { // isObject helps to solve problem with date axis, as for example dateX will get dateX from values object and won't get to the dateX date.\r\n value = this.getTagValueFromObject(parts, dataItem);\r\n }\r\n // Check data context\r\n var dataContext = dataItem.dataContext;\r\n if (!$type.hasValue(value) && dataContext) {\r\n value = this.getTagValueFromObject(parts, dataItem.dataContext);\r\n // Maybe it's a literal dot-separated name of the key in dataContext?\r\n if (!$type.hasValue(value)) {\r\n value = this.getTagValueFromObject([{\r\n prop: tagName\r\n }], dataContext);\r\n }\r\n // scond data context level sometimes exist (tree map)\r\n if (!$type.hasValue(value) && dataContext.dataContext) {\r\n value = this.getTagValueFromObject(parts, dataContext.dataContext);\r\n }\r\n }\r\n // Check component's data item\r\n if (!$type.hasValue(value) && dataItem.component && dataItem.component.dataItem !== dataItem) {\r\n value = dataItem.component.getTagValue(tagName, format);\r\n }\r\n }\r\n // Check sprite's properties\r\n if (!$type.hasValue(value)) {\r\n value = this.getTagValueFromObject(parts, this.populateStringFrom || this);\r\n }\r\n // Finally, check the parent\r\n if (!$type.hasValue(value) && this._parent) {\r\n value = this._parent.getTagValue(tagName, format);\r\n }\r\n return value;\r\n };\r\n /**\r\n * Tries to retrieve values from properties of any object, then applies\r\n * proper formatting to it.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (improve)\r\n * @param parts Properties ant methods to access\r\n * @param object Source object\r\n * @param format A specific format to apply\r\n * @return Formatted value\r\n */\r\n Sprite.prototype.getTagValueFromObject = function (parts, object, format) {\r\n var current = object;\r\n var formatApplied = false;\r\n for (var i = 0, len = parts.length; i < len; i++) {\r\n var part = parts[i];\r\n if (part.prop) {\r\n // Regular property\r\n current = current[part.prop];\r\n if (!$type.hasValue(current)) {\r\n // Not set, return undefined\r\n return;\r\n }\r\n }\r\n else {\r\n // Method\r\n switch (part.method) {\r\n case \"formatNumber\":\r\n var numberValue = $utils.anyToNumber(current);\r\n if ($type.hasValue(numberValue)) {\r\n current = this.numberFormatter.format(numberValue, format || part.params[0] || undefined);\r\n formatApplied = true;\r\n }\r\n break;\r\n case \"formatDate\":\r\n var dateValue = void 0;\r\n if ($type.isString(current)) {\r\n dateValue = this.dateFormatter.parse(current);\r\n }\r\n else {\r\n dateValue = $utils.anyToDate(current);\r\n }\r\n if (!$type.isDate(dateValue) || $type.isNaN(dateValue.getTime())) {\r\n // Was not able to get date out of value, quitting and letting\r\n // calling method try another value\r\n return;\r\n }\r\n if ($type.hasValue(dateValue)) {\r\n current = this.dateFormatter.format(dateValue, format || part.params[0] || undefined);\r\n formatApplied = true;\r\n }\r\n break;\r\n case \"formatDuration\":\r\n var durationValue = $utils.anyToNumber(current);\r\n if ($type.hasValue(durationValue)) {\r\n current = this.durationFormatter.format(durationValue, format || part.params[0] || undefined, part.params[1] || undefined);\r\n formatApplied = true;\r\n }\r\n break;\r\n case \"urlEncode\":\r\n case \"encodeURIComponent\":\r\n current = encodeURIComponent(current);\r\n break;\r\n default:\r\n if (current[part.method]) {\r\n current[part.method].apply(this, part.params);\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n // Apply default format if it wasn't applied explicitly\r\n if (!formatApplied) {\r\n var formatParts = [{\r\n method: \"\",\r\n params: format\r\n }];\r\n if (!$type.hasValue(format)) {\r\n // Format is not set\r\n // Determine from the type of the value\r\n if ($type.isNumber(current)) {\r\n formatParts[0].method = \"formatNumber\";\r\n formatParts[0].params = \"\";\r\n }\r\n else if ($type.isDate(current)) {\r\n formatParts[0].method = \"formatDate\";\r\n formatParts[0].params = \"\";\r\n }\r\n }\r\n else {\r\n // Format set\r\n // Try to determine formatter based on the format\r\n var formatterType = $utils.getFormat(format);\r\n // format\r\n if (formatterType === $strings.NUMBER) {\r\n formatParts[0].method = \"formatNumber\";\r\n }\r\n else if (formatterType === $strings.DATE) {\r\n formatParts[0].method = \"formatDate\";\r\n }\r\n else if (formatterType === $strings.DURATION) {\r\n formatParts[0].method = \"formatDuration\";\r\n }\r\n }\r\n // Apply format\r\n if (formatParts[0].method) {\r\n current = this.getTagValueFromObject(formatParts, current);\r\n }\r\n }\r\n return current;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"dataItem\", {\r\n /**\r\n * @return [[DataItem]]\r\n */\r\n get: function () {\r\n if (!this._dataItem) {\r\n if (this.virtualParent) {\r\n return this.virtualParent.dataItem;\r\n }\r\n if (this._parent) {\r\n return this._parent.dataItem;\r\n }\r\n }\r\n return this._dataItem;\r\n },\r\n /**\r\n * A [[DataItem]] to use as element's data source.\r\n *\r\n * @todo Review type\r\n * @param dataItem DataItem\r\n */\r\n set: function (dataItem) {\r\n //an not use this[\"_dataItem\"] here, as we return parent data item if this sprite doesn't have one.\r\n // @todo:think about it\r\n this.setDataItem(dataItem);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets currently used [[DataItem]].\r\n *\r\n * If the element has also `configField` set, it will also look for any\r\n * config in DataItem's data context to apply to this element.\r\n *\r\n * @param dataItem DataItem\r\n */\r\n Sprite.prototype.setDataItem = function (dataItem) {\r\n var _this = this;\r\n if (this._dataItem != dataItem) {\r\n this._dataItem = dataItem;\r\n if (dataItem) {\r\n if (this.configField) {\r\n var dataContext_1 = dataItem.dataContext;\r\n if (dataContext_1) {\r\n this.config = dataContext_1[this.configField];\r\n if (!this.config && dataContext_1.dataContext) {\r\n this.config = dataContext_1.dataContext[this.configField];\r\n }\r\n }\r\n }\r\n var dataContext_2 = dataItem.dataContext;\r\n if (dataContext_2) {\r\n var dataContext2_1 = dataContext_2.dataContext;\r\n $object.each(this.propertyFields, function (propertyName, fieldValue) {\r\n if ($type.hasValue(dataContext_2[fieldValue])) {\r\n var anyThis = _this;\r\n anyThis[propertyName] = dataContext_2[fieldValue];\r\n }\r\n else {\r\n if (dataContext2_1) {\r\n var value = dataContext2_1[fieldValue];\r\n if ($type.hasValue(value)) {\r\n var anyThis = _this;\r\n anyThis[propertyName] = value;\r\n }\r\n }\r\n }\r\n });\r\n }\r\n }\r\n this.invalidate();\r\n }\r\n };\r\n /**\r\n * ==========================================================================\r\n * PROPERTY UTILITIES\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns element's property value.\r\n *\r\n * Will check if there are any bindings with [[DataItem]].\r\n *\r\n * Will also apply any adapters bound to `propertyName`.\r\n *\r\n * @param propertyName Property name\r\n * @return Property value\r\n */\r\n Sprite.prototype.getPropertyValue = function (propertyName) {\r\n var propValue = this.properties[propertyName];\r\n // Apply adapter\r\n if (!this._isTemplate) {\r\n if (this._adapterO) {\r\n propValue = this._adapterO.apply(propertyName, propValue);\r\n }\r\n propValue = globalAdapter.applyAll(this, propertyName, propValue);\r\n }\r\n return propValue;\r\n };\r\n Sprite.prototype.setColorProperty = function (property, value, invalidate) {\r\n var currentValue = this.properties[property];\r\n if (value instanceof Color && currentValue instanceof Color && value.toString() == currentValue.toString()) {\r\n return false;\r\n }\r\n else {\r\n return this.setPropertyValue(property, value, invalidate);\r\n }\r\n };\r\n Sprite.prototype.setPercentProperty = function (property, value, invalidate, transform, precision, floor) {\r\n value = $type.toNumberOrPercent(value);\r\n if ($type.isNumber(value)) {\r\n if ($type.isNumber(precision)) {\r\n value = $math.round(value, precision, floor);\r\n }\r\n return this.setPropertyValue(property, value, invalidate, transform);\r\n }\r\n else {\r\n var currentValue = this.properties[property];\r\n if (value instanceof Percent && currentValue instanceof Percent && value.value == currentValue.value) {\r\n return false;\r\n }\r\n else {\r\n return this.setPropertyValue(property, value, invalidate, transform);\r\n }\r\n }\r\n };\r\n /**\r\n * Sets elements's property value. Will also propagate the same property value\r\n * on all element's clones.\r\n *\r\n * @param property Property\r\n * @param value Value\r\n * @param invalidate Should the sprite be invalidated, cause it's re-rendering\r\n * @param transform Re-apply positioning of the element\r\n * @return Did the value change? It will return `true` if the new value and the old value of the property are not the same\r\n * @todo Review propagation to clones. Right now we simply check if clone is disposed before setting the same property on it. It's better to remove from clone list altogether.\r\n */\r\n Sprite.prototype.setPropertyValue = function (property, value, invalidate, transform) {\r\n if (this.properties[property] !== value && !this.isDisposed()) {\r\n this.properties[property] = value;\r\n if (this.events.isEnabled(\"propertychanged\")) {\r\n var event_1 = {\r\n type: \"propertychanged\",\r\n target: this,\r\n property: property\r\n };\r\n this.events.dispatchImmediately(\"propertychanged\", event_1);\r\n }\r\n if (invalidate) {\r\n this.invalidate();\r\n }\r\n if (transform) {\r\n this.invalidatePosition();\r\n }\r\n if (this.applyOnClones) {\r\n var clones = this.clones.values;\r\n var length_2 = clones.length;\r\n for (var i = 0; i < length_2; ++i) {\r\n var clone = clones[i];\r\n if (!clone.isDisposed()) {\r\n //(<Sprite>clone).setPropertyValue(<any>property, value, invalidate, transform);\r\n clone[property] = value;\r\n }\r\n }\r\n }\r\n return true;\r\n }\r\n return false;\r\n };\r\n Sprite.prototype.bind = function (property, source, bindToProperty, modifier) {\r\n var _this = this;\r\n if (bindToProperty === void 0) { bindToProperty = property; }\r\n if ($type.hasValue(this._bindings[property])) {\r\n this._bindings[property].dispose();\r\n }\r\n // set current value\r\n this[property] = source[bindToProperty];\r\n //source.addEventListener(AMEvent.PROPERTY_CHANGED, this.handleBindings, false, this);\r\n this._bindings[property] = source.events.on(\"propertychanged\", function (event) {\r\n if (event.property === bindToProperty) {\r\n var value = source[bindToProperty];\r\n if (modifier) {\r\n value = modifier(value);\r\n }\r\n // TODO clonesById\r\n _this[property] = value;\r\n }\r\n });\r\n };\r\n /**\r\n * Sets up and obeserver function to monitor changes in particular property\r\n * or properties.\r\n *\r\n * @ignore Exclude from docs\r\n * @param property Element's property name\r\n * @param listener Handler function\r\n * @param context Context for handler function\r\n * @returns Event Disposer\r\n */\r\n Sprite.prototype.observe = function (property, listener, context, shouldClone) {\r\n var _this = this;\r\n return new MultiDisposer($array.map($array.toArray(property), function (prop) {\r\n return _this.events.on(\"propertychanged\", function (e) {\r\n if (e.property === prop) {\r\n listener.call(context, e);\r\n }\r\n }, context, shouldClone);\r\n }));\r\n };\r\n /**\r\n * ==========================================================================\r\n * ACCESSIBILITY-RELATED PROPERTIES\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Applies accessibility to the SVG element.\r\n *\r\n * Adds `<title>` and `<description>` elements as well as `aria-labelledby`\r\n * and `role` properties.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.applyAccessibility = function () {\r\n // Check if we need to add label and description\r\n var title = this.readerTitle, description = this.readerDescription, role = this.role, hidden = this.readerHidden, checked = this.readerChecked, controls = this.readerControls, live = this.readerLive, orientation = this.readerOrientation, valueNow = this.readerValueNow, valueText = this.readerValueText;\r\n // Init label/describe ids\r\n var labelledByIds = [];\r\n var describedByIds = [];\r\n var labelledBy = this.readerLabelledBy;\r\n if (labelledBy) {\r\n labelledByIds.push(labelledBy);\r\n }\r\n var describedBy = this.readerDescribedBy;\r\n if (describedBy) {\r\n describedByIds.push(describedBy);\r\n }\r\n // Add arial-label attribute if present\r\n // If not readerTitle and labelledBy is set we will use <title> element\r\n // instead of aria-label\r\n // TODO: should we check agains this.showSystemTooltip?\r\n if (title) {\r\n if (labelledByIds.length || this.showSystemTooltip) {\r\n var titleElement = this.titleElement;\r\n var titleId = this.uid + \"-title\";\r\n if (titleElement.node.textContent != title) {\r\n titleElement.node.textContent = title;\r\n titleElement.attr({ id: titleId });\r\n }\r\n labelledByIds.push(titleId);\r\n }\r\n else {\r\n if (this._titleElement) {\r\n this.group.removeElement(this._titleElement);\r\n this._titleElement = undefined;\r\n }\r\n this.setSVGAttribute({\r\n \"aria-label\": title\r\n });\r\n }\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-label\");\r\n if (this._titleElement) {\r\n this.group.removeElement(this._titleElement);\r\n this._titleElement = undefined;\r\n }\r\n }\r\n // Add description\r\n if (description) {\r\n var descriptionElement = this.descriptionElement;\r\n var descriptionId = this.uid + \"-description\";\r\n if (descriptionElement.node.textContent != description) {\r\n descriptionElement.node.textContent = description;\r\n descriptionElement.attr({ id: descriptionId });\r\n }\r\n describedByIds.push(descriptionId);\r\n }\r\n else if (this._descriptionElement) {\r\n this.group.removeElement(this._descriptionElement);\r\n this._descriptionElement = undefined;\r\n }\r\n // Add label and described properties\r\n if (labelledByIds.length) {\r\n this.setSVGAttribute({ \"aria-labelledby\": labelledByIds.join(\" \") });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-labelledby\");\r\n }\r\n if (describedByIds.length) {\r\n this.setSVGAttribute({ \"aria-describedby\": describedByIds.join(\" \") });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-describedby\");\r\n }\r\n // Apply role\r\n if (role) {\r\n this.setSVGAttribute({ \"role\": role });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"role\");\r\n }\r\n // Apply aria-hidden\r\n if (hidden) {\r\n this.setSVGAttribute({ \"aria-hidden\": \"true\" });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-hidden\");\r\n }\r\n // Apply aria-checked\r\n if (checked) {\r\n this.setSVGAttribute({ \"aria-checked\": \"true\" });\r\n }\r\n else if (checked === false) {\r\n this.setSVGAttribute({ \"aria-checked\": \"false\" });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-checked\");\r\n }\r\n // Apply aria-controls\r\n if (controls) {\r\n this.setSVGAttribute({ \"aria-controls\": controls });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-controls\");\r\n }\r\n // Apply aria-live\r\n if (live) {\r\n this.setSVGAttribute({ \"aria-live\": live });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-live\");\r\n }\r\n // Apply aria-orientation\r\n if (orientation) {\r\n this.setSVGAttribute({ \"aria-orientation\": orientation });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-orientation\");\r\n }\r\n // Apply aria-valuenow\r\n if (valueNow) {\r\n this.setSVGAttribute({ \"aria-valuenow\": valueNow });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-valuenow\");\r\n }\r\n // Apply aria-valuetext\r\n if (valueText) {\r\n this.setSVGAttribute({ \"aria-valuetext\": valueText });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-valuetext\");\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"readerTitle\", {\r\n /**\r\n * @return Title\r\n */\r\n get: function () {\r\n var title = this.getPropertyValue(\"readerTitle\");\r\n if ($type.hasValue(title) && this.dataItem) {\r\n return this.populateString(title);\r\n }\r\n return title;\r\n },\r\n /**\r\n * Screen reader title of the element.\r\n *\r\n * @param value Title\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerTitle\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerDescription\", {\r\n /**\r\n * @return Description\r\n */\r\n get: function () {\r\n var description = this.getPropertyValue(\"readerDescription\");\r\n if ($type.hasValue(description) && this.dataItem) {\r\n return this.populateString(description);\r\n }\r\n return this.getPropertyValue(\"readerDescription\");\r\n },\r\n /**\r\n * Screen reader description of the element.\r\n *\r\n * @param value Description\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerDescription\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"role\", {\r\n /**\r\n * @return Role\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"role\");\r\n },\r\n /**\r\n * A WAI-ARIA role for the element.\r\n *\r\n * @see {@link https://www.w3.org/TR/wai-aria-1.1/#role_definitions} for more information on WAI-ARIA roles\r\n * @param value Role\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"role\", value)) {\r\n this.applyAccessibility();\r\n if (value == \"slider\") {\r\n this.setSVGAttribute({ \"aria-valuemin\": \"0\" });\r\n this.setSVGAttribute({ \"aria-valuemax\": \"100\" });\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerHidden\", {\r\n /**\r\n * @return Hidden?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"readerHidden\");\r\n },\r\n /**\r\n * Controls if element should be hidden from screen readers.\r\n *\r\n * @see {@link https://www.w3.org/TR/wai-aria-1.1/#aria-hidden} for more information\r\n * @param value Hidden?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"readerHidden\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerChecked\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Checked?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"readerChecked\");\r\n },\r\n /**\r\n * Controls if element is currently marked as \"checked\".\r\n *\r\n * @ignore Exclude from docs\r\n * @see {@link https://www.w3.org/TR/wai-aria-1.1/#aria-checked} for more information\r\n * @param value Checked?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"readerChecked\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerControls\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Setting value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"readerControls\");\r\n },\r\n /**\r\n * A `uid` of an element this element controls.\r\n *\r\n * @ignore Exclude from docs\r\n * @see {@link https://www.w3.org/TR/wai-aria-1.1/#aria-controls} for more information\r\n * @param value Setting value\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerControls\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerLive\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Setting value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"readerLive\");\r\n },\r\n /**\r\n * Controls accessibility setting \"aria-live\" for the element.\r\n *\r\n * @ignore Exclude from docs\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions} for more information\r\n * @param value Setting value\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerLive\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerLabelledBy\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Target element\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"readerLabelledBy\");\r\n },\r\n /**\r\n * A `uid` of an element that describes this element.\r\n *\r\n * @ignore Exclude from docs\r\n * @see {@link https://www.w3.org/TR/wai-aria-1.1/#aria-labelledby} for more information\r\n * @param value Target element\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerLabelledBy\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerDescribedBy\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Target element\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"readerDescribedBy\");\r\n },\r\n /**\r\n * A `uid` of an element that describes this element.\r\n *\r\n * @ignore Exclude from docs\r\n * @see {@link https://www.w3.org/TR/wai-aria-1.1/#aria-describedby} for more information\r\n * @param value Target element\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerDescribedBy\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerOrientation\", {\r\n /**\r\n * @return Orientation\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"readerOrientation\");\r\n },\r\n /**\r\n * Orientation of the element.\r\n *\r\n * @since 4.7.16\r\n * @param value Orientation\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerOrientation\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerValueNow\", {\r\n /**\r\n * @return Current value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"readerValueNow\");\r\n },\r\n /**\r\n * Current value of the element.\r\n *\r\n * @since 4.7.16\r\n * @param value Current value\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerValueNow\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerValueText\", {\r\n /**\r\n * @return Current value (text)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"readerValueText\");\r\n },\r\n /**\r\n * Text representation of the current value of the element.\r\n *\r\n * @since 4.7.16\r\n * @param value Current value (text)\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerValueText\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"keyboardOptions\", {\r\n /**\r\n * ==========================================================================\r\n * USER INTERACTIONS\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns elements keyboard options.\r\n *\r\n * @return Keyboard options\r\n */\r\n get: function () {\r\n if (!this.interactions.keyboardOptions) {\r\n if (this.virtualParent) {\r\n return this.virtualParent.keyboardOptions;\r\n }\r\n if (this._parent) {\r\n return this._parent.keyboardOptions;\r\n }\r\n }\r\n return this.interactions.keyboardOptions;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"mouseOptions\", {\r\n /**\r\n * Mouse options.\r\n *\r\n * Enables controlling options related to the mouse, for example sensitivity\r\n * of its mouse wheel.\r\n *\r\n * E.g. the below will reduce chart's wheel-zoom speed to half its default\r\n * speed:\r\n *\r\n * ```TypeScript\r\n * chart.plotContainer.mouseOptions.sensitivity = 0.5;\r\n * ```\r\n * ```JavaScript\r\n * chart.plotContainer.mouseOptions.sensitivity = 0.5;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"plotContainer\": {\r\n * \"mouseOptions\": {\r\n * \"sensitivity\": 0.5\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * @return Mouse options\r\n */\r\n get: function () {\r\n if (!this.interactions.mouseOptions) {\r\n if (this.virtualParent) {\r\n return this.virtualParent.mouseOptions;\r\n }\r\n if (this._parent) {\r\n return this._parent.mouseOptions;\r\n }\r\n }\r\n return this.interactions.mouseOptions;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"interactions\", {\r\n /**\r\n * Returns (creates if necessary) an [[InteractionObject]] associated with\r\n * this element.\r\n *\r\n * [[InteractionObject]] is used to attach all kinds of user-interactions to\r\n * the element, e.g. click/touch, dragging, hovering, and similar events.\r\n *\r\n * @return Interaction object\r\n */\r\n get: function () {\r\n if (!this._interaction) {\r\n var interaction = getInteraction().getInteraction(this.dom);\r\n this._interaction = interaction;\r\n interaction.clickable = this.clickable;\r\n interaction.hoverable = this.hoverable;\r\n interaction.trackable = this.trackable;\r\n interaction.draggable = this.draggable;\r\n interaction.swipeable = this.swipeable;\r\n interaction.resizable = this.resizable;\r\n interaction.wheelable = this.wheelable;\r\n interaction.contextMenuDisabled = this.contextMenuDisabled;\r\n interaction.inert = this.inert;\r\n interaction.sprite = this;\r\n this._disposers.push(interaction);\r\n }\r\n return this._interaction;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns true if interactions object was created. Mostly used just to avoid creating interactions object if not needed.\r\n * @return Is Sprite interactive?\r\n */\r\n Sprite.prototype.isInteractive = function () {\r\n if (this._interaction) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"focusable\", {\r\n /**\r\n * @return Can element be focused?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"focusable\");\r\n },\r\n /**\r\n * ==========================================================================\r\n * ELEMENT FOCUS-RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Controls if the element can gain focus.\r\n *\r\n * Focusable element will be selectable via TAB key.\r\n *\r\n * Please note, clicking it with a mouse or touching will not add focus to\r\n * it.\r\n *\r\n * Focused element will show a system-specific highlight, which might ruin\r\n * the overal look. This is why we don't focus element on click/touch.\r\n *\r\n * A default setting varies for different elements. By default all elements\r\n * are not focusable, except certain items like buttons, legend items, etc.\r\n *\r\n * @default undefined (auto)\r\n * @param value Can element be focused?\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"focusable\", value)) {\r\n if (!value && !this.isInteractive()) {\r\n }\r\n else {\r\n this.interactions.focusable = value;\r\n if (value) {\r\n this.setSVGAttribute({ \"focusable\": value });\r\n if (!$type.hasValue(this._tabindex)) {\r\n this.tabindex = 0;\r\n }\r\n }\r\n else {\r\n this.removeSVGAttribute(\"focusable\");\r\n this.tabindex = undefined;\r\n }\r\n // Set focus events that would apply \"focus\" state\r\n // setEventDisposer will also remove listeners if value == false\r\n this.interactions.setEventDisposer(\"sprite-focusable\", value, function () { return new MultiDisposer([\r\n _this.events.on(\"blur\", _this.handleBlur, _this, false),\r\n _this.events.on(\"focus\", _this.handleFocus, _this, false)\r\n ]); });\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Applies filters (if set) when element gains focus.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Original event\r\n */\r\n Sprite.prototype.handleFocus = function (ev) {\r\n if (this.focusable) {\r\n if (this.topParent) {\r\n this.topParent.hasFocused = true;\r\n this.topParent.focusedElement = this;\r\n }\r\n if (this.focusFilter) {\r\n // Any `filters` manipulation will trigger `applyFilters()` so we don't\r\n // need to call it here\r\n this.filters.push(this.focusFilter);\r\n }\r\n if (this.hoverOnFocus) {\r\n // Trigger a hover event as well\r\n this.isHover = true;\r\n this.handleOver();\r\n }\r\n }\r\n };\r\n /**\r\n * Removes focus filter (if set) when elementloses focus.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Original event\r\n */\r\n Sprite.prototype.handleBlur = function (ev) {\r\n if (this.focusable) {\r\n if (this.topParent) {\r\n this.topParent.hasFocused = false;\r\n this.topParent.focusedElement = undefined;\r\n }\r\n if (this.focusFilter) {\r\n // Any `filters` manipulation will trigger `applyFilters()` so we don't\r\n // need to call it here\r\n this.filters.removeValue(this.focusFilter);\r\n }\r\n if (this.hoverOnFocus) {\r\n // Trigger a out event as well\r\n this.isHover = false;\r\n this.handleOut();\r\n }\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"focusFilter\", {\r\n /**\r\n * A reference to a [[Filter]] to apply to element when it gains focus.\r\n *\r\n * Normally, browsers will draw a default ugly square around focused element,\r\n * which totally makes sense because its purpose is to help identify active\r\n * element for visually impaired people.\r\n *\r\n * However, if you would rather apply a filter, so you can modify how focused\r\n * element looks like, use `focusFilter`.\r\n *\r\n * Simply set it to an anstance of [[FocusFilter]], or any other filter\r\n * object.\r\n *\r\n * ```TypeScript\r\n * chart.focusFilter = new am4core.FocusFilter();\r\n * ```\r\n * ```JavaScript\r\n * chart.focusFilter = new am4core.FocusFilter();\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"focusFilter\": {\r\n * \"type\": \"FocusFilter\"\r\n * },\r\n * // ...\r\n * }\r\n * ```\r\n *\r\n * @see {@link Filter}\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/accessibility/} more about accessibility\r\n * @see {@link https://www.amcharts.com/docs/v4/tutorials/changing-appearance-of-focused-items/} cusomizing focus appearance\r\n * @ignore Exclude from docs\r\n * @return Focused element filter\r\n */\r\n get: function () {\r\n /*if (!this._focusFilter) {\r\n this._focusFilter = new FocusFilter();\r\n this._disposers.push(this._focusFilter);\r\n }*/\r\n //return this._focusFilter;\r\n var focusFilter = this._focusFilter;\r\n if (focusFilter) {\r\n return focusFilter;\r\n }\r\n if (this.virtualParent) {\r\n return this.virtualParent.focusFilter;\r\n }\r\n else if (this._parent) {\r\n return this._parent.focusFilter;\r\n }\r\n //this._focusFilter = new FocusFilter();\r\n //this._disposers.push(this._focusFilter);\r\n },\r\n /**\r\n * @see {@link Filter}\r\n * @ignore Exclude from docs\r\n * @todo This is still experimental, don't use it\r\n */\r\n set: function (value) {\r\n this._focusFilter = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"hoverOnFocus\", {\r\n /**\r\n * @return Trigger hover on focus?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"hoverOnFocus\");\r\n },\r\n /**\r\n * If set to `true`, this element will also trigger `\"over\"` event with all\r\n * the related consequences, like \"hover\" state being applied and tooltip\r\n * being shown.\r\n *\r\n * Useful as an accessibility feature to display rollover tooltips on items\r\n * selected via keyboard.\r\n *\r\n * @param value Trigger hover on focus?\r\n * @default false\r\n */\r\n set: function (value) {\r\n if (value !== this.hoverOnFocus) {\r\n this.setPropertyValue(\"hoverOnFocus\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"tabindex\", {\r\n /**\r\n * @return TAB index\r\n */\r\n get: function () {\r\n var index = this._tabindex;\r\n if (index != null) {\r\n return index;\r\n }\r\n else if (this.virtualParent) {\r\n return this.virtualParent.tabindex;\r\n }\r\n else if (this._parent) {\r\n return this._parent.tabindex;\r\n }\r\n },\r\n /**\r\n * Sets or returns TAB index.\r\n *\r\n * Tab index maintains the order in which focusable elements gain focus when\r\n * TAB key is pressed.\r\n *\r\n * Please note, tab index is not local to the chart. It affects the whole\r\n * of the page, including non-SVG elements. Maintain extreme causion when\r\n * setting tab indexes, as it affects the user experience for the whole\r\n * web page.\r\n *\r\n * @param value TAB index\r\n */\r\n set: function (value) {\r\n value = $type.toNumber(value);\r\n if (this.setPropertyValue(\"tabindex\", value) && $type.isNumber(value)) {\r\n this.interactions.tabindex = value;\r\n this.setSVGAttribute({ \"tabindex\": value });\r\n this._tabindex = value;\r\n this.focusable = true;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"inertiaOptions\", {\r\n /**\r\n * ==========================================================================\r\n * DRAGGING AND RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns element's options to be used for inertia. This setting is\r\n * inheritable, meaning that if not set directly, it will search in all its\r\n * ascendants until very top.\r\n *\r\n * Inertia is used only if element's `inert` is set to `true`.\r\n *\r\n * \"Inert\" element, when dragged and released, will carry the momentum of the\r\n * movement, and will continue moving in the same drag direction, gradually\r\n * reducing in speed until finally stops.\r\n *\r\n * Check [[IInertiaOptions]] for how you tweak inertia animations.\r\n *\r\n * @return Inertia options\r\n */\r\n get: function () {\r\n if (!this.interactions.inertiaOptions) {\r\n if (this._parent) {\r\n return this._parent.inertiaOptions;\r\n }\r\n }\r\n return this.interactions.inertiaOptions;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"draggable\", {\r\n /**\r\n * @return `true` if element can be dragged\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"draggable\");\r\n },\r\n /**\r\n * Controls if the element is draggable.\r\n *\r\n * @param value `true` if element can be dragged\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"draggable\", value)) {\r\n if (!value && !this.isInteractive()) {\r\n }\r\n else {\r\n this.applyCursorStyle();\r\n this.interactions.draggable = value;\r\n //interaction.processDraggable(this);\r\n // Add events\r\n // @todo Maybe attach to InteractionObject's multidisposer so that\r\n // sprites events get disposed together with them?\r\n // this.interactions.disposers.getItem(\"movable\")\r\n // setEventDisposer will also remove listeners if value == false\r\n this.interactions.setEventDisposer(\"sprite-draggable\", value, function () { return new MultiDisposer([\r\n _this.events.on(\"down\", _this.handleDown, _this, false),\r\n _this.events.on(\"dragstart\", _this.handleDragStart, _this, false),\r\n _this.events.on(\"drag\", _this.handleDragMove, _this, false),\r\n _this.events.on(\"dragstop\", _this.handleDragStop, _this, false)\r\n ]); });\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Executes when dragged element is being started to drag.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.handleDragStart = function (ev) {\r\n if (!this.interactions.isTouchProtected || !ev.touch) {\r\n this.interactions.originalPosition = {\r\n x: this.pixelX,\r\n y: this.pixelY\r\n };\r\n this._isDragged = true;\r\n this.hideTooltip(0);\r\n }\r\n };\r\n /**\r\n * Tell this element to start being dragged. This is useful if you want to\r\n * drag items by interactions performed not directly on the target element.\r\n *\r\n * Parameter `pointer` is highly recommended. By passing in the Pointer you\r\n * will ensure that movement is tracked for the pointer that you want. If not\r\n * supplied, the system will try to determine the most logical pointer.\r\n *\r\n * However this may fail if you have more than one pointer active, which\r\n * might happen if you have several objects being dragged on a touch device.\r\n *\r\n * @ignore Exclude from docs\r\n * @param pointer Pointer to use for movement\r\n */\r\n Sprite.prototype.dragStart = function (pointer) {\r\n //this.dragStop(pointer);\r\n //this.draggable = true;\r\n this._isDragged = true;\r\n getInteraction().dragStart(this.interactions, pointer);\r\n };\r\n /**\r\n * Executes when dragged element is being dropped.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.handleDragStop = function (ev) {\r\n if (!this.interactions.isTouchProtected || !ev.touch) {\r\n this._isDragged = false;\r\n this.showTooltip();\r\n this.interactions.originalPosition = undefined;\r\n }\r\n };\r\n /**\r\n * Stops manually initiated dragging of the element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param pointer Pointer to use as a reference\r\n */\r\n Sprite.prototype.dragStop = function (pointer, cancelled) {\r\n //this.draggable = false;\r\n this._isDragged = false;\r\n getInteraction().dragStop(this.interactions, pointer, cancelled);\r\n //this.handleDragStop();\r\n };\r\n /**\r\n * Executes when {Sprite} is being dragged.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n * @todo Implement parent position offset calculation\r\n */\r\n Sprite.prototype.handleDragMove = function (ev) {\r\n if (!this.interactions.isTouchProtected || !ev.touch) {\r\n var point = this.interactions.originalPosition;\r\n if (point && this._isDragged) {\r\n var globalScale = this._parent.globalScale * this.svgContainer.cssScale;\r\n this.moveTo({ x: point.x + ev.shift.x / globalScale, y: point.y + ev.shift.y / globalScale }, undefined, undefined, true);\r\n }\r\n this.dispatchImmediately(\"dragged\", ev);\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"inert\", {\r\n /**\r\n * @return `true` if element should use inertia when animated\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"inert\");\r\n },\r\n /**\r\n * Controls if the element should use inertia when interacted with.\r\n *\r\n * \"Inert\" element, when dragged and released, will carry the momentum of the\r\n * movement, and will continue moving in the same drag direction, gradually\r\n * reducing in speed until finally stops.\r\n *\r\n * @default false\r\n * @param value `true` if element should use inertia when animated\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"inert\", value)) {\r\n if (!value && !this.isInteractive()) {\r\n // void\r\n }\r\n else {\r\n this.interactions.inert = value;\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"hoverOptions\", {\r\n /**\r\n * ==========================================================================\r\n * HOVERING\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns Sprite's hover options.\r\n *\r\n * @see {@link IHoverOptions} for available options.\r\n * @return Options\r\n */\r\n get: function () {\r\n if (!this.interactions.hoverOptions) {\r\n if (this.virtualParent) {\r\n return this.virtualParent.hoverOptions;\r\n }\r\n if (this._parent) {\r\n return this._parent.hoverOptions;\r\n }\r\n }\r\n return this.interactions.hoverOptions;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"hoverable\", {\r\n /**\r\n * @return `true` if element is hoverable\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"hoverable\");\r\n },\r\n /**\r\n * Controls if the element is hoverable (hover events are registered).\r\n *\r\n * Use `over` and `out` events, to watch for those respective actions.\r\n *\r\n * @default false\r\n * @param value `true` if element can be hovered\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"hoverable\", value)) {\r\n if (!value && !this.isInteractive()) {\r\n // void\r\n }\r\n else {\r\n this.applyCursorStyle();\r\n this.interactions.hoverable = value;\r\n // setEventDisposer will also remove listeners if value == false\r\n this.interactions.setEventDisposer(\"sprite-hoverable\", value, function () { return new MultiDisposer([\r\n _this.events.on(\"over\", _this.handleOver, _this, false),\r\n _this.events.on(\"out\", _this.handleOut, _this, false),\r\n ]); });\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Handles tasks when element becomes hovered:\r\n * * Shows [[Tooltip]] if applicable\r\n * * Applies \"hover\" state\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n */\r\n Sprite.prototype.handleOver = function (ev) {\r\n if (this._outTimeout) {\r\n this._outTimeout.dispose();\r\n }\r\n if (this.isHover) {\r\n if (this.states.hasKey(\"hover\")) {\r\n //this.setState(\"hover\");\r\n // This will check `isHover` and will set \"hover\" state\r\n if (!this.isHidden) {\r\n this.applyCurrentState();\r\n }\r\n }\r\n var point = void 0;\r\n if (ev && ev.pointer) {\r\n point = $utils.documentPointToSvg(ev.pointer.point, this.svgContainer.SVGContainer, this.svgContainer.cssScale);\r\n }\r\n if (this.showTooltipOn == \"hover\") {\r\n this.showTooltip(point);\r\n }\r\n }\r\n else {\r\n if (this.showTooltipOn == \"hover\") {\r\n this.hideTooltip();\r\n }\r\n if (!this.isHidden && this.states.hasKey(\"hover\")) {\r\n this.applyCurrentState();\r\n }\r\n }\r\n };\r\n /**\r\n * Handles tasks when element loses hover:\r\n *\r\n * * Hides [[Tooltip]]\r\n * * Applies default state\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev [description]\r\n */\r\n Sprite.prototype.handleOut = function (ev) {\r\n var _this = this;\r\n if (this.tooltip && this.tooltip.targetSprite == this && this.tooltip.keepTargetHover) {\r\n this._outTimeout = this.setTimeout(function () {\r\n if (!_this.tooltip.isHover) {\r\n if (_this.tooltip.targetSprite == _this) {\r\n _this.hideTooltip();\r\n }\r\n _this._outTimeout = _this.setTimeout(_this.handleOutReal.bind(_this), _this.rollOutDelay);\r\n }\r\n }, 10);\r\n return;\r\n }\r\n if (this.showTooltipOn == \"hover\") {\r\n this.hideTooltip();\r\n }\r\n this._outTimeout = this.setTimeout(this.handleOutReal.bind(this), this.rollOutDelay);\r\n };\r\n /**\r\n * [handleOutReal description]\r\n *\r\n * @ignore\r\n * @todo description\r\n */\r\n Sprite.prototype.handleOutReal = function () {\r\n if (!this.isHidden && !this.isHiding && this.states.hasKey(\"hover\")) {\r\n this.applyCurrentState();\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"hitOptions\", {\r\n /**\r\n * ==========================================================================\r\n * CLICKING/TAPPING AND TOGGLING STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns Sprite's click (hit) options.\r\n *\r\n * Click (hit) options control things like double-click, timeouts, etc.\r\n *\r\n * @see {@link IHitOptions} for available options.\r\n * @return Options\r\n */\r\n get: function () {\r\n if (!this.interactions.hitOptions) {\r\n if (this.virtualParent) {\r\n return this.virtualParent.hitOptions;\r\n }\r\n if (this._parent) {\r\n return this._parent.hitOptions;\r\n }\r\n }\r\n return this.interactions.hitOptions;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Prepares element's after `down` event.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event\r\n */\r\n Sprite.prototype.handleDown = function (ev) {\r\n if (this.interactions.downPointers.length === 1) {\r\n this.interactions.originalPosition = {\r\n x: this.pixelX,\r\n y: this.pixelY\r\n };\r\n this.interactions.originalAngle = this.rotation;\r\n this.interactions.originalScale = this.scale;\r\n if (this.states.hasKey(\"down\")) {\r\n this.setState(\"down\");\r\n }\r\n }\r\n };\r\n /**\r\n * Prepares element's after `up` event.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event\r\n */\r\n Sprite.prototype.handleUp = function (ev) {\r\n var _this = this;\r\n /*if (!this.isDown) {\r\n this.interactions.originalPosition = null;\r\n this.interactions.originalAngle = null;\r\n this.interactions.originalScale = null;\r\n }*/\r\n this._isResized = false;\r\n if (this.states.hasKey(\"down\")) {\r\n this.applyCurrentState();\r\n }\r\n if (this.showTooltipOn == \"hit\") {\r\n this.updateTooltipPosition(ev.pointer ? ev.pointer.point : undefined);\r\n this._disposers.push(registry.events.once(\"exitframe\", function () {\r\n _this.showTooltip();\r\n }));\r\n this._disposers.push(getInteraction().body.events.once(\"down\", function (ev) {\r\n _this.hideTooltip();\r\n }));\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"clickable\", {\r\n /**\r\n * @return {boolean}\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"clickable\");\r\n },\r\n /**\r\n * Indicates if the element is clickable.\r\n *\r\n * Some type of the elements, like buttons are clickable by default.\r\n *\r\n * Most of the elements are not clickable by default.\r\n *\r\n * Use `hit`, `doublehit`, `up`, `down`, `toggled` events to watch for\r\n * respective click/touch actions.\r\n *\r\n * @param value `true` if element can be clicked\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"clickable\", value)) {\r\n if (!value && !this.isInteractive()) {\r\n // void\r\n }\r\n else {\r\n this.applyCursorStyle();\r\n this.interactions.clickable = value;\r\n // setEventDisposer will also remove listeners if value == false\r\n this.interactions.setEventDisposer(\"sprite-clickable\", value, function () { return new MultiDisposer([\r\n _this.events.on(\"down\", _this.handleDown, _this, false),\r\n _this.events.on(\"up\", _this.handleUp, _this, false)\r\n ]); });\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"togglable\", {\r\n /**\r\n * @return Is togglable?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"togglable\");\r\n },\r\n /**\r\n * Indicates if element can be toggled on and off by subsequent clicks/taps.\r\n *\r\n * Togglable element will alternate its `isActive` property between `true`\r\n * and `false` with each click.\r\n *\r\n * @param value Is togglable?\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"togglable\", value)) {\r\n if (!value && !this.isInteractive()) {\r\n // void\r\n }\r\n else {\r\n // setEventDisposer will also remove listeners if value == false\r\n this.interactions.setEventDisposer(\"sprite-togglable\", value, function () { return _this.events.on(\"hit\", _this.handleToggle, _this, false); });\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Handles toggling of the element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event\r\n */\r\n Sprite.prototype.handleToggle = function (ev) {\r\n this.isActive = !this.isActive;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"contextMenuDisabled\", {\r\n /**\r\n * @return Context menu disabled?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"contextMenuDisabled\");\r\n },\r\n /**\r\n * Should element prevent context menu to be displayed, e.g. when\r\n * right-clicked?\r\n *\r\n * @default false\r\n * @param value Context menu disabled?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"contextMenuDisabled\", value)) {\r\n this.interactions.contextMenuDisabled = value;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"url\", {\r\n /**\r\n * @return URL\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"url\");\r\n },\r\n /**\r\n * Click-through URL for this element.\r\n *\r\n * If set, clicking/tapping this element will open the new URL in a target\r\n * window/tab as set by `urlTarget`.\r\n *\r\n * Please note that URL will be parsed by data placeholders in curly\r\n * brackets, to be populated from data. E.g.:\r\n *\r\n * ```TypeScript\r\n * series.columns.template.url = \"https://www.google.com/search?q={category.urlEncode()}\";\r\n * ```\r\n * ```JavaScript\r\n * series.columns.template.url = \"https://www.google.com/search?q={category.urlEncode()}\";\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"series\": [{\r\n * // ...\r\n * \"columns\": {\r\n * \"url\": \"https://www.google.com/search?q={category.urlEncode()}\"\r\n * }\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * @param value URL\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"url\", value)) {\r\n if (this._urlDisposer) {\r\n this._urlDisposer.dispose();\r\n }\r\n // If URL is not empty, set up events\r\n if ($utils.isNotEmpty(value)) {\r\n this._urlDisposer = this.events.on(\"hit\", this.urlHandler, this, false);\r\n // Set other required parameters\r\n this.clickable = true;\r\n this.cursorOverStyle = MouseCursorStyle.pointer;\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"baseId\", {\r\n /**\r\n * [baseId description]\r\n *\r\n * @ignore\r\n * @return [description]\r\n */\r\n get: function () {\r\n if (!this._baseId && this._parent) {\r\n this.baseId = this._parent.baseId;\r\n }\r\n return this._baseId;\r\n },\r\n /**\r\n * [baseId description]\r\n *\r\n * @ignore\r\n * @param value [description]\r\n */\r\n set: function (value) {\r\n this.setBaseId(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Sprite.prototype.setBaseId = function (value) {\r\n if (value != this._baseId) {\r\n if (this.invalid) {\r\n this.invalid = false;\r\n registry.removeFromInvalidSprites(this);\r\n this.invalidate();\r\n }\r\n this._baseId = value;\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"baseSprite\", {\r\n /**\r\n * Returns the mail chart object that this element belongs to.\r\n *\r\n * In most cases it will mean the chart object.\r\n *\r\n * Can be used to retrieve chart object in various events and adapters.\r\n *\r\n * ```TypeScript\r\n * chart.seriesContainer.events.on(\"hit\", function(ev) {\r\n * console.log(ev.target.baseSprite);\r\n * });\r\n * ```\r\n * ```JavaScript\r\n * chart.seriesContainer.events.on(\"hit\", function(ev) {\r\n * console.log(ev.target.baseSprite);\r\n * });\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"seriesContainer\": {\r\n * \"events\": {\r\n * \"hit\": function(ev) {\r\n * console.log(ev.target.baseSprite);\r\n * }\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * @readonly\r\n * @return Base chart object\r\n */\r\n get: function () {\r\n if (this.isBaseSprite) {\r\n return this;\r\n }\r\n else if (this._parent) {\r\n return this._parent.baseSprite;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"urlTarget\", {\r\n /**\r\n * @return URL target\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"urlTarget\");\r\n },\r\n /**\r\n * Target to use for URL clicks:\r\n *\r\n * * _blank\r\n * * _self (default)\r\n * * _parent\r\n * * _top\r\n * * Name of the window/frame\r\n *\r\n * Ignored if `url` is not set.\r\n *\r\n * @param value URL target\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"urlTarget\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Handles URL transition on element click.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev An event object\r\n */\r\n Sprite.prototype.urlHandler = function (ev) {\r\n // Is URL set?\r\n if ($utils.isNotEmpty(this.url)) {\r\n // Proceed to the URL\r\n var url = this.populateString(this.url);\r\n if (this.urlTarget === \"_self\") {\r\n window.location.href = url;\r\n }\r\n else {\r\n window.open(url, this.urlTarget);\r\n }\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"swipeOptions\", {\r\n /**\r\n * ==========================================================================\r\n * SWIPING GESTURE TRACKING\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns element's swipe gesture options.\r\n *\r\n * @return Swipe gesture options\r\n */\r\n get: function () {\r\n if (!this.interactions.swipeOptions) {\r\n if (this.virtualParent) {\r\n return this.virtualParent.swipeOptions;\r\n }\r\n if (this._parent) {\r\n return this._parent.swipeOptions;\r\n }\r\n }\r\n return this.interactions.swipeOptions;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"swipeable\", {\r\n /**\r\n * @return Element swipable?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"swipeable\");\r\n },\r\n /**\r\n * Controls if element is swipeable.\r\n *\r\n * Swipable element will invoke `swipe`, `swipeleft` and `swiperight` events,\r\n * when quick horizontal drag action is performed with either mouse or touch.\r\n *\r\n * Please note that combining swipe and drag is possible, however will incur\r\n * a slight but noticeable delay in drag start.\r\n *\r\n * @param value Element swipable?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"swipeable\", value)) {\r\n this.applyCursorStyle();\r\n if (!value && !this.isInteractive()) {\r\n // void\r\n }\r\n else {\r\n this.interactions.swipeable = value;\r\n }\r\n //interaction.processSwipeable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"trackable\", {\r\n /**\r\n * @return Track cursor movement over element?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"trackable\");\r\n },\r\n /**\r\n * ==========================================================================\r\n * POINTER TRACKING\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Indicates if the element is trackable (mouse position over it is reported to\r\n * event listeners).\r\n *\r\n * Will invoke `track` events whenever pointer (cursor) changes position\r\n * while over element.\r\n *\r\n * Please note, touch devices will also invoke `track` events when touch\r\n * point is moved while holding down on a trackable element.\r\n *\r\n * @param value Track cursor movement over element?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"trackable\", value)) {\r\n if (!value && !this.isInteractive()) {\r\n // void\r\n }\r\n else {\r\n this.applyCursorStyle();\r\n this.interactions.trackable = value;\r\n }\r\n //interaction.processTrackable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"wheelable\", {\r\n /**\r\n * @return Mouse wheel events enabled?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"wheelable\");\r\n },\r\n /**\r\n * ==========================================================================\r\n * MOUSE-WHEEL RELATED\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Indicates if the element can be interacted with mouse wheel.\r\n *\r\n * Will invoke `wheel`, `wheelup`, `wheeldown`, `wheelleft`, and `wheelright`\r\n * events when using mouse wheel over the element.\r\n *\r\n * @param value Mouse wheel events enabled?\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"wheelable\", value)) {\r\n if (!value && !this.isInteractive()) {\r\n // void\r\n }\r\n else {\r\n this.applyCursorStyle();\r\n this.interactions.wheelable = value;\r\n }\r\n //interaction.processWheelable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"resizable\", {\r\n /**\r\n * @return Element resizable?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"resizable\");\r\n },\r\n /**\r\n * ==========================================================================\r\n * RESIZE\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Indicates if this element is resizable.\r\n *\r\n * Enabling resize will turn on various interactions on the element. Their\r\n * actual functionality will depend on other properties.\r\n *\r\n * If the element also `draggable`, resize will only happen with two points\r\n * of contact on a touch device.\r\n *\r\n * If the element is not draggable, resize can be performed with just one\r\n * point of contact, touch or mouse.\r\n *\r\n * Will invoke `resize` event every time the size of the element changes.\r\n *\r\n * @param value Element resizable?\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"resizable\", value)) {\r\n if (!value && !this.isInteractive()) {\r\n // void\r\n }\r\n else {\r\n this.applyCursorStyle();\r\n this.interactions.resizable = value;\r\n // setEventDisposer will also remove listeners if value == false\r\n this.interactions.setEventDisposer(\"sprite-resizable\", value, function () { return new MultiDisposer([\r\n _this.events.on(\"down\", _this.handleDown, _this, false),\r\n _this.events.on(\"resize\", _this.handleResize, _this, false)\r\n ]); });\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Handles resize intermediate step.\r\n *\r\n * By default this method resizes actual element. Each element, can override\r\n * this method to implement their own resize logic.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n */\r\n Sprite.prototype.handleResize = function (ev) {\r\n if (!this.interactions.isTouchProtected || !ev.touch) {\r\n this._isResized = true;\r\n this.scale = this.interactions.originalScale * ev.scale;\r\n this.validatePosition();\r\n /*center: (io.draggable\r\n ? $math.getMidPoint(point1, point2)\r\n : {\r\n \"x\": io.originalPosition.x,\r\n \"y\": io.originalPosition.y\r\n })*/\r\n //this.moveTo(this.originalPosition.x + ev.shift.x, this.originalPosition.y + ev.shift.y);\r\n if (this.draggable || this.dragWhileResize) {\r\n this._isDragged = false;\r\n var svgPoint1 = $utils.documentPointToSvg(ev.point1, this.htmlContainer, this.svgContainer.cssScale);\r\n var svgPoint2 = $utils.documentPointToSvg(ev.point2, this.htmlContainer, this.svgContainer.cssScale);\r\n var svgMidPoint = $math.getMidPoint(svgPoint1, svgPoint2);\r\n var parentPoint1 = $utils.documentPointToSprite(ev.startPoint1, this._parent);\r\n var parentPoint2 = $utils.documentPointToSprite(ev.startPoint2, this._parent);\r\n var originalPosition = this.interactions.originalPosition;\r\n var originalScale = this.interactions.originalScale;\r\n if (originalPosition) {\r\n var spritePoint1 = { x: (parentPoint1.x - originalPosition.x) / originalScale, y: (parentPoint1.y - originalPosition.y) / originalScale };\r\n var spritePoint2 = { x: (parentPoint2.x - originalPosition.x) / originalScale, y: (parentPoint2.y - originalPosition.y) / originalScale };\r\n var spriteMidPoint = $math.getMidPoint(spritePoint1, spritePoint2);\r\n var parentPoint = $utils.svgPointToSprite(svgMidPoint, this._parent);\r\n this.moveTo({ x: parentPoint.x - spriteMidPoint.x * this.scale, y: parentPoint.y - spriteMidPoint.y * this.scale }, undefined, undefined, true);\r\n }\r\n }\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"cursorOptions\", {\r\n /**\r\n * ==========================================================================\r\n * MOUSE-RELATED\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns element's cursor options.\r\n *\r\n * Cursor options usually define cursor style for various states of the\r\n * hovered element.\r\n *\r\n * Elements inherit `cursorOptions` from their parents if they don't have\r\n * them set explicitly.\r\n *\r\n * @see {@link ICursorOptions} for a list of available options\r\n * @return Cursor options\r\n */\r\n get: function () {\r\n if (!this.interactions.cursorOptions) {\r\n if (this.virtualParent) {\r\n return this.virtualParent.cursorOptions;\r\n }\r\n if (this._parent) {\r\n return this._parent.cursorOptions;\r\n }\r\n }\r\n return this.interactions.cursorOptions;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"cursorOverStyle\", {\r\n /**\r\n * A shortcut to setting mouse cursor on hover.\r\n *\r\n * Example:\r\n *\r\n * ```TypeScript\r\n * series.slices.template.cursorOverStyle = am4core.MouseCursorStyle.pointer;\r\n * ```\r\n * ```JavaScript\r\n * series.slices.template.cursorOverStyle = am4core.MouseCursorStyle.pointer;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"series\": {\r\n * // ...\r\n * \"slices\": {\r\n * \"cursorOverStyle\": \"pointer\"\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * @param style An array of styles to apply onhover\r\n */\r\n set: function (style) {\r\n if (!this.cursorOptions.overStyle) {\r\n this.interactions.cursorOptions = {\r\n defaultStyle: this.cursorOptions.defaultStyle\r\n };\r\n }\r\n this.cursorOptions.overStyle = style;\r\n getInteraction().applyCursorOverStyle(this.interactions);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"cursorDownStyle\", {\r\n /**\r\n * A shortcut to setting mouse cursor when button is pressed down.\r\n *\r\n * Example:\r\n *\r\n * ```TypeScript\r\n * series.slices.template.cursorDownStyle = am4core.MouseCursorStyle.grabbing;\r\n * ```\r\n * ```JavaScript\r\n * series.slices.template.cursorDownStyle = am4core.MouseCursorStyle.grabbing;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"series\": {\r\n * // ...\r\n * \"slices\": {\r\n * \"cursorDownStyle\": \"grabbing\"\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * @param style An array of styles to apply onhover\r\n */\r\n set: function (style) {\r\n this.cursorOptions.downStyle = style;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Applies default cursor styles for interactable elements.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Determine if this is necessary. Maybe let's not apply any cursor styles by default\r\n */\r\n Sprite.prototype.applyCursorStyle = function () {\r\n // Draggable styles\r\n /*if (this.draggable) {\r\n\r\n if (!$type.hasValue(this.cursorOptions.overStyle)) {\r\n this.cursorOptions.overStyle = MouseCursorStyle.grab;\r\n }\r\n\r\n if (!$type.hasValue(this.cursorOptions.downStyle)) {\r\n this.cursorOptions.downStyle = MouseCursorStyle.grabbing;\r\n }\r\n }*/\r\n };\r\n Object.defineProperty(Sprite.prototype, \"interactionsEnabled\", {\r\n /**\r\n * @return Is interaction enabled for this element?\r\n */\r\n get: function () {\r\n var value = this.getPropertyValue(\"interactionsEnabled\");\r\n if (value === false) {\r\n return false;\r\n }\r\n if (this.virtualParent) {\r\n return this.virtualParent.interactionsEnabled;\r\n }\r\n if (this._parent) {\r\n return this._parent.interactionsEnabled;\r\n }\r\n return true;\r\n },\r\n /**\r\n * Setting this to `false` will effectively disable all interactivity on the\r\n * element.\r\n *\r\n * @param value Is interaction enabled for this element?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"interactionsEnabled\", value)) {\r\n var pointerEvents = null; // must be null, not \"null\"!\r\n if (!value) {\r\n pointerEvents = \"none\";\r\n }\r\n else {\r\n // this is for IE\r\n this.group.node.style.pointerEvents = \"\";\r\n }\r\n this.group.node.style.pointerEvents = pointerEvents;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"exporting\", {\r\n /**\r\n * @return Export instance\r\n */\r\n get: function () {\r\n return this.getExporting();\r\n },\r\n /**\r\n * ==========================================================================\r\n * EXPORT-RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * An [[Export]] instance.\r\n *\r\n * Used to access API of the chart export functionality.\r\n *\r\n * If `exporting` is not set, the element inherits [[Export]] instance from\r\n * its parents.\r\n *\r\n * Upon request, if no parent has such instance, a new one is created, using\r\n * default settings, what in most cases is just enough.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/exporting/} for more info about exporting\r\n * @param exp Export\r\n */\r\n set: function (exp) {\r\n this._exporting.set(exp, exp);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * This is here as a method so that inheriting classes could override it.\r\n *\r\n * @return Export instance\r\n */\r\n Sprite.prototype.getExporting = function () {\r\n var _export = this._exporting.get();\r\n if (_export) {\r\n return _export;\r\n }\r\n else {\r\n if (this.isStandaloneInstance || !this._parent) {\r\n _export = new Export(this.svgContainer.SVGContainer);\r\n _export.sprite = this;\r\n _export.language = this.language;\r\n _export.numberFormatter = this.numberFormatter;\r\n _export.dateFormatter = this.dateFormatter;\r\n _export.durationFormatter = this.durationFormatter;\r\n this._exporting.set(_export, _export);\r\n }\r\n else {\r\n return this._parent.exporting;\r\n }\r\n }\r\n return _export;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"exportable\", {\r\n /**\r\n * @return Export?\r\n */\r\n get: function () {\r\n return this._exportable;\r\n /*const svgContainer = this.svgContainer;\r\n return !svgContainer || $array.indexOf(svgContainer.nonExportableSprites, this) == -1;*/\r\n },\r\n /**\r\n * If set to `false` this element will be omitted when exporting the chart\r\n * to an image.\r\n *\r\n * @default true\r\n * @param value Export?\r\n */\r\n set: function (value) {\r\n var svgContainer = this.svgContainer;\r\n this._exportable = value;\r\n if (svgContainer) {\r\n if (value) {\r\n $array.remove(svgContainer.nonExportableSprites, this);\r\n }\r\n else if ($array.indexOf(svgContainer.nonExportableSprites, this) == -1) {\r\n svgContainer.nonExportableSprites.push(this);\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * ==========================================================================\r\n * MODAL/POPUP RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Private method to be used for \"classPrefix\" adapter for modals/popups.\r\n *\r\n * @param value Prefix\r\n */\r\n Sprite.prototype.modalPrefix = function (value) {\r\n value = options.classNamePrefix + value;\r\n return value;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"modal\", {\r\n /**\r\n * Returns a [[Modal]] instance, associated with this chart.\r\n * (elements top parent)\r\n *\r\n * Accessing modal does not make it appear. To make a modal appear, use\r\n * `showModal()` method.\r\n *\r\n * @see {@link Modal} for more information about using Modal windows\r\n * @return Modal instance\r\n */\r\n get: function () {\r\n var svgContainer = this.svgContainer;\r\n if (svgContainer) {\r\n var modal = svgContainer.modal;\r\n if (!modal.adapter.has(\"classPrefix\", this.modalPrefix)) {\r\n modal.adapter.add(\"classPrefix\", this.modalPrefix);\r\n }\r\n return modal;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Opens a modal window with specific content (`text` parameter) and,\r\n * optionally, `title`.\r\n *\r\n * The `text` parameter can contain HTML content.\r\n *\r\n * @see {@link Modal} for more information about using Modal windows\r\n * @param text Modal contents\r\n * @param title Title for the modal window\r\n */\r\n Sprite.prototype.openModal = function (text, title) {\r\n var svgContainer = this.svgContainer;\r\n if (svgContainer) {\r\n return svgContainer.openModal(text, title);\r\n }\r\n };\r\n /**\r\n * Hides modal window if there is one currently open.\r\n */\r\n Sprite.prototype.closeModal = function () {\r\n var svgContainer = this.svgContainer;\r\n if (svgContainer) {\r\n svgContainer.closeModal();\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"popups\", {\r\n /**\r\n * A list of popups for this chart.\r\n *\r\n * @return Popups\r\n */\r\n get: function () {\r\n var svgContainer = this.svgContainer;\r\n if (svgContainer) {\r\n var popups = svgContainer.popups;\r\n popups.template.sprite = this;\r\n if (!popups.template.adapter.has(\"classPrefix\", this.modalPrefix)) {\r\n popups.template.adapter.add(\"classPrefix\", this.modalPrefix);\r\n }\r\n return popups;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates, opens, and returns a new [[Popup]] window.\r\n *\r\n * `text` can be any valid HTML.\r\n *\r\n * `title` is currently not supported.\r\n *\r\n * @param text Popup contents\r\n * @param title Popup title\r\n * @return Popup instance\r\n */\r\n Sprite.prototype.openPopup = function (text, title) {\r\n var svgContainer = this.svgContainer;\r\n if (svgContainer) {\r\n return svgContainer.openPopup(text, title);\r\n }\r\n };\r\n /**\r\n * Closes all currently open popup windows\r\n */\r\n Sprite.prototype.closeAllPopups = function () {\r\n var svgContainer = this.svgContainer;\r\n if (svgContainer) {\r\n svgContainer.closeAllPopups();\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"x\", {\r\n /**\r\n * @return X coordinate\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"x\");\r\n },\r\n /**\r\n * ==========================================================================\r\n * POSITIONAL PROPERTIES AND RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Element's absolute or relative X coordinate.\r\n *\r\n * If setting both X and Y, please consider using `moveTo()` method instead,\r\n * as it will be faster to set both coordinates at once.\r\n *\r\n * @param value X coordinate\r\n */\r\n set: function (value) {\r\n if (!this.isDragged) {\r\n this.setPercentProperty(\"x\", value, false, true, this._positionPrecision, true);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelX\", {\r\n /**\r\n * Returns element's current absolute X coordinate in pixels.\r\n *\r\n * @readonly\r\n * @return X coordinate (px)\r\n */\r\n get: function () {\r\n var value = $math.fitToRange(this.getPixelX(this.x), this.minX, this.maxX);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"pixelX\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativeX\", {\r\n /**\r\n * Returns element's current relative X coordinate in [[Percent]].\r\n *\r\n * @return X coordinate ([[Percent]])\r\n */\r\n get: function () {\r\n if (!this._adapterO) {\r\n return this.getRelativeX(this.x);\r\n }\r\n else {\r\n return this._adapterO.apply(\"relativeX\", this.getRelativeX(this.x));\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"minX\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Min X (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"minX\");\r\n },\r\n /**\r\n * The smallest allowable absolute X coordinate for this element.\r\n *\r\n * This is used to contain element movement within certain boundaries.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Min X (px)\r\n */\r\n set: function (value) {\r\n if ($type.isNumber(value)) {\r\n value = $math.round(value, this._positionPrecision, true);\r\n this.setPropertyValue(\"minX\", value, false, true);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"maxX\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Max X (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"maxX\");\r\n },\r\n /**\r\n * The biggest allowable absolute X coordinate for this element.\r\n *\r\n * This is used to contain element movement within certain boundaries.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Max X (px)\r\n */\r\n set: function (value) {\r\n if ($type.isNumber(value)) {\r\n value = $math.round(value, this._positionPrecision, true);\r\n this.setPropertyValue(\"maxX\", value, false, true);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"y\", {\r\n /**\r\n * @return Y coordinate\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"y\");\r\n },\r\n /**\r\n * Element's absolute or relative Y coordinate.\r\n *\r\n * If setting both X and Y, please consider using `moveTo()` method instead,\r\n * as it will be faster to set both coordinates at once.\r\n *\r\n * @param value Y coordinate\r\n */\r\n set: function (value) {\r\n if (!this.isDragged) {\r\n this.setPercentProperty(\"y\", value, false, true, this._positionPrecision, true);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelY\", {\r\n /**\r\n * Returns element's current absolute Y coordinate in pixels.\r\n *\r\n * @readonly\r\n * @return Y coordinate (px)\r\n */\r\n get: function () {\r\n var value = $math.fitToRange(this.getPixelY(this.y), this.minY, this.maxY);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"pixelY\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativeY\", {\r\n /**\r\n * Returns element's current relative Y coordinate in [[Percent]].\r\n *\r\n * @readonly\r\n * @return Y coordinate ([[Percent]])\r\n */\r\n get: function () {\r\n if (!this._adapterO) {\r\n return this.getRelativeX(this.y);\r\n }\r\n else {\r\n return this._adapterO.apply(\"relativeY\", this.getRelativeX(this.y));\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"minY\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Min Y (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"minY\");\r\n },\r\n /**\r\n * The smallest allowable absolute Y coordinate for this element.\r\n *\r\n * This is used to contain element movement within certain boundaries.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Min Y (px)\r\n */\r\n set: function (value) {\r\n if ($type.isNumber(value)) {\r\n value = $math.round(value, this._positionPrecision, true);\r\n this.setPropertyValue(\"minY\", value, false, true);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"maxY\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Max Y (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"maxY\");\r\n },\r\n /**\r\n * The biggest allowable absolute Y coordinate for this element.\r\n *\r\n * This is used to contain element movement within certain boundaries.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Max Y (px)\r\n */\r\n set: function (value) {\r\n if ($type.isNumber(value)) {\r\n value = $math.round(value, this._positionPrecision, true);\r\n this.setPropertyValue(\"maxY\", value, false, true);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"dx\", {\r\n /**\r\n * @return Horizontal offset (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"dx\");\r\n },\r\n /**\r\n * A horizontal offset for the element in pixels.\r\n *\r\n * Can be negative value for offset to the left.\r\n *\r\n * @param value Horizontal offset (px)\r\n */\r\n set: function (value) {\r\n if ($type.isNumber(value)) {\r\n value = $math.round(value, this._positionPrecision, true);\r\n this.setPropertyValue(\"dx\", value, false, true);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"dy\", {\r\n /**\r\n * @return Vertical offset (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"dy\");\r\n },\r\n /**\r\n * A vertical offset for the element in pixels.\r\n *\r\n * Can be negative value for offset upwards.\r\n *\r\n * @param value Vertical offset (px)\r\n */\r\n set: function (value) {\r\n if ($type.isNumber(value)) {\r\n value = $math.round(value, this._positionPrecision, true);\r\n this.setPropertyValue(\"dy\", value, false, true);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"rotation\", {\r\n /**\r\n * @return Rotation (0-360)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"rotation\");\r\n },\r\n /**\r\n * Rotation of the element in degrees. (0-360)\r\n *\r\n * Note: For convenience purposes, negative values (for counter-clockwise\r\n * rotation) and values exceeding 360 can also be used.\r\n *\r\n * @param value Rotation (0-360)\r\n */\r\n set: function (value) {\r\n value = $type.toNumber(value);\r\n if (!$type.isNumber(value)) {\r\n value = 0;\r\n }\r\n this.setPropertyValue(\"rotation\", value, false, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"align\", {\r\n /**\r\n * @return Horizontal align\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"align\");\r\n },\r\n /**\r\n * Controls horizontal alignment of the element.\r\n *\r\n * This is used by parent [[Container]] when layouting its children.\r\n *\r\n * @param value Horizontal align\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"align\", value)) {\r\n if (this._parent) {\r\n this._parent.invalidateLayout();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"valign\", {\r\n /**\r\n * @return Vertical align\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"valign\");\r\n },\r\n /**\r\n * Controls vertical alignment of the element.\r\n *\r\n * This is used by parent [[Container]] when layouting its children.\r\n *\r\n * @param value Vertical align\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"valign\", value)) {\r\n if (this._parent) {\r\n this._parent.invalidateLayout();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"horizontalCenter\", {\r\n /**\r\n * @return Horizontal center\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"horizontalCenter\");\r\n },\r\n /**\r\n * Controls which part of the element to treat as a horizontal center.\r\n *\r\n * The setting will be used when positioning, resizing and rotating the\r\n * element.\r\n *\r\n * @param value Horizontal center\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"horizontalCenter\", value)) {\r\n this.updateCenter();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"verticalCenter\", {\r\n /**\r\n * @return Vertical center\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"verticalCenter\");\r\n },\r\n /**\r\n * Controls which part of the element to treat as a vertical center.\r\n *\r\n * The setting will be used when positioning, resizing and rotating the\r\n * element.\r\n *\r\n * @param value Vertical center\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"verticalCenter\", value)) {\r\n this.updateCenter();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"maxWidth\", {\r\n /**\r\n * @return Maximum width (px)\r\n */\r\n get: function () {\r\n var maxWidth = this.getPropertyValue(\"maxWidth\");\r\n if (!$type.isNumber(maxWidth)) {\r\n if (this._parent) {\r\n var parentWidth = this._parent.maxWidth;\r\n if (this._parent.layout != \"absolute\" && this.align != \"none\" && this.align != undefined) {\r\n parentWidth = parentWidth - this.pixelMarginLeft - this.pixelMarginRight;\r\n }\r\n return parentWidth;\r\n }\r\n }\r\n return maxWidth;\r\n },\r\n /**\r\n * ==========================================================================\r\n * DIMENSIONAL PROPERTIES AND RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Maximum allowed width for the element in pixels.\r\n *\r\n * @param value Maximum width (px)\r\n */\r\n set: function (value) {\r\n this.setMaxWidth(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Sprite.prototype.setMaxWidth = function (value) {\r\n var prevWidth = this.maxWidth;\r\n var prevHeight = this.maxHeight;\r\n if (this.setPropertyValue(\"maxWidth\", value)) {\r\n if ($type.isNumber(this.relativeWidth)) {\r\n this.invalidate();\r\n }\r\n var event_2 = {\r\n type: \"maxsizechanged\",\r\n target: this,\r\n previousWidth: prevWidth,\r\n previousHeight: prevHeight\r\n };\r\n this.dispatchImmediately(\"maxsizechanged\", event_2);\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"maxHeight\", {\r\n /**\r\n * @return Maximum height (px)\r\n */\r\n get: function () {\r\n var maxHeight = this.getPropertyValue(\"maxHeight\");\r\n if (!$type.isNumber(maxHeight)) {\r\n if (this._parent) {\r\n var parentHeight = this._parent.maxHeight;\r\n if (this._parent.layout != \"absolute\" && this.valign != \"none\" && this.valign != undefined) {\r\n parentHeight = parentHeight - this.pixelMarginTop - this.pixelMarginBottom;\r\n }\r\n return parentHeight;\r\n }\r\n }\r\n return maxHeight;\r\n },\r\n /**\r\n * Maximum allowed height for the element in pixels.\r\n *\r\n * @param value Maximum height (px)\r\n */\r\n set: function (value) {\r\n this.setMaxHeight(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Sprite.prototype.setMaxHeight = function (value) {\r\n var prevWidth = this.maxWidth;\r\n var prevHeight = this.maxHeight;\r\n if (this.setPropertyValue(\"maxHeight\", value)) {\r\n if ($type.isNumber(this.relativeHeight)) {\r\n this.invalidate();\r\n }\r\n var event_3 = {\r\n type: \"maxsizechanged\",\r\n target: this,\r\n previousWidth: prevWidth,\r\n previousHeight: prevHeight\r\n };\r\n this.dispatchImmediately(\"maxsizechanged\", event_3);\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"minWidth\", {\r\n /**\r\n * @return Minimum width (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"minWidth\");\r\n },\r\n /**\r\n * Minimum width of the element in pixels.\r\n *\r\n * Set to `undefined` to remove the limit.\r\n *\r\n * @param value Minimum width (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"minWidth\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"minHeight\", {\r\n /**\r\n * @return Minimum height (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"minHeight\");\r\n },\r\n /**\r\n * Minimum height for the element in pixels.\r\n *\r\n * Set to `undefined` to remove the limit.\r\n *\r\n * @param value Minimum height (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"minHeight\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"width\", {\r\n /**\r\n * @return Width (absolute or relative)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"width\");\r\n },\r\n /**\r\n * Element's absolute or relative width.\r\n *\r\n * The width can either be absolute, set in numeric pixels, or relative, set\r\n * in [[Percent]].\r\n *\r\n * Relative width will be calculated using closest measured ancestor\r\n * [[Container]].\r\n *\r\n * NOTE: `width` is an accessor, which allows setting width in pixels or\r\n * percent. It is a sort of a \"shortcut\" for the users. Actual renderer does\r\n * not ever use it. It uses either `pixelWidth` or `percentWidth`, so if\r\n * you need to add an adapter for width add it for either of the two\r\n * properties - whichever suits your requirements.\r\n *\r\n * @param value Width (numeric in pixels or relative)\r\n */\r\n set: function (value) {\r\n var changed = this.setPercentProperty(\"width\", value, true, false, this._positionPrecision, true);\r\n if (changed) {\r\n this.percentWidth = undefined;\r\n this.relativeWidth = undefined;\r\n if (value instanceof Percent) {\r\n this.percentWidth = value.percent;\r\n if ($type.isNumber(this._pixelWidth)) {\r\n this.maxWidth = undefined;\r\n }\r\n this._pixelWidth = undefined;\r\n }\r\n else {\r\n this._pixelWidth = Number(value);\r\n //this._measuredWidth = this._pixelWidth;\r\n this.maxWidth = this._pixelWidth;\r\n }\r\n this.invalidatePosition();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"height\", {\r\n /**\r\n * @return height (absolute or relative)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"height\");\r\n },\r\n /**\r\n * Element's absolute or relative height.\r\n *\r\n * The height can either be absolute, set in numeric pixels, or relative, set\r\n * in [[Percent]].\r\n *\r\n * Relative height will be calculated using closest measured ancestor\r\n * [[Container]].\r\n *\r\n * NOTE: `height` is an accessor, which allows setting height in pixels or\r\n * percent. It is a sort of a \"shortcut\" for the users. Actual renderer does\r\n * not ever use it. It uses either `pixelHeight` or `percentHeight`, so if\r\n * you need to add an adapter for height add it for either of the two\r\n * properties - whichever suits your requirements.\r\n *\r\n * @param value Height (numeric in pixels or relative)\r\n */\r\n set: function (value) {\r\n var changed = this.setPercentProperty(\"height\", value, true, false, this._positionPrecision, true);\r\n if (changed) {\r\n this.percentHeight = undefined;\r\n this._relativeHeight = undefined;\r\n if (value instanceof Percent) {\r\n this.percentHeight = value.percent;\r\n if ($type.isNumber(this._pixelHeight)) {\r\n this.maxHeight = undefined;\r\n }\r\n this._pixelHeight = undefined;\r\n }\r\n else {\r\n this._pixelHeight = Number(value);\r\n //this._measuredHeight = this._pixelHeight;\r\n this.maxHeight = this._pixelHeight; // yes, we reset maxWidth\r\n }\r\n this.invalidatePosition();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelWidth\", {\r\n /**\r\n * Returns element's width in pixels, if width was set. For actual width use measuredWidth property.\r\n *\r\n * @readonly\r\n * @return Width (px)\r\n */\r\n get: function () {\r\n var width;\r\n if ($type.isNumber(this.percentWidth)) {\r\n width = this.maxWidth;\r\n }\r\n else if ($type.isNumber(this._pixelWidth)) {\r\n width = this._pixelWidth;\r\n }\r\n else {\r\n width = 0;\r\n }\r\n var minWidth = this.minWidth;\r\n if (minWidth != null && width < minWidth) {\r\n width = minWidth;\r\n }\r\n var value = $math.round(width, this._positionPrecision, true);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"pixelWidth\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelHeight\", {\r\n /**\r\n * Returns element's height in pixels. For actual height use measuredHeight property.\r\n *\r\n * @readonly\r\n * @return Height (px)\r\n */\r\n get: function () {\r\n var height;\r\n if ($type.isNumber(this.percentHeight)) {\r\n height = this.maxHeight;\r\n }\r\n else if ($type.isNumber(this._pixelHeight)) {\r\n height = this._pixelHeight;\r\n }\r\n else {\r\n height = 0; //this._measuredHeightSelf;\r\n }\r\n var minHeight = this.minHeight;\r\n if (minHeight != null && height < minHeight) {\r\n height = minHeight;\r\n }\r\n var value = $math.round(height, this._positionPrecision, true);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"pixelHeight\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativeWidth\", {\r\n /**\r\n * @return Relative width\r\n * @ignore\r\n */\r\n get: function () {\r\n var relativeWidth = this._relativeWidth;\r\n if ($type.isNumber(relativeWidth)) {\r\n if (!this._adapterO) {\r\n return relativeWidth;\r\n }\r\n else {\r\n return this._adapterO.apply(\"relativeWidth\", relativeWidth);\r\n }\r\n }\r\n },\r\n /**\r\n * Element's relative width in [[Percent]].\r\n * @ignore\r\n *\r\n * @param value Relative width\r\n */\r\n set: function (value) {\r\n if (this._relativeWidth != value) {\r\n this._relativeWidth = value;\r\n //\t\t\tthis.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativeHeight\", {\r\n /**\r\n * @return Relative height\r\n * @ignore\r\n */\r\n get: function () {\r\n var relativeHeight = this._relativeHeight;\r\n if ($type.isNumber(relativeHeight)) {\r\n if (!this._adapterO) {\r\n return relativeHeight;\r\n }\r\n else {\r\n return this._adapterO.apply(\"relativeHeight\", relativeHeight);\r\n }\r\n }\r\n },\r\n /**\r\n * Element's relative height in [[Percent]].\r\n *\r\n * @param value Relative height\r\n * @ignore\r\n */\r\n set: function (value) {\r\n if (this._relativeHeight != value) {\r\n this._relativeHeight = value;\r\n //\t\t\tthis.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"measuredWidth\", {\r\n /**\r\n * Returns element's measured width in pixels.\r\n *\r\n * A measured width is actual width of contents plus `paddingRight` and* `paddingLeft`, relative to sprite parent, meaning that\r\n * rotation and scale is taken into account.\r\n *\r\n * @readonly\r\n * @return Width (px)\r\n */\r\n get: function () {\r\n if (this.disabled || this.__disabled) {\r\n return 0;\r\n }\r\n if (!this._adapterO) {\r\n return this._measuredWidth;\r\n }\r\n else {\r\n return this._adapterO.apply(\"measuredWidth\", this._measuredWidth);\r\n }\r\n // it's not good to fit to min/max range as then rotations and scale won't be taken into account\r\n //return this.adapter.apply(\"measuredWidth\", $math.fitToRange(this._measuredWidth, this.minWidth, this.maxWidth));\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"measuredHeight\", {\r\n /**\r\n * Returns elements's measured height in pixels.\r\n *\r\n * A measured height is actual height of contents plus `paddingTop` and `paddingBottom`, relative to sprite parent, meaning that\r\n * rotation and scale taken into account.\r\n *\r\n * @readonly\r\n * @return Height (px)\r\n */\r\n get: function () {\r\n if (this.disabled || this.__disabled) {\r\n return 0;\r\n }\r\n // it's not good to fit to min/max range as then rotations and scale won't be taken into account\r\n //return this.adapter.apply(\"measuredHeight\", $math.fitToRange(this._measuredHeight, this.minHeight, this.maxHeight));\r\n if (!this._adapterO) {\r\n return this._measuredHeight;\r\n }\r\n else {\r\n return this._adapterO.apply(\"measuredHeight\", this._measuredHeight);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"outerWidth\", {\r\n /**\r\n * Returns element's measured width plus its left and right margins in\r\n * pixels.\r\n *\r\n * @readonly\r\n * @return Outer width (px)\r\n */\r\n get: function () {\r\n var value = this.pixelWidth + this.pixelMarginRight + this.pixelMarginLeft;\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"outerWidth\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"outerHeight\", {\r\n /**\r\n * Returns element's measured height plus its top and bottom margins in\r\n * pixels.\r\n *\r\n * @readonly\r\n * @return Outer height (px)\r\n */\r\n get: function () {\r\n var value = this.pixelHeight + this.pixelMarginTop + this.pixelMarginBottom;\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"outerHeight\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"innerWidth\", {\r\n /**\r\n * Returns element's measured inner width in pixels.\r\n *\r\n * Inner width is actual available space for content, e.g. element's width\r\n * minus horizontal padding.\r\n *\r\n * @readonly\r\n * @return Inner width (px)\r\n */\r\n get: function () {\r\n var value = Math.max(0, this.pixelWidth - this.pixelPaddingRight - this.pixelPaddingLeft);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"innerWidth\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"innerHeight\", {\r\n /**\r\n * Returns element's measured inner height in pixels.\r\n *\r\n * Inner height is actual available space for content, e.g. element's height\r\n * minus vertical padding.\r\n *\r\n * @readonly\r\n * @return Inner height (px)\r\n */\r\n get: function () {\r\n var value = Math.max(0, this.pixelHeight - this.pixelPaddingTop - this.pixelPaddingBottom);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"innerHeight\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"globalScale\", {\r\n /**\r\n * Returns element's current \"global\" scale.\r\n *\r\n * Scale values accumulate over hierarchy of elements.\r\n *\r\n * E.g. if a [[Container]] has `scale = 2` and it's child has a `scale = 2`,\r\n * the child's `globalScale` will be 4. (a multitude of `2 x 2`)\r\n *\r\n * @readonly\r\n * @return Global scale\r\n */\r\n get: function () {\r\n var scale = this.scale;\r\n if (this._parent) {\r\n scale = scale * this._parent.globalScale;\r\n }\r\n if (!this._adapterO) {\r\n return scale;\r\n }\r\n else {\r\n return this._adapterO.apply(\"globalScale\", scale);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"scale\", {\r\n /**\r\n * @return Scale (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"scale\");\r\n },\r\n /**\r\n * Scale of the element.\r\n *\r\n * The scale is set from 0 (element reduced to nothing) to 1 (default size).\r\n * * 2 will mean element is increased twice.\r\n * * 0.5 - reduced by 50%.\r\n *\r\n * Etc.\r\n *\r\n * @param value Scale (0-1)\r\n */\r\n set: function (value) {\r\n value = $type.toNumber(value);\r\n if (value < 0) {\r\n value = 0;\r\n }\r\n if (value != this.getPropertyValue(\"scale\")) {\r\n this.setPropertyValue(\"scale\", value, false, true);\r\n this.handleGlobalScale();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets all four margins for the element at once.\r\n *\r\n * Margins are set in pixels.\r\n *\r\n * @param top Top margin\r\n * @param right Right margin\r\n * @param bottom Bottom margin\r\n * @param left Left margin\r\n * @return Current element\r\n */\r\n Sprite.prototype.margin = function (top, right, bottom, left) {\r\n this.marginTop = top;\r\n this.marginRight = right;\r\n this.marginBottom = bottom;\r\n this.marginLeft = left;\r\n return this;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"marginLeft\", {\r\n /**\r\n * @return Margin value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"marginLeft\");\r\n },\r\n /**\r\n * Left margin - absolute (px) or relative ([[Percent]]).\r\n *\r\n * @param value Margin value\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"marginLeft\", value, true, true, this._positionPrecision, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"marginRight\", {\r\n /**\r\n * @return Margin value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"marginRight\");\r\n },\r\n /**\r\n * Right margin - absolute (px) or relative ([[Percent]]).\r\n *\r\n * @param value Margin value\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"marginRight\", value, true, true, this._positionPrecision, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"marginTop\", {\r\n /**\r\n * @return Margin value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"marginTop\");\r\n },\r\n /**\r\n * Top margin - absolute (px) or relative ([[Percent]]).\r\n *\r\n * @param value Margin value\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"marginTop\", value, true, true, this._positionPrecision, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"marginBottom\", {\r\n /**\r\n * @return Margin value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"marginBottom\");\r\n },\r\n /**\r\n * Bottom margin - absolute (px) or relative ([[Percent]]).\r\n *\r\n * @param value Margin value\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"marginBottom\", value, true, true, this._positionPrecision, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelMarginRight\", {\r\n /**\r\n * Returns current right margin in pixels.\r\n *\r\n * @readonly\r\n * @return Right margin (px)\r\n */\r\n get: function () {\r\n var value = this.getPixelX(this.marginRight);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"pixelMarginRight\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativeMarginRight\", {\r\n /**\r\n * Returns current relative right margin.\r\n *\r\n * @readonly\r\n * @return Relative right margin\r\n */\r\n get: function () {\r\n // @todo Maybe use [[Percent]]?\r\n var value = this.getRelativeX(this.marginRight);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"relativeMarginRight\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelMarginLeft\", {\r\n /**\r\n * Returns current left margin in pixels.\r\n *\r\n * @readonly\r\n * @return Left margin (px)\r\n */\r\n get: function () {\r\n var value = this.getPixelX(this.marginLeft);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"pixelMarginLeft\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativeMarginLeft\", {\r\n /**\r\n * Returns current relative left margin.\r\n *\r\n * @readonly\r\n * @return Relative left margin\r\n */\r\n get: function () {\r\n //@todo Maybe use [[Percent]]?\r\n var value = this.getRelativeX(this.marginLeft);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"relativeMarginLeft\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelMarginTop\", {\r\n /**\r\n * Returns current top margin in pixels.\r\n *\r\n * @readonly\r\n * @return Top margin (px)\r\n */\r\n get: function () {\r\n var value = this.getPixelY(this.marginTop);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"pixelMarginTop\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativeMarginTop\", {\r\n /**\r\n * Returns current relative top margin.\r\n *\r\n * @readonly\r\n * @return Relative top margin\r\n */\r\n get: function () {\r\n // @todo Maybe use [[Percent]]?\r\n var value = this.getRelativeY(this.marginTop);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"relativeMarginTop\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelMarginBottom\", {\r\n /**\r\n * Returns current bottom margin in pixels.\r\n *\r\n * @readonly\r\n * @return Bottom margin (px)\r\n */\r\n get: function () {\r\n var value = this.getPixelY(this.marginBottom);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"pixelMarginBottom\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativeMarginBottom\", {\r\n /**\r\n * Returns current relative bottom margin.\r\n *\r\n * @readonly\r\n * @return Relative bottom margin\r\n */\r\n get: function () {\r\n // @todo Maybe use [[Percent]]?\r\n var value = this.getRelativeY(this.marginBottom);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"relativeMarginBottom\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets padding for the element in pixels.\r\n *\r\n * @param top Top padding (px)\r\n * @param right Right padding (px)\r\n * @param bottom Bottom padding (px)\r\n * @param left Left padding (px)\r\n * @return Element\r\n */\r\n Sprite.prototype.padding = function (top, right, bottom, left) {\r\n this.paddingTop = top;\r\n this.paddingRight = right;\r\n this.paddingBottom = bottom;\r\n this.paddingLeft = left;\r\n return this;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"paddingLeft\", {\r\n /**\r\n * @return Padding value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"paddingLeft\");\r\n },\r\n /**\r\n * Left padding - absolute (px) or relative ([[Percent]]).\r\n *\r\n * @param value Padding value\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"paddingLeft\", value, true, true, this._positionPrecision, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"paddingRight\", {\r\n /**\r\n * @return Padding value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"paddingRight\");\r\n },\r\n /**\r\n * Right padding - absolute (px) or relative ([[Percent]]).\r\n *\r\n * @param value Padding value\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"paddingRight\", value, true, true, this._positionPrecision, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"paddingTop\", {\r\n /**\r\n * @return Padding value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"paddingTop\");\r\n },\r\n /**\r\n * Top padding - absolute (px) or relative ([[Percent]]).\r\n *\r\n * @param value Padding value\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"paddingTop\", value, true, true, this._positionPrecision, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"paddingBottom\", {\r\n /**\r\n * @return Padding value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"paddingBottom\");\r\n },\r\n /**\r\n * Bottom padding - absolute (px) or relative ([[Percent]]).\r\n *\r\n * @param value Padding value\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"paddingBottom\", value, true, true, this._positionPrecision, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelPaddingRight\", {\r\n /**\r\n * Returns current right padding in pixels.\r\n *\r\n * @readonly\r\n * @return Right padding (px)\r\n */\r\n get: function () {\r\n return this.getPixelX(this.paddingRight);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativePaddingRight\", {\r\n /**\r\n * Returns current relative right padding.\r\n *\r\n * @readonly\r\n * @return Relative right padding\r\n */\r\n get: function () {\r\n // @todo Maybe use [[Percent]]?\r\n return this.getRelativeX(this.paddingRight);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelPaddingLeft\", {\r\n /**\r\n * Returns current left padding in pixels.\r\n *\r\n * @readonly\r\n * @return Left padding (px)\r\n */\r\n get: function () {\r\n return this.getPixelX(this.paddingLeft);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativePaddingLeft\", {\r\n /**\r\n * Returns current relative left padding.\r\n *\r\n * @readonly\r\n * @return Relative left padding\r\n */\r\n get: function () {\r\n // @todo Maybe use [[Percent]]?\r\n return this.getRelativeX(this.paddingLeft);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelPaddingTop\", {\r\n /**\r\n * Returns current top padding in pixels.\r\n *\r\n * @readonly\r\n * @return Top padding (px)\r\n */\r\n get: function () {\r\n return this.getPixelY(this.paddingTop);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativePaddingTop\", {\r\n /**\r\n * Returns current relative top padding.\r\n *\r\n * @readonly\r\n * @return Relative top padding\r\n */\r\n get: function () {\r\n // @todo Maybe use [[Percent]]?\r\n return this.getRelativeY(this.paddingTop);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelPaddingBottom\", {\r\n /**\r\n * Returns current bottom padding in pixels.\r\n *\r\n * @readonly\r\n * @return Bottom padding (px)\r\n */\r\n get: function () {\r\n return this.getPixelY(this.paddingBottom);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativePaddingBottom\", {\r\n /**\r\n * Returns current relative bottom padding.\r\n *\r\n * @readonly\r\n * @return Relative bottom padding\r\n */\r\n get: function () {\r\n // @todo Maybe use [[Percent]]?\r\n return this.getRelativeY(this.paddingBottom);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"path\", {\r\n /**\r\n * @return Path of a Sprite element\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"path\");\r\n },\r\n /**\r\n * ==========================================================================\r\n * APPEARANCE-RELATED PROPERTIES AND RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Path of Sprite element\r\n */\r\n set: function (value) {\r\n this.setPath(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n Sprite.prototype.setPath = function (value) {\r\n if (this.setPropertyValue(\"path\", value)) {\r\n if (this._adapterO) {\r\n value = this._adapterO.apply(\"path\", value);\r\n }\r\n if (!this._isPath) {\r\n if (!this.element || (this.element.node && !(this.element.node instanceof SVGPathElement))) {\r\n this.element = this.paper.add(\"path\");\r\n }\r\n this._isPath = true;\r\n }\r\n if ($type.hasValue(value)) {\r\n this.element.attr({ \"d\": value });\r\n }\r\n else {\r\n this.element.removeAttr(\"d\");\r\n }\r\n this.invalidatePosition();\r\n // otherwise is 0x0\r\n if (!this.inited) {\r\n this.events.once(\"inited\", this.validatePosition, this, false);\r\n }\r\n return true;\r\n }\r\n return false;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"fillModifier\", {\r\n /**\r\n * @return Fill color modifier\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"fillModifier\");\r\n },\r\n /**\r\n * [[ColorModifier]] that can be used to modify color and pattern of the\r\n * element's fill, e.g. create gradients.\r\n *\r\n * @param value Fill color modifiier\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"fillModifier\", value)) {\r\n this.setFill(this.fill);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"strokeModifier\", {\r\n /**\r\n * @return Stroke color modifier\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"strokeModifier\");\r\n },\r\n /**\r\n * [[ColorModifier]] that can be used to modify color and pattern of the\r\n * element's stroke (outline), e.g. create gradients.\r\n *\r\n * @param value Stroke color modifier\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"strokeModifier\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"fillOpacity\", {\r\n /**\r\n * @return Opacity (0-9)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"fillOpacity\");\r\n },\r\n /**\r\n * Element's fill opacity.\r\n *\r\n * Opacity ranges from 0 (fully transparent) to 1 (fully opaque).\r\n *\r\n * @param value Opacity (0-1)\r\n */\r\n set: function (value) {\r\n value = $math.toNumberRange(value, 0, 1);\r\n if (this.setPropertyValue(\"fillOpacity\", value)) {\r\n this.setSVGAttribute({ \"fill-opacity\": value });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"fill\", {\r\n /**\r\n * @return Fill\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"fill\");\r\n },\r\n /**\r\n * Element's fill color or pattern.\r\n *\r\n * @param value Fill\r\n */\r\n set: function (value) {\r\n this.setFill(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets actual `fill` property on the SVG element, including applicable color\r\n * modifiers.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Fill\r\n */\r\n Sprite.prototype.setFill = function (value) {\r\n if (!$type.isObject(value) || \"r\" in value) {\r\n value = toColor(value);\r\n }\r\n if (this.setColorProperty(\"fill\", value) || this.fillModifier) {\r\n // this can not go into next if, as value is turned to Gradient\r\n if (value instanceof Color) {\r\n if (this.fillModifier) {\r\n value = this.fillModifier.modify(value);\r\n }\r\n }\r\n this.realFill = value;\r\n // todo: review this place when some Color type will be added\r\n if (value instanceof Color) {\r\n this.setSVGAttribute({ \"fill\": value.toString() });\r\n }\r\n else if (!$type.hasValue(value)) {\r\n this.removeSVGAttribute(\"fill\");\r\n }\r\n else if (value instanceof Pattern || value instanceof LinearGradient || value instanceof RadialGradient) {\r\n var fill = value;\r\n fill.paper = this.paper;\r\n this.setSVGAttribute({ \"fill\": \"url(\\\"\" + $utils.getBaseURI() + fill.id + \"\\\")\" });\r\n }\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"opacity\", {\r\n /**\r\n * @return Opacity (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"opacity\");\r\n },\r\n /**\r\n * Element's opacity.\r\n *\r\n * Opacity setting can range from 0 (fully transparent) to 1 (fully opaque).\r\n *\r\n * ATTENTION: It is highly not recommended to use `opacity` directly on the\r\n * element. The charts use `opacity` to hide/show elements, so your setting\r\n * might be lost if element is hidden and then later shown.\r\n *\r\n * Instead use methods `hide()` and `show()` to completely toggle off and on\r\n * the element.\r\n *\r\n * Or, use properties `fillOpacity` and `strokeOpacity`, if you need to make\r\n * the element semi-transparent.\r\n *\r\n * @param value Opacity (0-1)\r\n */\r\n set: function (value) {\r\n value = $math.toNumberRange(value, 0, 1);\r\n if (this.setPropertyValue(\"opacity\", value)) {\r\n this.setSVGAttribute({ \"opacity\": value });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"stroke\", {\r\n /**\r\n * @return Stroke setting\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"stroke\");\r\n },\r\n /**\r\n * Element's stroke (outline) color or pattern.\r\n *\r\n * @param value Stroke setting\r\n */\r\n set: function (value) {\r\n this.setStroke(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets actual `stroke` property on the SVG element, including applicable\r\n * color modifiers.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Stroke setting\r\n */\r\n Sprite.prototype.setStroke = function (value) {\r\n if (!$type.isObject(value) || \"r\" in value) {\r\n value = toColor(value);\r\n }\r\n if (this.setColorProperty(\"stroke\", value) || this.strokeModifier) {\r\n // this can not go into next if, as value is turned to Gradient\r\n if (value instanceof Color) {\r\n if (this.strokeModifier) {\r\n value = this.strokeModifier.modify(value);\r\n }\r\n }\r\n this.realStroke = value;\r\n if (value instanceof Color) {\r\n if (value.hex == \"none\") {\r\n this.removeSVGAttribute(\"stroke\");\r\n }\r\n else {\r\n this.setSVGAttribute({ \"stroke\": value.toString() });\r\n }\r\n }\r\n else if (!$type.hasValue(value)) {\r\n this.removeSVGAttribute(\"stroke\");\r\n }\r\n else if (value instanceof Pattern || value instanceof LinearGradient || value instanceof RadialGradient) {\r\n var stroke = value;\r\n stroke.paper = this.paper;\r\n this.setSVGAttribute({ \"stroke\": \"url(\\\"\" + $utils.getBaseURI() + stroke.id + \"\\\")\" });\r\n }\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"strokeOpacity\", {\r\n /**\r\n * @return Opacity (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"strokeOpacity\");\r\n },\r\n /**\r\n * Stroke (outline) opacity.\r\n *\r\n * The values may range from 0 (fully transparent) to 1 (fully opaque).\r\n *\r\n * @param value Opacity (0-1)\r\n */\r\n set: function (value) {\r\n value = $math.toNumberRange(value, 0, 1);\r\n if (this.setPropertyValue(\"strokeOpacity\", value)) {\r\n this.setSVGAttribute({ \"stroke-opacity\": value });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"nonScalingStroke\", {\r\n /**\r\n * @return Do not scale stroke (outline)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"nonScalingStroke\");\r\n },\r\n /**\r\n * Controls if the element's stroke (outline) should remain keep constant\r\n * thicnkess and do not scale when the whole element is resized.\r\n *\r\n * @param value Do not scale stroke (outline)\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"nonScalingStroke\", value)) {\r\n this.strokeWidth = this.strokeWidth;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"nonScaling\", {\r\n /**\r\n * @return Is element scaleable?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"nonScaling\");\r\n },\r\n /**\r\n * Controls if element should keep constant size and not scale even if there is\r\n * space available, or it does not fit.\r\n *\r\n * @param value Is element scaleable?\r\n */\r\n set: function (value) {\r\n // @todo Description (review)\r\n value = $type.toBoolean(value);\r\n this.setPropertyValue(\"nonScaling\", value, false, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"strokeWidth\", {\r\n /**\r\n * @return Thickness (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"strokeWidth\");\r\n },\r\n /**\r\n * Stroke (outline) thickness in pixels.\r\n *\r\n * @param value Thickness (px)\r\n */\r\n set: function (value) {\r\n value = $type.toNumber(value);\r\n this.setPropertyValue(\"strokeWidth\", value, true);\r\n if (this.nonScalingStroke) {\r\n if (!$type.isNumber(value)) {\r\n value = 1;\r\n }\r\n value = value / this.globalScale;\r\n }\r\n this.setSVGAttribute({ \"stroke-width\": value });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"strokeDasharray\", {\r\n /**\r\n * @return `stroke-dasharray`\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"strokeDasharray\");\r\n },\r\n /**\r\n * A `stroke-dasharray` for the stroke (outline).\r\n *\r\n * \"Dasharray\" allows setting rules to make lines dashed, dotted, etc.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray} for more info on `stroke-dasharray`\r\n * @param value `stroke-dasharray`\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"strokeDasharray\", value)) {\r\n this.setSVGAttribute({ \"stroke-dasharray\": value });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"strokeDashoffset\", {\r\n /**\r\n * @return `stroke-dashoffset`\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"strokeDashoffset\");\r\n },\r\n /**\r\n * A `stroke-dashoffset` for the stroke (outline).\r\n *\r\n * \"Dashoffset\" allows setting the start position of the dashes if\r\n * `strokeDasharray` is used.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dashoffset} for more info on `stroke-dashoffset`\r\n * @param value `stroke-dashoffset`\r\n */\r\n set: function (value) {\r\n value = $type.toNumber(value);\r\n if (this.setPropertyValue(\"strokeDashoffset\", value)) {\r\n this.setSVGAttribute({ \"stroke-dashoffset\": value });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"strokeLinecap\", {\r\n /**\r\n * @return `stroke-linecap`\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"strokeLinecap\");\r\n },\r\n /**\r\n * A `stroke-linecap` to indicate how line ends are drawn.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Fills_and_Strokes#Stroke} for more info on `stroke-linecap`\r\n * @param value `stroke-linecap`\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"strokeLinecap\", value)) {\r\n this.setSVGAttribute({ \"stroke-linecap\": value });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"strokeLinejoin\", {\r\n /**\r\n * @return `stroke-linejoin`\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"strokeLinejoin\");\r\n },\r\n /**\r\n * A `stroke-linejoin` to indicate how line ends are drawn.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Fills_and_Strokes#Stroke} for more info on `stroke-linejoin`\r\n * @param value `stroke-linejoin`\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"strokeLinejoin\", value)) {\r\n this.setSVGAttribute({ \"stroke-linejoin\": value });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"shapeRendering\", {\r\n /**\r\n * @return 'shape-rendering' value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"shapeRendering\");\r\n },\r\n /**\r\n * An SVG-specific `shape-rendering` value.\r\n *\r\n * `shape-rendering` controls how vector graphics are drawn and rendered.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering} for more information about `shape-rendering`\r\n * @default \"auto\"\r\n * @param value 'shape-rendering' value\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"shapeRendering\", value)) {\r\n this.setSVGAttribute({ \"shape-rendering\": value });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelPerfect\", {\r\n /**\r\n * @return Use pixel perfect?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"pixelPerfect\");\r\n },\r\n /**\r\n * Controls if SVG vectors should be drawn with \"pixel\" precision, producing\r\n * perfectly crisp lines on retina displays.\r\n *\r\n * Setting this to `true` might improve visual quality, but may have a\r\n * negative effect on performance.\r\n *\r\n * Different elements use different default setting for `pixelPerfect`.\r\n *\r\n * We recommend leaving this at their default settings, unless there's a\r\n * specific need.\r\n *\r\n * @param value Use pixel perfect?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (value) {\r\n this._positionPrecision = options.pixelPerfectPrecision;\r\n }\r\n else {\r\n this._positionPrecision = 3;\r\n }\r\n this.setPropertyValue(\"pixelPerfect\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"rtl\", {\r\n /**\r\n * @return RTL?\r\n */\r\n get: function () {\r\n if ($type.hasValue(this._rtl)) {\r\n return this._rtl;\r\n }\r\n else if (this._topParent) {\r\n return this._topParent.rtl;\r\n }\r\n //this.rtl = false;\r\n return false;\r\n },\r\n /**\r\n * An RTL (right-to-left) setting.\r\n *\r\n * RTL may affect alignment, text, and other visual properties.\r\n *\r\n * If you set this on a top-level chart object, it will be used for all\r\n * child elements, e.g. labels, unless they have their own `rtl` setting\r\n * set directly on them.\r\n *\r\n * @param value `true` for to use RTL\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.isBaseSprite) {\r\n this.topParent.rtl = value;\r\n }\r\n this._rtl = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * ==========================================================================\r\n * VISIBILITY AND ORDER PROPERTIES AND RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Reveals hidden element.\r\n *\r\n * Has no effect if element is already visible.\r\n *\r\n * If `duration` is not specified, it will use default.\r\n *\r\n * @param duration Fade in duration (ms)\r\n * @return Animation object if such object was created\r\n */\r\n Sprite.prototype.show = function (duration) {\r\n return this.showReal(duration);\r\n };\r\n /**\r\n * Performs actual operations to reveal this element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param duration Fade in duration (ms)\r\n * @return Fade in duration (ms)\r\n */\r\n Sprite.prototype.showReal = function (duration) {\r\n var _this = this;\r\n if (this.preventShow) {\r\n return;\r\n }\r\n var transition;\r\n var properties = this.defaultState.properties;\r\n if (!this.disabled && (this.isHidden || !this.visible || this.isHiding || (properties.opacity != null && this.opacity < properties.opacity && !this.isShowing)) && !this.isDisposed()) {\r\n // helps to avoid flicker, as show might change opacity or visibility but item might be at invalid state/position\r\n if (this.invalid) {\r\n this.validate();\r\n }\r\n if (this.positionInvalid) {\r\n this.validatePosition();\r\n }\r\n if (!$type.isNumber(duration)) {\r\n duration = this.defaultState.transitionDuration;\r\n }\r\n if (this._hideAnimation) {\r\n this._hideAnimation.kill();\r\n this._hideAnimation = undefined;\r\n }\r\n // Cancel hide handler just in case it was there\r\n if (this._showHideDisposer) {\r\n this.removeDispose(this._showHideDisposer);\r\n }\r\n this._isHidden = false;\r\n this.isHiding = false;\r\n this.isShowing = true;\r\n // Apply current state\r\n transition = this.applyCurrentState(duration);\r\n if (transition && !transition.isFinished()) {\r\n this._showHideDisposer = transition.events.on(\"animationended\", function () {\r\n _this.isShowing = false;\r\n });\r\n this._disposers.push(this._showHideDisposer);\r\n }\r\n else {\r\n this.isShowing = false;\r\n }\r\n // Make it visible\r\n var visible = this.defaultState.properties.visible;\r\n if (!$type.hasValue(visible)) {\r\n visible = true;\r\n }\r\n this.visible = visible;\r\n // Unhide from screen readers\r\n this.readerHidden = false;\r\n // Dispatch \"show\" event\r\n this.dispatchImmediately(\"shown\");\r\n }\r\n return transition;\r\n };\r\n /**\r\n * Initiates hiding of Sprite.\r\n * When called it will fade out the the Sprite to transparency, then make it\r\n * invisible.\r\n * @param duration Duration in millisecons\r\n */\r\n /**\r\n * Hides the element, by applying `hidden` state.\r\n *\r\n * Has no effect if element is already hidden.\r\n *\r\n * If `duration` is not specified, it will use default.\r\n *\r\n * While element is fading out, its `isHiding` property will resolve to\r\n * `true`.\r\n *\r\n * When element is hidden, its `visible` property will resolve to `false`.\r\n *\r\n * @param duration Fade out duration (ms)\r\n * @return hide Animation object if such object was created\r\n */\r\n Sprite.prototype.hide = function (duration) {\r\n return this.hideReal(duration);\r\n };\r\n /**\r\n * Hides actual SVG elements and handles hiding animations.\r\n *\r\n * @param duration Fade out duration (ms)\r\n * @return Fade out duration (ms)\r\n * @ignore\r\n */\r\n Sprite.prototype.hideReal = function (duration) {\r\n var _this = this;\r\n var transition;\r\n if (!this.isHiding && this.visible && !this.isDisposed()) {\r\n // added to solve 51375\r\n if (this.tooltip && this.tooltip.currentSprite == this) {\r\n this.hideTooltip(0);\r\n }\r\n if (this._hideAnimation) {\r\n this._hideAnimation.kill();\r\n this._hideAnimation = undefined;\r\n }\r\n this.isShowing = false;\r\n // Cancel hide handler just in case it was there\r\n if (this._showHideDisposer) {\r\n this.removeDispose(this._showHideDisposer);\r\n }\r\n // Get state\r\n var hiddenState_1 = this.hiddenState;\r\n // Transition to \"hidden\" state, provided Sprite has one set\r\n if (hiddenState_1) {\r\n // Yes, we have a \"hidden\" state\r\n // `setState` will return an `Animation` object which we can set\r\n // events on\r\n transition = this.setState(hiddenState_1, duration, undefined);\r\n if (transition && !transition.isFinished()) {\r\n this._hideAnimation = transition;\r\n this._showHideDisposer = transition.events.on(\"animationended\", function () {\r\n _this.isHiding = false;\r\n _this._isHidden = true;\r\n if (hiddenState_1.properties.visible == false) {\r\n _this.visible = false;\r\n }\r\n }, this);\r\n this._disposers.push(this._showHideDisposer);\r\n // Thrown everything into `_disposers` just in case Sprite gets\r\n // destroyed in the meantime\r\n this._disposers.push(transition);\r\n }\r\n else {\r\n this.isHiding = false;\r\n this._isHidden = true;\r\n }\r\n }\r\n else {\r\n // No hidden state, let's just set `visible` and call it a day\r\n this.visible = false;\r\n this.isHiding = false;\r\n this._isHidden = true;\r\n }\r\n // Hide from screen readers\r\n this.readerHidden = true;\r\n // Dispach \"hidden\" event\r\n this.dispatchImmediately(\"hidden\");\r\n this.invalidate(); // hide it at once to avoid flickers // validate() causes SO\r\n }\r\n if (!$type.isNumber(duration)) {\r\n duration = this.hiddenState.transitionDuration;\r\n }\r\n return transition;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"visible\", {\r\n /**\r\n * @return Visible?\r\n */\r\n get: function () {\r\n return this.getVisibility();\r\n },\r\n /**\r\n * Indicates if element is current visible (`true`) or hidden (`false`).\r\n *\r\n * @param value Visible?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n this.setVisibility(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns visibility value\r\n * @ignore\r\n */\r\n Sprite.prototype.getVisibility = function () {\r\n var value = this.getPropertyValue(\"visible\");\r\n if (!$type.hasValue(value)) {\r\n value = true;\r\n }\r\n return value;\r\n };\r\n /**\r\n * Sets `visibility` property:\r\n *\r\n * * `true` - visible\r\n * * `false` - hidden\r\n *\r\n * @param value true - visible, false - hidden\r\n * @return Current visibility\r\n */\r\n Sprite.prototype.setVisibility = function (value) {\r\n if (this.setPropertyValue(\"visible\", value)) {\r\n if (value) {\r\n this.group.removeAttr(\"visibility\");\r\n }\r\n else {\r\n this.group.attr({ \"visibility\": \"hidden\" });\r\n }\r\n //this.invalidatePosition();\r\n if (this.events.isEnabled(\"visibilitychanged\")) {\r\n var event_4 = {\r\n type: \"visibilitychanged\",\r\n target: this,\r\n visible: value\r\n };\r\n this.events.dispatchImmediately(\"visibilitychanged\", event_4);\r\n }\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"zIndex\", {\r\n /**\r\n * @return zIndex\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"zIndex\");\r\n },\r\n /**\r\n * A \"zIndex\" of the element.\r\n *\r\n * \"zIndex\" determines the order of how elements are placed over each other.\r\n *\r\n * Higher \"zIndex\" will mean the element will be draw on top of elements\r\n * with lower \"zIndexes\".\r\n *\r\n * @param value zIndex\r\n */\r\n set: function (value) {\r\n value = $type.toNumber(value);\r\n if (this.setPropertyValue(\"zIndex\", value)) {\r\n this.dispatch(\"zIndexChanged\");\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Moves the element to the very top in element order, so that it appears\r\n * in front of other elements.\r\n */\r\n Sprite.prototype.toFront = function () {\r\n var parent = this._parent;\r\n if (parent && parent.children.indexOf(this) != parent.children.length - 1) {\r\n parent.children.moveValue(this, parent.children.length - 1);\r\n this.dispatch(\"zIndexChanged\");\r\n }\r\n };\r\n /**\r\n * Moves the element to the very bottom in the element order, so that it\r\n * appears behind other elements.\r\n */\r\n Sprite.prototype.toBack = function () {\r\n var parent = this._parent;\r\n if (parent && parent.children.indexOf(this) != 0) {\r\n parent.children.moveValue(this, 0);\r\n this.dispatch(\"zIndexChanged\");\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"userClassName\", {\r\n /**\r\n * @return Class name\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"userClassName\");\r\n },\r\n /**\r\n * A custom class name to set on the element.\r\n *\r\n * If set, the value will be added to element's `class` attribute.\r\n *\r\n * @since 4.9.11\r\n * @param value Class name\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"userClassName\", value)) {\r\n if (!value && this.userClassName) {\r\n this.group.removeClass(this.userClassName);\r\n }\r\n this.setClassName();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"tooltip\", {\r\n /**\r\n * @return Tooltip\r\n */\r\n get: function () {\r\n if (this._tooltip) {\r\n return this._tooltip;\r\n }\r\n else if (this.virtualParent) {\r\n return this.virtualParent.tooltip;\r\n }\r\n else if (this._parent) {\r\n return this._parent.tooltip;\r\n }\r\n },\r\n /**\r\n * ==========================================================================\r\n * TOOLTIP-RELATED PROPERTIES STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * A [[Tooltip]] object to be used when displayed rollover information for\r\n * the element.\r\n *\r\n * @param tooltip Tooltip\r\n */\r\n set: function (tooltip) {\r\n if (this._tooltip) {\r\n //this._tooltip.dispose();\r\n this.removeDispose(this._tooltip);\r\n }\r\n this._tooltip = tooltip;\r\n if (tooltip) {\r\n tooltip.parent = this.tooltipContainer;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"tooltipDataItem\", {\r\n /**\r\n * @return Tooltip data item\r\n */\r\n get: function () {\r\n var tooltipDataItem = this._tooltipDataItem;\r\n if (tooltipDataItem) {\r\n return tooltipDataItem;\r\n }\r\n else {\r\n return this.dataItem;\r\n }\r\n },\r\n /**\r\n * A [[DataItem]] to use when populating content for the element's\r\n * [[Tooltip]].\r\n *\r\n * @see {@link Tooltip}\r\n * @see {@link DataItem}\r\n * @param value Tooltip data item\r\n */\r\n set: function (value) {\r\n // important: do not dispose tooltip dataItem, as it is some actual data item from data!\r\n this._tooltipDataItem = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"tooltipColorSource\", {\r\n /**\r\n * @return Tooltip color source\r\n */\r\n get: function () {\r\n return this._tooltipColorSource;\r\n },\r\n /**\r\n * A [[Sprite]] or sprite template to use when getting colors for tooltip. If a template is set,\r\n * tooltip will look for a clone in tooltipDataItem.sprites. If no clone is found, then template colors will be used.\r\n *\r\n * @see {@link Tooltip}\r\n * @see {@link Sprite}\r\n * @param sprite Sprite\r\n */\r\n set: function (sprite) {\r\n this._tooltipColorSource = sprite;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Shows the element's [[Tooltip]].\r\n *\r\n * A tooltip will be populated using text templates in either `tooltipHTML` or\r\n * `tooltipText` as well as data in `tooltipDataItem`.\r\n *\r\n * @see {@link Tooltip}\r\n * @param optional point (sprite-related) to which tooltip must point.\r\n * @return returns true if the tooltip was shown and false if it wasn't (no text was found)\r\n */\r\n Sprite.prototype.showTooltip = function (point) {\r\n if (this.showTooltipOn == \"always\" && !this._tooltip && this.tooltip) {\r\n this._tooltip = this.tooltip.clone();\r\n }\r\n if (!point && this.tooltipPosition == \"pointer\" && this.isHover) {\r\n point = $utils.documentPointToSvg(getInteraction().lastPointer.point, this.svgContainer.SVGContainer, this.svgContainer.cssScale);\r\n }\r\n // do not show if hidden\r\n var sprite = this;\r\n while (sprite != undefined) {\r\n if (!sprite.visible || sprite.disabled || sprite.__disabled) {\r\n if (this._tooltip && this._tooltip.visible) {\r\n this._tooltip.hide(0);\r\n }\r\n return;\r\n }\r\n sprite = sprite.parent;\r\n }\r\n if ($type.hasValue(this.tooltipText) || $type.hasValue(this.tooltipHTML)) {\r\n var tooltip = this.tooltip;\r\n var tooltipDataItem = this.tooltipDataItem;\r\n if (tooltip) {\r\n tooltip.targetSprite = this;\r\n var colorSource_1 = this;\r\n var tooltipColorSource_1 = this.tooltipColorSource;\r\n if ((tooltip.getStrokeFromObject || tooltip.getFillFromObject) && tooltipColorSource_1) {\r\n if (tooltipColorSource_1.isTemplate) {\r\n if (tooltipDataItem) {\r\n $array.eachContinue(tooltipDataItem.sprites, function (sprite) {\r\n if (sprite.clonedFrom == tooltipColorSource_1) {\r\n colorSource_1 = sprite;\r\n return false;\r\n }\r\n return true;\r\n });\r\n }\r\n }\r\n else {\r\n colorSource_1 = tooltipColorSource_1;\r\n }\r\n }\r\n if (tooltip.getStrokeFromObject) {\r\n var stroke = this.stroke;\r\n var source = colorSource_1;\r\n while (source.parent != undefined) {\r\n stroke = source.stroke;\r\n if (stroke == undefined) {\r\n source = source.parent;\r\n }\r\n if (stroke != undefined) {\r\n break;\r\n }\r\n }\r\n if (stroke instanceof Color) {\r\n tooltip.background.animate({ property: \"stroke\", to: stroke }, tooltip.animationDuration);\r\n }\r\n else {\r\n tooltip.background.stroke = stroke;\r\n }\r\n }\r\n // Set data item\r\n tooltip.dataItem = tooltipDataItem;\r\n tooltip.label.populateStringFrom = this;\r\n if (tooltip.getFillFromObject) {\r\n var fill = this.fill;\r\n var source = colorSource_1;\r\n while (source.parent != undefined) {\r\n fill = source.fill;\r\n if (fill == undefined || (fill instanceof Color && fill.rgb == undefined)) {\r\n source = source.parent;\r\n }\r\n else if (fill != undefined) {\r\n break;\r\n }\r\n }\r\n if (fill == undefined) {\r\n fill = color(\"#000000\");\r\n }\r\n if (fill instanceof Color) {\r\n if (!tooltip.visible) {\r\n tooltip.background.fill = fill;\r\n }\r\n else {\r\n tooltip.background.animate({ property: \"fill\", to: fill }, tooltip.animationDuration);\r\n }\r\n }\r\n else {\r\n tooltip.background.fill = fill;\r\n }\r\n if (tooltip.autoTextColor && fill instanceof Color) {\r\n tooltip.label.fill = fill.alternative;\r\n }\r\n }\r\n // Apply tooltip text\r\n var text = \"\";\r\n if (this.tooltipHTML) {\r\n tooltip.html = this.tooltipHTML;\r\n text = this.tooltipHTML;\r\n }\r\n if (this.tooltipText) {\r\n tooltip.text = this.tooltipText;\r\n text = this.tooltipText;\r\n }\r\n if (this.updateTooltipPosition(point)) {\r\n // Set accessibility option\r\n tooltip.readerDescribedBy = this.uidAttr();\r\n // make label to render to be able to check currentText\r\n if (tooltip.label.invalid) {\r\n tooltip.label.validate();\r\n }\r\n if (text != undefined && text != \"\" && tooltip.label.currentText != \"\") {\r\n //@todo: think of how to solve this better\r\n if (tooltip && !tooltip.parent) {\r\n tooltip.parent = this.tooltipContainer;\r\n }\r\n // Reveal tooltip\r\n // showing it in 1 ms helps to avoid strange flickering in IE\r\n var duration = tooltip.defaultState.transitionDuration;\r\n if (duration <= 0) {\r\n duration = 1;\r\n }\r\n tooltip.show(duration);\r\n tooltip.currentSprite = this;\r\n return true;\r\n }\r\n else {\r\n this.hideTooltip(0);\r\n }\r\n }\r\n else {\r\n this.hideTooltip(0);\r\n }\r\n }\r\n }\r\n return false;\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Sprite.prototype.updateTooltipPosition = function (point) {\r\n var _this = this;\r\n if (this.tooltipPosition == \"pointer\") {\r\n if (this._interactionDisposer) {\r\n this._interactionDisposer.dispose();\r\n }\r\n this._interactionDisposer = getInteraction().body.events.on(\"track\", function (ev) {\r\n return _this.pointTooltipTo($utils.documentPointToSvg(ev.point, _this.svgContainer.SVGContainer, _this.svgContainer.cssScale), true);\r\n });\r\n if (point) {\r\n return this.pointTooltipTo(point, true);\r\n }\r\n }\r\n else {\r\n // Point to the X/Y of this Sprite\r\n var globalPoint = $utils.spritePointToSvg({\r\n \"x\": this.getTooltipX(),\r\n \"y\": this.getTooltipY()\r\n }, this);\r\n return this.pointTooltipTo(globalPoint);\r\n }\r\n };\r\n /**\r\n * Sets the point the [[Tooltip]] should point to.\r\n *\r\n * @param point Coordinates to point to\r\n * @param instantly Move instantly without animation\r\n */\r\n Sprite.prototype.pointTooltipTo = function (point, instantly) {\r\n var tooltip = this.tooltip;\r\n if (tooltip && this.topParent) {\r\n if (tooltip.showInViewport) {\r\n tooltip.pointTo(point, instantly);\r\n return true;\r\n }\r\n if ($math.isInRectangle(point, { x: 0, y: 0, width: this.topParent.maxWidth, height: this.topParent.maxHeight })) {\r\n tooltip.pointTo(point, instantly);\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n /**\r\n * Hides element's [[Tooltip]].\r\n *\r\n * @see {@link Tooltip}\r\n */\r\n Sprite.prototype.hideTooltip = function (duration) {\r\n if (this.showTooltipOn == \"always\") {\r\n return;\r\n }\r\n var tooltip = this.tooltip;\r\n if (tooltip) {\r\n if (tooltip.targetSprite == this) {\r\n tooltip.targetSprite = undefined;\r\n }\r\n tooltip.hide(duration);\r\n if (this._interactionDisposer) {\r\n this._interactionDisposer.dispose();\r\n this._interactionDisposer = undefined;\r\n }\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"tooltipHTML\", {\r\n /**\r\n * @return Tooltip HTML content template\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"tooltipHTML\");\r\n },\r\n /**\r\n * An HTML template to be used to populate [[Tooltip]] contents.\r\n *\r\n * If element has `tooltipDataItem` or `dataItem` set, this will be parsed\r\n * for any data values to be replaced with the values from respective data\r\n * items.\r\n *\r\n * @param value Tooltip HTML content template\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n this.hoverable = true;\r\n if (this.setPropertyValue(\"tooltipHTML\", value)) {\r\n if (this.tooltip) {\r\n if (this.tooltip.visible) {\r\n this.showTooltip();\r\n }\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"tooltipText\", {\r\n /**\r\n * @return Tooltip content template\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"tooltipText\");\r\n },\r\n /**\r\n * A text template to be used to populate Tooltip's contents.\r\n *\r\n * If element has `tooltipDataItem` or `dataItem` set, this will be parsed\r\n * for any data values to be replaced with the values from respective data\r\n * items.\r\n *\r\n * This template will also be parsed for any special formatting tags.\r\n *\r\n * @param value Tooltip content template\r\n * @see {@link TextFormatter}\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (value) {\r\n this.hoverable = true;\r\n }\r\n if (this.setPropertyValue(\"tooltipText\", value)) {\r\n if (this.tooltip) {\r\n if (this.tooltip.visible) {\r\n this.showTooltip();\r\n }\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"tooltipContainer\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Container\r\n */\r\n get: function () {\r\n if (this._tooltipContainer) {\r\n return this._tooltipContainer;\r\n }\r\n else if (this._parent) {\r\n return this._parent.tooltipContainer;\r\n }\r\n },\r\n /**\r\n * A container reference that should be used to place element's\r\n * [[Tooltip]] in.\r\n *\r\n * Will use parent's container if does not have one set.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Container\r\n * @todo Dispose of the old _tooltipContainer ?\r\n */\r\n set: function (value) {\r\n this._tooltipContainer = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"tooltipX\", {\r\n /**\r\n * @return Tooltip X (px)\r\n */\r\n get: function () {\r\n return this.getTooltipX();\r\n },\r\n /**\r\n * X coordinate the [[Tooltip]] should be shown at.\r\n *\r\n * @param value Tooltip X (px)\r\n */\r\n set: function (value) {\r\n if (this.setPercentProperty(\"tooltipX\", value) && this.tooltip) {\r\n this.tooltip.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"alwaysShowTooltip\", {\r\n /**\r\n * @return Always show tooltip?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"showTooltipOn\") == \"always\";\r\n },\r\n /**\r\n * DEPRECATION NOTICE: This setting is deprecated in favor of a more flexible\r\n * setting: `showTooltipOn`. Please use `showTooltipOn = \"always\"` instead.\r\n *\r\n * Indicates if this element should display a tooltip permanently.\r\n *\r\n * Useful, if you want to show permanent tooltips on some items.\r\n *\r\n * @default false\r\n * @since 4.5.4\r\n * @deprecated Use `showTooltipOn = \"always\"` instead\r\n * @param value Always show tooltip?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (value) {\r\n this.showTooltipOn = \"always\";\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"showTooltipOn\", {\r\n /**\r\n * @return When to show tooltip\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"showTooltipOn\");\r\n },\r\n /**\r\n * Indicates when tooltip needs to be shown on this element:\r\n *\r\n * * `\"hover\"` (default) - Tooltip will be shown when element is hovered on.\r\n * * `\"hit\"` - Tooltip will be shown when element is clicked/tapped. Tooltip will be hidden when clicked/tapped anywhere else.\r\n * * `\"always\"` - Tooltip will be shown on the element permanently.\r\n *\r\n * For example, if you would like to show tooltips on all of the columns of\r\n * a [[ColumnSeries]]:\r\n *\r\n * ```TypeScript\r\n * series.columns.template.showTooltipOn = \"always\";\r\n * ```\r\n * ```JavaScript\r\n * series.columns.template.showTooltipOn = \"always\";\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"series\": [{\r\n * // ...\r\n * \"columns\": {\r\n * \"showTooltipOn\": \"always\"\r\n * }\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * It can even be set to display on a selected columns via `propertyFields`:\r\n *\r\n * ```TypeScript\r\n * series.columns.template.propertyFields.showTooltipOn = \"tooltip\";\r\n * ```\r\n * ```JavaScript\r\n * series.columns.template.propertyFields.showTooltipOn = \"tooltip\";\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"series\": [{\r\n * // ...\r\n * \"columns\": {\r\n * \"propertyFields\": {\r\n * \"showTooltipOn\": \"tooltip\"\r\n * }\r\n * }\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * @default \"hover\"\r\n * @since 4.7.9\r\n * @param value When to show tooltip\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"showTooltipOn\", value)) {\r\n if (value == \"hit\") {\r\n this.clickable = true;\r\n }\r\n if (this.tooltip) {\r\n if (value == \"always\") {\r\n this.showTooltip();\r\n }\r\n else {\r\n this.handleAlwaysShowTooltip();\r\n }\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"tooltipPosition\", {\r\n /**\r\n * Position\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"tooltipPosition\");\r\n },\r\n /**\r\n * Specifies if [[Tooltip]] should follow the mouse or touch pointer or stay\r\n * at the fixed position.\r\n *\r\n * @param value Position\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"tooltipPosition\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"tooltipY\", {\r\n /**\r\n * @return Tooltip Y (px)\r\n */\r\n get: function () {\r\n return this.getTooltipY();\r\n },\r\n /**\r\n * Y coordinate the [[Tooltip]] should be shown at.\r\n *\r\n * @param value Tooltip Y (px)\r\n */\r\n set: function (value) {\r\n if (this.setPercentProperty(\"tooltipY\", value) && this.tooltip) {\r\n this.tooltip.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns Tooltip X coordinate if it's set, or middle of the element.\r\n *\r\n * @ignore Exclude from docs\r\n * @return X (px)\r\n */\r\n Sprite.prototype.getTooltipX = function () {\r\n var x = this.getPropertyValue(\"tooltipX\");\r\n if (!$type.hasValue(x)) {\r\n x = percent(50);\r\n }\r\n var value;\r\n if ($type.isNumber(x)) {\r\n value = x;\r\n }\r\n if (x instanceof Percent) {\r\n value = this.maxLeftSelf + this._measuredWidthSelf * x.value - this.pixelPaddingLeft - this.ex; // overflow is know only for measured items, so this is not always good\r\n }\r\n if (!$type.isNumber(value)) {\r\n value = 0;\r\n }\r\n return value;\r\n };\r\n /**\r\n * Returns Tooltip Y coordinate if it's set, or middle of the element.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Y (px)\r\n */\r\n Sprite.prototype.getTooltipY = function () {\r\n var y = this.getPropertyValue(\"tooltipY\");\r\n if (!$type.hasValue(y)) {\r\n y = percent(50);\r\n }\r\n var value;\r\n if ($type.isNumber(y)) {\r\n value = y;\r\n }\r\n if (y instanceof Percent) {\r\n value = this.maxTopSelf + this._measuredHeightSelf * y.value - this.pixelPaddingTop - this.ey; // overflow is know only for measured items, so this is not always good\r\n }\r\n if (!$type.isNumber(value)) {\r\n value = 0;\r\n }\r\n return value;\r\n };\r\n /**\r\n * Displays a modal or console message with error, and halts any further\r\n * processing of this item.\r\n *\r\n * @ignore Exclude from docs\r\n * @param e Error\r\n * @todo Implement from applying further actions to this item\r\n */\r\n Sprite.prototype.raiseCriticalError = function (e, closable) {\r\n if (this.svgContainer) {\r\n if (!this._adapterO) {\r\n this.modal.content = e.message;\r\n }\r\n else {\r\n this.modal.content = this._adapterO.apply(\"criticalError\", e).message;\r\n }\r\n if (!closable) {\r\n this.disabled = true;\r\n }\r\n else {\r\n this.modal.closable = true;\r\n }\r\n if (!options.suppressErrors) {\r\n this.modal.open();\r\n }\r\n }\r\n if (options.verbose) {\r\n console.log(e);\r\n }\r\n };\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n Sprite.prototype.processConfig = function (config) {\r\n if (config) {\r\n // Tooltip color source\r\n if ($type.hasValue(config.tooltipColorSource) && $type.isString(config.tooltipColorSource) && this.map.hasKey(config.tooltipColorSource)) {\r\n config.tooltipColorSource = this.map.getKey(config.tooltipColorSource);\r\n }\r\n // Cursor styles\r\n if ($type.hasValue(config.cursorOverStyle) && $type.isString(config.cursorOverStyle)) {\r\n config.cursorOverStyle = this.getCursorStyle(config.cursorOverStyle);\r\n }\r\n if ($type.hasValue(config.cursorDowntyle) && $type.isString(config.cursorDowntyle)) {\r\n config.cursorDowntyle = this.getCursorStyle(config.cursorDowntyle);\r\n }\r\n if ($type.hasValue(config.cursorOptions)) {\r\n if ($type.hasValue(config.cursorOptions.overStyle) && $type.isString(config.cursorOptions.overStyle)) {\r\n config.cursorOptions.overStyle = this.getCursorStyle(config.cursorOptions.overStyle);\r\n }\r\n if ($type.hasValue(config.cursorOptions.downStyle) && $type.isString(config.cursorOptions.downStyle)) {\r\n config.cursorOptions.downStyle = this.getCursorStyle(config.cursorOptions.downStyle);\r\n }\r\n }\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n this.processDelayedMap();\r\n };\r\n /**\r\n * Converts string name of the cursor into actual [[MouseCursorStyle]].\r\n *\r\n * @param style Cursor type\r\n * @return Cursor definition\r\n */\r\n Sprite.prototype.getCursorStyle = function (style) {\r\n switch (style) {\r\n case \"grab\":\r\n return MouseCursorStyle.grab;\r\n case \"grabbing\":\r\n return MouseCursorStyle.grabbing;\r\n case \"pointer\":\r\n return MouseCursorStyle.pointer;\r\n case \"horizontalResize\":\r\n return MouseCursorStyle.horizontalResize;\r\n case \"verticalResize\":\r\n return MouseCursorStyle.verticalResize;\r\n default:\r\n return MouseCursorStyle.default;\r\n }\r\n };\r\n /**\r\n * This function is used to sort element's JSON config properties, so that\r\n * some properties that absolutely need to be processed last, can be put at\r\n * the end.\r\n *\r\n * @ignore Exclude from docs\r\n * @param a Element 1\r\n * @param b Element 2\r\n * @return Sorting number\r\n */\r\n Sprite.prototype.configOrder = function (a, b) {\r\n if (a == b) {\r\n return 0;\r\n }\r\n // Must come last\r\n else if (a == \"tooltipColorSource\") {\r\n return 1;\r\n }\r\n else if (b == \"tooltipColorSource\") {\r\n return -1;\r\n }\r\n else {\r\n return _super.prototype.configOrder.call(this, a, b);\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"isHidden\", {\r\n /**\r\n * If `sprite.hide()` is called, we set isHidden to true when sprite is hidden.\r\n * This was added becaus hidden state might have visibility set to true and so\r\n * there would not be possible to find out if a sprite is technically hidden or not.\r\n */\r\n get: function () {\r\n if (this._isHidden) {\r\n return this._isHidden;\r\n }\r\n else if (this._parent) {\r\n return this._parent.isHidden;\r\n }\r\n return false;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"showOnInit\", {\r\n /**\r\n * @return Show on init?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"showOnInit\");\r\n },\r\n /**\r\n * If this is set to `true`, Sprite, when inited will be instantly hidden\r\n * (\"hidden\" state applied) and then shown (\"default\" state applied).\r\n *\r\n * If your \"default\" state's `transitionDuration > 0` this will result in\r\n * initial animation from \"hidden\" state to \"default\" state.\r\n *\r\n * If you need a Sprite which has `showOnInit = true` not to be shown\r\n * initially, set `sprite.hidden = true`. Setting `sprite.visible = false`\r\n * will not prevent the animation and the sprite will be shown.\r\n *\r\n * @param value show on init?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n this.setShowOnInit(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n Sprite.prototype.setShowOnInit = function (value) {\r\n if (this.setPropertyValue(\"showOnInit\", value)) {\r\n if (!this.isTemplate) {\r\n if (value && !this.inited && !this.hidden) {\r\n this._showOnInitDisposer = new MultiDisposer([\r\n registry.events.once(\"enterframe\", this.hideInitially, this),\r\n this.events.once(\"beforevalidated\", this.hideInitially, this, false),\r\n this.events.on(\"inited\", this.appear, this, false)\r\n ]);\r\n this._disposers.push(this._showOnInitDisposer);\r\n }\r\n else {\r\n if (this._showOnInitDisposer) {\r\n this._showOnInitDisposer.dispose();\r\n }\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Sprite.prototype.hideInitially = function () {\r\n if (!this.isDisposed()) {\r\n this.appeared = false;\r\n //if (!this.hidden && !this._isHidden) { // not good for series, as on enterframe it doesn't have data items yet.\r\n if (!this.inited) {\r\n this.hide(0);\r\n }\r\n }\r\n };\r\n /**\r\n * Hides the chart instantly and then shows it. If defaultState.transitionDuration > 0, this will result an animation in which properties of hidden state will animate to properties of visible state.\r\n */\r\n Sprite.prototype.appear = function () {\r\n var _this = this;\r\n this.appeared = false;\r\n if (!this.hidden && !this.isHidden) {\r\n this.hide(0);\r\n }\r\n if (!this.hidden) {\r\n var animation = this.show();\r\n if (animation && !animation.isFinished()) {\r\n this.addDisposer(animation.events.on(\"animationended\", function () {\r\n _this.appeared = true;\r\n _this.dispatch(\"appeared\");\r\n }));\r\n }\r\n else {\r\n this.appeared = true;\r\n this.dispatch(\"appeared\");\r\n }\r\n }\r\n else {\r\n this.appeared = true;\r\n this.dispatch(\"appeared\");\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"hidden\", {\r\n /**\r\n * @return Is initially hidden?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"hidden\");\r\n },\r\n /**\r\n * If a sprite has `showOnInit = true`, it will animate from \"hidden\" to\r\n * \"default\" state when initialized. To prevent this but keep\r\n * `showOnInit = true`, you can set `sprite.hidden = true`.\r\n *\r\n * @param value initially hidden?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n this.setPropertyValue(\"hidden\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"bbox\", {\r\n /**\r\n * Returns bounding box (square) for this element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n get: function () {\r\n if (this.definedBBox) {\r\n return this.definedBBox;\r\n }\r\n return this._bbox;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"plugins\", {\r\n /**\r\n * A list of plugins (objects that implement [[IPlugin]] interface) attached\r\n * to this object.\r\n *\r\n * @since 4.2.2\r\n * @return List of plugins\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._plugins) {\r\n this._plugins = new List();\r\n this._disposers.push(this._plugins.events.on(\"inserted\", function (ev) {\r\n ev.newValue.target = _this;\r\n ev.newValue.init();\r\n }));\r\n this._disposers.push(new ListDisposer(this._plugins));\r\n }\r\n return this._plugins;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Called during the System.update method\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype._systemUpdate = function (skippedSprites) {\r\n this.validate();\r\n };\r\n /**\r\n * Called during the System.update method\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype._systemCheckIfValidate = function () {\r\n return true;\r\n };\r\n /**\r\n * Called during the System.validatePositions method\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype._systemValidatePositions = function () {\r\n this.validatePosition();\r\n };\r\n /**\r\n * Called during the System.validateLayouts method\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype._systemValidateLayouts = function () {\r\n };\r\n return Sprite;\r\n}(BaseObjectEvents));\r\nexport { Sprite };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Sprite\"] = Sprite;\r\n//# sourceMappingURL=Sprite.js.map","/**\r\n * Functionality for drawing rectangles.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../Sprite\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $math from \"../utils/Math\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Used to draw a rectangle.\r\n *\r\n * @see {@link IRectangleEvents} for a list of available events\r\n * @see {@link IRectangleAdapters} for a list of available Adapters\r\n */\r\nvar Rectangle = /** @class */ (function (_super) {\r\n __extends(Rectangle, _super);\r\n /**\r\n * Constructor\r\n * * Creates a `<rect>` element\r\n * * Creates default state\r\n */\r\n function Rectangle() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Rectangle\";\r\n _this.element = _this.paper.add(\"rect\");\r\n //this.pixelPerfect = false;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Rectangle.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n var precision = this._positionPrecision;\r\n if (this.pixelPerfect) {\r\n precision = 0;\r\n }\r\n var w = $math.round(this.innerWidth, precision);\r\n var h = $math.round(this.innerHeight, precision);\r\n this.element.attr({\r\n \"width\": w,\r\n \"height\": h\r\n });\r\n };\r\n /**\r\n * Measures the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Rectangle.prototype.measureElement = function () {\r\n };\r\n Object.defineProperty(Rectangle.prototype, \"bbox\", {\r\n /**\r\n * Returns bounding box (square) for this element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n get: function () {\r\n if (this.definedBBox) {\r\n return this.definedBBox;\r\n }\r\n if (this.isMeasured) {\r\n return {\r\n x: 0,\r\n y: 0,\r\n width: this.innerWidth,\r\n height: this.innerHeight\r\n };\r\n }\r\n else {\r\n return { x: 0, y: 0, width: 0, height: 0 };\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Rectangle;\r\n}(Sprite));\r\nexport { Rectangle };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Rectangle\"] = Rectangle;\r\n//# sourceMappingURL=Rectangle.js.map","/**\r\n * Container module\r\n * @todo Needs description\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"./Sprite\";\r\nimport { SpriteState } from \"./SpriteState\";\r\nimport { List } from \"./utils/List\";\r\nimport { MultiDisposer } from \"./utils/Disposer\";\r\nimport { Dictionary, DictionaryDisposer } from \"./utils/Dictionary\";\r\nimport { getInteraction } from \"./interaction/Interaction\";\r\nimport { Rectangle } from \"./elements/Rectangle\";\r\nimport { Percent } from \"./utils/Percent\";\r\nimport { registry } from \"./Registry\";\r\nimport { InterfaceColorSet } from \"../core/utils/InterfaceColorSet\";\r\nimport * as $iter from \"./utils/Iterator\";\r\nimport * as $array from \"./utils/Array\";\r\nimport * as $math from \"./utils/Math\";\r\nimport * as $type from \"./utils/Type\";\r\nimport * as $dom from \"./utils/DOM\";\r\nimport { system } from \"./System\";\r\nimport { options } from \"./Options\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Container can contain multiple sprites and arrange them in various layouts.\r\n *\r\n * @see {@link IContainerEvents} for a list of available events\r\n * @see {@link IContainerAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar Container = /** @class */ (function (_super) {\r\n __extends(Container, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Container() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * Container children. (sorted by layout)\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._childrenByLayout = [];\r\n /**\r\n * Container's disposers for its child elements.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._childrenDisposers = new Dictionary();\r\n /**\r\n * Indicates if this container contains any focused elements, including\r\n * itself.\r\n */\r\n _this.hasFocused = false;\r\n /**\r\n * An array of references to elements the state should be set, when it is set\r\n * on this element.\r\n */\r\n _this.setStateOnSprites = [];\r\n /*\r\n * @ignore\r\n */\r\n _this.layoutInvalid = false;\r\n _this._absoluteWidth = 0;\r\n _this._absoluteHeight = 0;\r\n /**\r\n * An array of child Sprites that should be ready before this object can\r\n * fire a \"ready\" event.\r\n */\r\n _this._shouldBeReady = [];\r\n /**\r\n * Enables touch tap protection.\r\n */\r\n _this._tapToActivate = false;\r\n /**\r\n * If `tapToActivate` is used, this setting will determine how long the chart\r\n * will stay in \"active\" mode.\r\n *\r\n * @default 3000\r\n * @since 4.4.0\r\n */\r\n _this.tapTimeout = 3000;\r\n _this.className = \"Container\";\r\n _this._element = _this.paper.addGroup(\"g\");\r\n _this.group.add(_this.element);\r\n _this.setPropertyValue(\"pixelPerfect\", false);\r\n _this.setPropertyValue(\"layout\", \"absolute\");\r\n _this.setPropertyValue(\"fixedWidthGrid\", false);\r\n _this.setPropertyValue(\"verticalCenter\", \"none\");\r\n _this.setPropertyValue(\"horizontalCenter\", \"none\");\r\n _this._positionPrecision = 4;\r\n _this._disposers.push(new DictionaryDisposer(_this._childrenDisposers));\r\n _this.children.events.on(\"inserted\", _this.handleChildAdded, _this);\r\n _this.children.events.on(\"removed\", _this.handleChildRemoved, _this);\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Handles adding of a new child into `children`. Adding new children might\r\n * affect the whole layout so it needs to be revalidated.\r\n *\r\n * @ignore Exclude from docs\r\n * @param event Event object\r\n * @todo Throw an exception on adding a disposed object. Of course it's better NOT TO add disposed objects, so that what we should focus on.\r\n */\r\n Container.prototype.handleChildAdded = function (event) {\r\n this.processChild(event.newValue);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Container.prototype.processChild = function (child) {\r\n // try solves the problem when somedy adds child directly to children\r\n try {\r\n this._childrenDisposers.insertKey(child.uid, new MultiDisposer([\r\n // it's not enough to listen to POSITION_CHANGED only, as some extra redrawals will happen.\r\n child.events.on(\"transformed\", this.handleChildTransform, this),\r\n child.events.on(\"zIndexChanged\", this.sortAndAdd, this)\r\n ]));\r\n }\r\n catch (err) {\r\n // void\r\n }\r\n if (this.element) {\r\n var group = this.element;\r\n group.add(child.group);\r\n }\r\n child.parent = this;\r\n child.paper = this.paper;\r\n this.dispatchImmediately(\"childadded\", { type: \"childadded\", newValue: child });\r\n this.invalidate();\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Container.prototype.sortAndAdd = function () {\r\n this.sortChildren();\r\n this.addChildren();\r\n };\r\n /**\r\n * Handles child removal. Changing size of the child may change the\r\n * whole layout of the Container, hence layout needs to be invalidated.\r\n *\r\n * @ignore Exclude from docs\r\n * @param event Event object\r\n */\r\n Container.prototype.handleChildRemoved = function (event) {\r\n var child = event.oldValue;\r\n // TODO figure out why the key sometimes doesn't exist\r\n this._childrenDisposers.removeKey(child.uid);\r\n if (this.element) {\r\n var group = this.element;\r\n group.removeElement(child.group);\r\n }\r\n if (child.isMeasured) {\r\n this.invalidateLayout();\r\n }\r\n this.dispatchImmediately(\"childremoved\", { type: \"childremoved\", oldValue: child });\r\n };\r\n /**\r\n * Handles child transformation. Changing size of the child may change the\r\n * whole layout of the Container, hence layout needs to be invalidated.\r\n *\r\n * @ignore Exclude from docs\r\n * @param event Event object\r\n */\r\n Container.prototype.handleChildTransform = function (event) {\r\n var child = event.target;\r\n if (child.isMeasured) { // && this.layout != \"none\" && this.layout != \"absolute\") {\r\n this.invalidateLayout();\r\n }\r\n };\r\n /**\r\n * Invalidates Container's layout, causing it to be re-evaluated again.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Container.prototype.invalidateLayout = function () {\r\n if (this.layoutInvalid || this.disabled || this.isTemplate || this.layout == \"none\" || this.__disabled) {\r\n return;\r\n }\r\n this.layoutInvalid = true;\r\n registry.addToInvalidLayouts(this);\r\n system.requestFrame();\r\n };\r\n /**\r\n * Invalidates element.\r\n *\r\n * Object will be redrawn during the next update cycle.\r\n *\r\n * Please note that in most cases elements will auto-invalidate when needed. If\r\n * everything works, DO NOT use this method. Use it only if some changes do\r\n * not take otherwise.\r\n */\r\n Container.prototype.invalidate = function () {\r\n _super.prototype.invalidate.call(this);\r\n this.invalidateLayout();\r\n };\r\n /**\r\n * Invalidates the whole element, including layout AND all its child\r\n * elements.\r\n *\r\n * As this will essentially force all elements to redraw, use only if\r\n * absolutely necessary.\r\n */\r\n Container.prototype.deepInvalidate = function () {\r\n _super.prototype.invalidate.call(this);\r\n //this.sortChildren();\r\n $array.each(this._childrenByLayout, function (child) {\r\n if (child instanceof Container) {\r\n child.deepInvalidate();\r\n }\r\n else {\r\n child.invalidate();\r\n }\r\n });\r\n this.invalidateLayout();\r\n };\r\n Object.defineProperty(Container.prototype, \"children\", {\r\n /**\r\n * Returns a list of the child [[Sprite]] elements contained in this\r\n * Container.\r\n *\r\n * @return List of child elements (Sprites)\r\n */\r\n get: function () {\r\n // @todo Review if we can add all children to disposers\r\n if (!this._children) {\r\n this._children = new List();\r\n //this._disposers.push(new ListDisposer(this._children));\r\n }\r\n return this._children;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Container.prototype, \"minWidth\", {\r\n /**\r\n * @return Width (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"minWidth\");\r\n },\r\n /**\r\n * Minimum width (px) for the Container. A container will not\r\n * auto-shrink beyond this value, even if child elements are smaller.\r\n *\r\n * @param value Width (px)\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"minWidth\", value)) {\r\n this.invalidateLayout();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Container.prototype, \"minHeight\", {\r\n /**\r\n * @return Height (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"minHeight\");\r\n },\r\n /**\r\n * Minimum height (px) for the Container. A container will not\r\n * auto-shrink beyond this value, even if child elements are smaller.\r\n *\r\n * @param value Height (px)\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"minHeight\", value)) {\r\n this.invalidateLayout();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Overrides the original `removeElement` so that Container's actual element\r\n * is not removed. We do not need to remove element of a Container.\r\n *\r\n * We do this because remove element each time will fail the `getBBox`.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Container.prototype.removeElement = function () {\r\n };\r\n /**\r\n * Sorts Container's children: the ones with variable width and height are\r\n * put at the end of the list (depending on layout type), so that fixed-width\r\n * ones can be drawn first.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Container.prototype.sortChildren = function () {\r\n var _this = this;\r\n this._childrenByLayout = [];\r\n if (this.layout == \"none\" || this.layout == \"absolute\" || !this.layout) {\r\n //$iter.each(this.children.iterator(), (child) => {\r\n //\tthis._childrenByLayout.push(child);\r\n //});\r\n this._childrenByLayout = this.children.values;\r\n }\r\n else {\r\n // Assemble fixed-size and relative lists\r\n var fixed_1 = [];\r\n var relative_1 = [];\r\n $iter.each(this.children.iterator(), function (child) {\r\n if (_this.layout == \"horizontal\" || _this.layout == \"grid\") {\r\n if (!$type.isNumber(child.percentWidth)) {\r\n fixed_1.push(child);\r\n }\r\n else {\r\n relative_1.push(child);\r\n }\r\n }\r\n else if (_this.layout == \"vertical\") {\r\n if (!$type.isNumber(child.percentHeight)) {\r\n fixed_1.push(child);\r\n }\r\n else {\r\n relative_1.push(child);\r\n }\r\n }\r\n else {\r\n fixed_1.push(child);\r\n }\r\n });\r\n // Concat everything into list\r\n this._childrenByLayout = fixed_1.concat(relative_1);\r\n }\r\n this.calculateRelativeSize();\r\n };\r\n /**\r\n * Calculates relative sizes for all Container's children.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Make it protected?\r\n */\r\n Container.prototype.calculateRelativeSize = function () {\r\n var _this = this;\r\n var totalRelativeWidth = 0;\r\n var totalRelativeHeight = 0;\r\n $array.each(this._childrenByLayout, function (child) {\r\n // if child is not measured, we do not care about it at all.\r\n if (child.isMeasured) {\r\n if ($type.isNumber(child.percentWidth)) {\r\n totalRelativeWidth += child.percentWidth;\r\n }\r\n if ($type.isNumber(child.percentHeight)) {\r\n totalRelativeHeight += child.percentHeight;\r\n }\r\n }\r\n });\r\n $array.each(this._childrenByLayout, function (child) {\r\n if (child.isMeasured) {\r\n if (_this.layout == \"horizontal\") {\r\n if ($type.isNumber(child.percentWidth)) {\r\n child.relativeWidth = child.percentWidth / totalRelativeWidth;\r\n }\r\n if ($type.isNumber(child.percentHeight)) {\r\n child.relativeHeight = child.percentHeight / 100;\r\n }\r\n }\r\n if (_this.layout == \"vertical\") {\r\n if ($type.isNumber(child.percentHeight)) {\r\n child.relativeHeight = child.percentHeight / totalRelativeHeight;\r\n }\r\n if ($type.isNumber(child.percentWidth)) {\r\n child.relativeWidth = child.percentWidth / 100;\r\n }\r\n }\r\n if (_this.layout == \"grid\") {\r\n if ($type.isNumber(child.percentHeight)) {\r\n child.relativeHeight = child.percentHeight / 100;\r\n }\r\n if ($type.isNumber(child.percentWidth)) {\r\n child.relativeWidth = child.percentWidth / 100;\r\n }\r\n }\r\n }\r\n if (_this.layout == \"absolute\" || !child.isMeasured) {\r\n if ($type.isNumber(child.percentWidth)) {\r\n child.relativeWidth = child.percentWidth / 100;\r\n }\r\n if ($type.isNumber(child.percentHeight)) {\r\n child.relativeHeight = child.percentHeight / 100;\r\n }\r\n }\r\n });\r\n };\r\n /**\r\n * Adds all children to Container's SVG element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Container.prototype.addChildren = function () {\r\n /*\r\n Need this check because a child might be assigned to parent even before element is created, for example a theme\r\n access scrollbar.thumb\r\n */\r\n if (this.element) {\r\n var zindexed = $array.copy(this.children.values); // not children by layout!\r\n var sortArray = zindexed.map(function (data, idx) {\r\n return { idx: idx, data: data };\r\n });\r\n sortArray.sort(function (a, b) {\r\n var ai = (a.data.zIndex || 0);\r\n var bi = (b.data.zIndex || 0);\r\n if (ai < bi) {\r\n return -1;\r\n }\r\n if (ai > bi) {\r\n return 1;\r\n }\r\n return a.idx - b.idx;\r\n });\r\n zindexed = sortArray.map(function (val) {\r\n return val.data;\r\n });\r\n var group_1 = this.element;\r\n // check, maybe the order is good already\r\n var isCorrect = true;\r\n if (group_1.node && group_1.node.childNodes) {\r\n for (var i = 0, len = group_1.node.childNodes.length; i < len; i++) {\r\n if (group_1.node.childNodes[i] != zindexed[i].group.node) {\r\n isCorrect = false;\r\n break;\r\n }\r\n }\r\n }\r\n if (!isCorrect) {\r\n $array.each(zindexed, function (child) {\r\n if (child.group) {\r\n group_1.add(child.group);\r\n }\r\n });\r\n if (this._background) {\r\n this.group.addToBack(this._background.group);\r\n }\r\n this.invalidateLayout();\r\n }\r\n }\r\n };\r\n /**\r\n * Creates a new element of specific type and assigns as a child to the\r\n * Container.\r\n *\r\n * @param Class type for the new element\r\n * @return New element\r\n */\r\n Container.prototype.createChild = function (classType) {\r\n var sprite = new classType();\r\n sprite.parent = this;\r\n return sprite;\r\n };\r\n /**\r\n * Removes all Container's children without actually destroying them.\r\n *\r\n * To destroy children use `disposeChildren()` instead.\r\n */\r\n Container.prototype.removeChildren = function () {\r\n // remove all children\r\n // TODO use iteration instead\r\n while (this.children.length > 0) {\r\n var child = this.children.getIndex(0);\r\n child.parent = undefined;\r\n this.children.removeValue(child);\r\n }\r\n };\r\n /**\r\n * Removes and destroys all Container's children.\r\n *\r\n * To remove children from Container without destroying them, use\r\n * `removeChildren()`.\r\n */\r\n Container.prototype.disposeChildren = function () {\r\n // TODO use iteration instead\r\n while (this.children.length > 0) {\r\n var child = this.children.getIndex(0);\r\n child.dispose();\r\n this.children.removeValue(child);\r\n }\r\n };\r\n Object.defineProperty(Container.prototype, \"background\", {\r\n /**\r\n * @return Background element\r\n */\r\n get: function () {\r\n if (!this._background) {\r\n this._background = this.createBackground();\r\n this.processBackground();\r\n }\r\n return this._background;\r\n },\r\n /**\r\n * An element to use as container background.\r\n *\r\n * @param background Background element\r\n */\r\n set: function (background) {\r\n if (this._background && this.background != background) {\r\n this.removeDispose(this._background);\r\n }\r\n if (background) {\r\n this._background = background;\r\n this._disposers.push(background);\r\n this.processBackground();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Handles the situation where parent element is resized.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Container.prototype.handleGlobalScale = function () {\r\n _super.prototype.handleGlobalScale.call(this);\r\n this.children.each(function (child) {\r\n child.handleGlobalScale();\r\n });\r\n };\r\n /**\r\n * Creates and returns a [[Rectangle]] to use as a background for Container.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Background Rectangle element\r\n */\r\n Container.prototype.createBackground = function () {\r\n return new Rectangle();\r\n };\r\n /**\r\n * Decorates background element with required properties.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Container.prototype.processBackground = function () {\r\n var background = this._background;\r\n if (background) {\r\n background.isMeasured = false;\r\n this._background.fill = new InterfaceColorSet().getFor(\"background\");\r\n background.parent = this;\r\n background.isMeasured = false;\r\n this.children.removeValue(background);\r\n this._disposers.push(background);\r\n this.group.addToBack(this._background.group);\r\n }\r\n };\r\n /**\r\n * Measures the size of container and informs its children of how much size\r\n * they can occupy, by setting their relative `maxWidth` and `maxHeight`\r\n * properties.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Container.prototype.validateLayout = function () {\r\n var _this = this;\r\n registry.removeFromInvalidLayouts(this);\r\n this.layoutInvalid = false;\r\n // prevents from drawing if topparent is 0x0\r\n /*\r\n let topParent = this.topParent;\r\n if (topParent) {\r\n if (!topParent.maxWidth || !topParent.maxHeight) {\r\n this._disposers.push(topParent.events.once(\"maxsizechanged\", this.invalidateLayout, this));\r\n }\r\n }*/\r\n this._availableWidth = this.innerWidth;\r\n this._availableHeight = this.innerHeight;\r\n var measuredWidth = 0;\r\n var measuredHeight = 0;\r\n var allValid = true;\r\n if (this.children) {\r\n this.sortChildren();\r\n // we itterate through list of children, sorted by layout priority. sprites which width non-relative width/height will go first, so we will reduce available width before proceeding to sprites with relative width/height\r\n $array.each(this._childrenByLayout, function (child) {\r\n var maxWidth;\r\n var maxHeight;\r\n if ($type.isNumber(child.relativeWidth)) {\r\n maxWidth = $math.round(_this._availableWidth * child.relativeWidth, 2);\r\n if (_this.layout == \"horizontal\") { // || this.layout == \"absolute\") {\r\n maxWidth -= child.pixelMarginRight + child.pixelMarginLeft;\r\n }\r\n }\r\n else {\r\n if (_this.layout == \"horizontal\") {\r\n if (child.invalid) {\r\n child.validate();\r\n }\r\n }\r\n }\r\n if ($type.isNumber(child.relativeHeight)) {\r\n maxHeight = $math.round(_this._availableHeight * child.relativeHeight, 2);\r\n if (_this.layout == \"vertical\") { // || this.layout == \"absolute\") {\r\n maxHeight -= child.pixelMarginTop + child.pixelMarginBottom;\r\n }\r\n }\r\n else {\r\n if (_this.layout == \"vertical\") {\r\n if (child.invalid) {\r\n child.validate();\r\n }\r\n }\r\n }\r\n // if child is valid\r\n if (child.invalid == false) {\r\n if ($type.isNumber(child.relativeWidth)) {\r\n child.maxWidth = maxWidth;\r\n }\r\n if ($type.isNumber(child.relativeHeight)) {\r\n child.maxHeight = maxHeight;\r\n }\r\n if (child.isMeasured) {\r\n // reduce available width if this is horizontal layout\r\n if (_this.layout == \"horizontal\") {\r\n if (!$type.isNumber(child.percentWidth)) {\r\n if (child.measuredWidth > 0) {\r\n _this._availableWidth -= child.measuredWidth + child.pixelMarginLeft + child.pixelMarginRight;\r\n }\r\n }\r\n }\r\n // reduce available height if this is vertical layout\r\n if (_this.layout == \"vertical\") {\r\n if (!$type.isNumber(child.percentHeight)) {\r\n if (child.measuredHeight > 0) {\r\n _this._availableHeight -= child.measuredHeight + child.pixelMarginTop + child.pixelMarginBottom;\r\n }\r\n }\r\n }\r\n var childMeasuredWidth = child.measuredWidth;\r\n var childMeasuredHeight = child.measuredHeight;\r\n if (child.align != \"none\") {\r\n childMeasuredWidth += child.pixelMarginLeft + child.pixelMarginRight;\r\n }\r\n if (child.valign != \"none\") {\r\n childMeasuredHeight += child.pixelMarginTop + child.pixelMarginBottom;\r\n }\r\n measuredWidth = Math.max(measuredWidth, childMeasuredWidth);\r\n measuredHeight = Math.max(measuredHeight, childMeasuredHeight);\r\n }\r\n }\r\n // if child is not valid\r\n else {\r\n // tell child what maximum width/ height it can occupy\r\n if (child.isMeasured) {\r\n if ($type.isNumber(child.relativeWidth)) {\r\n if (child.maxWidth != maxWidth) { // need to check this because of allValid\r\n child.maxWidth = maxWidth;\r\n allValid = false;\r\n }\r\n }\r\n if ($type.isNumber(child.relativeHeight)) {\r\n if (child.maxHeight != maxHeight) { // need to check this because of allValid\r\n child.maxHeight = maxHeight;\r\n allValid = false;\r\n }\r\n }\r\n }\r\n }\r\n });\r\n }\r\n this._absoluteWidth = measuredWidth;\r\n this._absoluteHeight = measuredHeight;\r\n // arrange after measuring, only if all children are valid already\r\n if (allValid) {\r\n this.arrange();\r\n }\r\n };\r\n /**\r\n * Arranges children according to layout specs and available space / child\r\n * sizes.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Container.prototype.arrange = function () {\r\n var _this = this;\r\n var children = this.children;\r\n /*\r\n in this method we not only arrange children but also find out the size of the container\r\n it might seem it would be easier to get container size using sprite's measure method,\r\n however it would return only actual size of the bbox. However as each child meight have\r\n margins set, we need to check each child - we do it here.\r\n\r\n This method doesn't do anything with DOM, so it's not expensive\r\n */\r\n var measuredWidth = 0;\r\n var measuredHeight = 0;\r\n //let innerWidth: number = this.innerWidth; //$math.max(this.innerWidth, this._measuredWidth - paddingLeft - paddingRight);\r\n //let innerHeight: number = this.innerHeight; //$math.max(this.innerHeight, this._measuredHeight - paddingTop - paddingBottom);\r\n // above is wrong, as if a w/h is not specified, it is 0 and alignment doesn't work at all.\r\n var innerWidth = $math.max(this.innerWidth, this._absoluteWidth);\r\n var innerHeight = $math.max(this.innerHeight, this._absoluteHeight);\r\n var left; // = 0;\r\n var right; // = innerWidth;\r\n var top; // = 0;\r\n var bottom; // = innerHeight;\r\n var paddingLeft = this.pixelPaddingLeft;\r\n var paddingRight = this.pixelPaddingRight;\r\n var paddingTop = this.pixelPaddingTop;\r\n var paddingBottom = this.pixelPaddingBottom;\r\n var nextX = 0;\r\n var nextY = 0;\r\n var row = 0;\r\n var column = 0;\r\n var columnWidth = [];\r\n var rowHeight = [];\r\n var maxCellWidth;\r\n var minCellWidth;\r\n var columnCount;\r\n var maxWidth = this.maxWidth;\r\n var maxHeight = this.maxHeight;\r\n var minWidth = this.minWidth;\r\n var minHeight = this.minHeight;\r\n var childrenCopy = $array.copy(children.values);\r\n if (this.reverseOrder) {\r\n childrenCopy.reverse();\r\n }\r\n // GRID PRECALCULATIONS\r\n if (this.layout == \"grid\") {\r\n minCellWidth = maxWidth;\r\n maxCellWidth = 1;\r\n for (var i = 0, len = childrenCopy.length; i < len; i++) {\r\n var child = childrenCopy[i];\r\n if (child.isMeasured && !child.disabled && !child.__disabled) {\r\n var childMeasuredWidth = child.measuredWidth;\r\n if (childMeasuredWidth < minCellWidth) {\r\n minCellWidth = childMeasuredWidth;\r\n }\r\n if (childMeasuredWidth > maxCellWidth) {\r\n maxCellWidth = childMeasuredWidth;\r\n }\r\n }\r\n }\r\n minCellWidth = $math.fitToRange(minCellWidth, 1, maxWidth);\r\n maxCellWidth = $math.fitToRange(maxCellWidth, 1, maxWidth);\r\n if (this.fixedWidthGrid) {\r\n columnCount = maxWidth / maxCellWidth;\r\n }\r\n else {\r\n columnCount = maxWidth / minCellWidth; // predicted number of columns, yes it is usually much more than real number, but we fix that later\r\n }\r\n columnCount = $math.max(1, Math.floor(columnCount));\r\n columnCount = $math.min(this.maxColumns, columnCount);\r\n columnWidth = this.getColumnWidth(childrenCopy, columnCount, maxCellWidth);\r\n }\r\n var contentLeft;\r\n var contentRight;\r\n var contentTop;\r\n var contentBottom;\r\n // we itterate through array of children\r\n // TODO use iterator instead\r\n for (var i = 0, len = childrenCopy.length; i < len; i++) {\r\n var child = childrenCopy[i];\r\n if (child.isMeasured && !child.disabled && !child.__disabled) {\r\n var x = undefined; //child.pixelX; // must reset\r\n var y = undefined; //child.pixelY; // must reset\r\n var childMarginLeft = child.pixelMarginLeft;\r\n var childMarginRight = child.pixelMarginRight;\r\n var childMarginTop = child.pixelMarginTop;\r\n var childMarginBottom = child.pixelMarginBottom;\r\n var childWidth = child.measuredWidth;\r\n var childHeight = child.measuredHeight;\r\n var childLeft = void 0;\r\n var childRight = void 0;\r\n var childTop = void 0;\r\n var childBottom = void 0;\r\n switch (this.layout) {\r\n case \"none\":\r\n break;\r\n // absolute layout\r\n case \"absolute\":\r\n // horizontal alignment\r\n switch (child.align) {\r\n case \"left\":\r\n x = childMarginLeft - child.maxLeft;\r\n break;\r\n case \"center\":\r\n x = (innerWidth - childWidth) / 2 - child.maxLeft;\r\n break;\r\n case \"right\":\r\n x = innerWidth - childMarginRight - child.maxRight;\r\n break;\r\n default:\r\n if (!(child.x instanceof Percent)) {\r\n x = child.pixelX;\r\n }\r\n break;\r\n }\r\n // vertical alignment\r\n switch (child.valign) {\r\n case \"top\":\r\n y = childMarginTop - child.maxTop;\r\n break;\r\n case \"middle\":\r\n y = (innerHeight - childHeight) / 2 - child.maxTop;\r\n break;\r\n case \"bottom\":\r\n y = innerHeight - childMarginBottom - child.maxBottom;\r\n break;\r\n default:\r\n if (!(child.y instanceof Percent)) {\r\n y = child.pixelY;\r\n }\r\n break;\r\n }\r\n break;\r\n // vertical layout\r\n case \"vertical\":\r\n //if ($type.isNumber(child.relativeHeight)) {\r\n //\tchildHeight = child.maxHeight;\r\n //}\r\n switch (child.align) {\r\n case \"left\":\r\n x = childMarginLeft - child.maxLeft;\r\n break;\r\n case \"center\":\r\n x = (innerWidth - childWidth) / 2 - child.maxLeft;\r\n break;\r\n case \"right\":\r\n x = innerWidth - childMarginRight - child.maxRight;\r\n break;\r\n default:\r\n x = child.pixelX;\r\n break;\r\n }\r\n y = nextY + childMarginTop - child.maxTop;\r\n nextY = y + child.maxBottom + childMarginBottom;\r\n break;\r\n // horizontal layout\r\n case \"horizontal\":\r\n //if ($type.isNumber(child.relativeHeight)) {\r\n //\tchildHeight = child.maxHeight;\r\n //}\r\n switch (child.valign) {\r\n case \"top\":\r\n y = childMarginTop - child.maxTop;\r\n break;\r\n case \"middle\":\r\n y = (innerHeight - childHeight) / 2 - child.maxTop;\r\n break;\r\n case \"bottom\":\r\n y = innerHeight - childMarginBottom - child.maxBottom;\r\n break;\r\n default:\r\n y = child.pixelY;\r\n break;\r\n }\r\n x = nextX + childMarginLeft - child.maxLeft;\r\n nextX = x + child.maxRight + childMarginRight;\r\n break;\r\n case \"grid\":\r\n x = nextX + childMarginLeft - child.maxLeft;\r\n switch (child.valign) {\r\n case \"top\":\r\n y = nextY + childMarginTop - child.maxTop;\r\n break;\r\n case \"middle\":\r\n y = nextY + (innerHeight - childHeight) / 2 - child.maxTop;\r\n break;\r\n case \"bottom\":\r\n y = nextY + innerHeight - childMarginBottom - child.maxBottom;\r\n break;\r\n default:\r\n y = nextY - child.maxTop;\r\n break;\r\n }\r\n nextX += columnWidth[column];\r\n rowHeight[row] = $math.max(rowHeight[row], childHeight);\r\n column++;\r\n var nextColumnWidth = columnWidth[column];\r\n if (!$type.isNumber(nextColumnWidth)) {\r\n nextColumnWidth = maxCellWidth;\r\n }\r\n if (nextX > $math.min(this.innerWidth, maxWidth) - nextColumnWidth + 1 && column < columnCount) {\r\n columnCount = column;\r\n nextX = 0;\r\n nextY = 0;\r\n row = 0;\r\n column = 0;\r\n columnWidth = this.getColumnWidth(childrenCopy, columnCount, maxCellWidth);\r\n rowHeight = [];\r\n i = -1;\r\n continue;\r\n }\r\n if (column >= columnCount) {\r\n column = 0;\r\n nextY += rowHeight[row];\r\n row++;\r\n nextX = 0;\r\n }\r\n break;\r\n }\r\n if (this.layout !== \"none\") {\r\n child.moveTo({ x: x, y: y }); // must use moveTo, otherwise x/y set in percent won't work\r\n childLeft = x + child.maxLeft - childMarginLeft;\r\n childRight = x + child.maxRight + childMarginRight;\r\n childTop = y + child.maxTop - childMarginTop;\r\n childBottom = y + child.maxBottom + childMarginBottom;\r\n if (childRight > right || !$type.isNumber(right)) {\r\n right = childRight;\r\n }\r\n if (childLeft < left || !$type.isNumber(left)) {\r\n left = childLeft;\r\n }\r\n if (childTop < top || !$type.isNumber(top)) {\r\n top = childTop;\r\n }\r\n if (childBottom > bottom || !$type.isNumber(bottom)) {\r\n bottom = childBottom;\r\n }\r\n if (childRight > contentRight || !$type.isNumber(contentRight)) {\r\n contentRight = childRight;\r\n }\r\n if (childLeft < contentLeft || !$type.isNumber(contentLeft)) {\r\n contentLeft = childLeft;\r\n }\r\n if (childTop < contentTop || !$type.isNumber(contentTop)) {\r\n contentTop = childTop;\r\n }\r\n if (childBottom > contentBottom || !$type.isNumber(contentBottom)) {\r\n contentBottom = contentBottom;\r\n }\r\n }\r\n }\r\n else {\r\n child.validatePosition();\r\n }\r\n }\r\n if (this.layout == \"none\") {\r\n var noneBBox = this.bbox;\r\n left = noneBBox.x;\r\n right = noneBBox.x + noneBBox.width;\r\n top = noneBBox.y;\r\n bottom = noneBBox.y + noneBBox.height;\r\n }\r\n if (!$type.isNumber(left)) {\r\n left = 0;\r\n contentLeft = 0;\r\n }\r\n if (!$type.isNumber(right)) {\r\n right = this._availableWidth;\r\n contentRight = right;\r\n }\r\n if (!$type.isNumber(top)) {\r\n top = 0;\r\n contentTop = 0;\r\n }\r\n if (!$type.isNumber(bottom)) {\r\n bottom = this._availableHeight;\r\n contentBottom = bottom;\r\n }\r\n if (!$type.isNumber(contentTop)) {\r\n contentTop = 0;\r\n }\r\n if (!$type.isNumber(contentBottom)) {\r\n contentBottom = contentTop;\r\n }\r\n if (!$type.isNumber(contentLeft)) {\r\n contentLeft = 0;\r\n }\r\n if (!$type.isNumber(contentRight)) {\r\n contentRight = contentLeft;\r\n }\r\n measuredWidth = right - left;\r\n measuredHeight = bottom - top;\r\n if ($type.isNumber(this.relativeWidth)) {\r\n measuredWidth = maxWidth - paddingLeft - paddingRight;\r\n left = 0;\r\n right = measuredWidth;\r\n }\r\n if ($type.isNumber(this.relativeHeight)) {\r\n measuredHeight = maxHeight - paddingTop - paddingBottom;\r\n top = 0;\r\n bottom = measuredHeight;\r\n }\r\n if ($type.isNumber(this._pixelWidth)) {\r\n left = 0;\r\n measuredWidth = this._pixelWidth - paddingLeft - paddingRight;\r\n }\r\n if ($type.isNumber(minWidth) && measuredWidth < minWidth) {\r\n left = 0;\r\n measuredWidth = this.minWidth - paddingLeft - paddingRight;\r\n }\r\n if ($type.isNumber(this._pixelHeight)) {\r\n top = 0;\r\n measuredHeight = this._pixelHeight - paddingTop - paddingBottom;\r\n }\r\n if ($type.isNumber(minHeight) && measuredHeight < minHeight) {\r\n top = 0;\r\n measuredHeight = minHeight - paddingTop - paddingBottom;\r\n }\r\n var measuredContentWidth = contentRight - contentLeft;\r\n var measuredContentHeight = contentBottom - contentTop;\r\n /// handle content alignment\r\n if (this.layout != \"none\" && (this.contentAlign || this.contentValign) && children.length > 0) {\r\n var dx_1;\r\n var dy_1;\r\n var mwa = measuredWidth;\r\n var mha = measuredHeight;\r\n if (mwa < measuredContentWidth) {\r\n mwa = measuredContentWidth;\r\n }\r\n if (mha < measuredContentHeight) {\r\n mha = measuredContentHeight;\r\n }\r\n if (this.contentAlign == \"center\") {\r\n dx_1 = (mwa - measuredContentWidth) / 2;\r\n }\r\n if (this.contentAlign == \"right\") {\r\n dx_1 = mwa - measuredContentWidth;\r\n }\r\n if (this.contentValign == \"middle\") {\r\n dy_1 = (mha - measuredContentHeight) / 2;\r\n }\r\n if (this.contentValign == \"bottom\") {\r\n dy_1 = mha - measuredContentHeight;\r\n }\r\n if ($type.isNumber(dx_1)) {\r\n $iter.each(children.iterator(), function (child) {\r\n var childLeft = child.maxLeft;\r\n var ddx = dx_1;\r\n if (_this.layout == \"horizontal\") {\r\n child.x = child.pixelX + ddx;\r\n }\r\n // individual grid elements can not be aligned vertically, that's why it's different from horizontal\r\n if (_this.layout == \"grid\") {\r\n child.x = child.pixelX + ddx;\r\n }\r\n if (_this.layout == \"vertical\") {\r\n ddx += child.pixelMarginLeft;\r\n if (child.align == \"none\") {\r\n child.x = ddx - childLeft;\r\n }\r\n }\r\n if (_this.layout == \"absolute\") {\r\n ddx += child.pixelMarginLeft;\r\n if (child.align == \"none\") {\r\n child.x = ddx - childLeft;\r\n }\r\n }\r\n });\r\n }\r\n if ($type.isNumber(dy_1)) {\r\n $iter.each(children.iterator(), function (child) {\r\n var childTop = child.maxTop;\r\n var ddy = dy_1;\r\n if (_this.layout == \"horizontal\") {\r\n ddy += child.pixelMarginTop;\r\n if (child.valign == \"none\") {\r\n child.y = ddy - childTop;\r\n }\r\n }\r\n // individual grid elements can not be aligned vertically, that's why it's different from horizontal\r\n if (_this.layout == \"grid\") {\r\n ddy += child.pixelMarginTop;\r\n child.y = ddy - childTop;\r\n }\r\n if (_this.layout == \"vertical\") {\r\n child.y = child.pixelY + ddy;\r\n }\r\n if (_this.layout == \"absolute\") {\r\n ddy += child.pixelMarginTop;\r\n if (child.valign == \"none\") {\r\n child.y = ddy - childTop;\r\n }\r\n }\r\n });\r\n }\r\n }\r\n var oldBBox = this.bbox;\r\n // this will mess up maxw/maxh set by container layout, we need a separate min/maxwidth for users\r\n // this prevents invalidating layout in such cases as scrolling category axis, when labels go outside bounds and results transformed event\r\n // todo: need to check if this doesn't cause other problems.\r\n //if (this.maxWidth > 0) {\r\n //measuredWidth = $math.min(measuredWidth, this.maxWidth);\r\n //measuredWidth = $math.max(measuredWidth, this.minWidth);\r\n //}\r\n //if (this.maxHeight > 0) {\r\n //measuredHeight = $math.min(measuredHeight, this.maxHeight);\r\n //measuredHeight = $math.max(measuredHeight, this.minHeight);\r\n //}\r\n measuredWidth = $math.max(measuredWidth, minWidth);\r\n measuredHeight = $math.max(measuredHeight, minHeight);\r\n this.contentWidth = measuredWidth;\r\n this.contentHeight = measuredHeight;\r\n // new\r\n measuredWidth = $math.min(measuredWidth, maxWidth);\r\n measuredHeight = $math.min(measuredHeight, maxHeight);\r\n this._bbox = { x: left, y: top, width: measuredWidth, height: measuredHeight };\r\n var prevLeft = this.maxLeft;\r\n var prevTop = this.maxTop;\r\n var prevBotttom = this.maxBottom;\r\n var prevRight = this.maxRight;\r\n this.measure();\r\n if (prevLeft != this.maxLeft || prevRight != this.maxRight || prevTop != this.maxTop || prevBotttom != this.maxBottom) {\r\n if (this.events.isEnabled(\"transformed\")) {\r\n var event_1 = {\r\n type: \"transformed\",\r\n target: this\r\n };\r\n if (oldBBox) {\r\n event_1.dummyData = oldBBox.width + \" \" + measuredWidth + \" \" + oldBBox.height + \" \" + measuredHeight;\r\n }\r\n this.events.dispatchImmediately(\"transformed\", event_1);\r\n }\r\n }\r\n this.dispatchImmediately(\"layoutvalidated\");\r\n };\r\n /**\r\n * Positions element according its center settings.\r\n *\r\n * @todo Description (review)\r\n * @ignore Exclude from docs\r\n */\r\n Container.prototype.updateCenter = function () {\r\n _super.prototype.updateCenter.call(this);\r\n this.updateBackground();\r\n };\r\n /**\r\n * Update the background to fit into specific dimensions.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Make it protected?\r\n */\r\n Container.prototype.updateBackground = function () {\r\n var background = this._background; // accessing protected, as getter creates instance if it doesn't exist\r\n if (background) {\r\n background.x = this.maxLeft;\r\n background.y = this.maxTop;\r\n background.width = this.maxRight - this.maxLeft;\r\n background.height = this.maxBottom - this.maxTop;\r\n }\r\n };\r\n /**\r\n * Returns widths of all columns in a horizontal Container layout.\r\n *\r\n * @ignore Exclude from docs\r\n * @param columnCount Number of columns\r\n * @param maxCellWidth Maximum width of one grid cell\r\n * @return An array of column widths\r\n */\r\n Container.prototype.getColumnWidth = function (children, columnCount, maxCellWidth) {\r\n var _this = this;\r\n var columnWidth = [];\r\n var column = 0;\r\n $array.each(children, function (child) {\r\n if (child.isMeasured && !child.disabled && !child.__disabled) {\r\n if (_this.fixedWidthGrid) {\r\n columnWidth[column] = maxCellWidth;\r\n }\r\n else {\r\n columnWidth[column] = $math.max(columnWidth[column], child.measuredWidth + child.pixelMarginRight + child.pixelMarginLeft);\r\n }\r\n column++;\r\n if (column == columnCount) {\r\n column = 0;\r\n }\r\n }\r\n });\r\n return columnWidth;\r\n };\r\n Object.defineProperty(Container.prototype, \"layout\", {\r\n /**\r\n * @return Layout\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"layout\");\r\n },\r\n /**\r\n * Container layout.\r\n *\r\n * Options: \"absolute\" (default), \"vertical\", \"horizontal\", \"grid\", \"none\". \"none\" is quite the same as \"absolute\" - the objects will\r\n * be positioned at their x, y coordinates, the difference is that with \"absolute\" you can still use align/valign for children and with \"none\" you can not.\r\n * Use \"none\" as much as you can as it's most cpu-saving layout.\r\n *\r\n * @default \"absolute\"\r\n * @param value Layout\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"layout\", value)) {\r\n this.invalidateLayout();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Container.prototype, \"contentValign\", {\r\n /**\r\n * @return Vertical alignment\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"contentValign\");\r\n },\r\n /**\r\n * Vertical alignment of the elements for the vertical Container.\r\n *\r\n * This is used when Container is larger than the height of all its children.\r\n *\r\n * @param value vertical alignment\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"contentValign\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Container.prototype, \"contentAlign\", {\r\n /**\r\n * @return Horizontal alignment\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"contentAlign\");\r\n },\r\n /**\r\n * Horizontal alignment of the elements for the horizontal Container.\r\n *\r\n * This is used when Container is larger than the height of all its children.\r\n *\r\n * @param value Horizontal alignment\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"contentAlign\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Container.prototype, \"fixedWidthGrid\", {\r\n /**\r\n * @return Should use fixed width grid?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"fixedWidthGrid\");\r\n },\r\n /**\r\n * Controls if the grid of the Container should use fixed width. Fixed width\r\n * grid will divide available space to all its columns/rows equally, without\r\n * adapting to actual child sizes or size requirements.\r\n *\r\n * @default false\r\n * @param value Should use fixed width grid?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"fixedWidthGrid\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Container.prototype, \"maxColumns\", {\r\n /**\r\n * @return Should use fixed width grid?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"maxColumns\");\r\n },\r\n /**\r\n * Maximum number of columns (when using `\"grid\"` layout).\r\n *\r\n * @param value Should use fixed width grid?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"maxColumns\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Container.prototype, \"reverseOrder\", {\r\n /**\r\n * @return Reverse children?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"reverseOrder\");\r\n },\r\n /**\r\n * If set to `true`, the children of the container will be drawn in reverse\r\n * order.\r\n *\r\n * @default false\r\n * @param value Reverse children?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"reverseOrder\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Container.prototype, \"setStateOnChildren\", {\r\n /**\r\n * @return Set state on children\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"setStateOnChildren\");\r\n },\r\n /**\r\n * Specifies if, when state is applied on this container, the same state\r\n * should be applied to container's children as well as `background`.\r\n *\r\n * @default false\r\n * @param value Set state on children\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"setStateOnChildren\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Checks if point is within bounds of a container.\r\n *\r\n * @param point A coordinate to check\r\n * @return `true` if it fits within container\r\n */\r\n Container.prototype.fitsToBounds = function (point) {\r\n var x = point.x;\r\n var y = point.y;\r\n var deviation = 0.5; // sometimes coordinates are rounded to numbers like .999 so we add deviation here\r\n if (x >= -deviation && x <= this.pixelWidth + deviation && y >= -deviation && y <= this.pixelHeight + deviation) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n };\r\n /**\r\n * Copies all properties from different Container, including background\r\n * clone.\r\n *\r\n * @param source Source Container to copy from\r\n */\r\n Container.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n _super.prototype.copyFrom.call(this, source);\r\n this.layout = source.layout;\r\n this.setStateOnChildren = source.setStateOnChildren;\r\n if (source._background) {\r\n this.background = source._background.clone();\r\n this.background.copyFrom(source._background); // won't work without this\r\n }\r\n $iter.each(source.children.iterator(), function (child) {\r\n if (child.shouldClone) {\r\n var clonedChild = child.clone();\r\n clonedChild.parent = _this;\r\n }\r\n });\r\n };\r\n Object.defineProperty(Container.prototype, \"preloader\", {\r\n /**\r\n * @return Preloader instance\r\n */\r\n get: function () {\r\n var preloader = this._preloader;\r\n if (preloader) {\r\n return preloader;\r\n }\r\n else if (this.parent) {\r\n return this.parent.preloader;\r\n }\r\n },\r\n /**\r\n * A [[Preloader]] instance to be used when Container is busy.\r\n *\r\n * @param preloader Preloader instance\r\n */\r\n set: function (preloader) {\r\n if (this._preloader) {\r\n this.removeDispose(this._preloader);\r\n }\r\n this._preloader = preloader;\r\n if (preloader) {\r\n preloader.parent = this.tooltipContainer;\r\n this._disposers.push(preloader);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets [[Paper]] instance to use to draw elements.\r\n * @ignore\r\n * @param paper Paper\r\n * @return true if paper was changed, false, if it's the same\r\n */\r\n Container.prototype.setPaper = function (paper) {\r\n var _this = this;\r\n var changed = _super.prototype.setPaper.call(this, paper);\r\n if (changed) {\r\n if (this._background) {\r\n this._background.paper = paper;\r\n this._background.topParent = this.topParent;\r\n }\r\n this.children.each(function (child) {\r\n child.setPaper(paper);\r\n child.topParent = _this.topParent;\r\n });\r\n }\r\n return changed;\r\n };\r\n /**\r\n * Removes Container from the system-wide list of invalid Containers.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Container.prototype.removeFromInvalids = function () {\r\n _super.prototype.removeFromInvalids.call(this);\r\n registry.removeFromInvalidLayouts(this);\r\n };\r\n /**\r\n * Sets a [[DataItem]] to be used as data for the Container.\r\n *\r\n * @todo Description\r\n * @param dataItem DataItem\r\n */\r\n Container.prototype.setDataItem = function (dataItem) {\r\n // this place is potentially dangerous, as if we set datItem for some dummy container, all children dataItems will be overriden\r\n // the main reason for doing this is that we need a setDataItem code to be called for each sprite, otherwise property fields won't be\r\n // applied. Also, getting dataItem from parent all the time is more expensive than saving value.\r\n if (this._dataItem != dataItem) {\r\n $iter.each(this.children.iterator(), function (child) {\r\n child.dataItem = dataItem;\r\n });\r\n if (this._background) {\r\n this._background.dataItem = dataItem;\r\n }\r\n }\r\n _super.prototype.setDataItem.call(this, dataItem);\r\n };\r\n /**\r\n * Measures the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Container.prototype.measureElement = function () {\r\n if (this.disabled || this.isTemplate || this.layout == \"none\" || this.__disabled) {\r\n // void\r\n }\r\n else {\r\n this.validateLayout();\r\n }\r\n };\r\n Object.defineProperty(Container.prototype, \"fontFamily\", {\r\n /**\r\n * @return Font family\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"fontFamily\");\r\n },\r\n /**\r\n * Font family to be used for the text.\r\n *\r\n * Parts of the text may override this setting using in-line formatting.\r\n *\r\n * @param value Font family value\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"fontFamily\", value, true)) {\r\n this.setSVGAttribute({ \"font-family\": value });\r\n this.invalidateLabels();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Container.prototype, \"fontSize\", {\r\n /**\r\n * @return Font size\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"fontSize\");\r\n },\r\n /**\r\n * Font size to be used for the text. The size can either be numeric, in\r\n * pixels, or other measurements.\r\n *\r\n * Parts of the text may override this setting using in-line formatting.\r\n *\r\n * @param value Font size value\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"fontSize\", value, true)) {\r\n this.setSVGAttribute({ \"font-size\": value });\r\n this.invalidateLabels();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * When fontSize of fontFamily changes we need to hard-invalidate all Labels of this container to position them properly.\r\n */\r\n Container.prototype.invalidateLabels = function () {\r\n this.children.each(function (child) {\r\n // can't import Label because of Circular dependencies\r\n if (child[\"hardInvalidate\"]) {\r\n child[\"hardInvalidate\"]();\r\n // this fixes firefox and viewport issue\r\n child.events.once(\"validated\", child.handleValidate, child, false);\r\n }\r\n else if (child instanceof Container) {\r\n child.invalidateLabels();\r\n }\r\n });\r\n };\r\n Object.defineProperty(Container.prototype, \"fontWeight\", {\r\n /**\r\n * @return Font weight\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"fontWeight\");\r\n },\r\n /**\r\n * Font weight to use for text.\r\n *\r\n * Parts of the text may override this setting using in-line formatting.\r\n *\r\n * @param value Font weight\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"fontWeight\", value);\r\n this.setSVGAttribute({ \"font-weight\": value });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Container.prototype, \"textDecoration\", {\r\n /**\r\n * @return Decoration\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"textDecoration\");\r\n },\r\n /**\r\n * A text decoration to use for text.\r\n *\r\n * Parts of the text may override this setting using in-line formatting.\r\n *\r\n * @param value Decoration\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"textDecoration\", value);\r\n this.setSVGAttribute({ \"text-decoration\": value });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Disposes (destroys) the element and all its children.\r\n */\r\n Container.prototype.dispose = function () {\r\n if (this._background) {\r\n this._background.dispose();\r\n }\r\n this._shouldBeReady = [];\r\n this.disposeChildren();\r\n _super.prototype.dispose.call(this);\r\n };\r\n /**\r\n * Applies a [[SpriteState]] on this element.\r\n *\r\n * The first parameter can either be a name of the state or a [[SpriteState]]\r\n * instance.\r\n *\r\n * When run, this method will apply SVG properties defined in a\r\n * [[SpriteState]], but only those that are relevant to this particular\r\n * element, that is are listed in its respective `properties` array.\r\n *\r\n * @see {@link SpriteState}\r\n * @param value A state - name key or instance\r\n * @param transitionDuration Duration of the transition between current and new state\r\n * @param easing An easing function\r\n */\r\n Container.prototype.setState = function (value, transitionDuration, easing) {\r\n var stateName = value;\r\n if (value instanceof SpriteState) {\r\n stateName = value.name;\r\n }\r\n if (this.setStateOnChildren) {\r\n $iter.each(this.children.iterator(), function (child) {\r\n child.setState(stateName, transitionDuration, easing);\r\n // not good to set it in child setState\r\n if (stateName != \"active\") {\r\n child.isActive = false;\r\n }\r\n });\r\n }\r\n if (this._background) {\r\n this._background.setState(stateName);\r\n }\r\n if (this.setStateOnSprites.length) {\r\n $array.each(this.setStateOnSprites, function (item) {\r\n item.setState(stateName, transitionDuration, easing);\r\n });\r\n }\r\n return _super.prototype.setState.call(this, value, transitionDuration, easing);\r\n };\r\n // otherwise isActive won't work properly with background\r\n Container.prototype.setActive = function (value) {\r\n _super.prototype.setActive.call(this, value);\r\n if (this._background) {\r\n this._background.isActive = value;\r\n }\r\n };\r\n /**\r\n * Dispatches ready event. Dispatches when all children are ready.\r\n */\r\n Container.prototype.dispatchReady = function () {\r\n var _this = this;\r\n if (!this.isReady() && !this.isDisposed()) {\r\n var allReady_1 = true;\r\n $iter.eachContinue(this.children.iterator(), function (sprite) {\r\n if (!sprite.__disabled && !sprite.disabled && !sprite.isReady()) {\r\n allReady_1 = false;\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n });\r\n $array.eachContinue(this._shouldBeReady, function (sprite) {\r\n if (!sprite.__disabled && !sprite.disabled && !sprite.isReady()) {\r\n allReady_1 = false;\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n });\r\n if (allReady_1) {\r\n _super.prototype.dispatchReady.call(this);\r\n }\r\n else {\r\n registry.events.once(\"exitframe\", function () {\r\n _this.dispatchReady();\r\n system.requestFrame();\r\n }, undefined, false);\r\n }\r\n }\r\n };\r\n /**\r\n * Called during the System.update method\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Container.prototype._systemUpdate = function (skippedSprites) {\r\n this.children.each(function (child) {\r\n if (child.invalid) {\r\n if (!child._systemCheckIfValidate()) {\r\n skippedSprites.push(child);\r\n }\r\n else if (child.dataItem && child.dataItem.component && child.dataItem.component.dataInvalid) {\r\n skippedSprites.push(child);\r\n }\r\n else {\r\n child.validate();\r\n }\r\n }\r\n });\r\n _super.prototype._systemUpdate.call(this, skippedSprites);\r\n };\r\n /**\r\n * Called during the System.validatePositions method\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Container.prototype._systemValidatePositions = function () {\r\n this.children.each(function (sprite) {\r\n if (sprite.positionInvalid) {\r\n sprite.validatePosition();\r\n }\r\n });\r\n _super.prototype._systemValidatePositions.call(this);\r\n };\r\n /**\r\n * Called during the System.validateLayouts method\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Container.prototype._systemValidateLayouts = function () {\r\n if (this.layoutInvalid && !this.isDisposed()) {\r\n this.validateLayout();\r\n }\r\n };\r\n Object.defineProperty(Container.prototype, \"tapToActivate\", {\r\n /**\r\n * @return Enable touch protection?\r\n */\r\n get: function () {\r\n return this._tapToActivate;\r\n },\r\n /**\r\n * If set to `true` the chart's regular touch functionality will be suspended\r\n * so that the whole page it is located in remains scrollable, even when\r\n * swiping over the chart's body.\r\n *\r\n * User will need to tap the chart in order to activate its regular touch\r\n * functionality.\r\n *\r\n * The chart will remain \"active\" as long as user keeps interacting with the\r\n * chart. After `tapTimeout` milliseconds the chart will return to its\r\n * \"protected\" mode.\r\n *\r\n * @default false\r\n * @since 4.4.0\r\n * @param value Enable touch protection?\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/touch/} For more information.\r\n */\r\n set: function (value) {\r\n if (this._tapToActivate != value) {\r\n this.setTapToActivate(value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Container.prototype.setTapToActivate = function (value) {\r\n var _this = this;\r\n this._tapToActivate = value;\r\n this.interactions.isTouchProtected = value;\r\n // setEventDisposer will also remove listeners if value == false\r\n if (value) {\r\n this.interactions.setEventDisposer(\"container-tapToActivate\", value, function () { return new MultiDisposer([\r\n _this.events.on(\"hit\", _this.handleTapToActivate, _this, false),\r\n _this.events.on(\"down\", _this.initTapTimeout, _this, false),\r\n _this.events.on(\"track\", _this.initTapTimeout, _this, false),\r\n //this.events.on(\"drag\", this.initTapTimeout, this, false),\r\n getInteraction().body.events.on(\"down\", function (ev) {\r\n if (!getInteraction().isLocalElement(ev.pointer, _this.paper.svg, _this.uid)) {\r\n _this.handleTapToActivateDeactivation();\r\n }\r\n }, _this, false)\r\n ]); });\r\n }\r\n getInteraction();\r\n };\r\n /**\r\n * @todo Ignore on non-touch events\r\n */\r\n Container.prototype.handleTapToActivate = function () {\r\n this.interactions.isTouchProtected = false;\r\n this.initTapTimeout();\r\n };\r\n Container.prototype.handleTapToActivateDeactivation = function () {\r\n this.interactions.isTouchProtected = true;\r\n };\r\n Container.prototype.initTapTimeout = function () {\r\n var _this = this;\r\n if (this._tapToActivateTimeout) {\r\n this._tapToActivateTimeout.dispose();\r\n }\r\n if (this.tapToActivate && !this.interactions.isTouchProtected && this.tapTimeout) {\r\n this._tapToActivateTimeout = this.setTimeout(function () {\r\n _this.handleTapToActivateDeactivation();\r\n }, this.tapTimeout);\r\n }\r\n };\r\n /**\r\n * Moves the whole chart to other HTML container.\r\n *\r\n * `htmlElement` can either be a reference to a DOM element, or an id of\r\n * such element.\r\n *\r\n * @since 4.9.24\r\n * @param htmlElement Target element\r\n */\r\n Container.prototype.moveHtmlContainer = function (htmlElement) {\r\n var newContainer = $dom.getElement(htmlElement);\r\n if (newContainer) {\r\n this.htmlContainer = newContainer;\r\n var svgDiv = this.svgContainer;\r\n svgDiv.htmlElement = newContainer;\r\n svgDiv.htmlElement.appendChild(svgDiv.SVGContainer);\r\n svgDiv.initSensor();\r\n svgDiv.measure();\r\n }\r\n else if ($type.isString(htmlElement) && htmlElement != \"\") {\r\n system.log(\"html container '\" + htmlElement + \"' not found\");\r\n //throw new Error(\"html container not found\");\r\n }\r\n };\r\n /**\r\n * @ignore\r\n * @return Has license?\r\n */\r\n Container.prototype.hasLicense = function () {\r\n if (options.commercialLicense) {\r\n return true;\r\n }\r\n for (var i = 0; i < options.licenses.length; i++) {\r\n if (options.licenses[i].match(/^CH.{5,}/i)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n return Container;\r\n}(Sprite));\r\nexport { Container };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Container\"] = Container;\r\n//# sourceMappingURL=Container.js.map","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { registry, is } from \"./Registry\";\r\nimport { Container } from \"./Container\";\r\nimport { raf } from \"./utils/AsyncPending\";\r\nimport { triggerIdle } from \"./utils/AsyncPending\";\r\nimport * as $array from \"./utils/Array\";\r\nimport * as $object from \"./utils/Object\";\r\nimport * as $log from \"./utils/Log\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * The main class that handles system-wide tasks, like caching, heartbeats, etc.\r\n * @important\r\n */\r\nvar System = /** @class */ (function () {\r\n /**\r\n * Performs initialization of the System object.\r\n *\r\n * Called when the first [[Sprite]] object is created.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n function System() {\r\n /**\r\n * A flag indicating if the system is on pause.\r\n */\r\n this._isPaused = false;\r\n /**\r\n * Holds the list of currently playing animations.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this.animations = [];\r\n /**\r\n * Unique ID of the object.\r\n */\r\n this.uid = registry.getUniqueId();\r\n /**\r\n * @todo Description\r\n * @todo Needed?\r\n * @ignore Exclude from docs\r\n */\r\n this.dummyCounter = 0;\r\n this._frameRequested = false;\r\n this.updateStepDuration = 45;\r\n this.time = Date.now();\r\n }\r\n /**\r\n * Reports time elapsed since timer was reset.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Needed?\r\n * @param msg Message to report in console\r\n * @param reset Reset time counter\r\n */\r\n System.prototype.reportTime = function (msg, reset) {\r\n if (this.dummyCounter < 6) {\r\n //console.log(Date.now() - this.time, msg, this.dummyCounter2);\r\n }\r\n if (reset) {\r\n this.time = Date.now();\r\n }\r\n };\r\n /**\r\n * Performs \"heartbeat\" operations `frameRate` number of times per second.\r\n *\r\n * When the chart element is invalidated, it is not immediately redrawn.\r\n *\r\n * Instead it waits for the next `update()` cycle to be re-validated.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Maybe should be private?\r\n */\r\n System.prototype.update = function () {\r\n var _this = this;\r\n if (this._isPaused) {\r\n return;\r\n }\r\n this._frameRequested = false;\r\n var time = Date.now();\r\n registry.dispatchImmediately(\"enterframe\");\r\n //this.validateLayouts();\r\n //this.validatePositions();\r\n /*\r\n for (let key in registry.invalidLayouts) {\r\n this.validateLayouts(key);\r\n }\r\n for (let key in registry.invalidPositions) {\r\n this.validatePositions(key);\r\n }\r\n */\r\n var skippedComponents = [];\r\n // data objects first - do all calculations\r\n // only data is parsed in chunks, thats why we do for loop instead of a while like with other invalid items.\r\n // important to go backwards, as items are removed!\r\n // TODO use iterator instead\r\n for (var key in registry.invalidDatas) {\r\n if ($object.hasKey(registry.invalidDatas, key)) {\r\n var invalidData = registry.invalidDatas[key];\r\n while (invalidData.length > 0) {\r\n var component = invalidData[0];\r\n var dataProvider = component.dataProvider;\r\n if (!component.isDisposed()) {\r\n if (dataProvider && dataProvider.dataInvalid) {\r\n try {\r\n dataProvider.validateData();\r\n if (dataProvider.dataValidationProgress < 1) {\r\n break;\r\n }\r\n }\r\n catch (e) {\r\n $array.remove(invalidData, dataProvider);\r\n dataProvider.raiseCriticalError(e);\r\n }\r\n }\r\n else {\r\n try {\r\n component.validateData();\r\n if (component.dataValidationProgress < 1) {\r\n break;\r\n }\r\n }\r\n catch (e) {\r\n $array.remove(invalidData, component);\r\n component.raiseCriticalError(e);\r\n }\r\n }\r\n }\r\n else {\r\n $array.remove(invalidData, component);\r\n }\r\n }\r\n if (Date.now() - time > this.updateStepDuration) {\r\n break;\r\n }\r\n }\r\n }\r\n while (registry.invalidRawDatas.length > 0) {\r\n var component = registry.invalidRawDatas[0];\r\n if (!component.isDisposed()) {\r\n try {\r\n component.validateRawData();\r\n }\r\n catch (e) {\r\n $array.remove(registry.invalidRawDatas, component);\r\n component.raiseCriticalError(e);\r\n }\r\n }\r\n else {\r\n $array.remove(registry.invalidRawDatas, component);\r\n }\r\n }\r\n // TODO use iterator instead\r\n while (registry.invalidDataItems.length > 0) {\r\n var component = registry.invalidDataItems[0];\r\n var dataProvider = component.dataProvider;\r\n // this is needed to avoid partial value validation when data is parsed in chunks\r\n if (component.isDisposed() || component.dataInvalid || (dataProvider && dataProvider.dataInvalid)) {\r\n // void\r\n }\r\n else {\r\n try {\r\n component.validateDataItems();\r\n }\r\n catch (e) {\r\n $array.remove(registry.invalidDataItems, component);\r\n component.raiseCriticalError(e);\r\n }\r\n }\r\n // this might seem too much, as validateValues removes from invalidDataItems aswell, but just to be sure (in case validateData is overriden and no super is called)\r\n $array.remove(registry.invalidDataItems, component);\r\n }\r\n // TODO use iterator instead\r\n while (registry.invalidDataRange.length > 0) {\r\n var component = registry.invalidDataRange[0];\r\n var dataProvider = component.dataProvider;\r\n if (component.isDisposed() || component.dataInvalid || (dataProvider && dataProvider.dataInvalid)) {\r\n // void\r\n }\r\n else {\r\n try {\r\n component.validateDataRange();\r\n if (!component.skipRangeEvent) {\r\n component.dispatchImmediately(\"datarangechanged\");\r\n }\r\n component.skipRangeEvent = false;\r\n }\r\n catch (e) {\r\n $array.remove(registry.invalidDataRange, component);\r\n component.raiseCriticalError(e);\r\n }\r\n }\r\n // this might seem too much, as validateDataRange removes from invalidDataRange aswell, but just to be sure (in case validateData is overriden and no super is called)\r\n $array.remove(registry.invalidDataRange, component);\r\n }\r\n var skippedSprites = [];\r\n // display objects later\r\n // TODO use iterator instead\r\n $object.each(registry.invalidLayouts, function (key) {\r\n _this.validateLayouts(key);\r\n });\r\n $object.each(registry.invalidPositions, function (key) {\r\n _this.validatePositions(key);\r\n });\r\n var hasSkipped = false;\r\n time = Date.now();\r\n $object.each(registry.invalidSprites, function (key, invalidSprites) {\r\n var count = 0;\r\n while (invalidSprites.length > 0) {\r\n _this.validateLayouts(key);\r\n _this.validatePositions(key);\r\n count++;\r\n if (count == 5) {\r\n if (Date.now() - time > _this.updateStepDuration) {\r\n break;\r\n }\r\n count = 0;\r\n }\r\n var sprite = invalidSprites[invalidSprites.length - 1];\r\n // we need to check this, as validateLayout might validate sprite\r\n if (sprite && !sprite.isDisposed()) {\r\n if (!sprite._systemCheckIfValidate()) {\r\n // void\r\n skippedSprites.push(sprite);\r\n }\r\n else {\r\n if (!_this.checkIfValidate2(sprite)) {\r\n // void\r\n skippedSprites.push(sprite);\r\n }\r\n else {\r\n try {\r\n sprite._systemUpdate(skippedSprites);\r\n }\r\n catch (e) {\r\n sprite.invalid = false;\r\n $array.remove(invalidSprites, sprite);\r\n sprite.raiseCriticalError(e);\r\n }\r\n }\r\n }\r\n // this might seem too much, but it's ok\r\n sprite.invalid = false;\r\n }\r\n $array.remove(invalidSprites, sprite);\r\n }\r\n registry.invalidSprites[key] = registry.invalidSprites[key].concat(skippedSprites);\r\n });\r\n $object.each(registry.invalidSprites, function (key, value) {\r\n if (value.length > 0) {\r\n hasSkipped = true;\r\n }\r\n });\r\n $object.each(registry.invalidDatas, function (key, value) {\r\n if (value.length > 0) {\r\n hasSkipped = true;\r\n }\r\n });\r\n // TODO make this more efficient\r\n // TODO don't copy the array\r\n $array.each($array.copy(this.animations), function (x) {\r\n x.update();\r\n });\r\n //if(!hasSkipped){\r\n $object.each(registry.invalidLayouts, function (key) {\r\n _this.validateLayouts(key);\r\n });\r\n $object.each(registry.invalidPositions, function (key) {\r\n _this.validatePositions(key);\r\n });\r\n //}\r\n triggerIdle();\r\n $object.each(registry.invalidLayouts, function (key) {\r\n _this.validateLayouts(key);\r\n });\r\n $object.each(registry.invalidPositions, function (key) {\r\n _this.validatePositions(key);\r\n });\r\n registry.dispatchImmediately(\"exitframe\");\r\n if (hasSkipped || this.animations.length > 0 || skippedComponents.length > 0) {\r\n this.requestFrame();\r\n }\r\n if (this.updateStepDuration < 200) {\r\n var all0_1 = true;\r\n $object.each(registry.invalidDatas, function (key, value) {\r\n if (value.length > 0) {\r\n all0_1 = false;\r\n }\r\n });\r\n $object.each(registry.invalidSprites, function (key, value) {\r\n if (value.length > 0) {\r\n all0_1 = false;\r\n }\r\n });\r\n if (all0_1) {\r\n this.updateStepDuration = 200;\r\n }\r\n }\r\n };\r\n System.prototype.checkIfValidate2 = function (sprite) {\r\n if (sprite.dataItem && sprite.dataItem.component && sprite.dataItem.component.dataInvalid && !sprite.dataItem.component.isTemplate) {\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n };\r\n /**\r\n * Requests new animation frame\r\n */\r\n System.prototype.requestFrame = function () {\r\n var _this = this;\r\n if (!this._frameRequested) {\r\n raf(function () {\r\n _this.update();\r\n });\r\n this._frameRequested = true;\r\n }\r\n };\r\n /**\r\n * Call this method if you update data or config of a chart that is in\r\n * hidden container, after revealing the container, so that labels and\r\n * possibly other elements can correctly arrange themselves.\r\n *\r\n * @since 4.7.10\r\n * @param container Target container\r\n */\r\n System.prototype.softInvalidate = function (container) {\r\n var _this = this;\r\n container.children.each(function (child) {\r\n if (child instanceof Container) {\r\n _this.softInvalidate(child);\r\n }\r\n if (child.measureFailed) {\r\n if (is(child, \"Label\")) {\r\n child.hardInvalidate();\r\n }\r\n else {\r\n child.invalidate();\r\n }\r\n child.measureFailed = false;\r\n }\r\n });\r\n };\r\n /**\r\n * Triggers position re-validation on all [[Sprite]] elements that have\r\n * invalid(ated) positions.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Maybe should be private?\r\n */\r\n System.prototype.validatePositions = function (id) {\r\n // invalid positions\r\n // TODO use iterator instead\r\n var invalidPositions = registry.invalidPositions[id];\r\n while (invalidPositions.length > 0) {\r\n var sprite = invalidPositions[invalidPositions.length - 1];\r\n if (!sprite.isDisposed()) {\r\n try {\r\n sprite._systemValidatePositions();\r\n }\r\n catch (e) {\r\n sprite.positionInvalid = false;\r\n $array.remove(invalidPositions, sprite);\r\n sprite.raiseCriticalError(e);\r\n }\r\n }\r\n else {\r\n $array.remove(invalidPositions, sprite);\r\n }\r\n }\r\n };\r\n /**\r\n * Triggers position re-validation on all [[Container]] elements that have\r\n * invalid(ated) layouts.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Maybe should be private?\r\n */\r\n System.prototype.validateLayouts = function (id) {\r\n // invalid positions\r\n // TODO use iterator instead\r\n var invalidLayouts = registry.invalidLayouts[id];\r\n while (invalidLayouts.length > 0) {\r\n var container = invalidLayouts[invalidLayouts.length - 1];\r\n if (!container.isDisposed()) {\r\n try {\r\n container.children.each(function (sprite) {\r\n sprite._systemValidateLayouts();\r\n });\r\n container.validateLayout();\r\n }\r\n catch (e) {\r\n container.layoutInvalid = false;\r\n $array.remove(invalidLayouts, container);\r\n container.raiseCriticalError(e);\r\n }\r\n }\r\n else {\r\n $array.remove(invalidLayouts, container);\r\n }\r\n }\r\n };\r\n /**\r\n * Outputs string to console if `verbose` is `true`.\r\n *\r\n * @param value Message to output to console\r\n */\r\n System.prototype.log = function (value) {\r\n $log.log(value);\r\n };\r\n Object.defineProperty(System.prototype, \"isPaused\", {\r\n /**\r\n * @return Is system on pause?\r\n */\r\n get: function () {\r\n return this._isPaused;\r\n },\r\n /**\r\n * Pauses all the processes of all the amCharts objects on the page\r\n *\r\n * @return is paused?\r\n */\r\n set: function (value) {\r\n this._isPaused = value;\r\n if (!value) {\r\n this._frameRequested = false;\r\n this.requestFrame();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * amCharts Version.\r\n *\r\n * This follows npm's semver specification.\r\n *\r\n * @see {@link https://docs.npmjs.com/misc/semver}\r\n */\r\n System.VERSION = \"4.10.38\";\r\n return System;\r\n}());\r\nexport { System };\r\n/**\r\n * A singleton global instance of [[System]].\r\n *\r\n * All code should use this, rather than instantiating their\r\n * own System objects.\r\n */\r\nexport var system = new System();\r\n//# sourceMappingURL=System.js.map","/**\r\n * Data parser module.\r\n */\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { DateFormatter } from \"../formatters/DateFormatter\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $type from \"../utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Base class for the data parsers.\r\n */\r\nvar DataParser = /** @class */ (function () {\r\n function DataParser() {\r\n }\r\n /**\r\n * A \"placeholder\" function for real parsers to override.\r\n *\r\n * @ignore Exclude from docs\r\n * @param data Source data\r\n * @return Parsed data (empty)\r\n */\r\n DataParser.prototype.parse = function (data) {\r\n return [];\r\n };\r\n ;\r\n Object.defineProperty(DataParser.prototype, \"parsableNumbers\", {\r\n /**\r\n * Checks if there are any numeric fields that need to be converted to\r\n * numbers.\r\n *\r\n * @return Numeric fields?\r\n */\r\n get: function () {\r\n return this.options.numberFields && (this.options.numberFields.length > 0);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Converts a value to 'number' if it is in `numberFields`.\r\n *\r\n * @param field Field name\r\n * @param value Value\r\n * @return Parsed or original value\r\n */\r\n DataParser.prototype.maybeToNumber = function (field, value) {\r\n if (this.options.numberFields.indexOf(field) !== -1) {\r\n return $utils.anyToNumber(value);\r\n }\r\n return value;\r\n };\r\n Object.defineProperty(DataParser.prototype, \"parsableDates\", {\r\n /**\r\n * Checks if there are any date fields that need to be converted to `Date`\r\n * objects.\r\n *\r\n * @return Date fields?\r\n */\r\n get: function () {\r\n return this.options.dateFields && (this.options.dateFields.length > 0);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Converts a value to `Date` if it is in `dateFields`.\r\n *\r\n * @param field Field name\r\n * @param value Value\r\n * @return Parsed or original value\r\n */\r\n DataParser.prototype.maybeToDate = function (field, value) {\r\n if (this.options.dateFields.indexOf(field) !== -1) {\r\n return this.options.dateFormatter.parse(value, this.dateFormat);\r\n }\r\n return value;\r\n };\r\n /**\r\n * Replaces empty value with something else.\r\n *\r\n * @param value Source value\r\n * @return Source value or replacement\r\n */\r\n DataParser.prototype.maybeToEmpty = function (value) {\r\n if ((!$type.hasValue(value) || value == \"\") && $type.hasValue(this.options.emptyAs)) {\r\n return this.options.emptyAs;\r\n }\r\n return value;\r\n };\r\n Object.defineProperty(DataParser.prototype, \"dateFormatter\", {\r\n /**\r\n * [[DateFormatter]] object for date parsing.\r\n *\r\n * If there was not [[DateFormatter]] supplied in parser options, a new one\r\n * is created.\r\n *\r\n * @return Date formatter\r\n * @see {@link DateFormatter}\r\n */\r\n get: function () {\r\n if (!this.options.dateFormatter) {\r\n this.options.dateFormatter = new DateFormatter;\r\n if (this.options.dateFormat) {\r\n this.options.dateFormat = this.options.dateFormat;\r\n }\r\n }\r\n return this.options.dateFormatter;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataParser.prototype, \"dateFormat\", {\r\n /**\r\n * A date format to use when parsing dates.\r\n *\r\n * @return Date format\r\n * @see {@link DateFormatter}\r\n */\r\n get: function () {\r\n return this.options.dateFormat || this.dateFormatter.inputDateFormat;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return DataParser;\r\n}());\r\nexport { DataParser };\r\n//# sourceMappingURL=DataParser.js.map","/**\r\n * CSV parser.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { DataParser } from \"./DataParser\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $array from \"../utils/Array\";\r\n/**\r\n * Define possible separators.\r\n */\r\nvar separators = [\",\", \";\", \"\\t\"];\r\n/**\r\n * A parser for CSV format.\r\n *\r\n * @important\r\n */\r\nvar CSVParser = /** @class */ (function (_super) {\r\n __extends(CSVParser, _super);\r\n function CSVParser() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n /**\r\n * Content-type suitable for CSV format.\r\n */\r\n _this.contentType = \"text/csv\";\r\n /**\r\n * Parser options.\r\n *\r\n * @see {@link ICSVOptions} for description of each option\r\n */\r\n _this.options = {\r\n delimiter: \"\",\r\n reverse: false,\r\n skipRows: 0,\r\n skipEmpty: true,\r\n useColumnNames: false\r\n };\r\n return _this;\r\n }\r\n /**\r\n * Tests if the format is CSV.\r\n *\r\n * @param data Source data\r\n * @return Is it CSV?\r\n */\r\n CSVParser.isCSV = function (data) {\r\n return CSVParser.getDelimiterFromData(data) ? true : false;\r\n };\r\n /**\r\n * Tries to determine a column separator.\r\n *\r\n * @param data Source data\r\n * @return Separator\r\n */\r\n CSVParser.getDelimiterFromData = function (data) {\r\n // We're going to take first few lines of the CSV with different\r\n // possible separators and check if it results in same number of columns.\r\n // If it does, we're going to assume it's a CSV\r\n var lines = data.split(\"\\n\");\r\n var len = lines.length;\r\n var separator;\r\n $array.each(separators, function (sep) {\r\n var columns = 0, lineColums = 0;\r\n // TODO replace with iterators\r\n for (var i = 0; i < len; ++i) {\r\n // Get number of columns in a line\r\n columns = lines[i].split(sep).length;\r\n if (columns > 1) {\r\n // More than one column - possible candidate\r\n if (lineColums === 0) {\r\n // First line\r\n lineColums = columns;\r\n }\r\n else if (columns != lineColums) {\r\n // Incorrect number of columns, give up on this separator\r\n lineColums = 0;\r\n break;\r\n }\r\n }\r\n else {\r\n // Not this separator\r\n // Not point in continuing\r\n lineColums = 0;\r\n break;\r\n }\r\n }\r\n // Check if we have a winner\r\n if (lineColums) {\r\n separator = sep;\r\n }\r\n });\r\n return separator;\r\n };\r\n /**\r\n * Parses and returns data.\r\n *\r\n * @param data Unparsed data\r\n * @return Parsed data\r\n */\r\n CSVParser.prototype.parse = function (csv) {\r\n // Check if we have delimiter set\r\n if (!this.options.delimiter) {\r\n this.options.delimiter = CSVParser.getDelimiterFromData(csv);\r\n }\r\n // Get CSV data as array\r\n var data = this.CSVToArray(csv, this.options.delimiter);\r\n // Do we need to cast some fields to numbers?\r\n var empty = $type.hasValue(this.options.emptyAs);\r\n var numbers = this.parsableNumbers;\r\n var dates = this.parsableDates;\r\n // Init resuling array\r\n var res = [], cols = [], col, i;\r\n // Skip rows\r\n for (i = 0; i < this.options.skipRows; i++) {\r\n data.shift();\r\n }\r\n // First row holds column names?\r\n if (this.options.useColumnNames) {\r\n cols = data.shift();\r\n // Normalize column names\r\n for (var x = 0; x < cols.length; x++) {\r\n // trim\r\n col = $type.hasValue(cols[x]) ? cols[x].replace(/^\\s+|\\s+$/gm, \"\") : \"\";\r\n // Check for empty\r\n if (\"\" === col) {\r\n col = \"col\" + x;\r\n }\r\n cols[x] = col;\r\n }\r\n }\r\n // Iterate through the result set\r\n var row;\r\n while (true) {\r\n row = this.options.reverse ? data.pop() : data.shift();\r\n if (!row) {\r\n break;\r\n }\r\n if (this.options.skipEmpty && row.length === 1 && row[0] === \"\") {\r\n continue;\r\n }\r\n var dataPoint = {};\r\n for (i = 0; i < row.length; i++) {\r\n col = undefined === cols[i] ? \"col\" + i : cols[i];\r\n dataPoint[col] = row[i] === \"\" ? this.options.emptyAs : row[i];\r\n // Convert\r\n if (empty) {\r\n dataPoint[col] = this.maybeToEmpty(dataPoint[col]);\r\n }\r\n if (numbers) {\r\n dataPoint[col] = this.maybeToNumber(col, dataPoint[col]);\r\n }\r\n if (dates) {\r\n dataPoint[col] = this.maybeToDate(col, dataPoint[col]);\r\n }\r\n }\r\n res.push(dataPoint);\r\n }\r\n return res;\r\n };\r\n /**\r\n * Converts CSV into array.\r\n *\r\n * The functionality of this function is taken from here:\r\n * http://www.bennadel.com/blog/1504-ask-ben-parsing-csv-strings-with-javascript-exec-regular-expression-command.htm\r\n *\r\n * @param data Source data\r\n * @param delimiter Column delimiter\r\n * @return Parsed array\r\n */\r\n CSVParser.prototype.CSVToArray = function (data, delimiter) {\r\n // Check to see if the delimiter is defined. If not,\r\n // then default to comma.\r\n delimiter = (delimiter || ',');\r\n // Create a regular expression to parse the CSV values.\r\n var objPattern = new RegExp((\r\n // Delimiters.\r\n \"(\\\\\" + delimiter + \"|\\\\r?\\\\n|\\\\r|^)\" +\r\n // Quoted fields.\r\n \"(?:\\\"([^\\\"]*(?:\\\"\\\"[^\\\"]*)*)\\\"|\" +\r\n // Standard fields.\r\n \"([^\\\"\\\\\" + delimiter + \"\\\\r\\\\n]*))\"), \"gi\");\r\n // Create an array to hold our data. Give the array\r\n // a default empty first row.\r\n var arrData = [\r\n []\r\n ];\r\n // Create an array to hold our individual pattern\r\n // matching groups.\r\n var arrMatches = null;\r\n // Keep looping over the regular expression matches\r\n // until we can no longer find a match.\r\n while (true) {\r\n arrMatches = objPattern.exec(data);\r\n if (!arrMatches) {\r\n break;\r\n }\r\n // Get the delimiter that was found.\r\n var strMatchedDelimiter = arrMatches[1];\r\n // Check to see if the given delimiter has a length\r\n // (is not the start of string) and if it matches\r\n // field delimiter. If id does not, then we know\r\n // that this delimiter is a row delimiter.\r\n if (strMatchedDelimiter.length &&\r\n (strMatchedDelimiter !== delimiter)) {\r\n // Since we have reached a new row of data,\r\n // add an empty row to our data array.\r\n arrData.push([]);\r\n }\r\n // Now that we have our delimiter out of the way,\r\n // let's check to see which kind of value we\r\n // captured (quoted or unquoted).\r\n var strMatchedValue = void 0;\r\n if (arrMatches[2]) {\r\n // We found a quoted value. When we capture\r\n // this value, unescape any double quotes.\r\n strMatchedValue = arrMatches[2].replace(new RegExp(\"\\\"\\\"\", \"g\"), \"\\\"\");\r\n }\r\n else {\r\n // We found a non-quoted value.\r\n strMatchedValue = arrMatches[3];\r\n }\r\n // Now that we have our value string, let's add\r\n // it to the data array.\r\n arrData[arrData.length - 1].push(strMatchedValue);\r\n }\r\n // Return the parsed data.\r\n return (arrData);\r\n };\r\n return CSVParser;\r\n}(DataParser));\r\nexport { CSVParser };\r\n//# sourceMappingURL=CSVParser.js.map","/**\r\n * JSON parser.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { DataParser } from \"./DataParser\";\r\nimport * as $object from \"../utils/Object\";\r\nimport * as $type from \"../utils/Type\";\r\n/**\r\n * A parser for JSON.\r\n *\r\n * @important\r\n */\r\nvar JSONParser = /** @class */ (function (_super) {\r\n __extends(JSONParser, _super);\r\n function JSONParser() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n /**\r\n * Content-type suitable for JSON format.\r\n */\r\n _this.contentType = \"application/json\";\r\n /**\r\n * Parser options.\r\n *\r\n * @see {@link IJSONOptions} for description of each option\r\n */\r\n _this.options = {};\r\n return _this;\r\n }\r\n /**\r\n * Tests if the data is valid JSON.\r\n *\r\n * @param data Source data\r\n * @return Is it JSON?\r\n */\r\n JSONParser.isJSON = function (data) {\r\n try {\r\n // Try parsing JSON\r\n JSON.parse(data);\r\n // If we got to this point it means it's a valid JSON\r\n return true;\r\n }\r\n catch (e) {\r\n return false;\r\n }\r\n };\r\n /**\r\n * Parses and returns data.\r\n *\r\n * @param data Unparsed data\r\n * @return Parsed data\r\n */\r\n JSONParser.prototype.parse = function (data) {\r\n var _this = this;\r\n // Init return\r\n var res;\r\n // Try parsing\r\n try {\r\n if ($type.hasValue(JSON)) {\r\n res = JSON.parse(data);\r\n }\r\n }\r\n catch (e) {\r\n return undefined;\r\n }\r\n // Do we need to cast some fields to numbers or dates?\r\n var empty = $type.hasValue(this.options.emptyAs);\r\n var numbers = this.parsableNumbers;\r\n var dates = this.parsableDates;\r\n if (Array.isArray(res) && (numbers || dates || empty)) {\r\n var _loop_1 = function (i, len) {\r\n var row = res[i];\r\n $object.each(row, function (key, value) {\r\n if (empty) {\r\n row[key] = _this.maybeToEmpty(row[key]);\r\n }\r\n if (numbers) {\r\n row[key] = _this.maybeToNumber(key, row[key]);\r\n }\r\n if (dates) {\r\n row[key] = _this.maybeToDate(key, row[key]);\r\n }\r\n });\r\n };\r\n // Iterate through the data and check if it needs to be converted\r\n for (var i = 0, len = res.length; i < len; i++) {\r\n _loop_1(i, len);\r\n }\r\n }\r\n // Convert to array\r\n //return Array.isArray(res) ? res : [res];\r\n return res;\r\n };\r\n return JSONParser;\r\n}(DataParser));\r\nexport { JSONParser };\r\n//# sourceMappingURL=JSONParser.js.map","/**\r\n * Data Loader is responsible for loading and parsing external data\r\n */\r\nimport { CSVParser } from \"./CSVParser\";\r\nimport { JSONParser } from \"./JSONParser\";\r\nimport { Adapter } from \"../utils/Adapter\";\r\nimport * as $net from \"../utils/Net\";\r\nimport * as $array from \"../utils/Array\";\r\n;\r\n/**\r\n * Data Loader is responsible for loading and parsing external data.\r\n *\r\n * There is just one instance of DataLoader per system. Unless you have a\r\n * speicific reason, do not instantiate additional instances.\r\n *\r\n * The global instance of Data Loader is accessible via:\r\n *\r\n * ```TypeScript\r\n * am4core.dataLoader;\r\n * ```\r\n * ```JavaScript\r\n * am4core.dataLoader;\r\n * ```\r\n *\r\n * A loading of specific data source is done via [[DataSource]].\r\n *\r\n Please refer to [[DataSource]] for information how to use it.\r\n *\r\n * @see {@link IDataLoaderAdapters} for a list of available Adapters\r\n */\r\nvar DataLoader = /** @class */ (function () {\r\n function DataLoader() {\r\n /**\r\n * Adapter.\r\n */\r\n this.adapter = new Adapter(this);\r\n }\r\n /**\r\n * Loads a supplied [[DataSource]] or an array of data sources, then calls\r\n * their respective `parse` methods.\r\n *\r\n * @param source A single data source or an array of multiple of data sources\r\n */\r\n DataLoader.prototype.load = function (source) {\r\n var sources = Array.isArray(source) ? source : [source];\r\n // Add each Source to the list to be loaded simultaneously\r\n var promises = $array.map(sources, function (x) {\r\n // Dispatch events\r\n x.dispatchImmediately(\"started\");\r\n x.dispatchImmediately(\"loadstarted\");\r\n return $net.load(x.url, x, x.requestOptions);\r\n });\r\n // Run all promises in parallel\r\n Promise.all(promises).then(function (res) {\r\n // Process each loaded source\r\n $array.each(res, function (result) {\r\n // Get Source\r\n var source = result.target;\r\n // Dispatch events\r\n source.dispatchImmediately(\"loadended\");\r\n if (result.error) {\r\n if (source.events.isEnabled(\"error\")) {\r\n source.events.dispatchImmediately(\"error\", {\r\n type: \"error\",\r\n code: result.xhr.status,\r\n message: source.language.translate(\"Unable to load file: %1\", null, source.url),\r\n target: source\r\n });\r\n }\r\n }\r\n else {\r\n // Initiate parsing of the loaded data\r\n source.processData(result.response, result.type);\r\n }\r\n source.dispatchImmediately(\"ended\");\r\n });\r\n }).catch(function (res) {\r\n if (res.target) {\r\n res.target.dispatchImmediately(\"loadended\");\r\n if (res.target.events.isEnabled(\"error\")) {\r\n res.target.events.dispatchImmediately(\"error\", {\r\n type: \"error\",\r\n code: res.xhr.status,\r\n message: res.target.language.translate(\"Unable to load file: %1\", null, res.target.url),\r\n target: res.target\r\n });\r\n }\r\n res.target.dispatchImmediately(\"ended\");\r\n }\r\n });\r\n };\r\n /**\r\n * Instantiates a [[DataParser]] object based on the data type.\r\n * Built-in parser types are as follows:\r\n *\r\n * * \"csv\" or \"text/csv\"\r\n * * \"json\" or \"application/json\"\r\n *\r\n * @param contentType A format type\r\n * @return A parser object\r\n */\r\n DataLoader.prototype.getParserByType = function (contentType) {\r\n // Let some plugin decide\r\n var parser = this.adapter.apply(\"getParserByType\", {\r\n parser: null,\r\n type: contentType\r\n }).parser;\r\n if (parser) {\r\n return parser;\r\n }\r\n if (contentType == \"csv\" || contentType == \"text/csv\" || contentType == \"application/vnd.ms-excel\") {\r\n return new CSVParser();\r\n }\r\n if (contentType == \"json\" || contentType == \"application/json\") {\r\n return new JSONParser();\r\n }\r\n return;\r\n };\r\n /**\r\n * Tries to determine a parser out of content type and/or actual data.\r\n *\r\n * @param data Data\r\n * @param contentType Content-type\r\n * @return Parser instance\r\n */\r\n DataLoader.prototype.getParserByData = function (data, contentType) {\r\n // Let some plugin decide\r\n var parser = this.adapter.apply(\"getParserByData\", {\r\n parser: null,\r\n data: data,\r\n type: contentType\r\n }).parser;\r\n // Check if we have parser from outside code\r\n if (!parser) {\r\n // No, let's try to figure it out\r\n parser = this.getParserByType(contentType);\r\n if (parser) {\r\n // We're able to figure out parser by content-type\r\n return parser;\r\n }\r\n else if (JSONParser.isJSON(data)) {\r\n return this.getParserByType(\"json\");\r\n }\r\n else if (CSVParser.isCSV(data)) {\r\n return this.getParserByType(\"csv\");\r\n }\r\n }\r\n return parser;\r\n };\r\n return DataLoader;\r\n}());\r\nexport { DataLoader };\r\n/**\r\n * Create instance of Data Loader\r\n */\r\nexport var dataLoader = new DataLoader();\r\n//# sourceMappingURL=DataLoader.js.map","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { dataLoader } from \"./DataLoader\";\r\nimport { JSONParser } from \"./JSONParser\";\r\nimport { CSVParser } from \"./CSVParser\";\r\nimport { BaseObjectEvents } from \"../Base\";\r\nimport { Adapter } from \"../utils/Adapter\";\r\nimport { Language } from \"../utils/Language\";\r\nimport { DateFormatter } from \"../formatters/DateFormatter\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $object from \"../utils/Object\";\r\n;\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Represents a single data source - external file with all of its settings,\r\n * such as format, data parsing, etc.\r\n *\r\n * ```TypeScript\r\n * chart.dataSource.url = \"http://www.myweb.com/data.json\";\r\n * chart.dataSource.parser = am4core.JSONParser;\r\n * ```\r\n * ```JavaScript\r\n * chart.dataSource.url = \"http://www.myweb.com/data.json\";\r\n * chart.dataSource.parser = am4core.JSONParser;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"dataSource\": {\r\n * \"url\": \"http://www.myweb.com/data.json\",\r\n * \"parser\": \"JSONParser\"\r\n * },\r\n * // ...\r\n * }\r\n * ```\r\n *\r\n * @see {@link IDataSourceEvents} for a list of available events\r\n * @see {@link IDataSourceAdapters} for a list of available Adapters\r\n */\r\nvar DataSource = /** @class */ (function (_super) {\r\n __extends(DataSource, _super);\r\n /**\r\n * Constructor\r\n */\r\n function DataSource(url, parser) {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * Adapter.\r\n */\r\n _this.adapter = new Adapter(_this);\r\n /**\r\n * Custom options for HTTP(S) request.\r\n */\r\n _this._requestOptions = {};\r\n /**\r\n * If set to `true`, any subsequent data loads will be considered incremental\r\n * (containing only new data points that are supposed to be added to existing\r\n * data).\r\n *\r\n * NOTE: this setting works only with element's `data` property. It won't\r\n * work with any other externally-loadable data property.\r\n *\r\n * @default false\r\n */\r\n _this._incremental = false;\r\n /**\r\n * A collection of key/value pairs to attach to a data source URL when making\r\n * an incremental request.\r\n */\r\n _this._incrementalParams = {};\r\n /**\r\n * This setting is used only when `incremental = true`. If set to `true`,\r\n * it will try to retain the same number of data items across each load.\r\n *\r\n * E.g. if incremental load yeilded 5 new records, then 5 items from the\r\n * beginning of data will be removed so that we end up with the same number\r\n * of data items.\r\n *\r\n * @default false\r\n */\r\n _this._keepCount = false;\r\n /**\r\n * If set to `true`, each subsequent load will be treated as an update to\r\n * currently loaded data, meaning that it will try to update values on\r\n * existing data items, not overwrite the whole data.\r\n *\r\n * This will work faster than complete update, and also will animate the\r\n * values to their new positions.\r\n *\r\n * Data sources across loads must contain the same number of data items.\r\n *\r\n * Loader will not truncate the data set if loaded data has fewer data items,\r\n * and if it is longer, the excess data items will be ignored.\r\n *\r\n * @default false\r\n * @since 4.5.5\r\n */\r\n _this._updateCurrentData = false;\r\n /**\r\n * Will show loading indicator when loading files.\r\n */\r\n _this.showPreloader = true;\r\n _this.className = \"DataSource\";\r\n // Set defaults\r\n if (url) {\r\n _this.url = url;\r\n }\r\n // Set parser\r\n if (parser) {\r\n if (typeof parser == \"string\") {\r\n _this.parser = dataLoader.getParserByType(parser);\r\n }\r\n else {\r\n _this.parser = parser;\r\n }\r\n }\r\n return _this;\r\n }\r\n /**\r\n * Processes the loaded data.\r\n *\r\n * @ignore Exclude from docs\r\n * @param data Raw (unparsed) data\r\n * @param contentType Content type of the loaded data (optional)\r\n */\r\n DataSource.prototype.processData = function (data, contentType) {\r\n // Parsing started\r\n this.dispatchImmediately(\"parsestarted\");\r\n // Check if parser is set\r\n if (!this.parser) {\r\n // Try to resolve from data\r\n this.parser = dataLoader.getParserByData(data, contentType);\r\n if (!this.parser) {\r\n // We have a problem - nobody knows what to do with the data\r\n // Raise error\r\n if (this.events.isEnabled(\"parseerror\")) {\r\n var event_1 = {\r\n type: \"parseerror\",\r\n message: this.language.translate(\"No parser available for file: %1\", null, this.url),\r\n target: this\r\n };\r\n this.events.dispatchImmediately(\"parseerror\", event_1);\r\n }\r\n this.dispatchImmediately(\"parseended\");\r\n return;\r\n }\r\n }\r\n // Apply options adapters\r\n this.parser.options = this.adapter.apply(\"parserOptions\", this.parser.options);\r\n this.parser.options.dateFields = this.adapter.apply(\"dateFields\", this.parser.options.dateFields || []);\r\n this.parser.options.numberFields = this.adapter.apply(\"numberFields\", this.parser.options.numberFields || []);\r\n // Check if we need to pass in date formatter\r\n if (this.parser.options.dateFields && !this.parser.options.dateFormatter) {\r\n this.parser.options.dateFormatter = this.dateFormatter;\r\n }\r\n // Parse\r\n this.data = this.adapter.apply(\"parsedData\", this.parser.parse(this.adapter.apply(\"unparsedData\", data)));\r\n // Check for parsing errors\r\n if (!$type.hasValue(this.data) && this.events.isEnabled(\"parseerror\")) {\r\n var event_2 = {\r\n type: \"parseerror\",\r\n message: this.language.translate(\"Error parsing file: %1\", null, this.url),\r\n target: this\r\n };\r\n this.events.dispatchImmediately(\"parseerror\", event_2);\r\n }\r\n // Wrap up\r\n this.dispatchImmediately(\"parseended\");\r\n if ($type.hasValue(this.data)) {\r\n this.dispatchImmediately(\"done\", {\r\n \"data\": this.data\r\n });\r\n }\r\n // The component is responsible for updating its own data vtriggered via\r\n // events.\r\n // Update last data load\r\n this.lastLoad = new Date();\r\n };\r\n Object.defineProperty(DataSource.prototype, \"url\", {\r\n /**\r\n * @return URL\r\n */\r\n get: function () {\r\n // Get URL\r\n var url = this.disableCache\r\n ? this.timestampUrl(this._url)\r\n : this._url;\r\n // Add incremental params\r\n if (this.incremental && this.component.data.length) {\r\n url = this.addUrlParams(url, this.incrementalParams);\r\n }\r\n return this.adapter.apply(\"url\", url);\r\n },\r\n /**\r\n * URL of the data source.\r\n *\r\n * @param value URL\r\n */\r\n set: function (value) {\r\n this._url = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataSource.prototype, \"requestOptions\", {\r\n /**\r\n * @return Options\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"requestOptions\", this._requestOptions);\r\n },\r\n /**\r\n * Custom options for HTTP(S) request.\r\n *\r\n * At this moment the only option supported is: `requestHeaders`, which holds\r\n * an array of objects for custom request headers, e.g.:\r\n *\r\n * ```TypeScript\r\n * chart.dataSource.requestOptions.requestHeaders = [{\r\n * \"key\": \"x-access-token\",\r\n * \"value\": \"123456789\"\r\n * }];\r\n * ``````JavaScript\r\n * chart.dataSource.requestOptions.requestHeaders = [{\r\n * \"key\": \"x-access-token\",\r\n * \"value\": \"123456789\"\r\n * }];\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"dataSource\": {\r\n * // ...\r\n * \"requestOptions\": {\r\n * \"requestHeaders\": [{\r\n * \"key\": \"x-access-token\",\r\n * \"value\": \"123456789\"\r\n * }]\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * NOTE: setting this options on an-already loaded DataSource will not\r\n * trigger a reload.\r\n *\r\n * @param value Options\r\n */\r\n set: function (value) {\r\n this._requestOptions = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataSource.prototype, \"parser\", {\r\n /**\r\n * @return Data parser\r\n */\r\n get: function () {\r\n if (!this._parser) {\r\n this._parser = new JSONParser();\r\n }\r\n return this.adapter.apply(\"parser\", this._parser);\r\n },\r\n /**\r\n * A parser to be used to parse data.\r\n *\r\n * ```TypeScript\r\n * chart.dataSource.url = \"http://www.myweb.com/data.json\";\r\n * chart.dataSource.parser = am4core.JSONParser;\r\n * ```\r\n * ```JavaScript\r\n * chart.dataSource.url = \"http://www.myweb.com/data.json\";\r\n * chart.dataSource.parser = am4core.JSONParser;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"dataSource\": {\r\n * \"url\": \"http://www.myweb.com/data.json\",\r\n * \"parser\": {\r\n * \"type\": \"JSONParser\"\r\n * }\r\n * },\r\n * // ...\r\n * }\r\n * ```\r\n *\r\n * @default JSONParser\r\n * @param value Data parser\r\n */\r\n set: function (value) {\r\n this._parser = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataSource.prototype, \"reloadFrequency\", {\r\n /**\r\n * @return Reload frequency (ms)\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"reloadTimeout\", this._reloadFrequency);\r\n },\r\n /**\r\n * Data source reload frequency.\r\n *\r\n * If set, it will reload the same URL every X milliseconds.\r\n *\r\n * @param value Reload frequency (ms)\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n if (this._reloadFrequency != value) {\r\n this._reloadFrequency = value;\r\n // Should we schedule a reload?\r\n if (value) {\r\n if (!$type.hasValue(this._reloadDisposer)) {\r\n this._reloadDisposer = this.events.on(\"ended\", function (ev) {\r\n _this._reloadTimeout = setTimeout(function () {\r\n _this.load();\r\n }, _this.reloadFrequency);\r\n });\r\n }\r\n }\r\n else if ($type.hasValue(this._reloadDisposer)) {\r\n this._reloadDisposer.dispose();\r\n this._reloadDisposer = undefined;\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataSource.prototype, \"incremental\", {\r\n /**\r\n * @return Incremental load?\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"incremental\", this._incremental);\r\n },\r\n /**\r\n * Should subsequent reloads be treated as incremental?\r\n *\r\n * Incremental loads will assume that they contain only new data items\r\n * since the last load.\r\n *\r\n * If `incremental = false` the loader will replace all of the target's\r\n * data with each load.\r\n *\r\n * This setting does not have any effect trhe first time data is loaded.\r\n *\r\n * NOTE: this setting works only with element's `data` property. It won't\r\n * work with any other externally-loadable data property.\r\n *\r\n * @default false\r\n * @param Incremental load?\r\n */\r\n set: function (value) {\r\n this._incremental = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataSource.prototype, \"incrementalParams\", {\r\n /**\r\n * @return Incremental request parameters\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"incrementalParams\", this._incrementalParams);\r\n },\r\n /**\r\n * An object consisting of key/value pairs to apply to an URL when data\r\n * source is making an incremental request.\r\n *\r\n * @param value Incremental request parameters\r\n */\r\n set: function (value) {\r\n this._incrementalParams = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataSource.prototype, \"keepCount\", {\r\n /**\r\n * @return keepCount load?\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"keepCount\", this._keepCount);\r\n },\r\n /**\r\n * This setting is used only when `incremental = true`. If set to `true`,\r\n * it will try to retain the same number of data items across each load.\r\n *\r\n * E.g. if incremental load yeilded 5 new records, then 5 items from the\r\n * beginning of data will be removed so that we end up with the same number\r\n * of data items.\r\n *\r\n * @default false\r\n * @param Keep record count?\r\n */\r\n set: function (value) {\r\n this._keepCount = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataSource.prototype, \"updateCurrentData\", {\r\n /**\r\n * @return Update current data?\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"updateCurrentData\", this._updateCurrentData);\r\n },\r\n /**\r\n * If set to `true`, each subsequent load will be treated as an update to\r\n * currently loaded data, meaning that it will try to update values on\r\n * existing data items, not overwrite the whole data.\r\n *\r\n * This will work faster than complete update, and also will animate the\r\n * values to their new positions.\r\n *\r\n * Data sources across loads must contain the same number of data items.\r\n *\r\n * Loader will not truncate the data set if loaded data has fewer data items,\r\n * and if it is longer, the excess data items will be ignored.\r\n *\r\n * NOTE: this setting is ignored if `incremental = true`.\r\n *\r\n * @default false\r\n * @since 2.5.5\r\n * @param Update current data?\r\n */\r\n set: function (value) {\r\n this._updateCurrentData = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataSource.prototype, \"language\", {\r\n /**\r\n * @return A [[Language]] instance to be used\r\n */\r\n get: function () {\r\n if (this._language) {\r\n return this._language;\r\n }\r\n else if (this.component) {\r\n this._language = this.component.language;\r\n return this._language;\r\n }\r\n this.language = new Language();\r\n return this.language;\r\n },\r\n /**\r\n * Language instance to use.\r\n *\r\n * Will inherit and use chart's language, if not set.\r\n *\r\n * @param value An instance of Language\r\n */\r\n set: function (value) {\r\n this._language = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataSource.prototype, \"dateFormatter\", {\r\n /**\r\n * @return A [[DateFormatter]] instance to be used\r\n */\r\n get: function () {\r\n if (this._dateFormatter) {\r\n return this._dateFormatter;\r\n }\r\n else if (this.component) {\r\n this._dateFormatter = this.component.dateFormatter;\r\n return this._dateFormatter;\r\n }\r\n this.dateFormatter = new DateFormatter();\r\n return this.dateFormatter;\r\n },\r\n /**\r\n * A [[DateFormatter]] to use when parsing dates from string formats.\r\n *\r\n * Will inherit and use chart's DateFormatter if not ser.\r\n *\r\n * @param value An instance of [[DateFormatter]]\r\n */\r\n set: function (value) {\r\n this._dateFormatter = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Adds current timestamp to the URL.\r\n *\r\n * @param url Source URL\r\n * @return Timestamped URL\r\n */\r\n DataSource.prototype.timestampUrl = function (url) {\r\n var tstamp = new Date().getTime().toString();\r\n var params = {};\r\n params[tstamp] = \"\";\r\n return this.addUrlParams(url, params);\r\n };\r\n /**\r\n * Disposes of this object.\r\n */\r\n DataSource.prototype.dispose = function () {\r\n _super.prototype.dispose.call(this);\r\n if (this._reloadTimeout) {\r\n clearTimeout(this._reloadTimeout);\r\n }\r\n if ($type.hasValue(this._reloadDisposer)) {\r\n this._reloadDisposer.dispose();\r\n this._reloadDisposer = undefined;\r\n }\r\n };\r\n /**\r\n * Initiate the load.\r\n *\r\n * All loading in JavaScript is asynchronous. This function will trigger the\r\n * load and will exit immediately.\r\n *\r\n * Use DataSource's events to watch for loaded data and errors.\r\n */\r\n DataSource.prototype.load = function () {\r\n if (this.url) {\r\n if (this._reloadTimeout) {\r\n clearTimeout(this._reloadTimeout);\r\n }\r\n dataLoader.load(this);\r\n }\r\n };\r\n /**\r\n * Adds parameters to `url` as query strings. Will take care of proper\r\n * separators.\r\n *\r\n * @param url Source URL\r\n * @param params Parameters\r\n * @return New URL\r\n */\r\n DataSource.prototype.addUrlParams = function (url, params) {\r\n var join = url.match(/\\?/) ? \"&\" : \"?\";\r\n var add = [];\r\n $object.each(params, function (key, value) {\r\n if (value != \"\") {\r\n add.push(key + \"=\" + encodeURIComponent(value));\r\n }\r\n else {\r\n add.push(key);\r\n }\r\n });\r\n if (add.length) {\r\n return url + join + add.join(\"&\");\r\n }\r\n return url;\r\n };\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n DataSource.prototype.processConfig = function (config) {\r\n registry.registeredClasses[\"json\"] = JSONParser;\r\n registry.registeredClasses[\"JSONParser\"] = JSONParser;\r\n registry.registeredClasses[\"csv\"] = CSVParser;\r\n registry.registeredClasses[\"CSVParser\"] = CSVParser;\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n return DataSource;\r\n}(BaseObjectEvents));\r\nexport { DataSource };\r\n//# sourceMappingURL=DataSource.js.map","/**\r\n * Responsive functionality module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObjectEvents } from \"../Base\";\r\nimport { List } from \"../utils/List\";\r\nimport { Adapter } from \"../utils/Adapter\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $iter from \"../utils/Iterator\";\r\nimport * as $array from \"../utils/Array\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $object from \"../utils/Object\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Responsive is responsible for overriding certain properties when conditions\r\n * are met.\r\n *\r\n * This class is used to dynamically apply and change certain chart properties\r\n * based on the current values of properties.\r\n *\r\n * Mainly, this is used with [[Sprite]]'s dimensional properties, like\r\n * `pixelWidth` and `pixelHeight`. However, it can be used to dynamically\r\n * change any property, based on any other property's value.\r\n *\r\n * A default responsive rules are disabled.\r\n *\r\n * To enable, set `enabled = false`. E.g.:\r\n *\r\n * ```TypeScript\r\n * chart.responsive.enabled = true;\r\n * ```\r\n * ```JavaScript\r\n * chart.responsive.enabled = true;\r\n * ```\r\n *\r\n * @see {@link IResponsiveEvents} for a list of available events\r\n * @see {@link IResponsiveAdapters} for a list of available Adapters\r\n * @todo Add default rules\r\n * @todo Watch for rule modification\r\n * @important\r\n */\r\nvar Responsive = /** @class */ (function (_super) {\r\n __extends(Responsive, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Responsive() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * Holds a list of responsive rules organized by object type.\r\n */\r\n _this._rules = new List();\r\n /**\r\n * Holds the list of the default responsive rules.\r\n * @deprecated\r\n */\r\n //protected _defaultRules = new List<IResponsiveRule>();\r\n /**\r\n * Holds the list of currently applied rules.\r\n */\r\n _this._appliedRules = {};\r\n /**\r\n * Used to keep track of objects that have rules applied at the moment.\r\n */\r\n _this._appliedTargets = [];\r\n /**\r\n * Use default rules in addition to the user-defined ones?\r\n */\r\n _this._useDefault = true;\r\n /**\r\n * Adapter.\r\n */\r\n _this.adapter = new Adapter(_this);\r\n /**\r\n * Indicates of responsive rules application is enabled.\r\n */\r\n _this._enabled = false;\r\n /**\r\n * Holds disposers for all events added by this class.\r\n */\r\n _this._responsiveDisposers = [];\r\n /**\r\n * Collection of objects and state ids that do not have any properties set.\r\n */\r\n _this._noStates = [];\r\n _this.className = \"Responsive\";\r\n // Set up rules list events\r\n _this.rules.events.on(\"inserted\", function () { _this.checkRules(); }, true);\r\n _this.rules.events.on(\"removed\", function () { _this.checkRules(); }, true);\r\n _this._disposers.push(_this.rules.events);\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(Responsive.prototype, \"component\", {\r\n /**\r\n * @return Target object\r\n */\r\n get: function () {\r\n return this._component;\r\n },\r\n /**\r\n * A target object that responsive rules will need to be applied to.\r\n *\r\n * @param value Target object\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n // Check if it's the same\r\n if (value == this._component) {\r\n return;\r\n }\r\n // Check if we already have a set up component and remove its events\r\n this.disposeResponsiveHandlers();\r\n // Set\r\n this._component = value;\r\n // Set up resize monitoring events\r\n this._responsiveDisposers.push($type.getValue(this.component).events.on(\"sizechanged\", function () { _this.checkRules(); }, this));\r\n this._responsiveDisposers.push($type.getValue(this.component).events.once(\"datavalidated\", function () {\r\n if (_this._component.isReady()) {\r\n _this.checkRules(true);\r\n }\r\n }, this));\r\n // Enable resoponsive\r\n this.enabled = true;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Responsive.prototype, \"enabled\", {\r\n /**\r\n * @return Apply responsive rules?\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"enabled\", this._enabled);\r\n },\r\n /**\r\n * Should responsive rules be checked against and applied?\r\n *\r\n * @default false\r\n * @param value Apply responsive rules?\r\n */\r\n set: function (value) {\r\n if (this._enabled != value) {\r\n this._enabled = value;\r\n // Run `applyRules` so that any currently applied rules can be reset\r\n this.applyRules();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Responsive.prototype, \"useDefault\", {\r\n /**\r\n * @return Use default rules?\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"useDefault\", this._useDefault);\r\n },\r\n /**\r\n * Should default responsive rules be applied in addition to user-defined\r\n * ones.\r\n *\r\n * User-defined rules will take precedence over default rules whenever they\r\n * produce conflicting settings.\r\n *\r\n * @default true\r\n * @param value Use default rules?\r\n */\r\n set: function (value) {\r\n if (this._useDefault != value) {\r\n this._useDefault = value;\r\n // Run `applyRules` so that any currently applied rules can be reset\r\n this.applyRules();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Responsive.prototype, \"rules\", {\r\n /**\r\n * @return User-defined rules\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"rules\", this._rules);\r\n },\r\n /**\r\n * User-defined responsive rules.\r\n *\r\n * User-defined rules will take precedence over default rules whenever they\r\n * produce conflicting settings.\r\n *\r\n * Use `allRules` to get all applicable rules including default and\r\n * user-defined ones.\r\n *\r\n * @param value User-defined rules\r\n */\r\n set: function (value) {\r\n this._rules = value;\r\n this._enabled = true;\r\n this.applyRules();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Responsive.prototype, \"defaultRules\", {\r\n /**\r\n * Default responsive rules.\r\n *\r\n * @readonly\r\n * @return List of responsive rules\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"defaultRules\", defaultRules);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Responsive.prototype, \"allRules\", {\r\n /**\r\n * Returns all rules: default rules (if not disabled) combined with\r\n * user-defined ones.\r\n *\r\n * @readonly\r\n * @return List of all applicable rules\r\n */\r\n get: function () {\r\n // Create empty list\r\n var rules = new List();\r\n // Add default rules if not disabled\r\n // A code, requesting `allRules` must ensure loading of default rules\r\n // by calling `loadDefaultRules()`\r\n if (this.useDefault) {\r\n rules.copyFrom(this.defaultRules);\r\n }\r\n // Add user-defined ones\r\n rules.copyFrom(this.rules);\r\n return this.adapter.apply(\"allRules\", rules);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Checks if rule by the particular id currently applied.\r\n *\r\n * @param ruleId Rule ID\r\n * @return Is currently applied?\r\n */\r\n Responsive.prototype.isApplied = function (ruleId) {\r\n var rule = this._appliedRules[ruleId];\r\n return $type.hasValue(rule) ? rule : false;\r\n };\r\n /**\r\n * Checks which responsive rules currently satisfy their conditions and\r\n * should be applied, or unapplied.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Responsive.prototype.checkRules = function (force) {\r\n var _this = this;\r\n if (force === void 0) { force = false; }\r\n // Check if there are any rules\r\n var rules = this.allRules;\r\n if (!rules || rules.length == 0) {\r\n return;\r\n }\r\n // Init a list of rules to be applied\r\n var rulesChanged = false;\r\n var component = $type.getValue(this.component);\r\n // Do not perform rule application of target has no size\r\n if (component.pixelWidth == 0 || component.pixelHeight == 0) {\r\n return;\r\n }\r\n // Check which rules match\r\n $iter.each(rules.iterator(), function (rule) {\r\n // Check if rule has an id\r\n if (!rule.id) {\r\n rule.id = registry.getUniqueId();\r\n }\r\n // Init indicator if this rule should be applied\r\n var apply = rule.relevant(component);\r\n // Let's check if this rule needs to be applied\r\n if ((apply && !_this.isApplied(rule.id)) || (!apply && _this.isApplied(rule.id))) {\r\n rulesChanged = true;\r\n }\r\n _this._appliedRules[rule.id] = apply;\r\n });\r\n if (force) {\r\n rulesChanged = true;\r\n }\r\n // Check if we need to re-apply the rules\r\n if (rulesChanged) {\r\n if (!this.component.isReady()) {\r\n // The chart is not yet ready (built)\r\n // We will hide the chart and delay application of rules\r\n // until \"ready\" event kicks in\r\n //component.hide(0);\r\n component.hidden = true;\r\n component.events.once(\"ready\", function (ev) {\r\n ev.target.show(0);\r\n _this._applyRules();\r\n });\r\n return;\r\n }\r\n this.dispatchImmediately(\"ruleschanged\");\r\n this._applyRules();\r\n }\r\n };\r\n Responsive.prototype._applyRules = function () {\r\n var _this = this;\r\n if (this._timeout) {\r\n this._timeout.dispose();\r\n }\r\n this._timeout = this.setTimeout(function () {\r\n _this.applyRules();\r\n }, 10);\r\n };\r\n /**\r\n * Applies current rules to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param target Target object\r\n * @todo Better type check\r\n */\r\n Responsive.prototype.applyRules = function (target) {\r\n var _this = this;\r\n // If no target supplied, we assume the top-level element\r\n var newTarget = ($type.hasValue(target)\r\n ? target\r\n : $type.getValue(this.component));\r\n // Check each rule\r\n var defaultStateApplied = false;\r\n if (this.enabled) {\r\n var isApplied_1 = false;\r\n $iter.each(this.allRules.iterator(), function (rule) {\r\n // Get relevant state\r\n var state = _this.getState(rule, newTarget);\r\n // If there's a state, it means it needs to be applied\r\n if (state) {\r\n // Check if default state was already applied to this element.\r\n // We don't want to go resetting default states to ALL element,\r\n // if they don't have responsive states.\r\n if (!defaultStateApplied) {\r\n // Nope, reset states (instantly).\r\n if ($array.indexOf(_this._appliedTargets, newTarget.uid) !== -1) {\r\n // But only if this element has any rules applied, otherwise no\r\n // point in setting current state\r\n newTarget.setState(_this.getDefaultState(newTarget), 0);\r\n }\r\n defaultStateApplied = true;\r\n }\r\n // Is this rule currently applied?\r\n if (_this.isApplied($type.getValue(rule.id))) {\r\n // Yes. Apply the responsive state\r\n state.transitionDuration = 0;\r\n _this.setTargetState(newTarget, state);\r\n _this.dispatchImmediately(\"ruleapplied\", {\r\n rule: rule\r\n });\r\n isApplied_1 = true;\r\n }\r\n }\r\n });\r\n if (isApplied_1) {\r\n $array.replace(this._appliedTargets, newTarget.uid);\r\n }\r\n else {\r\n $array.remove(this._appliedTargets, newTarget.uid);\r\n }\r\n }\r\n // Apply rules to the children\r\n if (newTarget.children) {\r\n $iter.each(newTarget.children.iterator(), function (child) {\r\n _this.applyRules(child);\r\n });\r\n }\r\n };\r\n /**\r\n * Returns a relative state for the rule/target, or `undefined` if no state is\r\n * needed.\r\n *\r\n * @param rule [description]\r\n * @param target [description]\r\n * @return [description]\r\n */\r\n Responsive.prototype.getState = function (rule, target) {\r\n var stateId = \"responsive-\" + rule.id;\r\n var tmpId = target.uid + \"_\" + stateId;\r\n if ($array.indexOf(this._noStates, tmpId) !== -1) {\r\n return;\r\n }\r\n else if (!target.states.hasKey(stateId)) {\r\n var state = rule.state(target, stateId);\r\n if (!state) {\r\n this._noStates.push(tmpId);\r\n }\r\n return state;\r\n }\r\n else {\r\n return target.states.getKey(stateId);\r\n }\r\n };\r\n /**\r\n * Creates and returns default responsive rule for the target.\r\n *\r\n * This rule will be used to \"reset\" to non-responsive values.\r\n * @param target Target Sprite\r\n * @return State\r\n */\r\n Responsive.prototype.getDefaultState = function (target) {\r\n if (target.states.hasKey(\"responsive-default\")) {\r\n return target.states.getKey(\"responsive-default\");\r\n }\r\n return target.states.create(\"responsive-default\");\r\n };\r\n /**\r\n * Sets state on the target element and updates default state with the\r\n * overwritten values if needed.\r\n *\r\n * @param target Target\r\n * @param state State\r\n */\r\n Responsive.prototype.setTargetState = function (target, state) {\r\n var _this = this;\r\n // Update default state\r\n var defaultState = this.getDefaultState(target);\r\n $object.each(state.properties, function (key, val) {\r\n if (!$type.hasValue(defaultState.properties[key])) {\r\n defaultState.properties[key] = _this.getValue(target, key);\r\n }\r\n });\r\n target.setState(state);\r\n };\r\n /**\r\n * Gets a value from an element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param target Target object\r\n * @param property Property\r\n * @return Property value\r\n */\r\n Responsive.prototype.getValue = function (target, property) {\r\n // This is a bit hacky, first we check if the property exist.\r\n // If it doesn't we try accessing target's property directly\r\n var value = target.getPropertyValue(property);\r\n if (!$type.hasValue(value) && $type.hasValue(target[property])) {\r\n value = target[property];\r\n }\r\n return value;\r\n };\r\n /**\r\n * Disposes the object.\r\n */\r\n Responsive.prototype.dispose = function () {\r\n this.disposeResponsiveHandlers();\r\n _super.prototype.dispose.call(this);\r\n };\r\n /**\r\n * Disposes all event handlers.\r\n */\r\n Responsive.prototype.disposeResponsiveHandlers = function () {\r\n var disposer = this._responsiveDisposers.pop();\r\n while (disposer) {\r\n disposer.dispose();\r\n disposer = this._responsiveDisposers.pop();\r\n }\r\n };\r\n return Responsive;\r\n}(BaseObjectEvents));\r\nexport { Responsive };\r\n/**\r\n * [defaultRules description]\r\n *\r\n * @todo description\r\n */\r\nexport var defaultRules = new List();\r\ndefaultRules.events.on(\"inserted\", function (ev) {\r\n ev.newValue.id = registry.getUniqueId();\r\n});\r\n/**\r\n *\r\n * @todo description\r\n */\r\nvar ResponsiveBreakpoints = /** @class */ (function () {\r\n function ResponsiveBreakpoints() {\r\n }\r\n // Breakpoint functions (for use in `relevant` clause of the responsive rules)\r\n ResponsiveBreakpoints.widthXXS = function (container) {\r\n return container.pixelWidth <= ResponsiveBreakpoints.XXS;\r\n };\r\n ResponsiveBreakpoints.widthXS = function (container) {\r\n return container.pixelWidth <= ResponsiveBreakpoints.XS;\r\n };\r\n ResponsiveBreakpoints.widthS = function (container) {\r\n return container.pixelWidth <= ResponsiveBreakpoints.S;\r\n };\r\n ResponsiveBreakpoints.widthM = function (container) {\r\n return container.pixelWidth <= ResponsiveBreakpoints.M;\r\n };\r\n ResponsiveBreakpoints.widthL = function (container) {\r\n return container.pixelWidth <= ResponsiveBreakpoints.L;\r\n };\r\n ResponsiveBreakpoints.widthXL = function (container) {\r\n return container.pixelWidth <= ResponsiveBreakpoints.XL;\r\n };\r\n ResponsiveBreakpoints.widthXXL = function (container) {\r\n return container.pixelWidth <= ResponsiveBreakpoints.XXL;\r\n };\r\n ResponsiveBreakpoints.heightXXS = function (container) {\r\n return container.pixelHeight <= ResponsiveBreakpoints.XXS;\r\n };\r\n ResponsiveBreakpoints.heightXS = function (container) {\r\n return container.pixelHeight <= ResponsiveBreakpoints.XS;\r\n };\r\n ResponsiveBreakpoints.heightS = function (container) {\r\n return container.pixelHeight <= ResponsiveBreakpoints.S;\r\n };\r\n ResponsiveBreakpoints.heightM = function (container) {\r\n return container.pixelHeight <= ResponsiveBreakpoints.M;\r\n };\r\n ResponsiveBreakpoints.heightL = function (container) {\r\n return container.pixelHeight <= ResponsiveBreakpoints.L;\r\n };\r\n ResponsiveBreakpoints.heightXL = function (container) {\r\n return container.pixelHeight <= ResponsiveBreakpoints.XL;\r\n };\r\n ResponsiveBreakpoints.heightXXL = function (container) {\r\n return container.pixelHeight <= ResponsiveBreakpoints.XXL;\r\n };\r\n ResponsiveBreakpoints.isXXS = function (container) {\r\n return (container.pixelWidth <= ResponsiveBreakpoints.XXS) && (container.pixelHeight <= ResponsiveBreakpoints.XXS);\r\n };\r\n ResponsiveBreakpoints.isXS = function (container) {\r\n return (container.pixelWidth <= ResponsiveBreakpoints.XS) && (container.pixelHeight <= ResponsiveBreakpoints.XS);\r\n };\r\n ResponsiveBreakpoints.isS = function (container) {\r\n return (container.pixelWidth <= ResponsiveBreakpoints.S) && (container.pixelHeight <= ResponsiveBreakpoints.S);\r\n };\r\n ResponsiveBreakpoints.isM = function (container) {\r\n return (container.pixelWidth <= ResponsiveBreakpoints.M) && (container.pixelHeight <= ResponsiveBreakpoints.M);\r\n };\r\n ResponsiveBreakpoints.isL = function (container) {\r\n return (container.pixelWidth <= ResponsiveBreakpoints.L) && (container.pixelHeight <= ResponsiveBreakpoints.L);\r\n };\r\n ResponsiveBreakpoints.isXL = function (container) {\r\n return (container.pixelWidth <= ResponsiveBreakpoints.XL) && (container.pixelHeight <= ResponsiveBreakpoints.XL);\r\n };\r\n ResponsiveBreakpoints.isXXL = function (container) {\r\n return (container.pixelWidth <= ResponsiveBreakpoints.XXL) && (container.pixelHeight <= ResponsiveBreakpoints.XXL);\r\n };\r\n ResponsiveBreakpoints.maybeXXS = function (container) {\r\n return (container.pixelWidth <= ResponsiveBreakpoints.XXS) || (container.pixelHeight <= ResponsiveBreakpoints.XXS);\r\n };\r\n ResponsiveBreakpoints.maybeXS = function (container) {\r\n return (container.pixelWidth <= ResponsiveBreakpoints.XS) || (container.pixelHeight <= ResponsiveBreakpoints.XS);\r\n };\r\n ResponsiveBreakpoints.maybeS = function (container) {\r\n return (container.pixelWidth <= ResponsiveBreakpoints.S) || (container.pixelHeight <= ResponsiveBreakpoints.S);\r\n };\r\n ResponsiveBreakpoints.maybeM = function (container) {\r\n return (container.pixelWidth <= ResponsiveBreakpoints.M) || (container.pixelHeight <= ResponsiveBreakpoints.M);\r\n };\r\n ResponsiveBreakpoints.maybeL = function (container) {\r\n return (container.pixelWidth <= ResponsiveBreakpoints.L) || (container.pixelHeight <= ResponsiveBreakpoints.L);\r\n };\r\n ResponsiveBreakpoints.maybeXL = function (container) {\r\n return (container.pixelWidth <= ResponsiveBreakpoints.XL) || (container.pixelHeight <= ResponsiveBreakpoints.XL);\r\n };\r\n ResponsiveBreakpoints.maybeXXL = function (container) {\r\n return (container.pixelWidth <= ResponsiveBreakpoints.XXL) || (container.pixelHeight <= ResponsiveBreakpoints.XXL);\r\n };\r\n // Named pixel breakpoints\r\n ResponsiveBreakpoints.XXS = 100;\r\n ResponsiveBreakpoints.XS = 200;\r\n ResponsiveBreakpoints.S = 300;\r\n ResponsiveBreakpoints.M = 400;\r\n ResponsiveBreakpoints.L = 600;\r\n ResponsiveBreakpoints.XL = 800;\r\n ResponsiveBreakpoints.XXL = 1000;\r\n return ResponsiveBreakpoints;\r\n}());\r\nexport { ResponsiveBreakpoints };\r\n//# sourceMappingURL=Responsive.js.map","/**\r\n * Defines functionality for \"Data Item\"\r\n *\r\n * A Data Item can be any object that can hold data. For example [[LineSeries]]\r\n * holds a number of values, that comprise a line graph. Each of those values\r\n * (data points) is a {DataItem}.\r\n *\r\n * Furthermore the [[LineSeries]] itself can be represented as a entry in the\r\n * legend. Since legend needs access to Line Series' value, a DataItem is\r\n * created for the series.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObjectEvents } from \"./Base\";\r\nimport { Adapter } from \"./utils/Adapter\";\r\nimport { Animation, AnimationDisposer } from \"./utils/Animation\";\r\nimport * as $utils from \"./utils/Utils\";\r\nimport * as $array from \"./utils/Array\";\r\n//import * as $object from \"./utils/Object\";\r\nimport * as $type from \"./utils/Type\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * DataItem represents single element in data, for example a data point in a\r\n * Serial Chart Series, e.g. a column.\r\n *\r\n * DataItem defines relationship between structured data, required for specific\r\n * chart type or task, and raw source data.\r\n *\r\n * It also implements required calculations, updates related visual elements,\r\n * etc.\r\n *\r\n * @todo Description\r\n * @important\r\n */\r\nvar DataItem = /** @class */ (function (_super) {\r\n __extends(DataItem, _super);\r\n /**\r\n * Constructor\r\n * @todo Adding events to disposers produces errors in some cases, which means that chart is using disposed Data Items which is not right\r\n */\r\n function DataItem() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * This Data Item is currently disabled.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._disabled = false;\r\n /**\r\n * Indicates whether Data Item has any properties set.\r\n *\r\n * If it does not have any, the code can use this property to check whether\r\n * they need to apply costly operation of re-applying properties, whenever\r\n * Data Item-related element is redrawn, e.g. series.\r\n */\r\n _this.hasProperties = false;\r\n /**\r\n * An object containing calculated values.\r\n */\r\n _this.values = {};\r\n /**\r\n * An object container current working values.\r\n */\r\n //public readonly workingValues: { [index: string]: { [index: string]: number } } = {};\r\n /**\r\n * An object containing categories.\r\n */\r\n _this.categories = {};\r\n /**\r\n * An object containing dates.\r\n */\r\n _this.dates = {};\r\n /**\r\n * An object containing locations for the Data Item.\r\n *\r\n * A location is a position within date or category, or, in some other cases,\r\n * where there is no single point but rather some period.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/series/#Data_item_locations} for info how data item locations work\r\n */\r\n _this.locations = {};\r\n /**\r\n * Current working locations.\r\n */\r\n _this.workingLocations = {};\r\n /**\r\n * An object containing Data Item specific appearance properties in key-value\r\n * pairs.\r\n *\r\n * Sometimes a single Data Item needs to apply different properties than the\r\n * rest of the data [[Series]] it is part of. E.g. a single column,\r\n * represented by a Data Item needs to be filled with a different color than\r\n * the reset of the [[ColumnSeries]] it belongs to.\r\n *\r\n * That's where Data Item's `properties` come into play.\r\n *\r\n * Please note that you should set Data Item-specific properties using\r\n * `setProperty()` method, rather than access `properties` object directly.\r\n */\r\n _this.properties = {};\r\n /**\r\n * A list of [[Sprite]] elements that are associated with this Data Item.\r\n *\r\n * E.g. an [[Axis]] Data Item has several separate elements associated with\r\n * it, like [[AxisTick]], [[AxisLabel]], and [[Grid]].\r\n *\r\n * Data Item keeps track of all of them, so it can toggle all related visual\r\n * elements when it itself is toggled.\r\n */\r\n _this.sprites = [];\r\n /**\r\n * Identifies if this object is a \"template\" and should not be treated as\r\n * real object that is drawn or actually used in the chart.\r\n */\r\n _this.isTemplate = false;\r\n /**\r\n * The current index within the dataItems\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._index = null;\r\n /**\r\n * Is Data Item currently visible?\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._visible = true;\r\n /**\r\n * Is Data Item currently hidden?\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._hidden = false;\r\n /**\r\n * Should this Data Item be used when calculating data ranges and scales?\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._ignoreMinMax = false;\r\n /**\r\n * Some of the Data Item's data fields may contain an array of children. This\r\n * property contains an object indicating which fields hold an array, so that\r\n * they can be processed properly.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this.hasChildren = {};\r\n /**\r\n * Indicates whether Data Item is currently animiting from visible to hidden\r\n * state.\r\n */\r\n _this.isHiding = false;\r\n /**\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._valueAnimations = {};\r\n /**\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._locationAnimations = {};\r\n _this.className = \"DataItem\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(DataItem.prototype, \"adapter\", {\r\n /**\r\n * Holds Adapter.\r\n */\r\n get: function () {\r\n if (!this._adapterO) {\r\n this._adapterO = new Adapter(this);\r\n }\r\n return this._adapterO;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataItem.prototype, \"index\", {\r\n /**\r\n * Data Item's position index in Component's data.\r\n *\r\n * @return Index\r\n */\r\n get: function () {\r\n if (this.component) {\r\n if (this._index != null) {\r\n return this._index;\r\n }\r\n else {\r\n return -1;\r\n }\r\n }\r\n else {\r\n return -1;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataItem.prototype, \"animations\", {\r\n /**\r\n * A list of [[Animations]] objects currently mutating Data Item's values.\r\n *\r\n * @return [description]\r\n */\r\n get: function () {\r\n if (!this._animations) {\r\n this._animations = [];\r\n this._disposers.push(new AnimationDisposer(this._animations));\r\n }\r\n return this._animations;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataItem.prototype, \"visible\", {\r\n /**\r\n * Returns `true` if this Data Item is currently visible.\r\n *\r\n * @return Visible?\r\n */\r\n get: function () {\r\n if (this._hidden) {\r\n return false;\r\n }\r\n return this._visible;\r\n },\r\n /**\r\n * Sets visibility of the Data Item.\r\n *\r\n * @param value Visible?\r\n */\r\n set: function (value) {\r\n if (value) {\r\n this.hidden = false;\r\n }\r\n if (this._visible != value) {\r\n this.setVisibility(value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataItem.prototype, \"hidden\", {\r\n /**\r\n * Returns `true` if this Data Item is currently hidden.\r\n *\r\n * @return Hidden?\r\n */\r\n get: function () {\r\n return this._hidden;\r\n },\r\n /**\r\n * Sets hidden flag for data item. Mostly used to initially hide data item.\r\n *\r\n * @param value Hidden?\r\n */\r\n set: function (value) {\r\n if (this._hidden != value) {\r\n this._hidden = value;\r\n if (value) {\r\n this.setVisibility(false);\r\n }\r\n else {\r\n this.setVisibility(true, true);\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataItem.prototype, \"__disabled\", {\r\n /**\r\n * Is this Data Item currently disabled?\r\n *\r\n * @ignore Exclude from docs\r\n * @param {boolean}\r\n */\r\n get: function () {\r\n return this._disabled;\r\n },\r\n /**\r\n * Disables all Sprites associated with this Data Item.\r\n *\r\n * @ignore Exclude from docs\r\n * @param {boolean}\r\n */\r\n set: function (value) {\r\n //\tif (this._disabled != value) { // not good\r\n this._disabled = value;\r\n $array.each(this.sprites, function (sprite) {\r\n sprite.__disabled = value;\r\n });\r\n //\t}\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets visibility of the Data Item.\r\n *\r\n * @param value Data Item\r\n */\r\n DataItem.prototype.setVisibility = function (value, noChangeValues) {\r\n $array.each(this.sprites, function (sprite) {\r\n if (value) {\r\n sprite.visible = sprite.defaultState.properties.visible;\r\n }\r\n else {\r\n if (sprite.hiddenState) {\r\n sprite.visible = sprite.hiddenState.properties.visible;\r\n }\r\n else {\r\n sprite.visible = false;\r\n }\r\n }\r\n });\r\n this._visible = value;\r\n if (this._eventDispatcher && !this.__disabled) {\r\n if (this.events.isEnabled(\"visibilitychanged\")) {\r\n var event_1 = {\r\n type: \"visibilitychanged\",\r\n target: this,\r\n visible: value\r\n };\r\n this.events.dispatchImmediately(\"visibilitychanged\", event_1);\r\n }\r\n }\r\n };\r\n /**\r\n * Shows the Data Item and related visual elements.\r\n *\r\n * @param duration Animation duration (ms)\r\n * @param delay Delay animation (ms)\r\n * @param fields A list of fields to set values of\r\n */\r\n DataItem.prototype.show = function (duration, delay, fields) {\r\n var _this = this;\r\n if (!this.hidden) {\r\n this.setVisibility(true, true);\r\n this.isHiding = false;\r\n if (this._hideDisposer) {\r\n this.removeDispose(this._hideDisposer);\r\n }\r\n var animation_1;\r\n if (fields) {\r\n $array.each(fields, function (field) {\r\n animation_1 = _this.setWorkingValue(field, _this.values[field].value, duration, delay);\r\n });\r\n }\r\n $array.each(this.sprites, function (sprite) {\r\n var animation = sprite.show(duration);\r\n if (animation != null && !animation.isFinished()) {\r\n _this._disposers.push(animation);\r\n if (delay != null && delay > 0) {\r\n animation.delay(delay);\r\n }\r\n }\r\n });\r\n return animation_1;\r\n }\r\n };\r\n /**\r\n * Destroys this object and all related data.\r\n */\r\n DataItem.prototype.dispose = function () {\r\n _super.prototype.dispose.call(this);\r\n $array.each(this.sprites, function (sprite) {\r\n sprite.dispose();\r\n });\r\n this.sprites = [];\r\n };\r\n /**\r\n * Hides the Data Item and related visual elements.\r\n *\r\n * @param duration Animation duration (ms)\r\n * @param delay Delay animation (ms)\r\n * @param toValue A value to set to `fields` when hiding\r\n * @param fields A list of data fields to set value to `toValue`\r\n */\r\n DataItem.prototype.hide = function (duration, delay, toValue, fields) {\r\n var _this = this;\r\n this.isHiding = true;\r\n $array.each(this.sprites, function (sprite) {\r\n var animation = sprite.hide(duration);\r\n if (animation != null && !animation.isFinished()) {\r\n _this._disposers.push(animation);\r\n if (delay != null && delay > 0) {\r\n animation.delay(delay);\r\n }\r\n }\r\n });\r\n if ($type.isNumber(toValue) && fields) {\r\n var animation_2;\r\n $array.each(fields, function (field) {\r\n var anim = _this.setWorkingValue(field, toValue, duration, delay);\r\n if (anim) {\r\n animation_2 = anim;\r\n }\r\n });\r\n if (animation_2 && !animation_2.isFinished()) {\r\n this._hideDisposer = animation_2.events.on(\"animationended\", function () {\r\n _this.setVisibility(false, true);\r\n _this.isHiding = false;\r\n });\r\n this._disposers.push(this._hideDisposer);\r\n return animation_2;\r\n }\r\n else {\r\n this.isHiding = false;\r\n this.setVisibility(false, true);\r\n }\r\n }\r\n else {\r\n this.isHiding = false;\r\n this.setVisibility(false);\r\n }\r\n };\r\n /**\r\n * Returns a duration (ms) the Data Item should take to animate from one\r\n * value to another.\r\n *\r\n * If the duration is not specified via parameter, this method will try to\r\n * request a default duration from the related `Component`.\r\n *\r\n * @param duration Default duration (ms)\r\n * @return Duration (ms)\r\n */\r\n DataItem.prototype.getDuration = function (duration) {\r\n if (!$type.isNumber(duration)) {\r\n var component = this.component;\r\n if (component) {\r\n duration = component.interpolationDuration;\r\n }\r\n }\r\n if (duration != null) {\r\n if (!this._adapterO) {\r\n return duration;\r\n }\r\n else {\r\n return this._adapterO.apply(\"duration\", duration);\r\n }\r\n }\r\n };\r\n /**\r\n * Returns a numeric value for specific data field.\r\n *\r\n * If `calculated` is not set, it will return a raw value, as it is in\r\n * source data.\r\n *\r\n * If `calculated` is set, it will return a pre-calculated specific value.\r\n *\r\n * @param name Data field name\r\n * @param calculated A calculated value name\r\n * @return Value\r\n */\r\n DataItem.prototype.getValue = function (name, calculated) {\r\n if (name && this.component) {\r\n if (!calculated) {\r\n calculated = this.component.dataFields[name + \"Show\"];\r\n if (!calculated) {\r\n calculated = \"value\";\r\n }\r\n }\r\n var value = this.values[name][calculated];\r\n if (this._adapterO && this._adapterO.isEnabled(\"value\")) {\r\n return this._adapterO.apply(\"value\", {\r\n value: value,\r\n field: name\r\n }).value;\r\n }\r\n else {\r\n return value;\r\n }\r\n }\r\n };\r\n /**\r\n * Returns a current working value for a specific data field.\r\n *\r\n * The actual value may differ from the one returned by `getValue()`. The\r\n * latter returns static values from the data source.\r\n *\r\n * `getWorkingValue()` returns current value, which is usually different if\r\n * Data Item is animating from one state to another.\r\n *\r\n * @param name Data field name\r\n * @return Value\r\n */\r\n DataItem.prototype.getWorkingValue = function (name) {\r\n if (name && this.component) {\r\n var realName = this.component.dataFields[name + \"Show\"];\r\n if (!realName) {\r\n realName = \"workingValue\";\r\n }\r\n if (this._adapterO) {\r\n return this._adapterO.apply(\"workingValue\", {\r\n workingValue: this.values[name][realName],\r\n field: name\r\n }).workingValue;\r\n }\r\n else {\r\n return this.values[name][realName];\r\n }\r\n }\r\n };\r\n /**\r\n * @ignore\r\n * @return Value\r\n */\r\n DataItem.prototype.getActualWorkingValue = function (name) {\r\n return this.values[name].workingValue;\r\n };\r\n /**\r\n * Sets a numeric value for specific data field.\r\n *\r\n * @param name Data field name\r\n * @param value Value\r\n * @param calculated Calculated data field name\r\n * @param duration Duration (ms) to animate to new value to\r\n * @param delay Delay animation (ms)\r\n */\r\n DataItem.prototype.setValue = function (name, value, duration, delay) {\r\n var currentValue = this.values[name].value;\r\n var newDuration = this.getDuration(duration);\r\n value = $type.toNumber(value);\r\n if (currentValue !== value) {\r\n this.values[name].value = value;\r\n if (this._eventDispatcher && !this.__disabled) {\r\n if (this.events.isEnabled(\"valuechanged\")) {\r\n var event_2 = {\r\n type: \"valuechanged\",\r\n target: this,\r\n property: name\r\n };\r\n this.events.dispatchImmediately(\"valuechanged\", event_2);\r\n }\r\n }\r\n if (this.component) {\r\n this.component.handleDataItemValueChange(this, name);\r\n }\r\n }\r\n this.setWorkingValue(name, value, newDuration, delay);\r\n };\r\n DataItem.prototype.setCalculatedValue = function (name, value, calculated) {\r\n var currentValue = this.values[name][calculated];\r\n if (currentValue !== value && $type.isNumber(value)) {\r\n this.values[name][calculated] = value;\r\n if (this._eventDispatcher && !this.__disabled) {\r\n if (this.events.isEnabled(\"calculatedvaluechanged\")) {\r\n var event_3 = {\r\n type: \"calculatedvaluechanged\",\r\n target: this,\r\n property: name\r\n };\r\n this.events.dispatchImmediately(\"calculatedvaluechanged\", event_3);\r\n }\r\n }\r\n if (this.component) {\r\n this.component.handleDataItemCalculatedValueChange(this, name);\r\n }\r\n }\r\n };\r\n /**\r\n * Set current working numeric value for a specific data field.\r\n *\r\n * @param name Data field name\r\n * @param value Value\r\n * @param calculated Calculated data field name\r\n * @param duration Duration (ms) to animate to new value to\r\n * @param delay Delay animation (ms)\r\n * @return An [[Animation]] object used for transition to new values\r\n */\r\n DataItem.prototype.setWorkingValue = function (name, value, duration, delay) {\r\n if ($type.isNumber(this.values[name].value)) {\r\n var newDuration = this.getDuration(duration);\r\n var workingValue = this.values[name].workingValue;\r\n if (newDuration != null && newDuration > 0 && $type.isNumber(workingValue) && this.component) { // sometimes NaN is passed, so only change this to != null if all cases of NaN are handled, otherwise animation won't stop\r\n if (workingValue != value) {\r\n var animation = this.animate({ childObject: this.values[name], property: \"workingValue\", from: workingValue, to: value, dummyData: name }, newDuration, this.component.interpolationEasing);\r\n if (delay != null) {\r\n animation.delay(delay);\r\n }\r\n animation.events.on(\"animationstarted\", this.handleInterpolationProgress, this);\r\n animation.events.on(\"animationprogress\", this.handleInterpolationProgress, this);\r\n animation.events.on(\"animationended\", this.handleInterpolationProgress, this);\r\n this._valueAnimations[name] = animation;\r\n return animation;\r\n }\r\n else {\r\n var valueAnimation = this._valueAnimations[name];\r\n if (valueAnimation) {\r\n valueAnimation.stop();\r\n }\r\n this.values[name].workingValue = value;\r\n }\r\n }\r\n else {\r\n var valueAnimation = this._valueAnimations[name];\r\n if (valueAnimation) {\r\n valueAnimation.stop();\r\n }\r\n this.values[name].workingValue = value;\r\n if (this._eventDispatcher && !this.__disabled) {\r\n if (this.events.isEnabled(\"workingvaluechanged\")) {\r\n var event_4 = {\r\n type: \"workingvaluechanged\",\r\n target: this,\r\n property: name\r\n };\r\n this.events.dispatchImmediately(\"workingvaluechanged\", event_4);\r\n }\r\n }\r\n if (this.component) {\r\n this.component.handleDataItemWorkingValueChange(this, name);\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Sets a relative location for a data field.\r\n *\r\n * A location is always relative on a 0 to 1 scale, with 0 being beginning,\r\n * 0.5 middle and 1 end.\r\n *\r\n * @todo Rewiew description\r\n * @param name Data field name\r\n * @param value Location (0-1)\r\n * @param duration Duration (ms) to animate to new value to\r\n * @param delay Delay animation (ms)\r\n */\r\n DataItem.prototype.setLocation = function (name, value, duration, delay) {\r\n var currentLocation = this.locations[name];\r\n if (currentLocation !== value) {\r\n this.locations[name] = value;\r\n if (this._eventDispatcher && !this.__disabled) {\r\n if (this.events.isEnabled(\"locationchanged\")) {\r\n var event_5 = {\r\n type: \"locationchanged\",\r\n target: this,\r\n property: name\r\n };\r\n this.events.dispatchImmediately(\"locationchanged\", event_5);\r\n }\r\n }\r\n if (this.component) {\r\n this.component.handleDataItemValueChange(this, name); // correct\r\n }\r\n this.setWorkingLocation(name, value, duration, delay);\r\n }\r\n };\r\n /**\r\n * Sets a current working location for a data field.\r\n *\r\n * @todo Rewiew description\r\n * @param name Data field name\r\n * @param value Location (0-1)\r\n * @param duration Duration (ms) to animate to new value to\r\n * @param delay Delay animation (ms)\r\n */\r\n DataItem.prototype.setWorkingLocation = function (name, value, duration, delay) {\r\n var newDuration = this.getDuration(duration);\r\n var workingLocation = this.workingLocations[name];\r\n if (newDuration != null && newDuration > 0 && $type.isNumber(workingLocation) && this.component) { // sometimes NaN is passed, so only change this to != null if all cases of NaN are handled, otherwise animation won't stop\r\n if (workingLocation != value) {\r\n var animation = this.animate({ childObject: this.workingLocations, property: name, from: workingLocation, to: value, dummyData: name }, newDuration, this.component.interpolationEasing);\r\n if (delay != null) {\r\n animation.delay(delay);\r\n }\r\n animation.events.on(\"animationstarted\", this.handleInterpolationProgress, this);\r\n animation.events.on(\"animationprogress\", this.handleInterpolationProgress, this);\r\n animation.events.on(\"animationended\", this.handleInterpolationProgress, this);\r\n this._locationAnimations[name] = animation;\r\n return animation;\r\n }\r\n else {\r\n var locationAnimation = this._locationAnimations[name];\r\n if (locationAnimation) {\r\n locationAnimation.stop();\r\n }\r\n this.workingLocations[name] = value;\r\n }\r\n }\r\n else {\r\n var locationAnimation = this._locationAnimations[name];\r\n if (locationAnimation) {\r\n locationAnimation.stop();\r\n }\r\n this.workingLocations[name] = value;\r\n if (this._eventDispatcher && !this.__disabled) {\r\n if (this.events.isEnabled(\"workinglocationchanged\")) {\r\n var event_6 = {\r\n type: \"workinglocationchanged\",\r\n target: this,\r\n property: name\r\n };\r\n this.events.dispatchImmediately(\"workinglocationchanged\", event_6);\r\n }\r\n }\r\n if (this.component) {\r\n this.component.handleDataItemWorkingLocationChange(this, name);\r\n }\r\n }\r\n };\r\n /**\r\n * Sets Date value to a data field.\r\n *\r\n * @param name Data field name\r\n * @param date Date object\r\n * @param duration Duration (ms) to animate to new value to\r\n */\r\n DataItem.prototype.setDate = function (name, date, duration) {\r\n if (!$type.isDate(date) && this.component) {\r\n date = this.component.dateFormatter.parse(date);\r\n }\r\n var currentDate = this.dates[name];\r\n if (currentDate !== date) {\r\n this.dates[name] = date;\r\n this.setValue(name, date.getTime(), duration);\r\n }\r\n };\r\n /**\r\n * Returns a Date value of the data field.\r\n *\r\n * @param name Data field name\r\n * @return Date object\r\n */\r\n DataItem.prototype.getDate = function (name) {\r\n if (this._adapterO) {\r\n return this._adapterO.apply(\"date\", {\r\n date: this.dates[name],\r\n field: name\r\n }).date;\r\n }\r\n else {\r\n return this.dates[name];\r\n }\r\n };\r\n /**\r\n * Sets a Data Item-specific visual properties to apply to related elements.\r\n *\r\n * @param name Property name\r\n * @param value Property value\r\n */\r\n DataItem.prototype.setProperty = function (name, value) {\r\n if (this.properties[name] !== value) {\r\n this.hasProperties = true;\r\n this.properties[name] = value;\r\n if (this._eventDispatcher && !this.__disabled) {\r\n if (this.events.isEnabled(\"propertychanged\")) {\r\n var event_7 = {\r\n type: \"propertychanged\",\r\n target: this,\r\n property: name,\r\n value: value\r\n };\r\n this.events.dispatchImmediately(\"propertychanged\", event_7);\r\n }\r\n }\r\n if (this.component) {\r\n this.component.handleDataItemPropertyChange(this, name);\r\n }\r\n }\r\n };\r\n /**\r\n * Sets a related category for this Data Item.\r\n *\r\n * @todo Review description\r\n * @param name Data field name\r\n * @param value Category\r\n */\r\n DataItem.prototype.setCategory = function (name, value) {\r\n if (!$type.isString(value)) {\r\n value = $type.castString(value);\r\n }\r\n if (this.categories[name] !== value) {\r\n this.categories[name] = value;\r\n }\r\n };\r\n /**\r\n * Clones the Data Item, including all related data.\r\n *\r\n * @return New Data Item clone\r\n */\r\n //public clone(cloneId?: string): this {\r\n //\tlet dataItem: this = super.clone(cloneId);\r\n //\tdataItem.copyFrom(this);\r\n //\treturn dataItem;\r\n //}\r\n /**\r\n * Copies all properties and related data from different data item.\r\n *\r\n * @param object Source data item\r\n */\r\n DataItem.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n if (source.dataContext) {\r\n this.dataContext = $utils.copy(source.dataContext, {});\r\n }\r\n $utils.copyProperties(source.locations, this.locations);\r\n /*\r\n $utils.copyProperties(source.properties, this.properties);\r\n $utils.copyProperties(source.categories, this.categories);\r\n $utils.copyProperties(source.values, this.values);\r\n $utils.copyProperties(source.dates, this.dates);\r\n\r\n $object.each(source.values, (name, value) => {\r\n this.values[name] = $object.copy(value);\r\n });*/\r\n if (source._adapterO) {\r\n this.adapter.copyFrom(source._adapterO);\r\n }\r\n //this.events.copyFrom(source.events); // because copied in Base\r\n this.component = source.component;\r\n };\r\n Object.defineProperty(DataItem.prototype, \"opacity\", {\r\n /**\r\n * Sets opacity for all Data Item's related elements (Sprites).\r\n *\r\n * @param value Opacity (0-1)\r\n */\r\n set: function (value) {\r\n $array.each(this.sprites, function (sprite) {\r\n sprite.opacity = value;\r\n });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataItem.prototype, \"ignoreMinMax\", {\r\n /**\r\n * Exclude from min/max calculations?\r\n * @return Exclude from min/max calculations?\r\n */\r\n get: function () {\r\n return this._ignoreMinMax;\r\n },\r\n /**\r\n * Sets whether this data point should not be included in the scale and\r\n * minimum/maximum calculations.\r\n *\r\n * E.g. some we may want to exclude a particular data point from influencing\r\n * [[ValueAxis]] scale.\r\n *\r\n * @param value Exclude from min/max calculations?\r\n */\r\n set: function (value) {\r\n this._ignoreMinMax = value;\r\n if (this._eventDispatcher && !this.__disabled) {\r\n if (this.events.isEnabled(\"propertychanged\")) {\r\n var event_8 = {\r\n type: \"propertychanged\",\r\n target: this,\r\n property: \"ignoreMinMax\",\r\n value: value\r\n };\r\n this.events.dispatchImmediately(\"propertychanged\", event_8);\r\n }\r\n }\r\n if (this.component) {\r\n this.component.handleDataItemPropertyChange(this, \"ignoreMinMax\");\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates and starts an [[Animation]] to interpolate (morph) Data Item's\r\n * properties and/or values.\r\n *\r\n * @see {@link Animation}\r\n * @param animationOptions Animation options\r\n * @param duration Animation duration (ms)\r\n * @param easing Easing function\r\n * @return Animation\r\n */\r\n DataItem.prototype.animate = function (animationOptions, duration, easing) {\r\n return new Animation(this, animationOptions, duration, easing).start();\r\n };\r\n /**\r\n * Handles intermediate steps when Data Item is interpolating (morphing) from\r\n * one value to another.\r\n *\r\n * @ignore Exclude from docs\r\n * @param event Event object\r\n */\r\n DataItem.prototype.handleInterpolationProgress = function (event) {\r\n var animation = event.target;\r\n // it's always only one options, no need cycle\r\n var animationOptions = animation.animationOptions[0];\r\n if (animationOptions) {\r\n if (this._eventDispatcher && !this.__disabled) {\r\n if (this.events.isEnabled(\"workingvaluechanged\")) {\r\n var event_9 = {\r\n type: \"workingvaluechanged\",\r\n target: this,\r\n property: animationOptions.dummyData\r\n };\r\n this.events.dispatchImmediately(\"workingvaluechanged\", event_9);\r\n }\r\n }\r\n if (this.component) {\r\n this.component.handleDataItemWorkingValueChange(this, animationOptions.dummyData);\r\n }\r\n }\r\n };\r\n /**\r\n * Checks whether Data Item has values set for all of the data fields,\r\n * supplied via argument.\r\n *\r\n * @ignore Exclude from docs\r\n * @param fields Field list to check\r\n * @return Has values for all fields?\r\n */\r\n DataItem.prototype.hasValue = function (fields) {\r\n // todo: what about categories?\r\n for (var i = 0, len = fields.length; i < len; i++) {\r\n var values = this.values[fields[i]];\r\n if (!values || !$type.hasValue(values.value)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n Object.defineProperty(DataItem.prototype, \"depth\", {\r\n /**\r\n * Depth of the Data Item.\r\n *\r\n * In nested data structures, like TreeMap, this indicates the level this\r\n * data point is at, in relation to the parent Data Item.\r\n *\r\n * @return Depth\r\n */\r\n get: function () {\r\n if (!this.parent) {\r\n return 0;\r\n }\r\n else {\r\n return this.parent.depth + 1;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataItem.prototype, \"dataContext\", {\r\n /**\r\n * Sets to a reference to an original object from Component's data.\r\n *\r\n * @return [description]\r\n */\r\n get: function () {\r\n return this._dataContext;\r\n },\r\n /**\r\n * A reference to an original object in Component's data, that this Data Item\r\n * is derived from.\r\n *\r\n * @param value Original data object\r\n */\r\n set: function (value) {\r\n this._dataContext = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * adds a sprite to dataItem.sprites array\r\n * @ignore\r\n */\r\n DataItem.prototype.addSprite = function (sprite) {\r\n if (sprite.dataItem && sprite.dataItem != this) {\r\n $array.remove(sprite.dataItem.sprites, sprite);\r\n }\r\n if (!this.visible) {\r\n sprite.hide(0);\r\n }\r\n if (this.isHiding) {\r\n sprite.hide();\r\n }\r\n this.sprites.push(sprite);\r\n sprite.dataItem = this;\r\n };\r\n return DataItem;\r\n}(BaseObjectEvents));\r\nexport { DataItem };\r\n//# sourceMappingURL=DataItem.js.map","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"./Container\";\r\nimport { List, ListDisposer } from \"./utils/List\";\r\nimport { OrderedListTemplate } from \"./utils/SortedList\";\r\nimport { Dictionary } from \"./utils/Dictionary\";\r\nimport { Disposer, MultiDisposer } from \"./utils/Disposer\";\r\nimport { DataSource } from \"./data/DataSource\";\r\nimport { Responsive } from \"./utils/Responsive\";\r\nimport { system } from \"./System\";\r\nimport { DataItem } from \"./DataItem\";\r\nimport { registry } from \"./Registry\";\r\nimport * as $math from \"./utils/Math\";\r\nimport * as $array from \"./utils/Array\";\r\nimport * as $ease from \"./utils/Ease\";\r\nimport * as $utils from \"./utils/Utils\";\r\nimport * as $iter from \"./utils/Iterator\";\r\nimport * as $object from \"./utils/Object\";\r\nimport * as $type from \"./utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A Component represents an independent functional element or control, that\r\n * can have it's own behavior, children, data, etc.\r\n *\r\n * A few examples of a Component: [[Legend]], [[Series]], [[Scrollbar]].\r\n *\r\n * @see {@link IComponentEvents} for a list of available events\r\n * @see {@link IComponentAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar Component = /** @class */ (function (_super) {\r\n __extends(Component, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Component() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * Holds data field names.\r\n *\r\n * Data fields define connection beween [[DataItem]] and actual properties\r\n * in raw data.\r\n */\r\n _this.dataFields = {};\r\n /**\r\n * A list of [[DataSource]] definitions of external data source.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._dataSources = {};\r\n /**\r\n * This is used when only new data is invalidated (if added using `addData`\r\n * method).\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._parseDataFrom = 0;\r\n /**\r\n * Holds the disposers for the dataItems and dataUsers\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._dataDisposers = [];\r\n /**\r\n * Currently selected \"data set\".\r\n *\r\n * If it's set to `\"\"`, main data set (unaggregated data) is used.\r\n */\r\n _this._currentDataSetId = \"\";\r\n /**\r\n * [_start description]\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._start = 0;\r\n /**\r\n * [_end description]\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._end = 1;\r\n /**\r\n * If set to `true`, changing data range in element will not trigger\r\n * `daterangechanged` event.\r\n */\r\n _this.skipRangeEvent = false;\r\n /**\r\n * Whenever selected scope changes (chart is zoomed or panned), for example\r\n * by interaction from a Scrollbar, or API, a chart needs to reposition\r\n * its contents.\r\n *\r\n * `rangeChangeDuration` influences how this is performed.\r\n *\r\n * If set to zero (0), the change will happen instantenously.\r\n *\r\n * If set to non-zero value, the chart will gradually animate into new\r\n * position for the set amount of milliseconds.\r\n *\r\n * @default 0\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n */\r\n _this.rangeChangeDuration = 0;\r\n /**\r\n * An easing function to use for range change animation.\r\n *\r\n * @see {@link Ease}\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n */\r\n _this.rangeChangeEasing = $ease.cubicOut;\r\n /**\r\n * A duration (ms) of each data parsing step. A Component parses its data in\r\n * chunks in order to avoid completely freezing the machine when large data\r\n * sets are used. This setting will control how many milliseconds should pass\r\n * when parsing data until parser stops for a brief moment to let other\r\n * processes catch up.\r\n */\r\n _this.parsingStepDuration = 50;\r\n /**\r\n * [dataInvalid description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n _this.dataInvalid = false;\r\n /**\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this.rawDataInvalid = false;\r\n /**\r\n * [dataRangeInvalid description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n _this.dataRangeInvalid = false;\r\n /**\r\n * [dataItemsInvalid description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n _this.dataItemsInvalid = false;\r\n /**\r\n * If set to a non-zero number the element will \"animate\" data values of its\r\n * children.\r\n *\r\n * This will happen on first load and whenever data values change.\r\n *\r\n * Enabling interpolation will mean that elements will transit smoothly into\r\n * new values rather than updating instantly.\r\n *\r\n * @default 0\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n */\r\n _this.interpolationDuration = 0;\r\n /**\r\n * An easing function to use for interpolating values when transiting from\r\n * one source value to another.\r\n *\r\n * @default cubicOut\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n * @see {@link Ease}\r\n */\r\n _this.interpolationEasing = $ease.cubicOut;\r\n /**\r\n * Indicates whether transition between data item's values should start and\r\n * play out all at once, or with a small delay (as defined by\r\n * `sequencedInterpolationDelay`) for each subsequent data item.\r\n *\r\n * @default true\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n */\r\n _this.sequencedInterpolation = true;\r\n /**\r\n * A delay (ms) to wait between animating each subsequent data item's\r\n * interpolation animation.\r\n *\r\n * Relative only if `sequencedInterpolation = true`.\r\n *\r\n * @default 0\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n */\r\n _this.sequencedInterpolationDelay = 0;\r\n /**\r\n * A progress (0-1) for the data validation process.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this.dataValidationProgress = 0;\r\n _this._addAllDataItems = true;\r\n _this._usesData = true;\r\n _this.className = \"Component\";\r\n _this.minZoomCount = 1;\r\n _this.maxZoomCount = 0;\r\n _this._dataItems = new OrderedListTemplate(_this.createDataItem());\r\n _this._dataItems.events.on(\"inserted\", _this.handleDataItemAdded, _this, false);\r\n _this._dataItems.events.on(\"removed\", _this.handleDataItemRemoved, _this, false);\r\n _this._disposers.push(new ListDisposer(_this._dataItems));\r\n _this._disposers.push(_this._dataItems.template);\r\n _this.invalidateData();\r\n // TODO what about remove ?\r\n _this.dataUsers.events.on(\"inserted\", _this.handleDataUserAdded, _this, false);\r\n // Set up disposers\r\n _this._disposers.push(new MultiDisposer(_this._dataDisposers));\r\n _this._start = 0;\r\n _this._end = 1;\r\n _this.maxZoomDeclination = 1;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Returns a new/empty DataItem of the type appropriate for this object.\r\n *\r\n * @see {@link DataItem}\r\n * @return Data Item\r\n */\r\n Component.prototype.createDataItem = function () {\r\n return new DataItem();\r\n };\r\n /**\r\n * [handleDataUserAdded description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param event Event object\r\n */\r\n Component.prototype.handleDataUserAdded = function (event) {\r\n var dataUser = event.newValue;\r\n dataUser.dataProvider = this;\r\n };\r\n /**\r\n * [handleDataItemValueChange description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n Component.prototype.handleDataItemValueChange = function (dataItem, name) {\r\n if (!this.dataItemsInvalid) {\r\n this.invalidateDataItems();\r\n }\r\n };\r\n /**\r\n * [handleDataItemWorkingValueChange description]\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.handleDataItemWorkingValueChange = function (dataItem, name) {\r\n };\r\n /**\r\n * [handleDataItemWorkingLocationChange description]\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.handleDataItemWorkingLocationChange = function (dataItem, name) {\r\n };\r\n /**\r\n * [handleDataItemCalculatedValueChange description]\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.handleDataItemCalculatedValueChange = function (dataItem, name) {\r\n };\r\n /**\r\n * [handleDataItemPropertyChange description]\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.handleDataItemPropertyChange = function (dataItem, name) {\r\n };\r\n /**\r\n * Populates a [[DataItem]] width data from data source.\r\n *\r\n * Loops through all the fields and if such a field is found in raw data\r\n * object, a corresponding value on passed in `dataItem` is set.\r\n *\r\n * @ignore Exclude from docs\r\n * @param item\r\n */\r\n Component.prototype.processDataItem = function (dataItem, dataContext) {\r\n var _this = this;\r\n if (dataItem) {\r\n if (!dataContext) {\r\n dataContext = {};\r\n }\r\n // store reference to original data item\r\n dataItem.dataContext = dataContext;\r\n var hasSomeValues_1 = false;\r\n $object.each(this.dataFields, function (key, fieldValue) {\r\n var fieldName = key;\r\n var value = dataContext[fieldValue];\r\n // Apply adapters to a retrieved value\r\n if (_this._adapterO) {\r\n if (_this._adapterO.isEnabled(\"dataContextValue\")) {\r\n value = _this._adapterO.apply(\"dataContextValue\", {\r\n field: fieldName,\r\n value: value,\r\n dataItem: dataItem\r\n }).value;\r\n }\r\n }\r\n if ($type.hasValue(value)) {\r\n hasSomeValues_1 = true;\r\n if (dataItem.hasChildren[fieldName]) {\r\n var template = _this.createDataItem();\r\n template.copyFrom(_this.mainDataSet.template);\r\n var children = new OrderedListTemplate(template);\r\n children.events.on(\"inserted\", _this.handleDataItemAdded, _this, false);\r\n children.events.on(\"removed\", _this.handleDataItemRemoved, _this, false);\r\n _this._dataDisposers.push(new ListDisposer(children));\r\n var count = value.length;\r\n for (var i = 0; i < count; i++) {\r\n var rawDataItem = value[i];\r\n var childDataItem = children.create();\r\n childDataItem.parent = dataItem;\r\n _this.processDataItem(childDataItem, rawDataItem);\r\n }\r\n var anyDataItem = dataItem;\r\n anyDataItem[fieldName] = children;\r\n }\r\n else {\r\n // data is converted to numbers/dates in each dataItem\r\n dataItem[fieldName] = value;\r\n }\r\n }\r\n });\r\n $object.each(this.propertyFields, function (key, fieldValue) {\r\n var f = key;\r\n var value = dataContext[fieldValue];\r\n if ($type.hasValue(value)) {\r\n hasSomeValues_1 = true;\r\n dataItem.setProperty(f, value);\r\n }\r\n });\r\n // @todo we might need some flag which would tell whether we should create empty data items or not.\r\n if (!this._addAllDataItems && !hasSomeValues_1) {\r\n this.mainDataSet.remove(dataItem);\r\n }\r\n }\r\n };\r\n /**\r\n *\r\n * When validating raw data, instead of processing data item, we update it\r\n *\r\n * @ignore Exclude from docs\r\n * @param item\r\n */\r\n Component.prototype.updateDataItem = function (dataItem) {\r\n var _this = this;\r\n if (dataItem) {\r\n var dataContext_1 = dataItem.dataContext;\r\n $object.each(this.dataFields, function (key, fieldValue) {\r\n var fieldName = key;\r\n var value = dataContext_1[fieldValue];\r\n // Apply adapters to a retrieved value\r\n if (_this._adapterO) {\r\n value = _this._adapterO.apply(\"dataContextValue\", {\r\n field: fieldName,\r\n value: value,\r\n dataItem: dataItem\r\n }).value;\r\n }\r\n if ($type.hasValue(value)) {\r\n if (dataItem.hasChildren[fieldName]) {\r\n var anyDataItem = dataItem;\r\n var children = (anyDataItem[fieldName]);\r\n children.each(function (child) {\r\n _this.updateDataItem(child);\r\n });\r\n }\r\n else {\r\n // data is converted to numbers/dates in each dataItem\t\t\t\t\t\r\n dataItem[fieldName] = value;\r\n }\r\n }\r\n });\r\n $object.each(this.propertyFields, function (key, fieldValue) {\r\n var f = key;\r\n var value = dataContext_1[fieldValue];\r\n if ($type.hasValue(value)) {\r\n dataItem.setProperty(f, value);\r\n }\r\n });\r\n }\r\n };\r\n /**\r\n * [validateDataElements description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n Component.prototype.validateDataElements = function () {\r\n var count = this.endIndex;\r\n for (var i = this.startIndex; i < count; i++) {\r\n var dataItem = this.dataItems.getIndex(i);\r\n // TODO is this correct\r\n if (dataItem) {\r\n this.validateDataElement(dataItem);\r\n }\r\n }\r\n };\r\n /**\r\n * Validates this element and its related elements.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.validate = function () {\r\n this.validateDataElements();\r\n _super.prototype.validate.call(this);\r\n };\r\n /**\r\n * [validateDataElement description]\r\n *\r\n * @ignore Exclude from docs\r\n * @param dataItem [description]\r\n */\r\n Component.prototype.validateDataElement = function (dataItem) {\r\n };\r\n /**\r\n * Adds one or several (array) of data items to the existing data.\r\n *\r\n * @param rawDataItem One or many raw data item objects\r\n */\r\n Component.prototype.addData = function (rawDataItem, removeCount, skipRaw) {\r\n var _this = this;\r\n // need to check if data is invalid, as addData might be called multiple times\r\n if (!this.dataInvalid && this.inited) {\r\n this._parseDataFrom = this.data.length; // save length of parsed data\r\n }\r\n if (!skipRaw) {\r\n if (rawDataItem instanceof Array) {\r\n // can't use concat because new array is returned\r\n $array.each(rawDataItem, function (dataItem) {\r\n _this.data.push(dataItem);\r\n });\r\n }\r\n else {\r\n this.data.push(rawDataItem); // add to raw data array\r\n }\r\n }\r\n if (this.inited) {\r\n this.removeData(removeCount, skipRaw);\r\n }\r\n else {\r\n if ($type.isNumber(removeCount)) {\r\n while (removeCount > 0) {\r\n this.data.shift();\r\n removeCount--;\r\n }\r\n }\r\n }\r\n this.invalidateData();\r\n };\r\n /**\r\n * Removes elements from the beginning of data\r\n *\r\n * @param count number of elements to remove\r\n */\r\n Component.prototype.removeData = function (count, skipRaw) {\r\n if ($type.isNumber(count) && count > 0) {\r\n while (count > 0) {\r\n var dataItem = this.mainDataSet.getIndex(0);\r\n if (dataItem) {\r\n this.mainDataSet.remove(dataItem);\r\n }\r\n this.dataUsers.each(function (dataUser) {\r\n if (!dataUser.data || dataUser.data.length == 0) {\r\n var dataItem_1 = dataUser.mainDataSet.getIndex(0);\r\n if (dataItem_1) {\r\n dataUser.mainDataSet.remove(dataItem_1);\r\n }\r\n }\r\n });\r\n if (!skipRaw) {\r\n this.data.shift();\r\n }\r\n if (this._parseDataFrom > 0) {\r\n this._parseDataFrom--;\r\n }\r\n count--;\r\n }\r\n // changed from invalidateData since 4.7.19 to solve #51551\r\n this.invalidateDataItems();\r\n }\r\n };\r\n /**\r\n * Triggers a data (re)parsing.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.invalidateData = function () {\r\n if (this.disabled || this.isTemplate) {\r\n return;\r\n }\r\n //if(!this.dataInvalid){\r\n registry.addToInvalidComponents(this);\r\n system.requestFrame();\r\n this.dataInvalid = true;\r\n $iter.each(this.dataUsers.iterator(), function (x) {\r\n x.invalidateDataItems();\r\n });\r\n //}\r\n };\r\n /**\r\n * [invalidateDataUsers description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n Component.prototype.invalidateDataUsers = function () {\r\n $iter.each(this.dataUsers.iterator(), function (x) {\r\n x.invalidate();\r\n });\r\n };\r\n /**\r\n * Invalidates data values. When data array is not changed, but values within\r\n * it changes, we invalidate data so that component would process changes.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.invalidateDataItems = function () {\r\n if (this.disabled || this.isTemplate) {\r\n return;\r\n }\r\n //if(!this.dataItemsInvalid){\r\n $array.move(registry.invalidDataItems, this);\r\n system.requestFrame();\r\n this.dataItemsInvalid = true;\r\n $iter.each(this.dataUsers.iterator(), function (x) {\r\n x.invalidateDataItems();\r\n });\r\n //}\r\n };\r\n /**\r\n * Invalidates data range. This is done when data which must be shown\r\n * changes (chart is zoomed for example).\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.invalidateDataRange = function () {\r\n if (this.disabled || this.isTemplate) {\r\n return;\r\n }\r\n //if(!this.dataRangeInvalid){\r\n this.dataRangeInvalid = true;\r\n $array.move(registry.invalidDataRange, this);\r\n system.requestFrame();\r\n //}\r\n };\r\n /**\r\n * Processes data range.\r\n *\r\n * @todo Description\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.validateDataRange = function () {\r\n $array.remove(registry.invalidDataRange, this);\r\n this.dataRangeInvalid = false;\r\n if (this.startIndex != this._prevStartIndex || this.endIndex != this._prevEndIndex) {\r\n this.rangeChangeUpdate();\r\n this.appendDataItems();\r\n this.invalidate();\r\n this.dispatchImmediately(\"datarangechanged\");\r\n }\r\n };\r\n /**\r\n * [sliceData description]\r\n *\r\n * @todo Description\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.sliceData = function () {\r\n this._workingStartIndex = this.startIndex;\r\n this._workingEndIndex = this.endIndex;\r\n };\r\n /**\r\n * [rangeChangeUpdate description]\r\n *\r\n * @todo Description\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.rangeChangeUpdate = function () {\r\n this.sliceData();\r\n this._prevStartIndex = this.startIndex;\r\n this._prevEndIndex = this.endIndex;\r\n };\r\n /**\r\n * [appendDataItems description]\r\n *\r\n * @todo Description\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.appendDataItems = function () {\r\n // TODO use an iterator instead\r\n var count = this.endIndex;\r\n for (var i = this.startIndex; i < count; i++) {\r\n // data item\r\n var dataItem = this.dataItems.getIndex(i);\r\n if (dataItem) {\r\n dataItem.__disabled = false;\r\n }\r\n }\r\n for (var i = 0; i < this.startIndex; i++) {\r\n var dataItem = this.dataItems.getIndex(i);\r\n if (dataItem) {\r\n dataItem.__disabled = true;\r\n }\r\n }\r\n for (var i = this.endIndex; i < this.dataItems.length; i++) {\r\n var dataItem = this.dataItems.getIndex(i);\r\n if (dataItem) {\r\n dataItem.__disabled = true;\r\n }\r\n }\r\n };\r\n /**\r\n * If you want to have a smooth transition from one data values to another, you change your raw data and then you must call this method.\r\n * then instead of redrawing everything, the chart will check raw data and smoothly transit from previous to new data\r\n */\r\n Component.prototype.invalidateRawData = function () {\r\n if (this.disabled || this.isTemplate) {\r\n return;\r\n }\r\n //if(!this.rawDataInvalid){\r\n $array.move(registry.invalidRawDatas, this);\r\n system.requestFrame();\r\n this.rawDataInvalid = true;\r\n $iter.each(this.dataUsers.iterator(), function (x) {\r\n x.invalidateRawData();\r\n });\r\n //}\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Component.prototype.validateRawData = function () {\r\n var _this = this;\r\n $array.remove(registry.invalidRawDatas, this);\r\n $iter.each(this.mainDataSet.iterator(), function (dataItem) {\r\n if (dataItem) {\r\n _this.updateDataItem(dataItem);\r\n }\r\n });\r\n };\r\n /**\r\n * Destroys this object and all related data.\r\n */\r\n Component.prototype.dispose = function () {\r\n var _this = this;\r\n this.mainDataSet.template.clones.clear();\r\n $object.each(this._dataSources, function (key, source) {\r\n _this.removeDispose(source);\r\n });\r\n this.disposeData();\r\n _super.prototype.dispose.call(this);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Component.prototype.disposeData = function () {\r\n this.mainDataSet.template.clones.clear();\r\n $array.each(this._dataDisposers, function (x) {\r\n x.dispose();\r\n });\r\n // and for all components\r\n $iter.each(this.dataUsers.iterator(), function (dataUser) {\r\n dataUser.disposeData();\r\n });\r\n this._dataDisposers.length = 0;\r\n this._startIndex = undefined;\r\n this._endIndex = undefined;\r\n // dispose old\r\n this.mainDataSet.clear();\r\n this.mainDataSet.template.clones.clear();\r\n if (this._dataSets) {\r\n this._dataSets.clear();\r\n }\r\n };\r\n Component.prototype.getDataItem = function (dataContext) {\r\n return this.mainDataSet.create();\r\n };\r\n /**\r\n * Validates (processes) data.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.validateData = function () {\r\n this.dispatchImmediately(\"beforedatavalidated\");\r\n this.dataInvalid = false;\r\n registry.removeFromInvalidComponents(this);\r\n if (this.__disabled) {\r\n return;\r\n }\r\n this.dataValidationProgress = 0;\r\n // need this to slice new data\r\n this._prevStartIndex = undefined;\r\n this._prevEndIndex = undefined;\r\n // todo: this needs some overthinking, maybe some extra settings like zoomOotonDataupdate like in v3 or so. some charts like pie chart probably should act like this always\r\n this._startIndex = undefined;\r\n this._endIndex = undefined;\r\n if (this.dataFields.data && this.dataItem) {\r\n var dataContext = this.dataItem.dataContext;\r\n this._data = dataContext[this.dataFields.data];\r\n }\r\n // data items array is reset only if all data is validated, if _parseDataFrom is not 0, we append new data only\r\n // check heatmap demo if uncommented\r\n // fixed both issues by adding && this.data.length > 0\r\n // check adding series example if changed\r\n if (this._parseDataFrom === 0 && this.data.length > 0) {\r\n this.disposeData();\r\n }\r\n if (this.data.length > 0) {\r\n var preloader = this.preloader;\r\n // and for all components\r\n $iter.each(this.dataUsers.iterator(), function (dataUser) {\r\n // todo: this needs some overthinking, maybe some extra settings like zoomOUtonDataupdate like in v3 or so. some charts like pie chart probably should act like this always\r\n dataUser._startIndex = undefined;\r\n dataUser._endIndex = undefined;\r\n });\r\n var counter = 0;\r\n var startTime = Date.now();\r\n // parse data\r\n var i = this._parseDataFrom;\r\n var n = this.data.length;\r\n var _loop_1 = function () {\r\n var rawDataItem = this_1.data[i];\r\n if (this_1._usesData) {\r\n var dataItem = this_1.getDataItem(rawDataItem);\r\n this_1.processDataItem(dataItem, rawDataItem);\r\n }\r\n this_1.dataUsers.each(function (dataUser) {\r\n if (dataUser.data.length == 0) { // checking if data is not set directly\r\n var dataUserDataItem = dataUser.getDataItem(rawDataItem);\r\n dataUser.processDataItem(dataUserDataItem, rawDataItem);\r\n }\r\n });\r\n counter++;\r\n // show preloader if this takes too many time\r\n if (counter == 100) { // no need to check it on each data item\r\n counter = 0;\r\n var elapsed = Date.now() - startTime;\r\n if (elapsed > this_1.parsingStepDuration) {\r\n if (i < this_1.data.length - 10) {\r\n this_1._parseDataFrom = i + 1;\r\n // update preloader\r\n if (preloader) {\r\n if (i / this_1.data.length > 0.5 && !preloader.visible) {\r\n // do not start showing\r\n }\r\n else {\r\n preloader.progress = i / this_1.data.length;\r\n }\r\n }\r\n this_1.dataValidationProgress = i / this_1.data.length;\r\n i = this_1.data.length; // stops cycle\r\n this_1.invalidateData();\r\n return { value: void 0 };\r\n }\r\n }\r\n }\r\n };\r\n var this_1 = this;\r\n for (i; i < n; i++) {\r\n var state_1 = _loop_1();\r\n if (typeof state_1 === \"object\")\r\n return state_1.value;\r\n }\r\n if (preloader) {\r\n preloader.progress = 1;\r\n }\r\n this.dataUsers.each(function (dataUser) {\r\n if (dataUser.hidden || (dataUser.appeared && !dataUser.visible && dataUser.stacked)) {\r\n dataUser.hide(0);\r\n }\r\n });\r\n }\r\n this.dataValidationProgress = 1;\r\n this._parseDataFrom = 0; // reset this index, it is set to dataItems.length if addData() method was used.\r\n this.invalidateDataItems();\r\n if (!this._internalDefaultsApplied) {\r\n this.applyInternalDefaults();\r\n }\r\n this.dispatch(\"datavalidated\"); // can't zoom chart if dispatched immediately\r\n };\r\n /**\r\n * Validates (processes) data items.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.validateDataItems = function () {\r\n $array.remove(registry.invalidDataItems, this);\r\n this.dataItemsInvalid = false;\r\n this.invalidateDataRange();\r\n this.invalidate();\r\n this.dispatch(\"dataitemsvalidated\");\r\n };\r\n Object.defineProperty(Component.prototype, \"data\", {\r\n /**\r\n * Returns element's source (raw) data.\r\n *\r\n * @return Data\r\n */\r\n get: function () {\r\n if (!this._data) {\r\n this._data = [];\r\n }\r\n if (!this._adapterO) {\r\n return this._data;\r\n }\r\n else {\r\n return this._adapterO.apply(\"data\", this._data);\r\n }\r\n },\r\n /**\r\n * Sets source (raw) data for the element. The \"data\" is always an `Array`\r\n * of objects.\r\n *\r\n * IMPORTANT: The order of data items in `data` array is important as it\r\n * might affect chart look and behavior. [More details](https://www.amcharts.com/docs/v4/concepts/data/#Order_of_data_items).\r\n *\r\n * @param value Data\r\n */\r\n set: function (value) {\r\n this.setData(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Component.prototype.setData = function (value) {\r\n // array might be the same, but there might be items added\r\n // todo: check if array changed, toString maybe?\r\n if (!this.isDisposed()) {\r\n this._parseDataFrom = 0;\r\n this.disposeData();\r\n this._data = value;\r\n if (value && value.length > 0) {\r\n this.invalidateData();\r\n }\r\n else {\r\n this.dispatchImmediately(\"beforedatavalidated\");\r\n this.dispatch(\"datavalidated\");\r\n }\r\n }\r\n };\r\n /**\r\n * Returns (creates if necessary) a [[DataSource]] bound to any specific\r\n * property.\r\n *\r\n * For example if I want to bind `data` to an external JSON file, I'd create\r\n * a DataSource for it.\r\n *\r\n * @param property Property to bind external data to\r\n * @return A DataSource for property\r\n */\r\n Component.prototype.getDataSource = function (property) {\r\n var _this = this;\r\n if (!$type.hasValue(this._dataSources[property])) {\r\n this._dataSources[property] = new DataSource();\r\n this._dataSources[property].component = this;\r\n this.setDataSourceEvents(this._dataSources[property], property);\r\n this._dataSources[property].adapter.add(\"dateFields\", function (val) {\r\n return _this.dataSourceDateFields(val);\r\n });\r\n this._dataSources[property].adapter.add(\"numberFields\", function (val) {\r\n return _this.dataSourceNumberFields(val);\r\n });\r\n this.events.on(\"inited\", function () {\r\n _this.loadData(property);\r\n }, this, false);\r\n }\r\n return this._dataSources[property];\r\n };\r\n Object.defineProperty(Component.prototype, \"dataSource\", {\r\n /**\r\n * @return Data source\r\n */\r\n get: function () {\r\n if (!this._dataSources[\"data\"]) {\r\n this.getDataSource(\"data\");\r\n }\r\n return this._dataSources[\"data\"];\r\n },\r\n /**\r\n *A [[DataSource]] to be used for loading Component's data.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/loading-external-data/} for more on loading external data\r\n * @param value Data source\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n if (this._dataSources[\"data\"]) {\r\n this.removeDispose(this._dataSources[\"data\"]);\r\n }\r\n this._dataSources[\"data\"] = value;\r\n this._dataSources[\"data\"].component = this;\r\n this.events.on(\"inited\", function () {\r\n _this.loadData(\"data\");\r\n }, this, false);\r\n this.setDataSourceEvents(value, \"data\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Initiates loading of the external data via [[DataSource]].\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.loadData = function (property) {\r\n this._dataSources[property].load();\r\n };\r\n /**\r\n * This function is called by the [[DataSource]]'s `dateFields` adapater\r\n * so that particular chart types can popuplate this setting with their\r\n * own type-specific data fields so they are parsed properly.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Array of date fields\r\n * @return Array of date fields populated with chart's date fields\r\n */\r\n Component.prototype.dataSourceDateFields = function (value) {\r\n return value;\r\n };\r\n /**\r\n * This function is called by the [[DataSource]]'s `numberFields` adapater\r\n * so that particular chart types can popuplate this setting with their\r\n * own type-specific data fields so they are parsed properly.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Array of number fields\r\n * @return Array of number fields populated with chart's number fields\r\n */\r\n Component.prototype.dataSourceNumberFields = function (value) {\r\n return value;\r\n };\r\n /**\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param list [description]\r\n * @param dataFields [description]\r\n * @param targetList [description]\r\n * @return [description]\r\n */\r\n Component.prototype.populateDataSourceFields = function (list, dataFields, targetList) {\r\n $array.each(targetList, function (value) {\r\n if (dataFields[value] && $array.indexOf(list, dataFields[value]) === -1) {\r\n list.push(dataFields[value]);\r\n }\r\n });\r\n return list;\r\n };\r\n /**\r\n * Sets events on a [[DataSource]].\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.setDataSourceEvents = function (ds, property) {\r\n var _this = this;\r\n ds.events.on(\"started\", function (ev) {\r\n var preloader = _this.preloader;\r\n if (preloader) {\r\n preloader.progress = 0;\r\n //preloader.label.text = this.language.translate(\"Loading\");\r\n }\r\n }, undefined, false);\r\n ds.events.on(\"loadstarted\", function (ev) {\r\n var preloader = _this.preloader;\r\n if (preloader) {\r\n preloader.progress = 0.25;\r\n }\r\n }, undefined, false);\r\n ds.events.on(\"loadended\", function (ev) {\r\n var preloader = _this.preloader;\r\n if (preloader) {\r\n preloader.progress = 0.5;\r\n }\r\n }, undefined, false);\r\n ds.events.on(\"parseended\", function (ev) {\r\n var preloader = _this.preloader;\r\n if (preloader) {\r\n preloader.progress = 0.75;\r\n }\r\n }, undefined, false);\r\n ds.events.on(\"ended\", function (ev) {\r\n var preloader = _this.preloader;\r\n if (preloader) {\r\n preloader.progress = 1;\r\n }\r\n }, undefined, false);\r\n ds.events.on(\"error\", function (ev) {\r\n var preloader = _this.preloader;\r\n if (preloader) {\r\n preloader.progress = 1;\r\n }\r\n _this.openModal(ev.message);\r\n }, undefined, false);\r\n if (property) {\r\n ds.events.on(\"done\", function (ev) {\r\n var preloader = _this.preloader;\r\n if (preloader) {\r\n preloader.progress = 1;\r\n }\r\n if (property == \"data\" && !$type.isArray(ev.data)) {\r\n ev.data = [ev.data];\r\n }\r\n if (ds.incremental && property == \"data\" && _this.data.length) {\r\n _this.addData(ev.data, ds.keepCount ? ev.data.length : 0);\r\n }\r\n else if (ds.updateCurrentData && property == \"data\" && _this.data.length) {\r\n // cycle through existing data items\r\n $array.each(_this.data, function (item, index) {\r\n if ($type.hasValue(ev.data[index])) {\r\n $object.each(item, function (key, val) {\r\n if ($type.hasValue(ev.data[index][key])) {\r\n item[key] = ev.data[index][key];\r\n }\r\n });\r\n }\r\n });\r\n _this.invalidateRawData();\r\n }\r\n else {\r\n _this[property] = ev.data;\r\n }\r\n });\r\n }\r\n };\r\n Object.defineProperty(Component.prototype, \"responsive\", {\r\n /**\r\n * @return Responsive rules handler\r\n */\r\n get: function () {\r\n if (!this._responsive) {\r\n this._responsive = new Responsive();\r\n this._responsive.component = this;\r\n }\r\n return this._responsive;\r\n },\r\n /**\r\n * A [[Responsive]] instance to be used when applying conditional\r\n * property values.\r\n *\r\n * NOTE: Responsive features are currently in development and may not work\r\n * as expected, if at all.\r\n *\r\n * @param value Responsive rules handler\r\n */\r\n set: function (value) {\r\n this._responsive = value;\r\n this._responsive.component = this;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets current zoom.\r\n *\r\n * The range uses relative values from 0 to 1, with 0 marking beginning and 1\r\n * marking end of the available data range.\r\n *\r\n * This method will not have any effect when called on a chart object.\r\n * Since the chart can have a number of axes and series, each with its own\r\n * data, the meaning of \"range\" is very ambiguous.\r\n *\r\n * To zoom the chart use `zoom*` methods on its respective axes.\r\n *\r\n * @param range Range\r\n * @param skipRangeEvent Should rangechanged event not be triggered?\r\n * @param instantly Do not animate?\r\n * @return Actual modidied range (taking `maxZoomFactor` into account)\r\n */\r\n Component.prototype.zoom = function (range, skipRangeEvent, instantly, declination) {\r\n var _this = this;\r\n if (skipRangeEvent === void 0) { skipRangeEvent = false; }\r\n if (instantly === void 0) { instantly = false; }\r\n var start = range.start;\r\n var end = range.end;\r\n var priority = range.priority;\r\n if (range.start == range.end) {\r\n range.start = range.start - 0.5 / this.maxZoomFactor;\r\n range.end = range.end + 0.5 / this.maxZoomFactor;\r\n }\r\n if (priority == \"end\" && end == 1 && start != 0) {\r\n if (start < this.start) {\r\n priority = \"start\";\r\n }\r\n }\r\n if (priority == \"start\" && start == 0) {\r\n if (end > this.end) {\r\n priority = \"end\";\r\n }\r\n }\r\n if (!$type.isNumber(declination)) {\r\n declination = this.maxZoomDeclination;\r\n }\r\n if (!$type.isNumber(start) || !$type.isNumber(end)) {\r\n return { start: this.start, end: this.end };\r\n }\r\n if (this._finalStart != start || this._finalEnd != end) {\r\n var maxZoomFactor = this.maxZoomFactor / this.minZoomCount;\r\n var minZoomFactor = this.maxZoomFactor / this.maxZoomCount;\r\n // most likely we are dragging left scrollbar grip here, so we tend to modify end\r\n if (priority == \"start\") {\r\n if (this.maxZoomCount > 0) {\r\n // add to the end\r\n if (1 / (end - start) < minZoomFactor) {\r\n end = start + 1 / minZoomFactor;\r\n }\r\n }\r\n // add to the end\r\n if (1 / (end - start) > maxZoomFactor) {\r\n end = start + 1 / maxZoomFactor;\r\n }\r\n //unless end is > 0\r\n if (end > 1 && end - start < 1 / maxZoomFactor) {\r\n //end = 1;\r\n start = end - 1 / maxZoomFactor;\r\n }\r\n }\r\n // most likely we are dragging right, so we modify left\r\n else {\r\n if (this.maxZoomCount > 0) {\r\n // add to the end\r\n if (1 / (end - start) < minZoomFactor) {\r\n start = end - 1 / minZoomFactor;\r\n }\r\n }\r\n // remove from start\r\n if (1 / (end - start) > maxZoomFactor) {\r\n if (start <= 0) {\r\n end = start + 1 / maxZoomFactor;\r\n }\r\n else {\r\n start = end - 1 / maxZoomFactor;\r\n }\r\n }\r\n if (start < 0 && end - start < 1 / maxZoomFactor) {\r\n //start = 0;\r\n end = start + 1 / maxZoomFactor;\r\n }\r\n }\r\n if (start < -declination) {\r\n start = -declination;\r\n }\r\n if (1 / (end - start) > maxZoomFactor) {\r\n end = start + 1 / maxZoomFactor;\r\n }\r\n if (end > 1 + declination) {\r\n end = 1 + declination;\r\n }\r\n if (1 / (end - start) > maxZoomFactor) {\r\n start = end - 1 / maxZoomFactor;\r\n }\r\n this._finalEnd = end;\r\n this._finalStart = start;\r\n this.skipRangeEvent = skipRangeEvent;\r\n this.dispatchImmediately(\"rangechangestarted\");\r\n if (this.rangeChangeDuration > 0 && !instantly) {\r\n // todo: maybe move this to Animation\r\n var rangeChangeAnimation = this.rangeChangeAnimation;\r\n if (rangeChangeAnimation && rangeChangeAnimation.progress < 1) {\r\n var options = rangeChangeAnimation.animationOptions;\r\n if (options.length > 1) {\r\n if (options[0].to == start && options[1].to == end) {\r\n return { start: start, end: end };\r\n }\r\n else {\r\n if (!rangeChangeAnimation.isDisposed()) {\r\n rangeChangeAnimation.stop();\r\n }\r\n }\r\n }\r\n }\r\n if (this.rangeChangeAnimation) {\r\n this.rangeChangeAnimation.kill();\r\n }\r\n rangeChangeAnimation = this.animate([{ property: \"start\", to: start }, { property: \"end\", to: end }], this.rangeChangeDuration, this.rangeChangeEasing);\r\n this.rangeChangeAnimation = rangeChangeAnimation;\r\n if (rangeChangeAnimation && !rangeChangeAnimation.isFinished()) {\r\n rangeChangeAnimation.events.on(\"animationended\", function () {\r\n _this.dispatchImmediately(\"rangechangeended\");\r\n });\r\n }\r\n else {\r\n this.dispatchImmediately(\"rangechangeended\");\r\n }\r\n }\r\n else {\r\n this.start = start;\r\n this.end = end;\r\n this.dispatch(\"rangechangeended\");\r\n }\r\n }\r\n return { start: start, end: end };\r\n };\r\n /**\r\n * Zooms to specific data items using their index in data.\r\n *\r\n * This method will not have any effect when called on a chart object.\r\n * Since the chart can have a number of axes and series, each with its own\r\n * data, the meaning of \"index\" is very ambiguous.\r\n *\r\n * To zoom the chart use `zoom*` methods on its respective axes.\r\n *\r\n * @param startIndex Index of the starting data item\r\n * @param endIndex Index of the ending data item\r\n * @param skipRangeEvent Should rangechanged event not be triggered?\r\n * @param instantly Do not animate?\r\n */\r\n Component.prototype.zoomToIndexes = function (startIndex, endIndex, skipRangeEvent, instantly) {\r\n if (!$type.isNumber(startIndex) || !$type.isNumber(endIndex)) {\r\n return;\r\n }\r\n var start = startIndex / this.dataItems.length;\r\n var end = endIndex / this.dataItems.length;\r\n this.zoom({ start: start, end: end }, skipRangeEvent, instantly);\r\n };\r\n Object.defineProperty(Component.prototype, \"zoomFactor\", {\r\n /**\r\n * A current zoom factor (0-1). 1 meaning fully zoomed out. (showing all of\r\n * the available data)\r\n *\r\n * @return Zoom factor\r\n */\r\n get: function () {\r\n return $math.fitToRange(1 / (this.end - this.start), 1, this.maxZoomFactor);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Component.prototype, \"maxZoomFactor\", {\r\n /**\r\n * @return Maximum zoomFactor\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"maxZoomFactor\");\r\n },\r\n /**\r\n * Max available `zoomFactor`.\r\n *\r\n * The element will not allow zoom to occur beyond this factor.\r\n *\r\n * [[DateAxis]] and [[CategoryAxis]] calculate this atutomatically so that\r\n * category axis could be zoomed to one category and date axis allows to be\r\n * zoomed up to one base interval.\r\n *\r\n * In case you want to restrict category or date axis to be zoomed to more\r\n * than one category or more than one base interval, use `minZoomCount`\r\n * property (set it to `> 1`).\r\n *\r\n * Default value of [[ValueAxis]]'s `maxZoomFactor` is `1000`.\r\n *\r\n * Feel free to modify it to allow bigger zoom or to restrict zooming.\r\n *\r\n * @param value Maximum zoomFactor\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"maxZoomFactor\", value)) {\r\n if (value == 1) {\r\n this.maxZoomDeclination = 0;\r\n }\r\n this.invalidateDataRange();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Component.prototype, \"maxZoomDeclination\", {\r\n /**\r\n * @ignore\r\n * @return Maximum zoom declination\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"maxZoomDeclination\");\r\n },\r\n /**\r\n * Max zoom declination.\r\n *\r\n * @ignore\r\n * @default 1\r\n * @param value Maximum zoom declination\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"maxZoomDeclination\", value)) {\r\n this.invalidateDataRange();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Component.prototype, \"startIndex\", {\r\n /**\r\n * Current starting index.\r\n *\r\n * @return Start index\r\n */\r\n get: function () {\r\n if (!$type.isNumber(this._startIndex)) {\r\n this._startIndex = 0;\r\n }\r\n return this._startIndex;\r\n },\r\n /**\r\n * Sets current starting index.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Start index\r\n */\r\n set: function (value) {\r\n this._startIndex = $math.fitToRange(Math.round(value), 0, this.dataItems.length);\r\n //this._workingStartIndex = this._startIndex; // not good, breaks adjusted working start index of line series\r\n this.start = this.indexToPosition(this._startIndex);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n * @todo:review description\r\n * returns item's relative position by the index of the item\r\n * @param index\r\n */\r\n Component.prototype.indexToPosition = function (index) {\r\n return index / this.dataItems.length;\r\n };\r\n Object.defineProperty(Component.prototype, \"endIndex\", {\r\n /**\r\n * Current ending index.\r\n *\r\n * @return End index\r\n */\r\n get: function () {\r\n var count = this.dataItems.length;\r\n if (!$type.isNumber(this._endIndex) || this._endIndex > count) {\r\n this._endIndex = count;\r\n }\r\n return this._endIndex;\r\n },\r\n /**\r\n * Sets current ending index.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value End index\r\n */\r\n set: function (value) {\r\n this._endIndex = $math.fitToRange(Math.round(value), 0, this.dataItems.length);\r\n //this._workingEndIndex = this._endIndex; // not good, breaks adjusted workingend index of line series\r\n this.end = this.indexToPosition(this._endIndex);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Component.prototype, \"start\", {\r\n /**\r\n * @return Start (0-1)\r\n */\r\n get: function () {\r\n if (!this._adapterO) {\r\n return this._start;\r\n }\r\n else {\r\n return this._adapterO.apply(\"start\", this._start);\r\n }\r\n },\r\n /**\r\n * Start of the current data range (zoom).\r\n *\r\n * These are relative values from 0 (beginning) to 1 (end).\r\n *\r\n * @param value Start (0-1)\r\n */\r\n set: function (value) {\r\n // value = $math.round(value, 10); not good\r\n //if (1 / (this.end - value) > this.maxZoomFactor) {\r\n //\tvalue = this.end - 1 / this.maxZoomFactor;\r\n //}\r\n if (this._start != value) {\r\n this._start = value;\r\n var startIndex = Math.max(0, Math.floor(this.dataItems.length * value) || 0);\r\n this._startIndex = Math.min(startIndex, this.dataItems.length);\r\n this.invalidateDataRange();\r\n this.invalidate();\r\n this.dispatchImmediately(\"startchanged\");\r\n this.dispatch(\"startendchanged\");\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Component.prototype, \"end\", {\r\n /**\r\n * @return End (0-1)\r\n */\r\n get: function () {\r\n if (!this._adapterO) {\r\n return this._end;\r\n }\r\n else {\r\n return this._adapterO.apply(\"end\", this._end);\r\n }\r\n },\r\n /**\r\n * End of the current data range (zoom).\r\n *\r\n * These are relative values from 0 (beginning) to 1 (end).\r\n *\r\n * @param value End (0-1)\r\n */\r\n set: function (value) {\r\n // value = $math.round(value, 10); // not good\r\n //if (1 / (value - this.start) > this.maxZoomFactor) {\r\n //\tvalue = 1 / this.maxZoomFactor + this.start;\r\n //}\r\n if (this._end != value) {\r\n this._end = value;\r\n this._endIndex = Math.min(this.dataItems.length, Math.ceil(this.dataItems.length * value) || 0);\r\n this.invalidateDataRange();\r\n this.invalidate();\r\n this.dispatchImmediately(\"endchanged\");\r\n this.dispatch(\"startendchanged\");\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * [removeFromInvalids description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n Component.prototype.removeFromInvalids = function () {\r\n _super.prototype.removeFromInvalids.call(this);\r\n registry.removeFromInvalidComponents(this);\r\n $array.remove(registry.invalidDataItems, this);\r\n $array.remove(registry.invalidDataRange, this);\r\n $array.remove(registry.invalidRawDatas, this);\r\n };\r\n Object.defineProperty(Component.prototype, \"dataItems\", {\r\n /**\r\n * Returns a list of source [[DataItem]] objects currently used in the chart.\r\n *\r\n * @return List of data items\r\n */\r\n get: function () {\r\n if (this._currentDataSetId != \"\") {\r\n var dataItems = this.dataSets.getKey(this._currentDataSetId);\r\n if (dataItems) {\r\n return dataItems;\r\n }\r\n }\r\n return this._dataItems;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Component.prototype, \"dataSets\", {\r\n /**\r\n * Holds data items for data sets (usually aggregated data).\r\n *\r\n * @ignore\r\n * @since 4.7.0\r\n * @return Data sets\r\n */\r\n get: function () {\r\n if (!this._dataSets) {\r\n this._dataSets = new Dictionary();\r\n }\r\n return this._dataSets;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Makes the chart use particular data set.\r\n *\r\n * If `id` is not provided or there is no such data set, main data will be\r\n * used.\r\n *\r\n * @ignore\r\n * @since 4.7.0\r\n * @param id Data set id\r\n */\r\n Component.prototype.setDataSet = function (id) {\r\n if (this._currentDataSetId != id) {\r\n var dataSet = this.dataSets.getKey(id);\r\n if (!dataSet) {\r\n if (this._currentDataSetId != \"\") {\r\n this.dataItems.each(function (dataItem) {\r\n dataItem.__disabled = true;\r\n });\r\n this._currentDataSetId = \"\";\r\n this.invalidateDataRange();\r\n this._prevStartIndex = undefined;\r\n this.dataItems.each(function (dataItem) {\r\n dataItem.__disabled = false;\r\n });\r\n return true;\r\n }\r\n }\r\n else {\r\n this.dataItems.each(function (dataItem) {\r\n dataItem.__disabled = true;\r\n });\r\n this._currentDataSetId = id;\r\n this.invalidateDataRange();\r\n this._prevStartIndex = undefined;\r\n this.dataItems.each(function (dataItem) {\r\n dataItem.__disabled = false;\r\n });\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n Object.defineProperty(Component.prototype, \"currentDataSetId\", {\r\n /**\r\n * Returns id of the currently used data set, or `undefined` if main data set\r\n * is in use.\r\n *\r\n * @since 4.7.0\r\n * @return Current data set id\r\n */\r\n get: function () {\r\n return this._currentDataSetId;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Component.prototype, \"mainDataSet\", {\r\n /**\r\n * Returns reference to \"main\" data set (unaggregated data as it was supplied\r\n * in `data`).\r\n *\r\n * @since 4.7.0\r\n * @return Main data set\r\n */\r\n get: function () {\r\n return this._dataItems;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Updates the indexes for the dataItems\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype._updateDataItemIndexes = function (startIndex) {\r\n var dataItems = this.mainDataSet.values;\r\n var length = dataItems.length;\r\n for (var i = startIndex; i < length; ++i) {\r\n dataItems[i]._index = i;\r\n }\r\n };\r\n /**\r\n * Processes newly added [[DataItem]] as well as triggers data re-validation.\r\n *\r\n * @ignore Exclude from docs\r\n * @param event [description]\r\n */\r\n Component.prototype.handleDataItemAdded = function (event) {\r\n event.newValue.component = this;\r\n this._updateDataItemIndexes(event.index);\r\n if (!this.dataItemsInvalid) {\r\n this.invalidateDataItems();\r\n }\r\n };\r\n /**\r\n * removes [[DataItem]] as well as triggers data re-validation.\r\n *\r\n * @ignore Exclude from docs\r\n * @param event [description]\r\n */\r\n Component.prototype.handleDataItemRemoved = function (event) {\r\n //\t\tevent.oldValue.component = undefined; // not good, as some items might be not removed from component lists\r\n this._updateDataItemIndexes(event.index);\r\n if (!this.dataItemsInvalid) {\r\n this.invalidateDataItems();\r\n }\r\n };\r\n /**\r\n * Binds a data element's field to a specific field in raw data.\r\n * For example, for the very basic column chart you'd want to bind a `value`\r\n * field to a field in data, such as `price`.\r\n *\r\n * Some more advanced Components, like [[CandlestickSeries]] need several\r\n * data fields bound to data, such as ones for open, high, low and close\r\n * values.\r\n *\r\n * @todo Example\r\n * @param field Field name\r\n * @param value Field name in data\r\n */\r\n Component.prototype.bindDataField = function (field, value) {\r\n this.dataFields[field] = value;\r\n this.invalidateDataRange();\r\n };\r\n /**\r\n * Invalidates processed data.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.invalidateProcessedData = function () {\r\n this.resetProcessedRange();\r\n this.invalidateDataRange();\r\n };\r\n /**\r\n * [resetProcessedRange description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n Component.prototype.resetProcessedRange = function () {\r\n this._prevEndIndex = null;\r\n this._prevStartIndex = null;\r\n };\r\n Object.defineProperty(Component.prototype, \"dataUsers\", {\r\n /**\r\n * Returns all other [[Component]] objects that are using this element's\r\n * data.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (review)\r\n * @return [description]\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._dataUsers) {\r\n this._dataUsers = new List();\r\n //this._disposers.push(new ListDisposer(this._dataUsers));\r\n // TODO better way of handling this? e.g. move into another module ?\r\n this._disposers.push(new Disposer(function () {\r\n // TODO clear the list ?\r\n $iter.each(_this._dataUsers.iterator(), function (x) {\r\n x.dispose();\r\n });\r\n }));\r\n }\r\n return this._dataUsers;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns a clone of this element.\r\n *\r\n * @return Clone\r\n */\r\n Component.prototype.clone = function () {\r\n var component = _super.prototype.clone.call(this);\r\n component.dataFields = $utils.copyProperties(this.dataFields, {});\r\n return component;\r\n };\r\n /**\r\n * Copies all parameters from another [[Component]].\r\n *\r\n * @param source Source Component\r\n */\r\n Component.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.data = source.data;\r\n this.sequencedInterpolation = source.sequencedInterpolation;\r\n this.sequencedInterpolationDelay = source.sequencedInterpolationDelay;\r\n this.interpolationDuration = source.interpolationDuration;\r\n this.interpolationEasing = source.interpolationEasing;\r\n };\r\n /**\r\n * Invalidates the whole element, including all its children, causing\r\n * complete re-parsing of data and redraw.\r\n *\r\n * Use sparingly!\r\n */\r\n Component.prototype.reinit = function () {\r\n this._inited = false;\r\n this.deepInvalidate();\r\n };\r\n /**\r\n * Add an adapter for data.\r\n *\r\n * @return Exporting\r\n */\r\n Component.prototype.getExporting = function () {\r\n var _export = _super.prototype.getExporting.call(this);\r\n if (!_export.adapter.has(\"data\", this._exportData, -1, this)) {\r\n _export.adapter.add(\"data\", this._exportData, -1, this);\r\n this.events.on(\"datavalidated\", function (ev) {\r\n _export.handleDataUpdated();\r\n });\r\n }\r\n return _export;\r\n };\r\n Component.prototype._exportData = function (arg) {\r\n arg.data = this.data;\r\n return arg;\r\n };\r\n Component.prototype.setDisabled = function (value) {\r\n var changed = _super.prototype.setDisabled.call(this, value);\r\n if (changed) {\r\n this.invalidateData();\r\n }\r\n return changed;\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Component.prototype.setShowOnInit = function (value) {\r\n if (value != this.getPropertyValue(\"showOnInit\")) {\r\n if (value && !this.inited && !this.hidden) {\r\n this._showOnInitDisposer2 = this.events.once(\"dataitemsvalidated\", this.hideInitially, this, false);\r\n this._disposers.push(this._showOnInitDisposer2);\r\n }\r\n else {\r\n if (this._showOnInitDisposer2) {\r\n this.removeDispose(this._showOnInitDisposer2);\r\n }\r\n }\r\n }\r\n // important order here\r\n _super.prototype.setShowOnInit.call(this, value);\r\n };\r\n Component.prototype.setBaseId = function (value) {\r\n if (value != this._baseId) {\r\n if (this.dataInvalid) {\r\n this.dataInvalid = false;\r\n registry.removeFromInvalidComponents(this);\r\n this._baseId = value;\r\n this.invalidateData();\r\n }\r\n }\r\n _super.prototype.setBaseId.call(this, value);\r\n };\r\n Object.defineProperty(Component.prototype, \"minZoomCount\", {\r\n /**\r\n * @return Min zoom count\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"minZoomCount\");\r\n },\r\n /**\r\n * Use this for [[CategoryAxis]] or [[DateAxis]].\r\n *\r\n * Allows restricting zoom in beyond certain number of categories or base\r\n * intervals.\r\n *\r\n * @default 1\r\n * @param value Min zoom count\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"minZoomCount\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Component.prototype, \"maxZoomCount\", {\r\n /**\r\n * @return Max zoom count\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"maxZoomCount\");\r\n },\r\n /**\r\n * Use this for [[CategoryAxis]] or [[DateAxis]].\r\n *\r\n * Limits how many categories or base intervals can be shown at the same\r\n * time.\r\n *\r\n * If there are more items in the chart, the chart will auto-zoom.\r\n *\r\n * @default 0 (no limit)\r\n * @since 4.6.2\r\n * @param value Max zoom count\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"maxZoomCount\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Called during the System.update method\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype._systemCheckIfValidate = function () {\r\n if (this.dataInvalid || (this.dataProvider && this.dataProvider.dataInvalid)) {\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n };\r\n /**\r\n * Adds easing functions to \"function\" fields.\r\n *\r\n * @param field Field name\r\n * @return Assign as function?\r\n */\r\n Component.prototype.asFunction = function (field) {\r\n return field == \"interpolationEasing\" || field == \"rangeChangeEasing\" || _super.prototype.asIs.call(this, field);\r\n };\r\n return Component;\r\n}(Container));\r\nexport { Component };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Component\"] = Component;\r\n//# sourceMappingURL=Component.js.map","/**\r\n * Text class deals with all text placed on chart.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../Container\";\r\nimport { registry } from \"../Registry\";\r\nimport { getTextFormatter } from \"../formatters/TextFormatter\";\r\nimport { MultiDisposer } from \"../utils/Disposer\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $dom from \"../utils/DOM\";\r\nimport { defaultRules, ResponsiveBreakpoints } from \"../utils/Responsive\";\r\nimport { options } from \"../Options\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Text is used to display highly configurable, data-enabled textual elements.\r\n *\r\n * ## Data Binding\r\n *\r\n * A Text element can dynamically parse and populate its contents with values\r\n * from a [[DataItem]].\r\n *\r\n * To activate such binding, set element's `dataItem` property.\r\n *\r\n * When activated, text contents will be parsed for special tags, e.g.:\r\n *\r\n * ```TypeScript\r\n * label.dataItem = myDataItem;\r\n * label.text = \"The title is: {title}\";\r\n * ```\r\n * ```JavaScript\r\n * label.dataItem = myDataItem;\r\n * label.text = \"The title is: {title}\";\r\n * ```\r\n *\r\n * The above will automatically replace \"{title}\" in the string with the\r\n * actual data value from `myDataItem`.\r\n *\r\n * Note, that most often dataItem is set by the Component.\r\n *\r\n *\r\n * @see {@link ILabelEvents} for a list of available events\r\n * @see {@link ILabelAdapters} for a list of available Adapters\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-strings/} for info on string formatting and data binding\r\n * @todo Vertical align\r\n * @important\r\n */\r\nvar Label = /** @class */ (function (_super) {\r\n __extends(Label, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Label() {\r\n var _this = \r\n // Execute super's constructor\r\n _super.call(this) || this;\r\n /**\r\n * Indicates if the whole text does not fit into max dimenstions set for it.\r\n */\r\n _this.isOversized = false;\r\n // Set this class name\r\n _this.className = \"Label\";\r\n _this.fill = new InterfaceColorSet().getFor(\"text\");\r\n // not good to set this, as then these will appear on each label and values set on container won't be applied.\r\n //this.textDecoration = \"none\";\r\n //this.fontWeight = \"normal\";\r\n // Set defaults\r\n _this.wrap = false;\r\n _this.truncate = false;\r\n _this.fullWords = true;\r\n _this.ellipsis = \"…\";\r\n _this.textAlign = \"start\";\r\n _this.textValign = \"top\";\r\n _this.layout = \"absolute\";\r\n _this.baseLineRatio = -0.27;\r\n //this.pixelPerfect = true;\r\n _this._positionPrecision = 1;\r\n // Add events to watch for maxWidth/maxHeight changes so that we can\r\n // invalidate this\r\n _this.events.on(\"maxsizechanged\", function () {\r\n if (_this.inited) {\r\n _this.handleMaxSize();\r\n }\r\n }, _this, false);\r\n // this solves strange bug when text just added to svg is 0x0\r\n _this.events.once(\"validated\", _this.handleValidate, _this, false);\r\n // Aply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * A placeholder method that is called **after** element finishes drawing\r\n * itself.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Label.prototype.afterDraw = function () {\r\n // since we removed validatePosition from sprite, we still need it here to handle rotated text\r\n _super.prototype.afterDraw.call(this);\r\n this.validatePosition();\r\n };\r\n /**\r\n * Sets [[Paper]] instance to use to draw elements.\r\n * @ignore\r\n * @param paper Paper\r\n * @return true if paper was changed, false, if it's the same\r\n */\r\n Label.prototype.setPaper = function (paper) {\r\n var changed = _super.prototype.setPaper.call(this, paper);\r\n if (changed) {\r\n this.hardInvalidate();\r\n }\r\n return changed;\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Label.prototype.handleValidate = function () {\r\n if ((this.currentText || this.text) && (this.bbox.width == 0 || this.bbox.height == 0)) {\r\n registry.events.once(\"exitframe\", this.hardInvalidate, this);\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Label.prototype.handleMaxSize = function () {\r\n if ((this.bbox.width > this.availableWidth)\r\n || ((this.bbox.width < this.availableWidth) && (this.isOversized || this.truncate))\r\n || (this.bbox.height > this.availableHeight)\r\n || ((this.bbox.height < this.availableHeight) && this.isOversized)) {\r\n this.invalidate();\r\n }\r\n else {\r\n //this.alignSVGText();\r\n }\r\n };\r\n /**\r\n * [arrange description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n Label.prototype.arrange = function () {\r\n };\r\n /**\r\n * Updates current text according to data item and supported features.\r\n * Returns `true` if current text has changed.\r\n *\r\n * @return Text changed?\r\n */\r\n Label.prototype.updateCurrentText = function () {\r\n // Determine output format\r\n var output, text;\r\n if ($utils.isNotEmpty(this.html) && this.paper.supportsForeignObject()) {\r\n // We favor HTML text if it's set and browser supports `foreignObject`\r\n output = \"html\";\r\n text = this.html;\r\n }\r\n else {\r\n output = \"svg\";\r\n text = this.text;\r\n }\r\n // Need to toString source?\r\n if ($type.isObject(text)) {\r\n text = text.toString();\r\n }\r\n // Need to format text all the time\r\n if ($type.hasValue(text) && text !== \"\") {\r\n text = this.populateString(text, this.dataItem);\r\n }\r\n if (output == \"html\") {\r\n if (this._adapterO) {\r\n text = this._adapterO.apply(\"htmlOutput\", text);\r\n }\r\n }\r\n else {\r\n if (this._adapterO) {\r\n text = this._adapterO.apply(\"textOutput\", text);\r\n }\r\n }\r\n // Update the text\r\n var changed = text != this.currentText || output != this._currentFormat;\r\n this.currentText = text;\r\n this._currentFormat = output;\r\n return changed;\r\n };\r\n /**\r\n * Hard invalidate means the text will be redrawn even if it hasn't changed.\r\n * This is used when we change `fontSize`, `fontFamily`, or for some other\r\n * reasons.\r\n */\r\n Label.prototype.hardInvalidate = function () {\r\n this._prevStatus = \"\";\r\n this.invalidate();\r\n };\r\n /**\r\n * Gets line bbox, uses caching to save cpu\r\n * @ignore\r\n */\r\n Label.prototype.getLineBBox = function (lineInfo) {\r\n //let cacheKey = lineInfo.text + lineInfo.style;\r\n //let lineBBox = this.getCache(cacheKey);\r\n //if (!lineBBox) {\r\n //lineBBox = lineInfo.element.getBBox();\r\n //if (lineBBox.width != 0 && lineBBox.height != 0) {\r\n //\tthis.setCache(cacheKey, lineBBox, 5000);\r\n //}\r\n //}\r\n var element = lineInfo && lineInfo.element;\r\n var node = element && element.node;\r\n // Check for the parent Node to avoid FF from throwing errors\r\n if (node && node.parentNode) {\r\n lineInfo.bbox = element.getBBox();\r\n }\r\n };\r\n /**\r\n * Draws the textual label.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Label.prototype.draw = function () {\r\n // Draw super\r\n _super.prototype.draw.call(this);\r\n var oldW = this.bbox.width;\r\n var oldH = this.bbox.height;\r\n var topParent = this.topParent;\r\n if (topParent) {\r\n if (!topParent.maxWidth || !topParent.maxHeight) {\r\n topParent.events.once(\"maxsizechanged\", this.hardInvalidate, this, false);\r\n return;\r\n }\r\n }\r\n // Calculate max width and height\r\n var maxWidth = $math.max(this.availableWidth - this.pixelPaddingLeft - this.pixelPaddingRight, 0);\r\n var maxHeight = $math.max(this.availableHeight - this.pixelPaddingTop - this.pixelPaddingBottom, 0);\r\n // save\r\n var status = maxHeight + \",\" + maxWidth + this.wrap + this.truncate + this.fullWords + this.rtl + this.ellipsis;\r\n // Update text\r\n if (!this.updateCurrentText() && this.inited && this._prevStatus == status) {\r\n return;\r\n }\r\n this._measuredWidth = 0;\r\n this._measuredHeight = 0;\r\n // Reset\r\n this.isOversized = false;\r\n // Determine output format\r\n var output = this._currentFormat;\r\n var text = this.currentText;\r\n // Empty string\r\n if (!$type.hasValue(text) || text == \"\") {\r\n this.element.attr({ display: \"none\" });\r\n return;\r\n }\r\n // Chop up text into lines\r\n // We're still processing SVG and HTML in the same way for now\r\n var lines = text.split(\"\\n\");\r\n // Do we need to go through the trouble of measuring lines\r\n //let measure: boolean = true;// (lines.length > 1) || this.wrap;\r\n this._prevStatus = status;\r\n this.textAlign = this.textAlign;\r\n // need this to measure\r\n var display = this.group.getAttr(\"display\");\r\n if (display == \"none\") {\r\n this.group.removeAttr(\"display\");\r\n }\r\n if (this.textPathElement) {\r\n this.textPathElement.removeChildren();\r\n }\r\n // SVG or HTML?\r\n if (output === \"svg\") {\r\n /**\r\n * SVG\r\n */\r\n this.element.removeAttr(\"display\");\r\n // Clear the element\r\n var group = this.element;\r\n //group.removeChildren();\r\n this.resetBBox();\r\n // Init state variables\r\n var currentHeight = 0;\r\n var currentFormat = \"\";\r\n // Process each line\r\n for (var i = 0; i < lines.length; i++) {\r\n // Get line\r\n var line = lines[i];\r\n // Check if line is empty\r\n if (line == \"\") {\r\n // It is, let's just update currentHeight and go to the next one\r\n // If it's the first line, we'll have to use arbirary line height,\r\n // since there's nothing to measure. For subsequent lines we can take\r\n // previous line's height\r\n var tempElement = this.getSVGLineElement(\"\", 0);\r\n tempElement.add(this.getSvgElement(\".\", getTextFormatter().translateStyleShortcuts(currentFormat)));\r\n group.add(tempElement);\r\n var offset = Math.ceil(tempElement.getBBox().height);\r\n if (offset > 0) {\r\n currentHeight += offset;\r\n }\r\n group.removeElement(tempElement);\r\n // Clear cache if necessary\r\n var lineInfo_1 = this.getLineInfo(i);\r\n if (lineInfo_1) {\r\n lineInfo_1.text = \"\";\r\n lineInfo_1.element.textContent = \"\";\r\n }\r\n continue;\r\n }\r\n // Chunk up the line and process each chunk\r\n var chunks = getTextFormatter().chunk(line, null, this.ignoreFormatting);\r\n var currentLineHeight = 0;\r\n var firstChunk = true;\r\n var skipTextChunks = false;\r\n // Create line element or grab it from cache\r\n var lineInfo = this.getLineInfo(i);\r\n if (lineInfo) {\r\n // Empty line\r\n lineInfo.text = \"\";\r\n lineInfo.element.textContent = \"\";\r\n }\r\n else {\r\n // Init new line info\r\n lineInfo = {\r\n \"text\": \"\",\r\n \"element\": this.getSVGLineElement(\"\", 0),\r\n \"complex\": false\r\n };\r\n // Create the line element\r\n //lineInfo.element = this.getSVGLineElement(\"\", 0);\r\n //lineElement = this.getSVGLineElement(\"\", 0);\r\n group.add(lineInfo.element);\r\n }\r\n lineInfo.element.removeAttr(\"display\");\r\n lineInfo.element.removeChildren(); // memory leak without this\r\n if (this.textPathElement) {\r\n lineInfo.element.add(this.textPathElement);\r\n }\r\n /*// @todo not needed anymore\r\n if (this.rtl) {\r\n chunks.reverse();\r\n }*/\r\n // Process each chunk\r\n for (var x = 0; x < chunks.length; x++) {\r\n // If there's more than one chunk, means the line is \"complex\"\r\n if (x) {\r\n lineInfo.complex = true;\r\n }\r\n // Get chunk\r\n var chunk = chunks[x];\r\n // Is this chunk format or text?\r\n if (chunk.type === \"format\") {\r\n // Log current format, so that we can apply it to multiple lines if\r\n // necessary\r\n currentFormat = chunk.text;\r\n }\r\n else {\r\n // It's text block\r\n // Need to skip?\r\n // We do this when truncating. We can't just simply go ahead and\r\n // abandon chunk processing as they might have formatting\r\n // instructions in them that are relevant for subsequent lines\r\n if (skipTextChunks) {\r\n continue;\r\n }\r\n // Add chunk to the current element\r\n //lineInfo.element.content += $utils.trim(getTextFormatter().format(currentFormat + chunk.text, output));\r\n lineInfo.text = chunk.text;\r\n lineInfo.style = getTextFormatter().translateStyleShortcuts(currentFormat);\r\n if (this.textPathElement) {\r\n this.getSvgElement(lineInfo.text, lineInfo.style, this.textPathElement);\r\n }\r\n else {\r\n this.getSvgElement(lineInfo.text, lineInfo.style, lineInfo.element);\r\n }\r\n this.getLineBBox(lineInfo);\r\n lineInfo.bbox.width = Math.ceil(lineInfo.bbox.width);\r\n // Updated current line height\r\n if (currentLineHeight < lineInfo.bbox.height) {\r\n currentLineHeight = lineInfo.bbox.height;\r\n }\r\n // Wrapping?\r\n if ((this.wrap || this.truncate) && (lineInfo.bbox.width > maxWidth)) {\r\n // Set oversized\r\n this.isOversized = true;\r\n // Take temporary measurements\r\n var lineText = lineInfo.element.textContent;\r\n var avgCharWidth = (lineInfo.bbox.width / lineText.length); // * .9;\r\n // Calculate average number of symbols / width\r\n var excessChars = $math.min(Math.ceil((lineInfo.bbox.width - maxWidth) / avgCharWidth), lineText.length);\r\n // Are we truncating or auto-wrapping text?\r\n if (this.truncate) {\r\n /**\r\n * Processing line truncation\r\n * With the addition of each text chunk we measure if current\r\n * line does not exceed maxWidth. If it does, we will stop\r\n * addition of further chunks as well as try to truncate\r\n * current or any number of previous chunks with an added\r\n * ellipsis\r\n */\r\n // Indicator whether we need to add ellipsis to the current\r\n // element, even if it fits. This is needed to indicate\r\n // whether we have already removed some subsequent chunks in\r\n // which case we need to add ellipsis.\r\n var addEllipsis = false;\r\n // Process each child in the temporary line, until the whole\r\n // line fits, preferably with an ellipsis\r\n // TODO use iterator instead\r\n var node_1 = lineInfo.element.node;\r\n if (node_1 && node_1.childNodes) {\r\n for (var e = lineInfo.element.node.childNodes.length - 1; e >= 0; e--) {\r\n // Get current element\r\n var node_2 = lineInfo.element.node.childNodes[e];\r\n // Add ellipsis only if previous chunk was removed in full\r\n // and this chunk already fits\r\n //if (addEllipsis && (bbox.width <= maxWidth)) {\r\n if (addEllipsis && (lineInfo.bbox.width <= maxWidth)) {\r\n // Add ellipsis\r\n node_2.textContent += \" \" + this.ellipsis;\r\n // Measure again (we need to make sure ellipsis fits)\r\n lineInfo.bbox = lineInfo.element.getBBox();\r\n lineInfo.bbox.width = Math.floor(lineInfo.bbox.width);\r\n // If it fits, we're done here\r\n // If it doesn't we continue rolling\r\n if (lineInfo.bbox.width <= maxWidth) {\r\n break;\r\n }\r\n }\r\n addEllipsis = false;\r\n // Get element text\r\n var elementText = node_2.textContent;\r\n // Calculate average number of symbols / width\r\n lineText = lineInfo.element.textContent;\r\n excessChars = $math.min(Math.ceil((lineInfo.bbox.width - maxWidth) / avgCharWidth), lineText.length);\r\n // Do this until we fit\r\n while ((lineInfo.bbox.width > maxWidth) && (excessChars <= lineText.length) && (excessChars > 0)) {\r\n // Calculate max available chars\r\n var maxChars = $math.max(lineText.length - excessChars - this.ellipsis.length, 1);\r\n // Is there anything left?\r\n if (maxChars <= 1) {\r\n // Nope, let's jump to the previous item\r\n // Set excess characters to zero so that this loop does\r\n // not repeat when it over\r\n excessChars = 0;\r\n // Add ellipsis to previous item\r\n // Subsequent iterations will check if the ellipsis fits\r\n if (e > 0) {\r\n // Indicating to add ellipsis to previous item\r\n addEllipsis = true;\r\n // Removing this node\r\n lineInfo.element.node.removeChild(node_2);\r\n }\r\n }\r\n // Truncate the text\r\n elementText = $utils.truncateWithEllipsis(elementText, maxChars, this.ellipsis, this.fullWords, this.rtl);\r\n if ((elementText.length > maxChars) && this.fullWords) {\r\n // Still too long?\r\n // Let's try truncating breaking words anyway\r\n elementText = $utils.truncateWithEllipsis(elementText, maxChars, this.ellipsis, false, this.rtl);\r\n }\r\n // Set truncated text\r\n node_2.textContent = elementText;\r\n // Measure again\r\n lineInfo.bbox = lineInfo.element.getBBox();\r\n lineInfo.bbox.width = Math.floor(lineInfo.bbox.width);\r\n // Increase excess characters count, just in case it still\r\n // doesn't fit and we have to go at it again\r\n excessChars = Math.ceil(excessChars * 1.1);\r\n }\r\n // Do not process further chunks\r\n skipTextChunks = true;\r\n }\r\n }\r\n }\r\n else {\r\n /**\r\n * Processign auto-wrap\r\n * In this case we're going to be adding text chunks until\r\n * they don't fit into current line. Once that happens we will\r\n * inject the rest of the chunks to the next line\r\n */\r\n // Get last node added and measure it\r\n var node_3 = lineInfo.element.node;\r\n if (node_3) {\r\n var lastNode = lineInfo.element.node.lastChild;\r\n // Init split lines\r\n var splitLines = void 0;\r\n while ((lineInfo.bbox.width > maxWidth) && (excessChars <= lineText.length) && (excessChars > 0)) {\r\n // Calculate max available chars\r\n var maxChars = $math.max(chunk.text.length - excessChars, 1);\r\n // Don't split the words mid-word if it's not the first chunk\r\n // in the line\r\n if (firstChunk) {\r\n // Split mid-word if necessary\r\n splitLines = $utils.splitTextByCharCount(chunk.text, maxChars, true, this.rtl);\r\n }\r\n else {\r\n // Don't split mid-word\r\n splitLines = $utils.splitTextByCharCount(chunk.text, maxChars, true, this.rtl, false);\r\n // Check if the first word is too long\r\n if ((splitLines[0].length > maxChars) || maxChars === 1) {\r\n // Yes - move the whole chunk to the next line\r\n // Remove the element we just added\r\n lineInfo.element.node.removeChild(lastNode);\r\n // Break out of the while on next cycle\r\n excessChars = 0;\r\n }\r\n }\r\n // Use the first line to update last item\r\n if (excessChars > 0) {\r\n var lineText_1 = splitLines.shift();\r\n if (firstChunk) {\r\n lineText_1 = $utils.trim(lineText_1);\r\n }\r\n lastNode.textContent = getTextFormatter().cleanUp(lineText_1);\r\n }\r\n // Measure again, just in case\r\n lineInfo.bbox = lineInfo.element.getBBox();\r\n lineInfo.bbox.width = Math.floor(lineInfo.bbox.width);\r\n // Increase excess characters count, just in case it still\r\n // doesn't fit and we have to go at it again\r\n //excessChars = Math.ceil(excessChars * 1.05);\r\n excessChars++;\r\n }\r\n // Construct the rest of the line\r\n if (splitLines.length > 0) {\r\n var restOfLine = \"\";\r\n // Add leftovers from splitting the current chunk\r\n if ($type.hasValue(splitLines)) {\r\n if (this.rtl) {\r\n restOfLine += splitLines.join(\"\") + currentFormat;\r\n }\r\n else {\r\n restOfLine += currentFormat + splitLines.join(\"\").replace(/([\\[\\]]{1})/g, \"$1$1\");\r\n }\r\n }\r\n // Add the rest of the chunks\r\n for (var c = x + 1; c < chunks.length; c++) {\r\n if (chunks[c].type == \"value\") {\r\n // We're escaping single square brackets that were\r\n // cleaned up by chunk() back to double square brackets\r\n // so that they are not being treated as format on\r\n // next pass.\r\n restOfLine += chunks[c].text.replace(/([\\[\\]]{1})/g, \"$1$1\");\r\n }\r\n else {\r\n restOfLine += chunks[c].text;\r\n }\r\n }\r\n // Inject the rest of the lines as chunks for subsequent\r\n lines.splice(i + 1, 0, restOfLine);\r\n }\r\n // Skip processing the rest of the chunks\r\n skipTextChunks = true;\r\n }\r\n }\r\n }\r\n // Let's update the text's bbox with the line's one\r\n if (this.bbox.width < lineInfo.bbox.width) {\r\n this.bbox.width = lineInfo.bbox.width;\r\n }\r\n // commented to avoid bug (seen on sankey link) where text is incorrectly aligned\r\n //if (this.bbox.x > lineInfo.bbox.x) {\r\n //this.bbox.x = lineInfo.bbox.x;\r\n //}\r\n this.bbox.height = currentHeight + currentLineHeight;\r\n // Position current line\r\n if (!this.textPathElement) {\r\n lineInfo.element.attr({\r\n \"x\": \"0\",\r\n \"y\": currentHeight + currentLineHeight,\r\n \"dy\": $math.round((this.baseLineRatio * currentLineHeight), 3).toString()\r\n });\r\n }\r\n else {\r\n lineInfo.element.attr({\r\n \"dy\": -this.paddingBottom.toString()\r\n });\r\n }\r\n firstChunk = false;\r\n }\r\n }\r\n // Trim the last item\r\n var node = lineInfo.element.node;\r\n if (node) {\r\n var lastNode = node.lastChild;\r\n if (lastNode) {\r\n lastNode.textContent = this.rtl ?\r\n $utils.ltrim(lastNode.textContent) :\r\n $utils.rtrim(lastNode.textContent);\r\n }\r\n }\r\n // Increment collective height\r\n currentHeight += currentLineHeight;\r\n // Save line cache\r\n this.addLineInfo(lineInfo, i);\r\n }\r\n // Check if maybe we need to hide the whole label if it doesn't fit\r\n this.maybeHideOversized();\r\n this.measureFailed = false;\r\n if (this.bbox.width == 0 || this.bbox.height == 0) {\r\n this.measureFailed = true;\r\n }\r\n // Updated measured dims\r\n this._measuredWidth = $math.round($math.max(this.bbox.width, this.pixelWidth - this.pixelPaddingLeft - this.pixelPaddingRight));\r\n this._measuredHeight = $math.round($math.max(this.bbox.height, this.pixelHeight - this.pixelPaddingTop - this.pixelPaddingBottom));\r\n // Align the lines\r\n this.alignSVGText();\r\n this.bbox.width = this._measuredWidth;\r\n this.bbox.height = this._measuredHeight;\r\n if (oldH != this._measuredHeight || oldW != this._measuredWidth) {\r\n this.dispatch(\"transformed\");\r\n }\r\n this.hideUnused(lines.length);\r\n }\r\n else {\r\n /**\r\n * HTML\r\n */\r\n this.element.removeAttr(\"display\");\r\n this.resetBBox();\r\n // Clear the element\r\n var group = this.element;\r\n group.removeChildren();\r\n this.setCache(\"lineInfo\", [], 0);\r\n // Create a ForeignObject to use as HTML container\r\n var fo = this.paper.foreignObject();\r\n group.add(fo);\r\n // Set widths on foreignObject so that autosizing measurements work\r\n // This will bet reset to actual content width/height\r\n if (this.maxWidth) {\r\n fo.attr({\r\n width: this.maxWidth - this.pixelPaddingLeft - this.pixelPaddingRight\r\n });\r\n }\r\n if (this.maxHeight) {\r\n fo.attr({\r\n height: this.maxHeight - this.pixelPaddingTop - this.pixelPaddingBottom\r\n });\r\n }\r\n // Create line element\r\n //let lineElement: HTMLElement = this.getHTMLLineElement(getTextFormatter().format(this.html, output));\r\n var lineElement = this.getHTMLLineElement(text);\r\n fo.node.appendChild(lineElement);\r\n // Temporarily set to inline-block so we can measure real width and height\r\n lineElement.style.display = \"inline-block\";\r\n var clientWidth = lineElement.clientWidth;\r\n var clientHeight = lineElement.clientHeight;\r\n lineElement.style.display = \"block\";\r\n this._bbox = {\r\n x: 0,\r\n y: 0,\r\n width: clientWidth,\r\n height: clientHeight\r\n };\r\n // Set exact dimensions of foreignObject so it is sized exactly as\r\n // the content within (add one pixel to width so it does not wrap)\r\n fo.attr({\r\n width: clientWidth + 1,\r\n height: clientHeight\r\n });\r\n // Check if maybe we need to hide the whole label if it doesn't fit\r\n this.maybeHideOversized();\r\n // Set measurements and update bbox\r\n this._measuredWidth = $math.max(this.bbox.width, this.pixelWidth - this.pixelPaddingLeft - this.pixelPaddingRight);\r\n this._measuredHeight = $math.max(this.bbox.height, this.pixelHeight - this.pixelPaddingTop - this.pixelPaddingBottom);\r\n this.bbox.width = this._measuredWidth;\r\n this.bbox.height = this._measuredHeight;\r\n // Don't let labels bleed out of the alotted area\r\n if (this.truncate) {\r\n lineElement.style.overflow = \"hidden\";\r\n }\r\n if ((clientWidth > maxWidth) || (clientHeight > maxHeight)) {\r\n this.isOversized = true;\r\n }\r\n }\r\n // Set applicable styles\r\n this.setStyles();\r\n this.updateCenter();\r\n this.updateBackground();\r\n if (display == \"none\") {\r\n this.group.attr({ display: \"none\" });\r\n }\r\n if (this.pathElement) {\r\n this.paper.appendDef(this.pathElement);\r\n }\r\n };\r\n /**\r\n * Hides element if it does not fit into available space\r\n */\r\n Label.prototype.maybeHideOversized = function () {\r\n if (this.hideOversized) {\r\n if ((this.availableWidth < this.bbox.width) || (this.availableHeight < this.bbox.height)) {\r\n this.element.attr({ display: \"none\" });\r\n this.isOversized = true;\r\n }\r\n else {\r\n this.element.removeAttr(\"display\");\r\n this.isOversized = false;\r\n }\r\n }\r\n };\r\n /**\r\n * Aligns the lines horizontally and vertically, based on properties.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Label.prototype.alignSVGText = function () {\r\n // Get Group\r\n var group = this.element;\r\n var children = group.node.children || group.node.childNodes;\r\n // Is there anything to align?\r\n if (!children || (children && children.length == 0)) {\r\n return;\r\n }\r\n var width = this._measuredWidth;\r\n var height = this._measuredHeight;\r\n // TODO maybe these aren't needed ?\r\n $utils.used(this.pixelPaddingLeft);\r\n $utils.used(this.pixelPaddingRight);\r\n $utils.used(this.pixelPaddingTop);\r\n $utils.used(this.pixelPaddingBottom);\r\n if (this.rtl) {\r\n group.attr({\r\n \"direction\": \"rtl\"\r\n });\r\n }\r\n else {\r\n group.removeAttr(\"direction\");\r\n }\r\n // Process each line\r\n //$iter.each(group.children.backwards().iterator(), (element) => {\r\n for (var i = children.length - 1; i >= 0; i--) {\r\n // Align horizontally\r\n // Since we are using `text-anchor` for horizontal alignment, all we need\r\n // to do here is move the `x` position\r\n var node = children[i];\r\n node.setAttribute(\"text-anchor\", this.textAlign);\r\n if (this.textPathElement) {\r\n node.removeAttribute(\"x\");\r\n node.removeAttribute(\"y\");\r\n }\r\n else {\r\n switch (this.textAlign) {\r\n case \"middle\":\r\n node.setAttribute(\"x\", (width / 2).toString() + \"px\");\r\n break;\r\n case \"end\":\r\n if (this.rtl) {\r\n }\r\n else {\r\n node.setAttribute(\"x\", width.toString());\r\n }\r\n break;\r\n default:\r\n if (this.rtl) {\r\n node.setAttribute(\"x\", width.toString());\r\n }\r\n else {\r\n node.removeAttribute(\"text-anchor\");\r\n }\r\n break;\r\n }\r\n var y = $type.toNumber(node.getAttribute(\"y\"));\r\n switch (this.textValign) {\r\n case \"middle\":\r\n node.setAttribute(\"y\", ((y || 0) + (height - this.bbox.height) / 2).toString());\r\n break;\r\n case \"bottom\":\r\n node.setAttribute(\"y\", ((y || 0) + height - this.bbox.height).toString());\r\n break;\r\n default:\r\n node.setAttribute(\"y\", (y || 0).toString());\r\n break;\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Produces an SVG line element with formatted text.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Text to wrap into line\r\n * @param y Current line vertical position\r\n * @return A DOM element\r\n * @todo Implement HTML support\r\n */\r\n Label.prototype.getSVGLineElement = function (text, y) {\r\n // Create a <text> node and set text\r\n var element = this.paper.addGroup(\"text\");\r\n element.textContent = text;\r\n // Set parameters\r\n element.attr({\r\n \"x\": \"0\"\r\n //\"alignment-baseline\": \"hanging\",\r\n //\"baseline-shift\": \"-20%\",\r\n //\"text-anchor\": \"center\"\r\n });\r\n // Set `y` position\r\n if ($type.hasValue(y)) {\r\n element.attr({\r\n \"y\": y.toString()\r\n });\r\n }\r\n // Don't let labels blled out of the alotted area\r\n if (this.truncate || this.wrap) {\r\n element.attr({ \"overflow\": \"hidden\" });\r\n }\r\n // Add RTL?\r\n // This has now been moved to this.alignSVGText()\r\n // if (this.rtl) {\r\n // \telement.attr({\r\n // \t\t\"direction\": \"rtl\",\r\n // \t\t//\"unicode-bidi\": \"bidi-override\"\r\n // \t});\r\n // }\r\n return element;\r\n };\r\n Object.defineProperty(Label.prototype, \"rtl\", {\r\n /**\r\n * @return RTL?\r\n */\r\n get: function () {\r\n if ($type.hasValue(this._rtl)) {\r\n return this._rtl;\r\n }\r\n else if (this._topParent) {\r\n return this._topParent.rtl;\r\n }\r\n return false;\r\n },\r\n /**\r\n * An RTL (right-to-left) setting.\r\n *\r\n * RTL may affect alignment, text, and other visual properties.\r\n *\r\n * If you set this on a top-level chart object, it will be used for all\r\n * child elements, e.g. labels, unless they have their own `rtl` setting\r\n * set directly on them.\r\n *\r\n * @param value `true` for to use RTL\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n this._rtl = value;\r\n if (this.element) {\r\n this.alignSVGText();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Resets cached BBox.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Label.prototype.resetBBox = function () {\r\n this._bbox = { x: 0, y: 0, width: 0, height: 0 };\r\n };\r\n /**\r\n * Creates and returns an HTML line element (`<div>`).\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Text to add\r\n * @return `<div>` element reference\r\n */\r\n Label.prototype.getHTMLLineElement = function (text) {\r\n // Create the <div> element\r\n var div = document.createElement(\"div\");\r\n div.innerHTML = text;\r\n // Set text alignment\r\n switch (this.textAlign) {\r\n case \"middle\":\r\n div.style.textAlign = \"center\";\r\n break;\r\n case \"end\":\r\n div.style.textAlign = \"right\";\r\n break;\r\n }\r\n // Disable or enable wrapping\r\n if (this.wrap) {\r\n div.style.wordWrap = \"break-word\";\r\n }\r\n else {\r\n div.style.whiteSpace = \"nowrap\";\r\n }\r\n // Don't let labels bleed out of the alotted area\r\n // Moved to `draw()` because setting \"hidden\" kills all measuring\r\n /*if (this.truncate) {\r\n div.style.overflow = \"hidden\";\r\n }*/\r\n // Set RTL-related styles\r\n if (this.rtl) {\r\n div.style.direction = \"rtl\";\r\n //div.style.unicodeBidi = \"bidi-override\";\r\n }\r\n // Translate some of the SVG styles into CSS\r\n if ($type.hasValue(this.fill)) {\r\n div.style.color = this.fill.toString();\r\n }\r\n return div;\r\n };\r\n /**\r\n * Applies specific styles to text to make it not selectable, unless it is\r\n * explicitly set as `selectable`.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Set styles via AMElement\r\n */\r\n Label.prototype.setStyles = function () {\r\n var group = this.element;\r\n if (!this.selectable || this.draggable || this.resizable || this.swipeable) {\r\n group.addStyle({\r\n \"webkitUserSelect\": \"none\",\r\n \"msUserSelect\": \"none\"\r\n });\r\n }\r\n else if (this.selectable) {\r\n group.removeStyle(\"webkitUserSelect\");\r\n group.removeStyle(\"msUserSelect\");\r\n }\r\n };\r\n /**\r\n * Hides unused lines\r\n */\r\n Label.prototype.hideUnused = function (index) {\r\n this.initLineCache();\r\n var lines = this.getCache(\"lineInfo\");\r\n if (lines.length >= index) {\r\n for (var i = index; i < lines.length; i++) {\r\n var line = lines[i];\r\n if (line && line.element) {\r\n line.element.attr({ \"display\": \"none\" });\r\n }\r\n }\r\n }\r\n };\r\n Object.defineProperty(Label.prototype, \"text\", {\r\n /**\r\n * @return SVG text\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"text\");\r\n },\r\n /**\r\n * An SVG text.\r\n *\r\n * Please note that setting `html` will override this setting if browser\r\n * supports `foreignObject` in SGV, such as most modern browsers excluding\r\n * IEs.\r\n *\r\n * @param value SVG Text\r\n */\r\n set: function (value) {\r\n //this.setPropertyValue(\"html\", undefined);\r\n this.setPropertyValue(\"text\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Label.prototype, \"path\", {\r\n /**\r\n * @return Path\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"path\");\r\n },\r\n /**\r\n * An SVG path string to position text along. If set, the text will follow\r\n * the curvature of the path.\r\n *\r\n * Location along the path can be set using `locationOnPath`.\r\n *\r\n * IMPORTANT: Only SVG text can be put on path. If you are using HTML text\r\n * this setting will be ignored.\r\n *\r\n * @since 4.1.2\r\n * @param value Path\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"path\", value, true)) {\r\n if (this.pathElement) {\r\n this.pathElement.dispose();\r\n }\r\n if (this.textPathElement) {\r\n this.textPathElement.dispose();\r\n }\r\n this.pathElement = this.paper.add(\"path\");\r\n this.pathElement.attr({ \"d\": value });\r\n this.pathElement.attr({ \"id\": \"text-path-\" + this.uid });\r\n this._disposers.push(this.pathElement);\r\n this.textPathElement = this.paper.addGroup(\"textPath\");\r\n this.textPathElement.attrNS($dom.XLINK, \"xlink:href\", \"#text-path-\" + this.uid);\r\n // TODO remove after https://bugzilla.mozilla.org/show_bug.cgi?id=455986 is fixed\r\n this.textPathElement.attr({ \"path\": value });\r\n this._disposers.push(this.textPathElement);\r\n this.hardInvalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Label.prototype, \"locationOnPath\", {\r\n /**\r\n * @return Relatvie location on path\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"locationOnPath\");\r\n },\r\n /**\r\n * Relative label location on `path`. Value range is from 0 (beginning)\r\n * to 1 (end).\r\n *\r\n * Works only if you set `path` setting to an SVG path.\r\n *\r\n * @since 4.1.2\r\n * @default 0\r\n * @param value Relatvie location on path\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"locationOnPath\", value);\r\n if (this.textPathElement) {\r\n this.textPathElement.attr({ \"startOffset\": (value * 100) + \"%\" });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Label.prototype, \"baseLineRatio\", {\r\n /**\r\n * @return Base line ratio\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"baseLineRatio\");\r\n },\r\n /**\r\n * A ratio to calculate text baseline. Ralative distance from the bottom of\r\n * the label.\r\n *\r\n * @since 4.4.2\r\n * @default -0.27\r\n * @param value Base line ratio\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"baseLineRatio\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Label.prototype, \"wrap\", {\r\n /**\r\n * @return Auto-wrap enabled or not\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"wrap\");\r\n },\r\n /**\r\n * Enables or disables autowrapping of text.\r\n *\r\n * @param value Auto-wrapping enabled\r\n */\r\n set: function (value) {\r\n this.resetBBox();\r\n this.setPropertyValue(\"wrap\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Label.prototype, \"truncate\", {\r\n /**\r\n * @return Truncate text?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"truncate\");\r\n },\r\n /**\r\n * Indicates if text lines need to be truncated if they do not fit, using\r\n * configurable `ellipsis` string.\r\n *\r\n * `truncate` overrides `wrap` if both are set to `true`.\r\n *\r\n * NOTE: For HTML text, this setting **won't** trigger a parser and actual\r\n * line truncation with ellipsis. It will just hide everything that goes\r\n * outside the label.\r\n *\r\n * @param value trincate text?\r\n */\r\n set: function (value) {\r\n this.resetBBox();\r\n this.setPropertyValue(\"truncate\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Label.prototype, \"fullWords\", {\r\n /**\r\n * @return Truncate on full words?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"fullWords\");\r\n },\r\n /**\r\n * If `truncate` is enabled, should Label try to break only on full words\r\n * (`true`), or whenever needed, including middle of the word. (`false`)\r\n *\r\n * @default true\r\n * @param value Truncate on full words?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"fullWords\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Label.prototype, \"ellipsis\", {\r\n /**\r\n * @return Ellipsis string\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"ellipsis\");\r\n },\r\n /**\r\n * Ellipsis character to use if `truncate` is enabled.\r\n *\r\n * @param value Ellipsis string\r\n * @default \"...\"\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"ellipsis\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Label.prototype, \"selectable\", {\r\n /**\r\n * @return Text selectable?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"selectable\");\r\n },\r\n /**\r\n * Forces the text to be selectable. This setting will be ignored if the\r\n * object has some kind of interaction attached to it, such as it is\r\n * `draggable`, `swipeable`, `resizable`.\r\n *\r\n * @param value Text selectable?\r\n * @default false\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"selectable\", value, true);\r\n this.setStyles();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Label.prototype, \"textAlign\", {\r\n /**\r\n * @return Alignment\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"textAlign\");\r\n },\r\n /**\r\n * Horizontal text alignment.\r\n *\r\n * Available choices:\r\n * * \"start\"\r\n * * \"middle\"\r\n * * \"end\"\r\n *\r\n * @param value Alignment\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"textAlign\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Label.prototype, \"textValign\", {\r\n /**\r\n * @ignore Exclude from docs (not used)\r\n * @return Alignment\r\n * @deprecated\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"textValign\");\r\n },\r\n /**\r\n * Vertical text alignment.\r\n *\r\n * @ignore Exclude from docs (not used)\r\n * @param value Alignment\r\n * @deprecated\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"textValign\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Label.prototype, \"html\", {\r\n /**\r\n * @return HTML content\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"html\");\r\n },\r\n /**\r\n * Raw HTML to be used as text.\r\n *\r\n * NOTE: HTML text is subject to browser support. It relies on browsers\r\n * supporting SVG `foreignObject` nodes. Some browsers (read IEs) do not\r\n * support it. On those browsers, the text will fall back to basic SVG text,\r\n * striping out all HTML markup and styling that goes with it.\r\n *\r\n * For more information about `foreignObject` and its browser compatibility\r\n * refer to [this page](https://developer.mozilla.org/en/docs/Web/SVG/Element/foreignObject#Browser_compatibility).\r\n *\r\n * @param value HTML text\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"html\", value, true);\r\n if (!$type.hasValue(value)) {\r\n var group = this.element;\r\n group.removeChildrenByTag(\"foreignObject\");\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Label.prototype.setFill = function (value) {\r\n _super.prototype.setFill.call(this, value);\r\n if (this.html) {\r\n var group = this.element;\r\n var divs = group.node.getElementsByTagName(\"div\");\r\n for (var i = 0; i < divs.length; i++) {\r\n var div = divs[i];\r\n if ($type.hasValue(this.fill)) {\r\n div.style.color = this.fill.toString();\r\n }\r\n }\r\n }\r\n };\r\n Object.defineProperty(Label.prototype, \"hideOversized\", {\r\n /**\r\n * @return Hide if text does not fit?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"hideOversized\");\r\n },\r\n /**\r\n * Indicates whether the whole text should be hidden if it does not fit into\r\n * its allotted space.\r\n *\r\n * @param value Hide if text does not fit?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"hideOversized\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Label.prototype, \"ignoreFormatting\", {\r\n /**\r\n * @return Ignore formatting?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"ignoreFormatting\");\r\n },\r\n /**\r\n * If set to `true` square-bracket formatting blocks will be treated as\r\n * regular text.\r\n *\r\n * @default false\r\n * @param value Ignore formatting?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"ignoreFormatting\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Override `mesaureElement` so it does not get measure again, because\r\n * internal `_bbox` is being updated by measuring routines in Text itself.\r\n */\r\n Label.prototype.measureElement = function () { };\r\n /**\r\n * Returns information about a line element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param index Line index\r\n * @return Line info object\r\n */\r\n Label.prototype.getLineInfo = function (index) {\r\n this.initLineCache();\r\n var lines = this.getCache(\"lineInfo\");\r\n return lines.length > index ? lines[index] : undefined;\r\n };\r\n /**\r\n * Adds a line to line info cache.\r\n *\r\n * @ignore Exclude from docs\r\n * @param line Line info object\r\n * @param index Insert at specified index\r\n */\r\n Label.prototype.addLineInfo = function (line, index) {\r\n this.initLineCache();\r\n this.getCache(\"lineInfo\")[index] = line;\r\n };\r\n /**\r\n * Checks if line cache is initialized and initializes it.\r\n */\r\n Label.prototype.initLineCache = function () {\r\n if (!$type.hasValue(this.getCache(\"lineInfo\"))) {\r\n this.setCache(\"lineInfo\", [], 0);\r\n }\r\n };\r\n /**\r\n * Sets a [[DataItem]] to use for populating dynamic sections of the text.\r\n *\r\n * Check the description for [[Text]] class, for data binding.\r\n *\r\n * @param dataItem Data item\r\n */\r\n Label.prototype.setDataItem = function (dataItem) {\r\n if (this._sourceDataItemEvents) {\r\n this._sourceDataItemEvents.dispose();\r\n }\r\n if (dataItem) {\r\n this._sourceDataItemEvents = new MultiDisposer([\r\n dataItem.events.on(\"valuechanged\", this.invalidate, this, false),\r\n dataItem.events.on(\"workingvaluechanged\", this.invalidate, this, false),\r\n dataItem.events.on(\"calculatedvaluechanged\", this.invalidate, this, false),\r\n dataItem.events.on(\"propertychanged\", this.invalidate, this, false)\r\n ]);\r\n }\r\n _super.prototype.setDataItem.call(this, dataItem);\r\n };\r\n Object.defineProperty(Label.prototype, \"availableWidth\", {\r\n /**\r\n * Returns available horizontal space.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Available width (px)\r\n */\r\n get: function () {\r\n return $type.hasValue(this.maxWidth) ? this.maxWidth : this.pixelWidth;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Label.prototype, \"availableHeight\", {\r\n /**\r\n * Returns available vertical space.\r\n *\r\n * @return Available height (px)\r\n */\r\n get: function () {\r\n return $type.hasValue(this.maxHeight) ? this.maxHeight : this.pixelHeight;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n // temp, replacing textFormatter method\r\n Label.prototype.getSvgElement = function (text, style, parent) {\r\n var element = this.paper.add(\"tspan\");\r\n element.textContent = text;\r\n if (style) {\r\n if (options.nonce && parent) {\r\n //element.node.setAttribute(\"nonce\", \"test123\");\r\n var classid = \"amcharts_element_style_\" + btoa(style).replace(/[^\\w]*/g, \"\");\r\n element.node.setAttribute(\"class\", classid);\r\n var defs = document.createElementNS($dom.SVGNS, \"defs\");\r\n parent.node.appendChild(defs);\r\n var e = document.createElement(\"style\");\r\n e.type = \"text/css\";\r\n e.innerHTML = \".\" + classid + \" { \" + style + \"}\";\r\n e.setAttribute(\"nonce\", options.nonce);\r\n defs.appendChild(e);\r\n }\r\n else {\r\n element.node.setAttribute(\"style\", style);\r\n }\r\n }\r\n if (parent) {\r\n parent.add(element);\r\n }\r\n return element;\r\n };\r\n /**\r\n * Invalidates the whole element, including layout AND all its child\r\n * elements.\r\n */\r\n Label.prototype.deepInvalidate = function () {\r\n _super.prototype.deepInvalidate.call(this);\r\n this.hardInvalidate();\r\n };\r\n Object.defineProperty(Label.prototype, \"readerTitle\", {\r\n /**\r\n * @return Title\r\n */\r\n get: function () {\r\n var title = this.getPropertyValue(\"readerTitle\");\r\n if (!title) {\r\n title = this.populateString($utils.plainText($utils.isNotEmpty(this.html)\r\n ? this.html\r\n : this.text));\r\n }\r\n else if (this.dataItem) {\r\n title = this.populateString(title);\r\n }\r\n return title;\r\n },\r\n /**\r\n * Screen reader title of the element.\r\n *\r\n * @param value Title\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerTitle\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Label;\r\n}(Container));\r\nexport { Label };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Label\"] = Label;\r\n/**\r\n * Add default responsive rules\r\n */\r\n/**\r\n * Hide labels added directly to chart, like titles if chart is short.\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.heightXS,\r\n state: function (target, stateId) {\r\n if (target instanceof Label && target.parent && target.parent.isBaseSprite) {\r\n var state = target.states.create(stateId);\r\n state.properties.disabled = true;\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n//# sourceMappingURL=Label.js.map","/**\r\n * Rounded rectangle module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../Sprite\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $utils from \"../utils/Utils\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws a rectangle with rounded corners.\r\n *\r\n * @see {@link IRoundedRectangleEvents} for a list of available events\r\n * @see {@link IRoundedRectangleAdapters} for a list of available Adapters\r\n */\r\nvar RoundedRectangle = /** @class */ (function (_super) {\r\n __extends(RoundedRectangle, _super);\r\n /**\r\n * Constructor\r\n */\r\n function RoundedRectangle() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"RoundedRectangle\";\r\n _this.element = _this.paper.add(\"path\");\r\n _this.cornerRadius(3, 3, 3, 3);\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n RoundedRectangle.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n var w = this.innerWidth;\r\n var h = this.innerHeight;\r\n if ($type.isNumber(w) && $type.isNumber(h)) {\r\n var minSide = $math.min(w, h) / 2;\r\n var cornerRadiusTopLeft = $utils.relativeToValue(this.cornerRadiusTopLeft, minSide);\r\n var cornerRadiusTopRight = $utils.relativeToValue(this.cornerRadiusTopRight, minSide);\r\n var cornerRadiusBottomRight = $utils.relativeToValue(this.cornerRadiusBottomRight, minSide);\r\n var cornerRadiusBottomLeft = $utils.relativeToValue(this.cornerRadiusBottomLeft, minSide);\r\n var maxcr = $math.min(Math.abs(w / 2), Math.abs(h / 2));\r\n var crtl = $math.fitToRange(cornerRadiusTopLeft, 0, maxcr);\r\n var crtr = $math.fitToRange(cornerRadiusTopRight, 0, maxcr);\r\n var crbr = $math.fitToRange(cornerRadiusBottomRight, 0, maxcr);\r\n var crbl = $math.fitToRange(cornerRadiusBottomLeft, 0, maxcr);\r\n var lineT = \"M\" + crtl + \",0 L\" + (w - crtr) + \",0\";\r\n var lineB = \" L\" + crbl + \",\" + h;\r\n var lineL = \" L0,\" + crtl;\r\n var lineR = \" L\" + w + \",\" + (h - crbr);\r\n var arcTR = \" a\" + crtr + \",\" + crtr + \" 0 0 1 \" + crtr + \",\" + crtr;\r\n var arcBR = \" a\" + crbr + \",\" + crbr + \" 0 0 1 -\" + crbr + \",\" + crbr;\r\n var arcBL = \" a\" + crbl + \",\" + crbl + \" 0 0 1 -\" + crbl + \",-\" + crbl;\r\n var arcTL = \" a\" + crtl + \",\" + crtl + \" 0 0 1 \" + crtl + \",-\" + crtl;\r\n var path = lineT + arcTR + lineR + arcBR + lineB + arcBL + lineL + arcTL + \" Z\";\r\n this.path = path;\r\n }\r\n };\r\n /**\r\n * Sets radius for all four corners at ones.\r\n *\r\n * All numbers are in pixels.\r\n *\r\n * @param tl Top-left corner\r\n * @param tr Top-right corner\r\n * @param bl Bottom-left corner\r\n * @param br Bottom-right corner\r\n */\r\n RoundedRectangle.prototype.cornerRadius = function (tl, tr, bl, br) {\r\n this.cornerRadiusTopLeft = tl;\r\n this.cornerRadiusTopRight = tr;\r\n this.cornerRadiusBottomLeft = bl;\r\n this.cornerRadiusBottomRight = br;\r\n };\r\n Object.defineProperty(RoundedRectangle.prototype, \"cornerRadiusTopLeft\", {\r\n /**\r\n * @return Radius (px or Percent)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"cornerRadiusTopLeft\");\r\n },\r\n /**\r\n * Radius of the top-left corner in pixels.\r\n *\r\n * @default 3\r\n * @param value Radius (px or Percent)\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"cornerRadiusTopLeft\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RoundedRectangle.prototype, \"cornerRadiusTopRight\", {\r\n /**\r\n * @return Radius (px or Percent)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"cornerRadiusTopRight\");\r\n },\r\n /**\r\n * Radius of the top-right corner in pixels.\r\n *\r\n * @default 3\r\n * @param value Radius (px or Percent)\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"cornerRadiusTopRight\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RoundedRectangle.prototype, \"cornerRadiusBottomRight\", {\r\n /**\r\n * @return Radius (px or Percent)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"cornerRadiusBottomRight\");\r\n },\r\n /**\r\n * Radius of the bottom-right corner in pixels.\r\n *\r\n * @default 3\r\n * @param value Radius (px or Percent)\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"cornerRadiusBottomRight\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RoundedRectangle.prototype, \"cornerRadiusBottomLeft\", {\r\n /**\r\n * @return Radius (px or Percent)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"cornerRadiusBottomLeft\");\r\n },\r\n /**\r\n * Radius of the bottom-left corner in pixels.\r\n *\r\n * @default 3\r\n * @param value Radius (px or Percent)\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"cornerRadiusBottomLeft\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Measures the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n RoundedRectangle.prototype.measureElement = function () {\r\n };\r\n Object.defineProperty(RoundedRectangle.prototype, \"bbox\", {\r\n /**\r\n * Returns bounding box (square) for this element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n get: function () {\r\n if (this.definedBBox) {\r\n return this.definedBBox;\r\n }\r\n if (this.isMeasured) {\r\n return {\r\n x: 0,\r\n y: 0,\r\n width: this.innerWidth,\r\n height: this.innerHeight\r\n };\r\n }\r\n else {\r\n return { x: 0, y: 0, width: 0, height: 0 };\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return RoundedRectangle;\r\n}(Sprite));\r\nexport { RoundedRectangle };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"RoundedRectangle\"] = RoundedRectangle;\r\n//# sourceMappingURL=RoundedRectangle.js.map","/**\r\n * Functionality for drawing simple buttons.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../Container\";\r\nimport { Label } from \"./Label\";\r\nimport { RoundedRectangle } from \"../elements/RoundedRectangle\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { registry } from \"../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Button class is capable of drawing a simple rectangular button with\r\n * optionally rounded corners and an icon in it.\r\n *\r\n * @see {@link IButtonEvents} for a list of available events\r\n * @see {@link IButtonAdapters} for a list of available Adapters\r\n */\r\nvar Button = /** @class */ (function (_super) {\r\n __extends(Button, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Button() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"Button\";\r\n _this.tooltipY = 0;\r\n // Set defaults\r\n _this.iconPosition = \"left\";\r\n _this.layout = \"horizontal\";\r\n _this.contentAlign = \"center\";\r\n _this.contentValign = \"middle\";\r\n _this.padding(8, 16, 8, 16);\r\n _this.setStateOnChildren = true;\r\n var interfaceColors = new InterfaceColorSet();\r\n // Create background\r\n var background = _this.background;\r\n background.fill = interfaceColors.getFor(\"secondaryButton\");\r\n background.stroke = interfaceColors.getFor(\"secondaryButtonStroke\");\r\n background.fillOpacity = 1;\r\n background.strokeOpacity = 1;\r\n background.cornerRadius(3, 3, 3, 3);\r\n // Create the label element\r\n _this.label = new Label();\r\n _this.label.fill = interfaceColors.getFor(\"secondaryButtonText\");\r\n ;\r\n _this.label.shouldClone = false;\r\n // Create default states\r\n var hoverState = background.states.create(\"hover\");\r\n hoverState.properties.fillOpacity = 1;\r\n hoverState.properties.fill = interfaceColors.getFor(\"secondaryButtonHover\");\r\n var downState = background.states.create(\"down\");\r\n downState.transitionDuration = 100;\r\n downState.properties.fill = interfaceColors.getFor(\"secondaryButtonDown\");\r\n downState.properties.fillOpacity = 1;\r\n // Set up accessibility\r\n // A button should be always focusable\r\n _this.role = \"button\";\r\n _this.focusable = true;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(Button.prototype, \"icon\", {\r\n /**\r\n * @return Icon Sprite\r\n */\r\n get: function () {\r\n return this._icon;\r\n },\r\n /**\r\n * A [[Sprite]] to be used as an icon on button.\r\n *\r\n * @param icon Icon Sprite\r\n */\r\n set: function (icon) {\r\n var currentIcon = this._icon;\r\n if (currentIcon) {\r\n //this._icon.dispose();\r\n //this.removeDispose(currentIcon);\r\n currentIcon.parent = undefined;\r\n }\r\n if (icon) {\r\n this._icon = icon;\r\n icon.parent = this;\r\n icon.interactionsEnabled = false;\r\n icon.shouldClone = false;\r\n this.iconPosition = this.iconPosition;\r\n this._disposers.push(icon);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Button.prototype, \"iconPosition\", {\r\n /**\r\n * @return Icon position\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"iconPosition\");\r\n },\r\n /**\r\n * Icon position: \"left\" or \"right\".\r\n *\r\n * @default \"left\"\r\n * @param position Icon position\r\n */\r\n set: function (position) {\r\n this.setPropertyValue(\"iconPosition\", position);\r\n if (this.icon) {\r\n if (position == \"left\") {\r\n this.icon.toBack();\r\n }\r\n else {\r\n this.icon.toFront();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Button.prototype, \"label\", {\r\n /**\r\n * @return Label element\r\n */\r\n get: function () {\r\n return this._label;\r\n },\r\n /**\r\n * [[Label]] element to be used for text.\r\n *\r\n * @param label element\r\n */\r\n set: function (label) {\r\n if (this._label) {\r\n //this._label.dispose();\r\n this.removeDispose(this._label);\r\n }\r\n this._label = label;\r\n if (label) {\r\n label.parent = this;\r\n label.interactionsEnabled = false;\r\n this._disposers.push(this._label);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates a background element for the button.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Background element\r\n */\r\n Button.prototype.createBackground = function () {\r\n return new RoundedRectangle();\r\n };\r\n /**\r\n * Copies properties and other attributes.\r\n *\r\n * @param source Source\r\n */\r\n Button.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n if (source.label) {\r\n this.label.copyFrom(source.label);\r\n }\r\n if (source.icon) {\r\n this.icon = source.icon.clone();\r\n }\r\n };\r\n return Button;\r\n}(Container));\r\nexport { Button };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Button\"] = Button;\r\n//# sourceMappingURL=Button.js.map","/**\r\n * Functionality for drawing circles.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../Sprite\";\r\nimport { percent } from \"../utils/Percent\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $math from \"../utils/Math\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Used to create a circle\r\n * @see {@link ICircleEvents} for a list of available events\r\n * @see {@link ICircleAdapters} for a list of available Adapters\r\n */\r\nvar Circle = /** @class */ (function (_super) {\r\n __extends(Circle, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Circle() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Circle\";\r\n _this.element = _this.paper.add(\"circle\");\r\n _this.setPercentProperty(\"radius\", percent(100));\r\n _this.setPropertyValue(\"horizontalCenter\", \"middle\");\r\n _this.setPropertyValue(\"verticalCenter\", \"middle\");\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the circle.\r\n */\r\n Circle.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n this.element.attr({ \"r\": this.pixelRadius });\r\n };\r\n Object.defineProperty(Circle.prototype, \"radius\", {\r\n /**\r\n * @return Radius\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"radius\");\r\n },\r\n /**\r\n * Radius of the circle.\r\n *\r\n * Can be either absolute (pixels) or relative ([Percent]).\r\n *\r\n * @param value Radius\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"radius\", value, true, false, 10, false);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Circle.prototype, \"pixelRadius\", {\r\n /**\r\n * Radius of the circle in pixels.\r\n *\r\n * This is a read-only property. To set radius in pixels, use `radius`\r\n * property.\r\n *\r\n * @readonly\r\n * @return Radius (px)\r\n */\r\n get: function () {\r\n return $utils.relativeToValue(this.radius, $math.min(this.innerWidth / 2, this.innerHeight / 2));\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Updates bounding box.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Circle.prototype.measureElement = function () {\r\n var pixelRadius = this.pixelRadius;\r\n this._bbox = {\r\n x: -pixelRadius,\r\n y: -pixelRadius,\r\n width: pixelRadius * 2,\r\n height: pixelRadius * 2\r\n };\r\n };\r\n return Circle;\r\n}(Sprite));\r\nexport { Circle };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Circle\"] = Circle;\r\n//# sourceMappingURL=Circle.js.map","/**\r\n * Ellipse module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Circle } from \"./Circle\";\r\nimport { registry } from \"../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws an ellipse\r\n * @see {@link IEllipseEvents} for a list of available events\r\n * @see {@link IEllipseAdapters} for a list of available Adapters\r\n */\r\nvar Ellipse = /** @class */ (function (_super) {\r\n __extends(Ellipse, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Ellipse() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Ellipse\";\r\n _this.element = _this.paper.add(\"ellipse\");\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the ellipsis.\r\n */\r\n Ellipse.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n this.element.attr({ \"rx\": this.radius });\r\n this.element.attr({ \"ry\": this.radiusY });\r\n };\r\n Object.defineProperty(Ellipse.prototype, \"radiusY\", {\r\n /**\r\n * @return Vertical radius\r\n */\r\n get: function () {\r\n return this.innerHeight / 2;\r\n },\r\n /**\r\n * Vertical radius.\r\n *\r\n * It's a relative size to the `radius`.\r\n *\r\n * E.g. 0.8 will mean the height of the ellipsis will be 80% of it's\r\n * horizontal radius.\r\n *\r\n * @param value Vertical radius\r\n */\r\n set: function (value) {\r\n this.height = value * 2;\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Ellipse.prototype, \"radius\", {\r\n /**\r\n * @return Horizontal radius\r\n */\r\n get: function () {\r\n return this.innerWidth / 2;\r\n },\r\n /**\r\n * Horizontal radius.\r\n *\r\n * @param value Horizontal radius\r\n */\r\n set: function (value) {\r\n this.width = value * 2;\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Ellipse;\r\n}(Circle));\r\nexport { Ellipse };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Ellipse\"] = Ellipse;\r\n//# sourceMappingURL=Ellipse.js.map","/**\r\n * Functionality for adding images in SVG tree.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../Sprite\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $dom from \"../utils/DOM\";\r\nimport * as $type from \"../utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Used to add `<image>` elements to SVG.\r\n *\r\n * @see {@link IImageEvents} for a list of available events\r\n * @see {@link IImageAdapters} for a list of available Adapters\r\n */\r\nvar Image = /** @class */ (function (_super) {\r\n __extends(Image, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Image() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Image\";\r\n _this.element = _this.paper.add(\"image\");\r\n _this.applyTheme();\r\n _this.width = 50;\r\n _this.height = 50;\r\n return _this;\r\n }\r\n /**\r\n * Draws an `<image>` element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Image.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n if (this.href) {\r\n var width = this.innerWidth;\r\n var height = this.innerHeight;\r\n if ($type.isNumber(this.widthRatio)) {\r\n width = height * this.widthRatio;\r\n this.width = width;\r\n }\r\n if ($type.isNumber(this.heightRatio)) {\r\n height = width * this.heightRatio;\r\n this.height = height;\r\n }\r\n this.element.attr({\r\n \"width\": width,\r\n \"height\": height\r\n });\r\n this.element.attrNS($dom.XLINK, \"xlink:href\", this.href);\r\n }\r\n };\r\n Object.defineProperty(Image.prototype, \"href\", {\r\n /**\r\n * @return Image URI\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"href\");\r\n },\r\n /**\r\n * An image URI.\r\n *\r\n * @param value Image URI\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"href\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Image.prototype, \"widthRatio\", {\r\n /**\r\n * @return Ratio\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"widthRatio\");\r\n },\r\n /**\r\n * Sets image `width` relatively to its `height`.\r\n *\r\n * If image's `height = 100` and `widthRatio = 0.5` the actual width will be\r\n * `50`.\r\n *\r\n * @param value Ratio\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"widthRatio\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Image.prototype, \"heightRatio\", {\r\n /**\r\n * @return Ratio\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"heightRatio\");\r\n },\r\n /**\r\n * Sets image `height` relatively to its `width`.\r\n *\r\n * If image's `width = 100` and `heightRatio = 0.5` the actual height will be\r\n * `50`.\r\n *\r\n * @param value Ratio\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"heightRatio\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Image.prototype, \"bbox\", {\r\n /**\r\n * Returns bounding box (square) for this element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n get: function () {\r\n return {\r\n x: 0,\r\n y: 0,\r\n width: this.pixelWidth,\r\n height: this.pixelHeight\r\n };\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Image;\r\n}(Sprite));\r\nexport { Image };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Image\"] = Image;\r\n//# sourceMappingURL=Image.js.map","/**\r\n * Line drawing functionality.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../Sprite\";\r\nimport { color } from \"../utils/Color\";\r\nimport { LinearGradient } from \"../rendering/fills/LinearGradient\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $math from \"../utils/Math\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws a line.\r\n *\r\n * @see {@link ILineEvents} for a list of available events\r\n * @see {@link ILineAdapters} for a list of available Adapters\r\n */\r\nvar Line = /** @class */ (function (_super) {\r\n __extends(Line, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Line() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Line\";\r\n _this.element = _this.paper.add(\"line\");\r\n _this.fill = color(); //\"none\";\r\n _this.x1 = 0;\r\n _this.y1 = 0;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the line.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Line.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n if (this.x1 == this.x2 || this.y1 == this.y2) {\r\n this.pixelPerfect = true;\r\n }\r\n else {\r\n this.pixelPerfect = false;\r\n }\r\n this.x1 = this.x1;\r\n this.x2 = this.x2;\r\n this.y1 = this.y1;\r\n this.y2 = this.y2;\r\n };\r\n Object.defineProperty(Line.prototype, \"x1\", {\r\n /**\r\n * @return X\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"x1\");\r\n },\r\n /**\r\n * X coordinate of first end.\r\n *\r\n * @param value X\r\n */\r\n set: function (value) {\r\n if (!$type.isNumber(value)) {\r\n value = 0;\r\n }\r\n var delta = 0;\r\n if (this.pixelPerfect && this.stroke instanceof LinearGradient) {\r\n delta = 0.00001;\r\n }\r\n this.setPropertyValue(\"x1\", value, true);\r\n this.element.attr({ \"x1\": value + delta });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Line.prototype, \"x2\", {\r\n /**\r\n * @return X\r\n */\r\n get: function () {\r\n var value = this.getPropertyValue(\"x2\");\r\n if (!$type.isNumber(value)) {\r\n value = this.pixelWidth;\r\n }\r\n return value;\r\n },\r\n /**\r\n * X coordinate of second end.\r\n *\r\n * @param value X\r\n */\r\n set: function (value) {\r\n if (!$type.isNumber(value)) {\r\n value = 0;\r\n }\r\n this.setPropertyValue(\"x2\", value, true);\r\n this.element.attr({ \"x2\": value });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Line.prototype, \"y1\", {\r\n /**\r\n * @return Y\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"y1\");\r\n },\r\n /**\r\n * Y coordinate of first end.\r\n *\r\n * @param value Y\r\n */\r\n set: function (value) {\r\n if (!$type.isNumber(value)) {\r\n value = 0;\r\n }\r\n var delta = 0;\r\n if (this.pixelPerfect && this.stroke instanceof LinearGradient) {\r\n delta = 0.00001;\r\n }\r\n this.setPropertyValue(\"y1\", value, true);\r\n this.element.attr({ \"y1\": value + delta });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Line.prototype, \"y2\", {\r\n /**\r\n * @return Y\r\n */\r\n get: function () {\r\n var value = this.getPropertyValue(\"y2\");\r\n if (!$type.isNumber(value)) {\r\n value = this.pixelHeight;\r\n }\r\n return value;\r\n },\r\n /**\r\n * Y coordinate of second end.\r\n *\r\n * @param value Y\r\n */\r\n set: function (value) {\r\n if (!$type.isNumber(value)) {\r\n value = 0;\r\n }\r\n this.setPropertyValue(\"y2\", value, true);\r\n this.element.attr({ \"y2\": value });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Converts relative position along the line (0-1) into pixel coordinates.\r\n *\r\n * @param position Position (0-1)\r\n * @return Coordinates\r\n */\r\n Line.prototype.positionToPoint = function (position) {\r\n var point1 = { x: this.x1, y: this.y1 };\r\n var point2 = { x: this.x2, y: this.y2 };\r\n var point = $math.getMidPoint(point1, point2, position);\r\n var angle = $math.getAngle(point1, point2);\r\n return { x: point.x, y: point.y, angle: angle };\r\n };\r\n return Line;\r\n}(Sprite));\r\nexport { Line };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Line\"] = Line;\r\n//# sourceMappingURL=Line.js.map","/**\r\n * Pointed shape module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../Sprite\";\r\nimport * as $type from \"../utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws a shape with a pointer.\r\n *\r\n * @see {@link IPointedShapeEvents} for a list of available events\r\n * @see {@link IPointedShapeAdapters} for a list of available Adapters\r\n */\r\nvar PointedShape = /** @class */ (function (_super) {\r\n __extends(PointedShape, _super);\r\n /**\r\n * Constructor\r\n */\r\n function PointedShape() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"PointedShape\";\r\n _this.pointerBaseWidth = 15;\r\n _this.pointerLength = 10;\r\n _this.pointerY = 0;\r\n _this.pointerX = 0;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n PointedShape.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n if (!$type.isNumber(this.pointerX)) {\r\n this.pointerX = this.pixelWidth / 2;\r\n }\r\n if (!$type.isNumber(this.pointerY)) {\r\n this.pointerY = this.pixelHeight + 10;\r\n }\r\n };\r\n Object.defineProperty(PointedShape.prototype, \"pointerBaseWidth\", {\r\n /**\r\n * @return Width (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"pointerBaseWidth\");\r\n },\r\n /**\r\n * A width of the pinter's (stem's) thick end (base) in pixels.\r\n *\r\n * @default 15\r\n * @param value Width (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"pointerBaseWidth\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(PointedShape.prototype, \"pointerLength\", {\r\n /**\r\n * @return Length (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"pointerLength\");\r\n },\r\n /**\r\n * A length of the pinter (stem) in pixels.\r\n *\r\n * @default 10\r\n * @param value Length (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"pointerLength\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(PointedShape.prototype, \"pointerX\", {\r\n /**\r\n * @return X\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"pointerX\");\r\n },\r\n /**\r\n * X coordinate the shape is pointing to.\r\n *\r\n * @param value X\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"pointerX\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(PointedShape.prototype, \"pointerY\", {\r\n /**\r\n * @return Y\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"pointerY\");\r\n },\r\n /**\r\n * Y coordinate the shape is pointing to.\r\n *\r\n * @param value Y\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"pointerY\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return PointedShape;\r\n}(Sprite));\r\nexport { PointedShape };\r\n//# sourceMappingURL=PointedShape.js.map","/**\r\n * Pointed rectangle module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { PointedShape } from \"./PointedShape\";\r\nimport * as $math from \"../utils/Math\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws a rectangle with a pointer.\r\n *\r\n * @see {@link IPointedRectangleEvents} for a list of available events\r\n * @see {@link IPointedRectangleAdapters} for a list of available Adapters\r\n */\r\nvar PointedRectangle = /** @class */ (function (_super) {\r\n __extends(PointedRectangle, _super);\r\n /**\r\n * Constructor\r\n */\r\n function PointedRectangle() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"PointedRectangle\";\r\n _this.element = _this.paper.add(\"path\");\r\n _this.cornerRadius = 6;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n PointedRectangle.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n var cr = this.cornerRadius;\r\n var w = this.innerWidth;\r\n var h = this.innerHeight;\r\n if (w > 0 && h > 0) {\r\n var x = this.pointerX;\r\n var y = this.pointerY;\r\n var bwh = this.pointerBaseWidth / 2;\r\n var maxcr = $math.min(w / 2, h / 2);\r\n var crtl = $math.fitToRange(cr, 0, maxcr);\r\n var crtr = $math.fitToRange(cr, 0, maxcr);\r\n var crbr = $math.fitToRange(cr, 0, maxcr);\r\n var crbl = $math.fitToRange(cr, 0, maxcr);\r\n // corner coordinates\r\n // top left\r\n var xtl = 0;\r\n var ytl = 0;\r\n // top right\r\n var xtr = w;\r\n var ytr = 0;\r\n // bottom right\r\n var xbr = w;\r\n var ybr = h;\r\n // bottom left\r\n var xbl = 0;\r\n var ybl = h;\r\n var lineT = void 0;\r\n var lineR = void 0;\r\n var lineB = void 0;\r\n var lineL = void 0;\r\n // find stem base side: http://$math.stackexchange.com/questions/274712/calculate-on-which-side-of-straign-line-is-dot-located\r\n // d=(x−x1)(y2−y1)−(y−y1)(x2−x1)\r\n var d1 = (x - xtl) * (ybr - ytl) - (y - ytl) * (xbr - xtl);\r\n var d2 = (x - xbl) * (ytr - ybl) - (y - ybl) * (xtr - xbl);\r\n // top\r\n if (d1 > 0 && d2 > 0) {\r\n var stemX = $math.fitToRange(x, crtl + bwh, w - bwh - crtr);\r\n y = $math.fitToRange(y, -Infinity, 0);\r\n lineT = \"M\" + crtl + \",0 L\" + (stemX - bwh) + \",0 L\" + x + \",\" + y + \" L\" + (stemX + bwh) + \",0 L\" + (w - crtr) + \",0\";\r\n }\r\n else {\r\n lineT = \"M\" + crtl + \",0 L\" + (w - crtr) + \",0\";\r\n }\r\n // bottom\r\n if (d1 < 0 && d2 < 0) {\r\n var stemX = $math.fitToRange(x, crbl + bwh, w - bwh - crbr);\r\n y = $math.fitToRange(y, h, Infinity);\r\n lineB = \" L\" + (w - crbr) + \",\" + h + \" L\" + (stemX + bwh) + \",\" + h + \" L\" + x + \",\" + y + \" L\" + (stemX - bwh) + \",\" + h + \" L\" + crbl + \",\" + h;\r\n }\r\n else {\r\n lineB = \" L\" + crbl + \",\" + h;\r\n }\r\n // left\r\n if (d1 < 0 && d2 > 0) {\r\n var stemY = $math.fitToRange(y, crtl + bwh, h - crbl - bwh);\r\n x = $math.fitToRange(x, -Infinity, 0);\r\n lineL = \" L0,\" + (h - crbl) + \" L0,\" + (stemY + bwh) + \" L\" + x + \",\" + y + \" L0,\" + (stemY - bwh) + \" L0,\" + crtl;\r\n }\r\n else {\r\n lineL = \" L0,\" + crtl;\r\n }\r\n // right\r\n if (d1 > 0 && d2 < 0) {\r\n var stemY = $math.fitToRange(y, crtr + bwh, h - bwh - crbr);\r\n x = $math.fitToRange(x, w, Infinity);\r\n lineR = \" L\" + w + \",\" + crtr + \" L\" + w + \",\" + (stemY - bwh) + \" L\" + x + \",\" + y + \" L\" + w + \",\" + (stemY + bwh) + \" L\" + w + \",\" + (h - crbr);\r\n }\r\n else {\r\n lineR = \" L\" + w + \",\" + (h - crbr);\r\n }\r\n var arcTR = \" a\" + crtr + \",\" + crtr + \" 0 0 1 \" + crtr + \",\" + crtr;\r\n var arcBR = \" a\" + crbr + \",\" + crbr + \" 0 0 1 -\" + crbr + \",\" + crbr;\r\n var arcBL = \" a\" + crbl + \",\" + crbl + \" 0 0 1 -\" + crbl + \",-\" + crbl;\r\n var arcTL = \" a\" + crtl + \",\" + crtl + \" 0 0 1 \" + crtl + \",-\" + crtl;\r\n this.path = lineT + arcTR + lineR + arcBR + lineB + arcBL + lineL + arcTL;\r\n }\r\n };\r\n Object.defineProperty(PointedRectangle.prototype, \"cornerRadius\", {\r\n /**\r\n * @return Corner radius (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"cornerRadius\");\r\n },\r\n /**\r\n * Radius of rectangle's border in pixels.\r\n *\r\n * @default 0\r\n * @param value Corner radius (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"cornerRadius\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return PointedRectangle;\r\n}(PointedShape));\r\nexport { PointedRectangle };\r\n//# sourceMappingURL=PointedRectangle.js.map","/**\r\n * A collection of functions that deals with path calculations.\r\n */\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $type from \"../utils/Type\";\r\nimport { getGhostPaper } from \"../rendering/Paper\";\r\nimport { options } from \"../Options\";\r\n/**\r\n * ============================================================================\r\n * PATH FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Returns an SVG path from a number of points.\r\n *\r\n * @ignore Exclude from docs\r\n * @param points An array of line elbow points\r\n * @return SVG path\r\n */\r\nexport function polyline(points) {\r\n var path = lineTo(points[0]);\r\n var prevPoint = { x: 0, y: 0 };\r\n var minStep = options.minPolylineStep;\r\n if (!$type.isNumber(minStep)) {\r\n minStep = 0.5;\r\n }\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n var point = points[i];\r\n if ($math.getDistance(point, prevPoint) > minStep) {\r\n path += lineTo(point);\r\n prevPoint = point;\r\n }\r\n }\r\n return path;\r\n}\r\n/**\r\n * Returns a starting point of an SVG path.\r\n *\r\n * @ignore Exclude from docs\r\n * @param point Starting point\r\n * @return SVG path\r\n */\r\nexport function moveTo(point) {\r\n return \" M\" + $math.round(point.x, 4) + \",\" + $math.round(point.y, 4) + \" \";\r\n}\r\n/**\r\n * Returns a line part of SVG path.\r\n *\r\n * @ignore Exclude from docs\r\n * @param point SVG path\r\n * @return SVG path\r\n */\r\nexport function lineTo(point) {\r\n return \" L\" + $math.round(point.x, 4) + \",\" + $math.round(point.y, 4) + \" \";\r\n}\r\n/**\r\n * Returns a quadratic curve part of an SVG path.\r\n *\r\n * @ignore Exclude from docs\r\n * @param point End point of the curve\r\n * @param controlPoint Control point\r\n * @return SVG path\r\n */\r\nexport function quadraticCurveTo(point, controlPoint) {\r\n return \" Q\" + $math.round(controlPoint.x, 4)\r\n + \",\" + $math.round(controlPoint.y, 4) + \" \" + $math.round(point.x, 4)\r\n + \",\" + $math.round(point.y, 4);\r\n}\r\n/**\r\n * Returns a cubic curve part of an SVG path.\r\n *\r\n * @ignore Exclude from docs\r\n * @param point End point of the curve\r\n * @param controlPointA Control point A\r\n * @param controlPointB Control point B\r\n * @return SVG path\r\n */\r\nexport function cubicCurveTo(point, controlPointA, controlPointB) {\r\n return \" C\" + $math.round(controlPointA.x, 4)\r\n + \",\" + $math.round(controlPointA.y, 4) + \" \" + $math.round(controlPointB.x, 4)\r\n + \",\" + $math.round(controlPointB.y, 4) + \" \" + $math.round(point.x, 4)\r\n + \",\" + $math.round(point.y, 4);\r\n}\r\n/**\r\n * Returns a terminator for an SVG path.\r\n *\r\n * @ignore Exclude from docs\r\n * @return SVG path\r\n */\r\nexport function closePath() {\r\n return \" Z\";\r\n}\r\n/**\r\n * Returns an arc part of an SVG path.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Better parameter descriptions\r\n * @param startAngle Starting angle\r\n * @param arc Arc\r\n * @param radius Radius\r\n * @param radiusY Vertical radius\r\n * @return SVG path\r\n */\r\nexport function arcTo(startAngle, arc, radius, radiusY) {\r\n if (arc == 0) {\r\n return \"\";\r\n }\r\n if (!$type.isNumber(radiusY)) {\r\n radiusY = radius;\r\n }\r\n var path = \"\";\r\n var c = \",\";\r\n var segments = Math.ceil(Math.abs(arc) / 180);\r\n var l = 1;\r\n if (arc < 0) {\r\n l = 0;\r\n }\r\n // previous, as we use a not A\r\n var pax = 0;\r\n var pay = 0;\r\n // center\r\n var cx = -$math.cos(startAngle) * radius;\r\n var cy = -$math.sin(startAngle) * radiusY;\r\n // foir very short angles and big radius, solves artefacts\r\n if (arc < 0.5 && radius > 3000) {\r\n var endAngle = startAngle + arc;\r\n var ax = $math.round($math.cos(endAngle) * radius, 4);\r\n var ay = $math.round($math.sin(endAngle) * radiusY, 4);\r\n return lineTo({ x: ax, y: ay });\r\n }\r\n for (var i = 0; i < segments; i++) {\r\n var endAngle = startAngle + arc / segments * (i + 1);\r\n var ax = $math.round($math.cos(endAngle) * radius + cx - pax, 4);\r\n var ay = $math.round($math.sin(endAngle) * radiusY + cy - pay, 4);\r\n path += \" a\" + radius + c + radiusY + c + 0 + c + 0 + c + l + c + ax + c + ay;\r\n pax = ax;\r\n pay = ay;\r\n }\r\n return path;\r\n}\r\n/**\r\n * Creates an arc path.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param startAngle [description]\r\n * @param arc [description]\r\n * @param radius [description]\r\n * @param innerRadius [description]\r\n * @param radiusY [description]\r\n * @param cornerRadius [description]\r\n * @param innerCornerRadius [description]\r\n * @return SVG path\r\n */\r\nexport function arc(startAngle, arc, radius, innerRadius, radiusY, cornerRadius, innerCornerRadius) {\r\n if (arc == 0) {\r\n return \"\";\r\n }\r\n if (!$type.isNumber(innerRadius)) {\r\n innerRadius = 0;\r\n }\r\n if (radius == 0 && innerRadius <= 0) {\r\n return \"\";\r\n }\r\n if (radius < innerRadius) {\r\n var temp = radius;\r\n radius = innerRadius;\r\n innerRadius = temp;\r\n if ($type.isNumber(radiusY)) {\r\n radiusY = radiusY / innerRadius * radius;\r\n }\r\n }\r\n arc = $math.min(arc, 360);\r\n if (arc == 360) {\r\n cornerRadius = 0;\r\n innerCornerRadius = 0;\r\n }\r\n var endAngle = startAngle + arc;\r\n var crSin = $math.sin($math.min(arc, 45) / 2);\r\n radiusY = $type.isNumber(radiusY) ? radiusY : radius;\r\n cornerRadius = cornerRadius || 0;\r\n innerCornerRadius = $type.isNumber(innerCornerRadius) ? innerCornerRadius : cornerRadius;\r\n var innerRadiusY = (radiusY / radius) * innerRadius;\r\n var cornerRadiusY = (radiusY / radius) * cornerRadius;\r\n var innerCornerRadiusY = (radiusY / radius) * innerCornerRadius;\r\n cornerRadius = $math.fitToRange(cornerRadius, 0, (radius - innerRadius) / 2);\r\n cornerRadiusY = $math.fitToRange(cornerRadiusY, 0, (radiusY - innerRadiusY) / 2);\r\n innerCornerRadius = $math.fitToRange(innerCornerRadius, 0, (radius - innerRadius) / 2);\r\n innerCornerRadiusY = $math.fitToRange(innerCornerRadiusY, 0, (radiusY - innerRadiusY) / 2);\r\n cornerRadius = $math.round($math.fitToRange(cornerRadius, 0, radius * crSin), 4);\r\n cornerRadiusY = $math.round($math.fitToRange(cornerRadiusY, 0, radiusY * crSin), 4);\r\n innerCornerRadius = $math.round($math.fitToRange(innerCornerRadius, 0, innerRadius * crSin), 4);\r\n innerCornerRadiusY = $math.round($math.fitToRange(innerCornerRadiusY, 0, innerRadiusY * crSin), 4);\r\n var crAngle = Math.asin(cornerRadius / radius / 2) * $math.DEGREES * 2;\r\n var crAngleY = Math.asin(cornerRadiusY / radiusY / 2) * $math.DEGREES * 2;\r\n if (innerRadius < innerCornerRadius) {\r\n innerRadius = innerCornerRadius;\r\n }\r\n if (innerRadiusY < innerCornerRadiusY) {\r\n innerRadiusY = innerCornerRadiusY;\r\n }\r\n var crInnerAngle = Math.asin(innerCornerRadius / innerRadius / 2) * $math.DEGREES * 2;\r\n var crInnerAngleY = Math.asin(innerCornerRadiusY / innerRadiusY / 2) * $math.DEGREES * 2;\r\n if (!$type.isNumber(crInnerAngle)) {\r\n crInnerAngle = 0;\r\n }\r\n if (!$type.isNumber(crInnerAngleY)) {\r\n crInnerAngleY = 0;\r\n }\r\n var middleAngle = startAngle + arc / 2;\r\n var mPoint = { x: $math.round($math.cos(middleAngle) * innerRadius, 4), y: $math.sin(middleAngle) * innerRadiusY };\r\n var a0 = { x: $math.cos(startAngle) * (innerRadius + innerCornerRadius), y: $math.sin(startAngle) * (innerRadiusY + innerCornerRadiusY) };\r\n var b0 = { x: $math.cos(startAngle) * (radius - cornerRadius), y: $math.sin(startAngle) * (radiusY - cornerRadiusY) };\r\n var c0 = { x: $math.cos(endAngle) * (radius - cornerRadius), y: $math.sin(endAngle) * (radiusY - cornerRadiusY) };\r\n var d0 = { x: $math.cos(endAngle) * (innerRadius + innerCornerRadius), y: $math.sin(endAngle) * (innerRadiusY + innerCornerRadiusY) };\r\n var b1 = { x: $math.cos(startAngle + crAngle) * radius, y: $math.sin(startAngle + crAngleY) * radiusY };\r\n var d1 = { x: $math.cos(endAngle - crInnerAngle) * innerRadius, y: $math.sin(endAngle - crInnerAngleY) * innerRadiusY };\r\n // some magic math\r\n innerCornerRadius += innerCornerRadius * $math.sin(crInnerAngle / 2);\r\n innerCornerRadiusY += innerCornerRadiusY * $math.sin(crInnerAngleY / 2);\r\n if (crInnerAngle > (endAngle - startAngle) / 2) {\r\n d1 = mPoint;\r\n }\r\n var path = \"\";\r\n // start from b if this is full circle\r\n if (arc == 360) {\r\n path = moveTo(b0);\r\n }\r\n // otherwise start from a\r\n else {\r\n path = moveTo(a0);\r\n path += lineTo(b0);\r\n path += arcToPoint(b1, cornerRadius, cornerRadiusY, true);\r\n }\r\n // draw arc\r\n path += arcTo(startAngle + crAngle, arc - 2 * crAngle, radius, radiusY);\r\n // draw inner arc\r\n if ($type.isNumber(innerRadius) && innerRadius != 0) {\r\n // move to B if this is full circle\r\n if (arc == 360 && cornerRadius == 0) {\r\n path += moveTo(d0);\r\n }\r\n // draw line otherwise\r\n else {\r\n path += arcToPoint(c0, cornerRadius, cornerRadiusY, true);\r\n path += lineTo(d0);\r\n path += arcToPoint(d1, innerCornerRadius, innerCornerRadiusY, true);\r\n }\r\n path += arcTo(endAngle - crInnerAngle, -(arc - 2 * crInnerAngle), innerRadius, innerRadiusY);\r\n if (arc < 360 || cornerRadius > 0) {\r\n path += arcToPoint(a0, innerCornerRadius, innerCornerRadiusY, true);\r\n }\r\n path += lineTo(a0);\r\n }\r\n else {\r\n path += arcToPoint(c0, cornerRadius, cornerRadiusY, true);\r\n if (arc < 360) {\r\n path += lineTo(a0);\r\n }\r\n }\r\n return path;\r\n}\r\n/**\r\n * Creates a path for an arc to specific coordinate.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param point Reference point\r\n * @param radius Radius\r\n * @param radiusY Vertical radius (for skewed arcs)\r\n * @param sweepFlag [description]\r\n * @param largeArcFlag [description]\r\n * @param xAxisRotation [description]\r\n * @return Arc path\r\n */\r\nexport function arcToPoint(point, radius, radiusY, sweepFlag, largeArcFlag, xAxisRotation) {\r\n if (radius == 0) {\r\n return \"\";\r\n }\r\n xAxisRotation = xAxisRotation || 0;\r\n largeArcFlag = Boolean(largeArcFlag);\r\n sweepFlag = Boolean(sweepFlag);\r\n var c = \",\";\r\n var sweepFlagValue = +sweepFlag; // converts to 1 or 0\r\n var largeArcFlagValue = +largeArcFlag; // converts to 1 or 0\r\n return \" A\" + radius + c + radiusY + c + xAxisRotation + c + largeArcFlagValue + c + sweepFlagValue + c + $math.round(point.x, 4) + c + $math.round(point.y, 4);\r\n}\r\n/**\r\n * Creates a new rectangle.\r\n *\r\n * @ignore Exclude from docs\r\n * @param width Width (px)\r\n * @param height Height (px)\r\n * @param x X position\r\n * @param y Y position\r\n * @return Rectangle\r\n */\r\nexport function rectangle(width, height, x, y) {\r\n if (!$type.isNumber(x)) {\r\n x = 0;\r\n }\r\n if (!$type.isNumber(y)) {\r\n y = 0;\r\n }\r\n return moveTo({ x: x, y: y }) + lineTo({ x: x + width, y: y }) + lineTo({ x: x + width, y: y + height }) + lineTo({ x: x, y: y + height }) + closePath();\r\n}\r\n/**\r\n * Converts a rectangle to an SVG path.\r\n *\r\n * @ignore Exclude from docs\r\n * @param rect Rectangle\r\n * @param ccw Counter-clockwise?\r\n * @return SVG path\r\n */\r\nexport function rectToPath(rect, ccw) {\r\n var c = \",\";\r\n var L = \" L\";\r\n if (ccw) {\r\n return \"M\" + rect.x\r\n + c + rect.y + L + rect.x\r\n + c + (rect.y + rect.height) + L + (rect.x + rect.width)\r\n + c + (rect.y + rect.height) + L + (rect.x + rect.width)\r\n + c + rect.y + L + rect.x\r\n + c + rect.y;\r\n }\r\n else {\r\n return \"M\" + rect.x\r\n + c + rect.y + L + (rect.x + rect.width)\r\n + c + rect.y + L + (rect.x + rect.width)\r\n + c + (rect.y + rect.height) + L + rect.x\r\n + c + (rect.y + rect.height) + L + rect.x\r\n + c + rect.y;\r\n }\r\n}\r\n/**\r\n * Converts SVG path to array of points.\r\n *\r\n * Note, this is experimental feature based on method which is deprecated\r\n * on some browsers and some browsers do not support it at all.\r\n *\r\n * You can save the output of this function, but not rely on it completely.\r\n */\r\nexport function pathToPoints(path, pointCount) {\r\n var paper = getGhostPaper();\r\n var svgPath = paper.add(\"path\").node;\r\n svgPath.setAttribute(\"d\", path);\r\n if (svgPath.getPointAtLength && svgPath.getTotalLength) {\r\n var length_1 = svgPath.getTotalLength();\r\n var toPoints = [];\r\n for (var i = 0; i < pointCount; i++) {\r\n var point = svgPath.getPointAtLength(i / pointCount * length_1);\r\n toPoints.push({ x: point.x, y: point.y });\r\n }\r\n return toPoints;\r\n }\r\n svgPath.remove();\r\n}\r\nexport function spiralPoints(cx, cy, radius, radiusY, innerRadius, step, radiusStep, startAngle, endAngle) {\r\n if (!$type.isNumber(startAngle)) {\r\n startAngle = 0;\r\n }\r\n if (!$type.isNumber(startAngle)) {\r\n endAngle = startAngle;\r\n }\r\n var r = innerRadius + 0.01;\r\n var angle = startAngle * $math.RADIANS;\r\n var points = [];\r\n while (r < radius + radiusStep) {\r\n var stepSize = step;\r\n if (stepSize / 2 > r) {\r\n stepSize = 2 * r;\r\n }\r\n angle += 2 * Math.asin(stepSize / 2 / r);\r\n if (angle * $math.DEGREES > endAngle + ((radius - innerRadius) / radiusStep) * 360) {\r\n break;\r\n }\r\n var degrees = angle * $math.DEGREES;\r\n var point = { x: cx + r * Math.cos(angle), y: cy + r * radiusY / radius * Math.sin(angle) };\r\n points.push(point);\r\n r = innerRadius + degrees / 360 * radiusStep;\r\n }\r\n points.shift();\r\n return points;\r\n}\r\nexport function pointsToPath(points) {\r\n if (!points || points.length == 0) {\r\n return \"\";\r\n }\r\n var path = moveTo(points[0]);\r\n if (points && points.length > 0) {\r\n for (var i = 1; i < points.length; i++) {\r\n path += lineTo(points[i]);\r\n }\r\n }\r\n return path;\r\n}\r\n//# sourceMappingURL=Path.js.map","/**\r\n * Polyline module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../Sprite\";\r\nimport { color } from \"../utils/Color\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $path from \"../rendering/Path\";\r\nimport * as $math from \"../utils/Math\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws a polyline.\r\n *\r\n * @see {@link IPolylineEvents} for a list of available events\r\n * @see {@link IPolylineAdapters} for a list of available Adapters\r\n */\r\nvar Polyline = /** @class */ (function (_super) {\r\n __extends(Polyline, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Polyline() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * [_distance description]\r\n *\r\n * @todo Description\r\n */\r\n _this._distance = 0;\r\n _this.className = \"Polyline\";\r\n _this.element = _this.paper.add(\"path\");\r\n _this.shapeRendering = \"auto\";\r\n _this.fill = color();\r\n _this.strokeOpacity = 1;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Creats and adds an SVG path for the arc.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Polyline.prototype.makePath = function () {\r\n this._distance = 0;\r\n var segments = this.segments;\r\n if (segments && segments.length > 0) {\r\n var path = \"\";\r\n for (var i = 0, len = segments.length; i < len; i++) {\r\n var points = segments[i];\r\n if (points.length > 0) {\r\n path += $path.moveTo(points[0]);\r\n for (var p = 1; p < points.length; p++) {\r\n var point = points[p];\r\n path += $path.lineTo(point);\r\n this._distance += $math.getDistance(points[p - 1], point);\r\n }\r\n }\r\n }\r\n this.path = path;\r\n }\r\n this._realSegments = segments;\r\n };\r\n Object.defineProperty(Polyline.prototype, \"segments\", {\r\n /**\r\n * @return Segments\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"segments\");\r\n },\r\n /**\r\n * A list of segment coordinates for the multi-part line.\r\n *\r\n * @todo Example\r\n * @param segments Segments\r\n */\r\n set: function (segments) {\r\n this.setPropertyValue(\"segments\", segments);\r\n this.makePath();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Polyline.prototype, \"distance\", {\r\n /**\r\n * [distance description]\r\n *\r\n * @todo Description\r\n * @return [description]\r\n */\r\n get: function () {\r\n return this._distance;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Converts relative position along the line (0-1) into pixel coordinates.\r\n *\r\n * @param position Position (0-1)\r\n * @return Coordinates\r\n */\r\n Polyline.prototype.positionToPoint = function (position) {\r\n var deltaAngle = 0;\r\n if (position < 0) {\r\n position = Math.abs(position);\r\n deltaAngle = 180;\r\n }\r\n var segments = this._realSegments;\r\n if (segments) {\r\n var totalDistance = this.distance;\r\n var currentDistance = 0;\r\n var distanceAB = void 0;\r\n var positionA = 0;\r\n var positionB = 0;\r\n var pointA = void 0;\r\n var pointB = void 0;\r\n for (var s = 0; s < segments.length; s++) {\r\n var points = segments[s];\r\n if (points.length > 1) {\r\n for (var p = 1; p < points.length; p++) {\r\n pointA = points[p - 1];\r\n pointB = points[p];\r\n positionA = currentDistance / totalDistance;\r\n distanceAB = $math.getDistance(pointA, pointB);\r\n currentDistance += distanceAB;\r\n positionB = currentDistance / totalDistance;\r\n if (positionA <= position && positionB > position) {\r\n s = segments.length;\r\n break;\r\n }\r\n }\r\n }\r\n else if (points.length == 1) {\r\n pointA = points[0];\r\n pointB = points[0];\r\n positionA = 0;\r\n positionB = 1;\r\n }\r\n }\r\n if (pointA && pointB) {\r\n var positionAB = (position - positionA) / (positionB - positionA);\r\n var midPoint = $math.getMidPoint(pointA, pointB, positionAB);\r\n return { x: midPoint.x, y: midPoint.y, angle: deltaAngle + $math.getAngle(pointA, pointB) };\r\n }\r\n }\r\n return { x: 0, y: 0, angle: 0 };\r\n };\r\n Object.defineProperty(Polyline.prototype, \"realSegments\", {\r\n /**\r\n * @ignore\r\n */\r\n get: function () {\r\n return this._realSegments;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Polyline;\r\n}(Sprite));\r\nexport { Polyline };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Polyline\"] = Polyline;\r\n//# sourceMappingURL=Polyline.js.map","/**\r\n * Module for a multi-part arched line.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Polyline } from \"./Polyline\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws a multi-part arched line.\r\n *\r\n * @see {@link IPolyarcEvents} for a list of available events\r\n * @see {@link IPolyarcAdapters} for a list of available Adapters\r\n */\r\nvar Polyarc = /** @class */ (function (_super) {\r\n __extends(Polyarc, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Polyarc() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Polyarc\";\r\n _this.controlPointDistance = 0.5;\r\n _this.controlPointPosition = 0.5;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Creats and adds an SVG path for the arc.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Polyarc.prototype.makePath = function () {\r\n this._distance = 0;\r\n var segments = this.segments;\r\n if (segments && segments.length > 0) {\r\n var path = \"\";\r\n this._realSegments = [];\r\n for (var i = 0, len = segments.length; i < len; i++) {\r\n var points = segments[i];\r\n var realPoints = [];\r\n this._realSegments.push(realPoints);\r\n if (points.length > 0) {\r\n path += $path.moveTo(points[0]);\r\n for (var p = 1; p < points.length; p++) {\r\n var pointA = points[p - 1];\r\n var pointB = points[p];\r\n var distanceAB = $math.getDistance(pointB, pointA);\r\n var cpDistance = distanceAB * this.controlPointDistance;\r\n var controlPointPosition = this.controlPointPosition;\r\n var angle = -$math.getAngle(pointA, pointB);\r\n var cpx = pointA.x + (pointB.x - pointA.x) * controlPointPosition * 0.5 - cpDistance * $math.sin(angle);\r\n var cpy = pointA.y + (pointB.y - pointA.y) * controlPointPosition * 0.5 - cpDistance * $math.cos(angle);\r\n var controlPoint1 = { x: cpx, y: cpy };\r\n var cpx2 = pointA.x + (pointB.x - pointA.x) * controlPointPosition * 1.5 - cpDistance * $math.sin(angle);\r\n var cpy2 = pointA.y + (pointB.y - pointA.y) * controlPointPosition * 1.5 - cpDistance * $math.cos(angle);\r\n var controlPoint2 = { x: cpx2, y: cpy2 };\r\n path += $path.cubicCurveTo(pointB, controlPoint1, controlPoint2);\r\n // we add a lot of points in order to get the position/angle later\r\n var stepCount = Math.ceil(distanceAB);\r\n var prevPoint = pointA;\r\n if (stepCount > 0) {\r\n for (var i_1 = 0; i_1 <= stepCount; i_1++) {\r\n var point = $math.getPointOnCubicCurve(pointA, pointB, controlPoint1, controlPoint2, i_1 / stepCount);\r\n realPoints.push(point);\r\n this._distance += $math.getDistance(prevPoint, point);\r\n prevPoint = point;\r\n }\r\n }\r\n else {\r\n realPoints.push(pointA);\r\n }\r\n }\r\n }\r\n }\r\n this.path = path;\r\n }\r\n };\r\n Object.defineProperty(Polyarc.prototype, \"controlPointPosition\", {\r\n /**\r\n * @return Position (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"controlPointPosition\");\r\n },\r\n /**\r\n * Relative position along the line the control point is. (0-1)\r\n *\r\n * @default 0.5\r\n * @param value Position (0-1)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"controlPointPosition\", value);\r\n this.makePath();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Polyarc.prototype, \"controlPointDistance\", {\r\n /**\r\n * @return Distance (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"controlPointDistance\");\r\n },\r\n /**\r\n * Relative distance of the control point. (0-1)\r\n *\r\n * Default is half the length of the line. (0.5)\r\n *\r\n * @default 0.5\r\n * @param value Distance (0-1)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"controlPointDistance\", value);\r\n this.makePath();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Polyarc;\r\n}(Polyline));\r\nexport { Polyarc };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Polyarc\"] = Polyarc;\r\n//# sourceMappingURL=Polyarc.js.map","/**\r\n * Morpher module contains functionality that allows morphing one polygon to\r\n * another.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../Base\";\r\nimport { Animation, AnimationDisposer } from \"../utils/Animation\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $ease from \"../utils/Ease\";\r\nimport * as $type from \"../utils/Type\";\r\n/**\r\n * Morpher can be used to morph one polygon to some other polygon.\r\n */\r\nvar Morpher = /** @class */ (function (_super) {\r\n __extends(Morpher, _super);\r\n /**\r\n * Constructor.\r\n *\r\n * @param morphable An object to morph\r\n */\r\n function Morpher(morphable) {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * A storage for measurements.\r\n */\r\n _this._bboxes = [];\r\n /**\r\n * Duration of the morphing animation in milliseconds.\r\n */\r\n _this.morphDuration = 800;\r\n /**\r\n * An easing function to use for morphing animation.\r\n *\r\n * @see {@link Ease}\r\n */\r\n _this.morphEasing = $ease.cubicOut;\r\n /**\r\n * If set to `true`, all separate parts of the multi-part polygon will\r\n * morph into a single circle or polygon when using built-in methods\r\n * `morphToCircle()` or `morphToPolygon()`.\r\n *\r\n * Otherwise each separate part of polygon will morph to individual target\r\n * circle or polgyon.\r\n */\r\n _this.morphToSingle = true;\r\n /**\r\n * A ratio to scale morphed object in relation to the source object.\r\n */\r\n _this.scaleRatio = 1;\r\n _this.className = \"Morpher\";\r\n _this.morphable = morphable;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Morphs a polygon to another polygon.\r\n *\r\n * @param toPoints Corner points of the target shape\r\n * @param duration Duration in milliseconds\r\n * @param easing Easing function\r\n * @return Animation\r\n */\r\n Morpher.prototype.morphToPolygon = function (toPoints, duration, easing) {\r\n var points = this.morphable.currentPoints;\r\n if (points && toPoints) {\r\n this.sortPoints(points);\r\n this.sortPoints(toPoints);\r\n this._morphFromPointsReal = [];\r\n this._morphToPointsReal = [];\r\n if (!$type.hasValue(duration)) {\r\n duration = this.morphDuration;\r\n }\r\n if (!$type.hasValue(easing)) {\r\n easing = this.morphEasing;\r\n }\r\n this._morphFromPointsReal = this.normalizePoints(toPoints, points);\r\n this._morphToPointsReal = this.normalizePoints(points, toPoints);\r\n this.morphable.currentPoints = this._morphFromPointsReal;\r\n var animation = new Animation(this, { property: \"morphProgress\", from: 0, to: 1 }, duration, easing);\r\n this._disposers.push(animation);\r\n animation.start();\r\n return animation;\r\n }\r\n };\r\n /**\r\n * [normalizePoints description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param pointsA Point A\r\n * @param pointsB Point B\r\n * @return Normalized points\r\n */\r\n Morpher.prototype.normalizePoints = function (pointsA, pointsB) {\r\n for (var i = 0, len = pointsA.length; i < len; i++) {\r\n var surfaceA = pointsA[i][0];\r\n var holeA = pointsA[i][1];\r\n var bboxA = $type.getValue($math.getBBox(surfaceA));\r\n var middleX = bboxA.x + bboxA.width;\r\n var middleY = bboxA.y + bboxA.height;\r\n // check if we have the same in PointsB\r\n if (!pointsB[i]) {\r\n pointsB[i] = [];\r\n }\r\n // check if we have surface in pointsB\r\n if (surfaceA && !pointsB[i][0]) {\r\n pointsB[i][0] = [{ x: middleX, y: middleY }, { x: middleX, y: middleY }];\r\n }\r\n if (pointsB[i][0]) {\r\n pointsB[i][0] = this.addPoints(pointsB[i][0], surfaceA.length);\r\n var distance = Infinity;\r\n var splitAt = 0;\r\n for (var a = 0; a < pointsB[i][0].length; a++) {\r\n var newDistance = $math.getDistance(pointsB[i][0][a], surfaceA[0]);\r\n if (newDistance < distance) {\r\n splitAt = a;\r\n distance = newDistance;\r\n }\r\n }\r\n var partA = pointsB[i][0].slice(0, splitAt);\r\n var partB = pointsB[i][0].slice(splitAt);\r\n pointsB[i][0] = partB.concat(partA);\r\n }\r\n if (holeA) {\r\n if (!pointsB[i][1]) {\r\n pointsB[i][1] = [{ x: middleX, y: middleY }, { x: middleX, y: middleY }];\r\n }\r\n pointsB[i][1] = this.addPoints(pointsB[i][1], holeA.length);\r\n }\r\n }\r\n return pointsB;\r\n };\r\n /**\r\n * [sortPoints description]\r\n *\r\n * @ignore Exclude from doc\r\n * @todo Description\r\n * @param points [description]\r\n * @return common bbox of points\r\n */\r\n Morpher.prototype.sortPoints = function (points) {\r\n points.sort(function (a, b) {\r\n var bbox1 = $type.getValue($math.getBBox(a[0]));\r\n var bbox2 = $type.getValue($math.getBBox(b[0]));\r\n if (bbox1.width * bbox1.height > bbox2.width * bbox2.height) {\r\n return -1;\r\n }\r\n else {\r\n return 1;\r\n }\r\n });\r\n var bboxes = [];\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n var surface = points[i][0];\r\n if (surface) {\r\n bboxes.push($type.getValue($math.getBBox(surface)));\r\n }\r\n }\r\n return $math.getCommonRectangle(bboxes);\r\n };\r\n /**\r\n * Morphs polygon to a circle (it is actually a polygon which makes a circle).\r\n *\r\n * @param radius Target circle radius (px)\r\n * @param duration Duration (ms)\r\n * @param easing Easing function\r\n * @return Animation\r\n */\r\n Morpher.prototype.morphToCircle = function (radius, duration, easing) {\r\n var points = this.morphable.points;\r\n var commonBBox = this.sortPoints(points);\r\n this._morphFromPointsReal = [];\r\n this._morphToPointsReal = [];\r\n if (!$type.hasValue(duration)) {\r\n duration = this.morphDuration;\r\n }\r\n if (!$type.hasValue(easing)) {\r\n easing = this.morphEasing;\r\n }\r\n // surface\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n var surface = points[i][0];\r\n var hole = points[i][1];\r\n this._morphFromPointsReal[i] = [];\r\n this._morphToPointsReal[i] = [];\r\n if (surface) {\r\n var toPoints = surface;\r\n var fromPoints = surface;\r\n var bbox = $type.getValue($math.getBBox(fromPoints)); // this._bboxes[i];\r\n if (this.morphToSingle) {\r\n bbox = $type.getValue(commonBBox);\r\n }\r\n var middleX = bbox.x + bbox.width / 2;\r\n var middleY = bbox.y + bbox.height / 2;\r\n var realRadius = radius;\r\n if (!$type.isNumber(realRadius)) {\r\n realRadius = Math.min(bbox.width / 2, bbox.height / 2);\r\n }\r\n toPoints = [];\r\n // find angle for the first point\r\n var startAngle = $math.getAngle({ x: middleX, y: middleY }, surface[0]);\r\n var count = 100;\r\n if (surface.length > count) {\r\n count = surface.length;\r\n }\r\n fromPoints = this.addPoints(surface, count);\r\n count = fromPoints.length; // add Points might increase number a bit\r\n var angle = 360 / (count - 1);\r\n for (var a = 0; a < count; a++) {\r\n var realAngle = angle * a + startAngle;\r\n var pointOnCircle = { x: middleX + realRadius * $math.cos(realAngle), y: middleY + realRadius * $math.sin(realAngle) };\r\n toPoints[a] = pointOnCircle;\r\n }\r\n if (hole && hole.length > 0) {\r\n for (var i_1 = 0, hlen = hole.length; i_1 < hlen; i_1++) {\r\n toPoints.push({ x: middleX, y: middleY });\r\n }\r\n }\r\n this._morphFromPointsReal[i][0] = fromPoints;\r\n this._morphToPointsReal[i][0] = toPoints;\r\n }\r\n }\r\n this.morphable.currentPoints = this._morphFromPointsReal;\r\n var animation = new Animation(this, { property: \"morphProgress\", from: 0, to: 1 }, duration, easing);\r\n this._disposers.push(animation);\r\n animation.start();\r\n return animation;\r\n };\r\n /**\r\n * [addPoints description]\r\n *\r\n * @ignore Exclude from doc\r\n * @todo Description\r\n * @param points [description]\r\n * @param mustHaveCount [description]\r\n * @return [description]\r\n */\r\n Morpher.prototype.addPoints = function (points, mustHaveCount) {\r\n var addToSegmentCount = Math.round(mustHaveCount / points.length);\r\n var newPoints = [];\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n var point0 = points[i];\r\n var point1 = void 0;\r\n if (i == points.length - 1) {\r\n point1 = points[0];\r\n }\r\n else {\r\n point1 = points[i + 1];\r\n }\r\n newPoints.push(point0);\r\n for (var p = 1; p < addToSegmentCount; p++) {\r\n var percent = p / addToSegmentCount;\r\n var extraPoint = { x: point0.x + (point1.x - point0.x) * percent, y: point0.y + (point1.y - point0.y) * percent };\r\n newPoints.push(extraPoint);\r\n }\r\n // stop adding in case we already added more than left in original\r\n if (newPoints.length + points.length - i == mustHaveCount) {\r\n addToSegmentCount = 0;\r\n }\r\n }\r\n if (newPoints.length < mustHaveCount && points.length > 0) {\r\n var lastPoint = points[points.length - 1];\r\n for (var p = newPoints.length; p < mustHaveCount; p++) {\r\n // add same as last\r\n newPoints.push({ x: lastPoint.x, y: lastPoint.y });\r\n }\r\n }\r\n return newPoints;\r\n };\r\n /**\r\n * Morphs polygon into a rectangular polygon.\r\n *\r\n * @param width Width of the target rectangle (px)\r\n * @param height Height of the target rectangle (px)\r\n * @param duration Duration (ms)\r\n * @param easing Easing function\r\n * @return Animation\r\n */\r\n Morpher.prototype.morphToRectangle = function (width, height, duration, easing) {\r\n var points = this.morphable.points;\r\n this.sortPoints(points);\r\n this._morphFromPointsReal = [];\r\n this._morphToPointsReal = [];\r\n if (!$type.hasValue(duration)) {\r\n duration = this.morphDuration;\r\n }\r\n if (!$type.hasValue(easing)) {\r\n easing = this.morphEasing;\r\n }\r\n //\t\tlet biggestBBox: IRectangle = this._bboxes[this._biggestIndex];\r\n // surface\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n var surface = points[i][0];\r\n var hole = points[i][1];\r\n this._morphFromPointsReal[i] = [];\r\n this._morphToPointsReal[i] = [];\r\n if (surface) {\r\n var toPoints = surface;\r\n var fromPoints = surface;\r\n var bbox = this._bboxes[i];\r\n // we only work with first area. TODO: maybe we should find the biggest one?\r\n if (this.morphToSingle) {\r\n //if (i != this._biggestIndex) {\r\n //\tbbox = { x: biggestBBox.x + biggestBBox.width / 2, y: biggestBBox.y + biggestBBox.height / 2, width: 0, height: 0 };\r\n //}\r\n }\r\n var x = bbox.x;\r\n var y = bbox.y;\r\n var realWidth = width;\r\n var realHeight = height;\r\n if (!$type.isNumber(realWidth)) {\r\n realWidth = bbox.width;\r\n }\r\n if (!$type.isNumber(realHeight)) {\r\n realHeight = bbox.height;\r\n }\r\n toPoints = [{ x: x, y: y }, { x: x + realWidth, y: y }, { x: x + realWidth, y: y + realHeight }, { x: x, y: y + realHeight }];\r\n toPoints = this.addPoints(toPoints, surface.length);\r\n // if polygon has less points then count, add\r\n if (surface.length < 4) {\r\n for (var i_2 = surface.length; i_2 < 4; i_2++) {\r\n toPoints.push({ x: surface[i_2].x, y: surface[i_2].y });\r\n }\r\n }\r\n if (hole && hole.length > 0) {\r\n var middleX = bbox.x + bbox.width / 2;\r\n var middleY = bbox.y + bbox.height / 2;\r\n for (var i_3 = 0, hlen = hole.length; i_3 < hlen; i_3++) {\r\n toPoints.push({ x: middleX, y: middleY });\r\n }\r\n }\r\n this._morphFromPointsReal[i][0] = fromPoints;\r\n this._morphToPointsReal[i][0] = toPoints;\r\n }\r\n }\r\n this.morphable.currentPoints = this._morphFromPointsReal;\r\n var animation = new Animation(this, { property: \"morphProgress\", from: 0, to: 1 }, duration, easing);\r\n this._disposers.push(animation);\r\n animation.start();\r\n return animation;\r\n };\r\n Object.defineProperty(Morpher.prototype, \"morphProgress\", {\r\n /**\r\n * Returns the progress of morph transition.\r\n *\r\n * @return Progress (0-1)\r\n */\r\n get: function () {\r\n return this._morphProgress;\r\n },\r\n /**\r\n * Progress of the morph transition.\r\n *\r\n * Setting this will also trigger actual transformation.\r\n *\r\n * @param value Progress (0-1)\r\n */\r\n set: function (value) {\r\n this._morphProgress = value;\r\n var currentPoints = [];\r\n if (value != null) {\r\n var fromPoints = this._morphFromPointsReal;\r\n var toPoints = this._morphToPointsReal;\r\n if (fromPoints != null && toPoints != null) {\r\n for (var i = 0, len = fromPoints.length; i < len; i++) {\r\n var currentArea = [];\r\n currentPoints.push(currentArea);\r\n var surfaceFrom = fromPoints[i][0];\r\n var holeFrom = fromPoints[i][1];\r\n var surfaceTo = toPoints[i][0];\r\n var holeTo = toPoints[i][1];\r\n if (surfaceFrom && surfaceFrom.length > 0 && surfaceTo && surfaceTo.length > 0) {\r\n var currentSurface = [];\r\n for (var i_4 = 0, slen = surfaceFrom.length; i_4 < slen; i_4++) {\r\n var point0 = surfaceFrom[i_4];\r\n var point1 = surfaceTo[i_4];\r\n var currentPoint = { x: point0.x + (point1.x * this.scaleRatio - point0.x) * value, y: point0.y + (point1.y * this.scaleRatio - point0.y) * value };\r\n currentSurface.push(currentPoint);\r\n }\r\n currentArea[0] = currentSurface;\r\n }\r\n if (holeFrom && holeFrom.length > 0 && holeTo && holeTo.length > 0) {\r\n var currentHole = [];\r\n for (var i_5 = 0, hlen = holeFrom.length; i_5 < hlen; i_5++) {\r\n var point0 = holeFrom[i_5];\r\n var point1 = holeTo[i_5];\r\n var currentPoint = { x: point0.x + (point1.x * this.scaleRatio - point0.x) * value, y: point0.y + (point1.y * this.scaleRatio - point0.y) * value };\r\n currentHole.push(currentPoint);\r\n }\r\n currentArea[1] = currentHole;\r\n }\r\n }\r\n }\r\n }\r\n this.morphable.currentPoints = currentPoints;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Restores the polygon to its original appearance.\r\n *\r\n * @param duration Duration (ms)\r\n * @param easing Easing function\r\n * @return Animation\r\n */\r\n Morpher.prototype.morphBack = function (duration, easing) {\r\n this._morphToPointsReal = this._morphFromPointsReal;\r\n this._morphFromPointsReal = this.morphable.currentPoints;\r\n if (!$type.hasValue(duration)) {\r\n duration = this.morphDuration;\r\n }\r\n if (!$type.hasValue(easing)) {\r\n easing = this.morphEasing;\r\n }\r\n var animation = new Animation(this, { property: \"morphProgress\", from: 0, to: 1 }, duration, easing);\r\n this._disposers.push(animation);\r\n animation.start();\r\n return animation;\r\n };\r\n Object.defineProperty(Morpher.prototype, \"animations\", {\r\n /**\r\n * Returns a list of morph animations currently being played.\r\n *\r\n * @return List of animations\r\n */\r\n get: function () {\r\n if (!this._animations) {\r\n this._animations = [];\r\n this._disposers.push(new AnimationDisposer(this._animations));\r\n }\r\n return this._animations;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Morpher;\r\n}(BaseObject));\r\nexport { Morpher };\r\n//# sourceMappingURL=Morpher.js.map","/**\r\n * Polygon module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../Sprite\";\r\nimport { Morpher } from \"../utils/Morpher\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $path from \"../rendering/Path\";\r\nimport * as $type from \"../utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws a polygon.\r\n *\r\n * @see {@link IPolygonEvents} for a list of available events\r\n * @see {@link IPolygonAdapters} for a list of available Adapters\r\n */\r\nvar Polygon = /** @class */ (function (_super) {\r\n __extends(Polygon, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Polygon() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Polygon\";\r\n _this.element = _this.paper.add(\"path\");\r\n _this.shapeRendering = \"auto\";\r\n _this._currentPoints = [];\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(Polygon.prototype, \"points\", {\r\n /**\r\n * @return Polygon points\r\n */\r\n get: function () {\r\n var points = this.getPropertyValue(\"points\");\r\n var path = this.path;\r\n if (path && (!points || points.length == 0)) {\r\n var valueStr = path.slice(1, path.length - 1);\r\n var segments = valueStr.split(\"ZM\");\r\n for (var s = 0; s < segments.length; s++) {\r\n var segment = segments[s];\r\n if (segment.length > 0) {\r\n var areaHole = segment.split(\"M\");\r\n var areaArr = areaHole[0];\r\n var holeArr = areaHole[1];\r\n if (areaArr && areaArr.length > 0) {\r\n var pointsArr = areaArr.split(\"L\");\r\n if (pointsArr.length > 0) {\r\n var area = [];\r\n var areaAndHole = [area];\r\n points.push(areaAndHole);\r\n for (var p = 0; p < pointsArr.length; p++) {\r\n var coords = pointsArr[p].split(\",\");\r\n area.push({ x: +coords[0], y: +coords[1] });\r\n }\r\n if (holeArr && holeArr.length > 0) {\r\n var pointsArr_1 = holeArr.split(\"L\");\r\n if (pointsArr_1.length > 0) {\r\n var hole = [];\r\n areaAndHole.push(hole);\r\n for (var p = pointsArr_1.length - 1; p >= 0; p--) {\r\n var coords = pointsArr_1[p].split(\",\");\r\n hole.push({ x: +coords[0], y: +coords[1] });\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n this.setPropertyValue(\"points\", points);\r\n this._currentPoints = points;\r\n }\r\n return points;\r\n },\r\n /**\r\n * An array of X/Y coordinates for each elbow of the polygon.\r\n *\r\n * @todo Example\r\n * @param points Polygon points\r\n */\r\n set: function (points) {\r\n this.setPropertyValue(\"points\", points, true);\r\n this._currentPoints = points;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Polygon.prototype, \"currentPoints\", {\r\n /**\r\n * @return Polygon points\r\n */\r\n get: function () {\r\n if ((!this._currentPoints || this._currentPoints.length == 0) && this.path) {\r\n this._currentPoints = this.points;\r\n }\r\n return this._currentPoints;\r\n },\r\n /**\r\n * Current points. Used when morphing the element, so that original `points`\r\n * are not overwritten.\r\n *\r\n * @param points Polygon points\r\n */\r\n set: function (points) {\r\n if (this._currentPoints != points) {\r\n this._currentPoints = points;\r\n this.draw();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Draws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Polygon.prototype.draw = function () {\r\n var path = \"\";\r\n var points = this._currentPoints;\r\n var left;\r\n var right;\r\n var top;\r\n var bottom;\r\n if (points.length > 0) {\r\n // separate areas\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n // surface\r\n var surface = points[i][0];\r\n var hole = points[i][1];\r\n if (surface && surface.length > 0) {\r\n var point = surface[0];\r\n path += $path.moveTo(point);\r\n for (var s = 0; s < surface.length; s++) {\r\n point = surface[s];\r\n path += $path.lineTo(point);\r\n if (!$type.isNumber(right) || (right < point.x)) {\r\n right = point.x;\r\n }\r\n if (!$type.isNumber(left) || (left > point.x)) {\r\n left = point.x;\r\n }\r\n if (!$type.isNumber(top) || (top > point.y)) {\r\n top = point.y;\r\n }\r\n if (!$type.isNumber(bottom) || (bottom < point.y)) {\r\n bottom = point.y;\r\n }\r\n }\r\n }\r\n // hole\r\n if (hole && hole.length > 0) {\r\n var point = hole[0];\r\n path += $path.moveTo(point);\r\n for (var h = 0, hlen = hole.length; h < hlen; h++) {\r\n point = hole[h];\r\n path += $path.lineTo(point);\r\n }\r\n }\r\n }\r\n if (path) {\r\n path += $path.closePath();\r\n }\r\n this.bbox.x = left;\r\n this.bbox.y = top;\r\n this.bbox.width = right - left;\r\n this.bbox.height = bottom - top;\r\n _super.prototype.setPath.call(this, path);\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Polygon.prototype.setPath = function (value) {\r\n if (_super.prototype.setPath.call(this, value)) {\r\n this.points = [];\r\n this._bbox = this.group.getBBox();\r\n return true;\r\n }\r\n return false;\r\n };\r\n /**\r\n * Measures element\r\n */\r\n Polygon.prototype.measureElement = function () {\r\n // Overriding to avoid extra measurement.\r\n };\r\n Object.defineProperty(Polygon.prototype, \"centerPoint\", {\r\n /**\r\n * A calculated center point for the shape.\r\n *\r\n * @readonly\r\n * @return Center\r\n */\r\n get: function () {\r\n return { x: this.bbox.x + this.bbox.width / 2, y: this.bbox.y + this.bbox.height / 2 };\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Polygon.prototype, \"morpher\", {\r\n /**\r\n * A [[Morpher]] instance that is used to morph polygon into some other\r\n * shape.\r\n *\r\n * @readonly\r\n * @return Morpher instance\r\n */\r\n get: function () {\r\n if (!this._morpher) {\r\n this._morpher = new Morpher(this);\r\n this._disposers.push(this._morpher);\r\n }\r\n return this._morpher;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Polygon;\r\n}(Sprite));\r\nexport { Polygon };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Polygon\"] = Polygon;\r\n//# sourceMappingURL=Polygon.js.map","/**\r\n * Polyspline (smoothed line) module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Polyline } from \"./Polyline\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws a polysline. (smoothed multi-sigment line)\r\n *\r\n * @see {@link IPolysplineEvents} for a list of available events\r\n * @see {@link IPolysplineAdapters} for a list of available Adapters\r\n */\r\nvar Polyspline = /** @class */ (function (_super) {\r\n __extends(Polyspline, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Polyspline() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Polyspline\";\r\n _this.tensionX = 0.5;\r\n _this.tensionY = 0.5;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Creats and adds an SVG path for the arc.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Polyspline.prototype.makePath = function () {\r\n this._distance = 0;\r\n var segments = this.segments;\r\n var tensionX = this.tensionX;\r\n var tensionY = this.tensionY;\r\n this.allPoints = [];\r\n if (segments && segments.length > 0) {\r\n var path = \"\";\r\n this._realSegments = [];\r\n for (var i = 0, len = segments.length; i < len; i++) {\r\n var points = segments[i];\r\n var realPoints = [];\r\n this._realSegments.push(realPoints);\r\n if (points.length > 0) {\r\n var first = points[0];\r\n var last = points[points.length - 1];\r\n var closed_1 = false;\r\n if ($math.round(first.x, 3) == $math.round(last.x) && $math.round(first.y) == $math.round(last.y)) {\r\n closed_1 = true;\r\n }\r\n path += $path.moveTo(points[0]);\r\n for (var p = 0; p < points.length - 1; p++) {\r\n var p0 = points[p - 1];\r\n var p1 = points[p];\r\n var p2 = points[p + 1];\r\n var p3 = points[p + 2];\r\n if (p === 0) {\r\n p0 = points[p];\r\n }\r\n else if (p == points.length - 2) {\r\n p3 = points[p + 1];\r\n }\r\n if (!p3) {\r\n p3 = p2;\r\n }\r\n if (p === 0) {\r\n if (closed_1) {\r\n p0 = points[points.length - 2];\r\n }\r\n else {\r\n p0 = points[i];\r\n }\r\n }\r\n else if (p == points.length - 2) {\r\n if (closed_1) {\r\n p3 = points[1];\r\n }\r\n else {\r\n p3 = points[p + 1];\r\n }\r\n }\r\n var controlPointA = $math.getCubicControlPointA(p0, p1, p2, p3, tensionX, tensionY);\r\n var controlPointB = $math.getCubicControlPointB(p0, p1, p2, p3, tensionX, tensionY);\r\n path += $path.cubicCurveTo(p2, controlPointA, controlPointB);\r\n // now split to small segments so that we could have positionToPoint later\r\n var stepCount = Math.ceil($math.getCubicCurveDistance(p1, p2, controlPointA, controlPointB, 20)) * 1.2;\r\n var prevPoint = p1;\r\n if (stepCount > 0) {\r\n // not good for curved charts\r\n //this.allPoints[0] = { x: points[0].x, y: points[0].y, angle: $math.getAngle(points[0], points[1]) };\r\n //realPoints.push(this.allPoints[0]);\r\n for (var s = 0; s <= stepCount; s++) {\r\n var point = $math.getPointOnCubicCurve(p1, p2, controlPointA, controlPointB, s / stepCount);\r\n if (point.x == prevPoint.x && point.y == prevPoint.y) {\r\n continue;\r\n }\r\n realPoints.push(point);\r\n var angle = $math.round($math.getAngle(prevPoint, point), 5);\r\n //this.allPoints.push({ x: point.x, y: point.y, angle: angle });\r\n this._distance += $math.getDistance(prevPoint, point);\r\n this.allPoints[Math.floor(this._distance)] = { x: point.x, y: point.y, angle: angle };\r\n prevPoint = point;\r\n }\r\n }\r\n else {\r\n realPoints.push(p0);\r\n }\r\n }\r\n }\r\n var allPoints = this.allPoints;\r\n if (allPoints.length > 1) {\r\n for (var i_1 = 0; i_1 < allPoints.length; i_1++) {\r\n if (!allPoints[i_1]) {\r\n if (i_1 > 1) {\r\n allPoints[i_1] = allPoints[i_1 - 1];\r\n }\r\n else {\r\n for (var k = 1; k < allPoints.length; k++) {\r\n if (allPoints[k]) {\r\n allPoints[i_1] = allPoints[k];\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n this.path = path;\r\n }\r\n };\r\n /**\r\n * Returns an index of the point that is closest to specified coordinates.\r\n *\r\n * @param point Reference point\r\n * @return Index\r\n */\r\n Polyspline.prototype.getClosestPointIndex = function (point) {\r\n var points = this.allPoints;\r\n var index;\r\n var closest = Infinity;\r\n if (points.length > 1) {\r\n for (var p = 1; p < points.length; p++) {\r\n var distance = $math.getDistance(point, points[p]);\r\n if (distance < closest) {\r\n index = p;\r\n closest = distance;\r\n }\r\n }\r\n }\r\n return index;\r\n };\r\n Object.defineProperty(Polyspline.prototype, \"tensionX\", {\r\n /**\r\n * @return Tension\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"tensionX\");\r\n },\r\n /**\r\n * Horizontal tension for the spline.\r\n *\r\n * Used by the line smoothing algorithm.\r\n *\r\n * @default 0.5\r\n * @param value Tension\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"tensionX\", value);\r\n this.makePath();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Polyspline.prototype, \"tensionY\", {\r\n /**\r\n * @return Tension\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"tensionY\");\r\n },\r\n /**\r\n * Vertical tension for the spline.\r\n *\r\n * Used by the line smoothing algorithm.\r\n *\r\n * @default 0.5\r\n * @param value Tensions\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"tensionY\", value, true);\r\n this.makePath();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Converts relative position along the line (0-1) into pixel coordinates.\r\n *\r\n * @param position Position (0-1)\r\n * @return Coordinates\r\n */\r\n Polyspline.prototype.positionToPoint = function (position, extend) {\r\n var deltaAngle = 0;\r\n var allPoints = this.allPoints;\r\n var len = allPoints.length;\r\n if (!$type.isNumber(position)) {\r\n position = 0;\r\n }\r\n if (len > 1) {\r\n if (extend && len > 3) {\r\n if (position < 0) {\r\n if (position < -0.01) {\r\n position = -0.01;\r\n }\r\n var f0 = allPoints[0];\r\n var f1 = allPoints[1];\r\n var x = f0.x - (f0.x - f1.x) * len * position;\r\n var y = f0.y - (f0.y - f1.y) * len * position;\r\n return { x: x, y: y, angle: $math.getAngle(f0, f1) };\r\n }\r\n else if (position > 1) {\r\n if (position > 1.01) {\r\n position = 1.01;\r\n }\r\n var f0 = allPoints[allPoints.length - 2];\r\n var f1 = allPoints[allPoints.length - 3];\r\n var x = f0.x + (f0.x - f1.x) * len * (position - 1);\r\n var y = f0.y + (f0.y - f1.y) * len * (position - 1);\r\n return { x: x, y: y, angle: $math.getAngle(f0, { x: x, y: y }) };\r\n }\r\n else if (position == 1) {\r\n var point_1 = allPoints[allPoints.length - 1];\r\n return { x: point_1.x, y: point_1.y, angle: point_1.angle };\r\n }\r\n }\r\n else {\r\n if (position < 0) {\r\n position = Math.abs(position);\r\n deltaAngle = 180;\r\n }\r\n if (position >= 1) {\r\n position = 0.9999999999999;\r\n }\r\n }\r\n var point = allPoints[Math.floor(position * len)];\r\n return { x: point.x, y: point.y, angle: point.angle + deltaAngle };\r\n }\r\n else if (len == 1) {\r\n var point = allPoints[0];\r\n return { x: point.x, y: point.y, angle: point.angle };\r\n }\r\n else {\r\n return { x: 0, y: 0, angle: 0 };\r\n }\r\n };\r\n return Polyspline;\r\n}(Polyline));\r\nexport { Polyspline };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Polyspline\"] = Polyspline;\r\n//# sourceMappingURL=Polyspline.js.map","/**\r\n * Slice module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../Container\";\r\nimport { Sprite } from \"../Sprite\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $path from \"../rendering/Path\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport { Percent } from \"../utils/Percent\";\r\nimport { RadialGradient } from \"../rendering/fills/RadialGradient\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws a wedged semi-circle - slice. Usually used for Pie/Donut charts.\r\n *\r\n * @see {@link ISliceEvents} for a list of available events\r\n * @see {@link ISliceAdapters} for a list of available Adapters\r\n */\r\nvar Slice = /** @class */ (function (_super) {\r\n __extends(Slice, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Slice() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"Slice\";\r\n // Set defaults\r\n _this.setPropertyValue(\"cornerRadius\", 0);\r\n _this.setPropertyValue(\"startAngle\", 0);\r\n _this.setPercentProperty(\"innerRadius\", 0);\r\n _this.setPercentProperty(\"radius\", 0);\r\n _this.setPropertyValue(\"arc\", 0);\r\n _this.setPropertyValue(\"shiftRadius\", 0);\r\n _this.strokeOpacity = 1;\r\n _this.setPropertyValue(\"layout\", \"none\");\r\n // Create a slice wedge element\r\n _this.slice = _this.createChild(Sprite);\r\n _this.slice.isMeasured = false;\r\n _this._disposers.push(_this.slice);\r\n //this.element.attr({ \"stroke-linejoin\": \"round\" });\r\n //this.element.attr({ \"stroke-linecap\": \"round\" });\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Slice.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n var radiusY = this.radiusY;\r\n if (this.radius > 0 && radiusY == 0) {\r\n radiusY = 0.01;\r\n }\r\n this.slice.path = $path.arc(this.startAngle, this.arc, this.radius, this.pixelInnerRadius, radiusY, this.cornerRadius, this.innerCornerRadius);\r\n this.slice.invalidate();\r\n this.shiftRadius = this.shiftRadius;\r\n if (this.realFill instanceof RadialGradient) {\r\n this.updateGradient(this.realFill);\r\n }\r\n if (this.realStroke instanceof RadialGradient) {\r\n this.updateGradient(this.realStroke);\r\n }\r\n };\r\n Slice.prototype.updateGradient = function (gradient) {\r\n gradient.element.attr({ \"gradientUnits\": \"userSpaceOnUse\" });\r\n gradient.element.attr({ \"r\": this.radius });\r\n gradient.cx = 0;\r\n gradient.cy = 0;\r\n gradient.element.attr({ radius: this.radius });\r\n };\r\n Object.defineProperty(Slice.prototype, \"bbox\", {\r\n /**\r\n * Returns bounding box (square) for this element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n get: function () {\r\n if (this.definedBBox) {\r\n return this.definedBBox;\r\n }\r\n if (this.isMeasured) {\r\n var innerRect = $math.getArcRect(this.startAngle, this.startAngle + this.arc, this.pixelInnerRadius);\r\n var outerRect = $math.getArcRect(this.startAngle, this.startAngle + this.arc, this.radius);\r\n return $math.getCommonRectangle([innerRect, outerRect]);\r\n }\r\n else {\r\n return { x: 0, y: 0, width: 0, height: 0 };\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slice.prototype, \"startAngle\", {\r\n /**\r\n * @return Angle (0-360)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"startAngle\");\r\n },\r\n /**\r\n * The angle at which left edge of the slice is drawn. (0-360)\r\n *\r\n * 0 is to the right of the center.\r\n *\r\n * @param value Angle (0-360)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"startAngle\", $math.normalizeAngle(value), true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slice.prototype, \"arc\", {\r\n /**\r\n * @return [description]\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"arc\");\r\n },\r\n /**\r\n * [arc description]\r\n *\r\n * @todo Description\r\n * @param value [description]\r\n */\r\n set: function (value) {\r\n if (!$type.isNumber(value)) {\r\n value = 0;\r\n }\r\n this.setPropertyValue(\"arc\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slice.prototype, \"radius\", {\r\n /**\r\n * @return Radius (px)\r\n */\r\n get: function () {\r\n var radius = this.getPropertyValue(\"radius\");\r\n if (!$type.isNumber(radius)) {\r\n radius = 0;\r\n }\r\n return radius;\r\n },\r\n /**\r\n * Radius of the slice in pixels.\r\n *\r\n * @param value Radius (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"radius\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slice.prototype, \"radiusY\", {\r\n /**\r\n * @return Vertical radius (0-1)\r\n */\r\n get: function () {\r\n var value = this.getPropertyValue(\"radiusY\");\r\n if (!$type.isNumber(value)) {\r\n value = this.radius;\r\n }\r\n return value;\r\n },\r\n /**\r\n * Vertical radius for creating skewed slices.\r\n *\r\n * This is relevant to `radius`, e.g. 0.5 will set vertical radius to half\r\n * the `radius`.\r\n *\r\n * @param value Vertical radius (0-1)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"radiusY\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slice.prototype, \"innerRadius\", {\r\n /**\r\n * @return Radius (px or %)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"innerRadius\");\r\n },\r\n /**\r\n * Inner radius of the slice for creating cut out (donut) slices.\r\n *\r\n * @default 0\r\n * @param value Radius (px or %)\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"innerRadius\", value, true, false, 10, false);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slice.prototype, \"pixelInnerRadius\", {\r\n /**\r\n * @return Radius px\r\n */\r\n get: function () {\r\n return $utils.relativeToValue(this.innerRadius, this.radius);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slice.prototype, \"cornerRadius\", {\r\n /**\r\n * @return Radius (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"cornerRadius\");\r\n },\r\n /**\r\n * Radius of slice's outer corners in pixels.\r\n *\r\n * @default 0\r\n * @param value Radius (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"cornerRadius\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slice.prototype, \"innerCornerRadius\", {\r\n /**\r\n * @return Radius (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"innerCornerRadius\");\r\n },\r\n /**\r\n * Radius of slice's inner corners in pixels.\r\n *\r\n * @default 0\r\n * @param value Radius (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"innerCornerRadius\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slice.prototype, \"shiftRadius\", {\r\n /**\r\n * @return Radius shift\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"shiftRadius\");\r\n },\r\n /**\r\n * Indicates how far (relatively to center) a slice should be moved.\r\n *\r\n * The value is relative to the radius of the slice. Meaning 0 no shift,\r\n * 1 - slice shifted outside by whole of its radius.\r\n *\r\n * @param value Radius shift\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"shiftRadius\", value);\r\n value = this.getPropertyValue(\"shiftRadius\");\r\n this.dx = value * this.radius * this.ix;\r\n this.dy = value * this.radiusY * this.iy;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slice.prototype, \"ix\", {\r\n /**\r\n * [ix description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @return [description]\r\n */\r\n get: function () {\r\n return $math.cos(this.middleAngle);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slice.prototype, \"iy\", {\r\n /**\r\n * [iy description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @return [description]\r\n */\r\n get: function () {\r\n return $math.sin(this.middleAngle);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slice.prototype, \"middleAngle\", {\r\n /**\r\n * An angle of the slice's middle.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Angle\r\n */\r\n get: function () {\r\n return this.startAngle + this.arc / 2;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * X coordinate for the slice tooltip.\r\n *\r\n * @return X\r\n */\r\n Slice.prototype.getTooltipX = function () {\r\n var value = this.getPropertyValue(\"tooltipX\");\r\n if ($type.isNumber(value)) {\r\n return value;\r\n }\r\n var p = 0.5;\r\n if (value instanceof Percent) {\r\n p = value.value;\r\n }\r\n var innerRadius = $utils.relativeToValue(this.innerRadius, this.radius);\r\n return this.ix * (innerRadius + (this.radius - innerRadius) * p);\r\n };\r\n /**\r\n * Y coordinate for the slice tooltip.\r\n *\r\n * @return Y\r\n */\r\n Slice.prototype.getTooltipY = function () {\r\n var value = this.getPropertyValue(\"tooltipY\");\r\n if ($type.isNumber(value)) {\r\n return value;\r\n }\r\n var p = 0.5;\r\n if (value instanceof Percent) {\r\n p = value.value;\r\n }\r\n var innerRadius = $utils.relativeToValue(this.innerRadius, this.radius);\r\n return this.iy * (innerRadius + (this.radius - innerRadius) * p) + this.slice.dy;\r\n };\r\n return Slice;\r\n}(Container));\r\nexport { Slice };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Slice\"] = Slice;\r\n//# sourceMappingURL=Slice.js.map","/**\r\n * Preloader module.\r\n *\r\n * Preloader is a progress indicator.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../Container\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { Slice } from \"./Slice\";\r\nimport { Label } from \"./Label\";\r\nimport { registry } from \"../Registry\";\r\nimport { percent } from \"../../core/utils/Percent\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A class used to draw and display progress indicator.\r\n *\r\n * @see {@link IPreloaderEvents} for a list of available events\r\n * @see {@link IPreloaderAdapters} for a list of available Adapters\r\n */\r\nvar Preloader = /** @class */ (function (_super) {\r\n __extends(Preloader, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Preloader() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"Preloader\";\r\n // Set dimensions\r\n _this.width = percent(100);\r\n _this.height = percent(100);\r\n var interfaceColors = new InterfaceColorSet();\r\n // Create main container\r\n var sliceContainer = _this.createChild(Container);\r\n sliceContainer.shouldClone = false;\r\n // Add background (100%) slice\r\n var backgroundSlice = sliceContainer.createChild(Slice);\r\n backgroundSlice.shouldClone = false;\r\n backgroundSlice.radius = 53;\r\n backgroundSlice.arc = 360;\r\n backgroundSlice.fill = interfaceColors.getFor(\"fill\");\r\n backgroundSlice.fillOpacity = 0.8;\r\n backgroundSlice.innerRadius = 42;\r\n backgroundSlice.isMeasured = false;\r\n _this.backgroundSlice = backgroundSlice;\r\n // Add progress slice\r\n var progressSlice = sliceContainer.createChild(Slice);\r\n progressSlice.shouldClone = false;\r\n progressSlice.radius = 50;\r\n progressSlice.innerRadius = 45;\r\n progressSlice.fill = interfaceColors.getFor(\"alternativeBackground\");\r\n progressSlice.fillOpacity = 0.2;\r\n progressSlice.isMeasured = false;\r\n _this.progressSlice = progressSlice;\r\n // Add text label element\r\n var label = sliceContainer.createChild(Label);\r\n label.shouldClone = false;\r\n label.horizontalCenter = \"middle\";\r\n label.verticalCenter = \"middle\";\r\n label.isMeasured = false;\r\n label.fill = interfaceColors.getFor(\"text\");\r\n label.align = \"center\";\r\n label.valign = \"middle\";\r\n label.textAlign = \"middle\";\r\n label.fillOpacity = 0.4;\r\n _this.label = label;\r\n // Set defaults\r\n _this.background.opacity = 1;\r\n _this.background.fill = interfaceColors.getFor(\"background\");\r\n _this.contentAlign = \"center\";\r\n _this.contentValign = \"middle\";\r\n _this.delay = 300;\r\n // Create hidden state\r\n var hiddenState = _this.states.create(\"hidden\");\r\n hiddenState.properties.opacity = 0;\r\n // Hide by default\r\n _this.visible = false;\r\n _this.hide(0);\r\n _this.__disabled = true;\r\n // Make it disposable\r\n // @todo Maybe it's enough to just dispose `sliceContainer`?\r\n _this._disposers.push(_this.backgroundSlice);\r\n _this._disposers.push(_this.progressSlice);\r\n _this._disposers.push(_this.label);\r\n _this._disposers.push(sliceContainer);\r\n return _this;\r\n }\r\n Object.defineProperty(Preloader.prototype, \"progress\", {\r\n /**\r\n * @return Progress (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"progress\");\r\n },\r\n /**\r\n * Current preload progress. (0-1)\r\n *\r\n * * 0 - 0%\r\n * * 0.5 - 50%\r\n * * 1 - 100%\r\n *\r\n * Setting this to a value less than 1, will automatically reveal the\r\n * preloader, while setting it to 1 (100%) will hide it.\r\n *\r\n * @param value Progress (0-1)\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n this.__disabled = false;\r\n this.validateLayout(); // show not in center without this\r\n this.setPropertyValue(\"progress\", value);\r\n /*if (!this.visible && value == 1) {\r\n return;\r\n }*/\r\n this.progressSlice.arc = 360 * value;\r\n if (this.label) {\r\n this.label.text = Math.round(value * 100) + \"%\";\r\n }\r\n if (value >= 1) {\r\n // Cancel the timeout\r\n if (this._started) {\r\n this._started = undefined;\r\n }\r\n // TODO remove closure ?\r\n registry.events.once(\"enterframe\", function () {\r\n var animation = _this.hide();\r\n if (animation && !animation.isFinished()) {\r\n animation.events.once(\"animationended\", function () {\r\n _this.__disabled = true;\r\n });\r\n }\r\n else {\r\n _this.__disabled = true;\r\n }\r\n });\r\n this.interactionsEnabled = false;\r\n this.setPropertyValue(\"progress\", 0);\r\n }\r\n else if (value > 0) {\r\n if (this.delay) {\r\n if (!this._started) {\r\n this._started = new Date().getTime();\r\n }\r\n else if ((this._started + this.delay) <= new Date().getTime()) {\r\n this.__disabled = false;\r\n this.show();\r\n this.interactionsEnabled = true;\r\n }\r\n }\r\n else {\r\n this.__disabled = false;\r\n this.show();\r\n this.interactionsEnabled = true;\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Preloader.prototype, \"delay\", {\r\n /**\r\n * @return Delay (ms)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"delay\");\r\n },\r\n /**\r\n * Delay display of preloader by X milliseconds.\r\n *\r\n * When loading starts (`progress` is set to <1) and finishes (`progress` is\r\n * set to 1) before `delay` ms, the loader is never shown.\r\n *\r\n * This is used to avoid brief flashing of the preload for very quick loads.\r\n *\r\n * @default 1000\r\n * @param value Delay (ms)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"delay\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Preloader;\r\n}(Container));\r\nexport { Preloader };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Preloader\"] = Preloader;\r\n//# sourceMappingURL=Preloader.js.map","/**\r\n * Resize button module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Button } from \"./Button\";\r\nimport { Sprite } from \"../Sprite\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $path from \"../rendering/Path\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a draggable resize/grip button.\r\n *\r\n * @see {@link IResizeButtonEvents} for a list of available events\r\n * @see {@link IResizeButtonAdapters} for a list of available Adapters\r\n */\r\nvar ResizeButton = /** @class */ (function (_super) {\r\n __extends(ResizeButton, _super);\r\n /**\r\n * Constructor\r\n */\r\n function ResizeButton() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"ResizeButton\";\r\n // Set defaults\r\n _this.orientation = \"horizontal\";\r\n _this.layout = \"absolute\";\r\n _this.horizontalCenter = \"middle\";\r\n _this.verticalCenter = \"middle\";\r\n _this.draggable = true;\r\n _this.padding(8, 8, 8, 8);\r\n _this.background.cornerRadius(20, 20, 20, 20);\r\n // Create an icon\r\n var icon = new Sprite();\r\n icon.element = _this.paper.add(\"path\");\r\n var path = $path.moveTo({ x: -2, y: -6 });\r\n path += $path.lineTo({ x: -2, y: 6 });\r\n path += $path.moveTo({ x: 2, y: -6 });\r\n path += $path.lineTo({ x: 2, y: 6 });\r\n icon.path = path;\r\n icon.pixelPerfect = true;\r\n icon.padding(0, 4, 0, 4);\r\n icon.stroke = new InterfaceColorSet().getFor(\"alternativeText\");\r\n icon.strokeOpacity = 0.7;\r\n //icon.align = \"center\";\r\n //icon.valign = \"middle\";\r\n _this.icon = icon;\r\n _this.label.dispose();\r\n _this.label = undefined;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(ResizeButton.prototype, \"orientation\", {\r\n /**\r\n * Use for setting of direction (orientation) of the resize button.\r\n *\r\n * Available options: \"horizontal\", \"vertical\".\r\n *\r\n * @param value Orientation\r\n */\r\n set: function (value) {\r\n var icon = this.icon;\r\n if (icon) {\r\n if (value == \"horizontal\") {\r\n icon.rotation = 0;\r\n }\r\n else {\r\n icon.rotation = -90;\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return ResizeButton;\r\n}(Button));\r\nexport { ResizeButton };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ResizeButton\"] = ResizeButton;\r\n//# sourceMappingURL=ResizeButton.js.map","/**\r\n * Zoom out button functionality.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Button } from \"./Button\";\r\nimport { Sprite } from \"../Sprite\";\r\nimport { registry } from \"../Registry\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport * as $path from \"../rendering/Path\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport { MouseCursorStyle } from \"../../core/interaction/Mouse\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a zoom out button.\r\n *\r\n * @see {@link ICloseButtonEvents} for a list of available events\r\n * @see {@link ICloseButtonAdapters} for a list of available Adapters\r\n */\r\nvar CloseButton = /** @class */ (function (_super) {\r\n __extends(CloseButton, _super);\r\n /**\r\n * Constructor\r\n */\r\n function CloseButton() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"CloseButton\";\r\n _this.padding(8, 8, 8, 8);\r\n _this.showSystemTooltip = true;\r\n _this.width = 30;\r\n _this.height = 30;\r\n var interfaceColors = new InterfaceColorSet();\r\n _this.cursorOverStyle = MouseCursorStyle.pointer;\r\n var background = _this.background;\r\n background.cornerRadius(20, 20, 20, 20);\r\n var bgc = interfaceColors.getFor(\"background\");\r\n background.fill = bgc;\r\n background.stroke = interfaceColors.getFor(\"primaryButton\");\r\n background.strokeOpacity = 1;\r\n background.strokeWidth = 1;\r\n var downColor = interfaceColors.getFor(\"primaryButtonActive\");\r\n var bhs = background.states.getKey(\"hover\");\r\n bhs.properties.strokeWidth = 3;\r\n bhs.properties.fill = bgc;\r\n var bds = background.states.getKey(\"down\");\r\n bds.properties.stroke = downColor;\r\n bds.properties.fill = bgc;\r\n // Create an icon\r\n var icon = new Sprite();\r\n icon.element = _this.paper.add(\"path\");\r\n icon.stroke = background.stroke;\r\n _this.icon = icon;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n CloseButton.prototype.validate = function () {\r\n _super.prototype.validate.call(this);\r\n var w = this.pixelWidth / 3;\r\n var h = this.pixelHeight / 3;\r\n var path = $path.moveTo({ x: -w / 2, y: -h / 2 });\r\n path += $path.lineTo({ x: w / 2, y: h / 2 });\r\n path += $path.moveTo({ x: w / 2, y: -h / 2 });\r\n path += $path.lineTo({ x: -w / 2, y: h / 2 });\r\n this.icon.path = path;\r\n this.invalidateLayout();\r\n };\r\n /**\r\n * Sets defaults that instantiate some objects that rely on parent, so they\r\n * cannot be set in constructor.\r\n */\r\n CloseButton.prototype.applyInternalDefaults = function () {\r\n _super.prototype.applyInternalDefaults.call(this);\r\n if (!$type.hasValue(this.readerTitle)) {\r\n this.readerTitle = this.language.translate(\"Close\");\r\n }\r\n };\r\n return CloseButton;\r\n}(Button));\r\nexport { CloseButton };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"CloseButton\"] = CloseButton;\r\n//# sourceMappingURL=CloseButton.js.map","/**\r\n * Functionality for drawing simple SwitchButtons.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../Container\";\r\nimport { Label } from \"./Label\";\r\nimport { Button } from \"../elements/Button\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { Circle } from \"../../core/elements/Circle\";\r\nimport { percent } from \"../../core/utils/Percent\";\r\nimport { registry } from \"../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * SwitchButton class is capable of drawing a simple rectangular SwitchButton with\r\n * optionally rounded corners and an icon in it.\r\n *\r\n * @see {@link ISwitchButtonEvents} for a list of available events\r\n * @see {@link ISwitchButtonAdapters} for a list of available Adapters\r\n */\r\nvar SwitchButton = /** @class */ (function (_super) {\r\n __extends(SwitchButton, _super);\r\n /**\r\n * Constructor\r\n */\r\n function SwitchButton() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"SwitchButton\";\r\n _this.tooltipY = 0;\r\n // Set defaults\r\n _this.layout = \"horizontal\";\r\n _this.contentAlign = \"center\";\r\n _this.contentValign = \"middle\";\r\n _this.padding(8, 16, 8, 16);\r\n _this.setStateOnChildren = true;\r\n _this.states.create(\"active\");\r\n var interfaceColors = new InterfaceColorSet();\r\n // Create the label element\r\n var leftLabel = new Label();\r\n leftLabel.fillOpacity = 0.3;\r\n var llas = leftLabel.states.create(\"active\");\r\n llas.properties.fillOpacity = 1;\r\n leftLabel.isActive = true;\r\n _this.leftLabel = leftLabel;\r\n var button = new Button();\r\n var circle = new Circle();\r\n button.contentValign = \"none\";\r\n button.padding(0, 0, 0, 0);\r\n circle.radius = 10;\r\n button.icon = circle;\r\n button.icon.valign = \"middle\";\r\n button.label = undefined;\r\n var p100 = percent(100);\r\n button.background.cornerRadius(p100, p100, p100, p100);\r\n button.width = circle.radius * 3.5;\r\n button.height = circle.radius * 2.1;\r\n button.marginLeft = 8;\r\n button.marginRight = 8;\r\n button.togglable = true;\r\n circle.dx = -circle.radius * 0.7;\r\n circle.fill = interfaceColors.getFor(\"primaryButton\");\r\n var hs = circle.states.create(\"hover\");\r\n hs.properties.fill = interfaceColors.getFor(\"primaryButtonHover\");\r\n var as = circle.states.create(\"active\");\r\n as.properties.fill = interfaceColors.getFor(\"primaryButtonActive\");\r\n as.properties.dx = circle.radius * 0.7;\r\n _this.switchButton = button;\r\n _this.events.on(\"toggled\", function () {\r\n _this.leftLabel.isActive = !_this.isActive;\r\n _this.rightLabel.isActive = _this.isActive;\r\n });\r\n // Create the label element\r\n var rightLabel = new Label();\r\n rightLabel.fillOpacity = 0.3;\r\n var rlas = rightLabel.states.create(\"active\");\r\n rlas.properties.fillOpacity = 1;\r\n _this.rightLabel = rightLabel;\r\n // Set up accessibility\r\n // A Button should be always focusable\r\n _this.role = \"button\";\r\n _this.focusable = true;\r\n rightLabel.valign = \"middle\";\r\n leftLabel.valign = \"middle\";\r\n button.valign = \"middle\";\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(SwitchButton.prototype, \"leftLabel\", {\r\n /**\r\n * @return Left label element\r\n */\r\n get: function () {\r\n return this._leftLabel;\r\n },\r\n /**\r\n * [[Label]] element to be used for left text.\r\n *\r\n * @param left label element\r\n */\r\n set: function (label) {\r\n if (this._leftLabel) {\r\n this.removeDispose(this._leftLabel);\r\n }\r\n this._leftLabel = label;\r\n if (label) {\r\n label.parent = this;\r\n label.interactionsEnabled = false;\r\n label.shouldClone = false;\r\n this._disposers.push(this._leftLabel);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SwitchButton.prototype, \"rightLabel\", {\r\n /**\r\n * @return Rigth label element\r\n */\r\n get: function () {\r\n return this._rightLabel;\r\n },\r\n /**\r\n * [[Label]] element to be used for left text.\r\n *\r\n * @param rigth label element\r\n */\r\n set: function (label) {\r\n if (this._rightLabel) {\r\n this.removeDispose(this._rightLabel);\r\n }\r\n this._rightLabel = label;\r\n if (label) {\r\n label.parent = this;\r\n label.interactionsEnabled = false;\r\n label.shouldClone = false;\r\n this._disposers.push(this._rightLabel);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SwitchButton.prototype, \"switch\", {\r\n /**\r\n * @ignore\r\n * @deprecated Use `switchButton` instead\r\n */\r\n get: function () {\r\n return this._switchButton;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SwitchButton.prototype, \"switchButton\", {\r\n /**\r\n * @return Button\r\n */\r\n get: function () {\r\n return this._switchButton;\r\n },\r\n /**\r\n * A [[Button]] element for switch.\r\n *\r\n * @param Button\r\n */\r\n set: function (button) {\r\n if (this._switchButton) {\r\n this.removeDispose(this._switchButton);\r\n }\r\n this._switchButton = button;\r\n if (button) {\r\n button.parent = this;\r\n button.shouldClone = false;\r\n this._disposers.push(this._switchButton);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies properties and other attributes.\r\n *\r\n * @param source Source\r\n */\r\n SwitchButton.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n if (source.leftLabel) {\r\n this.leftLabel.copyFrom(source.leftLabel);\r\n }\r\n if (source.rightLabel) {\r\n this.rightLabel.copyFrom(source.rightLabel);\r\n }\r\n if (source.switchButton) {\r\n this.switchButton.copyFrom(source.switchButton);\r\n }\r\n };\r\n return SwitchButton;\r\n}(Container));\r\nexport { SwitchButton };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"SwitchButton\"] = SwitchButton;\r\n//# sourceMappingURL=SwitchButton.js.map","/**\r\n * Provides functionality used to build scrollbars.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../Container\";\r\nimport { ResizeButton } from \"../elements/ResizeButton\";\r\nimport { Button } from \"../elements/Button\";\r\nimport { getInteraction } from \"../interaction/Interaction\";\r\nimport { MouseCursorStyle } from \"../interaction/Mouse\";\r\nimport { RoundedRectangle } from \"../elements/RoundedRectangle\";\r\nimport { registry } from \"../Registry\";\r\nimport { keyboard } from \"../utils/Keyboard\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { percent, Percent } from \"../utils/Percent\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $ease from \"../utils/Ease\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $utils from \"../utils/Utils\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Scrollbar is a generic control allowing to select a range of values or pan\r\n * the selection.\r\n *\r\n * @see {@link IScrollbarEvents} for a list of available events\r\n * @see {@link IScrollbarAdapters} for a list of available Adapters\r\n */\r\nvar Scrollbar = /** @class */ (function (_super) {\r\n __extends(Scrollbar, _super);\r\n /**\r\n * Construtor\r\n */\r\n function Scrollbar() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Previously selected lower (start) value.\r\n */\r\n _this._previousStart = 0;\r\n /**\r\n * Previously selected upper (end) value.\r\n */\r\n _this._previousEnd = 1;\r\n /**\r\n * A value of previously selected lower value, used for doubleclick function.\r\n */\r\n _this._prevStart = 0;\r\n /**\r\n * A value of previously selected upper value, used for doubleclick function.\r\n */\r\n _this._prevEnd = 1;\r\n /**\r\n * Indicates if the Scrollbar is currently \"busy\" (animating and or\r\n * performing zoom by user interaction).\r\n */\r\n _this._isBusy = false;\r\n /**\r\n * [_skipRangeEvents description]\r\n *\r\n * @todo Description\r\n */\r\n _this._skipRangeEvents = false;\r\n /**\r\n * Update the selection when dragging the grips.\r\n *\r\n * If set to `false` selection will be updated only when the grip is\r\n * released.\r\n *\r\n * @default true\r\n */\r\n _this.updateWhileMoving = true;\r\n _this.className = \"Scrollbar\";\r\n _this.minHeight = 12;\r\n _this.minWidth = 12;\r\n _this.animationDuration = 0;\r\n _this.animationEasing = $ease.cubicOut;\r\n _this.margin(10, 10, 10, 10);\r\n var interfaceColors = new InterfaceColorSet();\r\n // background is also container as it might contain graphs, grid, etc\r\n var background = _this.background;\r\n background.cornerRadius(10, 10, 10, 10);\r\n background.fill = interfaceColors.getFor(\"fill\");\r\n background.fillOpacity = 0.5;\r\n // Make system tooltips appear by default\r\n _this.showSystemTooltip = true;\r\n _this.startGrip = new ResizeButton();\r\n _this.endGrip = new ResizeButton();\r\n // Default orientation...\r\n // ... is set in `applyInternalDefaults()` because it accesses `language`\r\n // and should only be started to access when parent is set\r\n // Set events\r\n _this.events.on(\"transformed\", function () {\r\n _this.updateThumb();\r\n }, _this, false);\r\n // Initial positions\r\n _this.start = 0;\r\n _this.end = 1;\r\n // Set roles\r\n _this.role = \"scrollbar\";\r\n _this.thumb.role = \"slider\";\r\n _this.thumb.readerLive = \"polite\";\r\n _this.startGrip.role = \"slider\";\r\n _this.endGrip.role = \"slider\";\r\n // otherwise range changed won't be registered\r\n _this.events.once(\"inited\", function () {\r\n _this._previousStart = undefined;\r\n _this.dispatchRangeChange();\r\n }, undefined, false);\r\n _this.hideGrips = false;\r\n _this.orientation = \"horizontal\";\r\n // Min/max values for accessibility\r\n _this.setSVGAttribute({ \"aria-valuemin\": \"0\" });\r\n _this.setSVGAttribute({ \"aria-valuemax\": \"100\" });\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Sets defaults that instantiate some objects that rely on parent, so they\r\n * cannot be set in constructor.\r\n */\r\n Scrollbar.prototype.applyInternalDefaults = function () {\r\n _super.prototype.applyInternalDefaults.call(this);\r\n // Set screen reader tetxt accordingly\r\n if (this.orientation === \"horizontal\") {\r\n if (!$type.hasValue(this.readerTitle)) {\r\n this.readerTitle = this.language.translate(\"Use TAB to select grip buttons or left and right arrows to change selection\");\r\n }\r\n if (!$type.hasValue(this.thumb.readerDescription)) {\r\n this.thumb.readerDescription = this.language.translate(\"Use left and right arrows to move selection\");\r\n }\r\n if (!$type.hasValue(this.startGrip.readerDescription)) {\r\n this.startGrip.readerDescription = this.language.translate(\"Use left and right arrows to move left selection\");\r\n }\r\n if (!$type.hasValue(this.endGrip.readerDescription)) {\r\n this.endGrip.readerDescription = this.language.translate(\"Use left and right arrows to move right selection\");\r\n }\r\n this.readerOrientation = \"horizontal\";\r\n }\r\n else {\r\n if (!$type.hasValue(this.readerTitle)) {\r\n this.readerTitle = this.language.translate(\"Use TAB select grip buttons or up and down arrows to change selection\");\r\n }\r\n if (!$type.hasValue(this.thumb.readerDescription)) {\r\n this.thumb.readerDescription = this.language.translate(\"Use up and down arrows to move selection\");\r\n }\r\n if (!$type.hasValue(this.startGrip.readerDescription)) {\r\n this.startGrip.readerDescription = this.language.translate(\"Use up and down arrows to move upper selection\");\r\n }\r\n if (!$type.hasValue(this.endGrip.readerDescription)) {\r\n this.endGrip.readerDescription = this.language.translate(\"Use up and down arrows to move lower selection\");\r\n }\r\n this.readerOrientation = \"vertical\";\r\n }\r\n this.readerControls = this.baseSprite.uidAttr();\r\n };\r\n /**\r\n * Validates the layout of the scrollbar's elements.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Scrollbar.prototype.validateLayout = function () {\r\n this.updateSize();\r\n _super.prototype.validateLayout.call(this);\r\n // when size changes, need to update extremes\r\n this.updateExtremes();\r\n };\r\n /**\r\n * Update background for the scrollbar.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Scrollbar.prototype.processBackground = function () {\r\n _super.prototype.processBackground.call(this);\r\n var background = this.background;\r\n background.clickable = true;\r\n background.events.on(\"hit\", this.handleBgHit, this, undefined);\r\n };\r\n /**\r\n * Zooms to the particular place when clicked/tapped on the scrollbar\r\n * background.\r\n *\r\n * @ignore Exclude from docs\r\n * @param event Event\r\n */\r\n Scrollbar.prototype.handleBgHit = function (event) {\r\n this.makeBusy();\r\n var point = event.spritePoint;\r\n point = $utils.spritePointToSprite(point, this.background, this);\r\n var thumb = this.thumb;\r\n if (this.orientation == \"horizontal\") {\r\n var thumbX = point.x - thumb.pixelWidth / 2;\r\n thumbX = $math.fitToRange(thumbX, 0, this.innerWidth - thumb.pixelWidth);\r\n this._thumbAnimation = thumb.animate({ property: \"x\", to: thumbX }, this.animationDuration, this.animationEasing);\r\n }\r\n else {\r\n var thumbY = point.y - thumb.pixelHeight / 2;\r\n thumbY = $math.fitToRange(thumbY, 0, this.innerHeight - thumb.pixelHeight);\r\n this._thumbAnimation = thumb.animate({ property: \"y\", to: thumbY }, this.animationDuration, this.animationEasing);\r\n }\r\n if (this.animationDuration > 0) {\r\n this._thumbAnimation.events.on(\"animationended\", this.makeUnbusy, this, false);\r\n }\r\n else {\r\n this._thumb.validate();\r\n this.makeUnbusy();\r\n }\r\n };\r\n /**\r\n * Set scrollbar as busy. (currently zooming)\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Scrollbar.prototype.makeBusy = function () {\r\n this._isBusy = true;\r\n this._skipRangeEvents = false;\r\n if (this._unbusyTimeout) {\r\n this.removeDispose(this._unbusyTimeout);\r\n }\r\n this._unbusyTimeout = undefined;\r\n this.stopAnimations();\r\n };\r\n /**\r\n * Stops all animations, currently playing for the scrollbar.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Scrollbar.prototype.stopAnimations = function () {\r\n if (this._thumbAnimation) {\r\n this._thumbAnimation.stop(true);\r\n }\r\n if (this._zoomAnimation) {\r\n this._zoomAnimation.stop(true);\r\n }\r\n };\r\n /**\r\n * Cancels \"busy\" status of the Scrollbar.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Scrollbar.prototype.makeUnbusy = function () {\r\n /**\r\n * We cannot make Scrollbar not busy right after release, because then axes\r\n * will take over controll and Scrollbar will start to animate.\r\n * Theorethically, it's not right to set timeout by `animationDuration`,\r\n * however we can not know all the durations of elements we scroll, so we\r\n * assume that animation duration will be the same as\r\n * `interpolationDuration` or `rangeChange` duration.\r\n */\r\n this._unbusyTimeout = this.setTimeout(this.makeUnbusyReal.bind(this), this.animationDuration * 1.1);\r\n };\r\n /**\r\n * [makeUnbusyReal description]\r\n *\r\n * @todo Description\r\n * @ignore Exclude from docs\r\n */\r\n Scrollbar.prototype.makeUnbusyReal = function () {\r\n this._usingGrip = undefined;\r\n this._isBusy = false;\r\n if (!this.updateWhileMoving) {\r\n this.dispatchRangeChange();\r\n }\r\n };\r\n /**\r\n * Disptatches rangechanged event if it really changed\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Scrollbar.prototype.dispatchRangeChange = function () {\r\n if (this._previousEnd != this.end || this._previousStart != this.start) {\r\n this._previousStart = this.start;\r\n this._previousEnd = this.end;\r\n this.dispatch(\"rangechanged\");\r\n }\r\n };\r\n /**\r\n * Updates the \"thumb\" element. A draggable element between the grips.\r\n * @ignore\r\n */\r\n Scrollbar.prototype.updateThumb = function (dispatchEvents) {\r\n if (dispatchEvents === void 0) { dispatchEvents = true; }\r\n if (!this.parent) {\r\n return;\r\n }\r\n var thumb = this.thumb;\r\n var start = this.start;\r\n var end = this.end;\r\n var startGrip = this.startGrip;\r\n var endGrip = this.endGrip;\r\n var directionFlipped = this.adapter.apply(\"positionValueDirection\", {\r\n flipped: false\r\n }).flipped;\r\n var fromName = directionFlipped ? \"To %1\" : \"From %1\";\r\n var toName = directionFlipped ? \"From %1\" : \"To %1\";\r\n var fromValue;\r\n var toValue;\r\n if (this.orientation == \"horizontal\") {\r\n var innerWidth_1 = this.innerWidth;\r\n thumb.width = innerWidth_1 * (end - start);\r\n thumb.maxX = innerWidth_1 - thumb.pixelWidth;\r\n thumb.x = start * innerWidth_1;\r\n startGrip.moveTo({ x: thumb.pixelX, y: 0 }, undefined, undefined, true); // overrides dragging\r\n endGrip.moveTo({ x: thumb.pixelX + thumb.pixelWidth, y: 0 }, undefined, undefined, true);\r\n fromValue = this.adapter.apply(\"positionValue\", {\r\n value: Math.round(start * 100) + \"%\",\r\n position: start\r\n }).value;\r\n toValue = this.adapter.apply(\"positionValue\", {\r\n value: Math.round(end * 100) + \"%\",\r\n position: end\r\n }).value;\r\n startGrip.readerTitle = this.language.translate(fromName, undefined, fromValue);\r\n startGrip.readerValueNow = \"\" + Math.round(start * 100);\r\n startGrip.readerValueText = startGrip.readerTitle;\r\n endGrip.readerTitle = this.language.translate(toName, undefined, toValue);\r\n endGrip.readerValueNow = \"\" + Math.round(end * 100);\r\n endGrip.readerValueText = endGrip.readerTitle;\r\n }\r\n else {\r\n var innerHeight_1 = this.innerHeight;\r\n thumb.height = innerHeight_1 * (end - start);\r\n thumb.maxY = innerHeight_1 - thumb.pixelHeight;\r\n thumb.y = (1 - end) * innerHeight_1;\r\n startGrip.moveTo({ x: 0, y: thumb.pixelY + thumb.pixelHeight }, undefined, undefined, true);\r\n endGrip.moveTo({ x: 0, y: thumb.pixelY }, undefined, undefined, true);\r\n fromValue = this.adapter.apply(\"positionValue\", {\r\n value: Math.round((1 - start) * 100) + \"%\",\r\n position: (1 - start)\r\n }).value;\r\n toValue = this.adapter.apply(\"positionValue\", {\r\n value: Math.round((1 - end) * 100) + \"%\",\r\n position: (1 - end)\r\n }).value;\r\n startGrip.readerTitle = this.language.translate(toName, undefined, fromValue);\r\n startGrip.readerValueNow = \"\" + Math.round(start * 100);\r\n startGrip.readerValueText = startGrip.readerTitle;\r\n endGrip.readerTitle = this.language.translate(fromName, undefined, toValue);\r\n endGrip.readerValueNow = \"\" + Math.round(end * 100);\r\n endGrip.readerValueText = endGrip.readerTitle;\r\n }\r\n // Add accessibility\r\n thumb.readerTitle = this.language.translate(\"From %1 to %2\", undefined, fromValue, toValue);\r\n thumb.readerValueNow = \"\" + Math.round(start * 100);\r\n thumb.readerValueText = thumb.readerTitle;\r\n this.readerValueNow = \"\" + Math.round(start * 100);\r\n this.readerValueText = thumb.readerTitle;\r\n if (!this._skipRangeEvents && this.updateWhileMoving && dispatchEvents) {\r\n this.dispatchRangeChange();\r\n }\r\n };\r\n /**\r\n * Updates extremes of the scrollbar.\r\n */\r\n Scrollbar.prototype.updateExtremes = function () {\r\n var orientation = this.orientation;\r\n var minX = 0;\r\n var minY = 0;\r\n var maxX = 0;\r\n var maxY = 0;\r\n if (orientation == \"horizontal\") {\r\n maxX = this.innerWidth;\r\n minY = maxY = this.innerHeight / 2;\r\n }\r\n else {\r\n maxY = this.innerHeight;\r\n minX = maxX = this.innerWidth / 2;\r\n }\r\n var startGrip = this.startGrip;\r\n startGrip.minX = minX;\r\n startGrip.maxX = maxX;\r\n startGrip.minY = minY;\r\n startGrip.maxY = maxY;\r\n var endGrip = this.endGrip;\r\n endGrip.minX = minX;\r\n endGrip.maxX = maxX;\r\n endGrip.minY = minY;\r\n endGrip.maxY = maxY;\r\n var thumb = this.thumb;\r\n thumb.minX = minX;\r\n thumb.maxX = maxX;\r\n thumb.minY = minY;\r\n thumb.maxY = maxY;\r\n };\r\n /**\r\n * Updates size of the scrollbar.\r\n */\r\n Scrollbar.prototype.updateSize = function () {\r\n var orientation = this.orientation;\r\n var startGrip = this.startGrip;\r\n if (startGrip) {\r\n startGrip.orientation = orientation;\r\n }\r\n if (this.endGrip) {\r\n this.endGrip.orientation = orientation;\r\n }\r\n var thumb = this.thumb;\r\n if (thumb) {\r\n if (orientation == \"horizontal\") {\r\n if (!$type.isNumber(this._pixelWidth)) {\r\n if (!(this.width instanceof Percent)) {\r\n this.width = percent(100);\r\n }\r\n }\r\n // this teorethically might be wrong, if user indeed sets height of a horizontal scrollbar in percent\r\n // however without this height might be equal to 100% if previous orientation was set to horizontal\r\n // so this is ok solution, in case user really wants to have scrollbar height set in percent,\r\n // he should do this after orientation.\r\n if ($type.hasValue(this.percentHeight)) {\r\n this.height = this.minHeight;\r\n }\r\n thumb.height = this.innerHeight;\r\n thumb.verticalCenter = \"middle\";\r\n thumb.horizontalCenter = \"left\";\r\n }\r\n else {\r\n if (!$type.isNumber(this._pixelHeight)) {\r\n if (!(this.height instanceof Percent)) {\r\n this.height = percent(100);\r\n }\r\n }\r\n // same as above with percentHeight\r\n if ($type.hasValue(this.percentWidth)) {\r\n this.width = this.minWidth;\r\n }\r\n thumb.width = this.innerWidth;\r\n thumb.verticalCenter = \"top\";\r\n thumb.horizontalCenter = \"middle\";\r\n }\r\n }\r\n };\r\n Object.defineProperty(Scrollbar.prototype, \"isBusy\", {\r\n /**\r\n * Indicates if the Scrollbar is currently \"busy\" (animating and or\r\n * performing zoom by user interaction).\r\n * @return boolean\r\n */\r\n get: function () {\r\n return this._isBusy;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Scrollbar.prototype, \"start\", {\r\n /**\r\n * @return Position (0-1)\r\n */\r\n get: function () {\r\n return Math.min(this.getPosition(this._start), this.getPosition(this._end));\r\n },\r\n /**\r\n * ==========================================================================\r\n * POSITIONS\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Relative position (0-1) of the start grip.\r\n *\r\n * @param position Position (0-1)\r\n */\r\n set: function (position) {\r\n if (!this._isBusy) {\r\n this.__start = position;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Scrollbar.prototype, \"__start\", {\r\n /**\r\n * @return [description]\r\n */\r\n get: function () {\r\n return this._start;\r\n },\r\n /**\r\n * [__start description]\r\n *\r\n * @todo Description\r\n * @param position [description]\r\n */\r\n set: function (position) {\r\n this._start = this.getPosition(position);\r\n this.updateThumb();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Scrollbar.prototype, \"end\", {\r\n /**\r\n * @return Position (0-1)\r\n */\r\n get: function () {\r\n return Math.max(this.getPosition(this._start), this.getPosition(this._end));\r\n },\r\n /**\r\n * Relative position (0-1) of the end grip.\r\n *\r\n * @param position Position (0-1)\r\n */\r\n set: function (position) {\r\n if (!this._isBusy) {\r\n this.__end = position;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Scrollbar.prototype, \"__end\", {\r\n /**\r\n * @return [description]\r\n */\r\n get: function () {\r\n return this._end;\r\n },\r\n /**\r\n * [__end description]\r\n *\r\n * @todo Description\r\n * @param position [description]\r\n */\r\n set: function (position) {\r\n this._end = this.getPosition(position);\r\n this.updateThumb();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Scrollbar.prototype, \"range\", {\r\n /**\r\n * Current selection range.\r\n *\r\n * @readonly\r\n * @return Range\r\n */\r\n get: function () {\r\n return { start: this.start, end: this.end, priority: this._usingGrip };\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Disables range change events.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Scrollbar.prototype.skipRangeEvents = function () {\r\n if (!this._isBusy) {\r\n this._skipRangeEvents = true;\r\n }\r\n };\r\n /**\r\n * [fixRange description]\r\n *\r\n * @todo Description\r\n * @ignore Exclude from docs\r\n * @param range Range\r\n */\r\n Scrollbar.prototype.fixRange = function (range) {\r\n if (range.start != $math.round(this._start, 2) || range.end != $math.round(this._end, 2)) {\r\n this._start = range.start;\r\n this._end = range.end;\r\n this._skipRangeEvents = true;\r\n this.updateThumb();\r\n this._skipRangeEvents = false;\r\n this.thumb.validate();\r\n this.thumb.background.validate();\r\n }\r\n };\r\n /**\r\n * [getPosition description]\r\n *\r\n * @todo Description\r\n * @param position [description]\r\n * @return [description]\r\n */\r\n Scrollbar.prototype.getPosition = function (position) {\r\n return $math.fitToRange($math.round(position, 4), 0, 1);\r\n };\r\n Object.defineProperty(Scrollbar.prototype, \"orientation\", {\r\n /**\r\n * @return Orientation\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"orientation\");\r\n },\r\n /**\r\n * ==========================================================================\r\n * MISC\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Orientation of the scrollbar.\r\n *\r\n * Available options: \"horizontal\" (default) and \"vertical\".\r\n *\r\n * @default \"horizontal\"\r\n * @param value Orientation\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"orientation\", value)) {\r\n // Set mouse cursors and screen reader tetxt accordingly\r\n if (value === \"horizontal\") {\r\n // Mouse styles\r\n this.startGrip.cursorOverStyle = MouseCursorStyle.horizontalResize;\r\n this.endGrip.cursorOverStyle = MouseCursorStyle.horizontalResize;\r\n // Reader text\r\n /*this.readerTitle = this.language.translate(\"Use TAB to select grip buttons or left and right arrows to change selection\");\r\n this.thumb.readerDescription = this.language.translate(\"Use left and right arrows to move selection\");\r\n this.startGrip.readerDescription = this.language.translate(\"Use left and right arrows to move left selection\");\r\n this.endGrip.readerDescription = this.language.translate(\"Use left and right arrows to move right selection\");*/\r\n }\r\n else {\r\n // Mouse styles\r\n this.startGrip.cursorOverStyle = MouseCursorStyle.verticalResize;\r\n this.endGrip.cursorOverStyle = MouseCursorStyle.verticalResize;\r\n // Reader text\r\n /*this.readerTitle = this.language.translate(\"Use TAB select grip buttons or up and down arrows to change selection\");\r\n this.thumb.readerDescription = this.language.translate(\"Use up and down arrows to move selection\");\r\n this.startGrip.readerDescription = this.language.translate(\"Use up and down arrows to move upper selection\");\r\n this.endGrip.readerDescription = this.language.translate(\"Use up and down arrows to move lower selection\");*/\r\n }\r\n this.updateByOrientation();\r\n this.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n Scrollbar.prototype.updateByOrientation = function () {\r\n };\r\n Object.defineProperty(Scrollbar.prototype, \"startGrip\", {\r\n /**\r\n * @return Grip element\r\n */\r\n get: function () {\r\n return this._startGrip;\r\n },\r\n /**\r\n * ==========================================================================\r\n * GRIPS\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Start grip element. (button)\r\n *\r\n * @param button Grip element\r\n */\r\n set: function (button) {\r\n if (this._startGrip) {\r\n this.removeDispose(this._startGrip);\r\n }\r\n this._startGrip = button;\r\n this.processGrip(button);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Scrollbar.prototype, \"endGrip\", {\r\n /**\r\n * @return Grip element\r\n */\r\n get: function () {\r\n return this._endGrip;\r\n },\r\n /**\r\n * End grip element. (button)\r\n *\r\n * @param button Grip element\r\n */\r\n set: function (button) {\r\n if (this._endGrip) {\r\n this.removeDispose(this._endGrip);\r\n }\r\n this._endGrip = button;\r\n this.processGrip(button);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Decorates the grip button with properties and events.\r\n *\r\n * @ignore Exclude from docs\r\n * @param button Grip button\r\n */\r\n Scrollbar.prototype.processGrip = function (button) {\r\n button.parent = this;\r\n button.isMeasured = false;\r\n button.focusable = true;\r\n button.shouldClone = false;\r\n // Set button defaults\r\n //button.showSystemTooltip = true; // setting this here is not right because we break inheritance\r\n button.zIndex = 100;\r\n button.events.on(\"drag\", this.handleGripDrag, this, false);\r\n button.events.on(\"dragstop\", this.makeUnbusy, this, false);\r\n button.events.on(\"down\", this.makeBusy, this, false);\r\n button.events.on(\"up\", this.makeUnbusy, this, false);\r\n this._disposers.push(button);\r\n };\r\n /**\r\n * Updates positions of related elements after grip element is dragged.\r\n *\r\n * @ignore Exclude from docs\r\n * @param event Event\r\n */\r\n Scrollbar.prototype.handleGripDrag = function (event) {\r\n this.makeBusy();\r\n if (event.target === this._startGrip) {\r\n this._usingGrip = \"start\";\r\n }\r\n else {\r\n this._usingGrip = \"end\";\r\n }\r\n if (this.orientation == \"horizontal\") {\r\n this._start = this.startGrip.pixelX / this.innerWidth;\r\n this._end = this.endGrip.pixelX / this.innerWidth;\r\n }\r\n else {\r\n this._start = 1 - this.startGrip.pixelY / this.innerHeight;\r\n this._end = 1 - this.endGrip.pixelY / this.innerHeight;\r\n }\r\n this.updateThumb();\r\n };\r\n Object.defineProperty(Scrollbar.prototype, \"thumb\", {\r\n /**\r\n * @return Thumb element\r\n */\r\n get: function () {\r\n if (!this._thumb) {\r\n // Create scrollbar controls (setters will handle adding disposers)\r\n var thumb = new Button();\r\n thumb.background.cornerRadius(10, 10, 10, 10);\r\n thumb.padding(0, 0, 0, 0);\r\n this.thumb = thumb;\r\n }\r\n return this._thumb;\r\n },\r\n /**\r\n * A \"thumb\" element.\r\n *\r\n * It's a draggable square space between the grips, that can be used to\r\n * pan the selection.\r\n *\r\n * @param thumb Thumb element\r\n */\r\n set: function (thumb) {\r\n var _this = this;\r\n if (thumb) {\r\n if (this._thumb) {\r\n this.removeDispose(this._thumb);\r\n }\r\n this._thumb = thumb;\r\n thumb.parent = this;\r\n thumb.isMeasured = false;\r\n thumb.inert = true;\r\n thumb.draggable = true;\r\n thumb.clickable = true;\r\n thumb.hoverable = true;\r\n thumb.focusable = true;\r\n thumb.shouldClone = false;\r\n thumb.zIndex = 0;\r\n // TODO remove closures ?\r\n // Add events\r\n // Add cursor styles to thumb\r\n thumb.cursorOverStyle = MouseCursorStyle.grab;\r\n thumb.cursorDownStyle = MouseCursorStyle.grabbing;\r\n thumb.events.on(\"dragstart\", this.makeBusy, this, false);\r\n thumb.events.on(\"dragstop\", this.makeUnbusy, this, false);\r\n thumb.events.on(\"positionchanged\", this.handleThumbPosition, this, false);\r\n thumb.events.on(\"sizechanged\", this.handleThumbPosition, this, false);\r\n thumb.events.on(\"doublehit\", this.handleDoubleClick, this, false);\r\n // Add event for space and ENTER to toggle full zoom out and back\r\n // (same as doubleclick)\r\n this._disposers.push(getInteraction().body.events.on(\"keyup\", function (ev) {\r\n if (keyboard.isKey(ev.event, [\"space\", \"enter\"]) && _this.thumb.isFocused) {\r\n ev.event.preventDefault();\r\n _this.handleDoubleClick();\r\n }\r\n }));\r\n this._disposers.push(this._thumb);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Zooms-in and out the selection on double-click of the thumb.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Scrollbar.prototype.handleDoubleClick = function () {\r\n this.makeBusy();\r\n var newStart = 0;\r\n var newEnd = 1;\r\n if (this.start != 0 || this.end != 1) {\r\n this._prevStart = this.start;\r\n this._prevEnd = this.end;\r\n }\r\n else {\r\n newStart = this._prevStart;\r\n newEnd = this._prevEnd;\r\n }\r\n var zoomAnimation = this.animate([{ property: \"__start\", to: newStart }, { property: \"__end\", to: newEnd }], this.animationDuration, this.animationEasing);\r\n if (zoomAnimation && !zoomAnimation.isFinished()) {\r\n zoomAnimation.events.on(\"animationended\", this.makeUnbusy, this, false);\r\n this._zoomAnimation = zoomAnimation;\r\n }\r\n else {\r\n this.makeUnbusy();\r\n }\r\n };\r\n /**\r\n * Updates positions of other elements when thumb is moved.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Scrollbar.prototype.handleThumbPosition = function () {\r\n var thumb = this.thumb;\r\n if (this.orientation == \"horizontal\") {\r\n var innerWidth_2 = this.innerWidth;\r\n var w = thumb.innerWidth;\r\n var x = thumb.pixelX;\r\n this._start = x / innerWidth_2;\r\n this._end = (x + w) / innerWidth_2;\r\n this.updateThumb();\r\n }\r\n else {\r\n var innerHeight_2 = this.innerHeight;\r\n var h = thumb.innerHeight;\r\n var y = thumb.pixelY;\r\n if (y + h > innerHeight_2) {\r\n y = innerHeight_2 - h;\r\n thumb.y = y;\r\n }\r\n this._start = 1 - (y + h) / innerHeight_2;\r\n this._end = 1 - y / innerHeight_2;\r\n this.updateThumb();\r\n }\r\n };\r\n /**\r\n * Creates a background element for the scrollbar.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Background\r\n */\r\n Scrollbar.prototype.createBackground = function () {\r\n return new RoundedRectangle();\r\n };\r\n Object.defineProperty(Scrollbar.prototype, \"hideGrips\", {\r\n /**\r\n * @return Show only on hover?\r\n */\r\n get: function () {\r\n return this._hideGrips;\r\n },\r\n /**\r\n * Use this property to set whether grips should be always visible (`false`),\r\n * or they should just appear on scrollbar hover (`true`).\r\n *\r\n * @param value Show only on hover?\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n this._hideGrips = value;\r\n if (this._overDisposer) {\r\n this.removeDispose(this._overDisposer);\r\n }\r\n if (this._outDisposer) {\r\n this.removeDispose(this._outDisposer);\r\n }\r\n if (value) {\r\n this._overDisposer = this.events.on(\"over\", function () {\r\n _this.startGrip.show();\r\n _this.endGrip.show();\r\n }, undefined, false);\r\n this._outDisposer = this.events.on(\"out\", function () {\r\n _this.startGrip.hide();\r\n _this.endGrip.hide();\r\n }, undefined, false);\r\n this.startGrip.hide();\r\n this.endGrip.hide();\r\n }\r\n else {\r\n this.startGrip.show();\r\n this.endGrip.show();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Scrollbar.prototype, \"animationDuration\", {\r\n /**\r\n * @return Orientation\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"animationDuration\");\r\n },\r\n /**\r\n * Duration in milliseconds of scrollbar animation (happens when user clicks on a background of a scrollbar)\r\n * @default 0\r\n * @param value number\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"animationDuration\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Scrollbar.prototype, \"animationEasing\", {\r\n /**\r\n * @return {Function}\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"animationEasing\");\r\n },\r\n /**\r\n * Animation easing function.\r\n * @todo: review description and default\r\n * @default $ease.cubicOut\r\n * @param value (value: number) => number\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"animationEasing\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Adds easing functions to \"function\" fields.\r\n *\r\n * @param field Field name\r\n * @return Assign as function?\r\n */\r\n Scrollbar.prototype.asFunction = function (field) {\r\n return field == \"animationEasing\" || _super.prototype.asIs.call(this, field);\r\n };\r\n return Scrollbar;\r\n}(Container));\r\nexport { Scrollbar };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Scrollbar\"] = Scrollbar;\r\n//# sourceMappingURL=Scrollbar.js.map","/**\r\n * Slider is a scrollbar with just one selection grip.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Scrollbar } from \"../../core/elements/Scrollbar\";\r\nimport { registry } from \"../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a slider - a version of scrollbar with just one grip.\r\n *\r\n * @see {@link ISliderEvents} for a list of available events\r\n * @see {@link ISliderAdapters} for a list of available Adapters\r\n */\r\nvar Slider = /** @class */ (function (_super) {\r\n __extends(Slider, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Slider() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Slider\";\r\n _this.thumb.opacity = 0;\r\n _this.thumb.interactionsEnabled = false;\r\n _this.endGrip.opacity = 0;\r\n _this.endGrip.interactionsEnabled = false;\r\n _this.startGrip.events.on(\"drag\", function () {\r\n _this.endGrip.x = _this.startGrip.x;\r\n _this.endGrip.y = _this.startGrip.y;\r\n });\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(Slider.prototype, \"__end\", {\r\n /**\r\n * @return [description]\r\n */\r\n get: function () {\r\n return this._start;\r\n },\r\n set: function (value) {\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slider.prototype, \"end\", {\r\n /**\r\n * @return [description]\r\n */\r\n get: function () {\r\n return this._start;\r\n },\r\n /**\r\n * Relative position (0-1) of the end grip.\r\n *\r\n * @param position Position (0-1)\r\n */\r\n set: function (position) {\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slider.prototype, \"start\", {\r\n /**\r\n * @return Position (0-1)\r\n */\r\n get: function () {\r\n return this._start;\r\n },\r\n /**\r\n * Relative position (0-1) of the start grip.\r\n *\r\n * @param position Position (0-1)\r\n */\r\n set: function (position) {\r\n if (!this._isBusy) {\r\n this.__start = position;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Slider;\r\n}(Scrollbar));\r\nexport { Slider };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Slider\"] = Slider;\r\n//# sourceMappingURL=Slider.js.map","/**\r\n * A module that defines Text element used to indicate links.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Label } from \"../../core/elements/Label\";\r\nimport { MouseCursorStyle } from \"../../core/interaction/Mouse\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { registry } from \"../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a text element with a link.\r\n *\r\n * @see {@link ITextLinkEvents} for a list of available events\r\n * @see {@link ITextLinkAdapters} for a list of available Adapters\r\n */\r\nvar TextLink = /** @class */ (function (_super) {\r\n __extends(TextLink, _super);\r\n /**\r\n * Constructor\r\n */\r\n function TextLink() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"TextLink\";\r\n _this.selectable = true;\r\n var interfaceColors = new InterfaceColorSet();\r\n _this.fill = interfaceColors.getFor(\"primaryButton\").brighten(0.3);\r\n var hoverState = _this.states.create(\"hover\");\r\n hoverState.properties.fill = interfaceColors.getFor(\"primaryButtonHover\").brighten(0.3);\r\n var downState = _this.states.create(\"down\");\r\n downState.properties.fill = interfaceColors.getFor(\"primaryButtonDown\").brighten(0.3);\r\n _this.cursorOverStyle = MouseCursorStyle.pointer;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n return TextLink;\r\n}(Label));\r\nexport { TextLink };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"TextLink\"] = TextLink;\r\n//# sourceMappingURL=TextLink.js.map","/**\r\n * This module contains a base class for an SVG filter.\r\n *\r\n * Filters can be used to decorate, change and transform just about any DOM\r\n * element.\r\n *\r\n * A Filter works by applying one or more effects (primitives) to SVG element.\r\n *\r\n * For more information on how SVG filters work, refer to\r\n * [this MDN tutorial](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/SVG_Filters_Tutorial).\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../../Base\";\r\nimport { getGhostPaper } from \"../Paper\";\r\nimport { Animation, AnimationDisposer } from \"../../utils/Animation\";\r\nimport { List } from \"../../utils/List\";\r\nimport * as $object from \"../../utils/Object\";\r\nimport * as $iter from \"../../utils/Iterator\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Base filter class.\r\n *\r\n * This class while can be instantiated will not do anything. It is just a base\r\n * functionality for any other \"real\" filters to extend.\r\n *\r\n * Filters can be used to decorate, change and transform just about any DOM\r\n * element.\r\n *\r\n * A Filter works by applying one or more effects (primitives) to SVG element.\r\n *\r\n * For more information on how SVG filters work, refer to\r\n * [this MDN tutorial](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/SVG_Filters_Tutorial).\r\n *\r\n * @todo Example\r\n */\r\nvar Filter = /** @class */ (function (_super) {\r\n __extends(Filter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Filter() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * A storage for Filter property/value pairs.\r\n *\r\n * @ignore Exclude from docs\r\n * @see {@link FilterProperties}\r\n */\r\n _this.properties = {};\r\n /**\r\n * Identifies if this object is a \"template\" and should not be treated as\r\n * real object that is drawn or actually used in the chart.\r\n */\r\n _this.isTemplate = false;\r\n /**\r\n * [_scale description]\r\n *\r\n * @todo Description\r\n */\r\n _this._scale = 1;\r\n /**\r\n * [_nonScaling description]\r\n *\r\n * @todo Description\r\n */\r\n _this._nonScaling = true;\r\n _this.className = \"Filter\";\r\n // Create a list to hold primitives (effect elements)\r\n _this.filterPrimitives = new List();\r\n _this.properties.filterUnits = \"objectBoundingBox\";\r\n // Automatically add added primitives to `_disposers` so they are discarded\r\n // when Filter object is destroyed (disposed)\r\n _this.filterPrimitives.events.on(\"inserted\", function (ev) {\r\n _this._disposers.push(ev.newValue);\r\n });\r\n // Set default dimensions\r\n _this.width = 120;\r\n _this.height = 120;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Appends actual filter elements to the filter group.\r\n *\r\n * @ignore Exclude from docs\r\n * @param filterElement An SVG `<group>` element to add filter element to\r\n */\r\n Filter.prototype.appendPrimitives = function (filterElement) {\r\n $iter.each(this.filterPrimitives.iterator(), function (filterPrimitive) {\r\n filterElement.add(filterPrimitive);\r\n });\r\n };\r\n /**\r\n * Uses Transitions filter's values from current to target. This is used to\r\n * smoothly appear filter, rather than it pop into effect.\r\n *\r\n * @ignore Exclude from docs\r\n * @param animationOptions Animation options\r\n * @param duration Duration in milliseconds\r\n * @param easing Easing function\r\n * @return Animation instance\r\n */\r\n Filter.prototype.animate = function (animationOptions, duration, easing) {\r\n var animation = new Animation(this, animationOptions, duration, easing).start();\r\n return animation;\r\n };\r\n Object.defineProperty(Filter.prototype, \"width\", {\r\n /**\r\n * @return Width (%)\r\n */\r\n get: function () {\r\n return this.properties[\"width\"];\r\n },\r\n /**\r\n * Width of the filter element in percent.\r\n *\r\n * If the filter is designed to \"bleed out\" of the original target element,\r\n * like for example a shadow, you need this bigger than 100, or the\r\n * non-fitting parts will be clipped.\r\n *\r\n * @default 120\r\n * @param value Width (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"width\"] = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Filter.prototype, \"height\", {\r\n /**\r\n * @return Height\r\n */\r\n get: function () {\r\n return this.properties[\"height\"];\r\n },\r\n /**\r\n * Height of the filter element in percent.\r\n *\r\n * If the filter is designed to \"bleed out\" of the original target element,\r\n * like for example a shadow, you need this bigger than 100, or the\r\n * non-fitting parts will be clipped.\r\n *\r\n * @default 120\r\n * @param value Height (%)\r\n */\r\n set: function (value) {\r\n this.properties[\"height\"] = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies properties from another [[Filter]] object.\r\n *\r\n * @param filter Source [[Filter]] object\r\n */\r\n Filter.prototype.copyFrom = function (filter) {\r\n var _this = this;\r\n _super.prototype.copyFrom.call(this, filter);\r\n $object.each(filter.properties, function (key, value) {\r\n _this[key] = value;\r\n });\r\n };\r\n Object.defineProperty(Filter.prototype, \"paper\", {\r\n /**\r\n * @return Paper\r\n */\r\n get: function () {\r\n if (this._paper) {\r\n return this._paper;\r\n }\r\n return getGhostPaper();\r\n },\r\n /**\r\n * Sets [[Paper]] instance to create filter's elements in.\r\n *\r\n * @ignore Exclude from docs\r\n * @param paper Paper\r\n */\r\n set: function (paper) {\r\n if (this._paper != paper) {\r\n this._paper = paper;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Filter.prototype, \"animations\", {\r\n /**\r\n * All animations currently in play.\r\n *\r\n * @ignore Exclude from docs\r\n * @return List of animations\r\n */\r\n get: function () {\r\n if (!this._animations) {\r\n this._animations = [];\r\n this._disposers.push(new AnimationDisposer(this._animations));\r\n }\r\n return this._animations;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Filter.prototype, \"scale\", {\r\n /**\r\n * @ignore Exclude from docs\r\n */\r\n get: function () {\r\n return this._scale;\r\n },\r\n /**\r\n * [[Sprite]] uses this method to inform filter about it's scale.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n set: function (value) {\r\n this._scale = value;\r\n this.updateScale();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Updates filter properties which depend on scale.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Filter.prototype.updateScale = function () {\r\n // Dummy method for extending classes to override.\r\n };\r\n Object.defineProperty(Filter.prototype, \"filterUnits\", {\r\n /**\r\n * @return Filter units\r\n */\r\n get: function () {\r\n return this.properties.filterUnits;\r\n },\r\n /**\r\n * Which units are used when drawing filter.\r\n *\r\n * Use `\"userSpaceOnUse\"` when applying filters on a perfectly straight line.\r\n *\r\n * @since 4.9.17\r\n * @default objectBoundingBox\r\n * @param value Filter units\r\n */\r\n set: function (value) {\r\n this.properties.filterUnits = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Filter.prototype, \"nonScaling\", {\r\n /**\r\n * @return Non scaling?\r\n */\r\n get: function () {\r\n return this._nonScaling;\r\n },\r\n /**\r\n * If a filter is non scaling, it will look the same even if the sprite is\r\n * scaled, otherwise filter will scale together with a [[Sprite]].\r\n *\r\n * @default false\r\n * @param value Non scaling?\r\n */\r\n set: function (value) {\r\n this._nonScaling = value;\r\n if (!value) {\r\n this._scale = 1;\r\n }\r\n this.updateScale();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Filter.prototype, \"sprite\", {\r\n /**\r\n * A target element this filter is currently attached to.\r\n *\r\n * We need to keep track of it because one filter can be used for just one\r\n * element, so we have to remove it from the old \"parent\" when attaching to\r\n * the new one.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Target element\r\n */\r\n set: function (value) {\r\n this.setSprite(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets filter's target element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Element filter is being attached to\r\n */\r\n Filter.prototype.setSprite = function (value) {\r\n if (this._sprite && this._sprite != value) {\r\n this._sprite.filters.removeValue(this);\r\n }\r\n this._sprite = value;\r\n };\r\n return Filter;\r\n}(BaseObject));\r\nexport { Filter };\r\n//# sourceMappingURL=Filter.js.map","/**\r\n * Module for \"Drop Shadow\" filter.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Filter } from \"./Filter\";\r\nimport { color } from \"../../utils/Color\";\r\nimport { registry } from \"../../Registry\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creats a \"Drop Shadow\" filter.\r\n */\r\nvar DropShadowFilter = /** @class */ (function (_super) {\r\n __extends(DropShadowFilter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function DropShadowFilter() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"DropShadowFilter\";\r\n // Create elements\r\n // NOTE: we do not need to add each individual element to `_disposers`\r\n // because `filterPrimitives` has an event handler which automatically adds\r\n // anything added to it to `_disposers`\r\n _this.color = color(\"#000\");\r\n _this.feGaussianBlur = _this.paper.add(\"feGaussianBlur\");\r\n _this.feGaussianBlur.attr({ \"result\": \"blurOut\", \"in\": \"SourceGraphic\" });\r\n _this.filterPrimitives.push(_this.feGaussianBlur);\r\n _this.feOffset = _this.paper.add(\"feOffset\");\r\n _this.feOffset.attr({ \"result\": \"offsetBlur\" });\r\n _this.filterPrimitives.push(_this.feOffset);\r\n _this.feFlood = _this.paper.add(\"feFlood\");\r\n _this.feFlood.attr({ \"flood-color\": _this.color });\r\n _this.filterPrimitives.push(_this.feFlood);\r\n _this.feComposite = _this.paper.add(\"feComposite\");\r\n _this.feComposite.attr({ \"in2\": \"offsetBlur\", operator: \"in\" });\r\n _this.filterPrimitives.push(_this.feComposite);\r\n _this.feMerge = _this.paper.addGroup(\"feMerge\");\r\n _this.feMerge.add(_this.paper.add(\"feMergeNode\"));\r\n _this.feMerge.add(_this.paper.add(\"feMergeNode\").attr({ \"in\": \"SourceGraphic\" }));\r\n _this.filterPrimitives.push(_this.feMerge);\r\n // Set default properties\r\n _this.width = 200;\r\n _this.height = 200;\r\n _this.blur = 1.5;\r\n _this.dx = 3;\r\n _this.dy = 3;\r\n _this.opacity = 0.5;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(DropShadowFilter.prototype, \"color\", {\r\n /**\r\n * @return Color\r\n */\r\n get: function () {\r\n return this.properties.color;\r\n },\r\n /**\r\n * Shadow color.\r\n *\r\n * @param value Color\r\n */\r\n set: function (value) {\r\n this.properties.color = value;\r\n if (this.feFlood) {\r\n this.feFlood.attr({ \"flood-color\": value });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropShadowFilter.prototype, \"opacity\", {\r\n /**\r\n * @return Opacity (0-1)\r\n */\r\n get: function () {\r\n return this.properties.opacity;\r\n },\r\n /**\r\n * Opacity of the shadow. (0-1)\r\n *\r\n * @param value Opacity (0-1)\r\n */\r\n set: function (value) {\r\n this.properties.opacity = value;\r\n this.feFlood.attr({ \"flood-opacity\": value });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropShadowFilter.prototype, \"dx\", {\r\n /**\r\n * @return Horizontal offset (px)\r\n */\r\n get: function () {\r\n return this.properties.dx;\r\n },\r\n /**\r\n * Horizontal offset in pixels.\r\n *\r\n * @param value Horizontal offset (px)\r\n */\r\n set: function (value) {\r\n this.properties.dx = value;\r\n this.feOffset.attr({ \"dx\": value / this.scale });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropShadowFilter.prototype, \"dy\", {\r\n /**\r\n * @return Vertical offset (px)\r\n */\r\n get: function () {\r\n return this.properties.dy;\r\n },\r\n /**\r\n * Vertical offset in pixels.\r\n *\r\n * @param value Vertical offset (px)\r\n */\r\n set: function (value) {\r\n this.properties.dy = value;\r\n this.feOffset.attr({ \"dy\": value / this.scale });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropShadowFilter.prototype, \"blur\", {\r\n /**\r\n * @return Blur\r\n */\r\n get: function () {\r\n return this.properties.blur;\r\n },\r\n /**\r\n * Blur.\r\n *\r\n * @param value Blur\r\n */\r\n set: function (value) {\r\n this.properties.blur = value;\r\n this.feGaussianBlur.attr({ \"stdDeviation\": value / this.scale });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * [updateScale description]\r\n *\r\n * @todo Description\r\n */\r\n DropShadowFilter.prototype.updateScale = function () {\r\n this.dx = this.dx;\r\n this.dy = this.dy;\r\n this.blur = this.blur;\r\n };\r\n return DropShadowFilter;\r\n}(Filter));\r\nexport { DropShadowFilter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"DropShadowFilter\"] = DropShadowFilter;\r\n//# sourceMappingURL=DropShadowFilter.js.map","/**\r\n * Provides functionality used to creating and showing tooltips (balloons).\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../Container\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { PointedRectangle } from \"./PointedRectangle\";\r\nimport { Label } from \"../elements/Label\";\r\nimport { Animation } from \"../utils/Animation\";\r\nimport { color } from \"../utils/Color\";\r\nimport { DropShadowFilter } from \"../rendering/filters/DropShadowFilter\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $ease from \"../utils/Ease\";\r\nimport * as $utils from \"../utils/Utils\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Tooltip displays text and/or multimedia information in a balloon over chart\r\n * area.\r\n * @see {@link ITooltipEvents} for a list of available events\r\n * @see {@link ITooltipAdapters} for a list of available Adapters\r\n */\r\nvar Tooltip = /** @class */ (function (_super) {\r\n __extends(Tooltip, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Tooltip() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * Holds numeric boundary values. Calculated from the `boundingContainer`.\r\n * @ignore\r\n */\r\n _this._boundingRect = { x: -40000, y: -40000, width: 80000, height: 80000 };\r\n /**\r\n * Coordinates tooltip's pointer (stem) should point to.\r\n */\r\n _this._pointTo = { x: 0, y: 0 };\r\n /**\r\n * If set to `true` the pointer/stem of the Tooltip will not go outside\r\n * Tooltip's width or height depending on pointer's orientation.\r\n *\r\n * @default false\r\n */\r\n _this.fitPointerToBounds = false;\r\n /**\r\n * If `tooltipOrientation` is vertical, it can be drawn below or above point\r\n * We need to know this when solving overlapping.\r\n */\r\n _this._verticalOrientation = \"up\";\r\n /**\r\n * @ignore\r\n */\r\n _this.fixDoc = true;\r\n _this.className = \"Tooltip\";\r\n _this.isMeasured = false;\r\n _this.getFillFromObject = true;\r\n _this.margin(5, 5, 5, 5);\r\n _this.defaultState.transitionDuration = 1;\r\n _this.hiddenState.transitionDuration = 1;\r\n // Create chrome/background\r\n var background = _this.background;\r\n background.interactionsEnabled = false;\r\n background.fillOpacity = 0.9;\r\n background.strokeWidth = 1;\r\n background.strokeOpacity = 1;\r\n background.stroke = color(\"#ffffff\");\r\n background.cornerRadius = 3;\r\n background.pointerLength = 6;\r\n background.pointerBaseWidth = 10;\r\n var dropShadow = new DropShadowFilter();\r\n dropShadow.dy = 1;\r\n dropShadow.dx = 1;\r\n dropShadow.opacity = 0.5;\r\n background.filters.push(dropShadow);\r\n _this.autoTextColor = true;\r\n // Create text element\r\n var label = _this.createChild(Label);\r\n label.shouldClone = false;\r\n _this.label = label;\r\n label.padding(7, 12, 4, 12);\r\n label.interactionsEnabled = false;\r\n label.horizontalCenter = \"middle\";\r\n label.fill = color(\"#ffffff\");\r\n _this._disposers.push(label);\r\n _this.label.events.on(\"sizechanged\", _this.drawBackground, _this);\r\n _this.label.zIndex = 1; // @todo remove this line when bg sorting is solved\r\n // Set defaults\r\n _this.pointerOrientation = \"vertical\";\r\n _this.animationDuration = 0;\r\n _this.animationEasing = $ease.cubicOut;\r\n _this.setPropertyValue(\"showInViewport\", false);\r\n // Set accessibility options\r\n _this.role = \"tooltip\";\r\n _this.visible = false;\r\n _this.opacity = 0;\r\n _this.x = 0;\r\n _this.y = 0;\r\n _this.events.on(\"visibilitychanged\", _this.handleVisibility, _this);\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Tooltip.prototype.handleVisibility = function () {\r\n if (this.visible) {\r\n this.label.invalidate();\r\n }\r\n };\r\n Object.defineProperty(Tooltip.prototype, \"getStrokeFromObject\", {\r\n /**\r\n * Specifies if tooltip background should get stroke color from the sprite it is pointing to.\r\n *\r\n * @return {boolean}\r\n * @default false\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"getStrokeFromObject\");\r\n },\r\n /**\r\n * Specifies if tooltip background should get stroke color from the sprite it is pointing to.\r\n *\r\n * @param value boolean\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"getStrokeFromObject\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Tooltip.prototype, \"autoTextColor\", {\r\n /**\r\n * @return {boolean}\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"autoTextColor\");\r\n },\r\n /**\r\n * Specifies if text color should be chosen automatically for a better\r\n * readability.\r\n *\r\n * IMPORTANT: this feature is generally ignored, if `getFillFromObject = false`.\r\n *\r\n * If inheriting of `fill` color from object tooltip is displayed for is\r\n * disabled, this feature will not work. If you are explicitly setting a\r\n * color for tooltip background, you may set a color for its label as well\r\n * using `tooltip.label.fill` property.\r\n *\r\n *\r\n * @param value boolean\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"autoTextColor\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Tooltip.prototype, \"keepTargetHover\", {\r\n /**\r\n * @return Keep target hovered?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"keepTargetHover\");\r\n },\r\n /**\r\n * If this tooltip is displayed on hover on some other object, keep that\r\n * element hovered if hovering on the tooltip.\r\n *\r\n * @default false\r\n * @since 4.1.13\r\n * @param value Keep target hovered?\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n if (this.setPropertyValue(\"keepTargetHover\", value, true)) {\r\n if (value) {\r\n this.hoverable = true;\r\n this.background.interactionsEnabled = true;\r\n this._disposers.push(this.events.on(\"over\", function (ev) {\r\n if (_this.targetSprite && _this.targetSprite.hoverable) {\r\n _this.targetSprite.isHover = true;\r\n }\r\n }));\r\n this._disposers.push(this.events.on(\"out\", function (ev) {\r\n if (_this.targetSprite && _this.targetSprite.hoverable) {\r\n //this.hideTooltip();\r\n //this.targetSprite.handleOut();\r\n _this.targetSprite.isHover = false;\r\n }\r\n }));\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Tooltip.prototype, \"showInViewport\", {\r\n /**\r\n * @return Force showing tooltip?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"showInViewport\");\r\n },\r\n /**\r\n * Normally, a tooltip will hide itself if it is pointing to a coordinate\r\n * that is outside viewport.\r\n *\r\n * Setting this setting to `true` will override that and make tooltip\r\n * appear next to the viewport edge closest to the target point.\r\n *\r\n * @default false\r\n * @since 4.5.7\r\n * @param value Force showing tooltip?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"showInViewport\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Tooltip.prototype, \"getFillFromObject\", {\r\n /**\r\n * Specifies if tooltip background should get fill color from the sprite it is pointing to.\r\n *\r\n * @return {boolean}\r\n * @default true\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"getFillFromObject\");\r\n },\r\n /**\r\n * @param value boolean\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"getFillFromObject\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates and returns a background element.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Background\r\n */\r\n Tooltip.prototype.createBackground = function () {\r\n return new PointedRectangle();\r\n };\r\n Object.defineProperty(Tooltip.prototype, \"pointerOrientation\", {\r\n /**\r\n * @return Orientation\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"pointerOrientation\");\r\n },\r\n /**\r\n * Pointer orientation: `\"horizontal\"`, `\"vertical\"`, `\"up\"`, `\"down\"`,\r\n * `\"right\"`, or `\"left\"`.\r\n *\r\n * Options`\"horizontal\"` or `\"vertical\"` are location-aware, meaning they\r\n * will change position of the Tooltip based on the target point's position\r\n * in relation to chart center.\r\n *\r\n * Options `\"up\"`, `\"down\"`, `\"right\"`, `\"left\"` are static and will point\r\n * in the specified direction regardless of the position, even if that means\r\n * going out of chart/screen bounds.\r\n *\r\n * IMPORTANT: in some situations, like having multiple tooltips stacked for\r\n * multiple series, the `\"up\"` and `\"down\"` values might be ignored in order\r\n * to make tooltip overlap algorithm work.\r\n *\r\n * @default \"vertical\"\r\n * @param value Orientation\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"pointerOrientation\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Tooltip.prototype, \"animationDuration\", {\r\n /**\r\n * @return Orientation\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"animationDuration\");\r\n },\r\n /**\r\n * Duration in milliseconds for the animation to take place when the tooltip\r\n * is moving from one place to another.\r\n *\r\n * @default 0\r\n * @param value number\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"animationDuration\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Tooltip.prototype, \"animationEasing\", {\r\n /**\r\n * @return {Function}\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"animationEasing\");\r\n },\r\n /**\r\n * Tooltip animation (moving from one place to another) easing function.\r\n *\r\n * @default $ease.cubicOut\r\n * @param value (value: number) => number\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"animationEasing\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Tooltip.prototype, \"html\", {\r\n /**\r\n * @return HTML content\r\n */\r\n get: function () {\r\n return this.label.html;\r\n },\r\n /**\r\n * HTML content for the Tooltip.\r\n *\r\n * Provided value will be used as is, without applying any further\r\n * formatting to it.\r\n *\r\n * @param value HTML content\r\n */\r\n set: function (value) {\r\n if (this.label.html != value) {\r\n this.label.html = value;\r\n this.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Tooltip.prototype, \"text\", {\r\n /**\r\n * @return SVG text\r\n */\r\n get: function () {\r\n return this.label.text;\r\n },\r\n /**\r\n * SVG text content for the Tooltip.\r\n *\r\n * Text can have a number of formatting options supported by\r\n * [[TextFormatter]].\r\n *\r\n * @param value SVG text\r\n */\r\n set: function (value) {\r\n if (this.label.text != value) {\r\n this.label.text = value;\r\n this.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates the Tooltip.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Tooltip.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n var label = this.label;\r\n if (label.invalid) {\r\n label.validate();\r\n }\r\n var x = this._pointTo.x;\r\n var y = this._pointTo.y;\r\n var boundingRect = this._boundingRect;\r\n var textW = label.measuredWidth;\r\n var textH = label.measuredHeight;\r\n var pointerLength = this.background.pointerLength;\r\n var textX;\r\n var textY;\r\n if (this.ignoreBounds) {\r\n boundingRect = undefined;\r\n }\r\n // try to handle if text is wider than br\r\n if (boundingRect && this.fixDoc && textW > boundingRect.width) {\r\n // TODO maybe this isn't needed ?\r\n $utils.spritePointToDocument({ x: boundingRect.x, y: boundingRect.y }, this.parent);\r\n var p1 = $utils.spritePointToDocument({ x: boundingRect.x + boundingRect.width, y: boundingRect.y + boundingRect.height }, this.parent);\r\n var documentWidth = document.body.offsetWidth;\r\n // TODO maybe this isn't needed ?\r\n $utils.used(document.body.offsetHeight);\r\n if (p1.x > documentWidth / 2) {\r\n boundingRect.x = boundingRect.width - textW;\r\n }\r\n else {\r\n boundingRect.width = boundingRect.x + textW;\r\n }\r\n }\r\n var pointerOrientation = this.pointerOrientation;\r\n // horizontal\r\n if (pointerOrientation == \"horizontal\" || pointerOrientation == \"left\" || pointerOrientation == \"right\") {\r\n textY = -textH / 2;\r\n if (pointerOrientation == \"horizontal\") {\r\n if (boundingRect && x > boundingRect.x + boundingRect.width / 2) {\r\n textX = -textW / 2 - pointerLength;\r\n }\r\n else {\r\n textX = textW / 2 + pointerLength;\r\n }\r\n }\r\n else if (pointerOrientation == \"left\") {\r\n textX = textW / 2 + pointerLength;\r\n }\r\n else {\r\n textX = -textW / 2 - pointerLength;\r\n }\r\n }\r\n // vertical pointer\r\n else {\r\n if (boundingRect) {\r\n textX = $math.fitToRange(0, boundingRect.x - x + textW / 2, boundingRect.x - x + boundingRect.width - textW / 2);\r\n }\r\n if (pointerOrientation == \"vertical\") {\r\n if (boundingRect && y > boundingRect.y + textH + pointerLength) {\r\n textY = -textH - pointerLength;\r\n this._verticalOrientation = \"up\";\r\n }\r\n else {\r\n textY = pointerLength;\r\n this._verticalOrientation = \"down\";\r\n }\r\n }\r\n else if (pointerOrientation == \"down\") {\r\n textY = -textH - pointerLength;\r\n this._verticalOrientation = \"up\";\r\n }\r\n else {\r\n textY = pointerLength;\r\n this._verticalOrientation = \"down\";\r\n }\r\n }\r\n if (boundingRect) {\r\n textY = $math.fitToRange(textY, boundingRect.y - y, boundingRect.y + boundingRect.height - textH - y);\r\n }\r\n label.x = textX;\r\n label.y = textY;\r\n this.drawBackground();\r\n };\r\n /**\r\n * Overrides functionality from the superclass.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Tooltip.prototype.updateBackground = function () {\r\n this.group.addToBack(this.background.group);\r\n };\r\n /**\r\n * Draws Tooltip background (chrome, background and pointer/stem).\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Tooltip.prototype.drawBackground = function () {\r\n var label = this.label;\r\n var background = this.background;\r\n var textWidth = label.measuredWidth;\r\n var textHeight = label.measuredHeight;\r\n var boundingRect = this._boundingRect;\r\n var bgWidth = textWidth;\r\n var bgX = label.pixelX - textWidth / 2;\r\n var bgHeight = textHeight;\r\n var bgY = label.pixelY;\r\n var x = this._pointTo.x;\r\n var y = this._pointTo.y;\r\n var boundX1 = boundingRect.x - x;\r\n var boundX2 = boundX1 + boundingRect.width;\r\n var boundY1 = boundingRect.y - y;\r\n var boundY2 = boundY1 + boundingRect.height;\r\n background.x = bgX;\r\n background.y = bgY;\r\n background.width = bgWidth;\r\n background.height = bgHeight;\r\n if (this.fitPointerToBounds) {\r\n background.pointerX = $math.fitToRange(-background.x, boundX1 - background.x, boundX2 - background.x);\r\n background.pointerY = $math.fitToRange(-background.y, boundY1 - background.y, boundY2 - background.y);\r\n }\r\n else {\r\n background.pointerX = -background.x;\r\n background.pointerY = -background.y;\r\n }\r\n background.validate();\r\n };\r\n /**\r\n *\r\n */\r\n Tooltip.prototype.delayedPointTo = function (point, instantly) {\r\n var _this = this;\r\n if (this._pointToDisposer) {\r\n this._pointToDisposer.dispose();\r\n }\r\n this._pointToDisposer = registry.events.once(\"exitframe\", function () {\r\n _this.pointTo(point, instantly);\r\n });\r\n this.addDisposer(this._pointToDisposer);\r\n };\r\n /**\r\n * Set nes tooltip's anchor point and moves whole tooltip.\r\n *\r\n * @param x X coordinate\r\n * @param y Y coordinate\r\n */\r\n Tooltip.prototype.pointTo = function (point, instantly) {\r\n if (this._pointTo.x != point.x || this._pointTo.y != point.y) {\r\n this._pointTo = point;\r\n this.invalidate();\r\n // this helps to avoid strange animation from nowhere on initial show or when balloon was hidden already\r\n if (!this.visible || instantly) {\r\n this.moveTo(this._pointTo);\r\n if (this._animation) {\r\n this._animation.kill();\r\n }\r\n }\r\n else {\r\n // helps to avoid flicker on top/left corner\r\n if (this.pixelX == 0 && this.pixelY == 0) {\r\n this.moveTo(this._pointTo);\r\n }\r\n else {\r\n if (this._animation) {\r\n this._animation.kill();\r\n }\r\n this._animation = new Animation(this, [{ property: \"x\", to: point.x, from: this.pixelX }, { property: \"y\", to: point.y, from: this.pixelY }], this.animationDuration, this.animationEasing).start();\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Sets numeric boundaries Tooltip needs to obey (so it does not go outside\r\n * specific area).\r\n *\r\n * @ignore Exclude from docs\r\n * @param rectangle Boundary rectangle\r\n */\r\n Tooltip.prototype.setBounds = function (rectangle) {\r\n var oldRect = this._boundingRect;\r\n if (oldRect.x != rectangle.x || oldRect.y != rectangle.y || oldRect.width != rectangle.width || oldRect.height != rectangle.height) {\r\n this._boundingRect = rectangle;\r\n this.invalidate();\r\n }\r\n };\r\n Object.defineProperty(Tooltip.prototype, \"boundingContainer\", {\r\n /**\r\n * Sets a [[Container]] instance to be used when calculating numeric\r\n * boundaries for the Tooltip.\r\n *\r\n * @ignore Exclude from docs\r\n * @param container Boundary container\r\n */\r\n set: function (container) {\r\n this._boundingContainer = container;\r\n // TODO remove closures ?\r\n container.events.on(\"sizechanged\", this.updateBounds, this);\r\n container.events.on(\"positionchanged\", this.updateBounds, this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Updates numeric boundaries for the Tooltip, based on the\r\n * `boundingCountrainer`.\r\n */\r\n Tooltip.prototype.updateBounds = function () {\r\n var boundingContainer = this._boundingContainer;\r\n // to global\r\n var rect = $utils.spriteRectToSvg({\r\n x: boundingContainer.pixelX,\r\n y: boundingContainer.pixelY,\r\n width: boundingContainer.maxWidth,\r\n height: boundingContainer.maxHeight\r\n }, boundingContainer);\r\n this.setBounds(rect);\r\n };\r\n Object.defineProperty(Tooltip.prototype, \"ignoreBounds\", {\r\n /**\r\n * @return Ignore chart bounds?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"ignoreBounds\");\r\n },\r\n /**\r\n * Normally, a tooltip's position will be adjusted so it always fits into\r\n * chart's coundaries.\r\n *\r\n * Setting this to `false` will disable such checks and will allow tooltip\r\n * to \"bleed over\" the edge of the chart.\r\n *\r\n * @default false\r\n * @since 4.10.8\r\n * @param value Ignore chart bounds?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"ignoreBounds\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Tooltip.prototype, \"verticalOrientation\", {\r\n /**\r\n * If tooltipOrientation is vertical, it can be drawn below or above point.\r\n * We need to know this when solving overlapping.\r\n *\r\n * @ignore Exclude from docs\r\n * @return \"up\" | \"down\"\r\n */\r\n get: function () {\r\n return this._verticalOrientation;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Tooltip.prototype, \"tooltip\", {\r\n /**\r\n * To avoid stackoverflow\r\n * @ignore\r\n */\r\n get: function () {\r\n return undefined;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies properties and other attributes.\r\n *\r\n * @param source Source\r\n */\r\n Tooltip.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.label.copyFrom(source.label);\r\n if (source._boundingRect) {\r\n this._boundingRect = source._boundingRect;\r\n }\r\n };\r\n /**\r\n * Adds easing functions to \"function\" fields.\r\n *\r\n * @param field Field name\r\n * @return Assign as function?\r\n */\r\n Tooltip.prototype.asFunction = function (field) {\r\n return field == \"animationEasing\" || _super.prototype.asIs.call(this, field);\r\n };\r\n return Tooltip;\r\n}(Container));\r\nexport { Tooltip };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Tooltip\"] = Tooltip;\r\n//# sourceMappingURL=Tooltip.js.map","/**\r\n * Functionality for drawing a trapezoid.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../Sprite\";\r\nimport { percent } from \"../../core/utils/Percent\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $path from \"../rendering/Path\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Used to draw a Trapezoid.\r\n *\r\n * @see {@link ITrapezoidEvents} for a list of available events\r\n * @see {@link ITrapezoidAdapters} for a list of available Adapters\r\n */\r\nvar Trapezoid = /** @class */ (function (_super) {\r\n __extends(Trapezoid, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Trapezoid() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Trapezoid\";\r\n _this.element = _this.paper.add(\"path\");\r\n _this.topSide = percent(100);\r\n _this.bottomSide = percent(100);\r\n _this.leftSide = percent(100);\r\n _this.rightSide = percent(100);\r\n _this.isMeasured = false; // todo: add measureElement\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Trapezoid.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n var w = this.pixelWidth;\r\n var h = this.pixelHeight;\r\n var ts = $utils.relativeToValue(this.topSide, w);\r\n var bs = $utils.relativeToValue(this.bottomSide, w);\r\n var ls = $utils.relativeToValue(this.leftSide, h);\r\n var rs = $utils.relativeToValue(this.rightSide, h);\r\n // 1----2\r\n // | |\r\n // 4----3\r\n var x0 = (w - ts) / 2;\r\n var y0 = (h - ls) / 2;\r\n var x1 = w - (w - ts) / 2;\r\n var y1 = (h - rs) / 2;\r\n var x2 = w - (w - bs) / 2;\r\n var y2 = h - (h - rs) / 2;\r\n var x3 = (w - bs) / 2;\r\n var y3 = h - (h - ls) / 2;\r\n var mt = \"\";\r\n var mr = \"\";\r\n var mb = \"\";\r\n var ml = \"\";\r\n if ($type.hasValue(this.horizontalNeck)) {\r\n var hn = this.horizontalNeck.value;\r\n mt = $path.lineTo({ x: w * hn, y: Math.max(y0, y1) });\r\n mb = $path.lineTo({ x: w * hn, y: Math.min(y2, y3) });\r\n }\r\n if ($type.hasValue(this.verticalNeck)) {\r\n var vn = this.verticalNeck.value;\r\n mr = $path.lineTo({ x: Math.min(x1, x2), y: h * vn });\r\n ml = $path.lineTo({ x: Math.max(x0, x3), y: h * vn });\r\n }\r\n var path = $path.moveTo({ x: x0, y: y0 })\r\n + mt\r\n + $path.lineTo({ x: x1, y: y1 })\r\n + mr\r\n + $path.lineTo({ x: x2, y: y2 })\r\n + mb\r\n + $path.lineTo({ x: x3, y: y3 })\r\n + ml;\r\n this.path = path;\r\n };\r\n Object.defineProperty(Trapezoid.prototype, \"topSide\", {\r\n /**\r\n * @return Width\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"topSide\");\r\n },\r\n /**\r\n * Wdith of the top side. Absolute (px) or relative ([[Percent]]).\r\n *\r\n * @default Percent(100)\r\n * @param value Width\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"topSide\", value, true, false, 10, false);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Trapezoid.prototype, \"bottomSide\", {\r\n /**\r\n * @return Width\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"bottomSide\");\r\n },\r\n /**\r\n * Wdith of the bottom side. Absolute (px) or relative ([[Percent]]).\r\n *\r\n * @default Percent(100)\r\n * @param value Width\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"bottomSide\", value, true, false, 10, false);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Trapezoid.prototype, \"leftSide\", {\r\n /**\r\n * @return Height\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"leftSide\");\r\n },\r\n /**\r\n * Height of the left side. Absolute (px) or relative ([[Percent]]).\r\n *\r\n * @default Percent(100)\r\n * @param value Height\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"leftSide\", value, true, false, 10, false);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Trapezoid.prototype, \"rightSide\", {\r\n /**\r\n * @return Height\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"rightSide\");\r\n },\r\n /**\r\n * Height of the right side. Absolute (px) or relative ([[Percent]]).\r\n *\r\n * @default Percent(100)\r\n * @param value Height\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"rightSide\", value, true, false, 10, false);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Trapezoid.prototype, \"horizontalNeck\", {\r\n /**\r\n * @return Horizontal neck position\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"horizontalNeck\");\r\n },\r\n /**\r\n * A relative vertical position of the \"neck\". If the top and bottom sides\r\n * are of different width, and `horizontalNeck` is set, a choke point\r\n * will be created at that position, creating a funnel shape.\r\n *\r\n * @param value Horizontal neck position\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"horizontalNeck\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Trapezoid.prototype, \"verticalNeck\", {\r\n /**\r\n * @return Vertical neck position\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"verticalNeck\");\r\n },\r\n /**\r\n * A relative horizontal position of the \"neck\". If the left and right sides\r\n * are of different height, and `verticalNeck` is set, a choke point\r\n * will be created at that position, creating a funnel shape.\r\n *\r\n * @param value Vertical neck position\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"verticalNeck\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Trapezoid;\r\n}(Sprite));\r\nexport { Trapezoid };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Trapezoid\"] = Trapezoid;\r\n//# sourceMappingURL=Trapezoid.js.map","/**\r\n * Functionality for drawing triangles.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../Sprite\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $path from \"../rendering/Path\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Used to draw a triangle.\r\n *\r\n * @see {@link ITriangleEvents} for a list of available events\r\n * @see {@link ITriangleAdapters} for a list of available Adapters\r\n */\r\nvar Triangle = /** @class */ (function (_super) {\r\n __extends(Triangle, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Triangle() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Triangle\";\r\n _this.element = _this.paper.add(\"path\");\r\n _this.direction = \"top\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Triangle.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n var w = this.pixelWidth;\r\n var h = this.pixelHeight;\r\n var path;\r\n switch (this.direction) {\r\n case \"right\":\r\n path = $path.moveTo({ x: 0, y: 0 })\r\n + $path.lineTo({ x: w, y: h / 2 })\r\n + $path.lineTo({ x: 0, y: h })\r\n + $path.closePath();\r\n break;\r\n case \"left\":\r\n path = $path.moveTo({ x: w, y: 0 })\r\n + $path.lineTo({ x: 0, y: h / 2 })\r\n + $path.lineTo({ x: w, y: h })\r\n + $path.closePath();\r\n break;\r\n case \"bottom\":\r\n path = $path.moveTo({ x: 0, y: 0 })\r\n + $path.lineTo({ x: w, y: 0 })\r\n + $path.lineTo({ x: w / 2, y: h })\r\n + $path.closePath();\r\n break;\r\n case \"top\":\r\n path = $path.moveTo({ x: w / 2, y: 0 })\r\n + $path.lineTo({ x: w, y: h })\r\n + $path.lineTo({ x: 0, y: h })\r\n + $path.closePath();\r\n break;\r\n }\r\n this.path = path;\r\n };\r\n Object.defineProperty(Triangle.prototype, \"direction\", {\r\n /**\r\n * Returns direction of a triangle\r\n *\r\n * @return value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"direction\");\r\n },\r\n /**\r\n * Sets direction of a triangle\r\n *\r\n * @param value\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"direction\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Triangle;\r\n}(Sprite));\r\nexport { Triangle };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Triangle\"] = Triangle;\r\n//# sourceMappingURL=Triangle.js.map","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { registry } from \"../Registry\";\r\nimport * as $path from \"./Path\";\r\nimport * as $array from \"../utils/Array\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $math from \"../utils/Math\";\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nvar Tension = /** @class */ (function () {\r\n /**\r\n * Constructor.\r\n *\r\n * @param tensionX [description]\r\n * @param tensionY [description]\r\n */\r\n function Tension(tensionX, tensionY) {\r\n this._tensionX = tensionX;\r\n this._tensionY = tensionY;\r\n }\r\n /**\r\n * [smooth description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param points [description]\r\n * @return [description]\r\n */\r\n Tension.prototype.smooth = function (points) {\r\n for (var i = points.length - 1; i > 0; i--) {\r\n var p0 = points[i];\r\n var p1 = points[i - 1];\r\n if (Math.abs(p0.x - p1.x) < 0.1 && Math.abs(p0.y - p1.y) < 0.1) {\r\n points.splice(i - 1, 1);\r\n }\r\n }\r\n var tensionX = this._tensionX;\r\n var tensionY = this._tensionY;\r\n if (points.length < 3 || (tensionX >= 1 && tensionY >= 1)) {\r\n return $path.polyline(points);\r\n }\r\n var first = points[0];\r\n var last = points[points.length - 1];\r\n var closed = false;\r\n if ($math.round(first.x, 3) == $math.round(last.x) && $math.round(first.y) == $math.round(last.y)) {\r\n closed = true;\r\n }\r\n // Can't moveTo here, as it wont be possible to have fill then.\r\n var path = \"\";\r\n for (var i = 0, len = points.length - 1; i < len; i++) {\r\n var p0 = points[i - 1];\r\n var p1 = points[i];\r\n var p2 = points[i + 1];\r\n var p3 = points[i + 2];\r\n if (i === 0) {\r\n if (closed) {\r\n p0 = points[points.length - 2];\r\n }\r\n else {\r\n p0 = points[i];\r\n }\r\n }\r\n else if (i == points.length - 2) {\r\n if (closed) {\r\n p3 = points[1];\r\n }\r\n else {\r\n p3 = points[i + 1];\r\n }\r\n }\r\n var controlPointA = $math.getCubicControlPointA(p0, p1, p2, p3, tensionX, tensionY);\r\n var controlPointB = $math.getCubicControlPointB(p0, p1, p2, p3, tensionX, tensionY);\r\n path += $path.cubicCurveTo(p2, controlPointA, controlPointB);\r\n }\r\n return path;\r\n };\r\n return Tension;\r\n}());\r\nexport { Tension };\r\n/**\r\n * Returns a waved line SVG path between two points.\r\n *\r\n * @ignore Exclude from docs\r\n * @param point1 Starting point\r\n * @param point2 Ending point\r\n * @param waveLength Wave length\r\n * @param waveHeight Wave height\r\n * @param adjustWaveLength Adjust wave length based on the actual line length\r\n * @return SVG path\r\n */\r\nexport function wavedLine(point1, point2, waveLength, waveHeight, tension, adjustWaveLength) {\r\n var x1 = point1.x;\r\n var y1 = point1.y;\r\n var x2 = point2.x;\r\n var y2 = point2.y;\r\n var distance = $math.getDistance(point1, point2);\r\n if (adjustWaveLength) {\r\n waveLength = distance / Math.round(distance / waveLength);\r\n }\r\n var d = registry.getCache($utils.stringify([\"wavedLine\", point1.x, point2.x, point1.y, point2.y, waveLength, waveHeight]));\r\n if (!d) {\r\n if (distance > 0) {\r\n var angle = Math.atan2(y2 - y1, x2 - x1);\r\n var cos = Math.cos(angle);\r\n var sin = Math.sin(angle);\r\n var waveLengthX = waveLength * cos;\r\n var waveLengthY = waveLength * sin;\r\n if (waveLength <= 1 || waveHeight <= 1) {\r\n d = $path.lineTo(point2);\r\n }\r\n else {\r\n var halfWaveCount = Math.round(2 * distance / waveLength);\r\n var points = [];\r\n var sign_1 = 1;\r\n if (x2 < x1) {\r\n sign_1 *= -1;\r\n }\r\n if (y2 < y1) {\r\n sign_1 *= -1;\r\n }\r\n for (var i = 0; i <= halfWaveCount; i++) {\r\n sign_1 *= -1;\r\n var x = x1 + i * waveLengthX / 2 + sign_1 * waveHeight / 2 * sin;\r\n var y = y1 + i * waveLengthY / 2 - sign_1 * waveHeight / 2 * cos;\r\n points.push({ x: x, y: y });\r\n }\r\n d = new Tension(tension, tension).smooth(points);\r\n }\r\n }\r\n else {\r\n d = \"\";\r\n }\r\n registry.setCache($utils.stringify([\"wavedLine\", point1.x, point2.x, point1.y, point2.y, waveLength, waveHeight]), d);\r\n }\r\n return d;\r\n}\r\nvar Monotone = /** @class */ (function () {\r\n function Monotone(reversed, info) {\r\n this._reversed = reversed;\r\n this._closed = info.closed;\r\n }\r\n // According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\r\n // \"you can express cubic Hermite interpolation in terms of cubic Bézier curves\r\n // with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\r\n Monotone.prototype._curve = function (x0, x1, y0, y1, t0, t1) {\r\n var dx = (x1 - x0) / 3;\r\n if (this._reversed) {\r\n return $path.cubicCurveTo({ x: y1, y: x1 }, { x: y0 + dx * t0, y: x0 + dx }, { x: y1 - dx * t1, y: x1 - dx });\r\n }\r\n else {\r\n return $path.cubicCurveTo({ x: x1, y: y1 }, { x: x0 + dx, y: y0 + dx * t0 }, { x: x1 - dx, y: y1 - dx * t1 });\r\n }\r\n };\r\n Monotone.prototype.smooth = function (points) {\r\n var _this = this;\r\n var x0 = NaN;\r\n var x1 = NaN;\r\n var y0 = NaN;\r\n var y1 = NaN;\r\n var t0 = NaN;\r\n var point = 0;\r\n var output = \"\";\r\n $array.each(points, function (_a) {\r\n var x = _a.x, y = _a.y;\r\n if (_this._reversed) {\r\n var temp = x;\r\n x = y;\r\n y = temp;\r\n }\r\n var t1 = NaN;\r\n if (!(x === x1 && y === y1)) {\r\n switch (point) {\r\n case 0:\r\n point = 1;\r\n if (_this._reversed) {\r\n output += $path.lineTo({ x: y, y: x });\r\n }\r\n else {\r\n output += $path.lineTo({ x: x, y: y });\r\n }\r\n break;\r\n case 1:\r\n point = 2;\r\n break;\r\n case 2:\r\n point = 3;\r\n output += _this._curve(x0, x1, y0, y1, slope2(x0, x1, y0, y1, t1 = slope3(x0, x1, y0, y1, x, y)), t1);\r\n break;\r\n default:\r\n output += _this._curve(x0, x1, y0, y1, t0, t1 = slope3(x0, x1, y0, y1, x, y));\r\n break;\r\n }\r\n x0 = x1;\r\n x1 = x;\r\n y0 = y1;\r\n y1 = y;\r\n t0 = t1;\r\n }\r\n });\r\n switch (point) {\r\n case 2:\r\n if (this._reversed) {\r\n output += $path.lineTo({ x: y1, y: x1 });\r\n }\r\n else {\r\n output += $path.lineTo({ x: x1, y: y1 });\r\n }\r\n break;\r\n case 3:\r\n output += this._curve(x0, x1, y0, y1, t0, slope2(x0, x1, y0, y1, t0));\r\n break;\r\n }\r\n if (this._closed) {\r\n output += $path.closePath();\r\n }\r\n return output;\r\n };\r\n return Monotone;\r\n}());\r\nexport { Monotone };\r\n// TODO move this someplace else\r\nfunction sign(x) {\r\n return x < 0 ? -1 : 1;\r\n}\r\nfunction slope2(x0, x1, y0, y1, t) {\r\n var h = x1 - x0;\r\n return h ? (3 * (y1 - y0) / h - t) / 2 : t;\r\n}\r\nfunction slope3(x0, x1, y0, y1, x2, y2) {\r\n var h0 = x1 - x0;\r\n var h1 = x2 - x1;\r\n var s0 = (y1 - y0) / (h0 || h1 < 0 && -0);\r\n var s1 = (y2 - y1) / (h1 || h0 < 0 && -0);\r\n var p = (s0 * h1 + s1 * h0) / (h0 + h1);\r\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\r\n}\r\nvar MonotoneX = /** @class */ (function (_super) {\r\n __extends(MonotoneX, _super);\r\n function MonotoneX(info) {\r\n return _super.call(this, false, info) || this;\r\n }\r\n return MonotoneX;\r\n}(Monotone));\r\nexport { MonotoneX };\r\nvar MonotoneY = /** @class */ (function (_super) {\r\n __extends(MonotoneY, _super);\r\n function MonotoneY(info) {\r\n return _super.call(this, true, info) || this;\r\n }\r\n return MonotoneY;\r\n}(Monotone));\r\nexport { MonotoneY };\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nvar Basis = /** @class */ (function () {\r\n /**\r\n * Constructor.\r\n *\r\n * @param info [description]\r\n */\r\n function Basis(info) {\r\n this._closed = info.closed;\r\n }\r\n /**\r\n * [smooth description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param points [description]\r\n * @return [description]\r\n */\r\n Basis.prototype.smooth = function (points) {\r\n var _this = this;\r\n var x0 = NaN;\r\n var x1 = NaN;\r\n var x2 = NaN;\r\n var x3 = NaN;\r\n var x4 = NaN;\r\n var y0 = NaN;\r\n var y1 = NaN;\r\n var y2 = NaN;\r\n var y3 = NaN;\r\n var y4 = NaN;\r\n var point = 0;\r\n var output = \"\";\r\n var pushCurve = function (x, y) {\r\n output += $path.cubicCurveTo({\r\n x: (x0 + 4 * x1 + x) / 6,\r\n y: (y0 + 4 * y1 + y) / 6\r\n }, {\r\n x: (2 * x0 + x1) / 3,\r\n y: (2 * y0 + y1) / 3\r\n }, {\r\n x: (x0 + 2 * x1) / 3,\r\n y: (y0 + 2 * y1) / 3\r\n });\r\n };\r\n var pushPoint = function (_a) {\r\n var x = _a.x, y = _a.y;\r\n switch (point) {\r\n case 0:\r\n point = 1;\r\n if (_this._closed) {\r\n x2 = x;\r\n y2 = y;\r\n }\r\n else {\r\n output += $path.lineTo({ x: x, y: y });\r\n }\r\n break;\r\n case 1:\r\n point = 2;\r\n if (_this._closed) {\r\n x3 = x;\r\n y3 = y;\r\n }\r\n break;\r\n case 2:\r\n point = 3;\r\n if (_this._closed) {\r\n x4 = x;\r\n y4 = y;\r\n output += $path.moveTo({ x: (x0 + 4 * x1 + x) / 6, y: (y0 + 4 * y1 + y) / 6 });\r\n break;\r\n }\r\n else {\r\n output += $path.lineTo({ x: (5 * x0 + x1) / 6, y: (5 * y0 + y1) / 6 });\r\n // fall-through\r\n }\r\n default:\r\n pushCurve(x, y);\r\n break;\r\n }\r\n x0 = x1;\r\n x1 = x;\r\n y0 = y1;\r\n y1 = y;\r\n };\r\n $array.each(points, pushPoint);\r\n if (this._closed) {\r\n switch (point) {\r\n case 1:\r\n output += $path.moveTo({ x: x2, y: y2 });\r\n output += $path.closePath();\r\n break;\r\n case 2:\r\n output += $path.moveTo({ x: (x2 + 2 * x3) / 3, y: (y2 + 2 * y3) / 3 });\r\n output += $path.lineTo({ x: (x3 + 2 * x2) / 3, y: (y3 + 2 * y2) / 3 });\r\n output += $path.closePath();\r\n break;\r\n case 3:\r\n pushPoint({ x: x2, y: y2 });\r\n pushPoint({ x: x3, y: y3 });\r\n pushPoint({ x: x4, y: y4 });\r\n break;\r\n }\r\n }\r\n else {\r\n switch (point) {\r\n case 3:\r\n pushCurve(x1, y1);\r\n // fall-through\r\n case 2:\r\n output += $path.lineTo({ x: x1, y: y1 });\r\n break;\r\n }\r\n output += $path.closePath();\r\n }\r\n return output;\r\n };\r\n return Basis;\r\n}());\r\nexport { Basis };\r\n//# sourceMappingURL=Smoothing.js.map","/**\r\n * Functionality for drawing waved circles.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Circle } from \"./Circle\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $path from \"../rendering/Path\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $smoothing from \"../../core/rendering/Smoothing\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws a waved circle.\r\n *\r\n * @see {@link IWavedCircleEvents} for a list of available events\r\n * @see {@link IWavedCircleAdapters} for a list of available Adapters\r\n */\r\nvar WavedCircle = /** @class */ (function (_super) {\r\n __extends(WavedCircle, _super);\r\n /**\r\n * Constructor\r\n */\r\n function WavedCircle() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"WavedCircle\";\r\n _this.element = _this.paper.add(\"path\");\r\n _this.waveLength = 16;\r\n _this.waveHeight = 4;\r\n _this.fill = undefined;\r\n _this.fillOpacity = 0;\r\n _this.tension = 0.8;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the waved line.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n WavedCircle.prototype.draw = function () {\r\n var path = \"\";\r\n var radius = this.pixelRadius;\r\n if (radius > 0) {\r\n var points = this.getPoints(radius);\r\n path = $path.moveTo(points[0]) + new $smoothing.Tension(this.tension, this.tension).smooth(points);\r\n }\r\n var innerRadius = this.pixelInnerRadius;\r\n if (innerRadius > 0) {\r\n var points = this.getPoints(innerRadius);\r\n points.reverse();\r\n path += $path.moveTo(points[0]) + new $smoothing.Tension(this.tension, this.tension).smooth(points);\r\n }\r\n this.path = path;\r\n };\r\n /**\r\n * Returns points that circle consists of.\r\n *\r\n * @param radius Radius (px)\r\n * @return Points\r\n */\r\n WavedCircle.prototype.getPoints = function (radius) {\r\n var circleLength = radius * Math.PI * 2;\r\n var halfWaveHeight = this.waveHeight / 2;\r\n var waveLength = circleLength / Math.round(circleLength / this.waveLength);\r\n var halfWaveLength = waveLength / 2;\r\n var points = [];\r\n var count = circleLength / waveLength;\r\n for (var i = 0; i <= count; i++) {\r\n var angle1 = (i * waveLength) / circleLength * 360;\r\n var angle2 = (i * waveLength + halfWaveLength) / circleLength * 360;\r\n points.push({ x: (radius - halfWaveHeight) * $math.cos(angle1), y: (radius - halfWaveHeight) * $math.sin(angle1) });\r\n points.push({ x: (radius + halfWaveHeight) * $math.cos(angle2), y: (radius + halfWaveHeight) * $math.sin(angle2) });\r\n }\r\n points.pop();\r\n return points;\r\n };\r\n Object.defineProperty(WavedCircle.prototype, \"innerRadius\", {\r\n /**\r\n * @return Inner radius\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"innerRadius\");\r\n },\r\n /**\r\n * Inner radius of the circle in pixels (absolute) or [[Percent]] (relative).\r\n *\r\n * @param value Inner radius\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"innerRadius\", value, true, false, 10, false);\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(WavedCircle.prototype, \"pixelInnerRadius\", {\r\n /**\r\n * Calculated inner radius of the circle in pixels.\r\n *\r\n * @readonly\r\n * @return Inner radius (px)\r\n */\r\n get: function () {\r\n return $utils.relativeToValue(this.innerRadius, $math.min(this.innerWidth / 2, this.innerHeight / 2));\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(WavedCircle.prototype, \"waveLength\", {\r\n /**\r\n * @return Wave length (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"waveLength\");\r\n },\r\n /**\r\n * Wave length in pixels.\r\n *\r\n * @default 16\r\n * @param value Wave length (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"waveLength\", value);\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(WavedCircle.prototype, \"waveHeight\", {\r\n /**\r\n * @return Wave height (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"waveHeight\");\r\n },\r\n /**\r\n * Wave height in pixels.\r\n *\r\n * @default 4\r\n * @param value Wave height (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"waveHeight\", value);\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(WavedCircle.prototype, \"tension\", {\r\n /**\r\n * @return Tension\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"tension\");\r\n },\r\n /**\r\n * Tension of the wave.\r\n *\r\n * @default 0.8\r\n * @param value Tension\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"tension\", value);\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return WavedCircle;\r\n}(Circle));\r\nexport { WavedCircle };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"WavedCircle\"] = WavedCircle;\r\n//# sourceMappingURL=WavedCircle.js.map","/**\r\n * Functionality for drawing waved lines.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Line } from \"./Line\";\r\nimport { color } from \"../utils/Color\";\r\nimport { wavedLine } from \"../rendering/Smoothing\";\r\nimport * as $path from \"../rendering/Path\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws a waved line.\r\n *\r\n * @see {@link IWavedLineEvents} for a list of available events\r\n * @see {@link IWavedLineAdapters} for a list of available Adapters\r\n */\r\nvar WavedLine = /** @class */ (function (_super) {\r\n __extends(WavedLine, _super);\r\n /**\r\n * Constructor\r\n */\r\n function WavedLine() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"WavedLine\";\r\n _this.element = _this.paper.add(\"path\");\r\n _this.waveLength = 16;\r\n _this.waveHeight = 4;\r\n _this.tension = 0.8;\r\n _this.pixelPerfect = false;\r\n _this.fill = color();\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the waved line.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n WavedLine.prototype.draw = function () {\r\n //super.draw();\r\n var p1 = { x: this.x1, y: this.y1 };\r\n var p2 = { x: this.x2, y: this.y2 };\r\n this.path = $path.moveTo(p1) + wavedLine(p1, p2, this.waveLength, this.waveHeight, this.tension, true);\r\n };\r\n Object.defineProperty(WavedLine.prototype, \"waveLength\", {\r\n /**\r\n * @return Wave length (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"waveLength\");\r\n },\r\n /**\r\n * Wave length in pixels.\r\n *\r\n * @default 16\r\n * @param value Wave length (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"waveLength\", value);\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(WavedLine.prototype, \"waveHeight\", {\r\n /**\r\n * @return Wave height (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"waveHeight\");\r\n },\r\n /**\r\n * Wave height in pixels.\r\n *\r\n * @default 4\r\n * @param value Wave height (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"waveHeight\", value);\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(WavedLine.prototype, \"tension\", {\r\n /**\r\n * @return Tension\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"tension\");\r\n },\r\n /**\r\n * Tension of the wave.\r\n *\r\n * @default 0.8\r\n * @param value Tension\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"tension\", value);\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return WavedLine;\r\n}(Line));\r\nexport { WavedLine };\r\n//# sourceMappingURL=WavedLine.js.map","/**\r\n * Functionality for drawing rectangles with waved edges.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Rectangle } from \"./Rectangle\";\r\nimport { wavedLine } from \"../rendering/Smoothing\";\r\nimport * as $path from \"../rendering/Path\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws a rectangle with waved edges.\r\n *\r\n * @see {@link IWavedRectangleEvents} for a list of available events\r\n * @see {@link IWavedRectangleAdapters} for a list of available Adapters\r\n */\r\nvar WavedRectangle = /** @class */ (function (_super) {\r\n __extends(WavedRectangle, _super);\r\n /**\r\n * Constructor\r\n */\r\n function WavedRectangle() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"WavedRectangle\";\r\n // Add path element\r\n _this.element = _this.paper.add(\"path\");\r\n // Set defaults\r\n _this.waveLength = 16;\r\n _this.waveHeight = 4;\r\n _this.tension = 0.8;\r\n _this.setPropertyValue(\"wavedLeft\", true);\r\n _this.setPropertyValue(\"wavedRight\", true);\r\n _this.setPropertyValue(\"wavedTop\", true);\r\n _this.setPropertyValue(\"wavedBottom\", true);\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the waved rectangle.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n WavedRectangle.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n var w = this.pixelWidth;\r\n var h = this.pixelHeight;\r\n if (w > 0 && h > 0) {\r\n var p1 = { x: 0, y: 0 };\r\n var p2 = { x: w, y: 0 };\r\n var p3 = { x: w, y: h };\r\n var p4 = { x: 0, y: h };\r\n var waveLengthH = Math.min(w, this.waveLength);\r\n var waveHeightH = Math.min(h, this.waveHeight);\r\n var waveLengthV = Math.min(h, this.waveLength);\r\n var waveHeightV = Math.min(w, this.waveHeight);\r\n var td = \"\";\r\n var rd = \"\";\r\n var bd = \"\";\r\n var ld = \"\";\r\n if (this.wavedTop) {\r\n td = wavedLine(p1, p2, waveLengthH, waveHeightH, this.tension, true);\r\n }\r\n if (this.wavedRight) {\r\n rd = wavedLine(p2, p3, waveLengthV, waveHeightV, this.tension, true);\r\n }\r\n if (this.wavedBottom) {\r\n bd = wavedLine(p3, p4, waveLengthH, waveHeightH, this.tension, true);\r\n }\r\n if (this.wavedLeft) {\r\n ld = wavedLine(p4, p1, waveLengthV, waveHeightV, this.tension, true);\r\n }\r\n this.path = $path.moveTo(p1) + td + $path.lineTo(p2) + rd + $path.lineTo(p3) + bd + $path.lineTo(p4) + ld + \"z\";\r\n }\r\n };\r\n Object.defineProperty(WavedRectangle.prototype, \"waveLength\", {\r\n /**\r\n * @return Wave length (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"waveLength\");\r\n },\r\n /**\r\n * Wave length in pixels.\r\n *\r\n * @default 16\r\n * @param value Wave length (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"waveLength\", value);\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(WavedRectangle.prototype, \"waveHeight\", {\r\n /**\r\n * @return Wave height (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"waveHeight\");\r\n },\r\n /**\r\n * Wave height in pixels.\r\n *\r\n * @default 4\r\n * @param value Wave height (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"waveHeight\", value);\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets which side should be waved or not. If particular side is set to\r\n * `false`, a straight line will be drawn on that side.\r\n *\r\n * @param top Top waved?\r\n * @param right Right side waved?\r\n * @param bottom Bottom Waved?\r\n * @param left Left side waved?\r\n */\r\n WavedRectangle.prototype.setWavedSides = function (top, right, bottom, left) {\r\n this.wavedTop = top;\r\n this.wavedRight = right;\r\n this.wavedBottom = bottom;\r\n this.wavedLeft = left;\r\n };\r\n Object.defineProperty(WavedRectangle.prototype, \"tension\", {\r\n /**\r\n * @return Tension\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"tension\");\r\n },\r\n /**\r\n * Tension of the wave.\r\n *\r\n * @default 0.8\r\n * @param value Tension\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"tension\", value);\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(WavedRectangle.prototype, \"wavedRight\", {\r\n /**\r\n * @return Wave right side?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"wavedRight\");\r\n },\r\n /**\r\n * Specifies if right side should be waved.\r\n *\r\n * @default true\r\n * @param value Waved?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"wavedRight\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(WavedRectangle.prototype, \"wavedLeft\", {\r\n /**\r\n * @return Wave left side?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"wavedLeft\");\r\n },\r\n /**\r\n * Specifies if left side should be waved.\r\n *\r\n * @default true\r\n * @param value Waved?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"wavedLeft\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(WavedRectangle.prototype, \"wavedTop\", {\r\n /**\r\n * @return Wave top side?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"wavedTop\");\r\n },\r\n /**\r\n * Specifies if top side should be waved.\r\n *\r\n * @default true\r\n * @param value Waved?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"wavedTop\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(WavedRectangle.prototype, \"wavedBottom\", {\r\n /**\r\n * @return Wave bottom side?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"wavedBottom\");\r\n },\r\n /**\r\n * Specifies if bottom side should be waved.\r\n *\r\n * @default true\r\n * @param value Waved?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"wavedBottom\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return WavedRectangle;\r\n}(Rectangle));\r\nexport { WavedRectangle };\r\n//# sourceMappingURL=WavedRectangle.js.map","/**\r\n * Zoom out button functionality.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Button } from \"./Button\";\r\nimport { Sprite } from \"../Sprite\";\r\nimport { registry } from \"../Registry\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport * as $path from \"../rendering/Path\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a zoom out button.\r\n *\r\n * @see {@link IZoomOutButtonEvents} for a list of available events\r\n * @see {@link IZoomOutButtonAdapters} for a list of available Adapters\r\n */\r\nvar ZoomOutButton = /** @class */ (function (_super) {\r\n __extends(ZoomOutButton, _super);\r\n /**\r\n * Constructor\r\n */\r\n function ZoomOutButton() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"ZoomOutButton\";\r\n _this.padding(9, 9, 9, 9);\r\n //this.dx = - 5;\r\n //this.dy = 5;\r\n _this.showSystemTooltip = true;\r\n var interfaceColors = new InterfaceColorSet();\r\n var background = _this.background;\r\n background.cornerRadius(20, 20, 20, 20);\r\n background.fill = interfaceColors.getFor(\"primaryButton\");\r\n background.stroke = interfaceColors.getFor(\"primaryButtonStroke\");\r\n background.strokeOpacity = 0;\r\n background.states.getKey(\"hover\").properties.fill = interfaceColors.getFor(\"primaryButtonHover\");\r\n background.states.getKey(\"down\").properties.fill = interfaceColors.getFor(\"primaryButtonActive\");\r\n // Create an icon\r\n var icon = new Sprite();\r\n icon.element = _this.paper.add(\"path\");\r\n var path = $path.moveTo({ x: 0, y: 0 });\r\n path += $path.lineTo({ x: 11, y: 0 });\r\n icon.path = path;\r\n icon.pixelPerfect = true;\r\n icon.padding(8, 3, 8, 3);\r\n icon.stroke = interfaceColors.getFor(\"primaryButtonText\");\r\n _this.icon = icon;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Sets defaults that instantiate some objects that rely on parent, so they\r\n * cannot be set in constructor.\r\n */\r\n ZoomOutButton.prototype.applyInternalDefaults = function () {\r\n _super.prototype.applyInternalDefaults.call(this);\r\n if (!$type.hasValue(this.readerTitle)) {\r\n this.readerTitle = this.language.translate(\"Zoom Out\");\r\n }\r\n };\r\n return ZoomOutButton;\r\n}(Button));\r\nexport { ZoomOutButton };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ZoomOutButton\"] = ZoomOutButton;\r\n//# sourceMappingURL=ZoomOutButton.js.map","/**\r\n * Play button functionality.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Button } from \"./Button\";\r\nimport { RoundedRectangle } from \"./RoundedRectangle\";\r\nimport { registry } from \"../Registry\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { Triangle } from \"./Triangle\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a zoom out button.\r\n *\r\n * @see {@link IPlayButtonEvents} for a list of available events\r\n * @see {@link IPlayButtonAdapters} for a list of available Adapters\r\n */\r\nvar PlayButton = /** @class */ (function (_super) {\r\n __extends(PlayButton, _super);\r\n /**\r\n * Constructor\r\n */\r\n function PlayButton() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"PlayButton\";\r\n _this.padding(12, 12, 12, 12);\r\n _this.showSystemTooltip = true;\r\n var interfaceColors = new InterfaceColorSet();\r\n var background = _this.background;\r\n background.cornerRadius(25, 25, 25, 25);\r\n background.fill = interfaceColors.getFor(\"primaryButton\");\r\n background.stroke = interfaceColors.getFor(\"primaryButtonStroke\");\r\n background.strokeOpacity = 0;\r\n background.states.getKey(\"hover\").properties.fill = interfaceColors.getFor(\"primaryButtonHover\");\r\n background.states.getKey(\"down\").properties.fill = interfaceColors.getFor(\"primaryButtonActive\");\r\n // Create a play icon\r\n var playIcon = new Triangle();\r\n playIcon.direction = \"right\";\r\n playIcon.width = 9;\r\n playIcon.height = 11;\r\n playIcon.marginLeft = 1;\r\n playIcon.marginRight = 1;\r\n playIcon.horizontalCenter = \"middle\";\r\n playIcon.verticalCenter = \"middle\";\r\n playIcon.stroke = interfaceColors.getFor(\"primaryButtonText\");\r\n playIcon.fill = playIcon.stroke;\r\n _this.icon = playIcon;\r\n // Create a play icon\r\n var stopIcon = new RoundedRectangle();\r\n stopIcon.width = 11;\r\n stopIcon.height = 11;\r\n stopIcon.horizontalCenter = \"middle\";\r\n stopIcon.verticalCenter = \"middle\";\r\n stopIcon.cornerRadius(0, 0, 0, 0);\r\n stopIcon.stroke = interfaceColors.getFor(\"primaryButtonText\");\r\n stopIcon.fill = playIcon.stroke;\r\n _this.togglable = true;\r\n var activeState = _this.states.create(\"active\");\r\n activeState.transitionDuration = 0;\r\n activeState.properties.icon = stopIcon;\r\n _this.defaultState.transitionDuration = 0;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Sets defaults that instantiate some objects that rely on parent, so they\r\n * cannot be set in constructor.\r\n */\r\n PlayButton.prototype.applyInternalDefaults = function () {\r\n _super.prototype.applyInternalDefaults.call(this);\r\n if (!$type.hasValue(this.readerTitle)) {\r\n this.readerTitle = this.language.translate(\"Play\");\r\n }\r\n };\r\n return PlayButton;\r\n}(Button));\r\nexport { PlayButton };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"PlayButton\"] = PlayButton;\r\n//# sourceMappingURL=PlayButton.js.map","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../../Base\";\r\nimport { registry } from \"../../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A base class for color modifiers.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nvar ColorModifier = /** @class */ (function (_super) {\r\n __extends(ColorModifier, _super);\r\n /**\r\n * Constructor\r\n */\r\n function ColorModifier() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"ColorModifier\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Modifies color value.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Original color\r\n * @return Modified\r\n */\r\n ColorModifier.prototype.modify = function (value) {\r\n return value;\r\n };\r\n return ColorModifier;\r\n}(BaseObject));\r\nexport { ColorModifier };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ColorModifier\"] = ColorModifier;\r\n//# sourceMappingURL=ColorModifier.js.map","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { ColorModifier } from \"./ColorModifier\";\r\nimport { registry } from \"../../Registry\";\r\nimport * as $math from \"../../utils/Math\";\r\nimport * as $type from \"../../utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * This class can be used to modify linear gradient steps, changing visual\r\n * properties like lightness, brightness, opacity of each set.\r\n *\r\n * It can also set offsets for each gradient step.\r\n *\r\n * E.g. if I want to fill a columns in a column series to be a solid fill from\r\n * top to 80% of height, then gradually fades out, I can use the following\r\n * gradient modifier as a `fillModifier`:\r\n *\r\n * ```TypeScript\r\n * let fillModifier = new am4core.GradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JavaScript\r\n * var fillModifier = new am4core.GradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JSON\r\n * \"series\": [{\r\n * \"type\": \"ColumnSeries\",\r\n * \"columns\": {\r\n * \"fillModifier\": {\r\n * \"type\": \"GradientModifier\",\r\n * \"opacities\": [1, 1, 0],\r\n * \"offsets\": [0, 0.8, 1]\r\n * }\r\n * }\r\n * }]\r\n * ```\r\n */\r\nvar GradientModifier = /** @class */ (function (_super) {\r\n __extends(GradientModifier, _super);\r\n /**\r\n * Constructor.\r\n */\r\n function GradientModifier() {\r\n var _this = _super.call(this) || this;\r\n _this.lightnesses = [];\r\n _this.brightnesses = [];\r\n _this.opacities = [];\r\n _this.offsets = [];\r\n _this.className = \"GradientModifier\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(GradientModifier.prototype, \"lightnesses\", {\r\n /**\r\n * @return Lightness values\r\n */\r\n get: function () {\r\n return this._lightnesses;\r\n },\r\n /**\r\n * An array of lightness values for each step.\r\n *\r\n * @param value Lightness values\r\n */\r\n set: function (value) {\r\n this._lightnesses = value;\r\n this._brightnesses = [];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(GradientModifier.prototype, \"brightnesses\", {\r\n /**\r\n * @return Brightness values\r\n */\r\n get: function () {\r\n return this._brightnesses;\r\n },\r\n /**\r\n * An array of brightness values for each step.\r\n *\r\n * @param value Brightness values\r\n */\r\n set: function (value) {\r\n this._brightnesses = value;\r\n this._lightnesses = [];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(GradientModifier.prototype, \"opacities\", {\r\n /**\r\n * @return Opacity values\r\n */\r\n get: function () {\r\n return this._opacities;\r\n },\r\n /**\r\n * An array of opacity values for each step.\r\n *\r\n * @param value Opacity values\r\n */\r\n set: function (value) {\r\n this._opacities = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(GradientModifier.prototype, \"offsets\", {\r\n /**\r\n * @return Offsets\r\n */\r\n get: function () {\r\n return this._offsets;\r\n },\r\n /**\r\n * An array of relative position (0-1) for each step.\r\n *\r\n * If not set, all steps will be of equal relative length.\r\n *\r\n * @param value Offsets\r\n */\r\n set: function (value) {\r\n this._offsets = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Modifies the color based on step setting.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Source color\r\n * @return A gradient that matches set modification rules\r\n */\r\n GradientModifier.prototype.modify = function (value) {\r\n // Clear current gradient\r\n this.gradient.clear();\r\n // Get step count\r\n var count = 0;\r\n if (this.opacities) {\r\n count = $math.max(count, this.opacities.length);\r\n }\r\n if (this.lightnesses) {\r\n count = $math.max(count, this.lightnesses.length);\r\n }\r\n if (this.brightnesses) {\r\n count = $math.max(count, this.brightnesses.length);\r\n }\r\n // Init step values\r\n var opacity = 1, lightness, brightness;\r\n // Apply steps\r\n for (var i = 0; i < count; i++) {\r\n // Take base color\r\n var color = value;\r\n // Check if there are any parameters for this step\r\n if (this.opacities && $type.isNumber(this.opacities[i])) {\r\n opacity = this.opacities[i];\r\n }\r\n if (this.lightnesses && $type.isNumber(this.lightnesses[i])) {\r\n lightness = this.lightnesses[i];\r\n brightness = undefined;\r\n }\r\n if (this.brightnesses && $type.isNumber(this.brightnesses[i])) {\r\n brightness = this.brightnesses[i];\r\n lightness = undefined;\r\n }\r\n // Check if we need to brighten/lighten color\r\n if ($type.isNumber(brightness)) {\r\n color = value.brighten(this.brightnesses[i]);\r\n }\r\n else if ($type.isNumber(lightness)) {\r\n color = value.lighten(this.lightnesses[i]);\r\n }\r\n // Get offset (it's OK if it's undefined)\r\n var offset = this.offsets[i];\r\n // Apply step\r\n this.gradient.addColor(color, opacity, offset);\r\n }\r\n return this.gradient;\r\n };\r\n GradientModifier.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this._offsets = source.offsets;\r\n this._brightnesses = source.brightnesses;\r\n this._lightnesses = source.lightnesses;\r\n this._opacities = source.opacities;\r\n };\r\n return GradientModifier;\r\n}(ColorModifier));\r\nexport { GradientModifier };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"GradientModifier\"] = GradientModifier;\r\n//# sourceMappingURL=GradientModifier.js.map","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { LinearGradient } from \"./LinearGradient\";\r\nimport { GradientModifier } from \"./GradientModifier\";\r\nimport { registry } from \"../../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * This class can be used to modify linear gradient steps, changing visual\r\n * properties like lightness, brightness, opacity of each set.\r\n *\r\n * It can also set offsets for each gradient step.\r\n *\r\n * E.g. if I want to fill a columns in a column series to be a solid fill from\r\n * top to 80% of height, then gradually fades out, I can use the following\r\n * gradient modifier as a `fillModifier`:\r\n *\r\n * ```TypeScript\r\n * let fillModifier = new am4core.LinearGradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JavaScript\r\n * var fillModifier = new am4core.LinearGradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JSON\r\n * \"series\": [{\r\n * \"type\": \"ColumnSeries\",\r\n * \"columns\": {\r\n * \"fillModifier\": {\r\n * \"type\": \"LinearGradientModifier\",\r\n * \"opacities\": [1, 1, 0],\r\n * \"offsets\": [0, 0.8, 1]\r\n * }\r\n * }\r\n * }]\r\n * ```\r\n */\r\nvar LinearGradientModifier = /** @class */ (function (_super) {\r\n __extends(LinearGradientModifier, _super);\r\n /**\r\n * Constructor.\r\n */\r\n function LinearGradientModifier() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"LinearGradientModifier\";\r\n _this.gradient = new LinearGradient();\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n LinearGradientModifier.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.gradient = source.gradient.clone();\r\n };\r\n return LinearGradientModifier;\r\n}(GradientModifier));\r\nexport { LinearGradientModifier };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"LinearGradientModifier\"] = LinearGradientModifier;\r\n//# sourceMappingURL=LinearGradientModifier.js.map","/**\r\n * Cone module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../../Container\";\r\nimport { Sprite, visualProperties } from \"../../Sprite\";\r\nimport { Ellipse } from \"../../elements/Ellipse\";\r\nimport { LinearGradientModifier } from \"../../rendering/fills/LinearGradientModifier\";\r\nimport { percent } from \"../../utils/Percent\";\r\nimport * as $object from \"../../utils/Object\";\r\nimport * as $path from \"../../rendering/Path\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Builds a round cone/cylinder.\r\n *\r\n * @see {@link IConeEvents} for a list of available events\r\n * @see {@link IConeAdapters} for a list of available Adapters\r\n */\r\nvar Cone = /** @class */ (function (_super) {\r\n __extends(Cone, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Cone() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Cone\";\r\n _this.angle = 30;\r\n _this.radius = percent(100);\r\n _this.topRadius = percent(100);\r\n _this.top = _this.createChild(Ellipse);\r\n _this.top.shouldClone = false;\r\n _this.bottom = _this.createChild(Ellipse);\r\n _this.bottom.shouldClone = false;\r\n _this.body = _this.createChild(Sprite);\r\n _this.body.shouldClone = false;\r\n _this.body.setElement(_this.paper.add(\"path\"));\r\n _this.layout = \"none\";\r\n _this.bodyFillModifier = new LinearGradientModifier();\r\n _this.bodyFillModifier.lightnesses = [0, -0.25, 0];\r\n _this.body.fillModifier = _this.bodyFillModifier;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Cone.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n $object.copyProperties(this, this.top, visualProperties);\r\n $object.copyProperties(this, this.bottom, visualProperties);\r\n $object.copyProperties(this, this.body, visualProperties);\r\n var w = this.innerWidth;\r\n var h = this.innerHeight;\r\n var bottom = this.bottom;\r\n var top = this.top;\r\n var angle = this.angle;\r\n var radiusBase;\r\n var dx;\r\n var dy;\r\n if (this.orientation == \"horizontal\") {\r\n radiusBase = h / 2;\r\n bottom.y = h / 2;\r\n bottom.x = 0;\r\n top.y = h / 2;\r\n top.x = w;\r\n dx = (90 - angle) / 90;\r\n dy = 0;\r\n this.bodyFillModifier.gradient.rotation = 90;\r\n }\r\n else {\r\n dx = 0;\r\n dy = (90 - angle) / 90;\r\n radiusBase = w / 2;\r\n bottom.y = h;\r\n bottom.x = w / 2;\r\n top.x = w / 2;\r\n this.bodyFillModifier.gradient.rotation = 0;\r\n }\r\n var radius = this.radius.value * radiusBase;\r\n var topRadius = this.topRadius.value * radiusBase;\r\n bottom.radius = radius - radius * dx;\r\n bottom.radiusY = radius - radius * dy;\r\n top.radius = topRadius - topRadius * dx;\r\n top.radiusY = topRadius - topRadius * dy;\r\n var path;\r\n if (this.orientation == \"horizontal\") {\r\n path = $path.moveTo({ x: 0, y: h / 2 - bottom.radiusY }) + $path.arcTo(-90, -180, bottom.radius, bottom.radiusY) + $path.lineTo({ x: w, y: h / 2 + top.radiusY }) + $path.arcTo(90, 180, top.radius, top.radiusY) + $path.closePath();\r\n }\r\n else {\r\n path = $path.moveTo({ x: w / 2 - top.radius, y: 0 }) + $path.arcTo(180, -180, top.radius, top.radiusY) + $path.lineTo({ x: w / 2 + bottom.radius, y: h }) + $path.arcTo(0, 180, bottom.radius, bottom.radiusY) + $path.closePath();\r\n }\r\n this.body.path = path;\r\n };\r\n Object.defineProperty(Cone.prototype, \"angle\", {\r\n /**\r\n * @return Angle\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"angle\");\r\n },\r\n /**\r\n * Angle of the point of view to the 3D element. (0-360)\r\n *\r\n * @default 30\r\n * @param value Angle\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"angle\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Cone.prototype, \"radius\", {\r\n /**\r\n * @return Bottom radius\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"radius\");\r\n },\r\n /**\r\n * A relative radius of the cone's bottom (base).\r\n *\r\n * It is relevant to the inner width or height of the element.\r\n *\r\n * @default Percent(100)\r\n * @param value Bottom radius\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"radius\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Cone.prototype, \"topRadius\", {\r\n /**\r\n * @return Top radius\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"topRadius\");\r\n },\r\n /**\r\n * A relative radius of the cone's top (tip).\r\n *\r\n * It is relevant to the inner width or height of the element.\r\n *\r\n * @default Percent(0)\r\n * @param value Top radius\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"topRadius\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Cone.prototype, \"orientation\", {\r\n /**\r\n * Orientation\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"orientation\");\r\n },\r\n /**\r\n * Orientation of the cone\r\n *\r\n * @default \"vertical\"\r\n * @param value Orientation\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"orientation\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Cone;\r\n}(Container));\r\nexport { Cone };\r\n//# sourceMappingURL=Cone.js.map","/**\r\n * Module for \"Lighten\" filter.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Filter } from \"./Filter\";\r\nimport { registry } from \"../../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a \"Lighten\" filter.\r\n */\r\nvar LightenFilter = /** @class */ (function (_super) {\r\n __extends(LightenFilter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function LightenFilter() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"LightenFilter\";\r\n // Create elements\r\n // NOTE: we do not need to add each individual element to `_disposers`\r\n // because `filterPrimitives` has an event handler which automatically adds\r\n // anything added to it to `_disposers`\r\n _this.feColorMatrix = _this.paper.add(\"feColorMatrix\");\r\n _this.feColorMatrix.attr({ \"type\": \"matrix\" });\r\n _this.filterPrimitives.push(_this.feColorMatrix);\r\n // Set default properties\r\n _this.lightness = 0;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(LightenFilter.prototype, \"lightness\", {\r\n /**\r\n * @return Lightness\r\n */\r\n get: function () {\r\n return this.properties[\"lightness\"];\r\n },\r\n /**\r\n * Lightness of the target colors.\r\n *\r\n * If `lightness` is a positive number, the filter will make all colors\r\n * lighter.\r\n *\r\n * If `lightness` is negative, colors will be darkened.\r\n *\r\n * @param value Lightness\r\n */\r\n set: function (value) {\r\n this.properties[\"lightness\"] = value;\r\n var v = value + 1;\r\n this.feColorMatrix.attr({ \"values\": v + \" 0 0 0 0 0 \" + v + \" 0 0 0 0 0 \" + v + \" 0 0 0 0 0 1 0\" });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return LightenFilter;\r\n}(Filter));\r\nexport { LightenFilter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"LightenFilter\"] = LightenFilter;\r\n//# sourceMappingURL=LightenFilter.js.map","/**\r\n * Creates a 3D rectangle.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../../Container\";\r\nimport { Sprite } from \"../../Sprite\";\r\nimport * as $math from \"../../utils/Math\";\r\nimport * as $path from \"../../rendering/Path\";\r\nimport { Color, color, toColor } from \"../../utils/Color\";\r\nimport { RadialGradient } from \"../../rendering/fills/RadialGradient\";\r\nimport { LinearGradient } from \"../../rendering/fills/LinearGradient\";\r\nimport { LightenFilter } from \"../../rendering/filters/LightenFilter\";\r\nimport * as $type from \"../../utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Builds a 3D rectangle\r\n * @see {@link IRectangle3DEvents} for a list of available events\r\n * @see {@link IRectangle3DAdapters} for a list of available Adapters\r\n */\r\nvar Rectangle3D = /** @class */ (function (_super) {\r\n __extends(Rectangle3D, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Rectangle3D() {\r\n var _this = _super.call(this) || this;\r\n _this.angle = 30;\r\n _this.depth = 30;\r\n _this.className = \"Rectangle3D\";\r\n _this.layout = \"none\";\r\n var sideBack = _this.createChild(Sprite);\r\n sideBack.shouldClone = false;\r\n sideBack.setElement(_this.paper.add(\"path\"));\r\n sideBack.isMeasured = false;\r\n _this.sideBack = sideBack;\r\n _this._disposers.push(_this.sideBack);\r\n var sideBottom = _this.createChild(Sprite);\r\n sideBottom.shouldClone = false;\r\n sideBottom.setElement(_this.paper.add(\"path\"));\r\n sideBottom.isMeasured = false;\r\n _this.sideBottom = sideBottom;\r\n _this._disposers.push(_this.sideBottom);\r\n var sideLeft = _this.createChild(Sprite);\r\n sideLeft.shouldClone = false;\r\n sideLeft.setElement(_this.paper.add(\"path\"));\r\n sideLeft.isMeasured = false;\r\n _this.sideLeft = sideLeft;\r\n _this._disposers.push(_this.sideLeft);\r\n var sideRight = _this.createChild(Sprite);\r\n sideRight.shouldClone = false;\r\n sideRight.setElement(_this.paper.add(\"path\"));\r\n sideRight.isMeasured = false;\r\n _this.sideRight = sideRight;\r\n _this._disposers.push(_this.sideRight);\r\n var sideTop = _this.createChild(Sprite);\r\n sideTop.shouldClone = false;\r\n sideTop.setElement(_this.paper.add(\"path\"));\r\n sideTop.isMeasured = false;\r\n _this.sideTop = sideTop;\r\n _this._disposers.push(_this.sideTop);\r\n var sideFront = _this.createChild(Sprite);\r\n sideFront.shouldClone = false;\r\n sideFront.setElement(_this.paper.add(\"path\"));\r\n sideFront.isMeasured = false;\r\n _this.sideFront = sideFront;\r\n _this._disposers.push(_this.sideFront);\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Rectangle3D.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n var w = this.innerWidth;\r\n var h = this.innerHeight;\r\n var depth = this.depth;\r\n var angle = this.angle;\r\n var sin = $math.sin(angle);\r\n var cos = $math.cos(angle);\r\n var a = { x: 0, y: 0 };\r\n var b = { x: w, y: 0 };\r\n var c = { x: w, y: h };\r\n var d = { x: 0, y: h };\r\n var ah = { x: depth * cos, y: -depth * sin };\r\n var bh = { x: depth * cos + w, y: -depth * sin };\r\n var ch = { x: depth * cos + w, y: -depth * sin + h };\r\n var dh = { x: depth * cos, y: -depth * sin + h };\r\n this.sideFront.path = $path.moveTo(a) + $path.lineTo(b) + $path.lineTo(c) + $path.lineTo(d) + $path.closePath();\r\n this.sideBack.path = $path.moveTo(ah) + $path.lineTo(bh) + $path.lineTo(ch) + $path.lineTo(dh) + $path.closePath();\r\n this.sideLeft.path = $path.moveTo(a) + $path.lineTo(ah) + $path.lineTo(dh) + $path.lineTo(d) + $path.closePath();\r\n this.sideRight.path = $path.moveTo(b) + $path.lineTo(bh) + $path.lineTo(ch) + $path.lineTo(c) + $path.closePath();\r\n this.sideBottom.path = $path.moveTo(d) + $path.lineTo(dh) + $path.lineTo(ch) + $path.lineTo(c) + $path.closePath();\r\n this.sideTop.path = $path.moveTo(a) + $path.lineTo(ah) + $path.lineTo(bh) + $path.lineTo(b) + $path.closePath();\r\n };\r\n Object.defineProperty(Rectangle3D.prototype, \"depth\", {\r\n /**\r\n * @return Depth (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"depth\");\r\n },\r\n /**\r\n * Depth (Z dimension) of the 3D rectangle in pixels.\r\n *\r\n * @default 30\r\n * @param value Depth (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"depth\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Rectangle3D.prototype, \"angle\", {\r\n /**\r\n * @return Angle\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"angle\");\r\n },\r\n /**\r\n * Angle of the point of view to the 3D element. (0-360)\r\n *\r\n * @default 30\r\n * @param value Angle\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"angle\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets actual `fill` property on the SVG element, including applicable color\r\n * modifiers.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Fill\r\n */\r\n Rectangle3D.prototype.setFill = function (value) {\r\n _super.prototype.setFill.call(this, value);\r\n if (!$type.isObject(value) || \"r\" in value) {\r\n value = toColor(value);\r\n }\r\n var colorStr;\r\n if (value instanceof Color) {\r\n colorStr = value.hex;\r\n }\r\n else if (value instanceof LinearGradient || value instanceof RadialGradient) {\r\n colorStr = value.stops.getIndex(0).color.hex;\r\n }\r\n else {\r\n var filter = new LightenFilter();\r\n filter.lightness = -0.2;\r\n this.sideBack.filters.push(filter);\r\n var filter2 = filter.clone();\r\n filter2.lightness = -0.4;\r\n this.sideLeft.filters.push(filter2);\r\n var filter3 = filter.clone();\r\n filter3.lightness = -0.2;\r\n this.sideRight.filters.push(filter3);\r\n var filter4 = filter.clone();\r\n filter4.lightness = -0.1;\r\n this.sideTop.filters.push(filter4);\r\n var filter5 = filter.clone();\r\n filter5.lightness = -0.5;\r\n this.sideBottom.filters.push(filter5);\r\n }\r\n if (colorStr) {\r\n this.sideBack.fill = color(colorStr).lighten(-0.2);\r\n this.sideLeft.fill = color(colorStr).lighten(-0.4);\r\n this.sideRight.fill = color(colorStr).lighten(-0.2);\r\n this.sideTop.fill = color(colorStr).lighten(-0.1);\r\n this.sideBottom.fill = color(colorStr).lighten(-0.5);\r\n }\r\n };\r\n /**\r\n * Copies all properties and related data from a different instance of Rectangle3D.\r\n *\r\n * @param source Source Rectangle3D\r\n */\r\n Rectangle3D.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.sideBack.copyFrom(source.sideBack);\r\n this.sideLeft.copyFrom(source.sideLeft);\r\n this.sideRight.copyFrom(source.sideRight);\r\n this.sideTop.copyFrom(source.sideTop);\r\n this.sideBottom.copyFrom(source.sideBottom);\r\n };\r\n return Rectangle3D;\r\n}(Container));\r\nexport { Rectangle3D };\r\n//# sourceMappingURL=Rectangle3D.js.map","/**\r\n * 3D slice module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Slice } from \"../Slice\";\r\nimport { Sprite } from \"../../Sprite\";\r\nimport * as $math from \"../../utils/Math\";\r\nimport * as $path from \"../../rendering/Path\";\r\nimport * as $type from \"../../utils/Type\";\r\nimport { Color, color } from \"../../utils/Color\";\r\nimport { RadialGradient } from \"../../rendering/fills/RadialGradient\";\r\nimport { LinearGradient } from \"../../rendering/fills/LinearGradient\";\r\nimport { LightenFilter } from \"../../rendering/filters/LightenFilter\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Used to draw a 3D slice of a Pie chart.\r\n *\r\n * @see {@link ISlice3DEvents} for a list of available events\r\n * @see {@link ISlice3DAdapters} for a list of available Adapters\r\n */\r\nvar Slice3D = /** @class */ (function (_super) {\r\n __extends(Slice3D, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Slice3D() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"Slice3D\";\r\n _this.layout = \"none\";\r\n // Create edge container\r\n var edge = _this.createChild(Sprite);\r\n _this.edge = edge;\r\n edge.shouldClone = false;\r\n edge.isMeasured = false;\r\n edge.toBack();\r\n // Set defaults\r\n _this.angle = 30;\r\n _this.depth = 20;\r\n // Create side A element\r\n var sideA = _this.createChild(Sprite);\r\n _this.sideA = sideA;\r\n sideA.shouldClone = false;\r\n sideA.isMeasured = false;\r\n //sideA.setElement(this.paper.add(\"path\"));\r\n //sideA.strokeOpacity = 0;\r\n // Crate side B element\r\n var sideB = _this.createChild(Sprite);\r\n _this.sideB = sideB;\r\n sideB.shouldClone = false;\r\n sideB.isMeasured = false;\r\n //sideB.setElement(this.paper.add(\"path\"));\r\n //sideB.strokeOpacity = 0;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Sets actual `fill` property on the SVG element, including applicable color\r\n * modifiers.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Fill\r\n */\r\n Slice3D.prototype.setFill = function (value) {\r\n _super.prototype.setFill.call(this, value);\r\n var colorStr;\r\n if (value instanceof Color) {\r\n colorStr = value.hex;\r\n }\r\n else if (value instanceof LinearGradient || value instanceof RadialGradient) {\r\n colorStr = value.stops.getIndex(0).color.hex;\r\n }\r\n else {\r\n var filter = new LightenFilter();\r\n filter.lightness = -0.25;\r\n this.edge.filters.push(filter);\r\n this.sideA.filters.push(filter.clone());\r\n this.sideB.filters.push(filter.clone());\r\n }\r\n if (colorStr) {\r\n var edgeFill = color(colorStr).lighten(-0.25);\r\n this.edge.fill = edgeFill;\r\n this.sideA.fill = edgeFill;\r\n this.sideB.fill = edgeFill;\r\n this.edge.stroke = edgeFill;\r\n this.sideA.stroke = edgeFill;\r\n this.sideB.stroke = edgeFill;\r\n }\r\n };\r\n /**\r\n * Draws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Slice3D.prototype.draw = function () {\r\n this.cornerRadius = 0;\r\n this.innerCornerRadius = 0;\r\n _super.prototype.draw.call(this);\r\n if (this.arc !== 0 && this.radius > 0 && this.depth > 0) {\r\n this.sideB.show(0);\r\n this.sideA.show(0);\r\n this.edge.show(0);\r\n var startAngle = this.startAngle;\r\n var arc = this.arc;\r\n var innerRadius = this.pixelInnerRadius || 0;\r\n var radiusY = this.radiusY || 0;\r\n //let cornerRadius = this.cornerRadius || 0;\r\n //let innerCornerRadius = this.innerCornerRadius;\r\n var radius = this.radius;\r\n // this is code duplicate with $path.arc. @todo to think how to avoid it\r\n var endAngle = startAngle + arc;\r\n //let crSin = $math.sin($math.min(arc, 45) / 2);\r\n //innerCornerRadius = innerCornerRadius || cornerRadius;\r\n var innerRadiusY = (radiusY / radius) * innerRadius;\r\n //let cornerRadiusY = (radiusY / radius) * cornerRadius;\r\n //let innerCornerRadiusY = (radiusY / radius) * innerCornerRadius;\r\n //cornerRadius = $math.fitToRange(cornerRadius, 0, (radius - innerRadius) / 2);\r\n //cornerRadiusY = $math.fitToRange(cornerRadiusY, 0, (radiusY - innerRadiusY) / 2);\r\n //innerCornerRadius = $math.fitToRange(innerCornerRadius, 0, (radius - innerRadius) / 2);\r\n //innerCornerRadiusY = $math.fitToRange(innerCornerRadiusY, 0, (radiusY - innerRadiusY) / 2);\r\n //cornerRadius = $math.fitToRange(cornerRadius, 0, radius * crSin);\r\n //cornerRadiusY = $math.fitToRange(cornerRadiusY, 0, radiusY * crSin);\r\n //innerCornerRadius = $math.fitToRange(innerCornerRadius, 0, innerRadius * crSin);\r\n //innerCornerRadiusY = $math.fitToRange(innerCornerRadiusY, 0, innerRadiusY * crSin);\r\n //let crAngle: number = Math.asin(cornerRadius / radius / 2) * $math.DEGREES * 2;\r\n //let crAngleY: number = Math.asin(cornerRadiusY / radiusY / 2) * $math.DEGREES * 2;\r\n //if (innerRadius < innerCornerRadius) {\r\n //\tinnerRadius = innerCornerRadius;\r\n //}\r\n //if (innerRadiusY < innerCornerRadiusY) {\r\n //\tinnerRadiusY = innerCornerRadiusY;\r\n //}\r\n //let crInnerAngle: number = Math.asin(innerCornerRadius / innerRadius / 2) * $math.DEGREES * 2;\r\n //let crInnerAngleY: number = Math.asin(innerCornerRadiusY / innerRadiusY / 2) * $math.DEGREES * 2;\r\n //if (!$type.isNumber(crInnerAngle)) {\r\n //\tcrInnerAngle = 0;\r\n //}\r\n //if (!$type.isNumber(crInnerAngleY)) {\r\n //\tcrInnerAngleY = 0;\r\n //}\r\n //let middleAngle = startAngle + arc / 2;\r\n //let mPoint = { x: $math.round($math.cos(middleAngle) * innerRadius, 4), y: $math.round($math.sin(middleAngle) * innerRadiusY, 4) };\r\n var a0 = { x: $math.cos(startAngle) * (innerRadius), y: $math.sin(startAngle) * (innerRadiusY) };\r\n var b0 = { x: $math.cos(startAngle) * (radius), y: $math.sin(startAngle) * (radiusY) };\r\n var c0 = { x: $math.cos(endAngle) * (radius), y: $math.sin(endAngle) * (radiusY) };\r\n var d0 = { x: $math.cos(endAngle) * (innerRadius), y: $math.sin(endAngle) * (innerRadiusY) };\r\n // end of duplicate\r\n var h = this.depth;\r\n var ah = { x: a0.x, y: a0.y - h };\r\n var bh = { x: b0.x, y: b0.y - h };\r\n var ch = { x: c0.x, y: c0.y - h };\r\n var dh = { x: d0.x, y: d0.y - h };\r\n var edgePath = \"\";\r\n var count = Math.ceil(arc / 5);\r\n var step = arc / count;\r\n var mangle = startAngle;\r\n var prevPoint = bh;\r\n for (var i = 0; i < count; i++) {\r\n mangle += step;\r\n if (mangle > 0 && mangle < 180) {\r\n edgePath += $path.moveTo(prevPoint);\r\n var pp = { x: $math.cos(mangle) * (radius), y: $math.sin(mangle) * (radiusY) - h };\r\n edgePath += $path.lineTo({ x: prevPoint.x, y: prevPoint.y + h });\r\n edgePath += $path.arcToPoint({ x: pp.x, y: pp.y + h }, radius, radiusY, true);\r\n edgePath += $path.lineTo(pp);\r\n edgePath += $path.arcToPoint(prevPoint, radius, radiusY);\r\n edgePath += \"z\";\r\n prevPoint = pp;\r\n }\r\n else {\r\n edgePath += $path.moveTo(prevPoint);\r\n var pp = { x: $math.cos(mangle) * (radius), y: $math.sin(mangle) * (radiusY) - h };\r\n edgePath += $path.arcToPoint(pp, radius, radiusY, true);\r\n edgePath += $path.lineTo({ x: pp.x, y: pp.y + h });\r\n edgePath += $path.arcToPoint({ x: prevPoint.x, y: prevPoint.y + h }, radius, radiusY);\r\n edgePath += $path.lineTo(prevPoint);\r\n edgePath += \"z\";\r\n prevPoint = pp;\r\n }\r\n }\r\n prevPoint = ah;\r\n mangle = startAngle;\r\n for (var i = 0; i < count; i++) {\r\n mangle += step;\r\n if (mangle > 0 && mangle < 180) {\r\n edgePath += $path.moveTo(prevPoint);\r\n var pp = { x: $math.cos(mangle) * (innerRadius), y: $math.sin(mangle) * (innerRadiusY) - h };\r\n edgePath += $path.lineTo({ x: prevPoint.x, y: prevPoint.y + h });\r\n edgePath += $path.arcToPoint({ x: pp.x, y: pp.y + h }, innerRadius, innerRadiusY, true);\r\n edgePath += $path.lineTo(pp);\r\n edgePath += $path.arcToPoint(prevPoint, innerRadius, innerRadiusY);\r\n edgePath += \"z\";\r\n prevPoint = pp;\r\n }\r\n else {\r\n edgePath += $path.moveTo(prevPoint);\r\n var pp = { x: $math.cos(mangle) * (innerRadius), y: $math.sin(mangle) * (innerRadiusY) - h };\r\n edgePath += $path.arcToPoint(pp, innerRadius, innerRadiusY, true);\r\n edgePath += $path.lineTo({ x: pp.x, y: pp.y + h });\r\n edgePath += $path.arcToPoint({ x: prevPoint.x, y: prevPoint.y + h }, innerRadius, innerRadiusY);\r\n edgePath += $path.lineTo(prevPoint);\r\n edgePath += \"z\";\r\n prevPoint = pp;\r\n }\r\n }\r\n this.edge.path = edgePath;\r\n /*\r\n a0 = { x: $math.cos(startAngle) * (innerRadius + innerCornerRadius), y: $math.sin(startAngle) * (innerRadiusY + innerCornerRadiusY) };\r\n b0 = { x: $math.cos(startAngle) * (radius - cornerRadius), y: $math.sin(startAngle) * (radiusY - cornerRadiusY) };\r\n c0 = { x: $math.cos(endAngle) * (radius - cornerRadius), y: $math.sin(endAngle) * (radiusY - cornerRadiusY) };\r\n d0 = { x: $math.cos(endAngle) * (innerRadius + innerCornerRadius), y: $math.sin(endAngle) * (innerRadiusY + innerCornerRadiusY) };\r\n // end of duplicate\r\n \r\n ah = { x: a0.x, y: a0.y - h };\r\n bh = { x: b0.x, y: b0.y - h };\r\n ch = { x: c0.x, y: c0.y - h };\r\n dh = { x: d0.x, y: d0.y - h };\r\n */\r\n this.sideA.path = $path.moveTo(a0) + $path.lineTo(b0) + $path.lineTo(bh) + $path.lineTo(ah) + $path.closePath();\r\n this.sideB.path = $path.moveTo(c0) + $path.lineTo(d0) + $path.lineTo(dh) + $path.lineTo(ch) + $path.closePath();\r\n if (this.startAngle < 90) {\r\n this.sideA.toBack();\r\n }\r\n else {\r\n this.sideA.toFront();\r\n }\r\n if (this.startAngle + this.arc > 90) {\r\n this.sideB.toBack();\r\n }\r\n else {\r\n this.sideB.toFront();\r\n }\r\n this.slice.dy = -h;\r\n }\r\n else {\r\n this.sideA.hide(0);\r\n this.sideB.hide(0);\r\n this.edge.hide(0);\r\n }\r\n };\r\n Object.defineProperty(Slice3D.prototype, \"depth\", {\r\n /**\r\n * @return Depth (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"depth\");\r\n },\r\n /**\r\n * Depth (height) of the 3D slice in pixels.\r\n *\r\n * @default 20\r\n * @param depth Depth (px)\r\n */\r\n set: function (depth) {\r\n this.setPropertyValue(\"depth\", depth, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slice3D.prototype, \"angle\", {\r\n /**\r\n * @return Angle\r\n */\r\n get: function () {\r\n var angle = this.getPropertyValue(\"angle\");\r\n if (!$type.isNumber(angle)) {\r\n angle = 0;\r\n }\r\n return angle;\r\n },\r\n /**\r\n * Angle of the point of view to the 3D element. (0-360)\r\n *\r\n * @default 30\r\n * @param value Angle\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"angle\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slice3D.prototype, \"radiusY\", {\r\n /**\r\n * @return Vertical radius (0-1)\r\n */\r\n get: function () {\r\n var radiusY = this.getPropertyValue(\"radiusY\");\r\n if (!$type.isNumber(radiusY)) {\r\n radiusY = this.radius - this.radius * this.angle / 90;\r\n }\r\n return radiusY;\r\n },\r\n /**\r\n * Vertical radius for creating skewed slices.\r\n *\r\n * This is relevant to `radius`, e.g. 0.5 will set vertical radius to half\r\n * the `radius`.\r\n *\r\n * @param value Vertical radius (0-1)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"radiusY\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies all properties and related data from a different instance of Axis.\r\n *\r\n * @param source Source Axis\r\n */\r\n Slice3D.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.edge.copyFrom(source.edge);\r\n this.sideA.copyFrom(source.sideA);\r\n this.sideB.copyFrom(source.sideB);\r\n };\r\n return Slice3D;\r\n}(Slice));\r\nexport { Slice3D };\r\n//# sourceMappingURL=Slice3D.js.map","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { RadialGradient } from \"./RadialGradient\";\r\nimport { GradientModifier } from \"./GradientModifier\";\r\nimport { registry } from \"../../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * This class can be used to modify radial gradient steps, changing visual\r\n * properties like lightness, brightness, opacity of each set.\r\n *\r\n * It can also set offsets for each gradient step.\r\n *\r\n * E.g. if I want to fill a columns in a column series to be a solid fill from\r\n * top to 80% of height, then gradually fades out, I can use the following\r\n * gradient modifier as a `fillModifier`:\r\n *\r\n * ```TypeScript\r\n * let fillModifier = new am4core.LinearGradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JavaScript\r\n * var fillModifier = new am4core.LinearGradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JSON\r\n * \"series\": [{\r\n * \"type\": \"ColumnSeries\",\r\n * \"columns\": {\r\n * \"fillModifier\": {\r\n * \"type\": \"LinearGradientModifier\",\r\n * \"opacities\": [1, 1, 0],\r\n * \"offsets\": [0, 0.8, 1]\r\n * }\r\n * }\r\n * }]\r\n * ```\r\n */\r\nvar RadialGradientModifier = /** @class */ (function (_super) {\r\n __extends(RadialGradientModifier, _super);\r\n /**\r\n * Constructor.\r\n */\r\n function RadialGradientModifier() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"RadialGradientModifier\";\r\n _this.gradient = new RadialGradient();\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n RadialGradientModifier.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.gradient = source.gradient.clone();\r\n };\r\n return RadialGradientModifier;\r\n}(GradientModifier));\r\nexport { RadialGradientModifier };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"RadialGradientModifier\"] = RadialGradientModifier;\r\n//# sourceMappingURL=RadialGradientModifier.js.map","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Pattern } from \"./Pattern\";\r\nimport { registry } from \"../../Registry\";\r\nimport * as $path from \"../../rendering/Path\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Line pattern.\r\n */\r\nvar LinePattern = /** @class */ (function (_super) {\r\n __extends(LinePattern, _super);\r\n /**\r\n * Constructor\r\n */\r\n function LinePattern() {\r\n var _this = _super.call(this) || this;\r\n _this.properties[\"gap\"] = 0;\r\n _this._line = _this.paper.add(\"path\");\r\n _this.addElement(_this._line);\r\n return _this;\r\n }\r\n /**\r\n * Draws the pattern.\r\n */\r\n LinePattern.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n if (Math.round(this.rotation / 90) != this.rotation / 90) {\r\n this.properties[\"shapeRendering\"] = \"auto\";\r\n }\r\n if (this._line) {\r\n var w = this.width;\r\n var h = this.height;\r\n var path = \"\";\r\n if (!this.gap) {\r\n if (Math.round(this.rotation / 90) != this.rotation / 90) {\r\n path = $path.moveTo({ x: -w, y: h / 2 }) + $path.lineTo({ x: w * 2, y: h / 2 });\r\n this.properties[\"rotationX\"] = this.width / 2;\r\n this.properties[\"rotationY\"] = this.height / 2;\r\n }\r\n else {\r\n path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: w, y: 0 });\r\n }\r\n }\r\n else {\r\n var step = this.gap + this.strokeWidth;\r\n var count = this.height / step;\r\n for (var i = -count / 2; i < count * 1.5; i++) {\r\n if (Math.round(this.rotation / 90) != this.rotation / 90) {\r\n path += $path.moveTo({ x: -w, y: (i + 0.5) * step }) + $path.lineTo({ x: w * 2, y: (i + 0.5) * step });\r\n this.properties[\"rotationX\"] = this.width / 2;\r\n this.properties[\"rotationY\"] = this.height / 2;\r\n }\r\n else {\r\n path += $path.moveTo({ x: -w, y: i * step }) + $path.lineTo({ x: w * 2, y: i * step });\r\n }\r\n }\r\n }\r\n this._line.attr({ \"d\": path });\r\n }\r\n };\r\n Object.defineProperty(LinePattern.prototype, \"gap\", {\r\n /**\r\n * @return gap\r\n */\r\n get: function () {\r\n return this.properties[\"gap\"];\r\n },\r\n /**\r\n * Number of pixels between pattern lines.\r\n *\r\n * The pattern will automatically draw required number of lines to fill\r\n * pattern area maintaining `gap` distance between them.\r\n *\r\n * 0 (zero) means only single line will be drawn.\r\n *\r\n * @default 0\r\n * @since 4.7.7\r\n */\r\n set: function (value) {\r\n this.properties[\"gap\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return LinePattern;\r\n}(Pattern));\r\nexport { LinePattern };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"LinePattern\"] = LinePattern;\r\n//# sourceMappingURL=LinePattern.js.map","/**\r\n * Rectangular pattern module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Pattern } from \"./Pattern\";\r\nimport { registry } from \"../../Registry\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Circular pattern\r\n */\r\nvar CirclePattern = /** @class */ (function (_super) {\r\n __extends(CirclePattern, _super);\r\n /**\r\n * Constructor\r\n */\r\n function CirclePattern() {\r\n var _this = _super.call(this) || this;\r\n _this.properties[\"radius\"] = 2;\r\n _this._circle = _this.paper.add(\"circle\");\r\n _this.addElement(_this._circle);\r\n _this.shapeRendering = \"auto\";\r\n return _this;\r\n }\r\n /**\r\n * Draws the circle element.\r\n */\r\n CirclePattern.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n if (this._circle) {\r\n this._circle.attr({ \"r\": this.radius, \"cx\": this.width / 2, \"cy\": this.height / 2 });\r\n }\r\n };\r\n Object.defineProperty(CirclePattern.prototype, \"radius\", {\r\n /**\r\n * @return Radius (px)\r\n */\r\n get: function () {\r\n return this.properties[\"radius\"];\r\n },\r\n /**\r\n * Circle radius in pixels.\r\n *\r\n * @param value Radius (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"radius\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return CirclePattern;\r\n}(Pattern));\r\nexport { CirclePattern };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"CirclePattern\"] = CirclePattern;\r\n//# sourceMappingURL=CirclePattern.js.map","/**\r\n * Rectangular pattern module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Pattern } from \"./Pattern\";\r\nimport { registry } from \"../../Registry\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Rectangular pattern\r\n */\r\nvar RectPattern = /** @class */ (function (_super) {\r\n __extends(RectPattern, _super);\r\n /**\r\n * Constructor\r\n */\r\n function RectPattern() {\r\n var _this = _super.call(this) || this;\r\n _this.rectHeight = 1;\r\n _this.rectWidth = 1;\r\n _this._rect = _this.paper.add(\"rect\");\r\n _this.addElement(_this._rect);\r\n return _this;\r\n }\r\n /**\r\n * Draws the rectangular element.\r\n */\r\n RectPattern.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n this.properties[\"rotationX\"] = this.width / 2;\r\n this.properties[\"rotationY\"] = this.height / 2;\r\n if (this._rect) {\r\n this._rect.attr({ \"width\": this.rectWidth, \"height\": this.rectHeight, \"x\": (this.width - this.rectWidth) / 2, \"y\": (this.height - this.rectHeight) / 2 });\r\n }\r\n };\r\n Object.defineProperty(RectPattern.prototype, \"rectWidth\", {\r\n /**\r\n * @return Width (px)\r\n */\r\n get: function () {\r\n return this.properties[\"rectWidth\"];\r\n },\r\n /**\r\n * Rectangle width in pixels.\r\n *\r\n * @param value Width (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"rectWidth\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RectPattern.prototype, \"rectHeight\", {\r\n /**\r\n * @return Height (px)\r\n */\r\n get: function () {\r\n return this.properties[\"rectHeight\"];\r\n },\r\n /**\r\n * Rectangle height in pixels.\r\n *\r\n * @param value Height (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"rectHeight\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return RectPattern;\r\n}(Pattern));\r\nexport { RectPattern };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"RectPattern\"] = RectPattern;\r\n//# sourceMappingURL=RectPattern.js.map","/**\r\n * Module for \"Colorize\" filter.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Filter } from \"./Filter\";\r\nimport { registry } from \"../../Registry\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a \"Colorize\" filter.\r\n */\r\nvar ColorizeFilter = /** @class */ (function (_super) {\r\n __extends(ColorizeFilter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function ColorizeFilter() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"ColorizeFilter\";\r\n // Create elements\r\n // NOTE: we do not need to add each individual element to `_disposers`\r\n // because `filterPrimitives` has an event handler which automatically adds\r\n // anything added to it to `_disposers`\r\n _this.feColorMatrix = _this.paper.add(\"feColorMatrix\");\r\n _this.feColorMatrix.attr({ \"type\": \"matrix\" });\r\n //this.feColorMatrix.setAttribute(\"in\", \"SourceAlpha\");\r\n _this.filterPrimitives.push(_this.feColorMatrix);\r\n // Set default properties\r\n _this.intensity = 1;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * (Re)applies colors to the already existing filter by modifying filyer's\r\n * color matrix element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n ColorizeFilter.prototype.applyFilter = function () {\r\n var i = this.intensity;\r\n var ii = 1 - i;\r\n var r;\r\n var g;\r\n var b;\r\n var color = this.color;\r\n if (color && color.rgb) {\r\n r = color.rgb.r / 255 * i;\r\n g = color.rgb.g / 255 * i;\r\n b = color.rgb.b / 255 * i;\r\n }\r\n else {\r\n r = 0;\r\n g = 0;\r\n b = 0;\r\n }\r\n this.feColorMatrix.attr({ \"values\": ii + \" 0 0 0 \" + r + \" 0 \" + ii + \" 0 0 \" + g + \" 0 0 \" + ii + \" 0 \" + b + \" 0 0 0 1 0\" });\r\n };\r\n Object.defineProperty(ColorizeFilter.prototype, \"color\", {\r\n /**\r\n * @return Color\r\n */\r\n get: function () {\r\n return this.properties[\"color\"];\r\n },\r\n /**\r\n * Target color to apply to the element.\r\n *\r\n * Depending on the `intensity`, all colors of the target element will steer\r\n * towards this color.\r\n *\r\n * E.g. setting to `am4core.color(\"greener\")` will make all colors greener.\r\n *\r\n * @param value Color\r\n */\r\n set: function (value) {\r\n this.properties[\"color\"] = value;\r\n this.applyFilter();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ColorizeFilter.prototype, \"intensity\", {\r\n /**\r\n * @return Intensity (0-1)\r\n */\r\n get: function () {\r\n return this.properties.intensity;\r\n },\r\n /**\r\n * Intensity of the color (0-1).\r\n *\r\n * The bigger the number the more of a `color` target's colors will become.\r\n *\r\n * 0 means the colors will remain as they are.\r\n * 1 means all colors will become the target `color`.\r\n *\r\n * @default 1\r\n * @param value Intensity (0-1)\r\n */\r\n set: function (value) {\r\n this.properties.intensity = value;\r\n this.applyFilter();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return ColorizeFilter;\r\n}(Filter));\r\nexport { ColorizeFilter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ColorizeFilter\"] = ColorizeFilter;\r\n//# sourceMappingURL=ColorizeFilter.js.map","/**\r\n * Module for \"Desaturate\" filter.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Filter } from \"./Filter\";\r\nimport { registry } from \"../../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creats a \"Desaturate\" filter\r\n */\r\nvar DesaturateFilter = /** @class */ (function (_super) {\r\n __extends(DesaturateFilter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function DesaturateFilter() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"DesaturateFilter\";\r\n // Create elements\r\n // NOTE: we do not need to add each individual element to `_disposers`\r\n // because `filterPrimitives` has an event handler which automatically adds\r\n // anything added to it to `_disposers`\r\n _this.feColorMatrix = _this.paper.add(\"feColorMatrix\");\r\n _this.feColorMatrix.attr({ \"type\": \"saturate\" });\r\n _this.filterPrimitives.push(_this.feColorMatrix);\r\n // Set default properties\r\n _this.width = 120;\r\n _this.height = 120;\r\n _this.saturation = 0;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(DesaturateFilter.prototype, \"saturation\", {\r\n /**\r\n * @return Saturation (0-1)\r\n */\r\n get: function () {\r\n return this.properties[\"saturation\"];\r\n },\r\n /**\r\n * Saturation.\r\n *\r\n * 0 - completely desaturated.\r\n * 1 - fully saturated (gray).\r\n *\r\n * @param value Saturation (0-1)\r\n */\r\n set: function (value) {\r\n this.properties[\"saturation\"] = value;\r\n this.feColorMatrix.attr({ \"values\": value.toString() });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return DesaturateFilter;\r\n}(Filter));\r\nexport { DesaturateFilter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"DesaturateFilter\"] = DesaturateFilter;\r\n//# sourceMappingURL=DesaturateFilter.js.map","/**\r\n * Module for \"Blur\" filter.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Filter } from \"./Filter\";\r\nimport { registry } from \"../../Registry\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a \"Blur\" filter.\r\n */\r\nvar BlurFilter = /** @class */ (function (_super) {\r\n __extends(BlurFilter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function BlurFilter() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"BlurFilter\";\r\n // Create elements\r\n // NOTE: we do not need to add each individual element to `_disposers`\r\n // because `filterPrimitives` has an event handler which automatically adds\r\n // anything added to it to `_disposers`\r\n _this.feGaussianBlur = _this.paper.add(\"feGaussianBlur\");\r\n _this.feGaussianBlur.attr({ \"result\": \"blurOut\", \"in\": \"SourceGraphic\" });\r\n _this.filterPrimitives.push(_this.feGaussianBlur);\r\n // Set default properties\r\n _this.width = 200;\r\n _this.height = 200;\r\n _this.blur = 1.5;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(BlurFilter.prototype, \"blur\", {\r\n /**\r\n * @return Blur\r\n */\r\n get: function () {\r\n return this.properties.blur;\r\n },\r\n /**\r\n * Blur value.\r\n *\r\n * The bigger the value, the blurrier the target element will become.\r\n *\r\n * @default 1.5\r\n * @param value Blur\r\n */\r\n set: function (value) {\r\n this.properties.blur = value;\r\n this.feGaussianBlur.attr({ \"stdDeviation\": value / this.scale });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return BlurFilter;\r\n}(Filter));\r\nexport { BlurFilter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"BlurFilter\"] = BlurFilter;\r\n//# sourceMappingURL=BlurFilter.js.map","/**\r\n * Module for \"Focus\" filter.\r\n */\r\nimport { __extends } from \"tslib\";\r\nimport { Filter } from \"./Filter\";\r\nimport { InterfaceColorSet } from \"../../utils/InterfaceColorSet\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a \"Focus\" filter.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/accessibility/} more about accessibility\r\n * @see {@link https://www.amcharts.com/docs/v4/tutorials/changing-appearance-of-focused-items/} cusomizing focus appearance\r\n */\r\nvar FocusFilter = /** @class */ (function (_super) {\r\n __extends(FocusFilter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function FocusFilter() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"FocusFilter\";\r\n // Create elements\r\n // NOTE: we do not need to add each individual element to `_disposers`\r\n // because `filterPrimitives` has an event handler which automatically adds\r\n // anything added to it to `_disposers`\r\n _this.feFlood = _this.paper.add(\"feFlood\");\r\n _this.feFlood.attr({ \"flood-color\": new InterfaceColorSet().getFor(\"primaryButtonHover\"), \"result\": \"base\" });\r\n _this.filterPrimitives.push(_this.feFlood);\r\n _this.feMorphology = _this.paper.add(\"feMorphology\");\r\n _this.feMorphology.attr({ \"result\": \"bigger\", \"in\": \"SourceGraphic\", \"operator\": \"dilate\", \"radius\": \"2\" });\r\n _this.filterPrimitives.push(_this.feMorphology);\r\n _this.feColorMatrix = _this.paper.add(\"feColorMatrix\");\r\n _this.feColorMatrix.attr({ \"result\": \"mask\", \"in\": \"bigger\", \"type\": \"matrix\", \"values\": \"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0\" });\r\n _this.filterPrimitives.push(_this.feColorMatrix);\r\n _this.feComposite = _this.paper.add(\"feComposite\");\r\n _this.feComposite.attr({ \"result\": \"drop\", \"in\": \"base\", \"in2\": \"mask\", \"operator\": \"in\" });\r\n _this.filterPrimitives.push(_this.feComposite);\r\n _this.feBlend = _this.paper.add(\"feBlend\");\r\n _this.feBlend.attr({ \"in\": \"SourceGraphic\", \"in2\": \"drop\", \"mode\": \"normal\" });\r\n _this.filterPrimitives.push(_this.feBlend);\r\n // Set default properties\r\n _this.width = 130;\r\n _this.height = 130;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(FocusFilter.prototype, \"stroke\", {\r\n /**\r\n * @return Color\r\n */\r\n get: function () {\r\n return this.properties[\"stroke\"];\r\n },\r\n /**\r\n * Stroke (outline) color.\r\n *\r\n * @param value Color\r\n */\r\n set: function (value) {\r\n this.properties[\"stroke\"] = value;\r\n this.feFlood.attr({ \"flood-color\": value });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(FocusFilter.prototype, \"strokeWidth\", {\r\n /**\r\n * @return Outline thickness (px)\r\n */\r\n get: function () {\r\n return this.properties[\"strokeWidth\"];\r\n },\r\n /**\r\n * Stroke (outline) thickness in pixels.\r\n *\r\n * @param value Outline thickness (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"strokeWidth\"] = value;\r\n this.feMorphology.attr({ \"radius\": value });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(FocusFilter.prototype, \"opacity\", {\r\n /**\r\n * @return Outline opacity (0-1)\r\n */\r\n get: function () {\r\n return this.properties[\"opacity\"];\r\n },\r\n /**\r\n * Opacity of the outline. (0-1)\r\n *\r\n * @param value Outline opacity (0-1)\r\n */\r\n set: function (value) {\r\n this.properties[\"opacity\"] = value;\r\n this.feColorMatrix.attr({ \"values\": \"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \" + value + \" 0\" });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets filter's target element.\r\n *\r\n * In addition it also disables built-in focus outline on element this\r\n * filter is applied to.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Element filter is being attached to\r\n */\r\n FocusFilter.prototype.setSprite = function (value) {\r\n if (this._sprite && this._sprite != value) {\r\n this._sprite.group.removeStyle(\"outline\");\r\n }\r\n value.group.addStyle({\r\n \"outline\": \"none\"\r\n });\r\n _super.prototype.setSprite.call(this, value);\r\n };\r\n return FocusFilter;\r\n}(Filter));\r\nexport { FocusFilter };\r\n//# sourceMappingURL=FocusFilter.js.map","/**\r\n * This module contains ColorSet object definition\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../Base\";\r\nimport { Color, color } from \"./Color\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $colors from \"./Colors\";\r\nimport * as $type from \"./Type\";\r\nimport * as $utils from \"./Utils\";\r\nimport * as $math from \"./Math\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Represents a set of colors. Can also generate colors according to set rules.\r\n *\r\n * @important\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/colors/} for color-related info\r\n */\r\nvar ColorSet = /** @class */ (function (_super) {\r\n __extends(ColorSet, _super);\r\n /**\r\n * Constructor\r\n */\r\n function ColorSet() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Holds the list of the colors in this set. (preset or auto-generated)\r\n */\r\n _this._list = [];\r\n /**\r\n * Current step in a color generator's cycle.\r\n */\r\n _this._currentStep = 0;\r\n /**\r\n * If set to non-zero value, the ColorSet will start iterating colors from\r\n * that particular index, not the first color in the list.\r\n */\r\n _this._startIndex = 0;\r\n /**\r\n * Current pass in the color generator's cycle. Normally a generator would\r\n * cycle through all available hue range, then repeat it, alternating other\r\n * color properties, to generate distinctive colors.\r\n */\r\n _this._currentPass = 0;\r\n /**\r\n * A base color. If there are no colors pre-set in the color list, ColorSet\r\n * will use this color as a base when generating new ones, applying\r\n * `stepOptions` and `passOptions` to this base color.\r\n */\r\n _this.baseColor = new Color({\r\n r: 103,\r\n g: 183,\r\n b: 220\r\n });\r\n /**\r\n * Modifications to apply with each new generated color.\r\n */\r\n _this.stepOptions = {};\r\n /**\r\n * Modifications to apply on top of `stepOptions` for each \"pass\" of the\r\n * color generation.\r\n *\r\n * A \"pass\" is when ColorSet generates `minColors` number of colors.\r\n */\r\n _this.passOptions = {\r\n brighten: -0.2\r\n };\r\n /**\r\n * An index increment to use when iterating through color list.\r\n *\r\n * Default is 1, which means returning each and every color.\r\n *\r\n * Setting it to a bigger number will make ColorSet `next()` iterator skip\r\n * some colors.\r\n *\r\n * E.g. setting to 2, will return every second color in the list.\r\n *\r\n * This is useful, when the color list has colors that are too close each\r\n * other for contrast.\r\n *\r\n * However, having bigger number will mean that `next()` iterator will go\r\n * through the list quicker, and the generator will kick sooner.\r\n */\r\n _this.step = 1;\r\n /**\r\n * A number of colors to generate in one \"pass\".\r\n *\r\n * This setting can be automatically overridden, if ColorSet has a list of\r\n * pre-set colors. In such case ColorSet will generate exactly the same\r\n * number of colors with each pass as there were colors in original set.\r\n */\r\n _this.minColors = 20;\r\n /**\r\n * Do not let the \"lightness\" of generated color to fall below this\r\n * threshold.\r\n */\r\n _this.minLightness = 0.2;\r\n /**\r\n * Do not let the \"lightness\" of generated color to get above this threshold.\r\n */\r\n _this.maxLightness = 0.9;\r\n /**\r\n * Randomly shuffle generated colors.\r\n */\r\n _this.shuffle = false;\r\n /**\r\n * When colors are generated, based on `stepOptions`, each generated color\r\n * gets either lighter or darker.\r\n *\r\n * If this is set to `true`, color generator will switch to opposing spectrum\r\n * when reaching `minLightness` or `maxLightness`.\r\n *\r\n * E.g. if we start off with a red color, then gradually generate lighter\r\n * colors through rose shades, then switch back to dark red and gradually\r\n * increase the lightness of it until it reaches the starting red.\r\n *\r\n * If set to `false` it will stop there and cap lightness at whatever level\r\n * we hit `minLightness` or `maxLightness`, which may result in a number of\r\n * the same colors.\r\n */\r\n _this.wrap = true;\r\n /**\r\n * Re-use same colors in the pre-set list, when ColorSet runs out of colors,\r\n * rather than start generating new ones.\r\n */\r\n _this.reuse = false;\r\n /**\r\n * Saturation of colors. This will change saturation of all colors of color\r\n * set.\r\n *\r\n * It is recommended to set this in theme, as changing it at run time won't\r\n * make the items to redraw and change color.\r\n */\r\n _this.saturation = 1;\r\n _this.className = \"ColorSet\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(ColorSet.prototype, \"list\", {\r\n /**\r\n * Returns current list of colors.\r\n *\r\n * If there are none, a new list of colors is generated, based on various\r\n * ColorSet settings.\r\n *\r\n * @return Color list\r\n */\r\n get: function () {\r\n if (!this._list) {\r\n this.generate(this.minColors);\r\n }\r\n return this._list;\r\n },\r\n /**\r\n * Sets a list of pre-defined colors to use for the iterator.\r\n *\r\n * @param value Color list\r\n */\r\n set: function (value) {\r\n this._list = value;\r\n this.reset();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Gets reusable color.\r\n *\r\n * @param index Index of color\r\n * @return Color\r\n */\r\n ColorSet.prototype.getReusableColor = function (index) {\r\n if (this._list.length == 0) {\r\n this.generate(1);\r\n return this.list[0];\r\n }\r\n else {\r\n var tmpstep = index - (Math.floor(index / this._list.length) * this.list.length);\r\n return this.list[tmpstep];\r\n }\r\n };\r\n /**\r\n * Returns next color in the list using internal iterator counter.\r\n *\r\n * If `step` is set to something other than 1, it may return other color than\r\n * exact next one in the list.\r\n *\r\n * @return Color\r\n */\r\n ColorSet.prototype.next = function () {\r\n var color;\r\n if (this.list.length <= this._currentStep) {\r\n if (this.reuse) {\r\n color = this.getReusableColor(this._currentStep);\r\n }\r\n else {\r\n this.generate($math.max(this.minColors, this._currentStep + 1));\r\n color = this.list[this._currentStep];\r\n }\r\n }\r\n else {\r\n color = this.list[this._currentStep];\r\n }\r\n this._currentStep += this.step;\r\n return color.saturate(this.saturation);\r\n };\r\n /**\r\n * Returns a color at specific index in the list.\r\n *\r\n * @param i Index\r\n * @return Color\r\n */\r\n ColorSet.prototype.getIndex = function (i) {\r\n var color;\r\n if (this.list.length <= i) {\r\n if (this.reuse) {\r\n color = this.getReusableColor(i);\r\n }\r\n else {\r\n this.generate(this.minColors);\r\n color = this.getIndex(i);\r\n }\r\n }\r\n else {\r\n color = this.list[i];\r\n }\r\n return color.saturate(this.saturation);\r\n };\r\n /**\r\n * Resets internal iterator.\r\n *\r\n * Calling `next()` after this will return the very first color in the color\r\n * list, even if it was already returned before.\r\n */\r\n ColorSet.prototype.reset = function () {\r\n this._currentStep = this._startIndex;\r\n };\r\n Object.defineProperty(ColorSet.prototype, \"currentStep\", {\r\n /**\r\n * @return Step\r\n */\r\n get: function () {\r\n return this._currentStep;\r\n },\r\n /**\r\n * Sets current color iteration. You can use this property to skip some\r\n * colors from iteration. E.g. setting it to `10` will skip first ten\r\n * colors.\r\n *\r\n * Please note that the number is zero-based.\r\n *\r\n * @param value Step\r\n */\r\n set: function (value) {\r\n this._currentStep = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ColorSet.prototype, \"startIndex\", {\r\n /**\r\n * @return Index\r\n */\r\n get: function () {\r\n return this._startIndex;\r\n },\r\n /**\r\n * If set to non-zero value, the ColorSet will start iterating colors from\r\n * that particular index, not the first color in the list.\r\n *\r\n * @default 0\r\n * @since 4.4.9\r\n * @param value Index\r\n */\r\n set: function (value) {\r\n this._startIndex = value;\r\n this.reset();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Generates colors based on the various ColorSet settings.\r\n *\r\n * @param count Number of colors to generate\r\n */\r\n ColorSet.prototype.generate = function (count) {\r\n // Init\r\n var curColor = this.currentColor;\r\n var hsl = $colors.rgbToHsl($type.getValue(curColor.rgb));\r\n var hueStep = $type.hasValue(this.stepOptions.hue) ? this.stepOptions.hue : 1 / count;\r\n var mods = {\r\n brighten: 0,\r\n lighten: 0,\r\n hue: hsl.h,\r\n lightness: hsl.l,\r\n saturation: hsl.s\r\n };\r\n // Generate list of hues, and shuffle them\r\n var hues = [];\r\n var startIndex = this.list.length == 0 ? 0 : 1;\r\n if (this.reuse) {\r\n for (var i = startIndex; i <= count; i++) {\r\n hues.push($colors.rgbToHsl($type.getValue(this._list[i].rgb)).h);\r\n }\r\n }\r\n else {\r\n for (var i = startIndex; i <= count; i++) {\r\n var h = hsl.h + hueStep * i;\r\n if (this.wrap && (h > 1)) {\r\n h -= 1;\r\n }\r\n hues.push(h);\r\n }\r\n }\r\n // Shuffle colors randomly\r\n if (this.shuffle) {\r\n hues.sort(function (a, b) {\r\n return Math.random() - 0.5;\r\n });\r\n }\r\n // Generate colors by rotating hue\r\n for (var i = 0; i < count; i++) {\r\n // Update hue\r\n if (this.reuse) {\r\n hsl = $colors.rgbToHsl($type.getValue(this._list[i].rgb));\r\n }\r\n else {\r\n hsl.h = hues.shift();\r\n }\r\n // Apply HSL mods\r\n this.applyStepOptions(hsl, mods, i, this._currentPass);\r\n // Convert back to Color\r\n var c = color($colors.hslToRgb(hsl));\r\n // Apply regular color mods\r\n var brighten = (this.stepOptions.brighten || 0) * i + (this.passOptions.brighten || 0) * this._currentPass;\r\n if (brighten != 0) {\r\n if (this.wrap) {\r\n brighten = $utils.fitNumberRelative(brighten, this.minLightness, this.maxLightness);\r\n }\r\n else {\r\n brighten = $utils.fitNumber(brighten, this.minLightness, this.maxLightness);\r\n }\r\n c = c.brighten(brighten);\r\n }\r\n var lighten = (this.stepOptions.lighten || 0) * i + (this.passOptions.lighten || 0) * this._currentPass;\r\n if (lighten != 0) {\r\n if (this.wrap) {\r\n lighten = $utils.fitNumberRelative(lighten, this.minLightness, this.maxLightness);\r\n }\r\n else {\r\n lighten = $utils.fitNumber(lighten, this.minLightness, this.maxLightness);\r\n }\r\n c = c.lighten(lighten);\r\n }\r\n this._list.push(c);\r\n }\r\n this._currentPass++;\r\n };\r\n Object.defineProperty(ColorSet.prototype, \"currentColor\", {\r\n /**\r\n * Returns current last color. It's either the last color in the list of\r\n * colors, or `baseColor` if list is empty.\r\n *\r\n * @return Color\r\n */\r\n get: function () {\r\n if (this._list.length == 0) {\r\n return this.baseColor.saturate(this.saturation);\r\n }\r\n else {\r\n return this._list[this._list.length - 1].saturate(this.saturation);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Generates modifiers for color, based on what step and pass.\r\n *\r\n * @param hsl Curren HSL value of the color to modify\r\n * @param base The modifiers that were before modification to use as a base\r\n * @param step Current step\r\n * @param pass Current pass\r\n */\r\n ColorSet.prototype.applyStepOptions = function (hsl, base, step, pass) {\r\n // Process lightness\r\n hsl.l = base.lightness + (this.stepOptions.lightness || 0) * step + (this.passOptions.lightness || 0) * pass;\r\n if (this.wrap) {\r\n if (hsl.l > 1) {\r\n hsl.l = hsl.l - Math.floor(hsl.l);\r\n }\r\n else if (hsl.l < 0) {\r\n hsl.l = -(hsl.l - Math.floor(hsl.l));\r\n }\r\n hsl.l = $utils.fitNumberRelative(hsl.l, this.minLightness, this.maxLightness);\r\n }\r\n else {\r\n if (hsl.l > 1) {\r\n hsl.l = 1;\r\n }\r\n else if (hsl.l < 0) {\r\n hsl.l = 0;\r\n }\r\n hsl.l = $utils.fitNumber(hsl.l, this.minLightness, this.maxLightness);\r\n }\r\n };\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n ColorSet.prototype.processConfig = function (config) {\r\n if (config) {\r\n // Cast colors\r\n if ($type.hasValue(config.list) && $type.isArray(config.list)) {\r\n for (var i = 0, len = config.list.length; i < len; i++) {\r\n if (!(config.list[i] instanceof Color)) {\r\n config.list[i] = color(config.list[i]);\r\n }\r\n }\r\n }\r\n if ($type.hasValue(config.baseColor) && !(config.baseColor instanceof Color)) {\r\n config.baseColor = color(config.baseColor);\r\n }\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n return ColorSet;\r\n}(BaseObject));\r\nexport { ColorSet };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ColorSet\"] = ColorSet;\r\n//# sourceMappingURL=ColorSet.js.map","/**\r\n * This module contains PatternSet object definition\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../Base\";\r\nimport { Color } from \"./Color\";\r\nimport { InterfaceColorSet } from \"./InterfaceColorSet\";\r\nimport { LinePattern } from \"../rendering/fills/LinePattern\";\r\nimport { RectPattern } from \"../rendering/fills/RectPattern\";\r\nimport { CirclePattern } from \"../rendering/fills/CirclePattern\";\r\nimport { registry } from \"../Registry\";\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines an interable list of distinctive patterns that can be used in\r\n * conjunction to colors to generate various fill patterns.\r\n *\r\n * @important\r\n * @since 4.7.5\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/colors/} for color-related info\r\n */\r\nvar PatternSet = /** @class */ (function (_super) {\r\n __extends(PatternSet, _super);\r\n /**\r\n * Constructor\r\n */\r\n function PatternSet() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Holds the list of the colors in this set. (preset or auto-generated)\r\n */\r\n _this._list = [];\r\n /**\r\n * Current step.\r\n */\r\n _this._currentStep = 0;\r\n /**\r\n * If set to non-zero value, the PatternSet will start iterating patterns from\r\n * that particular index, not the first pattern in the list.\r\n */\r\n _this._startIndex = 0;\r\n /**\r\n * Current pass in cycle. Once all patterns in the list are iterated,\r\n * iteration restarts from beginning and currentPass is incremented.\r\n */\r\n _this._currentPass = 0;\r\n /**\r\n * A base color. If there are no colors pre-set in the color list, ColorSet\r\n * will use this color as a base when generating new ones, applying\r\n * `stepOptions` and `passOptions` to this base color.\r\n */\r\n _this.baseColor = new Color({\r\n r: 103,\r\n g: 183,\r\n b: 220\r\n });\r\n _this.className = \"PatternSet\";\r\n // Set base color to be used for pattern elements\r\n var interfaceColors = new InterfaceColorSet();\r\n // Set default patterns\r\n _this.list = [\r\n _this.getLinePattern(1000, 45, 1, 6),\r\n _this.getRectPattern(10, 0, 4),\r\n _this.getLinePattern(1000, -45, 1, 6),\r\n _this.getCirclePattern(11, 2, true),\r\n _this.getLinePattern(6, 90, 1),\r\n _this.getRectPattern(12, 45, 6, true),\r\n _this.getLinePattern(6, 0, 1),\r\n _this.getRectPattern(7, 0, 4),\r\n _this.getLinePattern(1000, 45, 2, 3, \"4,2\"),\r\n _this.getCirclePattern(9, 3, false),\r\n _this.getLinePattern(1000, -45, 2, 3, \"4,2\"),\r\n _this.getRectPattern(10, 45, Math.sqrt(50)),\r\n _this.getLinePattern(1000, -45, 2, 1),\r\n _this.getRectPattern(10, 0, 9),\r\n _this.getLinePattern(1000, 45, 2, 1),\r\n _this.getLinePattern(1000, 0, 3, 1),\r\n _this.getRectPattern(10, 45, 10),\r\n _this.getLinePattern(1000, 90, 3, 1)\r\n ];\r\n _this.baseColor = interfaceColors.getFor(\"stroke\");\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n PatternSet.prototype.getLinePattern = function (size, rotation, thickness, gap, strokeDashArray) {\r\n var pattern = new LinePattern();\r\n pattern.width = size;\r\n pattern.height = size;\r\n pattern.stroke = this.baseColor;\r\n pattern.gap = gap;\r\n pattern.strokeDasharray = strokeDashArray;\r\n pattern.strokeWidth = thickness;\r\n pattern.rotation = rotation;\r\n return pattern;\r\n };\r\n PatternSet.prototype.getRectPattern = function (size, rotation, thickness, outline) {\r\n var pattern = new RectPattern();\r\n pattern.width = size;\r\n pattern.height = size;\r\n pattern.rectWidth = thickness;\r\n pattern.rectHeight = thickness;\r\n if (outline) {\r\n pattern.stroke = this.baseColor;\r\n pattern.strokeWidth = 1;\r\n pattern.fillOpacity = 0;\r\n }\r\n else {\r\n pattern.fill = this.baseColor;\r\n pattern.strokeWidth = 0;\r\n }\r\n if (rotation != 0) {\r\n pattern.shapeRendering = \"auto\";\r\n }\r\n pattern.rotation = rotation;\r\n return pattern;\r\n };\r\n PatternSet.prototype.getCirclePattern = function (size, radius, outline) {\r\n var pattern = new CirclePattern();\r\n pattern.width = size;\r\n pattern.height = size;\r\n pattern.shapeRendering = \"auto\";\r\n pattern.radius = radius;\r\n if (outline) {\r\n pattern.stroke = this.baseColor;\r\n pattern.strokeWidth = 1;\r\n pattern.fillOpacity = 0;\r\n }\r\n else {\r\n pattern.fill = this.baseColor;\r\n pattern.strokeWidth = 0;\r\n }\r\n return pattern;\r\n };\r\n Object.defineProperty(PatternSet.prototype, \"list\", {\r\n /**\r\n * @return Pattern list\r\n */\r\n get: function () {\r\n return this._list;\r\n },\r\n /**\r\n * List of pre-defined patterns to be used in set.\r\n *\r\n * @param value Pattern list\r\n */\r\n set: function (value) {\r\n this._list = value;\r\n this.reset();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns the next pattern in list.\r\n *\r\n * @return Pattern\r\n */\r\n PatternSet.prototype.next = function () {\r\n var pattern = this.getIndex(this.currentStep);\r\n this._currentStep++;\r\n return pattern;\r\n };\r\n /**\r\n * Returns a color at specific index in the list.\r\n *\r\n * @param i Index\r\n * @return Pattern\r\n */\r\n PatternSet.prototype.getIndex = function (i) {\r\n var pattern;\r\n while (this.list.length <= i) {\r\n this.generatePatterns();\r\n }\r\n pattern = this.list[i];\r\n return pattern.clone();\r\n };\r\n /**\r\n * Generates a new set of patterns.\r\n */\r\n PatternSet.prototype.generatePatterns = function () {\r\n var count = this.list.length / (this._currentPass + 1);\r\n this._currentPass++;\r\n for (var i = 0; i < count; i++) {\r\n this.list.push(this.list[i].clone());\r\n }\r\n };\r\n /**\r\n * Resets internal iterator.\r\n *\r\n * Calling `next()` after this will return the very first color in the color\r\n * list, even if it was already returned before.\r\n */\r\n PatternSet.prototype.reset = function () {\r\n this._currentStep = this._startIndex;\r\n };\r\n Object.defineProperty(PatternSet.prototype, \"currentStep\", {\r\n /**\r\n * @return Step\r\n */\r\n get: function () {\r\n return this._currentStep;\r\n },\r\n /**\r\n * Sets current color iteration. You can use this property to skip some\r\n * colors from iteration. E.g. setting it to `10` will skip first ten\r\n * colors.\r\n *\r\n * Please note that the number is zero-based.\r\n *\r\n * @param value Step\r\n */\r\n set: function (value) {\r\n this._currentStep = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(PatternSet.prototype, \"startIndex\", {\r\n /**\r\n * @return Index\r\n */\r\n get: function () {\r\n return this._startIndex;\r\n },\r\n /**\r\n * If set to non-zero value, the ColorSet will start iterating colors from\r\n * that particular index, not the first color in the list.\r\n *\r\n * @default 0\r\n * @param value Index\r\n */\r\n set: function (value) {\r\n this._startIndex = value;\r\n this.reset();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n PatternSet.prototype.processConfig = function (config) {\r\n // if (config) {\r\n // \t// Set up axis ranges\r\n // \tif ($type.hasValue(config.list) && $type.isArray(config.list)) {\r\n // \t\tfor (let i = 0, len = config.list.length; i < len; i++) {\r\n // \t\t\tif (!(config.list[i] instanceof Color)) {\r\n // \t\t\t\tconfig.list[i] = color(config.list[i]);\r\n // \t\t\t}\r\n // \t\t}\r\n // \t}\r\n // }\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n return PatternSet;\r\n}(BaseObject));\r\nexport { PatternSet };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"PatternSet\"] = PatternSet;\r\n//# sourceMappingURL=PatternSet.js.map","/**\r\n * A plugin base class.\r\n */\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * This is a base class that provides core functionality for plugins.\r\n *\r\n * The easiest way to start off with a new plugin is to extend this class.\r\n *\r\n * It will provide all the mandatory functionality, such as disposers.\r\n *\r\n * @since 4.2.2\r\n */\r\nvar Plugin = /** @class */ (function () {\r\n /**\r\n * Constructor\r\n */\r\n function Plugin() {\r\n /**\r\n * Is this object disposed?\r\n */\r\n this._disposed = false;\r\n /**\r\n * List of IDisposer which will be disposed when the BaseObject is disposed.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this._disposers = [];\r\n // Nothing to do here\r\n }\r\n /**\r\n * Decorates series with required events and adapters used to hijack its\r\n * data.\r\n */\r\n Plugin.prototype.init = function () {\r\n // Does nothing\r\n // Override it\r\n };\r\n /**\r\n * Returns if this element is already disposed.\r\n *\r\n * @return Is disposed?\r\n */\r\n Plugin.prototype.isDisposed = function () {\r\n return this._disposed;\r\n };\r\n /**\r\n * Disposes this object and related stuff.\r\n */\r\n Plugin.prototype.dispose = function () {\r\n if (!this._disposed) {\r\n this._disposed = true;\r\n var a = this._disposers;\r\n this._disposers = null;\r\n while (a.length !== 0) {\r\n var disposer = a.shift();\r\n disposer.dispose();\r\n }\r\n }\r\n };\r\n return Plugin;\r\n}());\r\nexport { Plugin };\r\n//# sourceMappingURL=Plugin.js.map","/**\r\n * AmChartsLogo module.\r\n *\r\n * AmChartsLogo shows amCharts logo for non-commercial users of a library.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../Container\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { Polyspline } from \"./Polyspline\";\r\nimport { color } from \"../utils/Color\";\r\nimport { LinearGradient } from \"../rendering/fills/LinearGradient\";\r\nimport { DesaturateFilter } from \"../rendering/filters/DesaturateFilter\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A class used to draw and display progress indicator.\r\n *\r\n * @see {@link IAmChartsLogoEvents} for a list of available events\r\n * @see {@link IAmChartsLogoAdapters} for a list of available Adapters\r\n * @ignore Exclude from docs\r\n */\r\nvar AmChartsLogo = /** @class */ (function (_super) {\r\n __extends(AmChartsLogo, _super);\r\n /**\r\n * Constructor\r\n */\r\n function AmChartsLogo() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"AmChartsLogo\";\r\n _this.valign = \"bottom\";\r\n var d = 0.3;\r\n _this.opacity = 0.3;\r\n _this.defaultState.properties.opacity = 0.4;\r\n _this.url = \"https://www.amcharts.com/\";\r\n _this.urlTarget = \"_blank\";\r\n _this.showSystemTooltip = true;\r\n _this.readerTitle = \"Chart created using amCharts library\";\r\n _this.width = 220 * d;\r\n _this.height = 70 * d;\r\n _this.background.opacity = 0;\r\n var aColor = color(\"#474758\");\r\n if (new InterfaceColorSet().getFor(\"background\").alternative.hex == \"#ffffff\") {\r\n aColor = color(\"#ffffff\");\r\n }\r\n var aGradient = new LinearGradient();\r\n aGradient.addColor(aColor);\r\n aGradient.addColor(aColor, 1, 0.75);\r\n aGradient.addColor(color(\"#3cabff\"), 1, 0.755);\r\n aGradient.rotation = -10;\r\n var aStroke = aGradient;\r\n var m = _this.createChild(Polyspline);\r\n m.shouldClone = false;\r\n m.isMeasured = false;\r\n m.segments = [[{ x: 50 * d, y: 50 * d }, { x: 90 * d, y: 50 * d }, { x: 120 * d, y: 20 * d }, { x: 135 * d, y: 35 * d }, { x: 150 * d, y: 20 * d }, { x: 180 * d, y: 50 * d }, { x: 200 * d, y: 50 * d }]];\r\n m.strokeWidth = 6 * d;\r\n m.tensionX = 0.8;\r\n m.tensionY = 1;\r\n m.stroke = color(\"#3cabff\");\r\n var a = _this.createChild(Polyspline);\r\n a.shouldClone = false;\r\n a.isMeasured = false;\r\n a.segments = [[{ x: 20 * d, y: 50 * d }, { x: 50 * d, y: 50 * d }, { x: 90 * d, y: 12 * d }, { x: 133 * d, y: 50 * d }, { x: 170 * d, y: 50 * d }, { x: 200 * d, y: 50 * d }]];\r\n a.strokeWidth = 6 * d;\r\n a.tensionX = 0.75;\r\n a.tensionY = 1;\r\n a.stroke = aStroke;\r\n _this._disposers.push(a);\r\n var desaturateFilter = new DesaturateFilter();\r\n _this.filters.push(desaturateFilter);\r\n var desaturateFilterHover = new DesaturateFilter();\r\n desaturateFilterHover.saturation = 1;\r\n var hoverState = _this.states.create(\"hover\");\r\n hoverState.properties.opacity = 1;\r\n hoverState.filters.push(desaturateFilterHover);\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n return AmChartsLogo;\r\n}(Container));\r\nexport { AmChartsLogo };\r\n//# sourceMappingURL=AmChartsLogo.js.map","/**\r\n * Legend-related functionality.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Component } from \"../core/Component\";\r\nimport { DataItem } from \"../core/DataItem\";\r\nimport { ListTemplate, ListDisposer } from \"../core/utils/List\";\r\nimport { RoundedRectangle } from \"../core/elements/RoundedRectangle\";\r\nimport { Container } from \"../core/Container\";\r\nimport { Label } from \"../core/elements/Label\";\r\nimport { keyboard } from \"../core/utils/Keyboard\";\r\nimport { registry } from \"../core/Registry\";\r\nimport { getInteraction } from \"../core/interaction/Interaction\";\r\nimport { percent, Percent } from \"../core/utils/Percent\";\r\nimport { InterfaceColorSet } from \"../core/utils/InterfaceColorSet\";\r\nimport * as $utils from \"../core/utils/Utils\";\r\nimport * as $type from \"../core/utils/Type\";\r\nimport * as $math from \"../core/utils/Math\";\r\nimport { Sprite } from \"../core/Sprite\";\r\nimport { Disposer } from \"../core/utils/Disposer\";\r\nimport { MouseCursorStyle } from \"../core/interaction/Mouse\";\r\nimport { defaultRules, ResponsiveBreakpoints } from \"../core/utils/Responsive\";\r\nimport { Scrollbar } from \"../core/elements/Scrollbar\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a [[DataItem]] for [[Legend]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nvar LegendDataItem = /** @class */ (function (_super) {\r\n __extends(LegendDataItem, _super);\r\n /**\r\n * Constructor\r\n */\r\n function LegendDataItem() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * @ignore\r\n */\r\n _this.childrenCreated = false;\r\n _this.className = \"LegendDataItem\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(LegendDataItem.prototype, \"label\", {\r\n /**\r\n * A legend item's [[Label]] element.\r\n *\r\n * @return Label\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._label) {\r\n var label_1 = this.component.labels.create();\r\n this._label = label_1;\r\n this.addSprite(label_1);\r\n this._disposers.push(label_1);\r\n label_1.parent = this.itemContainer;\r\n this._disposers.push(new Disposer(function () {\r\n if ($type.hasValue(_this.component)) {\r\n _this.component.labels.removeValue(label_1);\r\n }\r\n }));\r\n }\r\n return this._label;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(LegendDataItem.prototype, \"color\", {\r\n /**\r\n * @return Main color\r\n */\r\n get: function () {\r\n return this.properties.color;\r\n },\r\n /**\r\n * Main color of legend data item.\r\n *\r\n * This is set by the target element this legend item represents, like\r\n * a Series or a Slice.\r\n *\r\n * It can be used to derive a color in legend's sub-items, like label:\r\n *\r\n * ```TypeScript\r\n * chart.legend.labels.template.text = \"[{color}]{name}[/]\";\r\n * ```\r\n * ```JavaScript\r\n * chart.legend.labels.template.text = \"[{color}]{name}[/]\";\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"legend\": {\r\n * // ...\r\n * \"labels\": {\r\n * \"text\": \"[{color}]{name}[/]\"\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/legend/#Legend_labels} For more information about configuring legend labels.\r\n * @param value Main color\r\n */\r\n set: function (value) {\r\n this.setProperty(\"color\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(LegendDataItem.prototype, \"valueLabel\", {\r\n /**\r\n * A legend item's [[Label]] element for \"value label\".\r\n *\r\n * @return Label\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._valueLabel) {\r\n var valueLabel_1 = this.component.valueLabels.create();\r\n this._valueLabel = valueLabel_1;\r\n this.addSprite(valueLabel_1);\r\n this._disposers.push(valueLabel_1);\r\n valueLabel_1.parent = this.itemContainer;\r\n this._disposers.push(new Disposer(function () {\r\n if ($type.hasValue(_this.component)) {\r\n _this.component.valueLabels.removeValue(valueLabel_1);\r\n }\r\n }));\r\n }\r\n return this._valueLabel;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(LegendDataItem.prototype, \"itemContainer\", {\r\n /**\r\n * A reference to the main [[Container]] that holds legend item's elements:\r\n * marker and labels.\r\n *\r\n * @return Item container\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._itemContainer) {\r\n var component_1 = this.component;\r\n var itemContainer_1 = component_1.itemContainers.create();\r\n itemContainer_1.parent = component_1;\r\n this._itemContainer = itemContainer_1;\r\n this.addSprite(itemContainer_1);\r\n this._disposers.push(itemContainer_1);\r\n // Add click/tap event to toggle item\r\n if (itemContainer_1.togglable) {\r\n itemContainer_1.events.on(\"toggled\", function (ev) {\r\n component_1.toggleDataItem(ev.target.dataItem);\r\n }, undefined, false);\r\n }\r\n // Add focus event so that we can track which object is currently in focus\r\n // for keyboard toggling\r\n if (itemContainer_1.focusable) {\r\n itemContainer_1.events.on(\"hit\", function (ev) {\r\n // We need this here in order to reset focused item when it is clicked\r\n // normally so that it is not toggled by ENTER afterwards\r\n component_1.focusedItem = undefined;\r\n }, undefined, false);\r\n itemContainer_1.events.on(\"focus\", function (ev) {\r\n component_1.focusedItem = ev.target.dataItem;\r\n }, undefined, false);\r\n itemContainer_1.events.on(\"blur\", function (ev) {\r\n component_1.focusedItem = undefined;\r\n }, undefined, false);\r\n }\r\n this._disposers.push(new Disposer(function () {\r\n if ($type.hasValue(_this.component)) {\r\n _this.component.itemContainers.removeValue(itemContainer_1);\r\n }\r\n }));\r\n if (this.dataContext.uidAttr) {\r\n itemContainer_1.readerControls = this.dataContext.uidAttr();\r\n itemContainer_1.readerLabelledBy = this.dataContext.uidAttr();\r\n }\r\n var sprite = this.dataContext;\r\n if ((sprite instanceof DataItem || sprite instanceof Sprite) && !sprite.isDisposed()) {\r\n var visibilitychanged = function (ev) {\r\n itemContainer_1.readerChecked = ev.visible;\r\n itemContainer_1.events.disableType(\"toggled\");\r\n itemContainer_1.isActive = !ev.visible;\r\n itemContainer_1.events.enableType(\"toggled\");\r\n };\r\n sprite.addDisposer(new Disposer(function () {\r\n if (_this.component) {\r\n _this.component.dataItems.remove(_this);\r\n }\r\n }));\r\n if (sprite instanceof Sprite) {\r\n itemContainer_1.addDisposer(sprite.events.on(\"visibilitychanged\", visibilitychanged, undefined, false));\r\n itemContainer_1.addDisposer(sprite.events.on(\"hidden\", function (ev) {\r\n itemContainer_1.readerChecked = false;\r\n itemContainer_1.events.disableType(\"toggled\");\r\n itemContainer_1.isActive = true;\r\n itemContainer_1.events.enableType(\"toggled\");\r\n }, undefined, false));\r\n itemContainer_1.addDisposer(sprite.events.on(\"shown\", function (ev) {\r\n itemContainer_1.readerChecked = true;\r\n itemContainer_1.events.disableType(\"toggled\");\r\n itemContainer_1.isActive = false;\r\n itemContainer_1.events.enableType(\"toggled\");\r\n }, undefined, false));\r\n }\r\n else {\r\n itemContainer_1.addDisposer(sprite.events.on(\"visibilitychanged\", visibilitychanged, undefined, false));\r\n }\r\n }\r\n }\r\n return this._itemContainer;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(LegendDataItem.prototype, \"marker\", {\r\n /**\r\n * A [[Container]] that holds legend item's marker element.\r\n *\r\n * @return Marker\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._marker) {\r\n var marker_1 = this.component.markers.create();\r\n this._marker = marker_1;\r\n marker_1.parent = this.itemContainer;\r\n this.addSprite(marker_1);\r\n this._disposers.push(marker_1);\r\n this._disposers.push(new Disposer(function () {\r\n if ($type.hasValue(_this.component)) {\r\n _this.component.markers.removeValue(marker_1);\r\n }\r\n }));\r\n }\r\n return this._marker;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return LegendDataItem;\r\n}(DataItem));\r\nexport { LegendDataItem };\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a class that carries legend settings.\r\n *\r\n * A legend might change its settings dynamically. Legend can also be shared\r\n * by several elements, requiring different settings.\r\n *\r\n * Having legend's settings in a separate object is a good way to \"hot swap\"\r\n * a set of settings for the legend.\r\n */\r\nvar LegendSettings = /** @class */ (function () {\r\n function LegendSettings() {\r\n /**\r\n * Should marker be created for each legend item.\r\n */\r\n this.createMarker = true;\r\n }\r\n return LegendSettings;\r\n}());\r\nexport { LegendSettings };\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * [[Legend]] class is used to create legend for the chart.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/legend/} for Legend documentation\r\n * @see {@link ILegendEvents} for a list of available events\r\n * @see {@link ILegendAdapters} for a list of available Adapters\r\n */\r\nvar Legend = /** @class */ (function (_super) {\r\n __extends(Legend, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Legend() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Legend\";\r\n // Set defaults\r\n _this.layout = \"grid\";\r\n _this.setPropertyValue(\"useDefaultMarker\", false);\r\n _this.setPropertyValue(\"scrollable\", false);\r\n _this.setPropertyValue(\"contentAlign\", \"center\");\r\n // Create a template container and list for legend items\r\n var itemContainer = new Container();\r\n itemContainer.applyOnClones = true;\r\n itemContainer.padding(8, 0, 8, 0);\r\n itemContainer.margin(0, 10, 0, 10);\r\n itemContainer.layout = \"horizontal\";\r\n itemContainer.clickable = true;\r\n itemContainer.focusable = true;\r\n itemContainer.role = \"switch\";\r\n itemContainer.togglable = true;\r\n itemContainer.cursorOverStyle = MouseCursorStyle.pointer;\r\n itemContainer.background.fillOpacity = 0; // creates hit area\r\n // Create container list using item template we just created\r\n _this.itemContainers = new ListTemplate(itemContainer);\r\n _this._disposers.push(new ListDisposer(_this.itemContainers));\r\n _this._disposers.push(_this.itemContainers.template);\r\n // Set up global keyboard events for toggling elements\r\n _this._disposers.push(getInteraction().body.events.on(\"keyup\", function (ev) {\r\n if (keyboard.isKey(ev.event, \"enter\") && _this.focusedItem) {\r\n var focusedItem = _this.focusedItem;\r\n var target = focusedItem.itemContainer;\r\n if (target.togglable) {\r\n _this.toggleDataItem(focusedItem);\r\n }\r\n else if (target.clickable && target.events.isEnabled(\"hit\")) {\r\n target.dispatchImmediately(\"hit\", { event: ev });\r\n // We need this here because \"hit\" event resets `this.focusedItem`\r\n // And we need it here\r\n _this.focusedItem = focusedItem;\r\n }\r\n }\r\n }, _this));\r\n var interfaceColors = new InterfaceColorSet();\r\n // Create a template container and list for the a marker\r\n var marker = new Container();\r\n marker.width = 23;\r\n marker.height = 23;\r\n marker.interactionsEnabled = false;\r\n marker.applyOnClones = true;\r\n marker.setStateOnChildren = true;\r\n marker.background.fillOpacity = 0;\r\n marker.background.strokeOpacity = 0;\r\n marker.propertyFields.fill = \"fill\";\r\n marker.valign = \"middle\";\r\n var disabledColor = interfaceColors.getFor(\"disabledBackground\");\r\n marker.events.on(\"childadded\", function (event) {\r\n var child = event.newValue;\r\n var activeState = child.states.create(\"active\");\r\n activeState.properties.stroke = disabledColor;\r\n activeState.properties.fill = disabledColor;\r\n });\r\n _this.markers = new ListTemplate(marker);\r\n _this._disposers.push(new ListDisposer(_this.markers));\r\n _this._disposers.push(_this.markers.template);\r\n // Create a legend background element\r\n var rectangle = marker.createChild(RoundedRectangle);\r\n rectangle.width = percent(100);\r\n rectangle.height = percent(100);\r\n rectangle.applyOnClones = true;\r\n rectangle.propertyFields.fill = \"fill\"; //othrwise old edge doesn't like as the same pattern is set both on parent and child https://codepen.io/team/amcharts/pen/72d7a98f3fb811d3118795220ff63182\r\n rectangle.strokeOpacity = 0;\r\n // Create a template container and list for item labels\r\n var label = new Label();\r\n label.text = \"{name}\";\r\n label.margin(0, 5, 0, 5);\r\n label.valign = \"middle\";\r\n label.applyOnClones = true;\r\n label.states.create(\"active\").properties.fill = interfaceColors.getFor(\"disabledBackground\");\r\n _this.labels = new ListTemplate(label);\r\n _this._disposers.push(new ListDisposer(_this.labels));\r\n _this._disposers.push(_this.labels.template);\r\n label.interactionsEnabled = false;\r\n label.truncate = true;\r\n label.fullWords = false;\r\n // Create a template container and list for item value labels\r\n var valueLabel = new Label();\r\n valueLabel.margin(0, 5, 0, 0);\r\n valueLabel.valign = \"middle\";\r\n valueLabel.width = 50; // to avoid rearranging legend entries when value changes.\r\n valueLabel.align = \"right\";\r\n valueLabel.textAlign = \"end\";\r\n valueLabel.applyOnClones = true;\r\n valueLabel.states.create(\"active\").properties.fill = interfaceColors.getFor(\"disabledBackground\");\r\n valueLabel.interactionsEnabled = false;\r\n _this.valueLabels = new ListTemplate(valueLabel);\r\n _this._disposers.push(new ListDisposer(_this.valueLabels));\r\n _this._disposers.push(_this.valueLabels.template);\r\n _this.position = \"bottom\"; // don't use setPropertyValue here!\r\n // Create a state for disabled legend items\r\n itemContainer.states.create(\"active\");\r\n itemContainer.setStateOnChildren = true;\r\n // Apply accessibility settings\r\n _this.role = \"group\";\r\n _this.events.on(\"layoutvalidated\", _this.handleScrollbar, _this, false);\r\n _this.events.on(\"parentset\", function () {\r\n var parent = _this.parent;\r\n if (parent) {\r\n _this._disposers.push(parent.events.on(\"maxsizechanged\", function () {\r\n if (_this.scrollable) {\r\n _this.setTimeout(function () {\r\n _this.updateMasks();\r\n _this.handleScrollbar();\r\n _this._handleWheelReal(1);\r\n }, 100);\r\n }\r\n }));\r\n }\r\n });\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Sets defaults that instantiate some objects that rely on parent, so they\r\n * cannot be set in constructor.\r\n */\r\n Legend.prototype.applyInternalDefaults = function () {\r\n _super.prototype.applyInternalDefaults.call(this);\r\n if (!$type.hasValue(this.readerTitle)) {\r\n this.readerTitle = this.language.translate(\"Legend\");\r\n }\r\n };\r\n /**\r\n * Returns a new/empty DataItem of the type appropriate for this object.\r\n *\r\n * @see {@link DataItem}\r\n * @return Data Item\r\n */\r\n Legend.prototype.createDataItem = function () {\r\n return new LegendDataItem();\r\n };\r\n /**\r\n * [validateDataElements description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n Legend.prototype.validateDataElements = function () {\r\n if (this.scrollbar) {\r\n this.scrollbar.start = 0;\r\n this.scrollbar.end = 1;\r\n }\r\n _super.prototype.validateDataElements.call(this);\r\n };\r\n /**\r\n * [validateDataElement description]\r\n *\r\n * @ignore Exclude from docs\r\n * @param dataItem Data item\r\n * @todo Description\r\n * @todo Figure out how to update appearance of legend item without losing focus\r\n * @todo Update legend marker appearance as apperance of related series changes\r\n */\r\n Legend.prototype.validateDataElement = function (dataItem) {\r\n _super.prototype.validateDataElement.call(this, dataItem);\r\n // Get data item (legend item's) container\r\n var container = dataItem.itemContainer;\r\n var marker = dataItem.marker;\r\n $utils.used(dataItem.label);\r\n var valueLabel = dataItem.valueLabel;\r\n // Set parent and update current state\r\n container.readerChecked = dataItem.dataContext.visible;\r\n // Tell series its legend data item\r\n dataItem.dataContext.legendDataItem = dataItem;\r\n var tempMaxWidth = dataItem.label.maxWidth;\r\n if (!(dataItem.label.width instanceof Percent)) {\r\n dataItem.label.width = undefined;\r\n }\r\n if (tempMaxWidth > 0) {\r\n dataItem.label.maxWidth = tempMaxWidth;\r\n }\r\n if (valueLabel.align == \"right\") {\r\n valueLabel.width = undefined;\r\n }\r\n var legendSettings = dataItem.dataContext.legendSettings;\r\n // If we are not using default markers, create a unique legend marker based\r\n // on the data item type\r\n var dataContext = dataItem.dataContext;\r\n if (dataContext.createLegendMarker && (!this.useDefaultMarker || !(dataContext instanceof Sprite))) {\r\n if (!dataItem.childrenCreated) {\r\n dataContext.createLegendMarker(marker);\r\n dataItem.childrenCreated = true;\r\n }\r\n }\r\n else {\r\n this.markers.template.propertyFields.fill = undefined;\r\n }\r\n if (dataContext.updateLegendValue) {\r\n dataContext.updateLegendValue(); // this solves issue with external legend, as legend is created after chart updates legend values\r\n }\r\n if (dataContext.component && dataContext.component.updateLegendValue) {\r\n dataContext.component.updateLegendValue(dataContext);\r\n }\r\n if (valueLabel.invalid) {\r\n valueLabel.validate();\r\n }\r\n if (valueLabel.text == \"\" || valueLabel.text == undefined) {\r\n valueLabel.__disabled = true;\r\n }\r\n else {\r\n valueLabel.__disabled = false;\r\n }\r\n if (legendSettings && (legendSettings.itemValueText != undefined || legendSettings.valueText != undefined)) {\r\n valueLabel.__disabled = false;\r\n }\r\n var visible = dataItem.dataContext.visible;\r\n if (visible === undefined) {\r\n visible = true;\r\n }\r\n visible = $type.toBoolean(visible);\r\n dataItem.dataContext.visible = visible;\r\n container.events.disableType(\"toggled\");\r\n container.isActive = !visible;\r\n if (container.isActive) {\r\n container.setState(\"active\", 0);\r\n }\r\n else {\r\n container.setState(\"default\", 0);\r\n }\r\n container.events.enableType(\"toggled\");\r\n };\r\n Legend.prototype.afterDraw = function () {\r\n var _this = this;\r\n var maxWidth = this.getPropertyValue(\"maxWidth\");\r\n var maxLabelWidth = 0;\r\n this.labels.each(function (label) {\r\n if (label.invalid) {\r\n label.maxWidth = undefined;\r\n label.validate();\r\n }\r\n if (label.measuredWidth + label.pixelMarginLeft + label.pixelMarginRight > maxLabelWidth) {\r\n maxLabelWidth = label.measuredWidth + label.pixelMarginLeft + label.pixelMarginRight;\r\n }\r\n });\r\n var maxValueLabelWidth = 0;\r\n this.valueLabels.each(function (label) {\r\n if (label.invalid) {\r\n label.validate();\r\n }\r\n if (label.measuredWidth + label.pixelMarginLeft + label.pixelMarginRight > maxValueLabelWidth) {\r\n maxValueLabelWidth = label.measuredWidth + label.pixelMarginLeft + label.pixelMarginRight;\r\n }\r\n });\r\n var maxMarkerWidth = 0;\r\n this.markers.each(function (marker) {\r\n if (marker.invalid) {\r\n marker.validate();\r\n }\r\n if (marker.measuredWidth + marker.pixelMarginLeft + marker.pixelMarginRight > maxMarkerWidth) {\r\n maxMarkerWidth = marker.measuredWidth + marker.pixelMarginLeft + marker.pixelMarginRight;\r\n }\r\n });\r\n var itemContainer = this.itemContainers.template;\r\n var margin = itemContainer.pixelMarginRight + itemContainer.pixelMarginLeft;\r\n var maxAdjustedLabelWidth;\r\n var trueMaxWidth = maxLabelWidth + maxValueLabelWidth + maxMarkerWidth;\r\n if (!$type.isNumber(maxWidth)) {\r\n maxAdjustedLabelWidth = maxLabelWidth;\r\n }\r\n else {\r\n maxWidth = maxWidth - margin;\r\n if (maxWidth > trueMaxWidth) {\r\n maxWidth = trueMaxWidth;\r\n }\r\n maxAdjustedLabelWidth = maxWidth - maxMarkerWidth - maxValueLabelWidth;\r\n }\r\n this.labels.each(function (label) {\r\n if (_this.valueLabels.template.align == \"right\" || label.measuredWidth > maxAdjustedLabelWidth) {\r\n if (!(label.width instanceof Percent)) {\r\n label.width = Math.min(label.maxWidth, maxAdjustedLabelWidth - label.pixelMarginLeft - label.pixelMarginRight);\r\n label.maxWidth = label.width;\r\n }\r\n }\r\n });\r\n if (this.valueLabels.template.align == \"right\") {\r\n this.valueLabels.each(function (valueLabel) {\r\n valueLabel.width = maxValueLabelWidth - valueLabel.pixelMarginRight - valueLabel.pixelMarginLeft;\r\n });\r\n }\r\n _super.prototype.afterDraw.call(this);\r\n };\r\n Legend.prototype.handleScrollbar = function () {\r\n var scrollbar = this.scrollbar;\r\n if (this.scrollable && scrollbar) {\r\n var measuredHeight = this.maxHeight;\r\n scrollbar.height = measuredHeight;\r\n scrollbar.x = this.measuredWidth - scrollbar.pixelWidth - scrollbar.pixelMarginLeft;\r\n if (this.contentHeight > measuredHeight) {\r\n scrollbar.visible = true;\r\n scrollbar.thumb.height = scrollbar.height * measuredHeight / this.contentHeight;\r\n this.paddingRight = scrollbar.pixelWidth + scrollbar.pixelMarginLeft + scrollbar.pixelMarginRight;\r\n }\r\n else {\r\n scrollbar.thumb.height = scrollbar.height * measuredHeight / this.contentHeight;\r\n this.paddingRight = scrollbar.pixelWidth + scrollbar.pixelMarginLeft + scrollbar.pixelMarginRight;\r\n scrollbar.visible = false;\r\n scrollbar.start = 0;\r\n scrollbar.end = 1;\r\n }\r\n scrollbar.handleThumbPosition();\r\n this.updateMasks();\r\n }\r\n };\r\n Object.defineProperty(Legend.prototype, \"position\", {\r\n /**\r\n * @return Position\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"position\");\r\n },\r\n /**\r\n * Position of the legend.\r\n *\r\n * Options: \"left\", \"right\", \"top\", \"bottom\" (default), or \"absolute\".\r\n *\r\n * IMPORTANT: [[MapChart]] will ignore this setting, as it is using different\r\n * layout structure than other charts.\r\n *\r\n * To position legend in [[MapChart]] set legend's `align` (`\"left\"` or\r\n * `\"right\"`) and `valign` (`\"top\"` or `\"bottom\"`) properties instead.\r\n *\r\n * @default \"bottom\"\r\n * @param value Position\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"position\", value)) {\r\n if (value == \"left\" || value == \"right\") {\r\n this.margin(10, 5, 10, 10);\r\n this.valign = \"middle\";\r\n this.contentAlign = \"none\";\r\n this.valueLabels.template.align = \"right\";\r\n if (!$type.isNumber(this.maxColumns)) {\r\n this.maxColumns = 1;\r\n }\r\n this.width = undefined;\r\n this.maxWidth = 220;\r\n }\r\n else {\r\n this.maxColumns = undefined;\r\n this.width = percent(100);\r\n this.valueLabels.template.align = \"left\";\r\n }\r\n this.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Legend.prototype, \"useDefaultMarker\", {\r\n /**\r\n * @return Use default marker?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"useDefaultMarker\");\r\n },\r\n /**\r\n * Should legend try to mirror the look of the related item when building\r\n * the marker for legend item?\r\n *\r\n * If set to `false` it will try to make the marker look like its related\r\n * item.\r\n *\r\n * E.g. if an item is for a Line Series, it will display a line of the\r\n * same thickness, color, and will use the same bullets if series have them.\r\n *\r\n * If set to `true`, all markers will be shown as squares, regardless of te\r\n * series type.\r\n *\r\n * @default false\r\n * @param value Use default marker?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"useDefaultMarker\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Legend.prototype, \"scrollable\", {\r\n /**\r\n * @return Legend Scrollable?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"scrollable\");\r\n },\r\n /**\r\n * If set to `true` the Legend will display a scrollbar if its contents do\r\n * not fit into its `maxHeight`.\r\n *\r\n * Please note that `maxHeight` is automatically set for Legend when its\r\n * `position` is set to `\"left\"` or `\"right\"`.\r\n *\r\n * @default false\r\n * @since 4.8.0\r\n * @param value Legend Scrollable?\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"scrollable\", value, true)) {\r\n if (value) {\r\n var scrollbar = this.createChild(Scrollbar);\r\n this.scrollbar = scrollbar;\r\n scrollbar.isMeasured = false;\r\n scrollbar.orientation = \"vertical\";\r\n scrollbar.endGrip.__disabled = true;\r\n scrollbar.startGrip.__disabled = true;\r\n scrollbar.visible = false;\r\n scrollbar.marginLeft = 5;\r\n this._mouseWheelDisposer = this.events.on(\"wheel\", this.handleWheel, this, false);\r\n this._disposers.push(this._mouseWheelDisposer);\r\n this._disposers.push(scrollbar.events.on(\"rangechanged\", this.updateMasks, this, false));\r\n }\r\n else {\r\n if (this._mouseWheelDisposer) {\r\n this._mouseWheelDisposer.dispose();\r\n if (this.scrollbar) {\r\n this.scrollbar.dispose();\r\n this.scrollbar = undefined;\r\n }\r\n }\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Handles mouse wheel scrolling of legend.\r\n *\r\n * @param event Event\r\n */\r\n Legend.prototype.handleWheel = function (event) {\r\n this._handleWheelReal(event.shift.y);\r\n };\r\n Legend.prototype._handleWheelReal = function (shift) {\r\n var scrollbar = this.scrollbar;\r\n if (scrollbar) {\r\n var ds = (shift / 1000 * this.measuredHeight / this.contentHeight);\r\n var delta = scrollbar.end - scrollbar.start;\r\n if (shift > 0) {\r\n scrollbar.start = $math.max(0, scrollbar.start - ds);\r\n scrollbar.end = scrollbar.start + delta;\r\n }\r\n else {\r\n scrollbar.end = $math.min(1, scrollbar.end - ds);\r\n scrollbar.start = scrollbar.end - delta;\r\n }\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Legend.prototype.updateMasks = function () {\r\n var _this = this;\r\n if (this.scrollbar) {\r\n this.itemContainers.each(function (itemContainer) {\r\n itemContainer.dy = -_this.scrollbar.thumb.pixelY * _this.contentHeight / _this.maxHeight;\r\n itemContainer.maskRectangle = { x: 0, y: -itemContainer.dy, width: _this.measuredWidth, height: _this.maxHeight };\r\n });\r\n }\r\n this.invalidatePosition();\r\n };\r\n /**\r\n * Toggles a legend item.\r\n *\r\n * @ignore Exclude from docs\r\n * @param item Legend item\r\n * @todo Maybe do it with togglable instead\r\n */\r\n Legend.prototype.toggleDataItem = function (item) {\r\n var dataContext = item.dataContext;\r\n if (!dataContext.visible || dataContext.isHiding || (dataContext instanceof Sprite && dataContext.isHidden)) {\r\n item.color = item.colorOrig;\r\n dataContext.appeared = true;\r\n item.itemContainer.isActive = false;\r\n if (dataContext.hidden === true) {\r\n dataContext.hidden = false;\r\n }\r\n if (dataContext.show) {\r\n dataContext.show();\r\n }\r\n else {\r\n dataContext.visible = true;\r\n }\r\n this.svgContainer.readerAlert(this.language.translate(\"%1 shown\", this.language.locale, item.label.readerTitle));\r\n }\r\n else {\r\n item.itemContainer.isActive = true;\r\n dataContext.appeared = true;\r\n if (dataContext.hide) {\r\n dataContext.hide();\r\n }\r\n else {\r\n dataContext.visible = false;\r\n }\r\n this.svgContainer.readerAlert(this.language.translate(\"%1 hidden\", this.language.locale, item.label.readerTitle));\r\n item.color = new InterfaceColorSet().getFor(\"disabledBackground\");\r\n }\r\n };\r\n Object.defineProperty(Legend.prototype, \"preloader\", {\r\n /**\r\n * Override preloader method so that legend does not accidentally show its\r\n * own preloader.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Always `undefined`\r\n */\r\n get: function () {\r\n return;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * [handleDataItemPropertyChange description]\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Legend.prototype.handleDataItemPropertyChange = function (dataItem, name) {\r\n dataItem.valueLabel.invalidate();\r\n dataItem.label.invalidate();\r\n };\r\n return Legend;\r\n}(Component));\r\nexport { Legend };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Legend\"] = Legend;\r\n/**\r\n * Add default responsive rules\r\n */\r\n/**\r\n * Move legend to below the chart if chart is narrow\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.widthXS,\r\n state: function (target, stateId) {\r\n if (target instanceof Legend && (target.position == \"left\" || target.position == \"right\")) {\r\n var state = target.states.create(stateId);\r\n state.properties.position = \"bottom\";\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n/**\r\n * Move legend to the right if chart is very short\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.heightXS,\r\n state: function (target, stateId) {\r\n if (target instanceof Legend && (target.position == \"top\" || target.position == \"bottom\")) {\r\n var state = target.states.create(stateId);\r\n state.properties.position = \"right\";\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n/**\r\n * Disable legend altogether on small charts\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.isXS,\r\n state: function (target, stateId) {\r\n if (target instanceof Legend) {\r\n var state = target.states.create(stateId);\r\n state.properties.disabled = true;\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n//# sourceMappingURL=Legend.js.map","/**\r\n * Axis break module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../../core/Container\";\r\nimport { MutableValueDisposer } from \"../../core/utils/Disposer\";\r\nimport { WavedLine } from \"../../core/elements/WavedLine\";\r\nimport { List } from \"../../core/utils/List\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { color } from \"../../core/utils/Color\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Base class to define \"breaks\" on axes.\r\n *\r\n * @see {@link IAxisBreakEvents} for a list of available events\r\n * @see {@link IAxisBreakAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar AxisBreak = /** @class */ (function (_super) {\r\n __extends(AxisBreak, _super);\r\n /**\r\n * Constructor\r\n */\r\n function AxisBreak() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * Reference to parent Axis.\r\n */\r\n _this._axis = new MutableValueDisposer();\r\n /**\r\n * A list of axis data items which fall within this break.\r\n */\r\n _this.dataItems = new List();\r\n _this.className = \"AxisBreak\";\r\n // Set defaults\r\n _this.breakSize = 0.01;\r\n _this.marginLeft = -5;\r\n _this.marginRight = -5;\r\n _this.marginTop = -5;\r\n _this.marginBottom = -5;\r\n var interfaceColors = new InterfaceColorSet();\r\n // Create elements\r\n // (these won't be used actually, just for setting properties)\r\n var fillShape = new WavedLine();\r\n fillShape.fill = interfaceColors.getFor(\"background\");\r\n fillShape.stroke = color();\r\n fillShape.fillOpacity = 0.9;\r\n fillShape.zIndex = 0;\r\n _this._fillShape = fillShape;\r\n var startLine = new WavedLine();\r\n startLine.fill = color();\r\n startLine.stroke = interfaceColors.getFor(\"grid\");\r\n startLine.strokeOpacity = 0.3;\r\n startLine.zIndex = 1;\r\n _this._startLine = startLine;\r\n var endLine = new WavedLine();\r\n endLine.fill = color();\r\n endLine.stroke = color(\"#000000\"); // interfaceColors.getFor(\"grid\");\r\n endLine.strokeOpacity = 0.3;\r\n endLine.zIndex = 2;\r\n _this._endLine = endLine;\r\n _this._disposers.push(_this._axis);\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n AxisBreak.prototype.dispose = function () {\r\n _super.prototype.dispose.call(this);\r\n if (this._fillShape) {\r\n this._fillShape.dispose();\r\n }\r\n if (this._startLine) {\r\n this._startLine.dispose();\r\n }\r\n if (this._endLine) {\r\n this._endLine.dispose();\r\n }\r\n };\r\n Object.defineProperty(AxisBreak.prototype, \"startLine\", {\r\n /**\r\n * @return Element\r\n */\r\n get: function () {\r\n return this._startLine;\r\n },\r\n /**\r\n * An element used for the starting line of the break.\r\n *\r\n * @param sprite Element\r\n */\r\n set: function (sprite) {\r\n if (this._startLine) {\r\n this._startLine.dispose();\r\n }\r\n this._startLine = sprite;\r\n this.addBreakSprite(sprite);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisBreak.prototype, \"endLine\", {\r\n /**\r\n * @return Element\r\n */\r\n get: function () {\r\n return this._endLine;\r\n },\r\n /**\r\n * An element used for the end line of the break.\r\n *\r\n * @param sprite Element\r\n */\r\n set: function (sprite) {\r\n if (this._endLine) {\r\n this._endLine.dispose();\r\n }\r\n this._endLine = sprite;\r\n this.addBreakSprite(sprite);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisBreak.prototype, \"fillShape\", {\r\n /**\r\n * @return Element\r\n */\r\n get: function () {\r\n return this._fillShape;\r\n },\r\n /**\r\n * An element used for fill of the break.\r\n *\r\n * @param sprite Element\r\n */\r\n set: function (sprite) {\r\n if (this._fillShape) {\r\n this._fillShape.dispose();\r\n }\r\n this._fillShape = sprite;\r\n this.addBreakSprite(sprite);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Adds a break element (e.g. lines, fill) to the break, which is\r\n * [[Container]].\r\n *\r\n * @ignore Exclude from docs\r\n * @param sprite Element to add\r\n */\r\n AxisBreak.prototype.addBreakSprite = function (sprite) {\r\n sprite.parent = this;\r\n sprite.isMeasured = false;\r\n this._disposers.push(sprite);\r\n };\r\n Object.defineProperty(AxisBreak.prototype, \"axis\", {\r\n /**\r\n * @return Axis\r\n */\r\n get: function () {\r\n return this._axis.get();\r\n },\r\n /**\r\n * An Axis this Break is associated with.\r\n *\r\n * @param axis Axis\r\n */\r\n set: function (axis) {\r\n if (this._axis.get() !== axis) {\r\n this._axis.set(axis, axis.renderer.gridContainer.events.on(\"transformed\", this.invalidate, this, false));\r\n axis.renderer.createBreakSprites(this);\r\n // this can't go to copyFrom, as axis is set later\r\n var breakTemplate = axis.axisBreaks.template;\r\n this.startLine.copyFrom(breakTemplate.startLine);\r\n this.endLine.copyFrom(breakTemplate.endLine);\r\n this.fillShape.copyFrom(breakTemplate.fillShape);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisBreak.prototype, \"breakSize\", {\r\n /**\r\n * @return Relative axis break\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"breakSize\");\r\n },\r\n /**\r\n * A size of the break relative to the actual size of the scope break spans.\r\n *\r\n * For example, if `breakSize = 0.1` and unbroken scope of values it spans\r\n * would be 100 pixels, the break would be 10 pixels wide.\r\n *\r\n * 0 means the break will completely collapse and hide the values.\r\n * 1 means break would be not collapse at all, which would make it\r\n * effectively useless.\r\n *\r\n * @default 0.01\r\n * @param value Relative axis break\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"breakSize\", value)) {\r\n if (this.axis) {\r\n this.axis.invalidate();\r\n this.axis.invalidateSeries();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisBreak.prototype, \"startPoint\", {\r\n /**\r\n * Returns pixel coordinates of axis break's start.\r\n *\r\n * @return Start point\r\n */\r\n get: function () {\r\n var renderer = this.axis.renderer;\r\n if (renderer) {\r\n return renderer.positionToPoint(this.startPosition);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisBreak.prototype, \"endPoint\", {\r\n /**\r\n * Returns pixel coordinates of axis break's end.\r\n *\r\n * @return End point\r\n */\r\n get: function () {\r\n var renderer = this.axis.renderer;\r\n if (renderer) {\r\n return renderer.positionToPoint(this.endPosition);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisBreak.prototype, \"startPosition\", {\r\n /**\r\n * Returns a relative position at which axis break starts.\r\n *\r\n * This is a calculated position, meaning it shows relative position of the\r\n * break after break is applied.\r\n *\r\n * @return Start position\r\n */\r\n get: function () {\r\n return;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisBreak.prototype, \"endPosition\", {\r\n /**\r\n * Returns a relative position at which axis break ends.\r\n *\r\n * This is a calculated position, meaning it shows relative position of the\r\n * break after break is applied.\r\n *\r\n * @return End position\r\n */\r\n get: function () {\r\n return;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Draws the axis break.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n AxisBreak.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n if (this.axis) {\r\n var renderer = this.axis.renderer;\r\n renderer.updateBreakElement(this);\r\n }\r\n };\r\n Object.defineProperty(AxisBreak.prototype, \"startValue\", {\r\n /**\r\n * @return Starting value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"startValue\");\r\n },\r\n /**\r\n * A starting value for the break.\r\n *\r\n * @param value Starting value\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"startValue\", value)) {\r\n if (this.axis) {\r\n this.axis.invalidate();\r\n this.axis.invalidateSeries();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisBreak.prototype, \"endValue\", {\r\n /**\r\n * @return End value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"endValue\");\r\n },\r\n /**\r\n * An end value for the break.\r\n *\r\n * @param value End value\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"endValue\", value)) {\r\n if (this.axis) {\r\n this.axis.invalidate();\r\n this.axis.invalidateSeries();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return AxisBreak;\r\n}(Container));\r\nexport { AxisBreak };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisBreak\"] = AxisBreak;\r\n//# sourceMappingURL=AxisBreak.js.map","/**\r\n * Base class for all Axis\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Component } from \"../../core/Component\";\r\nimport { Container } from \"../../core/Container\";\r\nimport { DataItem } from \"../../core/DataItem\";\r\nimport { AxisBreak } from \"./AxisBreak\";\r\nimport { Label } from \"../../core/elements/Label\";\r\nimport { Tooltip } from \"../../core/elements/Tooltip\";\r\nimport { SortedListTemplate } from \"../../core/utils/SortedList\";\r\nimport { List, ListTemplate, ListDisposer } from \"../../core/utils/List\";\r\nimport { Disposer, MultiDisposer } from \"../../core/utils/Disposer\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $number from \"../../core/utils/Number\";\r\nimport * as $array from \"../../core/utils/Array\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport { defaultRules, ResponsiveBreakpoints } from \"../../core/utils/Responsive\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a [[DataItem]] for [[Axis]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nvar AxisDataItem = /** @class */ (function (_super) {\r\n __extends(AxisDataItem, _super);\r\n /**\r\n * Constructor\r\n */\r\n function AxisDataItem() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"AxisDataItem\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(AxisDataItem.prototype, \"grid\", {\r\n /**\r\n * @return Grid element\r\n */\r\n get: function () {\r\n if (!this._grid) {\r\n var component_1 = this.component;\r\n if (component_1) {\r\n var template = void 0;\r\n var grid_1;\r\n if (this.isRange) {\r\n template = component_1.axisRanges.template.grid;\r\n if (template.disabled) {\r\n return;\r\n }\r\n else {\r\n grid_1 = template.clone();\r\n }\r\n }\r\n else {\r\n template = component_1.renderer.grid.template;\r\n if (template.disabled) {\r\n return;\r\n }\r\n else {\r\n grid_1 = component_1.renderer.grid.create();\r\n this._disposers.push(new Disposer(function () {\r\n component_1.renderer.grid.removeValue(grid_1);\r\n }));\r\n }\r\n }\r\n this.grid = grid_1;\r\n grid_1.shouldClone = false;\r\n this._disposers.push(grid_1);\r\n grid_1.axis = this.component;\r\n }\r\n }\r\n return this._grid;\r\n },\r\n /**\r\n * A [[Grid]] element associated with this data item.\r\n *\r\n * If there is no grid element associated with data item, a new one is\r\n * created and returned.\r\n *\r\n * @param grid Grid element\r\n */\r\n set: function (grid) {\r\n if (this._grid && this._grid != grid) {\r\n $array.remove(this.sprites, this._grid);\r\n this._grid.dataItem = undefined;\r\n }\r\n if (grid) {\r\n if (grid.dataItem && grid.dataItem != this) {\r\n $array.remove(grid.dataItem.sprites, grid);\r\n grid.dataItem.grid = undefined;\r\n }\r\n this.addSprite(grid);\r\n }\r\n this._grid = grid;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisDataItem.prototype, \"tick\", {\r\n /**\r\n * @return Tick element\r\n */\r\n get: function () {\r\n if (!this._tick) {\r\n var component_2 = this.component;\r\n if (component_2) {\r\n var template = void 0;\r\n var tick_1;\r\n if (this.isRange) {\r\n template = component_2.axisRanges.template.tick;\r\n if (template.disabled) {\r\n return;\r\n }\r\n else {\r\n tick_1 = template.clone();\r\n }\r\n }\r\n else {\r\n template = component_2.renderer.ticks.template;\r\n if (template.disabled) {\r\n return;\r\n }\r\n else {\r\n tick_1 = component_2.renderer.ticks.create();\r\n this._disposers.push(new Disposer(function () {\r\n component_2.renderer.ticks.removeValue(tick_1);\r\n }));\r\n }\r\n }\r\n this.tick = tick_1;\r\n tick_1.axis = this.component;\r\n tick_1.shouldClone = false;\r\n this._disposers.push(tick_1);\r\n }\r\n }\r\n return this._tick;\r\n },\r\n /**\r\n * An [[AxisTick]] element associated with this data item.\r\n *\r\n * If there is no tick element associated with data item, a new one is\r\n * created and returned.\r\n *\r\n * @param tick Tick element\r\n */\r\n set: function (tick) {\r\n if (this._tick && this._tick != tick) {\r\n $array.remove(this.sprites, this._tick);\r\n this._tick.dataItem = undefined;\r\n }\r\n if (tick) {\r\n if (tick.dataItem && tick.dataItem != this) {\r\n $array.remove(tick.dataItem.sprites, tick);\r\n tick.dataItem.tick = undefined;\r\n }\r\n this.addSprite(tick);\r\n }\r\n this._tick = tick;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisDataItem.prototype, \"label\", {\r\n /**\r\n * @return Label element\r\n */\r\n get: function () {\r\n if (!this._label) {\r\n var component_3 = this.component;\r\n if (component_3) {\r\n var template = void 0;\r\n var label_1;\r\n if (this.isRange) {\r\n template = component_3.axisRanges.template.label;\r\n if (template.disabled) {\r\n return;\r\n }\r\n else {\r\n label_1 = template.clone();\r\n }\r\n }\r\n else {\r\n template = component_3.renderer.labels.template;\r\n if (template.disabled) {\r\n return;\r\n }\r\n else {\r\n label_1 = component_3.renderer.labels.create();\r\n this._disposers.push(new Disposer(function () {\r\n component_3.renderer.labels.removeValue(label_1);\r\n }));\r\n }\r\n }\r\n this._disposers.push(label_1);\r\n this.label = label_1;\r\n label_1.shouldClone = false;\r\n label_1.axis = this.component;\r\n label_1.virtualParent = component_3;\r\n }\r\n }\r\n return this._label;\r\n },\r\n /**\r\n * An [[AxisLabel]] element associated with this data item.\r\n *\r\n * If there is no label element associated with data item, a new one is\r\n * created and returned.\r\n *\r\n * @param label Label element\r\n */\r\n set: function (label) {\r\n if (this._label && this._label != label) {\r\n $array.remove(this.sprites, this._label);\r\n this._label.dataItem = undefined;\r\n }\r\n if (label) {\r\n if (label.dataItem && label.dataItem != this) {\r\n $array.remove(label.dataItem.sprites, label);\r\n label.dataItem.label = undefined;\r\n }\r\n this.addSprite(label);\r\n }\r\n this._label = label;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisDataItem.prototype, \"axisFill\", {\r\n /**\r\n * @return Label element\r\n */\r\n get: function () {\r\n if (!this._axisFill) {\r\n var component_4 = this.component;\r\n if (component_4) {\r\n var template = void 0;\r\n var axisFill_1;\r\n if (this.isRange) {\r\n template = component_4.axisRanges.template.axisFill;\r\n if (!this.isTemplate && template.disabled) {\r\n return;\r\n }\r\n else {\r\n axisFill_1 = template.clone();\r\n }\r\n }\r\n else {\r\n template = component_4.renderer.axisFills.template;\r\n if (template.disabled) {\r\n return;\r\n }\r\n else {\r\n axisFill_1 = component_4.renderer.axisFills.create();\r\n this._disposers.push(new Disposer(function () {\r\n component_4.renderer.axisFills.removeValue(axisFill_1);\r\n }));\r\n }\r\n }\r\n this.axisFill = axisFill_1;\r\n axisFill_1.shouldClone = false;\r\n this._disposers.push(axisFill_1);\r\n }\r\n }\r\n return this._axisFill;\r\n },\r\n /**\r\n * An [[AxisFill]] associated element with this data item.\r\n *\r\n * If there is no fill element associated with data item, a new one is\r\n * created and returned.\r\n *\r\n * @param label Label element\r\n */\r\n set: function (axisFill) {\r\n if (this._axisFill && this._axisFill != axisFill) {\r\n $array.remove(this.sprites, this._axisFill);\r\n this._axisFill.dataItem = undefined;\r\n }\r\n if (axisFill) {\r\n if (axisFill.dataItem && axisFill.dataItem != this) {\r\n $array.remove(axisFill.dataItem.sprites, axisFill);\r\n axisFill.dataItem.axisFill = undefined;\r\n }\r\n axisFill.axis = this.component;\r\n this.addSprite(axisFill);\r\n }\r\n this._axisFill = axisFill;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisDataItem.prototype, \"text\", {\r\n /**\r\n * @return Text label\r\n */\r\n get: function () {\r\n return this._text;\r\n },\r\n /**\r\n * Text to be used as data item's label.\r\n *\r\n * @param text Text label\r\n */\r\n set: function (text) {\r\n this._text = text;\r\n if (this._label) { // do not use getter, it will create unwanted instances!\r\n this._label.text = text;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisDataItem.prototype, \"mask\", {\r\n /**\r\n * Data item's mask.\r\n *\r\n * @return Mask\r\n */\r\n get: function () {\r\n return this._mask;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisDataItem.prototype, \"contents\", {\r\n /**\r\n * Returns a [[Container]] to place all visual elements, related to data item\r\n * in.\r\n *\r\n * If there is no Container, a new one is created.\r\n *\r\n * @return Contents container\r\n */\r\n get: function () {\r\n if (!this._contents) {\r\n var contents = new Container();\r\n this.addSprite(contents);\r\n contents.isMeasured = false;\r\n this._contents = contents;\r\n var component = this.component;\r\n if (component) {\r\n var mask = component.renderer.createFill(this.component);\r\n mask.disabled = false;\r\n mask.axis = component;\r\n this.addSprite(mask);\r\n this._mask = mask;\r\n contents.mask = mask;\r\n }\r\n }\r\n return this._contents;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisDataItem.prototype, \"axisBreak\", {\r\n /**\r\n * @return Axis break\r\n */\r\n get: function () {\r\n return this._axisBreak;\r\n },\r\n /**\r\n * An [[AxisBreak]] this data item falls within.\r\n *\r\n * @param axisBreak Axis break\r\n */\r\n set: function (axisBreak) {\r\n if (this._axisBreak) {\r\n this._axisBreak.dataItems.removeValue(this);\r\n }\r\n if (axisBreak) {\r\n axisBreak.dataItems.push(this);\r\n }\r\n this._axisBreak = axisBreak;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Re-draws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n AxisDataItem.prototype.validate = function () {\r\n if (this.component) {\r\n this.component.validateDataElement(this);\r\n }\r\n };\r\n /**\r\n * Appends data item's elements to the parent [[Container]].\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n AxisDataItem.prototype.appendChildren = function () {\r\n if (this.component) {\r\n this.component.appendDataItem(this);\r\n }\r\n };\r\n /**\r\n * Checks if data item has particular property set.\r\n *\r\n * @param prop Property name\r\n * @return Property set?\r\n */\r\n AxisDataItem.prototype.hasProperty = function (prop) {\r\n return prop == \"component\" ? true : _super.prototype.hasProperty.call(this, prop);\r\n };\r\n /**\r\n * Copies all parameters from another [[AxisDataItem]].\r\n *\r\n * @param source Source AxisDataItem\r\n */\r\n AxisDataItem.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.text = source.text;\r\n if (source.bullet) {\r\n this.bullet = source.bullet.clone();\r\n }\r\n this.minPosition = source.minPosition;\r\n this.maxPosition = source.maxPosition;\r\n };\r\n /**\r\n * Sets visibility of the Data Item.\r\n *\r\n * @param value Data Item\r\n */\r\n AxisDataItem.prototype.setVisibility = function (value, noChangeValues) {\r\n _super.prototype.setVisibility.call(this, value, noChangeValues);\r\n if (this._contents) {\r\n this._contents.visible = value;\r\n }\r\n };\r\n Object.defineProperty(AxisDataItem.prototype, \"bullet\", {\r\n /**\r\n * @return Bullet\r\n */\r\n get: function () {\r\n return this._bullet;\r\n },\r\n /**\r\n * Set it to an instance of any [[Sprite]]. It will be displayed as an axis\r\n * bullet in the middle of the cell, or specific value.\r\n *\r\n * If you need position bullet relatively to the cell, use [[AxisBullet]]\r\n * instead. It has a `location` property which can be used to indicate\r\n * precise relative location within cell/range.\r\n *\r\n * Also, [[AxisBullet]] is a [[Container]] so you can push any other element\r\n * into it.\r\n *\r\n * NOTE: `location` is relative to the parent axis range's scope, i.e.\r\n * between its `date` and `endDate` for [[DateAxis]], or `value`/`endValue`\r\n * ([[ValueAxis]]), or `category`/`endCategory` ([[categoryAxis]]).\r\n *\r\n * ```TypeScript\r\n * let range = dateAxis.axisRanges.create();\r\n * range.date = new Date(2018, 0, 5);\r\n *\r\n * let flag = new am4plugins_bullets.FlagBullet();\r\n * flag.label.text = \"Hello\";\r\n *\r\n * range.bullet = flag;\r\n * ```\r\n * ```JavaScript\r\n * var range = dateAxis.axisRanges.create();\r\n * range.date = new Date(2018, 0, 5);\r\n *\r\n * var flag = new am4plugins_bullets.FlagBullet();\r\n * flag.label.text = \"Hello\";\r\n *\r\n * range.bullet = flag;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"xAxes\": [{\r\n * \"type\": \"DateAxis\",\r\n * // ...\r\n * \"axisRanges\": [{\r\n * \"date\": new Date(2018, 0, 5),\r\n * \"bullet: {\r\n * \"type\": \"FlagBullet\",\r\n * \"label\": {\r\n * \"text\": \"Hello\"\r\n * }\r\n * }\r\n * }]\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * @since 4.5.9\r\n * @param value Bullet\r\n */\r\n set: function (value) {\r\n if (this._bullet && this._bullet != value) {\r\n $array.remove(this.sprites, this._bullet);\r\n this._bullet.dataItem = undefined;\r\n }\r\n this._bullet = value;\r\n if (value) {\r\n this.addSprite(value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return AxisDataItem;\r\n}(DataItem));\r\nexport { AxisDataItem };\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines named positions for data item's location within [[Axis]].\r\n */\r\nexport var AxisItemLocation;\r\n(function (AxisItemLocation) {\r\n AxisItemLocation[AxisItemLocation[\"Start\"] = 0] = \"Start\";\r\n AxisItemLocation[AxisItemLocation[\"Middle\"] = 0.5] = \"Middle\";\r\n AxisItemLocation[AxisItemLocation[\"End\"] = 1] = \"End\";\r\n})(AxisItemLocation || (AxisItemLocation = {}));\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A base class for all Axis elements.\r\n *\r\n * @see {@link IAxisEvents} for a list of available Events\r\n * @see {@link IAxisAdapters} for a list of available Adapters\r\n */\r\nvar Axis = /** @class */ (function (_super) {\r\n __extends(Axis, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Axis() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * Number of Grid elements on the axis.\r\n */\r\n _this._gridCount = 10;\r\n /**\r\n * A list of [[XYSeries]] that are using this Axis.\r\n */\r\n _this._series = new List();\r\n /**\r\n * Specifies if axis should be automatically disposed when removing from\r\n * chart's axis list.\r\n *\r\n * @default true\r\n */\r\n _this.autoDispose = true;\r\n /**\r\n * @ignore\r\n */\r\n _this._axisItemCount = 0;\r\n if (_this.constructor === Axis) {\r\n throw new Error(\"'Axis' cannot be instantiated directly. Please use a specific axis type.\");\r\n }\r\n _this.hideTooltipWhileZooming = true;\r\n _this.minWidth = 0.0001;\r\n _this.minHeight = 0.0001;\r\n _this.className = \"Axis\";\r\n _this.shouldClone = false;\r\n _this.setPropertyValue(\"cursorTooltipEnabled\", true);\r\n _this.toggleZoomOutButton = true;\r\n _this.zoomable = true;\r\n var interfaceColors = new InterfaceColorSet();\r\n // Create title\r\n _this.title = new Label();\r\n _this.title.shouldClone = false;\r\n _this._disposers.push(_this.title);\r\n _this.setPropertyValue(\"startLocation\", 0);\r\n _this.setPropertyValue(\"endLocation\", 1);\r\n // Data item iterator\r\n _this._dataItemsIterator = new $iter.ListIterator(_this.dataItems, function () { return _this.dataItems.create(); });\r\n _this._dataItemsIterator.createNewItems = true;\r\n // Create tooltip\r\n var tooltip = new Tooltip();\r\n _this._disposers.push(tooltip);\r\n tooltip.label.padding(5, 10, 5, 10);\r\n tooltip.background.pointerLength = 5;\r\n tooltip.fitPointerToBounds = true;\r\n tooltip.background.filters.clear();\r\n // Set virtual parentfor the tooltip so that it can properly inheirt\r\n // formatters from the axis.\r\n tooltip.virtualParent = _this;\r\n // Create background element for the tooltip\r\n var background = tooltip.background;\r\n background.cornerRadius = 0;\r\n background.fill = interfaceColors.getFor(\"alternativeBackground\");\r\n background.stroke = background.fill;\r\n background.strokeWidth = 1;\r\n background.fillOpacity = 1;\r\n tooltip.label.fill = interfaceColors.getFor(\"alternativeText\");\r\n _this.tooltip = tooltip;\r\n // Accessibility\r\n _this.readerHidden = true;\r\n _this.events.on(\"rangechangestarted\", function () {\r\n _this.series.each(function (series) {\r\n if (series.hideTooltipWhileZooming) {\r\n series.tooltip.hide();\r\n series.tooltip.preventShow = true;\r\n }\r\n });\r\n if (_this.hideTooltipWhileZooming) {\r\n _this.tooltip.hide();\r\n _this.tooltip.preventShow = true;\r\n }\r\n }, undefined, false);\r\n _this.events.on(\"rangechangeended\", function () {\r\n _this.series.each(function (series) {\r\n if (series.hideTooltipWhileZooming) {\r\n series.tooltip.hide();\r\n series.tooltip.preventShow = false;\r\n }\r\n });\r\n if (_this.hideTooltipWhileZooming) {\r\n _this.tooltip.hide();\r\n _this.tooltip.preventShow = false;\r\n }\r\n }, undefined, false);\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Holds reference to a function that accepts a DataItem and its index as\r\n * parameters.\r\n *\r\n * It can either return a fill opacity for a fill, or manipulate data item\r\n * directly, to create various highlighting scenarios.\r\n *\r\n * For example, you can set it up to highlight only weekends on a\r\n * [[DateAxis]].\r\n */\r\n Axis.prototype.fillRule = function (dataItem, index) {\r\n if (!$type.isNumber(index)) {\r\n index = dataItem.index;\r\n }\r\n if (index / 2 == Math.round(index / 2)) {\r\n dataItem.axisFill.__disabled = true;\r\n dataItem.axisFill.opacity = 0;\r\n }\r\n else {\r\n dataItem.axisFill.opacity = 1;\r\n dataItem.axisFill.__disabled = false;\r\n }\r\n };\r\n /**\r\n * Returns a new/empty DataItem of the type appropriate for this object.\r\n *\r\n * @see {@link DataItem}\r\n * @return Data Item\r\n */\r\n Axis.prototype.createDataItem = function () {\r\n return new AxisDataItem();\r\n };\r\n /**\r\n * Invalidates layout.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Axis.prototype.invalidateLayout = function () {\r\n _super.prototype.invalidateLayout.call(this);\r\n // this puts series after axis in invalidation order also makes series update it's data items in case widht/height of a series is not 100%\r\n $iter.each(this.series.iterator(), function (series) {\r\n series.invalidateLayout();\r\n });\r\n };\r\n /**\r\n * Invalidates series of this axis.\r\n */\r\n Axis.prototype.invalidateSeries = function () {\r\n // this puts series after axis in invalidation order also makes series update it's data items in case widht/height of a series is not 100%\r\n $iter.each(this.series.iterator(), function (series) {\r\n series.invalidate();\r\n });\r\n };\r\n /**\r\n * Override to cancel super call for data element validation.\r\n * @ignore\r\n */\r\n Axis.prototype.validateDataElements = function () {\r\n this._axisItemCount = 0;\r\n if (this.ghostLabel) {\r\n this.renderer.updateLabelElement(this.ghostLabel, this.start, this.end);\r\n this.ghostLabel.validate();\r\n }\r\n };\r\n /**\r\n * Recalculates the number of grid items on the axis.\r\n */\r\n Axis.prototype.updateGridCount = function () {\r\n if (this.renderer) {\r\n var gridCount = this.axisLength / this.renderer.minGridDistance;\r\n if (gridCount != this._gridCount) {\r\n this._gridCount = gridCount;\r\n this.clearCache();\r\n }\r\n }\r\n };\r\n /**\r\n * Redraws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Axis.prototype.validateLayout = function () {\r\n this.axisFullLength = this.axisLength / (this.end - this.start);\r\n _super.prototype.validateLayout.call(this);\r\n this.updateGridCount();\r\n var renderer = this.renderer;\r\n if (renderer) {\r\n renderer.updateAxisLine();\r\n renderer.updateTooltip();\r\n renderer.updateBaseGridElement();\r\n }\r\n if (this._prevLength != this.axisLength) {\r\n this.dispatchImmediately(\"lengthchanged\");\r\n this._prevLength = this.axisLength;\r\n }\r\n };\r\n /**\r\n * Initializes Axis' renderer.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Axis.prototype.initRenderer = function () {\r\n };\r\n /**\r\n * Adds a data item to the Axis.\r\n *\r\n * @param dataItem Data item\r\n */\r\n Axis.prototype.appendDataItem = function (dataItem) {\r\n var renderer = this.renderer;\r\n var tick = dataItem.tick;\r\n if (tick) {\r\n if (tick.above) {\r\n tick.parent = renderer.bulletsContainer;\r\n }\r\n else {\r\n tick.parent = renderer.gridContainer;\r\n }\r\n }\r\n if (dataItem.label) {\r\n dataItem.label.parent = renderer;\r\n }\r\n var axisFill = dataItem.axisFill;\r\n if (axisFill) {\r\n if (axisFill.above) {\r\n axisFill.parent = renderer.bulletsContainer;\r\n }\r\n else {\r\n axisFill.parent = renderer.gridContainer;\r\n }\r\n }\r\n var grid = dataItem.grid;\r\n if (grid) {\r\n if (grid.above) {\r\n grid.parent = renderer.bulletsContainer;\r\n }\r\n else {\r\n grid.parent = renderer.gridContainer;\r\n }\r\n }\r\n if (dataItem.bullet) {\r\n dataItem.bullet.parent = renderer.bulletsContainer;\r\n }\r\n };\r\n /**\r\n * Redraws Axis' related items.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Axis.prototype.validate = function () {\r\n _super.prototype.validate.call(this);\r\n this.validateLayout();\r\n this.renderer.updateGridContainer();\r\n };\r\n /**\r\n * Redars Axis ranges.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Axis.prototype.validateAxisRanges = function () {\r\n var _this = this;\r\n $iter.each(this.axisRanges.iterator(), function (axisRange) {\r\n _this.appendDataItem(axisRange);\r\n _this.validateDataElement(axisRange);\r\n if (axisRange.grid) {\r\n axisRange.grid.validate();\r\n }\r\n if (axisRange.tick) {\r\n axisRange.tick.validate();\r\n }\r\n if (axisRange.axisFill) {\r\n axisRange.axisFill.validate();\r\n }\r\n if (axisRange.label) {\r\n axisRange.label.validate();\r\n }\r\n });\r\n };\r\n /**\r\n * Invalidates all axis breaks, so they are redrawn.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Axis.prototype.validateBreaks = function () {\r\n if (this._axisBreaks) {\r\n $iter.each(this._axisBreaks.iterator(), function (axisBreak) {\r\n axisBreak.invalidate();\r\n });\r\n }\r\n };\r\n /**\r\n * Associates an Axis break with this Axis, after it is inserted into\r\n * `axisBreaks`.\r\n *\r\n * @ignore Exclude from docs\r\n * @param event Event\r\n */\r\n Axis.prototype.processBreak = function (event) {\r\n var axisBreak = event.newValue;\r\n axisBreak.parent = this.renderer.breakContainer;\r\n axisBreak.axis = this;\r\n };\r\n /**\r\n * Registers a [[XYSeries]] element with this Axis.\r\n *\r\n * Returns a [[Disposer]] for all events, added to Series for watching\r\n * changes in Axis, and vice versa.\r\n * @ignore\r\n * @param series Series\r\n * @return Event disposer\r\n */\r\n Axis.prototype.registerSeries = function (series) {\r\n var _this = this;\r\n this.series.moveValue(series);\r\n return new MultiDisposer([\r\n new Disposer(function () {\r\n _this.series.removeValue(series);\r\n }),\r\n this.events.on(\"lengthchanged\", series.invalidate, series, false),\r\n this.events.on(\"lengthchanged\", series.createMask, series, false),\r\n this.events.on(\"startchanged\", series.invalidate, series, false),\r\n this.events.on(\"endchanged\", series.invalidate, series, false),\r\n ]);\r\n };\r\n Object.defineProperty(Axis.prototype, \"renderer\", {\r\n /**\r\n * @return Renderer\r\n */\r\n get: function () {\r\n return this._renderer;\r\n },\r\n /**\r\n * An [[AxisRenderer]] to be used to render this Axis.\r\n *\r\n * Please note that most of the settings, related to Axis' appearance are set\r\n * via its renderer. Not directly on the Axis.\r\n *\r\n * E.g.:\r\n *\r\n * ```TypeScript\r\n * axis.renderer.inside = true;\r\n * axis.renderer.minLabelPosition = 0.1;\r\n * axis.renderer.maxLabelPosition = 0.9;\r\n * ```\r\n * ```JavaScript\r\n * axis.renderer.inside = true;\r\n * axis.renderer.minLabelPosition = 0.1;\r\n * axis.renderer.maxLabelPosition = 0.9;\r\n * ```\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/axes/} for more info\r\n * @param renderer Renderer\r\n */\r\n set: function (renderer) {\r\n if (renderer != this._renderer) {\r\n this._renderer = renderer;\r\n renderer.chart = this.chart;\r\n renderer.axis = this;\r\n renderer.parent = this;\r\n this.title.parent = this; // we add title to axis and set layout in renderer to avoid one extra container, as otherwise axis container would be used for holding renderer only\r\n this.initRenderer();\r\n this._disposers.push(renderer.gridContainer.events.on(\"maxsizechanged\", this.invalidate, this, false));\r\n var ghostLabel_1 = this.renderer.labels.create();\r\n this._disposers.push(ghostLabel_1);\r\n ghostLabel_1.dataItem = this.dataItems.template.clone(); // just for the adapters not to fail\r\n ghostLabel_1.text = \"L\";\r\n ghostLabel_1.parent = this.renderer;\r\n ghostLabel_1.shouldClone = false;\r\n ghostLabel_1.fillOpacity = 0;\r\n ghostLabel_1.opacity = 0;\r\n ghostLabel_1.strokeOpacity = 0;\r\n ghostLabel_1.interactionsEnabled = false;\r\n ghostLabel_1.validate();\r\n this.ghostLabel = ghostLabel_1;\r\n this.events.on(\"beforedatavalidated\", function () {\r\n ghostLabel_1.text = \"L\";\r\n }, undefined, false);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Converts a relative position to angle. (for circular axes)\r\n *\r\n * @param position Position (0-1)\r\n * @return Angle\r\n */\r\n Axis.prototype.positionToAngle = function (position) {\r\n return this.renderer.positionToAngle(position);\r\n };\r\n /**\r\n * Converts pixel coordinates to a relative position. (0-1)\r\n *\r\n * @param point Coorinates (px)\r\n * @return Position (0-1)\r\n */\r\n Axis.prototype.pointToPosition = function (point) {\r\n return this.renderer.pointToPosition(point);\r\n };\r\n /**\r\n * Converts relative position to coordinate.\r\n *\r\n * @since 4.7.15\r\n * @param position (0-1)\r\n * @return coordinate (px)\r\n */\r\n Axis.prototype.positionToCoordinate = function (position) {\r\n return this.renderer.positionToCoordinate(position);\r\n };\r\n /**\r\n * [getAnyRangePath description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param start [description]\r\n * @param end [description]\r\n * @return [description]\r\n */\r\n Axis.prototype.getAnyRangePath = function (start, end) {\r\n return this.renderer.getPositionRangePath(start, end);\r\n };\r\n /**\r\n * Converts any positional parameter to a relative position on axis.\r\n *\r\n * @todo Description (review)\r\n * @param value Pisition\r\n * @return Position (0-1)\r\n */\r\n Axis.prototype.anyToPosition = function (value) {\r\n return 0;\r\n };\r\n /**\r\n * Converts any positional parameter to a relative position on axis.\r\n *\r\n * @todo Description (review)\r\n * @param value Pisition\r\n * @return Orientation point\r\n */\r\n Axis.prototype.anyToPoint = function (value) {\r\n return { x: 0, y: 0, angle: 0 };\r\n };\r\n /**\r\n * [getPositionRangePath description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param startPosition [description]\r\n * @param endPosition [description]\r\n * @return [description]\r\n */\r\n Axis.prototype.getPositionRangePath = function (startPosition, endPosition) {\r\n if (this.renderer) {\r\n return this.renderer.getPositionRangePath(startPosition, endPosition);\r\n }\r\n return \"\";\r\n };\r\n Object.defineProperty(Axis.prototype, \"axisLength\", {\r\n /**\r\n * Actual axis length in pixels.\r\n *\r\n * @return Axis length (px)\r\n */\r\n get: function () {\r\n if (this.renderer) {\r\n return this.renderer.axisLength;\r\n }\r\n return 0;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Axis.prototype, \"cursorTooltipEnabled\", {\r\n /**\r\n * @return Display tooltip?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"cursorTooltipEnabled\");\r\n },\r\n /**\r\n * Indicates if axis should display a tooltip for chart's cursor.\r\n *\r\n * @param value Display tooltip?\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"cursorTooltipEnabled\", value)) {\r\n if (value && this.renderer) {\r\n this.renderer.updateTooltip();\r\n }\r\n else if (this.tooltip) {\r\n this.tooltip.hide(0);\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Axis.prototype, \"toggleZoomOutButton\", {\r\n /**\r\n * @return Toggle zoom out button?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"toggleZoomOutButton\");\r\n },\r\n /**\r\n * Normally, when axis is zoomed in, a zoom out button is shown by a chart,\r\n * and vice versa: when axis is zoomed out completely, zoom out button is\r\n * hidden.\r\n *\r\n * Setting this to `false` will disable this behavior. Zooming in our out\r\n * this axis will not reveal or hide zoom out button.\r\n *\r\n * @default true\r\n * @since 4.6.2\r\n * @param value Toggle zoom out button?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"toggleZoomOutButton\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Hides element's [[Tooltip]].\r\n *\r\n * @see {@link Tooltip}\r\n */\r\n Axis.prototype.hideTooltip = function (duration) {\r\n _super.prototype.hideTooltip.call(this, duration);\r\n this._tooltipPosition = undefined;\r\n };\r\n /**\r\n * Shows Axis tooltip at specific relative position within Axis. (0-1)\r\n *\r\n * @param position Position (0-1)\r\n * @param local or global position\r\n */\r\n Axis.prototype.showTooltipAtPosition = function (position, local) {\r\n var tooltip = this._tooltip;\r\n if (!tooltip || this.dataItems.length <= 0) {\r\n this._tooltipPosition = undefined;\r\n }\r\n else {\r\n if (!local) {\r\n position = this.toAxisPosition(position);\r\n }\r\n if (!$type.isNumber(position) || position < this.start || position > this.end) {\r\n tooltip.hide(0);\r\n this._tooltipPosition = undefined;\r\n return;\r\n }\r\n var renderer = this.renderer;\r\n //@todo: think of how to solve this better\r\n if (!tooltip.parent) {\r\n tooltip.parent = this.tooltipContainer;\r\n }\r\n var tooltipLocation = renderer.tooltipLocation;\r\n var startPosition = this.getCellStartPosition(position);\r\n var endPosition = this.getCellEndPosition(position);\r\n if (this.tooltipPosition == \"fixed\") {\r\n position = startPosition + (endPosition - startPosition) * tooltipLocation;\r\n }\r\n position = $math.fitToRange(position, this.start, this.end);\r\n if (this._tooltipPosition != position) {\r\n this._tooltipPosition = position;\r\n var tooltipLocation2 = renderer.tooltipLocation2;\r\n var startPoint = renderer.positionToPoint(startPosition, tooltipLocation2);\r\n var endPoint = renderer.positionToPoint(endPosition, tooltipLocation2);\r\n // save values so cursor could use them\r\n this.currentItemStartPoint = startPoint;\r\n this.currentItemEndPoint = endPoint;\r\n if (renderer.fullWidthTooltip) {\r\n tooltip.width = endPoint.x - startPoint.x;\r\n tooltip.height = endPoint.y - startPoint.y;\r\n }\r\n var point = renderer.positionToPoint(position, tooltipLocation2);\r\n var globalPoint = $utils.spritePointToSvg(point, this.renderer.line);\r\n tooltip.text = this.getTooltipText(position);\r\n if (tooltip.text) {\r\n tooltip.delayedPointTo(globalPoint);\r\n tooltip.show();\r\n }\r\n }\r\n if (!this.cursorTooltipEnabled || this.tooltip.disabled) {\r\n tooltip.hide(0);\r\n }\r\n }\r\n };\r\n /**\r\n * Converts relative position (0-1) to Axis position with zoom level and\r\n * inversed taken into account.\r\n *\r\n * @param position Global position (0-1)\r\n * @return Position within Axis (0-1)\r\n */\r\n Axis.prototype.toAxisPosition = function (position) {\r\n position = this.renderer.toAxisPosition(position);\r\n if (position == undefined) {\r\n return;\r\n }\r\n position = position * (this.end - this.start);\r\n if (this.renderer.inversed) {\r\n position = this.end - position;\r\n }\r\n else {\r\n position = this.start + position;\r\n }\r\n return position;\r\n };\r\n /**\r\n * Converts position on the axis with zoom level and\r\n * inversed taken into account to global position.\r\n *\r\n * @param position Axis position (0-1)\r\n * @return Global position (0-1)\r\n */\r\n Axis.prototype.toGlobalPosition = function (position) {\r\n if (this.renderer.inversed) {\r\n position = this.end - position;\r\n }\r\n else {\r\n position = position - this.start;\r\n }\r\n return position / (this.end - this.start);\r\n };\r\n /**\r\n * Returns text to be used for cursor's Axis tooltip.\r\n *\r\n * This is a placeholder to override for extending classes.\r\n *\r\n * @ignore Exclude from docs\r\n * @param position Position coordinate (px)\r\n * @return Label text\r\n */\r\n Axis.prototype.getTooltipText = function (position) {\r\n return;\r\n };\r\n /**\r\n * Updates Axis' tooltip's position and possibly size, and pointer (stem)\r\n * place.\r\n *\r\n * @ignore Exclude from docs\r\n * @param pointerOrientation Pointer (stem) orientation\r\n * @param boundingRectangle A rectangle for tooltip to fit within\r\n */\r\n Axis.prototype.updateTooltip = function (pointerOrientation, boundingRectangle) {\r\n var tooltip = this._tooltip;\r\n if (tooltip) {\r\n tooltip.fixDoc = false;\r\n tooltip.pointerOrientation = pointerOrientation;\r\n tooltip.setBounds($utils.spriteRectToSvg(boundingRectangle, this.renderer.line));\r\n }\r\n };\r\n /**\r\n * [roundPosition description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param position Relative position\r\n * @param location Location on axis\r\n * @return Rounded position\r\n */\r\n Axis.prototype.roundPosition = function (position, location, axisLocation) {\r\n return position;\r\n };\r\n /**\r\n * [getCellStartPosition description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param position [description]\r\n * @return [description]\r\n */\r\n Axis.prototype.getCellStartPosition = function (position) {\r\n return position;\r\n };\r\n /**\r\n * [getCellEndPosition description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param position [description]\r\n * @return [description]\r\n */\r\n Axis.prototype.getCellEndPosition = function (position) {\r\n return position;\r\n };\r\n Object.defineProperty(Axis.prototype, \"axisRanges\", {\r\n /**\r\n * A list of axis ranges for this Axis.\r\n *\r\n * @return Axis ranges\r\n */\r\n get: function () {\r\n if (!this._axisRanges) {\r\n var dataItem = this.createDataItem();\r\n dataItem.isRange = true;\r\n dataItem.axisFill = this.renderer.axisFills.template.clone();\r\n dataItem.grid = this.renderer.grid.template.clone();\r\n dataItem.tick = this.renderer.ticks.template.clone();\r\n dataItem.label = this.renderer.labels.template.clone();\r\n dataItem.isTemplate = true;\r\n dataItem.component = this;\r\n dataItem.axisFill.disabled = false;\r\n dataItem.tick.disabled = false;\r\n dataItem.grid.disabled = false;\r\n dataItem.label.disabled = false;\r\n this._axisRanges = new ListTemplate(dataItem);\r\n this._axisRanges.events.on(\"inserted\", this.processAxisRange, this, false);\r\n this._disposers.push(new ListDisposer(this._axisRanges));\r\n this._disposers.push(this._axisRanges.template);\r\n }\r\n return this._axisRanges;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Decorates an axis range after it has been added to the axis range list.\r\n *\r\n * @param event Event\r\n */\r\n Axis.prototype.processAxisRange = function (event) {\r\n var axisRange = event.newValue;\r\n axisRange.component = this;\r\n axisRange.isRange = true;\r\n };\r\n Object.defineProperty(Axis.prototype, \"axisBreaks\", {\r\n /**\r\n * A list of axis breaks on this Axis.\r\n *\r\n * @return Axis breaks.\r\n */\r\n get: function () {\r\n if (!this._axisBreaks) {\r\n this._axisBreaks = new SortedListTemplate(this.createAxisBreak(), function (a, b) {\r\n return $number.order(a.adjustedStartValue, b.adjustedStartValue);\r\n });\r\n this._axisBreaks.events.on(\"inserted\", this.processBreak, this, false);\r\n this._disposers.push(new ListDisposer(this._axisBreaks));\r\n this._disposers.push(this._axisBreaks.template);\r\n }\r\n return this._axisBreaks;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates a new axis break.\r\n *\r\n * @return Axis break\r\n */\r\n Axis.prototype.createAxisBreak = function () {\r\n return new AxisBreak();\r\n };\r\n Object.defineProperty(Axis.prototype, \"series\", {\r\n /**\r\n * A list of Series currently associated with this Axis.\r\n *\r\n * @return Series\r\n */\r\n get: function () {\r\n if (!this._series) {\r\n this._series = new List();\r\n }\r\n return this._series;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Processes Series' data items.\r\n *\r\n * This is a placeholder to override for extending classes.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Axis.prototype.processSeriesDataItems = function () {\r\n };\r\n /**\r\n * Processes Series' single data item.\r\n *\r\n * This is a placeholder to override for extending classes.\r\n *\r\n * @ignore Exclude from docs\r\n * @param dataItem Data item\r\n */\r\n Axis.prototype.processSeriesDataItem = function (dataItem, axisLetter) {\r\n };\r\n /**\r\n * Post-processes Serie's data items.\r\n *\r\n * This is a placeholder to override for extending classes.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Axis.prototype.postProcessSeriesDataItems = function (series) {\r\n };\r\n /**\r\n * Post-processes Serie's single data item.\r\n *\r\n * This is a placeholder to override for extending classes.\r\n *\r\n * @ignore Exclude from docs\r\n * @param dataItem Data item\r\n */\r\n Axis.prototype.postProcessSeriesDataItem = function (dataItem) {\r\n };\r\n //\r\n /**\r\n * Updates Axis based on all Series that might influence it.\r\n *\r\n * Called by Series after Series data is validated.\r\n *\r\n * This is a placeholder to override for extending classes.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Axis.prototype.updateAxisBySeries = function () {\r\n };\r\n /**\r\n * Hides unused data items.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Axis.prototype.hideUnusedDataItems = function () {\r\n var _this = this;\r\n // hide all unused\r\n var dataItemsIterator = this._dataItemsIterator;\r\n dataItemsIterator.createNewItems = false;\r\n $iter.each(dataItemsIterator.iterator(), function (dataItem) {\r\n _this.validateDataElement(dataItem); // solves shrinking\r\n dataItem.__disabled = true;\r\n });\r\n dataItemsIterator.clear();\r\n dataItemsIterator.createNewItems = true;\r\n };\r\n /**\r\n * Returns a Series' data item that corresponds to specific position on Axis.\r\n *\r\n * This is a placeholder to override for extending classes.\r\n *\r\n * @ignore Exclude from docs\r\n * @param series Series\r\n * @param position Position (0-1)\r\n * @param findNearest Should axis try to find nearest tooltip if there is no data item at exact position\r\n * @return Data item\r\n */\r\n Axis.prototype.getSeriesDataItem = function (series, position, findNearest) {\r\n return;\r\n };\r\n /**\r\n * Returns an angle that corresponds to specific position on axis.\r\n *\r\n * This is a placeholder to override for extending classes.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (review)\r\n * @param dataItem Data item\r\n * @param key ???\r\n * @param location Location\r\n * @param stackKey ???\r\n * @return Angle\r\n */\r\n Axis.prototype.getAngle = function (dataItem, key, location, stackKey, range) {\r\n return;\r\n };\r\n /**\r\n * [getX description]\r\n *\r\n * This is a placeholder to override for extending classes.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (review)\r\n * @param dataItem [description]\r\n * @param key [description]\r\n * @param location [description]\r\n * @param stackKey [description]\r\n * @return [description]\r\n */\r\n Axis.prototype.getX = function (dataItem, key, location, stackKey, range) {\r\n return;\r\n };\r\n /**\r\n * [getX description]\r\n *\r\n * This is a placeholder to override for extending classes.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (review)\r\n * @param dataItem [description]\r\n * @param key [description]\r\n * @param location [description]\r\n * @param stackKey [description]\r\n * @return [description]\r\n */\r\n Axis.prototype.getPositionX = function (dataItem, key, location, stackKey, range) {\r\n return;\r\n };\r\n /**\r\n * [getY description]\r\n *\r\n * This is a placeholder to override for extending classes.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (review)\r\n * @param dataItem [description]\r\n * @param key [description]\r\n * @param location [description]\r\n * @param stackKey [description]\r\n * @return [description]\r\n */\r\n Axis.prototype.getY = function (dataItem, key, location, stackKey, range) {\r\n return;\r\n };\r\n /**\r\n * [getY description]\r\n *\r\n * This is a placeholder to override for extending classes.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (review)\r\n * @param dataItem [description]\r\n * @param key [description]\r\n * @param location [description]\r\n * @param stackKey [description]\r\n * @return [description]\r\n */\r\n Axis.prototype.getPositionY = function (dataItem, key, location, stackKey, range) {\r\n return;\r\n };\r\n Object.defineProperty(Axis.prototype, \"basePoint\", {\r\n /**\r\n * Coordinates of the actual axis start.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Base point coordinates\r\n */\r\n get: function () {\r\n return { x: 0, y: 0 };\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * [dataChangeUpdate description]\r\n *\r\n * This is a placeholder to override for extending classes.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n Axis.prototype.dataChangeUpdate = function () {\r\n };\r\n /**\r\n * [dataChangeUpdate description]\r\n *\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n Axis.prototype.seriesDataChangeUpdate = function (series) {\r\n };\r\n /**\r\n * Removes axis breaks that fall between `min` and `max` (???)\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (review)\r\n * @param min Start value\r\n * @param max End value\r\n * @return Spread o\r\n */\r\n Axis.prototype.adjustDifference = function (min, max) {\r\n var difference = max - min;\r\n if ($type.isNumber(difference)) {\r\n if (this._axisBreaks) {\r\n $iter.eachContinue(this._axisBreaks.iterator(), function (axisBreak) {\r\n var startValue = axisBreak.adjustedStartValue;\r\n var endValue = axisBreak.adjustedEndValue;\r\n if ($type.isNumber(startValue) && $type.isNumber(endValue)) {\r\n // breaks are sorted, we don't need go further anymore\r\n if (startValue > max) {\r\n return false;\r\n }\r\n if (endValue >= min) {\r\n if ($type.isNumber(startValue) && $type.isNumber(endValue)) {\r\n var breakSize = axisBreak.breakSize;\r\n var intersection = $math.intersection({ start: startValue, end: endValue }, { start: min, end: max });\r\n if (intersection) {\r\n difference -= (intersection.end - intersection.start) * (1 - breakSize);\r\n }\r\n }\r\n }\r\n return true;\r\n }\r\n });\r\n }\r\n return difference;\r\n }\r\n };\r\n /**\r\n * Checks if specific value falls within a break.\r\n *\r\n * Returns [[AxisBreak]] the value falls into.\r\n *\r\n * @param value Value to check\r\n * @return Axis break\r\n */\r\n Axis.prototype.isInBreak = function (value) {\r\n if (this._axisBreaks) {\r\n return $iter.find(this._axisBreaks.iterator(), function (axisBreak) {\r\n return value >= axisBreak.adjustedStartValue &&\r\n value <= axisBreak.adjustedEndValue;\r\n });\r\n }\r\n };\r\n /**\r\n * [fixAxisBreaks description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n Axis.prototype.fixAxisBreaks = function () {\r\n var _this = this;\r\n if (this._axisBreaks) {\r\n var axisBreaks = this._axisBreaks;\r\n if (axisBreaks.length > 0) {\r\n // first make sure that startValue is <= end value\r\n // This needs to make a copy of axisBreaks because it mutates the list while traversing\r\n // TODO very inefficient\r\n $array.each($iter.toArray(axisBreaks.iterator()), function (axisBreak) {\r\n var startValue = $math.min(axisBreak.startValue, axisBreak.endValue);\r\n var endValue = $math.max(axisBreak.startValue, axisBreak.endValue);\r\n axisBreak.adjustedStartValue = startValue;\r\n axisBreak.adjustedEndValue = endValue;\r\n _this._axisBreaks.update(axisBreak);\r\n });\r\n var firstAxisBreak = axisBreaks.first;\r\n var previousEndValue_1 = Math.min(firstAxisBreak.startValue, firstAxisBreak.endValue);\r\n // process breaks\r\n // TODO does this need to call axisBreaks.update ?\r\n $iter.each(axisBreaks.iterator(), function (axisBreak) {\r\n var startValue = axisBreak.adjustedStartValue;\r\n var endValue = axisBreak.adjustedEndValue;\r\n // breaks can't overlap\r\n // if break starts before previous break ends\r\n if (startValue < previousEndValue_1) {\r\n startValue = previousEndValue_1;\r\n if (endValue < previousEndValue_1) {\r\n endValue = previousEndValue_1;\r\n }\r\n }\r\n axisBreak.adjustedStartValue = startValue;\r\n axisBreak.adjustedEndValue = endValue;\r\n });\r\n }\r\n }\r\n };\r\n Object.defineProperty(Axis.prototype, \"startIndex\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return [description]\r\n */\r\n get: function () {\r\n return 0;\r\n },\r\n /**\r\n * We need start/end indexes of axes to be 0 - `dataItems.length`.\r\n *\r\n * Yes, also for category axis, this helps to avoid jumping of categories\r\n * while scrolling and does not do a lot of extra work as we use\r\n * protected `_startIndex` and `_endIndex` when working with items.\r\n *\r\n * @hidden\r\n */\r\n /**\r\n * [startIndex description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param value [description]\r\n */\r\n set: function (value) {\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Axis.prototype, \"endIndex\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return [description]\r\n */\r\n get: function () {\r\n return this.dataItems.length;\r\n },\r\n /**\r\n * [endIndex description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param value [description]\r\n */\r\n set: function (value) {\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns a formatted label based on position.\r\n *\r\n * Individual axis types should override this method to generate a label\r\n * that is relevant to axis type.\r\n *\r\n * Please note that `position` represents position within axis which may be\r\n * zoomed and not correspond to Cursor's `position`.\r\n *\r\n * To convert Cursor's `position` to Axis' `position` use `toAxisPosition()` method.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/tutorials/tracking-cursors-position-via-api/#Tracking_Cursor_s_position} For more information about cursor tracking.\r\n * @param position Relative position on axis (0-1)\r\n * @return Position label\r\n */\r\n Axis.prototype.getPositionLabel = function (position) {\r\n return Math.round(position * 100) + \"%x\";\r\n };\r\n Object.defineProperty(Axis.prototype, \"chart\", {\r\n /**\r\n * @return Chart\r\n */\r\n get: function () {\r\n return this._chart;\r\n },\r\n /**\r\n * A Chart this Axis belongs to.\r\n *\r\n * @param value Chart\r\n */\r\n set: function (value) {\r\n this._chart = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates a data item for a Series range.\r\n *\r\n * @param series Target Series\r\n * @return Range data item\r\n */\r\n Axis.prototype.createSeriesRange = function (series) {\r\n var range = this.axisRanges.create();\r\n range.component = this;\r\n range.axisFill = this.renderer.axisFills.template.clone();\r\n range.axisFill.disabled = false;\r\n range.axisFill.fillOpacity = 0;\r\n range.grid = this.renderer.grid.template.clone();\r\n range.grid.disabled = true;\r\n range.tick = this.renderer.ticks.template.clone();\r\n range.tick.disabled = true;\r\n range.label = this.renderer.labels.template.clone();\r\n range.label.disabled = true;\r\n range.addDisposer(new Disposer(function () {\r\n series.axisRanges.removeValue(range);\r\n }));\r\n series.axisRanges.push(range);\r\n return range;\r\n };\r\n /**\r\n * Copies all properties and related data from a different instance of Axis.\r\n *\r\n * @param source Source Axis\r\n */\r\n Axis.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n if (this.renderer) {\r\n this.renderer.copyFrom(source.renderer);\r\n }\r\n else {\r\n if (source.renderer) {\r\n this.renderer = source.renderer.clone();\r\n this._disposers.push(this.renderer);\r\n }\r\n }\r\n if (source.title) {\r\n if (!this.title) {\r\n this.title = source.title.clone();\r\n this.title.parent = this;\r\n }\r\n else {\r\n this.title.copyFrom(source.title);\r\n }\r\n this._disposers.push(this.title);\r\n }\r\n };\r\n /**\r\n * Resets internal iterator.\r\n */\r\n Axis.prototype.resetIterators = function () {\r\n this._dataItemsIterator.reset();\r\n };\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n Axis.prototype.processConfig = function (config) {\r\n if (config) {\r\n // Set up axis ranges\r\n if ($type.hasValue(config.axisRanges) && $type.isArray(config.axisRanges)) {\r\n for (var i = 0, len = config.axisRanges.length; i < len; i++) {\r\n var range = config.axisRanges[i];\r\n // If `series` is set, we know it's a series range\r\n if ($type.hasValue(range[\"series\"])) {\r\n if ($type.isString(range[\"series\"])) {\r\n if (this.map.hasKey(range[\"series\"])) {\r\n //range[\"series\"] = this.map.getKey(range[\"series\"]);\r\n config.axisRanges[i] = this.createSeriesRange(this.map.getKey(range[\"series\"]));\r\n delete (range[\"series\"]);\r\n config.axisRanges[i].config = range;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n /**\r\n * Ordering function used in JSON setup.\r\n *\r\n * @param a Item A\r\n * @param b Item B\r\n * @return Order\r\n */\r\n Axis.prototype.configOrder = function (a, b) {\r\n if (a == b) {\r\n return 0;\r\n }\r\n // last\r\n else if (a == \"title\") {\r\n return 1;\r\n }\r\n else if (b == \"title\") {\r\n return -1;\r\n }\r\n // first\r\n else if (a == \"component\") {\r\n return -1;\r\n }\r\n else if (b == \"component\") {\r\n return 1;\r\n }\r\n else {\r\n return _super.prototype.configOrder.call(this, a, b);\r\n }\r\n };\r\n Object.defineProperty(Axis.prototype, \"startLocation\", {\r\n /**\r\n * @return Location (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"startLocation\");\r\n },\r\n /**\r\n * Axis start location. Works on Date/Category axis, doesn't work on Value axis.\r\n *\r\n * * 0 - Full first cell is shown.\r\n * * 0.5 - Half of first cell is shown.\r\n * * 1 - None of the first cell is visible. (you probably don't want that)\r\n *\r\n * @param value Location (0-1)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"startLocation\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Axis.prototype, \"endLocation\", {\r\n /**\r\n * @return Location (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"endLocation\");\r\n },\r\n /**\r\n * Axis end location. Works on Date/Category axis, doesn't work on Value axis.\r\n *\r\n * * 0 - None of the last cell is shown. (don't do that)\r\n * * 0.5 - Half of the last cell is shown.\r\n * * 1 - Full last cell is shown.\r\n *\r\n * @param value Location (0-1)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"endLocation\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Axis.prototype.setDisabled = function (value) {\r\n var changed = _super.prototype.setDisabled.call(this, value);\r\n if (this.renderer) {\r\n this.renderer.gridContainer.disabled = value;\r\n }\r\n return changed;\r\n };\r\n Object.defineProperty(Axis.prototype, \"title\", {\r\n /**\r\n * @return Title label\r\n */\r\n get: function () {\r\n return this._title;\r\n },\r\n /**\r\n * A reference to a [[Label]] element which serves as a title to the axis.\r\n *\r\n * When axis is created it aleready has an element, so you can just modify\r\n * it.\r\n *\r\n * Or you can replace it with your own instance of `Label`.\r\n *\r\n * @param value Title label\r\n */\r\n set: function (value) {\r\n if (this._title && this._title != value) {\r\n this._title.dispose();\r\n }\r\n if (value) {\r\n this._title = value;\r\n value.parent = this;\r\n value.shouldClone = false;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Axis.prototype, \"hideTooltipWhileZooming\", {\r\n /**\r\n * @return Hide tooltip while zooming?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"hideTooltipWhileZooming\");\r\n },\r\n /**\r\n * Indicates if axis' tooltip should be hidden while axis range is animating\r\n * (zooming)\r\n *\r\n * @default true\r\n * @since 4.7.16\r\n * @param value Hide tooltip while zooming?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"hideTooltipWhileZooming\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Axis.prototype, \"zoomable\", {\r\n /**\r\n * @return Zoomable?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"zoomable\");\r\n },\r\n /**\r\n * Should the axis be zoomed with scrollbar/cursor?\r\n *\r\n * @default true\r\n * @since 4.9.28\r\n * @param value Zoomable?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"zoomable\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Axis;\r\n}(Component));\r\nexport { Axis };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Axis\"] = Axis;\r\nregistry.registeredClasses[\"AxisDataItem\"] = AxisDataItem;\r\n/**\r\n * Add default responsive rules\r\n */\r\n/**\r\n * Disable axis tooltips.\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.maybeXS,\r\n state: function (target, stateId) {\r\n if (target instanceof Axis && target.tooltip) {\r\n var state = target.states.create(stateId);\r\n state.properties.cursorTooltipEnabled = false;\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n//# sourceMappingURL=Axis.js.map","/**\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { color } from \"../../core/utils/Color\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Used to draw Axis line.\r\n *\r\n * @see {@link IAxisLineEvents} for a list of available events\r\n * @see {@link IAxisLineAdapters} for a list of available Adapters\r\n */\r\nvar AxisLine = /** @class */ (function (_super) {\r\n __extends(AxisLine, _super);\r\n /**\r\n * Constructor\r\n */\r\n function AxisLine() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"AxisLine\";\r\n _this.element = _this.paper.add(\"path\");\r\n var interfaceColors = new InterfaceColorSet();\r\n _this.stroke = interfaceColors.getFor(\"grid\");\r\n _this.strokeOpacity = 0.15;\r\n _this.pixelPerfect = true;\r\n _this.fill = color();\r\n _this.applyTheme();\r\n _this.interactionsEnabled = false;\r\n return _this;\r\n //this.element.moveTo({ x: 0, y: 0 });\r\n }\r\n return AxisLine;\r\n}(Sprite));\r\nexport { AxisLine };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisLine\"] = AxisLine;\r\n//# sourceMappingURL=AxisLine.js.map","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * AxisFill is a base class used to defines fill shapes for various\r\n * type-specific Axes.\r\n *\r\n * Axis fills are used to add fills to specific ranges of those axes.\r\n *\r\n * @see {@link IAxisFillEvents} for a list of available events\r\n * @see {@link IAxisFillAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar AxisFill = /** @class */ (function (_super) {\r\n __extends(AxisFill, _super);\r\n /**\r\n * Constructor.\r\n *\r\n * @param axis Axis\r\n */\r\n function AxisFill(axis) {\r\n var _this = _super.call(this) || this;\r\n _this.axis = axis;\r\n _this.element = _this.paper.add(\"path\");\r\n _this.className = \"AxisFill\";\r\n _this.isMeasured = false;\r\n _this.location = 0;\r\n _this.above = false;\r\n var interfaceColors = new InterfaceColorSet();\r\n _this.fill = interfaceColors.getFor(\"alternativeBackground\");\r\n _this.fillOpacity = 0;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * @ignore\r\n */\r\n AxisFill.prototype.setDisabled = function (value) {\r\n var changed = _super.prototype.setDisabled.call(this, value);\r\n if (this.axis) {\r\n this.axis.invalidateDataItems();\r\n }\r\n return changed;\r\n };\r\n /**\r\n * Draws the fill element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n AxisFill.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n if (this.__disabled || this.disabled) {\r\n return;\r\n }\r\n if (this.axis && $type.isNumber(this.startPosition) && $type.isNumber(this.endPosition)) {\r\n this.fillPath = this.axis.getPositionRangePath(this.startPosition, this.endPosition);\r\n this.path = this.fillPath;\r\n if (this.isMeasured) {\r\n this.measure();\r\n }\r\n }\r\n };\r\n Object.defineProperty(AxisFill.prototype, \"startPosition\", {\r\n /**\r\n * @return Start position\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"startPosition\");\r\n },\r\n /**\r\n * An actual starting position of the fill.\r\n *\r\n * @param value Starting position\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"startPosition\", value);\r\n this.invalidate(); // this is needed as relative position might not change when zooming\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisFill.prototype, \"endPosition\", {\r\n /**\r\n * @return End position\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"endPosition\");\r\n },\r\n /**\r\n * An actual end position of the fill.\r\n *\r\n * @param value End position\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"endPosition\", value);\r\n this.invalidate(); // this is needed as relative position might not change when zooming\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisFill.prototype, \"location\", {\r\n /**\r\n * @return Location (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"location\");\r\n },\r\n /**\r\n * Relative location of the fill. (0-1)\r\n *\r\n * @param value Location (0-1)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"location\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n AxisFill.prototype.setPath = function (value) {\r\n if (this.setPropertyValue(\"path\", value)) {\r\n this.element.attr({ \"d\": value });\r\n return true;\r\n }\r\n return false;\r\n };\r\n Object.defineProperty(AxisFill.prototype, \"above\", {\r\n /**\r\n * @return Draw above series?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"above\");\r\n },\r\n /**\r\n * Normally fill goes below series. Set this to `true` to go above.\r\n *\r\n * @default false\r\n * @since 4.5.9\r\n * @param value Draw above series?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"above\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return AxisFill;\r\n}(Sprite));\r\nexport { AxisFill };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisFill\"] = AxisFill;\r\n//# sourceMappingURL=AxisFill.js.map","/**\r\n * A module defining functionality for axis grid elements.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { color } from \"../../core/utils/Color\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { defaultRules, ResponsiveBreakpoints } from \"../../core/utils/Responsive\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Displays an axis grid line.\r\n *\r\n * @see {@link IGridEvents} for a list of available events\r\n * @see {@link IGridAdapters} for a list of available Adapters\r\n * @todo Review: container is better, as we'll be able to attach something to the grid, also with 3d charts we might need some additional elements\r\n * @important\r\n */\r\nvar Grid = /** @class */ (function (_super) {\r\n __extends(Grid, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Grid() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Grid\";\r\n _this.element = _this.paper.add(\"path\");\r\n _this.location = 0.5;\r\n _this.isMeasured = false;\r\n _this.above = false;\r\n var interfaceColors = new InterfaceColorSet();\r\n _this.stroke = interfaceColors.getFor(\"grid\");\r\n _this.pixelPerfect = true;\r\n _this.strokeOpacity = 0.15;\r\n _this.fill = color(); // \"none\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(Grid.prototype, \"location\", {\r\n /**\r\n * @return Location (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"location\");\r\n },\r\n /**\r\n * Location within axis cell to place grid line on.\r\n *\r\n * * 0 - start\r\n * * 0.5 - middle\r\n * * 1 - end\r\n *\r\n * @param value Location (0-1)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"location\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Grid.prototype, \"above\", {\r\n /**\r\n * @return Draw above series?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"above\");\r\n },\r\n /**\r\n * Normally fill goes below series. Set this to `true` to go above.\r\n *\r\n * @default false\r\n * @since 4.5.9\r\n * @param value Draw above series?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"above\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n Grid.prototype.setDisabled = function (value) {\r\n var changed = _super.prototype.setDisabled.call(this, value);\r\n if (this.axis) {\r\n this.axis.invalidateDataItems();\r\n }\r\n return changed;\r\n };\r\n return Grid;\r\n}(Sprite));\r\nexport { Grid };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Grid\"] = Grid;\r\n/**\r\n * Add default responsive rules\r\n */\r\n/**\r\n * Disable grid on smaller charts\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.maybeXS,\r\n state: function (target, stateId) {\r\n if (target instanceof Grid) {\r\n var state = target.states.create(stateId);\r\n state.properties.disabled = true;\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n//# sourceMappingURL=Grid.js.map","/**\r\n * Axis Label module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Label } from \"../../core/elements/Label\";\r\nimport { registry } from \"../../core/Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Use to create labels on Axis.\r\n *\r\n * @see {@link IAxisLabelEvents} for a list of available events\r\n * @see {@link IAxisLabelAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar AxisLabel = /** @class */ (function (_super) {\r\n __extends(AxisLabel, _super);\r\n /**\r\n * Constructor\r\n */\r\n function AxisLabel() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"AxisLabel\";\r\n _this.isMeasured = false;\r\n _this.padding(10, 10, 10, 10);\r\n _this.location = 0.5;\r\n //this.nonScaling = true; // not good for perf\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(AxisLabel.prototype, \"location\", {\r\n /**\r\n * @return Location (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"location\");\r\n },\r\n /**\r\n * Relative location of the label. (0-1)\r\n *\r\n * @param value Location (0-1)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"location\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisLabel.prototype, \"inside\", {\r\n /**\r\n * Returns if label is set to be drawn inside axis.\r\n *\r\n * @return Inside?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"inside\");\r\n },\r\n /**\r\n * Sets if label should be drawn inside axis.\r\n *\r\n * @param value Inside?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"inside\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n AxisLabel.prototype.setDisabled = function (value) {\r\n var changed = _super.prototype.setDisabled.call(this, value);\r\n if (this.axis) {\r\n this.axis.invalidateDataItems();\r\n }\r\n return changed;\r\n };\r\n return AxisLabel;\r\n}(Label));\r\nexport { AxisLabel };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisLabel\"] = AxisLabel;\r\n//# sourceMappingURL=AxisLabel.js.map","/**\r\n * Tick module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A basic Tick class.\r\n *\r\n * A tick is a short dash, mainly connecting an object like axis or slice to\r\n * it's textual label.\r\n *\r\n * @see {@link ITickEvents} for a list of available events\r\n * @see {@link ITickAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar Tick = /** @class */ (function (_super) {\r\n __extends(Tick, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Tick() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Tick\";\r\n var interfaceColors = new InterfaceColorSet();\r\n _this.fillOpacity = 0;\r\n _this.length = 6;\r\n _this.strokeOpacity = 0.2;\r\n _this.stroke = interfaceColors.getFor(\"grid\");\r\n _this.isMeasured = false;\r\n _this.nonScalingStroke = true;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(Tick.prototype, \"length\", {\r\n /**\r\n * @return Length (px)\r\n */\r\n get: function () {\r\n if (this.disabled) {\r\n return 0;\r\n }\r\n return this.getPropertyValue(\"length\");\r\n },\r\n /**\r\n * Length of the tick in pixels.\r\n *\r\n * @param value Length (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"length\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Tick;\r\n}(Sprite));\r\nexport { Tick };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Tick\"] = Tick;\r\n//# sourceMappingURL=Tick.js.map","/**\r\n * Axis Tick module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Tick } from \"../elements/Tick\";\r\nimport { registry } from \"../../core/Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws an axis tick\r\n * @see {@link IAxisTickEvents} for a list of available events\r\n * @see {@link IAxisTickAdapters} for a list of available Adapters\r\n */\r\nvar AxisTick = /** @class */ (function (_super) {\r\n __extends(AxisTick, _super);\r\n function AxisTick() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"AxisTick\";\r\n _this.element = _this.paper.add(\"path\");\r\n _this.location = 0.5;\r\n _this.above = false;\r\n _this.isMeasured = false;\r\n _this.pixelPerfect = true;\r\n _this.strokeOpacity = 0;\r\n _this.length = 5;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(AxisTick.prototype, \"location\", {\r\n /**\r\n * @return Location (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"location\");\r\n },\r\n /**\r\n * Relative location of the tick. (0-1)\r\n *\r\n * @param value Location (0-1)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"location\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisTick.prototype, \"inside\", {\r\n /**\r\n * Returns if label is set to be drawn inside axis.\r\n *\r\n * @return Inside?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"inside\");\r\n },\r\n /**\r\n * Sets if tick should be drawn inside axis.\r\n *\r\n * @param value Inside?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"inside\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisTick.prototype, \"above\", {\r\n /**\r\n * @return Draw above series?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"above\");\r\n },\r\n /**\r\n * Normally tick goes below series. Set this to `true` to go above.\r\n *\r\n * @default false\r\n * @since 4.5.9\r\n * @param value Draw above series?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"above\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n AxisTick.prototype.setDisabled = function (value) {\r\n var changed = _super.prototype.setDisabled.call(this, value);\r\n if (this.axis) {\r\n this.axis.invalidateDataItems();\r\n }\r\n return changed;\r\n };\r\n return AxisTick;\r\n}(Tick));\r\nexport { AxisTick };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisTick\"] = AxisTick;\r\n//# sourceMappingURL=AxisTick.js.map","/**\r\n * Module, defining base Axis Renderer.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../../core/Container\";\r\nimport { MutableValueDisposer } from \"../../core/utils/Disposer\";\r\nimport { AxisDataItem } from \"./Axis\";\r\nimport { AxisLine } from \"./AxisLine\";\r\nimport { AxisFill } from \"./AxisFill\";\r\nimport { Grid } from \"./Grid\";\r\nimport { AxisLabel } from \"./AxisLabel\";\r\nimport { AxisTick } from \"./AxisTick\";\r\nimport { ListTemplate, ListDisposer } from \"../../core/utils/List\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { percent } from \"../../core/utils/Percent\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A base class for all axis renderers.\r\n *\r\n * @see {@link IAxisRendererEvents} for a list of available events\r\n * @see {@link IAxisRendererAdapters} for a list of available Adapters\r\n */\r\nvar AxisRenderer = /** @class */ (function (_super) {\r\n __extends(AxisRenderer, _super);\r\n /**\r\n * Constructor.\r\n *\r\n * @param axis Related axis\r\n */\r\n function AxisRenderer() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * A related chart.\r\n */\r\n _this._chart = new MutableValueDisposer();\r\n _this.className = \"AxisRenderer\";\r\n // Set defaults\r\n _this.minGridDistance = 50;\r\n _this.inside = false;\r\n _this.inversed = false;\r\n _this.tooltipLocation = 0.5;\r\n _this.fullWidthTooltip = false;\r\n _this.cellStartLocation = 0;\r\n _this.cellEndLocation = 1;\r\n _this.minLabelPosition = 0;\r\n _this.maxLabelPosition = 1;\r\n _this.shouldClone = false;\r\n var gridContainer = _this.createChild(Container);\r\n gridContainer.shouldClone = false;\r\n gridContainer.layout = \"none\";\r\n //\tgridContainer.isMeasured = false;\r\n gridContainer.virtualParent = _this;\r\n gridContainer.width = percent(100);\r\n gridContainer.height = percent(100);\r\n _this.gridContainer = gridContainer;\r\n // not good without this\r\n gridContainer.events.on(\"maxsizechanged\", function () {\r\n if (_this.inited) {\r\n _this.invalidateAxisItems();\r\n }\r\n }, _this, false);\r\n var breakContainer = _this.createChild(Container);\r\n breakContainer.shouldClone = false;\r\n breakContainer.isMeasured = false;\r\n breakContainer.layout = \"none\";\r\n breakContainer.width = percent(100);\r\n breakContainer.height = percent(100);\r\n _this.breakContainer = breakContainer;\r\n var bulletsContainer = _this.createChild(Container);\r\n bulletsContainer.shouldClone = false;\r\n bulletsContainer.isMeasured = false;\r\n bulletsContainer.layout = \"none\";\r\n bulletsContainer.width = percent(100);\r\n bulletsContainer.height = percent(100);\r\n _this.bulletsContainer = bulletsContainer;\r\n _this.line = _this.createChild(AxisLine);\r\n _this.line.shouldClone = false;\r\n _this.line.strokeOpacity = 0;\r\n var baseGrid = _this.createChild(Grid);\r\n baseGrid.shouldClone = false;\r\n _this.baseGrid = baseGrid;\r\n // Make elements disposable\r\n var disposers = _this._disposers;\r\n disposers.push(baseGrid);\r\n disposers.push(_this.line);\r\n disposers.push(gridContainer);\r\n disposers.push(breakContainer);\r\n disposers.push(bulletsContainer);\r\n disposers.push(_this._chart);\r\n _this.ticks.template.disabled = true;\r\n _this.axisFills.template.disabled = true;\r\n _this.axisFills.template.interactionsEnabled = false;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(AxisRenderer.prototype, \"axis\", {\r\n /**\r\n * Axis of a renderer\r\n * @return axis Axis\r\n */\r\n get: function () {\r\n return this._axis;\r\n },\r\n /**\r\n * Axis of a renderer\r\n * @param axis Axis\r\n */\r\n set: function (axis) {\r\n this.setAxis(axis);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n AxisRenderer.prototype.setAxis = function (axis) {\r\n this._axis = axis;\r\n this.baseGrid.parent = axis;\r\n this.line.parent = axis;\r\n this.gridContainer.bind(\"opacity\", axis);\r\n };\r\n /**\r\n * Called when rendered is attached to an Axis, as well as a property of\r\n * Axis that might affect the appearance is updated.\r\n *\r\n * E.g. `axis.opposite`, `axis.inside`, etc.\r\n *\r\n * This method is called **before** draw, so that any related setting\r\n * changed in this method can be changed.\r\n *\r\n * @todo Description (review)\r\n * @ignore Exclude from docs\r\n */\r\n AxisRenderer.prototype.processRenderer = function () {\r\n this.events.on(\"sizechanged\", this.updateTooltip, this, false);\r\n this.events.on(\"positionchanged\", this.updateTooltip, this, false);\r\n this.labels.template.inside = this.inside;\r\n this.ticks.template.inside = this.inside;\r\n };\r\n /**\r\n * Updates Axis' tooltip.\r\n *\r\n * @todo Description (review)\r\n * @ignore Exclude from docs\r\n */\r\n AxisRenderer.prototype.updateTooltip = function () {\r\n // This is a placeholder method for extending classes to override.\r\n };\r\n Object.defineProperty(AxisRenderer.prototype, \"axisLength\", {\r\n /**\r\n * Returns actual length of the Axis, in pixels.\r\n *\r\n * @return Length (px)\r\n */\r\n get: function () {\r\n // This is a placeholder method for extending classes to override.\r\n return 0;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Re-positions an element to new coordinates.\r\n *\r\n * @ignore Exclude from docs\r\n * @param item A target element\r\n * @param point New coordinates\r\n */\r\n AxisRenderer.prototype.positionItem = function (item, point) {\r\n if (item) {\r\n item.moveTo(point);\r\n }\r\n };\r\n /**\r\n * Converts relative position on axis to point coordinates.\r\n *\r\n * @param position Position (0-1)\r\n * @return Point\r\n */\r\n AxisRenderer.prototype.positionToPoint = function (position, position2) {\r\n // This is a placeholder method for extending classes to override.\r\n return { x: 0, y: 0 };\r\n };\r\n /**\r\n * Converts relative position on axis to angle.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (review / units)\r\n * @param position Position (0-1)\r\n * @return Angle\r\n */\r\n AxisRenderer.prototype.positionToAngle = function (position) {\r\n // This is a placeholder method for extending classes to override.\r\n return 0;\r\n };\r\n /**\r\n * Converts relative position (0-1) on axis to a pixel coordinate.\r\n *\r\n * @param position Position (0-1)\r\n * @return Coordinate (px)\r\n */\r\n AxisRenderer.prototype.positionToCoordinate = function (position) {\r\n var coordinate;\r\n var axis = this.axis;\r\n var axisFullLength = axis.axisFullLength;\r\n if (axis.renderer.inversed) {\r\n coordinate = (axis.end - position) * axisFullLength;\r\n }\r\n else {\r\n coordinate = (position - axis.start) * axisFullLength;\r\n }\r\n return coordinate;\r\n };\r\n AxisRenderer.prototype.updateGridContainer = function () {\r\n };\r\n AxisRenderer.prototype.getHeight = function () {\r\n var gridContainer = this.gridContainer;\r\n if (gridContainer.parent) {\r\n return gridContainer.parent.pixelHeight;\r\n }\r\n return this.gridContainer.pixelHeight || 0;\r\n };\r\n AxisRenderer.prototype.getWidth = function () {\r\n var gridContainer = this.gridContainer;\r\n if (gridContainer.parent) {\r\n return gridContainer.parent.pixelWidth;\r\n }\r\n return this.gridContainer.pixelWidth || 0;\r\n };\r\n /**\r\n * Converts a coordinate in pixels to a relative position. (0-1)\r\n *\r\n * @param coordinate Coordinate (px)\r\n * @param coordinate2 Coordinate of a second axis, only needed for complex axes systems, like timeline (px)\r\n * @return Position (0-1)\r\n */\r\n AxisRenderer.prototype.coordinateToPosition = function (coordinate, coordinate2) {\r\n var position;\r\n var axis = this.axis;\r\n var axisFullLength = axis.axisFullLength;\r\n if (axis.renderer.inversed) {\r\n position = axis.end - coordinate / axisFullLength;\r\n }\r\n else {\r\n position = coordinate / axisFullLength + axis.start;\r\n }\r\n return $math.round(position, 5);\r\n };\r\n /**\r\n * Converts a point at specific coordinates to a relative position (0-1)\r\n * on the axis.\r\n *\r\n * @ignore Exclude from docs\r\n * @param point Point\r\n * @return Position (0-1)\r\n */\r\n AxisRenderer.prototype.pointToPosition = function (point) {\r\n // This is a placeholder method for extending classes to override.\r\n return 0;\r\n };\r\n /**\r\n * [getPositionRangePath description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param startPosition Starting position\r\n * @param endPosition End position\r\n * @return SVG path\r\n */\r\n AxisRenderer.prototype.getPositionRangePath = function (startPosition, endPosition) {\r\n return \"\";\r\n };\r\n /**\r\n * Invalidates all axis data items, effectively causing them re-evaluated.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (review)\r\n */\r\n AxisRenderer.prototype.invalidateAxisItems = function () {\r\n var axis = this.axis;\r\n if (axis) {\r\n axis.invalidateDataItems();\r\n }\r\n };\r\n /**\r\n * Updates and positions a grid element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param grid Grid element\r\n * @param position Starting position\r\n * @param endPosition End position\r\n */\r\n AxisRenderer.prototype.updateGridElement = function (grid, position, endPosition) {\r\n // This is a placeholder method for extending classes to override.\r\n };\r\n /**\r\n * Updates and positions a tick element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param tick Tick element\r\n * @param position Starting position\r\n * @param endPosition End position\r\n */\r\n AxisRenderer.prototype.updateTickElement = function (tick, position, endPosition) {\r\n // This is a placeholder method for extending classes to override.\r\n };\r\n /**\r\n * Updates and positions axis bullet.\r\n *\r\n * @ignore Exclude from docs\r\n * @param bullet AxisBullet element\r\n * @param position Starting position\r\n * @param endPosition End position\r\n */\r\n AxisRenderer.prototype.updateBullet = function (bullet, position, endPosition) {\r\n // This is a placeholder method for extending classes to override.\r\n };\r\n /**\r\n * Updates and positions a label element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param label Label element\r\n * @param position Starting position\r\n * @param endPosition Ending position\r\n */\r\n AxisRenderer.prototype.updateLabelElement = function (label, position, endPosition, location) {\r\n // This is a placeholder method for extending classes to override.\r\n };\r\n /**\r\n * Updates and positions the axis fill element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param fill Fill element\r\n * @param position Starting position\r\n * @param endPosition Ending position\r\n */\r\n AxisRenderer.prototype.updateFillElement = function (fill, position, endPosition) {\r\n fill.startPosition = position;\r\n fill.endPosition = endPosition;\r\n };\r\n /**\r\n * Updates and positions the axis line element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n AxisRenderer.prototype.updateAxisLine = function () {\r\n // This is a placeholder method for extending classes to override.\r\n };\r\n /**\r\n * Updates and positions the base grid element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n AxisRenderer.prototype.updateBaseGridElement = function () {\r\n // This is a placeholder method for extending classes to override.\r\n };\r\n /**\r\n * Updates and positions an axis break element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param axisBreak Break element\r\n */\r\n AxisRenderer.prototype.updateBreakElement = function (axisBreak) {\r\n this.positionItem(axisBreak.startLine, axisBreak.startPoint);\r\n this.toggleVisibility(axisBreak.startLine, axisBreak.startPosition, 0, 1);\r\n this.positionItem(axisBreak.endLine, axisBreak.endPoint);\r\n this.toggleVisibility(axisBreak.endLine, axisBreak.endPosition, 0, 1);\r\n };\r\n Object.defineProperty(AxisRenderer.prototype, \"minGridDistance\", {\r\n /**\r\n * @return Min distance (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"minGridDistance\");\r\n },\r\n /**\r\n * Minimum distance in pixels between grid elements.\r\n *\r\n * Use it to control density of the grid/labels on the axis.element.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/axes/positioning-axis-elements/#Setting_the_density_of_the_the_grid_labels} for more info\r\n * @param value Min distance (px)\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"minGridDistance\", value)) {\r\n if (this.axis) {\r\n this.axis.invalidateDataItems();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisRenderer.prototype, \"chart\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Chart\r\n */\r\n get: function () {\r\n return this._chart.get();\r\n },\r\n /**\r\n * A chart, associated with the Axis.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Chart\r\n */\r\n set: function (value) {\r\n this._chart.set(value, null);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Toggles visibility of an element, based on its current position and\r\n * min/max position settings.\r\n *\r\n * E.g. labels based on `minLabelPosition` and `maxLabelPosition`.\r\n *\r\n * @ignore Exclude from docs\r\n * @param sprite An element to toggle\r\n * @param position Elements current position\r\n * @param minPosition Min position setting\r\n * @param maxPosition Max position setting\r\n */\r\n AxisRenderer.prototype.toggleVisibility = function (sprite, position, minPosition, maxPosition) {\r\n var axis = this.axis;\r\n var dataItem = sprite.dataItem;\r\n if (dataItem && dataItem instanceof AxisDataItem) {\r\n if ($type.isNumber(dataItem.minPosition)) {\r\n minPosition = dataItem.minPosition;\r\n }\r\n if ($type.isNumber(dataItem.maxPosition)) {\r\n maxPosition = dataItem.maxPosition;\r\n }\r\n }\r\n var updatedStart = axis.start + (axis.end - axis.start) * (minPosition - 0.0001);\r\n var updatedEnd = axis.start + (axis.end - axis.start) * (maxPosition + 0.0001);\r\n if (!sprite.disabled) {\r\n if (position < updatedStart || position > updatedEnd) {\r\n sprite.__disabled = true;\r\n }\r\n else {\r\n sprite.__disabled = false;\r\n }\r\n }\r\n };\r\n /**\r\n * Creates visual elements for and axis break.\r\n *\r\n * @ignore Exclude from docs\r\n * @param axisBreak Axis break\r\n */\r\n AxisRenderer.prototype.createBreakSprites = function (axisBreak) {\r\n // This is a placeholder method for extending classes to override.\r\n };\r\n Object.defineProperty(AxisRenderer.prototype, \"axisFills\", {\r\n /**\r\n * A list of Axis' Fill elements.\r\n *\r\n * Those are fill elements that cover the space between every second set\r\n * of grid lines, and can be configured to create striped charts.\r\n *\r\n * Please note that these are disabled by default. To enable them, set\r\n * template to true.\r\n *\r\n * ```TypeScript\r\n * categoryAxis.renderer.axisFills.template.disabled = false;\r\n * ```\r\n * ```JavaScript\r\n * categoryAxis.renderer.axisFills.template.disabled = false;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"xAxes\": [{\r\n * // ...\r\n * \"renderer\": {\r\n * \"axisFills\": {\r\n * \"disabled\": false\r\n * }\r\n * }\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/tutorials/alternated-axis-fills/} this tutorial for more info.\r\n * @return Fill elements\r\n */\r\n get: function () {\r\n if (!this._axisFills) {\r\n var fill = this.createFill(this.axis);\r\n this._axisFills = new ListTemplate(fill);\r\n fill.applyOnClones = true;\r\n fill.events.on(\"enabled\", this.invalidateAxisItems, this, false);\r\n this._disposers.push(new ListDisposer(this._axisFills));\r\n this._disposers.push(this._axisFills.template);\r\n }\r\n return this._axisFills;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns a new fill element, suitable for this Axis Renderer type.\r\n *\r\n * @return Fill element\r\n */\r\n AxisRenderer.prototype.createFill = function (axis) {\r\n return new AxisFill(axis);\r\n };\r\n Object.defineProperty(AxisRenderer.prototype, \"grid\", {\r\n /**\r\n * A list of Axis' Grid elements.\r\n *\r\n * @return Grid elements\r\n */\r\n get: function () {\r\n if (!this._grid) {\r\n var grid = this.createGrid();\r\n this._grid = new ListTemplate(grid);\r\n grid.applyOnClones = true;\r\n grid.events.on(\"enabled\", this.invalidateAxisItems, this, false);\r\n this._disposers.push(new ListDisposer(this._grid));\r\n this._disposers.push(this._grid.template);\r\n }\r\n return this._grid;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns a new grid element, suitable for this Axis Renderer type.\r\n *\r\n * @return Grid element\r\n */\r\n AxisRenderer.prototype.createGrid = function () {\r\n return new Grid();\r\n };\r\n Object.defineProperty(AxisRenderer.prototype, \"ticks\", {\r\n /**\r\n * A list of Axis' Tick elements.\r\n *\r\n * Please note that these are disabled by default. To enable ticks, you'll\r\n * need to set `disabled` and `strokeOpacity` properties of the tick template.\r\n *\r\n * ```TypeScript\r\n * categoryAxis.renderer.ticks.template.disabled = false;\r\n * categoryAxis.renderer.ticks.template.strokeOpacity = 0.5;\r\n * ```\r\n * ```JavaScript\r\n * categoryAxis.renderer.ticks.template.disabled = false;\r\n * categoryAxis.renderer.ticks.template.strokeOpacity = 0.5;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"xAxes\": [{\r\n * // ...\r\n * \"renderer\": {\r\n * \"ticks\": {\r\n * \"disabled\": false,\r\n * \"strokeOpacity\": 0.5\r\n * }\r\n * }\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * @return Tick elements\r\n */\r\n get: function () {\r\n if (!this._ticks) {\r\n var tick = this.createTick();\r\n tick.applyOnClones = true;\r\n tick.isMeasured = false;\r\n tick.events.on(\"enabled\", this.invalidateAxisItems, this, false);\r\n this._ticks = new ListTemplate(tick);\r\n this._disposers.push(new ListDisposer(this._ticks));\r\n this._disposers.push(this._ticks.template);\r\n }\r\n return this._ticks;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns a new tick element, suitable for this Axis Renderer type.\r\n *\r\n * @return Tick element\r\n */\r\n AxisRenderer.prototype.createTick = function () {\r\n return new AxisTick();\r\n };\r\n Object.defineProperty(AxisRenderer.prototype, \"labels\", {\r\n /**\r\n * A list of Axis' Label elements.\r\n *\r\n * @return Label elements\r\n */\r\n get: function () {\r\n if (!this._labels) {\r\n var label = this.createLabel();\r\n this._labels = new ListTemplate(label);\r\n label.applyOnClones = true;\r\n label.events.on(\"enabled\", this.invalidateAxisItems, this, false);\r\n this._disposers.push(new ListDisposer(this._labels));\r\n this._disposers.push(this._labels.template);\r\n }\r\n return this._labels;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns a new label element, suitable for this Axis Renderer type.\r\n *\r\n * @return Label element\r\n */\r\n AxisRenderer.prototype.createLabel = function () {\r\n return new AxisLabel();\r\n };\r\n Object.defineProperty(AxisRenderer.prototype, \"inside\", {\r\n /**\r\n * @return Labels inside?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"inside\");\r\n },\r\n /**\r\n * Indicates whether Axis' labels and ticks should be drawn inside Plot area.\r\n *\r\n * Does not work with all renderers, like AxisRendererRadial.\r\n *\r\n * @param value Labels inside?\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"inside\", value)) {\r\n if (this.axis) {\r\n this.axis.invalidate();\r\n }\r\n }\r\n if (value) {\r\n this.width = 0;\r\n this.height = 0;\r\n }\r\n else {\r\n this.width = undefined;\r\n this.height = undefined;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisRenderer.prototype, \"opposite\", {\r\n /**\r\n * @return Draw axis on opposite side?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"opposite\");\r\n },\r\n /**\r\n * Indicates whether Axis should be drawn on the opposite side of the plot\r\n * area than it would normally be drawn based on chart's settings.\r\n *\r\n * Does not work with all renderers, like [[AxisRendererRadial]] and\r\n * [[AxisRenderer Circular].\r\n *\r\n * @param value Draw axis on opposite side?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"opposite\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisRenderer.prototype, \"fullWidthTooltip\", {\r\n /**\r\n * @return Full width tooltip?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"fullWidthTooltip\");\r\n },\r\n /**\r\n * Indicates if Axis tooltip should take the whole width of the axis cell.\r\n * (between two grid lines)\r\n *\r\n * NOTE: this setting is ignored on circular axis types.\r\n *\r\n * @param value Full width tooltip?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"fullWidthTooltip\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisRenderer.prototype, \"tooltipLocation\", {\r\n /**\r\n * @return Tooltip location\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"tooltipLocation\");\r\n },\r\n /**\r\n * Location within axis cell to show tooltip on. (0-1)\r\n *\r\n * 0 - show at the start\r\n * 0.5 - show right in the middle\r\n * 1 - show at the end\r\n *\r\n * @param value Tooltip location\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"tooltipLocation\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisRenderer.prototype, \"tooltipLocation2\", {\r\n /**\r\n * @return Tooltip location\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"tooltipLocation2\");\r\n },\r\n /**\r\n * Location within secondary axis cell to show tooltip on. (0-1)\r\n *\r\n * 0 - show at the start\r\n * 0.5 - show right in the middle\r\n * 1 - show at the end\r\n *\r\n * @param value Tooltip location\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"tooltipLocation2\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisRenderer.prototype, \"cellStartLocation\", {\r\n /**\r\n * @return Cell start (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"cellStartLocation\");\r\n },\r\n /**\r\n * Location for the cell start.\r\n *\r\n * Normally a \"cell\" is the whole available width in a category.\r\n *\r\n * If there are several clustered column-like series available, the whole\r\n * space is divided between each clustered column, or column stacks.\r\n *\r\n * `cellStartLocation` identifies where, within available space, the actual\r\n * cell starts.\r\n *\r\n * This, together with column series' `width` will affect actual width of\r\n * columns, and thus gaps between them.\r\n *\r\n * This will affect category-like axes only, like [[DateAxis]], or\r\n * [[CategoryAxis]].\r\n *\r\n * This is used to limit a space occupied by series like column.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/axes/positioning-axis-elements/} for more info.\r\n * @param value Cell start (0-1)\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"cellStartLocation\", value)) {\r\n if (this.axis) {\r\n this.axis.invalidateSeries();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisRenderer.prototype, \"cellEndLocation\", {\r\n /**\r\n * @return Cell end (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"cellEndLocation\");\r\n },\r\n /**\r\n * Location for the cell end.\r\n *\r\n * Normally a \"cell\" is the whole available width in a category.\r\n *\r\n * If there are several clustered column-like series available, the whole\r\n * space is divided between each clustered column, or column stacks.\r\n *\r\n * `cellEndLocation` identifies where, within available space, the actual\r\n * cell ends.\r\n *\r\n * This, together with column series' `width` will affect actual width of\r\n * columns, and thus gaps between them.\r\n *\r\n * This will affect category-like axes only, like [[DateAxis]], or\r\n * [[CategoryAxis]].\r\n *\r\n * This is used to limit a space occupied by series like column.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/axes/positioning-axis-elements/} for more info.\r\n * @param value Cell end (0-1)\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"cellEndLocation\", value)) {\r\n if (this.axis) {\r\n this.axis.invalidateSeries();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisRenderer.prototype, \"inversed\", {\r\n /**\r\n * @return Flip axis?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"inversed\");\r\n },\r\n /**\r\n * Indicates if the scale of the axis should be flipped.\r\n *\r\n * @param value Flip axis?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"inversed\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisRenderer.prototype, \"minLabelPosition\", {\r\n /**\r\n * @return Min label position (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"minLabelPosition\");\r\n },\r\n /**\r\n * Minimum position along the Axis, for labels.\r\n *\r\n * Labels, which have their position closer to the start of the Axis, will be\r\n * automatically hidden.\r\n *\r\n * E.g., setting this to 0.05 (5% of total axis length) would hide labels,\r\n * that would otherwise be drawn very near start of the Axis.\r\n *\r\n * This is especially usefull with `inside = true`, or if the chart hasn't\r\n * got any extra margins.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/axes/positioning-axis-elements/} for more info.\r\n * @param value Min label position (0-1)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"minLabelPosition\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisRenderer.prototype, \"maxLabelPosition\", {\r\n /**\r\n * @return Max label position (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"maxLabelPosition\");\r\n },\r\n /**\r\n * Maximum position along the Axis, for labels.\r\n *\r\n * Labels, which have their position closer to the and of the Axis, will be\r\n * automatically hidden.\r\n *\r\n * E.g., setting this to 0.95 (95% of total axis length) would hide labels,\r\n * that would otherwise be drawn very near end of the Axis.\r\n *\r\n * This is especially usefull with `inside = true`, or if the chart hasn't\r\n * got any extra margins.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/axes/positioning-axis-elements/} for more info.\r\n * @param value Max label position (0-1)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"maxLabelPosition\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies all settings and related items from another object of the same\r\n * type.\r\n *\r\n * @param source Source object\r\n */\r\n AxisRenderer.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.grid.template.copyFrom(source.grid.template);\r\n this.ticks.template.copyFrom(source.ticks.template);\r\n this.labels.template.copyFrom(source.labels.template);\r\n this.axisFills.template.copyFrom(source.axisFills.template);\r\n this.line.copyFrom(source.line);\r\n this.baseGrid.copyFrom(source.baseGrid);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n AxisRenderer.prototype.toAxisPosition = function (value) {\r\n return value;\r\n };\r\n /**\r\n * Sets `visibility` property:\r\n *\r\n * * `true` - visible\r\n * * `false` - hidden\r\n *\r\n * @param value true - visible, false - hidden\r\n * @return Current visibility\r\n */\r\n AxisRenderer.prototype.setVisibility = function (value) {\r\n _super.prototype.setVisibility.call(this, value);\r\n this.bulletsContainer.visible = value;\r\n };\r\n return AxisRenderer;\r\n}(Container));\r\nexport { AxisRenderer };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisRenderer\"] = AxisRenderer;\r\n//# sourceMappingURL=AxisRenderer.js.map","/**\r\n * Axis Bullet module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../../core/Container\";\r\nimport { registry } from \"../../core/Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Used to draw a positioned bullet (element) on an Axis.\r\n *\r\n * ```TypeScript\r\n * let range = dateAxis.axisRanges.create();\r\n * range.date = new Date(2018, 0, 5);\r\n *\r\n * let flag = new am4plugins_bullets.FlagBullet();\r\n * flag.label.text = \"Hello\";\r\n *\r\n * range.bullet = flag;\r\n * ```\r\n * ```JavaScript\r\n * var range = dateAxis.axisRanges.create();\r\n * range.date = new Date(2018, 0, 5);\r\n *\r\n * var flag = new am4plugins_bullets.FlagBullet();\r\n * flag.label.text = \"Hello\";\r\n *\r\n * range.bullet = flag;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"xAxes\": [{\r\n * \"type\": \"DateAxis\",\r\n * // ...\r\n * \"axisRanges\": [{\r\n * \"date\": new Date(2018, 0, 5),\r\n * \"bullet: {\r\n * \"type\": \"FlagBullet\",\r\n * \"label\": {\r\n * \"text\": \"Hello\"\r\n * }\r\n * }\r\n * }]\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * @since 4.5.9\r\n * @see {@link IAxisBulletEvents} for a list of available events\r\n * @see {@link IAxisBulletAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar AxisBullet = /** @class */ (function (_super) {\r\n __extends(AxisBullet, _super);\r\n function AxisBullet() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"AxisBullet\";\r\n _this.location = 0.5;\r\n _this.isMeasured = false;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(AxisBullet.prototype, \"location\", {\r\n /**\r\n * @return Location (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"location\");\r\n },\r\n /**\r\n * Relative position within cell/range.\r\n *\r\n * Value range is from from `0` (beginning) to `1` (end).\r\n *\r\n * NOTE: `location` is relative to the parent axis range's scope, i.e.\r\n * between its `date` and `endDate` for [[DateAxis]], or `value`/`endValue`\r\n * ([[ValueAxis]]), or `category`/`endCategory` ([[categoryAxis]]).\r\n *\r\n * ```TypeScript\r\n * let range = dateAxis.axisRanges.create();\r\n * range.date = new Date(2018, 0, 5);\r\n * range.endDate = new Date(2018, 0, 6);\r\n *\r\n * let bullet = new am4charts.AxisBullet();\r\n * bullet.location = 1;\r\n *\r\n * let flag = bullet.createChild(am4plugins_bullets.FlagBullet);\r\n * flag.label.text = \"Hello\";\r\n * ```\r\n * ```JavaScript\r\n * var range = dateAxis.axisRanges.create();\r\n * range.date = new Date(2018, 0, 5);\r\n * range.endDate = new Date(2018, 0, 6);\r\n *\r\n * var bullet = new am4charts.AxisBullet();\r\n * bullet.location = 1;\r\n *\r\n * var flag = bullet.createChild(am4plugins_bullets.FlagBullet);\r\n * flag.label.text = \"Hello\";\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"xAxes\": [{\r\n * \"type\": \"DateAxis\",\r\n * // ...\r\n * \"axisRanges\": [{\r\n * \"date\": new Date(2018, 0, 5),\r\n * \"endDate\": new Date(2018, 0, 6),\r\n * \"bullet: {\r\n * \"type\": \"AxisBullet\",\r\n * \"location\": 1,\r\n * \"children\": [{\r\n * \"type\": \"FlagBullet\",\r\n * \"label\": {\r\n * \"text\": \"Hello\"\r\n * }\r\n * }]\r\n * }\r\n * }]\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * @default 0.5\r\n * @param value Location (0-1)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"location\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n AxisBullet.prototype.setDisabled = function (value) {\r\n var changed = _super.prototype.setDisabled.call(this, value);\r\n if (this.axis) {\r\n this.axis.invalidateDataItems();\r\n }\r\n return changed;\r\n };\r\n return AxisBullet;\r\n}(Container));\r\nexport { AxisBullet };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisBullet\"] = AxisBullet;\r\n//# sourceMappingURL=AxisBullet.js.map","/**\r\n * Module, defining Axis Renderer for vertical axes.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { AxisRenderer } from \"./AxisRenderer\";\r\nimport { WavedLine } from \"../../core/elements/WavedLine\";\r\nimport { WavedRectangle } from \"../../core/elements/WavedRectangle\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { percent, Percent } from \"../../core/utils/Percent\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport { defaultRules, ResponsiveBreakpoints } from \"../../core/utils/Responsive\";\r\nimport { AxisBullet } from \"./AxisBullet\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A renderer for vertical axis.\r\n *\r\n * @see {@link IAxisRendererYEvents} for a list of available events\r\n * @see {@link IAxisRendererYAdapters} for a list of available Adapters\r\n */\r\nvar AxisRendererY = /** @class */ (function (_super) {\r\n __extends(AxisRendererY, _super);\r\n /**\r\n * Constructor.\r\n *\r\n * @param axis Related axis\r\n */\r\n function AxisRendererY() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"AxisRendererY\";\r\n _this.minGridDistance = 40;\r\n _this.opposite = false;\r\n _this.height = percent(100);\r\n _this.labels.template.verticalCenter = \"middle\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * @ignore\r\n */\r\n AxisRendererY.prototype.setAxis = function (axis) {\r\n _super.prototype.setAxis.call(this, axis);\r\n axis.layout = \"horizontal\";\r\n };\r\n /**\r\n * @ignore\r\n */\r\n AxisRendererY.prototype.updateGridContainer = function () {\r\n var axis = this.axis;\r\n if (axis) {\r\n var gridContainer = this.gridContainer;\r\n gridContainer.y = axis.pixelY;\r\n gridContainer.height = axis.axisLength;\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n AxisRendererY.prototype.toAxisPosition = function (value) {\r\n var axis = this.axis;\r\n if (axis) {\r\n var inversedPosition = 1 - value;\r\n var relativePositionSprite = axis.relativePositionSprite;\r\n var y = axis.pixelY;\r\n if (relativePositionSprite) {\r\n y = $utils.spritePointToSprite({ x: 0, y: this.pixelY }, this.parent, relativePositionSprite).y;\r\n }\r\n else {\r\n relativePositionSprite = axis.parent;\r\n }\r\n if (relativePositionSprite) {\r\n var relativeY = y / relativePositionSprite.innerHeight;\r\n var relativeHeight = axis.axisLength / relativePositionSprite.innerHeight;\r\n return 1 - (inversedPosition - relativeY) / relativeHeight;\r\n }\r\n }\r\n return value;\r\n };\r\n /**\r\n * Called when rendered is attached to an Axis, as well as a property of\r\n * Axis that might affect the appearance is updated.\r\n *\r\n * E.g. `axis.opposite`, `axis.inside`, etc.\r\n *\r\n * This method is called **before** draw, so that any related setting\r\n * changed in this method can be changed.\r\n *\r\n * @todo Description (review)\r\n * @ignore Exclude from docs\r\n */\r\n AxisRendererY.prototype.processRenderer = function () {\r\n _super.prototype.processRenderer.call(this);\r\n var axis = this.axis;\r\n if (axis) {\r\n var title = axis.title;\r\n title.valign = \"middle\";\r\n if (!(axis.height instanceof Percent)) {\r\n axis.height = percent(100);\r\n }\r\n if (this.opposite) {\r\n title.rotation = 90;\r\n this.line.toBack();\r\n title.toFront();\r\n }\r\n else {\r\n title.rotation = -90;\r\n title.toBack();\r\n this.line.toFront();\r\n }\r\n }\r\n };\r\n /**\r\n * Updates some of the Axis tooltip's visual properties, related to\r\n * rendering of the Axis.\r\n *\r\n * @todo Description (review)\r\n * @ignore Exclude from docs\r\n */\r\n AxisRendererY.prototype.updateTooltip = function () {\r\n var axis = this.axis;\r\n if (axis) {\r\n var bigNum = 2000;\r\n var bbx = 0;\r\n var bby = 0;\r\n var bbw = bigNum;\r\n var bbh = this.axisLength;\r\n // right\r\n if (this.opposite) {\r\n if (this.inside) {\r\n bbx = -bigNum;\r\n bbw = bigNum;\r\n }\r\n }\r\n // left\r\n else {\r\n if (!this.inside) {\r\n bbx = -bigNum;\r\n bbw = bigNum;\r\n }\r\n }\r\n this.axis.updateTooltip(\"horizontal\", { x: bbx, y: bby, width: bbw, height: bbh });\r\n }\r\n };\r\n Object.defineProperty(AxisRendererY.prototype, \"axisLength\", {\r\n /**\r\n * Returns actual length of the Axis, in pixels.\r\n *\r\n * @return Length (px)\r\n */\r\n get: function () {\r\n var axis = this.axis;\r\n return (axis.measuredHeight - axis.pixelPaddingTop - axis.pixelPaddingBottom) || 0;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Converts relative position on axis to point coordinates.\r\n *\r\n * @param position Position (0-1)\r\n * @param position2 Position (0-1) Position on the second axis\r\n * @return Point\r\n */\r\n AxisRendererY.prototype.positionToPoint = function (position, position2) {\r\n return { x: 0, y: this.positionToCoordinate(position) };\r\n };\r\n /**\r\n * Converts a point at specific coordinates to a relative position (0-1)\r\n * on the axis.\r\n *\r\n * @param point Point\r\n * @return Position (0-1)\r\n */\r\n AxisRendererY.prototype.pointToPosition = function (point) {\r\n return this.coordinateToPosition(point.y, point.x);\r\n };\r\n /**\r\n * Converts a coordinate in pixels to a relative position. (0-1)\r\n *\r\n * @param coordinate Coordinate (px)\r\n * @param coordinate2 Coordinate of a second axis, only needed for complex axes systems, like timeline (px)\r\n * @return Position (0-1)\r\n */\r\n AxisRendererY.prototype.coordinateToPosition = function (coordinate, coordinate2) {\r\n var position;\r\n var axis = this.axis;\r\n var axisFullLength = axis.axisFullLength;\r\n if (axis.renderer.inversed) {\r\n position = (1 - axis.start) - coordinate / axisFullLength;\r\n }\r\n else {\r\n position = coordinate / axisFullLength + (1 - axis.end);\r\n }\r\n return $math.round(position, 5);\r\n };\r\n /**\r\n * [getPositionRangePath description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param startPosition Starting position\r\n * @param endPosition End position\r\n * @return SVG path\r\n */\r\n AxisRendererY.prototype.getPositionRangePath = function (startPosition, endPosition) {\r\n var y1 = $math.fitToRange(this.positionToCoordinate(startPosition), 0, this.axisLength);\r\n var y2 = $math.fitToRange(this.positionToCoordinate(endPosition), 0, this.axisLength);\r\n var h = Math.abs(y2 - y1);\r\n var w = this.getWidth();\r\n var y = Math.min(y1, y2);\r\n var x = 0;\r\n return $path.rectToPath({\r\n x: x,\r\n y: y,\r\n width: w,\r\n height: h\r\n }, true);\r\n };\r\n /**\r\n * Updates and positions a grid element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param grid Grid element\r\n * @param position Starting position\r\n * @param endPosition End position\r\n */\r\n AxisRendererY.prototype.updateGridElement = function (grid, position, endPosition) {\r\n position = position + (endPosition - position) * grid.location;\r\n var point = this.positionToPoint(position);\r\n //\tpoint.y = $utils.spritePointToSprite({ x: 0, y: point.y }, this, this.gridContainer).y;\r\n grid.path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: this.getWidth(), y: 0 });\r\n this.positionItem(grid, point);\r\n this.toggleVisibility(grid, position, 0, 1);\r\n };\r\n /**\r\n * Updates and positions a tick element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param tick Tick element\r\n * @param position Starting position\r\n * @param endPosition End position\r\n */\r\n AxisRendererY.prototype.updateTickElement = function (tick, position, endPosition) {\r\n position = position + (endPosition - position) * tick.location;\r\n var point = this.positionToPoint(position);\r\n var tickLength = tick.length;\r\n try {\r\n $utils.used(this.axis.title.measuredWidth);\r\n }\r\n catch (_a) {\r\n // void\r\n }\r\n point.x = $utils.spritePointToSprite({ x: this.line.pixelX, y: 0 }, this.line.parent, this.gridContainer).x;\r\n if (!this.opposite) {\r\n tickLength *= (tick.inside ? 1 : -1);\r\n }\r\n else {\r\n tickLength *= (tick.inside ? -1 : 1);\r\n }\r\n tick.path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: tickLength, y: 0 });\r\n this.positionItem(tick, point);\r\n this.toggleVisibility(tick, position, 0, 1);\r\n };\r\n /**\r\n * Updates and positions the axis line element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n AxisRendererY.prototype.updateAxisLine = function () {\r\n this.line.path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: 0, y: this.axisLength });\r\n };\r\n /**\r\n * Updates and positions the base grid element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n AxisRendererY.prototype.updateBaseGridElement = function () {\r\n _super.prototype.updateBaseGridElement.call(this);\r\n var axis = this.axis;\r\n var w = this.getWidth();\r\n var h = this.axisLength;\r\n var y = axis.basePoint.y;\r\n var baseGrid = this.baseGrid;\r\n if (y < -0.2 || y > h + 0.2) {\r\n baseGrid.hide(0);\r\n }\r\n else {\r\n var x = $utils.spritePointToSprite({ x: 0, y: 0 }, this.gridContainer, baseGrid.parent).x;\r\n baseGrid.path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: w, y: 0 });\r\n baseGrid.moveTo({ x: x, y: y });\r\n baseGrid.show(0);\r\n }\r\n };\r\n /**\r\n * Updates and positions a label element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param label Label element\r\n * @param position Starting position\r\n * @param endPosition Ending position\r\n */\r\n AxisRendererY.prototype.updateLabelElement = function (label, position, endPosition, location) {\r\n if (!$type.hasValue(location)) {\r\n location = label.location;\r\n }\r\n position = position + (endPosition - position) * location;\r\n label.isMeasured = !label.inside;\r\n var point = this.positionToPoint(position);\r\n var horizontalCenter;\r\n var deltaX = 0;\r\n var maxWidth = this.gridContainer.maxWidth;\r\n if (this.opposite) {\r\n if (label.inside) {\r\n horizontalCenter = \"right\";\r\n if (label.align == \"left\") {\r\n deltaX = -maxWidth;\r\n horizontalCenter = \"left\";\r\n }\r\n if (label.align == \"center\") {\r\n deltaX = -maxWidth / 2;\r\n horizontalCenter = \"middle\";\r\n }\r\n }\r\n else {\r\n horizontalCenter = \"left\";\r\n }\r\n point.x = 0 + deltaX;\r\n }\r\n else {\r\n if (label.inside) {\r\n horizontalCenter = \"left\";\r\n if (label.align == \"right\") {\r\n deltaX = maxWidth;\r\n horizontalCenter = \"right\";\r\n }\r\n if (label.align == \"center\") {\r\n deltaX = maxWidth / 2;\r\n horizontalCenter = \"middle\";\r\n }\r\n }\r\n else {\r\n horizontalCenter = \"right\";\r\n }\r\n point.x = this.measuredWidth + deltaX;\r\n }\r\n if (label.rotation == 0) {\r\n // Apply fuzzy logic to verticalCenter only if labels are not rotated\r\n label.horizontalCenter = horizontalCenter;\r\n }\r\n this.positionItem(label, point);\r\n this.toggleVisibility(label, position, this.minLabelPosition, this.maxLabelPosition);\r\n };\r\n /**\r\n * Updates and positions an axis break element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param axisBreak Break element\r\n */\r\n AxisRendererY.prototype.updateBreakElement = function (axisBreak) {\r\n _super.prototype.updateBreakElement.call(this, axisBreak);\r\n var startLine = axisBreak.startLine;\r\n var endLine = axisBreak.endLine;\r\n var fillShape = axisBreak.fillShape;\r\n var startPoint = axisBreak.startPoint;\r\n var endPoint = axisBreak.endPoint;\r\n var x1 = axisBreak.pixelMarginLeft;\r\n var x2 = this.getWidth() - axisBreak.pixelMarginLeft - axisBreak.pixelMarginRight;\r\n startPoint.y = $math.fitToRange(startPoint.y, -1, this.axisLength + 1);\r\n endPoint.y = $math.fitToRange(endPoint.y, -1, this.axisLength + 1);\r\n if (startPoint.y == endPoint.y && (startPoint.y < 0 || startPoint.y > this.axisLength)) {\r\n axisBreak.fillShape.__disabled = true;\r\n }\r\n else {\r\n axisBreak.fillShape.__disabled = false;\r\n }\r\n var w = Math.abs(x2 - x1);\r\n startLine.x = x1;\r\n startLine.height = 0;\r\n startLine.width = w;\r\n endLine.x = x1;\r\n endLine.height = 0;\r\n endLine.width = w;\r\n fillShape.width = w;\r\n fillShape.height = Math.abs(endPoint.y - startPoint.y);\r\n fillShape.x = x1;\r\n fillShape.y = endPoint.y;\r\n };\r\n /**\r\n * Creates visual elements for and axis break.\r\n *\r\n * @ignore Exclude from docs\r\n * @param axisBreak Axis break\r\n */\r\n AxisRendererY.prototype.createBreakSprites = function (axisBreak) {\r\n axisBreak.startLine = new WavedLine();\r\n axisBreak.endLine = new WavedLine();\r\n var wavedRectangle = new WavedRectangle();\r\n wavedRectangle.setWavedSides(true, false, true, false);\r\n axisBreak.fillShape = wavedRectangle;\r\n };\r\n /**\r\n * Converts a position on the axis to a coordinate in pixels.\r\n *\r\n * @ignore Exclude from docs\r\n * @param position Position (0-1)\r\n * @return Coordinate (px)\r\n */\r\n AxisRendererY.prototype.positionToCoordinate = function (position) {\r\n var coordinate;\r\n var axis = this.axis;\r\n var axisFullLength = axis.axisFullLength;\r\n if (!axis.renderer.inversed) {\r\n coordinate = (axis.end - position) * axisFullLength;\r\n }\r\n else {\r\n coordinate = (position - axis.start) * axisFullLength;\r\n }\r\n return coordinate;\r\n };\r\n /**\r\n * Updates and positions axis bullets.\r\n *\r\n * @ignore Exclude from docs\r\n * @param bullet AxisBullet element\r\n * @param position Starting position\r\n * @param endPosition End position\r\n */\r\n AxisRendererY.prototype.updateBullet = function (bullet, position, endPosition) {\r\n var location = 0.5;\r\n if (bullet instanceof AxisBullet) {\r\n location = bullet.location;\r\n }\r\n position = position + (endPosition - position) * location;\r\n var point = this.positionToPoint(position);\r\n point.x = $utils.spritePointToSprite({ x: this.line.pixelX, y: 0 }, this.line.parent, this.gridContainer).x;\r\n this.positionItem(bullet, point);\r\n this.toggleVisibility(bullet, position, 0, 1);\r\n };\r\n return AxisRendererY;\r\n}(AxisRenderer));\r\nexport { AxisRendererY };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisRendererY\"] = AxisRendererY;\r\n/**\r\n * Add default responsive rules\r\n */\r\n/**\r\n * Put labels inside plot area.\r\n * Disable first and last labels.\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.widthS,\r\n state: function (target, stateId) {\r\n if (target instanceof AxisRendererY) {\r\n var state = target.states.create(stateId);\r\n state.properties.inside = true;\r\n state.properties.maxLabelPosition = 0.9;\r\n state.properties.minLabelPosition = 0.1;\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n/**\r\n * Disable labels altogather on very small charts\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.widthXS,\r\n state: function (target, stateId) {\r\n if (target instanceof AxisRendererY) {\r\n var state = target.states.create(stateId);\r\n state.properties.disabled = true;\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n//# sourceMappingURL=AxisRendererY.js.map","/**\r\n * A module which defines functionality related to Value Axis Break.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { AxisBreak } from \"./AxisBreak\";\r\nimport { registry } from \"../../core/Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Base class to define \"breaks\" on value axis.\r\n *\r\n * A \"break\" can be used to \"cut out\" specific ranges of the axis scale, e.g.\r\n * when comparing columns with relatively similar values, it would make sense\r\n * to cut out their mid section, so that their tip differences are more\r\n * prominent.\r\n *\r\n * @see {@link IValueAxisBreakEvents} for a list of available events\r\n * @see {@link IValueAxisBreakAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar ValueAxisBreak = /** @class */ (function (_super) {\r\n __extends(ValueAxisBreak, _super);\r\n /**\r\n * Constructor\r\n */\r\n function ValueAxisBreak() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"ValueAxisBreak\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(ValueAxisBreak.prototype, \"startPosition\", {\r\n /**\r\n * Pixel position of the break's start.\r\n *\r\n * @return Position (px)\r\n * @readonly\r\n */\r\n get: function () {\r\n if (this.axis) {\r\n return this.axis.valueToPosition(this.adjustedStartValue);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxisBreak.prototype, \"endPosition\", {\r\n /**\r\n * Pixel position of the break's end.\r\n *\r\n * @return Position (px)\r\n * @readonly\r\n */\r\n get: function () {\r\n if (this.axis) {\r\n return this.axis.valueToPosition(this.adjustedEndValue);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return ValueAxisBreak;\r\n}(AxisBreak));\r\nexport { ValueAxisBreak };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ValueAxisBreak\"] = ValueAxisBreak;\r\n//# sourceMappingURL=ValueAxisBreak.js.map","/**\r\n * Value Axis module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Axis, AxisDataItem } from \"./Axis\";\r\nimport { AxisRendererY } from \"./AxisRendererY\";\r\nimport { MultiDisposer } from \"../../core/utils/Disposer\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { ValueAxisBreak } from \"./ValueAxisBreak\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $object from \"../../core/utils/Object\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a [[DataItem]] for [[ValueAxis]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nvar ValueAxisDataItem = /** @class */ (function (_super) {\r\n __extends(ValueAxisDataItem, _super);\r\n /**\r\n * Constructor\r\n */\r\n function ValueAxisDataItem() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"ValueAxisDataItem\";\r\n _this.values.value = {};\r\n _this.values.endValue = {};\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(ValueAxisDataItem.prototype, \"value\", {\r\n /**\r\n * @return Value\r\n */\r\n get: function () {\r\n return this.values[\"value\"].value;\r\n },\r\n /**\r\n * A data point's numeric value.\r\n *\r\n * @param value Value\r\n */\r\n set: function (value) {\r\n this.setValue(\"value\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxisDataItem.prototype, \"endValue\", {\r\n /**\r\n * @return Value\r\n */\r\n get: function () {\r\n return this.values[\"endValue\"].value;\r\n },\r\n /**\r\n * Data point's numeric end value.\r\n *\r\n * @param value End value\r\n */\r\n set: function (value) {\r\n this.setValue(\"endValue\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return ValueAxisDataItem;\r\n}(AxisDataItem));\r\nexport { ValueAxisDataItem };\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Used to create a value axis for the chart.\r\n *\r\n * ```TypeScript\r\n * // Create the axis\r\n * let valueAxis = chart.yAxes.push(new am4charts.ValueAxis());\r\n *\r\n * // Set settings\r\n * valueAxis.title.text = \"Monthly Sales\";\r\n * ```\r\n * ```JavaScript\r\n * // Create the axis\r\n * var valueAxis = chart.yAxes.push(new am4charts.ValueAxis());\r\n *\r\n * // Set settings\r\n * valueAxis.title.text = \"Monthly Sales\";\r\n * ```\r\n * ```JSON\r\n * \"yAxes\": [{\r\n * \"type\": \"ValueAxis\",\r\n * \"title\": {\r\n * \"text\": \"Monthly Sales\"\r\n * }\r\n * }]\r\n * ```\r\n *\r\n * @see {@link IValueAxisEvents} for a list of available Events\r\n * @see {@link IValueAxisAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar ValueAxis = /** @class */ (function (_super) {\r\n __extends(ValueAxis, _super);\r\n /**\r\n * Constructor\r\n */\r\n function ValueAxis() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * [_stepDecimalPlaces description]\r\n *\r\n * @todo Description\r\n */\r\n _this._stepDecimalPlaces = 0;\r\n _this._prevStepDecimalPlaces = 0;\r\n _this._adjustLabelPrecision = true;\r\n /**\r\n * Base value for the axis.\r\n */\r\n _this._baseValue = 0;\r\n /**\r\n * Adjusted start in case we have breaks.\r\n *\r\n * @todo Description\r\n */\r\n _this._adjustedStart = 0;\r\n /**\r\n * Adjusted end in case we have breaks.\r\n *\r\n * @todo Description\r\n */\r\n _this._adjustedEnd = 1;\r\n _this._extremesChanged = false;\r\n _this._deltaMinMax = 1;\r\n _this._dsc = false;\r\n /**\r\n * As calculating totals is expensive operation and not often needed, we\r\n * don't do it by default.\r\n *\r\n * In case you use `totalPercent` or `total` in your charts, this must be set\r\n * to `true`.\r\n *\r\n * @default false\r\n * @see {@link https://www.amcharts.com/docs/v4/chart-types/xy-chart/#100_stacks} For using `calculateTotals` for 100% stacked series.\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-strings/#Placeholders_for_numeric_values} For using `calculateTotals` in labels.\r\n */\r\n _this.calculateTotals = false;\r\n _this.className = \"ValueAxis\";\r\n // Set field name\r\n _this.axisFieldName = \"value\";\r\n // Set defaults\r\n _this.setPropertyValue(\"maxZoomFactor\", 1000);\r\n _this.setPropertyValue(\"extraMin\", 0);\r\n _this.setPropertyValue(\"extraMax\", 0);\r\n _this.setPropertyValue(\"strictMinMax\", false);\r\n _this.setPropertyValue(\"maxPrecision\", Number.MAX_VALUE);\r\n _this.setPropertyValue(\"adjustLabelPrecision\", true);\r\n _this.setPropertyValue(\"extraTooltipPrecision\", 0);\r\n _this.keepSelection = false;\r\n _this.includeRangesInMinMax = false;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Holds reference to a function that accepts a DataItem as parameter.\r\n *\r\n * It can either return a fill opacity for a fill, or manipulate data item\r\n * directly, to create various highlighting scenarios.\r\n */\r\n ValueAxis.prototype.fillRule = function (dataItem) {\r\n var value = dataItem.value;\r\n var axis = dataItem.component;\r\n if (!dataItem.axisFill.disabled) {\r\n // rounding in left to solve floating point number\r\n if ($math.round(value / axis.step / 2, 5) == Math.round(value / axis.step / 2)) {\r\n dataItem.axisFill.__disabled = true;\r\n }\r\n else {\r\n dataItem.axisFill.__disabled = false;\r\n }\r\n }\r\n };\r\n /**\r\n * Returns a new/empty [[DataItem]] of the type appropriate for this object.\r\n *\r\n * @see {@link DataItem}\r\n * @return Data Item\r\n */\r\n ValueAxis.prototype.createDataItem = function () {\r\n return new ValueAxisDataItem();\r\n };\r\n /**\r\n * Returns a new/empty [[AxisBreak]] of the appropriate type.\r\n *\r\n * @return Axis break\r\n */\r\n ValueAxis.prototype.createAxisBreak = function () {\r\n return new ValueAxisBreak();\r\n };\r\n /**\r\n * [dataChangeUpdate description]\r\n *\r\n * This is a placeholder to override for extending classes.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n ValueAxis.prototype.dataChangeUpdate = function () {\r\n this.clearCache();\r\n if (!this.keepSelection) {\r\n if (this._start != 0 || this._end != 1) {\r\n this._start = 0;\r\n this._end = 1;\r\n this.dispatchImmediately(\"startendchanged\");\r\n }\r\n }\r\n else {\r\n if (this._start != 0) {\r\n this.dispatchImmediately(\"startchanged\");\r\n }\r\n if (this._end != 1) {\r\n this.dispatchImmediately(\"endchanged\");\r\n }\r\n if (this._start != 0 || this._end != 1) {\r\n this.dispatchImmediately(\"startendchanged\");\r\n }\r\n }\r\n this._maxZoomed = this._maxDefined;\r\n this._minZoomed = this._minDefined;\r\n this._maxAdjusted = this._maxDefined;\r\n this._minAdjusted = this._minDefined;\r\n };\r\n /**\r\n * Processes data items of the related Series.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n ValueAxis.prototype.processSeriesDataItems = function () {\r\n // @todo: add some boolean (maybe autodedect) if we need these calculations or not. this place uses a lot of cpu\r\n if (this.calculateTotals) {\r\n var series = this.series.getIndex(0);\r\n var startIndex = series.startIndex;\r\n if (series.dataItems.length > 0) {\r\n if (startIndex > 0) {\r\n startIndex--;\r\n }\r\n var endIndex = series.endIndex;\r\n if (endIndex < series.dataItems.length) {\r\n endIndex++;\r\n }\r\n var _loop_1 = function (i) {\r\n // This has to be `var` in order to avoid garbage collection\r\n var total = {};\r\n var sum = {};\r\n this_1.series.each(function (series) {\r\n if (!series.excludeFromTotal) {\r\n var dataItem_1 = series.dataItems.getIndex(i);\r\n if (dataItem_1) {\r\n $object.each(dataItem_1.values, function (key) {\r\n var value = dataItem_1.values[key].workingValue; // can not use getWorkingValue here!\r\n if ($type.isNumber(value)) {\r\n if (!$type.isNumber(total[key])) {\r\n total[key] = Math.abs(value);\r\n }\r\n else {\r\n total[key] += Math.abs(value);\r\n }\r\n if (!$type.isNumber(sum[key])) {\r\n sum[key] = value;\r\n }\r\n else {\r\n sum[key] += value;\r\n }\r\n }\r\n });\r\n }\r\n }\r\n });\r\n this_1.series.each(function (series) {\r\n if (!series.excludeFromTotal) {\r\n var dataItem_2 = series.dataItems.getIndex(i);\r\n if (dataItem_2) {\r\n $object.each(dataItem_2.values, function (key) {\r\n var value = dataItem_2.values[key].workingValue; // can not use getWorkingValue here!\r\n if ($type.isNumber(value)) {\r\n dataItem_2.setCalculatedValue(key, total[key], \"total\");\r\n dataItem_2.setCalculatedValue(key, 100 * value / total[key], \"totalPercent\");\r\n dataItem_2.setCalculatedValue(key, sum[key], \"sum\");\r\n }\r\n });\r\n }\r\n }\r\n });\r\n };\r\n var this_1 = this;\r\n // This has to be `var` in order to avoid garbage collection\r\n for (var i = startIndex; i < endIndex; ++i) {\r\n _loop_1(i);\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Validates the whole axis. Causes it to redraw.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (review)\r\n */\r\n ValueAxis.prototype.validate = function () {\r\n if (this.axisLength <= 0) {\r\n return;\r\n }\r\n _super.prototype.validate.call(this);\r\n this.getMinMax();\r\n if (!$type.isNumber(this._minAdjusted)) {\r\n this.dataItems.each(function (dataItem) {\r\n dataItem.value = null;\r\n });\r\n }\r\n this.fixAxisBreaks();\r\n this.calculateZoom();\r\n this.validateAxisElements();\r\n this.validateAxisRanges();\r\n this.validateBreaks();\r\n this.hideUnusedDataItems();\r\n this.renderer.invalidateLayout();\r\n // hide too close\r\n //this.hideTooCloseDataItems();\r\n };\r\n /**\r\n * Calculates all positions, related to axis as per current zoom.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n ValueAxis.prototype.calculateZoom = function () {\r\n if ($type.isNumber(this.min) && $type.isNumber(this.max)) {\r\n var min = this.positionToValue(this.start);\r\n var max = this.positionToValue(this.end);\r\n var differece = this.adjustDifference(min, max);\r\n var minMaxStep = this.adjustMinMax(min, max, differece, this._gridCount, true);\r\n var stepDecimalPlaces = $utils.decimalPlaces(minMaxStep.step);\r\n this._stepDecimalPlaces = stepDecimalPlaces;\r\n min = $math.round(min, stepDecimalPlaces);\r\n max = $math.round(max, stepDecimalPlaces);\r\n minMaxStep = this.adjustMinMax(min, max, differece, this._gridCount, true);\r\n var step = minMaxStep.step;\r\n if (this.syncWithAxis) {\r\n var calculated = this.getCache(min + \"-\" + max);\r\n if ($type.isNumber(calculated)) {\r\n step = calculated;\r\n }\r\n }\r\n else {\r\n min = minMaxStep.min;\r\n max = minMaxStep.max;\r\n }\r\n if (this._minZoomed != min || this._maxZoomed != max || this._step != step || this._dsc) {\r\n this._dsc = false;\r\n this._minZoomed = min;\r\n this._maxZoomed = max;\r\n this._step = step;\r\n this.dispatchImmediately(\"selectionextremeschanged\");\r\n }\r\n }\r\n };\r\n ValueAxis.prototype.fixSmallStep = function (step) {\r\n if (1 + step == 1) {\r\n step *= 2;\r\n return this.fixSmallStep(step);\r\n }\r\n return step;\r\n };\r\n /**\r\n * Validates Axis elements.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n ValueAxis.prototype.validateAxisElements = function () {\r\n var _this = this;\r\n if ($type.isNumber(this.max) && $type.isNumber(this.min)) {\r\n // first regular items\r\n var value_1 = this.minZoomed - this._step * 2;\r\n if (!this.logarithmic) {\r\n value_1 = Math.floor(value_1 / this._step) * this._step;\r\n }\r\n else {\r\n var differencePower = Math.log(this.max) * Math.LOG10E - Math.log(this.min) * Math.LOG10E;\r\n if (differencePower > 1) {\r\n value_1 = Math.pow(10, Math.log(this.min) * Math.LOG10E);\r\n }\r\n else {\r\n value_1 = Math.floor(this.minZoomed / this._step) * this._step;\r\n if (value_1 == 0) {\r\n value_1 = this.minZoomed;\r\n }\r\n }\r\n }\r\n var maxZoomed = this._maxZoomed + this._step;\r\n this.resetIterators();\r\n var dataItemsIterator_1 = this._dataItemsIterator;\r\n if (this._step == 0) {\r\n return;\r\n }\r\n this._step = this.fixSmallStep(this._step);\r\n var i = 0;\r\n var precisionChanged = this._prevStepDecimalPlaces != this._stepDecimalPlaces;\r\n this._prevStepDecimalPlaces = this._stepDecimalPlaces;\r\n while (value_1 <= maxZoomed) {\r\n var axisBreak = this.isInBreak(value_1);\r\n if (!axisBreak) {\r\n var dataItem = dataItemsIterator_1.find(function (x) { return x.value === value_1; });\r\n if (dataItem.__disabled) {\r\n dataItem.__disabled = false;\r\n }\r\n //this.processDataItem(dataItem);\r\n this.appendDataItem(dataItem);\r\n dataItem.axisBreak = undefined;\r\n if (dataItem.value != value_1 || precisionChanged) {\r\n dataItem.value = value_1;\r\n dataItem.text = this.formatLabel(value_1);\r\n if (dataItem.label && dataItem.label.invalid) {\r\n dataItem.label.validate();\r\n }\r\n if (dataItem.value >= this.min && dataItem.value <= this.max) {\r\n if (dataItem.label) {\r\n if ((this.axisLetter == \"Y\" && dataItem.label.measuredWidth > this.ghostLabel.measuredWidth) || (this.axisLetter == \"X\" && dataItem.label.measuredHeight > this.ghostLabel.measuredHeight)) {\r\n this.ghostLabel.text = dataItem.label.currentText;\r\n this.ghostLabel.validate();\r\n }\r\n }\r\n }\r\n }\r\n this.validateDataElement(dataItem);\r\n }\r\n i++;\r\n var oldValue = value_1;\r\n if (!this.logarithmic) {\r\n value_1 += this._step;\r\n }\r\n else {\r\n var differencePower = Math.log(this.max) * Math.LOG10E - Math.log(this.min) * Math.LOG10E;\r\n if (differencePower > 1) {\r\n value_1 = Math.pow(10, Math.log(this.min) * Math.LOG10E + i);\r\n }\r\n else {\r\n value_1 += this._step;\r\n }\r\n }\r\n var stepPower = Math.pow(10, Math.floor(Math.log(Math.abs(this._step)) * Math.LOG10E));\r\n if (stepPower < 1) {\r\n // exponent is less then 1 too. Count decimals of exponent\r\n var decCount = Math.round(Math.abs(Math.log(Math.abs(stepPower)) * Math.LOG10E)) + 2;\r\n decCount = Math.min(13, decCount);\r\n // round value to avoid floating point issues\r\n value_1 = $math.round(value_1, decCount);\r\n // ceil causes problems: https://codepen.io/team/amcharts/pen/XWMjZwy?editors=1010\r\n if (oldValue == value_1) {\r\n value_1 = maxZoomed;\r\n break;\r\n }\r\n }\r\n }\r\n var axisBreaks = this._axisBreaks;\r\n if (axisBreaks) {\r\n // breaks later\r\n var renderer_1 = this.renderer;\r\n $iter.each(axisBreaks.iterator(), function (axisBreak) {\r\n if (axisBreak.breakSize > 0) {\r\n // only add grid if gap is bigger then minGridDistance\r\n if ($math.getDistance(axisBreak.startPoint, axisBreak.endPoint) > renderer_1.minGridDistance) {\r\n var breakValue_1 = axisBreak.adjustedMin;\r\n while (breakValue_1 <= axisBreak.adjustedMax) {\r\n if (breakValue_1 >= axisBreak.adjustedStartValue && breakValue_1 <= axisBreak.adjustedEndValue) {\r\n var dataItem = dataItemsIterator_1.find(function (x) { return x.value === breakValue_1; });\r\n if (dataItem.__disabled) {\r\n dataItem.__disabled = false;\r\n }\r\n //this.processDataItem(dataItem);\r\n _this.appendDataItem(dataItem);\r\n dataItem.axisBreak = axisBreak;\r\n if (dataItem.value != breakValue_1) {\r\n dataItem.value = breakValue_1;\r\n dataItem.text = _this.formatLabel(breakValue_1);\r\n if (dataItem.label && dataItem.label.invalid) {\r\n dataItem.label.validate();\r\n }\r\n }\r\n _this.validateDataElement(dataItem);\r\n }\r\n breakValue_1 += axisBreak.adjustedStep;\r\n }\r\n }\r\n }\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * Validates axis data item.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param dataItem Data item\r\n */\r\n ValueAxis.prototype.validateDataElement = function (dataItem) {\r\n _super.prototype.validateDataElement.call(this, dataItem);\r\n //dataItem.__disabled = false;\r\n dataItem.itemIndex = this._axisItemCount;\r\n this._axisItemCount++;\r\n var renderer = this.renderer;\r\n var value = dataItem.value;\r\n var endValue = dataItem.endValue;\r\n var position = this.valueToPosition(value);\r\n dataItem.position = position;\r\n var endPosition = position;\r\n var fillEndPosition = this.valueToPosition(value + this._step);\r\n if ($type.isNumber(endValue)) {\r\n endPosition = this.valueToPosition(endValue);\r\n fillEndPosition = endPosition;\r\n }\r\n // this point is needed to calculate distance to satisfy minGridDistance\r\n dataItem.point = renderer.positionToPoint(position);\r\n var tick = dataItem.tick;\r\n if (tick && !tick.disabled) {\r\n renderer.updateTickElement(tick, position, endPosition);\r\n }\r\n var grid = dataItem.grid;\r\n if (grid && !grid.disabled) {\r\n renderer.updateGridElement(grid, position, endPosition);\r\n }\r\n var label = dataItem.label;\r\n if (label && !label.disabled) {\r\n renderer.updateLabelElement(label, position, endPosition);\r\n }\r\n var fill = dataItem.axisFill;\r\n if (fill && !fill.disabled) {\r\n renderer.updateFillElement(fill, position, fillEndPosition);\r\n if (!dataItem.isRange) {\r\n this.fillRule(dataItem);\r\n }\r\n }\r\n if (dataItem.bullet) {\r\n renderer.updateBullet(dataItem.bullet, position, endPosition);\r\n }\r\n var mask = dataItem.mask;\r\n if (mask) {\r\n renderer.updateFillElement(mask, position, fillEndPosition);\r\n }\r\n };\r\n /**\r\n * Formats the value according to axis' own [[NumberFormatter]].\r\n *\r\n * @param value Source value\r\n * @return Formatted value\r\n */\r\n ValueAxis.prototype.formatLabel = function (value) {\r\n if (this.adjustLabelPrecision && value != 0) {\r\n return this.numberFormatter.format(value, undefined, this._stepDecimalPlaces);\r\n }\r\n else {\r\n return this.numberFormatter.format(value);\r\n }\r\n };\r\n Object.defineProperty(ValueAxis.prototype, \"basePoint\", {\r\n /**\r\n * Coordinates of the actual axis start.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Base point\r\n */\r\n get: function () {\r\n var baseValue = this.baseValue;\r\n var position = this.valueToPosition(baseValue);\r\n var basePoint = this.renderer.positionToPoint(position);\r\n return basePoint;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"baseValue\", {\r\n /**\r\n * @return base value\r\n */\r\n get: function () {\r\n var baseValue = this._baseValue;\r\n if (this.logarithmic) {\r\n baseValue = this.min;\r\n }\r\n if (!this._adapterO) {\r\n return baseValue;\r\n }\r\n else {\r\n return this._adapterO.apply(\"baseValue\", baseValue);\r\n }\r\n },\r\n /**\r\n * A base value.\r\n *\r\n * This is a threshold value that will divide \"positive\" and \"negative\"\r\n * value ranges.\r\n *\r\n * Other scale-related functionality also depend on base value. E.g. stacks,\r\n * value-dependent coloring, etc.\r\n *\r\n * @param value Base value\r\n */\r\n set: function (value) {\r\n this._baseValue = value;\r\n this.invalidateLayout();\r\n this.invalidateSeries();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Converts a numeric value to relative position on axis\r\n *\r\n * An alias to `valueToPosition()`.\r\n *\r\n * @param value Value\r\n * @return Position\r\n */\r\n ValueAxis.prototype.anyToPosition = function (value) {\r\n return this.valueToPosition(value);\r\n };\r\n /**\r\n * Converts a numeric value to orientation point (x, y, angle) on axis\r\n *\r\n * @param value Value\r\n * @return Orientation point\r\n */\r\n ValueAxis.prototype.valueToPoint = function (value) {\r\n var position = this.valueToPosition(value);\r\n var point = this.renderer.positionToPoint(position);\r\n var angle = this.renderer.positionToAngle(position);\r\n return { x: point.x, y: point.y, angle: angle };\r\n };\r\n /**\r\n * Converts a numeric value to orientation (x, y, angle) point on axis\r\n *\r\n * @param value Value\r\n * @return Orientation point\r\n */\r\n ValueAxis.prototype.anyToPoint = function (value) {\r\n return this.valueToPoint(value);\r\n };\r\n /**\r\n * Converts a numeric value to relative position on axis.\r\n *\r\n * @param value Value\r\n * @return relative position\r\n */\r\n ValueAxis.prototype.valueToPosition = function (value) {\r\n if ($type.isNumber(value)) {\r\n // todo: think if possible to take previous value and do not go through all previous breaks\r\n var min_1 = this.min;\r\n var max_1 = this.max;\r\n if ($type.isNumber(min_1) && $type.isNumber(max_1)) {\r\n var difference = this._difference;\r\n var axisBreaks = this._axisBreaks;\r\n if (axisBreaks && axisBreaks.length > 0) {\r\n $iter.eachContinue(axisBreaks.iterator(), function (axisBreak) {\r\n var startValue = axisBreak.adjustedStartValue;\r\n var endValue = axisBreak.adjustedEndValue;\r\n if ($type.isNumber(startValue) && $type.isNumber(endValue)) {\r\n if (value < startValue) {\r\n return false;\r\n }\r\n if ($math.intersect({ start: startValue, end: endValue }, { start: min_1, end: max_1 })) { // todo: check this once and set some flag in axisBreak\r\n startValue = Math.max(startValue, min_1);\r\n endValue = Math.min(endValue, max_1);\r\n var breakSize = axisBreak.breakSize;\r\n // value to the right of break end\r\n if (value > endValue) {\r\n min_1 += (endValue - startValue) * (1 - breakSize); // todo: maybe this can be done differently?\r\n }\r\n // value to the left of break start\r\n else if (value < startValue) {\r\n }\r\n // value within break\r\n else {\r\n value = startValue + (value - startValue) * breakSize;\r\n }\r\n }\r\n }\r\n return true;\r\n });\r\n }\r\n var position = void 0;\r\n if (!this.logarithmic) {\r\n position = (value - min_1) / difference;\r\n }\r\n else {\r\n var treatZeroAs = this.treatZeroAs;\r\n if ($type.isNumber(treatZeroAs)) {\r\n if (value <= treatZeroAs) {\r\n value = treatZeroAs;\r\n }\r\n }\r\n position = (Math.log(value) * Math.LOG10E - Math.log(this.min) * Math.LOG10E) / ((Math.log(this.max) * Math.LOG10E - Math.log(this.min) * Math.LOG10E));\r\n }\r\n //position = $math.round(position, 10);\r\n return position;\r\n }\r\n }\r\n return 0;\r\n };\r\n /**\r\n * When fontSize of fontFamily changes we need to hard-invalidate all Labels of this container to position them properly.\r\n */\r\n ValueAxis.prototype.invalidateLabels = function () {\r\n _super.prototype.invalidateLabels.call(this);\r\n if (this.dataItems) {\r\n this.dataItems.each(function (dataItem) {\r\n dataItem.value = undefined;\r\n });\r\n this.invalidate();\r\n }\r\n };\r\n /**\r\n * Converts an relative position to a corresponding value within\r\n * axis' scale.\r\n *\r\n * @param position Position (px)\r\n * @return Value\r\n */\r\n ValueAxis.prototype.positionToValue = function (position) {\r\n var min = this.min;\r\n var max = this.max;\r\n if ($type.isNumber(min) && $type.isNumber(max)) {\r\n var difference_1 = max - min; //no need to adjust!\r\n var value_2 = null;\r\n var axisBreaks = this._axisBreaks;\r\n if (axisBreaks) {\r\n // in case we have some axis breaks\r\n if (axisBreaks.length > 0) {\r\n $iter.eachContinue(axisBreaks.iterator(), function (axisBreak) {\r\n var breakStartPosition = axisBreak.startPosition;\r\n var breakEndPosition = axisBreak.endPosition;\r\n var breakStartValue = axisBreak.adjustedStartValue;\r\n var breakEndValue = axisBreak.adjustedEndValue;\r\n if ($type.isNumber(breakStartValue) && $type.isNumber(breakEndValue)) {\r\n if (breakStartValue > max) {\r\n return false;\r\n }\r\n if ($math.intersect({ start: breakStartValue, end: breakEndValue }, { start: min, end: max })) {\r\n breakStartValue = $math.max(breakStartValue, min);\r\n breakEndValue = $math.min(breakEndValue, max);\r\n var breakSize = axisBreak.breakSize;\r\n difference_1 -= (breakEndValue - breakStartValue) * (1 - breakSize);\r\n // position to the right of break end\r\n if (position > breakEndPosition) {\r\n min += (breakEndValue - breakStartValue) * (1 - breakSize);\r\n }\r\n // position to the left of break start\r\n else if (position < breakStartPosition) {\r\n }\r\n // value within break\r\n else {\r\n var breakPosition = (position - breakStartPosition) / (breakEndPosition - breakStartPosition);\r\n value_2 = breakStartValue + breakPosition * (breakEndValue - breakStartValue);\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n });\r\n }\r\n }\r\n if (!$type.isNumber(value_2)) {\r\n if (this.logarithmic) {\r\n value_2 = Math.pow(Math.E, (position * ((Math.log(this.max) * Math.LOG10E - Math.log(this.min) * Math.LOG10E)) + Math.log(this.min) * Math.LOG10E) / Math.LOG10E);\r\n }\r\n else {\r\n value_2 = position * difference_1 + min;\r\n }\r\n }\r\n return value_2;\r\n }\r\n //}\r\n };\r\n /**\r\n * Converts an X coordinate to a relative value in axis' scale.\r\n *\r\n * @param x X (px)\r\n * @return Value\r\n */\r\n ValueAxis.prototype.xToValue = function (x) {\r\n return this.positionToValue(this.pointToPosition({ x: x, y: 0 }));\r\n };\r\n /**\r\n * Converts an Y coordinate to a relative value in axis' scale.\r\n *\r\n * @param y Y (px)\r\n * @return Value\r\n */\r\n ValueAxis.prototype.yToValue = function (y) {\r\n return this.positionToValue(this.pointToPosition({ x: 0, y: y }));\r\n };\r\n /**\r\n * Converts pixel coordinates to a relative position. (0-1)\r\n *\r\n * @param point Coorinates (px)\r\n * @return Position (0-1)\r\n */\r\n ValueAxis.prototype.pointToPosition = function (point) {\r\n if (this.renderer instanceof AxisRendererY) {\r\n return 1 - this.renderer.pointToPosition(point);\r\n }\r\n else {\r\n return this.renderer.pointToPosition(point);\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n ValueAxis.prototype.animateMinMax = function (min, max) {\r\n return this.animate([{ property: \"_minAdjusted\", from: this._minAdjusted, to: min }, { property: \"_maxAdjusted\", from: this._maxAdjusted, to: max }], this.rangeChangeDuration, this.rangeChangeEasing);\r\n };\r\n /**\r\n * Calculates smallest and biggest value for the axis scale.\r\n * @ignore\r\n * @todo Description (review)\r\n */\r\n ValueAxis.prototype.getMinMax = function () {\r\n var _this = this;\r\n this.updateGridCount();\r\n var min = Number.POSITIVE_INFINITY;\r\n var max = Number.NEGATIVE_INFINITY;\r\n // only if min and max are not set from outside, we go through min and max influencers\r\n if (!$type.isNumber(this._minDefined) || !$type.isNumber(this._maxDefined)) {\r\n this.series.each(function (series) {\r\n if (!series.ignoreMinMax) {\r\n // check min\r\n var seriesMin = series.min(_this);\r\n if ($type.isNumber(seriesMin) && (seriesMin < min)) {\r\n min = seriesMin;\r\n }\r\n // check max\r\n var seriesMax = series.max(_this);\r\n if ($type.isNumber(seriesMax) && (seriesMax > max)) {\r\n max = seriesMax;\r\n }\r\n }\r\n });\r\n if (this.includeRangesInMinMax) {\r\n this.axisRanges.each(function (range) {\r\n if (!range.ignoreMinMax) {\r\n var minValue = $math.min(range.value, range.endValue);\r\n var maxValue = $math.max(range.value, range.endValue);\r\n if (minValue < min || !$type.isNumber(min)) {\r\n min = minValue;\r\n }\r\n if (maxValue > max || !$type.isNumber(max)) {\r\n max = maxValue;\r\n }\r\n }\r\n });\r\n }\r\n }\r\n if (this.logarithmic) {\r\n var treatZeroAs = this.treatZeroAs;\r\n if ($type.isNumber(treatZeroAs)) {\r\n if (min <= 0) {\r\n min = treatZeroAs;\r\n }\r\n }\r\n if (min <= 0) {\r\n this.raiseCriticalError(new Error(\"Logarithmic value axis can not have values <= 0.\"), true);\r\n }\r\n }\r\n if (min == 0 && max == 0) {\r\n max = 0.9;\r\n min = -0.9;\r\n }\r\n // if defined from outside\r\n if ($type.isNumber(this._minDefined)) {\r\n min = this._minDefined;\r\n }\r\n if ($type.isNumber(this._maxDefined)) {\r\n max = this._maxDefined;\r\n }\r\n if (this._adapterO) {\r\n min = this._adapterO.apply(\"min\", min);\r\n }\r\n if (this._adapterO) {\r\n max = this._adapterO.apply(\"max\", max);\r\n }\r\n if (!$type.isNumber(min) || !$type.isNumber(max)) {\r\n return;\r\n }\r\n this._minReal = min;\r\n this._maxReal = max;\r\n if (min == Number.POSITIVE_INFINITY) {\r\n min = undefined;\r\n }\r\n if (max == Number.NEGATIVE_INFINITY) {\r\n max = undefined;\r\n }\r\n var dif = this.adjustDifference(min, max); // previously it was max-min, but not worked well\r\n min = this.fixMin(min);\r\n max = this.fixMax(max);\r\n // this happens if starLocation and endLocation are 0.5 and DateAxis has only one date\r\n if (max - min <= 1 / Math.pow(10, 15)) {\r\n if (max - min != 0) {\r\n this._deltaMinMax = (max - min) / 2;\r\n }\r\n else {\r\n // the number by which we need to raise 10 to get difference\r\n var exponent = Math.log(Math.abs(max)) * Math.LOG10E;\r\n // here we find a number which is power of 10 and has the same count of numbers as difference has\r\n var power = Math.pow(10, Math.floor(exponent));\r\n // reduce this number by 10 times\r\n power = power / 10;\r\n this._deltaMinMax = power;\r\n }\r\n min -= this._deltaMinMax;\r\n max += this._deltaMinMax;\r\n }\r\n min -= (max - min) * this.extraMin;\r\n max += (max - min) * this.extraMax;\r\n var strict = this.strictMinMax;\r\n if ($type.isNumber(this._maxDefined)) {\r\n strict = true;\r\n }\r\n var minMaxStep = this.adjustMinMax(min, max, dif, this._gridCount, strict);\r\n min = minMaxStep.min;\r\n max = minMaxStep.max;\r\n dif = max - min; //new\r\n // do it for the second time (importat!)\r\n minMaxStep = this.adjustMinMax(min, max, max - min, this._gridCount, true);\r\n min = minMaxStep.min;\r\n max = minMaxStep.max;\r\n // return min max if strict\r\n if (this.strictMinMax) {\r\n if ($type.isNumber(this._minDefined)) {\r\n min = this._minDefined;\r\n }\r\n else {\r\n min = this._minReal;\r\n }\r\n if ($type.isNumber(this._maxDefined)) {\r\n max = this._maxDefined;\r\n }\r\n else {\r\n max = this._maxReal;\r\n }\r\n if (max - min <= 0.00000001) {\r\n min -= this._deltaMinMax;\r\n max += this._deltaMinMax;\r\n }\r\n min -= (max - min) * this.extraMin;\r\n max += (max - min) * this.extraMax;\r\n }\r\n if (this._adapterO) {\r\n min = this._adapterO.apply(\"min\", min);\r\n }\r\n if (this._adapterO) {\r\n max = this._adapterO.apply(\"max\", max);\r\n }\r\n this._step = minMaxStep.step;\r\n if (!$type.isNumber(min) && !$type.isNumber(max)) {\r\n this.start = 0;\r\n this.end = 1;\r\n this.renderer.labels.each(function (label) {\r\n label.dataItem.text = \"\";\r\n });\r\n }\r\n // checking isNumber is good when all series are hidden\r\n if ((this._minAdjusted != min || this._maxAdjusted != max) && $type.isNumber(min) && $type.isNumber(max)) {\r\n var animation = this._minMaxAnimation;\r\n if (this._extremesChanged && $type.isNumber(this._minAdjusted) && $type.isNumber(this._maxAdjusted) && this.inited) {\r\n if ((animation && !animation.isFinished()) && this._finalMax == max && this._finalMin == min) {\r\n return;\r\n }\r\n else {\r\n this._finalMin = min;\r\n this._finalMax = max;\r\n animation = this.animateMinMax(min, max);\r\n if (animation && !animation.isFinished()) {\r\n animation.events.on(\"animationprogress\", this.validateDataItems, this);\r\n animation.events.on(\"animationended\", function () {\r\n //this.validateDataItems();\r\n _this.series.each(function (series) {\r\n series.validate();\r\n });\r\n _this.validateDataItems();\r\n _this.handleSelectionExtremesChange();\r\n });\r\n this._minMaxAnimation = animation;\r\n }\r\n else {\r\n this.series.each(function (series) {\r\n series.invalidate();\r\n });\r\n }\r\n this.validateDataItems();\r\n this.dispatchImmediately(\"extremeschanged\");\r\n this.handleSelectionExtremesChange();\r\n }\r\n }\r\n else {\r\n if ((animation && !animation.isFinished()) && this._finalMax == max && this._finalMin == min) {\r\n return;\r\n }\r\n else {\r\n this._minAdjusted = min;\r\n this._maxAdjusted = max;\r\n this._finalMin = min;\r\n this._finalMax = max;\r\n this.invalidateDataItems();\r\n this.dispatchImmediately(\"extremeschanged\");\r\n this._saveMinMax(min, max);\r\n }\r\n }\r\n }\r\n this._extremesChanged = false;\r\n this._difference = this.adjustDifference(min, max);\r\n };\r\n /**\r\n * Adjusts the minimum value.\r\n *\r\n * This is a placeholder method for extending classes to override.\r\n *\r\n * For numeric values this does nothing, however for more complex types, like\r\n * dates, it may be necessary to adjust.\r\n *\r\n * @param value Value\r\n * @return Adjusted value\r\n */\r\n ValueAxis.prototype.fixMin = function (value) {\r\n return value;\r\n };\r\n /**\r\n * Adjusts the maximum value.\r\n *\r\n * This is a placeholder method for extending classes to override.\r\n *\r\n * For numeric values this does nothing, however for more complex types, like\r\n * dates, it may be necessary to adjust.\r\n *\r\n * @param value Value\r\n * @return Adjusted value\r\n */\r\n ValueAxis.prototype.fixMax = function (value) {\r\n return value;\r\n };\r\n /**\r\n * Adjusts actual min and max scale values so that the axis starts and ends\r\n * at \"nice\" values, unless `strictMinMax` is set.\r\n *\r\n * The `difference` can be something else than `max - min`, because of the\r\n * axis breaks.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param min [description]\r\n * @param max [description]\r\n * @param difference [description]\r\n * @param gridCount [description]\r\n * @param strictMode [description]\r\n * @return [description]\r\n */\r\n ValueAxis.prototype.adjustMinMax = function (min, max, difference, gridCount, strictMode) {\r\n // will fail if 0\r\n if (gridCount <= 1) {\r\n gridCount = 1;\r\n }\r\n gridCount = Math.round(gridCount);\r\n var initialMin = min;\r\n var initialMax = max;\r\n // in case min and max is the same, use max\r\n if (difference === 0) {\r\n difference = Math.abs(max);\r\n }\r\n // the number by which we need to raise 10 to get difference\r\n var exponent = Math.log(Math.abs(difference)) * Math.LOG10E;\r\n // here we find a number which is power of 10 and has the same count of numbers as difference has\r\n var power = Math.pow(10, Math.floor(exponent));\r\n // reduce this number by 10 times\r\n power = power / 10;\r\n var extra = power;\r\n if (strictMode) {\r\n extra = 0;\r\n }\r\n if (!this.logarithmic) {\r\n // round down min\r\n if (strictMode) {\r\n min = Math.floor(min / power) * power;\r\n // round up max\r\n max = Math.ceil(max / power) * power;\r\n }\r\n else {\r\n min = Math.ceil(min / power) * power - extra;\r\n // round up max\r\n max = Math.floor(max / power) * power + extra;\r\n }\r\n // don't let min go below 0 if real min is >= 0\r\n if (min < 0 && initialMin >= 0) {\r\n min = 0;\r\n }\r\n // don't let max go above 0 if real max is <= 0\r\n if (max > 0 && initialMax <= 0) {\r\n max = 0;\r\n }\r\n }\r\n else {\r\n if (min <= 0) {\r\n //throw Error(\"Logarithmic value axis can not have values <= 0.\");\r\n min = this.baseValue;\r\n }\r\n // @todo: think of a better way or to restrict zooming when no series are selected\r\n if (min == Infinity) {\r\n min = 1;\r\n }\r\n if (max == -Infinity) {\r\n max = 10;\r\n }\r\n if (this.strictMinMax) {\r\n if (this._minDefined > 0) {\r\n min = this._minDefined;\r\n }\r\n else {\r\n min = min;\r\n }\r\n if (this._maxDefined > 0) {\r\n max = max;\r\n }\r\n }\r\n else {\r\n min = Math.pow(10, Math.floor(Math.log(Math.abs(min)) * Math.LOG10E));\r\n max = Math.pow(10, Math.ceil(Math.log(Math.abs(max)) * Math.LOG10E));\r\n }\r\n }\r\n // repeat diff, exponent and power again with rounded values\r\n //difference = this.adjustDifference(min, max);\r\n /*\r\n\r\n if(min > initialMin){\r\n min = initialMin;\r\n }\r\n\r\n if(max < initialMax){\r\n max = initialMax;\r\n }\r\n */\r\n exponent = Math.log(Math.abs(difference)) * Math.LOG10E;\r\n power = Math.pow(10, Math.floor(exponent));\r\n power = power / 10;\r\n // approximate difference between two grid lines\r\n var step = Math.ceil((difference / gridCount) / power) * power;\r\n var stepPower = Math.pow(10, Math.floor(Math.log(Math.abs(step)) * Math.LOG10E));\r\n // TODO: in v3 I had fixStepE here, ommiting it for a while, need to think about other solution\r\n // the step should divide by 2, 5, and 10.\r\n var stepDivisor = Math.ceil(step / stepPower); // number 0 - 10\r\n if (stepDivisor > 5) {\r\n stepDivisor = 10;\r\n }\r\n else if (stepDivisor <= 5 && stepDivisor > 2) {\r\n stepDivisor = 5;\r\n }\r\n // now get real step\r\n step = Math.ceil(step / (stepPower * stepDivisor)) * stepPower * stepDivisor;\r\n if (this.maxPrecision < Number.MAX_VALUE && step != $math.ceil(step, this.maxPrecision)) {\r\n step = $math.ceil(step, this.maxPrecision);\r\n }\r\n var decCount = 0;\r\n // in case numbers are smaller than 1\r\n if (stepPower < 1) {\r\n // exponent is less then 1 too. Count decimals of exponent\r\n decCount = Math.round(Math.abs(Math.log(Math.abs(stepPower)) * Math.LOG10E)) + 1;\r\n // round step\r\n step = $math.round(step, decCount);\r\n }\r\n if (!this.logarithmic) {\r\n // final min and max\r\n var minCount = Math.floor(min / step);\r\n min = $math.round(step * minCount, decCount);\r\n var maxCount = void 0;\r\n if (!strictMode) {\r\n maxCount = Math.ceil(max / step);\r\n }\r\n else {\r\n maxCount = Math.floor(max / step);\r\n }\r\n if (maxCount == minCount) {\r\n maxCount++;\r\n }\r\n max = $math.round(step * maxCount, decCount);\r\n if (max < initialMax) {\r\n max = max + step;\r\n }\r\n if (min > initialMin) {\r\n min = min - step;\r\n }\r\n }\r\n return { min: min, max: max, step: step };\r\n };\r\n Object.defineProperty(ValueAxis.prototype, \"min\", {\r\n /**\r\n * @return Min value\r\n */\r\n get: function () {\r\n var min = this._minAdjusted;\r\n if (!$type.isNumber(min)) {\r\n min = this._minDefined;\r\n }\r\n return min;\r\n },\r\n /**\r\n * A minimum value for the axis scale.\r\n *\r\n * This value might be auto-adjusted by the Axis in order to accomodate the\r\n * grid nicely, i.e. plot area is divided by grid in nice equal cells.\r\n *\r\n * The above might be overridden by `strictMinMax` which will force exact\r\n * user-defined min and max values to be used for scale.\r\n *\r\n * @param value Min value\r\n */\r\n set: function (value) {\r\n if (this._minDefined != value) {\r\n this._minDefined = value;\r\n this.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"minDefined\", {\r\n /**\r\n * Min value as defined by user's code, not auto-calculated.\r\n *\r\n * @readonly\r\n * @return Min value\r\n */\r\n get: function () {\r\n return this._minDefined;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"maxDefined\", {\r\n /**\r\n * Max value as defined by user's code, not auto-calculated.\r\n *\r\n * @readonly\r\n * @return Man value\r\n */\r\n get: function () {\r\n return this._maxDefined;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"extraMin\", {\r\n /**\r\n * @return {number}\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"extraMin\");\r\n },\r\n /**\r\n * Allows relatively adjusting minimum value of the axis' scale.\r\n *\r\n * The value is relative to the actual range of values currently displayed\r\n * on the axis.\r\n *\r\n * E.g.: 0.5 will mean half of the current range. If we have axis displaying\r\n * from 100 to 200, we will now have axis displaying from 50 to 200 because\r\n * we asked to expand minimum value by 50% (0.5).\r\n *\r\n * NOTE: this setting is not compatible with `strictMinMax`.\r\n *\r\n * @param {number}\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"extraMin\", value)) {\r\n this.invalidateDataItems();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"extraMax\", {\r\n /**\r\n * @return Min multiplier\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"extraMax\");\r\n },\r\n /**\r\n * Allows relatively adjusting maximum value of the axis' scale.\r\n *\r\n * The value is relative to the actual range of values currently displayed\r\n * on the axis.\r\n *\r\n * E.g.: 0.5 will mean half of the current range. If we have axis displaying\r\n * from 100 to 200, we will now have axis displaying from 100 to 250 because\r\n * we asked to expand maximum value by 50% (0.5).\r\n *\r\n * NOTE: this setting is not compatible with `strictMinMax`.\r\n *\r\n * @param {number}\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"extraMax\", value)) {\r\n this.invalidateDataItems();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"step\", {\r\n /**\r\n * Current calculated delta in values between two adjacent grid lines (step).\r\n *\r\n * This is a read-only value and cannot be used to set actual step.\r\n *\r\n * @readonly\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/axes/positioning-axis-elements/#Setting_the_density_of_the_the_grid_labels} For more information about modifying density of labels\r\n * @return [description]\r\n */\r\n get: function () {\r\n return this._step;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"max\", {\r\n /**\r\n * @return Max value\r\n */\r\n get: function () {\r\n var max = this._maxAdjusted;\r\n if (!$type.isNumber(max)) {\r\n max = this._maxDefined;\r\n }\r\n return max;\r\n },\r\n /**\r\n * A maximum value for the axis scale.\r\n *\r\n * This value might be auto-adjusted by the Axis in order to accomodate the\r\n * grid nicely, i.e. plot area is divided by grid in nice equal cells.\r\n *\r\n * The above might be overridden by `strictMinMax` which will force exact\r\n * user-defined min and max values to be used for scale.\r\n *\r\n * @param value Max value\r\n */\r\n set: function (value) {\r\n if (this._maxDefined != value) {\r\n this._maxDefined = value;\r\n this.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"adjustLabelPrecision\", {\r\n /**\r\n * @return Adjust precision\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"adjustLabelPrecision\");\r\n },\r\n /**\r\n * By default the axis will adjust precision of all numbers to match number\r\n * of decimals in all its labels, e.g.: `1.0`, `1.5`, `2.0`.\r\n *\r\n * To disable set `adjustLabelPrecision` to `false`, to use whatever other\r\n * precision or number format settings are set.\r\n *\r\n * IMPORTANT: This setting will be ignored if your number format uses\r\n * modifiers, e.g. `\"#a\"`.\r\n *\r\n * @default true\r\n * @since 4.9.14\r\n * @param value Adjust precision\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"adjustLabelPrecision\", value)) {\r\n this.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Used for the Series to register itself as the user of this Axis.\r\n *\r\n * This will also decorate both the Series and Axis with event handlers, used\r\n * to redraw on Axis position/zoom change.\r\n *\r\n * A disposer for those events is returned, so that they can be disposed\r\n * together with Series.\r\n *\r\n * @ignore Exclude from docs\r\n * @param series Series\r\n * @return Disposer for events\r\n */\r\n ValueAxis.prototype.registerSeries = function (series) {\r\n return new MultiDisposer([\r\n _super.prototype.registerSeries.call(this, series),\r\n series.events.on(\"extremeschanged\", this.handleExtremesChange, this, false),\r\n series.events.on(\"selectionextremeschanged\", this.handleSelectionExtremesChange, this, false),\r\n this.events.on(\"extremeschanged\", series.invalidate, series, false)\r\n ]);\r\n };\r\n /**\r\n * Perform tasks after Axis zoom.\r\n */\r\n ValueAxis.prototype.handleSelectionExtremesChange = function () {\r\n var _this = this;\r\n var selectionMin;\r\n var selectionMax;\r\n var allHidden = true;\r\n $iter.each(this.series.iterator(), function (series) {\r\n if (!series.ignoreMinMax && !series.isHidden && !series.outOfRange) {\r\n if (series.visible && !series.isHiding) {\r\n allHidden = false;\r\n }\r\n var seriesSelectionMin = series.selectionMin(_this);\r\n var seriesSelectionMax = series.selectionMax(_this);\r\n if ($type.isNumber(seriesSelectionMin)) {\r\n if (!$type.isNumber(selectionMin) || (seriesSelectionMin < selectionMin)) {\r\n selectionMin = seriesSelectionMin;\r\n }\r\n }\r\n // check max\r\n if ($type.isNumber(seriesSelectionMax)) {\r\n if (!$type.isNumber(selectionMax) || (seriesSelectionMax > selectionMax)) {\r\n selectionMax = seriesSelectionMax;\r\n }\r\n }\r\n }\r\n });\r\n if (this.includeRangesInMinMax) {\r\n this.axisRanges.each(function (range) {\r\n if (!range.ignoreMinMax) {\r\n var minValue = $math.min(range.value, range.endValue);\r\n var maxValue = $math.max(range.value, range.endValue);\r\n if (minValue < selectionMin) {\r\n selectionMin = minValue;\r\n }\r\n if (maxValue > selectionMax) {\r\n selectionMax = maxValue;\r\n }\r\n }\r\n });\r\n }\r\n // this is not good, as if date axis is initially zoomed, selection of y axis is reset to 0, 1 at the end of this method\r\n //$iter.each(this.series.iterator(), (series) => {\r\n //\tif (!series.appeared) {\r\n //\t\tallHidden = true;\r\n //\t}\r\n //})\r\n if ($type.isNumber(this._minDefined)) {\r\n if (this.strictMinMax) {\r\n selectionMin = this._minDefined;\r\n }\r\n else {\r\n selectionMin = this.min;\r\n }\r\n }\r\n else if (this.strictMinMax) {\r\n selectionMin = this._minReal;\r\n }\r\n if ($type.isNumber(this._maxDefined)) {\r\n if (this.strictMinMax) {\r\n selectionMax = this._maxDefined;\r\n }\r\n else {\r\n selectionMax = this.max;\r\n }\r\n }\r\n else if (this.strictMinMax) {\r\n selectionMax = this._maxReal;\r\n }\r\n if (selectionMin == selectionMax) {\r\n selectionMin -= this._deltaMinMax;\r\n selectionMax += this._deltaMinMax;\r\n var minMaxStep2 = this.adjustMinMax(selectionMin, selectionMax, 0, this._gridCount, this.strictMinMax);\r\n selectionMin = minMaxStep2.min;\r\n selectionMax = minMaxStep2.max;\r\n }\r\n var dif = this.adjustDifference(selectionMin, selectionMax);\r\n var minMaxStep = this.adjustMinMax(selectionMin, selectionMax, dif, this._gridCount);\r\n selectionMin = minMaxStep.min;\r\n selectionMax = minMaxStep.max;\r\n selectionMin -= (selectionMax - selectionMin) * this.extraMin;\r\n selectionMax += (selectionMax - selectionMin) * this.extraMax;\r\n selectionMin = $math.fitToRange(selectionMin, this.min, this.max);\r\n selectionMax = $math.fitToRange(selectionMax, this.min, this.max);\r\n // do it for the second time !important\r\n dif = this.adjustDifference(selectionMin, selectionMax);\r\n minMaxStep = this.adjustMinMax(selectionMin, selectionMax, dif, this._gridCount, true);\r\n selectionMin = minMaxStep.min;\r\n selectionMax = minMaxStep.max;\r\n if (this.strictMinMax) {\r\n selectionMin = $math.max(selectionMin, this._minDefined);\r\n selectionMax = $math.min(selectionMax, this._maxDefined);\r\n }\r\n var step = minMaxStep.step;\r\n if (this.syncWithAxis) {\r\n minMaxStep = this.syncAxes(selectionMin, selectionMax, step);\r\n selectionMin = minMaxStep.min;\r\n selectionMax = minMaxStep.max;\r\n this.invalidate();\r\n }\r\n step = minMaxStep.step;\r\n // needed because of grouping\r\n this._difference = this.adjustDifference(this.min, this.max);\r\n var start = this.valueToPosition(selectionMin);\r\n var end = this.valueToPosition(selectionMax);\r\n // in case all series are hidden or hiding, full zoomout\r\n if (allHidden && !this.syncWithAxis) {\r\n start = 0;\r\n end = 1;\r\n }\r\n var declination = 0;\r\n if (this.syncWithAxis) {\r\n declination = 5;\r\n this.setCache(selectionMin + \"-\" + selectionMax, step);\r\n }\r\n else {\r\n if (this._step != step || this._minZoomed != selectionMin || this._maxZoomed != selectionMax) {\r\n this._dsc = true;\r\n }\r\n this._step = step;\r\n this._minZoomed = selectionMin;\r\n this._maxZoomed = selectionMax;\r\n }\r\n if (!this.keepSelection) {\r\n this.zoom({ start: start, end: end }, false, false, declination);\r\n }\r\n };\r\n Object.defineProperty(ValueAxis.prototype, \"strictMinMax\", {\r\n /**\r\n * @return Use exact values?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"strictMinMax\");\r\n },\r\n /**\r\n * Indicates whether to blindly use exact `min` and `max` values set by user\r\n * when generating Axis scale.\r\n *\r\n * If not set, the Axis might slightly adjust those values to accomodate a\r\n * better looking grid.\r\n *\r\n * NOTE: if `min` and `max` are not set, setting `strictMinMax` to `true`\r\n * will result in fixing the scale of the axis to actual lowest and highest\r\n * values in the series within currently selected scope.\r\n *\r\n * @default false\r\n * @param value Use exact values?\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"strictMinMax\", value)) {\r\n this.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"logarithmic\", {\r\n /**\r\n * @return Logarithmic scale?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"logarithmic\");\r\n },\r\n /**\r\n * Indicates if this axis should use a logarithmic scale.\r\n *\r\n * Please note that logarithmic axis can **only** accommodate values bigger\r\n * than zero.\r\n *\r\n * Having zero or negative values will result in error and failure of the\r\n * whole chart.\r\n *\r\n * @param value Logarithmic scale?\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"logarithmic\", value)) {\r\n this.invalidate();\r\n this.series.each(function (series) {\r\n series.invalidateDataItems();\r\n });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"keepSelection\", {\r\n /**\r\n * @return Preseve zoom after data update?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"keepSelection\");\r\n },\r\n /**\r\n * Indicates if a current selection (zoom) should be kept across data updates.\r\n *\r\n * If your axis is zoomed while chart's data is updated, the axis will try\r\n * to retain the same start and end values.\r\n *\r\n * You can also use this to initially pre-zoom axis:\r\n *\r\n * ```TypeScript\r\n * axis.keepSelection = true;\r\n * axis.start = 0.5;\r\n * axis.end = 0.7;\r\n * ```\r\n * ```JavaScript\r\n * axis.keepSelection = true;\r\n * axis.start = 0.5;\r\n * axis.end = 0.7;\r\n * ```\r\n * ```JSON\r\n * {\r\n * \"xAxes\": [{\r\n * // ...\r\n * \"keepSelection\": true,\r\n * \"start\": 0.5,\r\n * \"end\": 0.7\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * The above will start the chart zoomed from the middle of the actual scope\r\n * to 70%.\r\n *\r\n * @since 4.1.1\r\n * @default false\r\n * @param value Preseve zoom after data update?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"keepSelection\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"includeRangesInMinMax\", {\r\n /**\r\n * @return Include ranges?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"includeRangesInMinMax\");\r\n },\r\n /**\r\n * If set to `true`, values of axis ranges will be included when calculating\r\n * range of values / scale of the [[ValueAxis]].\r\n *\r\n * @default false\r\n * @since 4.4.9\r\n * @param value Include ranges?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"includeRangesInMinMax\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"maxPrecision\", {\r\n /**\r\n * @return max precision\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"maxPrecision\");\r\n },\r\n /**\r\n * Maximum number of decimals to allow when placing grid lines and labels\r\n * on axis.\r\n *\r\n * Set it to `0` (zero) to force integer-only axis labels.\r\n *\r\n * @param {number}\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"maxPrecision\", value)) {\r\n this.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"extraTooltipPrecision\", {\r\n /**\r\n * @return Extra decimals\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"extraTooltipPrecision\");\r\n },\r\n /**\r\n * This setting allows using bigger precision for numbers displayed in axis\r\n * tooltip.\r\n *\r\n * Please note that this setting indicates additional decimal places to\r\n * automatically-calculated axis number precision.\r\n *\r\n * So if your axis displays numbers like 0.1, 0.2, etc. (one decimal place),\r\n * and you set `extraTooltipPrecision = 1`, tooltips will display numbers\r\n * like 0.12, 0.25, etc. (two decimal places).\r\n *\r\n * @default 0\r\n * @since 4.8.3\r\n * @param value Extra decimals\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"extraTooltipPrecision\", value)) {\r\n this.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Invalidates axis data items when series extremes change\r\n */\r\n ValueAxis.prototype.handleExtremesChange = function () {\r\n var _this = this;\r\n this._extremesChanged = true;\r\n this.getMinMax();\r\n if (this.ghostLabel) {\r\n var mw_1 = 0;\r\n this.dataItems.each(function (dataItem) {\r\n if (dataItem.label && dataItem.label.pixelWidth > mw_1) {\r\n _this.ghostLabel.text = dataItem.label.currentText;\r\n }\r\n });\r\n }\r\n };\r\n /**\r\n * Returns relative position on axis for series' data item's value.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (review)\r\n * @param dataItem Data item\r\n * @param key Data field to get value from\r\n * @param location Location (0-1)\r\n * @param stackKey ?\r\n * @return X coordinate (px)\r\n */\r\n ValueAxis.prototype.getX = function (dataItem, key, location, stackKey, range) {\r\n return this.renderer.positionToPoint(this.getPositionX(dataItem, key, location, stackKey, range)).x;\r\n };\r\n /**\r\n * Returns the X coordinate for series' data item's value.\r\n *\r\n * @since 4.5.14\r\n * @param dataItem Data item\r\n * @param key Data field to get value from\r\n * @param location Location (0-1)\r\n * @param stackKey ?\r\n * @return Relative position\r\n */\r\n ValueAxis.prototype.getPositionX = function (dataItem, key, location, stackKey, range) {\r\n var value = dataItem.getWorkingValue(key);\r\n if (!$type.hasValue(stackKey)) {\r\n stackKey = \"valueX\";\r\n }\r\n var stack = dataItem.getValue(stackKey, \"stack\");\r\n if (!$type.isNumber(value)) {\r\n value = this.baseValue;\r\n if (this.logarithmic) {\r\n if (stack > 0) {\r\n value = 0;\r\n }\r\n }\r\n }\r\n var position = this.valueToPosition(value + stack);\r\n if (range) {\r\n position = $math.fitToRange(position, range.start, range.end);\r\n }\r\n return position;\r\n };\r\n /**\r\n * Returns the Y coordinate for series' data item's value.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (review)\r\n * @param dataItem Data item\r\n * @param key Data field to get value from\r\n * @param location Location (0-1)\r\n * @param stackKey Stack ID\r\n * @return Y coordinate (px)\r\n */\r\n ValueAxis.prototype.getY = function (dataItem, key, location, stackKey, range) {\r\n return this.renderer.positionToPoint(this.getPositionY(dataItem, key, location, stackKey, range)).y;\r\n };\r\n /**\r\n * Returns relative position on axis for series' data item's value.\r\n *\r\n * @since 4.5.14\r\n * @param dataItem Data item\r\n * @param key Data field to get value from\r\n * @param location Location (0-1)\r\n * @param stackKey Stack ID\r\n * @return Relative position\r\n */\r\n ValueAxis.prototype.getPositionY = function (dataItem, key, location, stackKey, range) {\r\n var value = dataItem.getWorkingValue(key);\r\n if (!$type.hasValue(stackKey)) {\r\n stackKey = \"valueY\";\r\n }\r\n var stack = dataItem.getValue(stackKey, \"stack\");\r\n if (!$type.isNumber(value)) {\r\n value = this.baseValue;\r\n if (this.logarithmic) {\r\n if (stack > 0) {\r\n value = 0;\r\n }\r\n }\r\n }\r\n var position = this.valueToPosition(value + stack);\r\n if (range) {\r\n position = $math.fitToRange(position, range.start, range.end);\r\n }\r\n return position;\r\n };\r\n /**\r\n * Returns an angle for series data item.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (review)\r\n * @param dataItem Data item\r\n * @param key Data field to get value from\r\n * @param location Location (0-1)\r\n * @param stackKey Stack ID\r\n * @param range Range to fit in\r\n * @return Angle\r\n */\r\n ValueAxis.prototype.getAngle = function (dataItem, key, location, stackKey, range) {\r\n var value = dataItem.getWorkingValue(key);\r\n var stack = dataItem.getValue(stackKey, \"stack\");\r\n if (!$type.isNumber(value)) {\r\n value = this.baseValue;\r\n }\r\n var position = this.valueToPosition(value + stack);\r\n if (range) {\r\n position = $math.fitToRange(position, range.start, range.end);\r\n }\r\n return this.positionToAngle(position);\r\n };\r\n /**\r\n * [getAnyRangePath description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param start [description]\r\n * @param end [description]\r\n * @param location [description]\r\n * @return [description]\r\n */\r\n ValueAxis.prototype.getAnyRangePath = function (start, end, location) {\r\n var startPosition = this.valueToPosition(start);\r\n var endPosition = this.valueToPosition(end);\r\n return this.getPositionRangePath(startPosition, endPosition); // Base class (Axis) gets range shape from AxisRenderer\r\n };\r\n /**\r\n * Returns text to show in a axis tooltip, based on specific position within\r\n * axis.\r\n *\r\n * The label will be formatted as per [[NumberFormatter]] set for the whole\r\n * chart, or explicitly for this Axis.\r\n *\r\n * @ignore Exclude from docs\r\n * @param position Position (px)\r\n * @return Label (numeric value)\r\n */\r\n ValueAxis.prototype.getTooltipText = function (position) {\r\n var value = $math.round(this.positionToValue(position), this._stepDecimalPlaces + this.extraTooltipPrecision);\r\n var valueStr = this.tooltip.numberFormatter.format(value);\r\n if (!this._adapterO) {\r\n return valueStr;\r\n }\r\n else {\r\n return this._adapterO.apply(\"getTooltipText\", valueStr);\r\n }\r\n };\r\n /**\r\n * Zooms axis to specific values.\r\n *\r\n * @param startValue Start value\r\n * @param endValue End value\r\n * @param skipRangeEvent Do not invoke events\r\n * @param instantly Do not play zoom animations\r\n */\r\n ValueAxis.prototype.zoomToValues = function (startValue, endValue, skipRangeEvent, instantly) {\r\n var start = (startValue - this.min) / (this.max - this.min);\r\n var end = (endValue - this.min) / (this.max - this.min);\r\n this.zoom({ start: start, end: end }, skipRangeEvent, instantly);\r\n };\r\n Object.defineProperty(ValueAxis.prototype, \"minZoomed\", {\r\n /**\r\n * A smallest value in axis scale within current zoom.\r\n *\r\n * @return Min zoom value\r\n */\r\n get: function () {\r\n if (!this.syncWithAxis) {\r\n return $math.max(this.min, this._minZoomed);\r\n }\r\n else {\r\n return this._minZoomed;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"maxZoomed\", {\r\n /**\r\n * A biggest value in axis scale within current zoom.\r\n * @return [description]\r\n */\r\n get: function () {\r\n if (!this.syncWithAxis) {\r\n return $math.min(this.max, this._maxZoomed);\r\n }\r\n else {\r\n return this._maxZoomed;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Updates positioning of Axis breaks after something changes.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n ValueAxis.prototype.fixAxisBreaks = function () {\r\n var _this = this;\r\n _super.prototype.fixAxisBreaks.call(this);\r\n var axisBreaks = this._axisBreaks;\r\n if (axisBreaks && axisBreaks.length > 0) {\r\n // process breaks\r\n axisBreaks.each(function (axisBreak) {\r\n var startValue = axisBreak.adjustedStartValue;\r\n var endValue = axisBreak.adjustedEndValue;\r\n // break difference\r\n var axisBreakDif = endValue - startValue;\r\n var axisBreakGridCount = Math.ceil(axisBreakDif * axisBreak.breakSize) * _this._gridCount / (_this.max - _this.min);\r\n // calculate min, max and step for axis break\r\n var breakMinMaxStep = _this.adjustMinMax(startValue, endValue, axisBreakDif, axisBreakGridCount, true);\r\n axisBreak.adjustedStep = breakMinMaxStep.step;\r\n axisBreak.adjustedMin = breakMinMaxStep.min;\r\n axisBreak.adjustedMax = breakMinMaxStep.max;\r\n });\r\n }\r\n this._difference = this.adjustDifference(this.min, this.max);\r\n };\r\n /**\r\n * Returns value based on position.\r\n *\r\n * Please note that `position` represents position within axis which may be\r\n * zoomed and not correspond to Cursor's `position`.\r\n *\r\n * To convert Cursor's `position` to Axis' `position` use `toAxisPosition()` method.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/tutorials/tracking-cursors-position-via-api/#Tracking_Cursor_s_position} For more information about cursor tracking.\r\n * @param position Relative position on axis (0-1)\r\n * @return Position label\r\n */\r\n ValueAxis.prototype.getPositionLabel = function (position) {\r\n var value = this.positionToValue(position);\r\n return this.numberFormatter.format(value);\r\n };\r\n /**\r\n * Shows Axis tooltip at specific value\r\n *\r\n * @param value Value\r\n */\r\n ValueAxis.prototype.showTooltipAt = function (value) {\r\n this.showTooltipAtPosition(this.valueToPosition(value));\r\n };\r\n /**\r\n * Copies all properties and related data from a different instance of Axis.\r\n *\r\n * @param source Source Axis\r\n */\r\n ValueAxis.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.min = source.min;\r\n this.max = source.max;\r\n this.calculateTotals = source.calculateTotals;\r\n this._baseValue = source.baseValue;\r\n };\r\n Object.defineProperty(ValueAxis.prototype, \"syncWithAxis\", {\r\n /**\r\n * @return Target axis\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"syncWithAxis\");\r\n },\r\n /**\r\n * Enables syncing of grid with another axis.\r\n *\r\n * To enable, set to a reference of the other `ValueAxis`. This axis will try\r\n * to maintain its scale in such way that its grid matches target axis grid.\r\n *\r\n * IMPORTANT #1: At this stage it's an experimental feature. Use it at your\r\n * own risk, as it may not work in 100% of the scenarios.\r\n *\r\n * IMPORTANT #2: `syncWithAxis` is not compatible with `strictMinMax` and\r\n * `sequencedInterpolation` settings.\r\n *\r\n * IMPORTANT #3: `syncWithAxis` is not compatible with scrollbars. Make sure\r\n * you do not add a scrollbar in the same direction as synced axes. For\r\n * example, if you have vertical synced axes, do not add `scrollbarY` on\r\n * your chart. It will create anomalies when used.\r\n *\r\n * IMPORTANT #4: `syncWithAxis` is not compatible with `XYCursor` if it has\r\n * its `behavior` set to either `zoomY` or `zoomXY`.\r\n *\r\n * @since 4.8.1\r\n * @param axis Target axis\r\n */\r\n set: function (axis) {\r\n var _this = this;\r\n if (this.setPropertyValue(\"syncWithAxis\", axis, true)) {\r\n if (axis) {\r\n this._disposers.push(axis.events.on(\"extremeschanged\", this.handleSelectionExtremesChange, this, false));\r\n this._disposers.push(axis.events.on(\"selectionextremeschanged\", this.handleSelectionExtremesChange, this, false));\r\n this._disposers.push(axis.events.on(\"startendchanged\", this.handleSelectionExtremesChange, this, false));\r\n this.events.on(\"shown\", this.handleSelectionExtremesChange, this, false);\r\n this.events.on(\"maxsizechanged\", function () {\r\n _this.clearCache();\r\n _this._disposers.push(registry.events.once(\"exitframe\", function () {\r\n _this.handleSelectionExtremesChange();\r\n }));\r\n }, this, false);\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"treatZeroAs\", {\r\n /**\r\n * @return Zero replacement value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"treatZeroAs\");\r\n },\r\n /**\r\n * If set, zero values will be treated as this value.\r\n *\r\n * It is useful if you need to use data with zero-values on a logarithmic\r\n * axis scale.\r\n *\r\n * @since 4.9.34\r\n * @param value Zero replacement value\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"treatZeroAs\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Syncs with a target axis.\r\n *\r\n * @param min Min\r\n * @param max Max\r\n * @param step Step\r\n */\r\n ValueAxis.prototype.syncAxes = function (min, max, step) {\r\n var axis = this.syncWithAxis;\r\n if (axis) {\r\n if (!$type.isNumber(min)) {\r\n min = this.min;\r\n }\r\n if (!$type.isNumber(max)) {\r\n max = this.max;\r\n }\r\n if (!$type.isNumber(step)) {\r\n step = this._step;\r\n }\r\n var count = Math.round((axis.maxZoomed - axis.minZoomed) / axis.step);\r\n var currentCount = Math.round((max - min) / step);\r\n if ($type.isNumber(count) && $type.isNumber(currentCount)) {\r\n var synced = false;\r\n var c = 0;\r\n var diff = (max - min) * 0.01;\r\n var omin = min;\r\n var omax = max;\r\n var ostep = step;\r\n while (synced != true) {\r\n synced = this.checkSync(omin, omax, ostep, count);\r\n c++;\r\n if (c > 1000) {\r\n synced = true;\r\n }\r\n if (!synced) {\r\n //omin = min - diff * c;\r\n if (c / 3 == Math.round(c / 3)) {\r\n omin = min - diff * c;\r\n if (min >= 0 && omin < 0) {\r\n omin = 0;\r\n }\r\n }\r\n else {\r\n omax = max + diff * c;\r\n if (omax <= 0 && omax > 0) {\r\n omax = 0;\r\n }\r\n }\r\n var minMaxStep = this.adjustMinMax(omin, omax, omax - omin, this._gridCount, true);\r\n omin = minMaxStep.min;\r\n omax = minMaxStep.max;\r\n ostep = minMaxStep.step;\r\n }\r\n else {\r\n min = omin;\r\n max = omax;\r\n step = ostep;\r\n }\r\n }\r\n }\r\n }\r\n return { min: min, max: max, step: step };\r\n };\r\n /**\r\n * Returns `true` if axis needs to be resunced with some other axis.\r\n */\r\n ValueAxis.prototype.checkSync = function (min, max, step, count) {\r\n var currentCount = (max - min) / step;\r\n for (var i = 1; i < count; i++) {\r\n if ($math.round(currentCount / i, 1) == count || currentCount * i == count) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n ValueAxis.prototype.processConfig = function (config) {\r\n if (config) {\r\n // Set up axes\r\n if ($type.hasValue(config.syncWithAxis) && $type.isString(config.syncWithAxis)) {\r\n if (this.map.hasKey(config.syncWithAxis)) {\r\n config.syncWithAxis = this.map.getKey(config.syncWithAxis);\r\n }\r\n else {\r\n this.processingErrors.push(\"[ValueAxis] No axis with id \\\"\" + config.syncWithAxis + \"\\\" found for `syncWithAxis`\");\r\n delete config.xAxis;\r\n }\r\n }\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n ValueAxis.prototype._saveMinMax = function (_min, _max) {\r\n };\r\n return ValueAxis;\r\n}(Axis));\r\nexport { ValueAxis };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ValueAxis\"] = ValueAxis;\r\nregistry.registeredClasses[\"ValueAxisDataItem\"] = ValueAxisDataItem;\r\n//# sourceMappingURL=ValueAxis.js.map","/**\r\n * Module, defining Axis Renderer for vertical axes.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { AxisRenderer } from \"./AxisRenderer\";\r\nimport { AxisBullet } from \"./AxisBullet\";\r\nimport { WavedLine } from \"../../core/elements/WavedLine\";\r\nimport { WavedRectangle } from \"../../core/elements/WavedRectangle\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { percent, Percent } from \"../../core/utils/Percent\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport { defaultRules, ResponsiveBreakpoints } from \"../../core/utils/Responsive\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A renderer for horizontal axis.\r\n *\r\n * @see {@link IAxisRendererEvents} for a list of available events\r\n * @see {@link IAxisRendererAdapters} for a list of available Adapters\r\n */\r\nvar AxisRendererX = /** @class */ (function (_super) {\r\n __extends(AxisRendererX, _super);\r\n /**\r\n * Constructor.\r\n *\r\n * @param axis Related axis\r\n */\r\n function AxisRendererX() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"AxisRendererX\";\r\n _this.minGridDistance = 120;\r\n _this.opposite = false;\r\n _this.rotation = 0;\r\n _this.width = percent(100);\r\n _this.labels.template.horizontalCenter = \"middle\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * @ignore\r\n */\r\n AxisRendererX.prototype.setAxis = function (axis) {\r\n _super.prototype.setAxis.call(this, axis);\r\n axis.layout = \"vertical\";\r\n };\r\n /**\r\n * @ignore\r\n */\r\n AxisRendererX.prototype.updateGridContainer = function () {\r\n var axis = this.axis;\r\n if (axis) {\r\n var gridContainer = this.gridContainer;\r\n gridContainer.x = axis.pixelX;\r\n gridContainer.width = axis.axisLength;\r\n }\r\n };\r\n /**\r\n * Called when rendered is attached to an Axis, as well as a property of\r\n * Axis that might affect the appearance is updated.\r\n *\r\n * E.g. `axis.opposite`, `axis.inside`, etc.\r\n *\r\n * This method is called **before** draw, so that any related setting\r\n * changed in this method can be changed.\r\n *\r\n * @todo Description (review)\r\n * @ignore Exclude from docs\r\n */\r\n AxisRendererX.prototype.processRenderer = function () {\r\n _super.prototype.processRenderer.call(this);\r\n // can not do this in init, as axis is set later\r\n var axis = this.axis;\r\n if (axis) {\r\n if (!(axis.width instanceof Percent)) {\r\n axis.width = percent(100);\r\n }\r\n // @todo Is thi sneeded?\r\n $utils.used(this.line);\r\n var title = axis.title;\r\n title.rotation = 0;\r\n title.align = \"center\";\r\n if (this.opposite) {\r\n this.line.toFront();\r\n title.toBack();\r\n }\r\n else {\r\n title.toFront();\r\n this.toBack();\r\n this.line.toBack();\r\n }\r\n }\r\n };\r\n /**\r\n * Updates some of the Axis tooltip's visual properties, related to\r\n * rendering of the Axis.\r\n *\r\n * @todo Description (review)\r\n * @ignore Exclude from docs\r\n */\r\n AxisRendererX.prototype.updateTooltip = function () {\r\n var axis = this.axis;\r\n if (axis) {\r\n var bigNum = 1000;\r\n var bbx = this.line.pixelX;\r\n var bby = this.line.pixelY;\r\n var bbw = this.axisLength;\r\n var bbh = bigNum;\r\n // top\r\n if (this.opposite) {\r\n if (!this.inside) {\r\n bby = -bigNum;\r\n bbh = bigNum;\r\n }\r\n }\r\n // bottom\r\n else {\r\n if (this.inside) {\r\n bby = -bigNum;\r\n bbh = bigNum;\r\n }\r\n }\r\n this.axis.updateTooltip(\"vertical\", { x: bbx, y: bby, width: bbw, height: bbh });\r\n }\r\n };\r\n /**\r\n * Updates and positions a label element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param label Label element\r\n * @param position Starting position\r\n * @param endPosition Ending position\r\n */\r\n AxisRendererX.prototype.updateLabelElement = function (label, position, endPosition, location) {\r\n if (!$type.hasValue(location)) {\r\n location = label.location;\r\n }\r\n position = position + (endPosition - position) * location;\r\n var point = this.positionToPoint(position);\r\n label.isMeasured = !label.inside;\r\n var deltaY = 0;\r\n var verticalCenter;\r\n var maxHeight = this.gridContainer.maxHeight;\r\n if (this.opposite) {\r\n if (label.inside) {\r\n verticalCenter = \"top\";\r\n if (label.valign == \"bottom\") {\r\n deltaY = maxHeight;\r\n verticalCenter = \"bottom\";\r\n }\r\n if (label.valign == \"middle\") {\r\n deltaY = maxHeight / 2;\r\n verticalCenter = \"middle\";\r\n }\r\n }\r\n else {\r\n verticalCenter = \"bottom\";\r\n }\r\n point.y = deltaY;\r\n }\r\n else {\r\n if (label.inside) {\r\n verticalCenter = \"bottom\";\r\n if (label.valign == \"top\") {\r\n deltaY = -maxHeight;\r\n verticalCenter = \"top\";\r\n }\r\n if (label.valign == \"middle\") {\r\n deltaY = -maxHeight / 2;\r\n verticalCenter = \"middle\";\r\n }\r\n }\r\n else {\r\n verticalCenter = \"top\";\r\n }\r\n point.y += deltaY;\r\n }\r\n if (label.rotation == 0) {\r\n // Apply fuzzy logic to verticalCenter only if labels are not rotated\r\n label.verticalCenter = verticalCenter;\r\n }\r\n this.positionItem(label, point);\r\n this.toggleVisibility(label, position, this.minLabelPosition, this.maxLabelPosition);\r\n };\r\n Object.defineProperty(AxisRendererX.prototype, \"axisLength\", {\r\n /**\r\n * Returns actual length of the Axis, in pixels.\r\n *\r\n * @return Length (px)\r\n */\r\n get: function () {\r\n var axis = this.axis;\r\n return (axis.measuredWidth - axis.pixelPaddingRight - axis.pixelPaddingLeft) || 0;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Converts relative position on axis to point coordinates.\r\n *\r\n * @param position Position (0-1)\r\n * @param position2 Position (0-1) Position on the second axis\r\n * @return Point\r\n */\r\n AxisRendererX.prototype.positionToPoint = function (position, position2) {\r\n return { x: this.positionToCoordinate(position), y: 0 };\r\n };\r\n /**\r\n * Converts a point at specific coordinates to a relative position (0-1)\r\n * on the axis.\r\n *\r\n * @param point Point\r\n * @return Position (0-1)\r\n */\r\n AxisRendererX.prototype.pointToPosition = function (point) {\r\n return this.coordinateToPosition(point.x, point.y);\r\n };\r\n /**\r\n * [getPositionRangePath description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param startPosition Starting position\r\n * @param endPosition End position\r\n * @return SVG path\r\n */\r\n AxisRendererX.prototype.getPositionRangePath = function (startPosition, endPosition) {\r\n var x1 = $math.fitToRange(this.positionToCoordinate(startPosition), 0, this.axisLength);\r\n var x2 = $math.fitToRange(this.positionToCoordinate(endPosition), 0, this.axisLength);\r\n var w = Math.abs(x2 - x1);\r\n var h = this.getHeight();\r\n var x = Math.min(x1, x2);\r\n var y = 0;\r\n return $path.rectToPath({\r\n x: x,\r\n y: y,\r\n width: w,\r\n height: h\r\n }, true);\r\n };\r\n /**\r\n * Updates and positions an axis break element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param axisBreak Break element\r\n */\r\n AxisRendererX.prototype.updateBreakElement = function (axisBreak) {\r\n _super.prototype.updateBreakElement.call(this, axisBreak);\r\n var startLine = axisBreak.startLine;\r\n var endLine = axisBreak.endLine;\r\n var fillShape = axisBreak.fillShape;\r\n var startPoint = axisBreak.startPoint;\r\n var endPoint = axisBreak.endPoint;\r\n var y1 = axisBreak.pixelMarginLeft;\r\n var y2 = this.getHeight() - axisBreak.pixelMarginTop - axisBreak.pixelMarginBottom;\r\n startPoint.x = $math.fitToRange(startPoint.x, -1, this.axisLength + 1);\r\n endPoint.x = $math.fitToRange(endPoint.x, -1, this.axisLength + 1);\r\n if (startPoint.x == endPoint.x && (startPoint.x < 0 || startPoint.x > this.axisLength)) {\r\n axisBreak.fillShape.__disabled = true;\r\n }\r\n else {\r\n axisBreak.fillShape.__disabled = false;\r\n }\r\n startLine.y = y1;\r\n startLine.width = 0;\r\n startLine.height = y2;\r\n endLine.y = y1;\r\n endLine.width = 0;\r\n endLine.height = y2;\r\n fillShape.height = y2;\r\n fillShape.width = Math.abs(endPoint.x - startPoint.x);\r\n fillShape.y = y1;\r\n fillShape.x = startPoint.x;\r\n };\r\n /**\r\n * Updates and positions a grid element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param grid Grid element\r\n * @param position Starting position\r\n * @param endPosition End position\r\n */\r\n AxisRendererX.prototype.updateGridElement = function (grid, position, endPosition) {\r\n position = position + (endPosition - position) * grid.location;\r\n var point = this.positionToPoint(position);\r\n //point.x = $utils.spritePointToSprite({x:point.x, y:0}, this, this.gridContainer).x;\r\n grid.path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: 0, y: this.getHeight() });\r\n this.positionItem(grid, point);\r\n this.toggleVisibility(grid, position, 0, 1);\r\n };\r\n /**\r\n * Updates and positions a tick element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param tick Tick element\r\n * @param position Starting position\r\n * @param endPosition End position\r\n */\r\n AxisRendererX.prototype.updateTickElement = function (tick, position, endPosition) {\r\n position = position + (endPosition - position) * tick.location;\r\n var point = this.positionToPoint(position);\r\n var tickLength = tick.length;\r\n point.y = $utils.spritePointToSprite({ x: 0, y: this.line.pixelY }, this.line.parent, this.gridContainer).y;\r\n if (this.opposite) {\r\n tickLength *= (tick.inside ? 1 : -1);\r\n }\r\n else {\r\n tickLength *= (tick.inside ? -1 : 1);\r\n }\r\n tick.path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: 0, y: tickLength });\r\n this.positionItem(tick, point);\r\n this.toggleVisibility(tick, position, 0, 1);\r\n };\r\n /**\r\n * Updates and positions the axis line element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n AxisRendererX.prototype.updateAxisLine = function () {\r\n this.line.path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: this.axisLength, y: 0 });\r\n };\r\n /**\r\n * Updates and positions the base grid element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n AxisRendererX.prototype.updateBaseGridElement = function () {\r\n _super.prototype.updateBaseGridElement.call(this);\r\n var axis = this.axis;\r\n var h = this.getHeight();\r\n var w = this.axisLength;\r\n var baseGrid = this.baseGrid;\r\n var x = axis.basePoint.x;\r\n if (x < -0.2 || x > w + 0.2) {\r\n baseGrid.hide(0);\r\n }\r\n else {\r\n var y = $utils.spritePointToSprite({ x: 0, y: 0 }, this.gridContainer, baseGrid.parent).y;\r\n baseGrid.path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: 0, y: h });\r\n baseGrid.moveTo({ x: x, y: y });\r\n baseGrid.show(0);\r\n }\r\n };\r\n /**\r\n * Creates visual elements for and axis break.\r\n *\r\n * @ignore Exclude from docs\r\n * @param axisBreak Axis break\r\n */\r\n AxisRendererX.prototype.createBreakSprites = function (axisBreak) {\r\n axisBreak.startLine = new WavedLine();\r\n axisBreak.endLine = new WavedLine();\r\n var wavedRectangle = new WavedRectangle();\r\n wavedRectangle.setWavedSides(false, true, false, true);\r\n axisBreak.fillShape = wavedRectangle;\r\n };\r\n /**\r\n * @ignore\r\n */\r\n AxisRendererX.prototype.toAxisPosition = function (value) {\r\n var inversedPosition = value;\r\n var axis = this.axis;\r\n if (axis) {\r\n var relativePositionSprite = axis.relativePositionSprite;\r\n var x = axis.pixelX;\r\n if (relativePositionSprite) {\r\n x = $utils.spritePointToSprite({ x: this.pixelX, y: 0 }, this.parent, relativePositionSprite).x;\r\n }\r\n else {\r\n relativePositionSprite = axis.parent;\r\n }\r\n if (relativePositionSprite) {\r\n var relativeX = x / relativePositionSprite.innerWidth;\r\n var relativeWidth = axis.axisLength / relativePositionSprite.innerWidth;\r\n return (inversedPosition - relativeX) / relativeWidth;\r\n }\r\n }\r\n return value;\r\n };\r\n /**\r\n * Updates and positions axis bullets.\r\n *\r\n * @ignore Exclude from docs\r\n * @param bullet AxisBullet element\r\n * @param position Starting position\r\n * @param endPosition End position\r\n */\r\n AxisRendererX.prototype.updateBullet = function (bullet, position, endPosition) {\r\n var location = 0.5;\r\n if (bullet instanceof AxisBullet) {\r\n location = bullet.location;\r\n }\r\n position = position + (endPosition - position) * location;\r\n var point = this.positionToPoint(position);\r\n point.y = $utils.spritePointToSprite({ x: 0, y: this.line.pixelY }, this.line.parent, this.gridContainer).y;\r\n this.positionItem(bullet, point);\r\n this.toggleVisibility(bullet, position, 0, 1);\r\n };\r\n return AxisRendererX;\r\n}(AxisRenderer));\r\nexport { AxisRendererX };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisRendererX\"] = AxisRendererX;\r\n/**\r\n * Add default responsive rules\r\n */\r\n/**\r\n * Put labels inside plot area.\r\n * Disable first and last labels.\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.heightXS,\r\n state: function (target, stateId) {\r\n if (target instanceof AxisRendererX) {\r\n var state = target.states.create(stateId);\r\n state.properties.inside = true;\r\n state.properties.maxLabelPosition = 0.9;\r\n state.properties.minLabelPosition = 0.1;\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n/**\r\n * Disable labels altogather on very small charts\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.heightXXS,\r\n state: function (target, stateId) {\r\n if (target instanceof AxisRendererX) {\r\n var state = target.states.create(stateId);\r\n state.properties.disabled = true;\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n//# sourceMappingURL=AxisRendererX.js.map","/**\r\n * HeatLegend module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../../core/Container\";\r\nimport { LinearGradient } from \"../../core/rendering/fills/LinearGradient\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { toColor, Color } from \"../../core/utils/Color\";\r\nimport { ListTemplate, ListDisposer } from \"../../core/utils/List\";\r\nimport { percent } from \"../../core/utils/Percent\";\r\nimport { ValueAxis } from \"../../charts/axes/ValueAxis\";\r\nimport { AxisRendererX } from \"../../charts/axes/AxisRendererX\";\r\nimport { AxisRendererY } from \"../../charts/axes/AxisRendererY\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $colors from \"../../core/utils/Colors\";\r\nimport { RoundedRectangle } from \"../../core/elements/RoundedRectangle\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * This class creates a link (waved color-filled line) between two nodes in a\r\n * Sankey Diagram.\r\n *\r\n * @see {@link IHeatLegendEvents} for a list of available events\r\n * @see {@link IHeatLegendAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar HeatLegend = /** @class */ (function (_super) {\r\n __extends(HeatLegend, _super);\r\n /**\r\n * Constructor\r\n */\r\n function HeatLegend() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"HeatLegend\";\r\n _this.markerContainer = _this.createChild(Container);\r\n _this.markerContainer.shouldClone = false;\r\n _this.markerCount = 1;\r\n // Create a template container and list for the a marker\r\n var marker = new RoundedRectangle();\r\n marker.minHeight = 20;\r\n marker.minWidth = 20;\r\n marker.interactionsEnabled = false;\r\n marker.fillOpacity = 1;\r\n marker.cornerRadius(0, 0, 0, 0);\r\n _this.markerContainer.minHeight = 20;\r\n _this.markerContainer.minWidth = 20;\r\n _this.orientation = \"horizontal\";\r\n _this.markers = new ListTemplate(marker);\r\n _this._disposers.push(new ListDisposer(_this.markers));\r\n _this._disposers.push(_this.markers.template);\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n HeatLegend.prototype.getMinFromRules = function (property) {\r\n var series = this.series;\r\n if (series) {\r\n var minValue_1;\r\n $iter.eachContinue(series.heatRules.iterator(), function (heatRule) {\r\n if (heatRule.property == property) {\r\n minValue_1 = heatRule.min;\r\n return false;\r\n }\r\n return true;\r\n });\r\n return minValue_1;\r\n }\r\n };\r\n HeatLegend.prototype.getMaxFromRules = function (property) {\r\n var series = this.series;\r\n if (series) {\r\n var maxValue_1;\r\n $iter.each(series.heatRules.iterator(), function (heatRule) {\r\n if (heatRule.property == property) {\r\n maxValue_1 = heatRule.max;\r\n return false;\r\n }\r\n return true;\r\n });\r\n return maxValue_1;\r\n }\r\n };\r\n /**\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n HeatLegend.prototype.validate = function () {\r\n _super.prototype.validate.call(this);\r\n this.valueAxis.renderer.inversed = this.reverseOrder;\r\n var series = this.series;\r\n var minColor = this.minColor;\r\n var maxColor = this.maxColor;\r\n if (!$type.hasValue(minColor)) {\r\n minColor = toColor(this.getMinFromRules(\"fill\"));\r\n }\r\n if (!$type.hasValue(maxColor)) {\r\n maxColor = toColor(this.getMaxFromRules(\"fill\"));\r\n }\r\n if (series) {\r\n var seriesFill = series.fill;\r\n if (!$type.hasValue(minColor) && seriesFill instanceof Color) {\r\n minColor = seriesFill;\r\n }\r\n if (!$type.hasValue(maxColor) && seriesFill instanceof Color) {\r\n maxColor = seriesFill;\r\n }\r\n }\r\n if (!$type.hasValue(maxColor)) {\r\n maxColor = toColor(this.getMaxFromRules(\"fill\"));\r\n }\r\n var minOpacity = $type.toNumber(this.getMinFromRules(\"fillOpacity\"));\r\n if (!$type.isNumber(minOpacity)) {\r\n minOpacity = 1;\r\n }\r\n var maxOpacity = $type.toNumber(this.getMaxFromRules(\"fillOpacity\"));\r\n if (!$type.isNumber(maxOpacity)) {\r\n maxOpacity = 1;\r\n }\r\n var minStrokeOpacity = $type.toNumber(this.getMinFromRules(\"strokeOpacity\"));\r\n if (!$type.isNumber(minStrokeOpacity)) {\r\n minStrokeOpacity = 1;\r\n }\r\n var maxStrokeOpacity = $type.toNumber(this.getMaxFromRules(\"strokeOpacity\"));\r\n if (!$type.isNumber(maxStrokeOpacity)) {\r\n maxStrokeOpacity = 1;\r\n }\r\n var minStroke = toColor(this.getMinFromRules(\"stroke\"));\r\n var maxStroke = toColor(this.getMaxFromRules(\"stroke\"));\r\n //if (series) {\r\n for (var i = 0; i < this.markerCount; i++) {\r\n var marker = this.markers.getIndex(i);\r\n if (!marker) {\r\n marker = this.markers.create();\r\n marker.parent = this.markerContainer;\r\n marker.height = percent(100);\r\n marker.width = percent(100);\r\n }\r\n if (this.markerCount == 1) {\r\n var gradient = new LinearGradient();\r\n if (this.reverseOrder) {\r\n gradient.addColor(maxColor, maxOpacity);\r\n gradient.addColor(minColor, minOpacity);\r\n }\r\n else {\r\n gradient.addColor(minColor, minOpacity);\r\n gradient.addColor(maxColor, maxOpacity);\r\n }\r\n if (this.orientation == \"vertical\") {\r\n gradient.rotation = -90;\r\n }\r\n marker.fill = gradient;\r\n if ($type.hasValue(minStroke) && $type.hasValue(maxStroke)) {\r\n var strokeGradient = new LinearGradient();\r\n if (this.reverseOrder) {\r\n strokeGradient.addColor(maxStroke, maxStrokeOpacity);\r\n strokeGradient.addColor(minStroke, minStrokeOpacity);\r\n }\r\n else {\r\n strokeGradient.addColor(minStroke, minStrokeOpacity);\r\n strokeGradient.addColor(maxStroke, maxStrokeOpacity);\r\n }\r\n if (this.orientation == \"vertical\") {\r\n strokeGradient.rotation = -90;\r\n }\r\n marker.stroke = strokeGradient;\r\n }\r\n }\r\n else {\r\n var c = i;\r\n if (this.reverseOrder) {\r\n c = this.markerCount - i - 1;\r\n }\r\n var color = new Color($colors.interpolate(minColor.rgb, maxColor.rgb, c / this.markerCount));\r\n marker.fill = color;\r\n var opacity = minOpacity + (maxOpacity - minOpacity) * c / this.markerCount;\r\n marker.fillOpacity = opacity;\r\n if ($type.hasValue(minStroke) && $type.hasValue(maxStroke)) {\r\n var color_1 = new Color($colors.interpolate(minStroke.rgb, maxStroke.rgb, c / this.markerCount));\r\n marker.stroke = color_1;\r\n var opacity_1 = minStrokeOpacity + (maxStrokeOpacity - minStrokeOpacity) * c / this.markerCount;\r\n marker.strokeOpacity = opacity_1;\r\n }\r\n }\r\n }\r\n var renderer = this.valueAxis.renderer;\r\n if (this.markerCount > 1) {\r\n if (this.orientation == \"horizontal\") {\r\n renderer.minGridDistance = this.measuredWidth / this.markerCount;\r\n }\r\n else {\r\n renderer.minGridDistance = this.measuredHeight / this.markerCount;\r\n }\r\n }\r\n this.valueAxis.invalidate();\r\n for (var i = this.markerCount, len = this.markers.length; i < len; i++) {\r\n this.markers.getIndex(i).parent = undefined;\r\n }\r\n };\r\n Object.defineProperty(HeatLegend.prototype, \"minColor\", {\r\n /**\r\n * Returns minColor value\r\n * @return {Color}\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"minColor\");\r\n },\r\n /**\r\n * Min color of a heat legend. If a series is set for the legend, minColor is taken from series.\r\n *\r\n * @param {Color}\r\n */\r\n set: function (value) {\r\n if (!(value instanceof Color)) {\r\n value = toColor(value);\r\n }\r\n this.setColorProperty(\"minColor\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(HeatLegend.prototype, \"maxColor\", {\r\n /**\r\n * Returns maxColor value\r\n * @return {Color}\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"maxColor\");\r\n },\r\n /**\r\n * Max color of a heat legend. If a series is set for the legend, maxColor is taken from series.\r\n *\r\n * @param {Color}\r\n */\r\n set: function (value) {\r\n if (!(value instanceof Color)) {\r\n value = toColor(value);\r\n }\r\n this.setColorProperty(\"maxColor\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(HeatLegend.prototype, \"markerCount\", {\r\n /**\r\n * Returns number of color squares (markers).\r\n * @return {number}\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"markerCount\");\r\n },\r\n /**\r\n * Number of color squares (markers) in the heat legend. If only 1 marker is used, it will be filled with gradient.\r\n *\r\n * @param {number}\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"markerCount\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(HeatLegend.prototype, \"minValue\", {\r\n /**\r\n * Returns minimum value of heat legend.\r\n * @return {number}\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"minValue\");\r\n },\r\n /**\r\n * Minimum value of heat legend's value axis. If a series is set for the legend, min is taken from series.\r\n *\r\n * @param {number}\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"minValue\", value);\r\n this.valueAxis.min = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(HeatLegend.prototype, \"maxValue\", {\r\n /**\r\n * Returns maximum value of heat legend.\r\n * @return {number}\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"maxValue\");\r\n },\r\n /**\r\n * Maximum value of heat legend's value axis. If a series is set for the legend, max is taken from series.\r\n *\r\n * @param {number}\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"maxValue\", value);\r\n this.valueAxis.max = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(HeatLegend.prototype, \"orientation\", {\r\n /**\r\n * Returns orientation value.\r\n *\r\n * @return {\"horizontal\" | \"vertical\"}\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"orientation\");\r\n },\r\n /**\r\n * Heat legend orientation. Note, if you change orientation of a heat legend, you must set value axis renderer properties after that, as with orientation renderer changes.\r\n *\r\n * @param {\"horizontal\" | \"vertical\"}\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"orientation\", value, true);\r\n var markerContainer = this.markerContainer;\r\n var valueAxis = this.valueAxis;\r\n // HORIZONTAL\r\n if (value == \"horizontal\") {\r\n if (!$type.hasValue(this.width)) {\r\n this.width = 200;\r\n }\r\n this.height = undefined;\r\n valueAxis.width = percent(100);\r\n valueAxis.height = undefined;\r\n valueAxis.tooltip.pointerOrientation = \"vertical\";\r\n this.layout = \"vertical\";\r\n markerContainer.width = percent(100);\r\n markerContainer.height = undefined;\r\n if (!(valueAxis.renderer instanceof AxisRendererX)) {\r\n valueAxis.renderer = new AxisRendererX();\r\n }\r\n }\r\n // VERTICAL\r\n else {\r\n if (!$type.hasValue(this.height)) {\r\n this.height = 200;\r\n }\r\n this.width = undefined;\r\n this.layout = \"horizontal\";\r\n markerContainer.width = undefined;\r\n markerContainer.height = percent(100);\r\n valueAxis.height = percent(100);\r\n valueAxis.width = undefined;\r\n valueAxis.tooltip.pointerOrientation = \"horizontal\";\r\n if (!(valueAxis.renderer instanceof AxisRendererY)) {\r\n valueAxis.renderer = new AxisRendererY();\r\n }\r\n valueAxis.renderer.inside = true;\r\n valueAxis.renderer.labels.template.inside = true;\r\n this.markerContainer.reverseOrder = true;\r\n }\r\n var renderer = valueAxis.renderer;\r\n renderer.grid.template.disabled = true;\r\n renderer.axisFills.template.disabled = true;\r\n renderer.baseGrid.disabled = true;\r\n renderer.labels.template.padding(2, 3, 2, 3);\r\n renderer.minHeight = undefined;\r\n renderer.minWidth = undefined;\r\n this.markerContainer.layout = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(HeatLegend.prototype, \"valueAxis\", {\r\n /**\r\n * Returns valueAxis value.\r\n * @return {ValueAxis}\r\n */\r\n get: function () {\r\n if (!this._valueAxis) {\r\n this.valueAxis = this.createChild(ValueAxis);\r\n this.valueAxis.shouldClone = false;\r\n }\r\n return this._valueAxis;\r\n },\r\n /**\r\n * Sets a value axis of heat legend. Value axis for heat legend is created automatically.\r\n * @param {ValueAxis}\r\n */\r\n set: function (valueAxis) {\r\n this._valueAxis = valueAxis;\r\n valueAxis.parent = this;\r\n valueAxis.strictMinMax = true;\r\n this.orientation = this.orientation;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(HeatLegend.prototype, \"series\", {\r\n /**\r\n * Returns series value.\r\n * @return {Series}\r\n */\r\n get: function () {\r\n return this._series;\r\n },\r\n /**\r\n * You can set series for heat legend. It will take min, max, minColor and maxColor values from this series.\r\n * @param series\r\n */\r\n set: function (series) {\r\n var _this = this;\r\n this._series = series;\r\n var dataField = \"value\";\r\n try {\r\n var dataFieldDefined = series.heatRules.getIndex(0).dataField;\r\n if (dataFieldDefined) {\r\n dataField = dataFieldDefined;\r\n }\r\n }\r\n catch (err) {\r\n }\r\n this.updateMinMax(series.dataItem.values[dataField].low, series.dataItem.values[dataField].high);\r\n series.dataItem.events.on(\"calculatedvaluechanged\", function (event) {\r\n _this.updateMinMax(series.dataItem.values[dataField].low, series.dataItem.values[dataField].high);\r\n }, undefined, false);\r\n series.heatRules.events.on(\"inserted\", this.invalidate, this, false);\r\n series.heatRules.events.on(\"removed\", this.invalidate, this, false);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Updates min/max of value axis.\r\n * @ignore\r\n */\r\n HeatLegend.prototype.updateMinMax = function (min, max) {\r\n var valueAxis = this.valueAxis;\r\n if (!$type.isNumber(this.minValue)) {\r\n valueAxis.min = min;\r\n valueAxis.invalidate();\r\n }\r\n if (!$type.isNumber(this.maxValue)) {\r\n valueAxis.max = max;\r\n valueAxis.invalidate();\r\n }\r\n };\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n HeatLegend.prototype.processConfig = function (config) {\r\n if (config) {\r\n // Set up series\r\n if ($type.hasValue(config.series) && $type.isString(config.series)) {\r\n if ($type.isString(config.series)) {\r\n if (this.map.hasKey(config.series)) {\r\n config.series = this.map.getKey(config.series);\r\n }\r\n else {\r\n var seriesId_1 = config.series;\r\n var disposer_1 = this.map.events.on(\"insertKey\", function (ev) {\r\n if (ev.key == seriesId_1) {\r\n this.series = ev.newValue;\r\n disposer_1.dispose();\r\n }\r\n }, this);\r\n this._disposers.push(disposer_1);\r\n delete config.series;\r\n }\r\n }\r\n }\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n return HeatLegend;\r\n}(Container));\r\nexport { HeatLegend };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"HeatLegend\"] = HeatLegend;\r\n//# sourceMappingURL=HeatLegend.js.map","/**\r\n * Grip module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Button } from \"./Button\";\r\nimport { Sprite } from \"../Sprite\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { registry } from \"../Registry\";\r\nimport { percent } from \"../utils/Percent\";\r\nimport * as $path from \"../rendering/Path\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a grip element that can be used for scrolling or other things.\r\n *\r\n * @see {@link IGripEvents} for a list of available events\r\n * @see {@link IGripAdapters} for a list of available Adapters\r\n * @since 4.4.0\r\n */\r\nvar Grip = /** @class */ (function (_super) {\r\n __extends(Grip, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Grip() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"Grip\";\r\n var cs = new InterfaceColorSet();\r\n // Set defaults\r\n _this.layout = \"absolute\";\r\n _this.padding(10, 10, 10, 10);\r\n _this.margin(3, 3, 3, 3);\r\n _this.background.fillOpacity = 0.3;\r\n _this.background.cornerRadius(10, 10, 10, 10);\r\n // Create an icon\r\n var icon = new Sprite();\r\n icon.element = _this.paper.add(\"path\");\r\n var path = $path.moveTo({ x: -6, y: 0 });\r\n path += $path.lineTo({ x: 6, y: 0 });\r\n path += $path.moveTo({ x: -8, y: -6 });\r\n path += $path.lineTo({ x: 0, y: -12 });\r\n path += $path.lineTo({ x: 8, y: -6 });\r\n path += $path.moveTo({ x: -8, y: 6 });\r\n path += $path.lineTo({ x: 0, y: 12 });\r\n path += $path.lineTo({ x: 8, y: 6 });\r\n icon.path = path;\r\n icon.strokeWidth = 2;\r\n icon.fillOpacity = 0;\r\n icon.pixelPerfect = true;\r\n icon.padding(0, 4, 0, 4);\r\n icon.stroke = cs.getFor(\"text\");\r\n icon.strokeOpacity = 0.7;\r\n icon.align = \"center\";\r\n icon.valign = \"middle\";\r\n _this.icon = icon;\r\n _this.label.dispose();\r\n _this.label = undefined;\r\n // Set default position\r\n _this.position = \"right\";\r\n // Set up autohide\r\n _this.autoHideDelay = 3000;\r\n _this.events.on(\"shown\", function (ev) {\r\n if (_this._autoHideTimeout) {\r\n _this._autoHideTimeout.dispose();\r\n }\r\n if (_this.autoHideDelay) {\r\n _this._autoHideTimeout = _this.setTimeout(function () {\r\n _this.hide();\r\n }, _this.autoHideDelay);\r\n }\r\n });\r\n _this.events.on(\"down\", function (ev) {\r\n if (_this._autoHideTimeout) {\r\n _this._autoHideTimeout.dispose();\r\n }\r\n });\r\n _this.events.on(\"out\", function (ev) {\r\n if (_this.autoHideDelay) {\r\n _this._autoHideTimeout = _this.setTimeout(function () {\r\n _this.hide();\r\n }, _this.autoHideDelay);\r\n }\r\n });\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(Grip.prototype, \"position\", {\r\n /**\r\n * @return Position\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"position\");\r\n },\r\n /**\r\n * Sets position of the grip.\r\n *\r\n * Available options: \"left\", \"right\" (default), \"top\", \"bottom\".\r\n *\r\n * @param value Position\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"position\", value)) {\r\n switch (value) {\r\n case \"left\":\r\n this.align = \"left\";\r\n this.valign = \"middle\";\r\n this.horizontalCenter = \"left\";\r\n this.verticalCenter = \"middle\";\r\n this.icon.rotation = 0;\r\n this.width = undefined;\r\n this.height = percent(30);\r\n break;\r\n case \"right\":\r\n this.align = \"right\";\r\n this.valign = \"middle\";\r\n this.horizontalCenter = \"right\";\r\n this.verticalCenter = \"middle\";\r\n this.icon.rotation = 0;\r\n this.width = undefined;\r\n this.height = percent(30);\r\n break;\r\n case \"top\":\r\n this.align = \"center\";\r\n this.valign = \"top\";\r\n this.horizontalCenter = \"middle\";\r\n this.verticalCenter = \"top\";\r\n this.icon.rotation = 90;\r\n this.width = percent(30);\r\n this.height = undefined;\r\n break;\r\n case \"bottom\":\r\n this.align = \"center\";\r\n this.valign = \"bottom\";\r\n this.horizontalCenter = \"middle\";\r\n this.verticalCenter = \"bottom\";\r\n this.icon.rotation = 90;\r\n this.width = percent(30);\r\n this.height = undefined;\r\n break;\r\n default:\r\n this.align = \"center\";\r\n this.valign = \"middle\";\r\n this.horizontalCenter = \"middle\";\r\n this.verticalCenter = \"middle\";\r\n this.icon.rotation = 90;\r\n this.width = percent(30);\r\n this.height = undefined;\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Grip.prototype, \"autoHideDelay\", {\r\n /**\r\n * @return Delay\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"autoHideDelay\");\r\n },\r\n /**\r\n * Number of milliseconds to show grip until it is hidden automatically.\r\n *\r\n * @default 3000\r\n * @param value Delay\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"autoHideDelay\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Grip;\r\n}(Button));\r\nexport { Grip };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Grip\"] = Grip;\r\n//# sourceMappingURL=Grip.js.map","/**\r\n * [[Chart]] class provides base functionality for all chart types to inherit.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { registry } from \"../core/Registry\";\r\nimport { Component } from \"../core/Component\";\r\nimport { MutableValueDisposer, Disposer } from \"../core/utils/Disposer\";\r\nimport { ListTemplate, ListDisposer } from \"../core/utils/List\";\r\nimport { Container } from \"../core/Container\";\r\nimport { Label } from \"../core/elements/Label\";\r\nimport { Grip } from \"../core/elements/Grip\";\r\nimport { DataItem } from \"../core/DataItem\";\r\nimport { percent } from \"../core/utils/Percent\";\r\nimport * as $iter from \"../core/utils/Iterator\";\r\nimport * as $type from \"../core/utils/Type\";\r\nimport { defaultRules, ResponsiveBreakpoints } from \"../core/utils/Responsive\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a [[DataItem]] for [[Chart]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nvar ChartDataItem = /** @class */ (function (_super) {\r\n __extends(ChartDataItem, _super);\r\n /**\r\n * Constructor\r\n */\r\n function ChartDataItem() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"ChartDataItem\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n return ChartDataItem;\r\n}(DataItem));\r\nexport { ChartDataItem };\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A base class for all Charts.\r\n *\r\n * @see {@link IChartEvents} for a list of available Events\r\n * @see {@link IChartAdapters} for a list of available Adapters\r\n */\r\nvar Chart = /** @class */ (function (_super) {\r\n __extends(Chart, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Chart() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * A reference to chart's [[Legend]].\r\n * @ignore\r\n */\r\n _this._legend = new MutableValueDisposer();\r\n if (_this.constructor === Chart) {\r\n throw new Error(\"'Chart' cannot be instantiated directly. Please use a specific chart type.\");\r\n }\r\n _this.className = \"Chart\";\r\n // Create a list of titles\r\n var template = new Label();\r\n _this.titles = new ListTemplate(template);\r\n _this._disposers.push(new ListDisposer(_this.titles));\r\n _this._disposers.push(template);\r\n // Chart component is also a container. it holds _chartAndLegendCont and titles\r\n _this.width = percent(100);\r\n _this.height = percent(100);\r\n _this.layout = \"vertical\";\r\n // Chart and legend\r\n var chartAndLegendContainer = _this.createChild(Container);\r\n chartAndLegendContainer.shouldClone = false;\r\n chartAndLegendContainer.layout = \"vertical\";\r\n chartAndLegendContainer.width = percent(100);\r\n chartAndLegendContainer.height = percent(100);\r\n _this.chartAndLegendContainer = chartAndLegendContainer;\r\n // Chart container holds all the elements of a chart, extept titles and legend\r\n var chartContainer = chartAndLegendContainer.createChild(Container);\r\n chartContainer.shouldClone = false;\r\n chartContainer.width = percent(100);\r\n chartContainer.height = percent(100);\r\n _this.chartContainer = chartContainer;\r\n _this.showOnInit = true;\r\n _this._disposers.push(_this._legend);\r\n // Add title list events to apply certain formatting options and to make\r\n // the chart reference them as accessible screen reader labels\r\n _this.titles.events.on(\"inserted\", function (label) {\r\n _this.processTitle(label);\r\n _this.updateReaderTitleReferences();\r\n }, _this, false);\r\n _this.titles.events.on(\"removed\", function (label) {\r\n _this.updateReaderTitleReferences();\r\n }, _this, false);\r\n // Accessibility\r\n // It seems we can't set focusable on the whole chart because it seems to\r\n // mess up the whole focus event system - getting a focus on an inside\r\n // object also trigger focus on parent\r\n //this.focusable = true;\r\n _this.role = \"region\";\r\n _this.defaultState.transitionDuration = 1;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Sets defaults that instantiate some objects that rely on parent, so they\r\n * cannot be set in constructor.\r\n */\r\n Chart.prototype.applyInternalDefaults = function () {\r\n _super.prototype.applyInternalDefaults.call(this);\r\n if (!$type.hasValue(this.readerTitle)) {\r\n this.readerTitle = this.language.translate(\"Chart\");\r\n }\r\n };\r\n /**\r\n * Initiates drawing of the chart.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Chart.prototype.draw = function () {\r\n this.fixLayout();\r\n _super.prototype.draw.call(this);\r\n };\r\n /**\r\n * Updates legend's hierarchy based on the position.\r\n */\r\n Chart.prototype.fixLayout = function () {\r\n var legend = this.legend;\r\n if (legend) {\r\n var chartAndLegendContainer = this.chartAndLegendContainer;\r\n var chartContainer = this.chartContainer;\r\n chartContainer.x = undefined;\r\n chartContainer.y = undefined;\r\n if (legend.position != \"absolute\") {\r\n legend.x = undefined;\r\n legend.y = undefined;\r\n }\r\n switch (legend.position) {\r\n case \"left\":\r\n chartAndLegendContainer.layout = \"horizontal\";\r\n legend.toBack();\r\n break;\r\n case \"right\":\r\n chartAndLegendContainer.layout = \"horizontal\";\r\n legend.toFront();\r\n break;\r\n case \"top\":\r\n chartAndLegendContainer.layout = \"vertical\";\r\n legend.toBack();\r\n break;\r\n case \"bottom\":\r\n chartAndLegendContainer.layout = \"vertical\";\r\n legend.toFront();\r\n break;\r\n case \"absolute\":\r\n legend.isMeasured = false;\r\n break;\r\n }\r\n }\r\n };\r\n /**\r\n * Setups the legend to use the chart's data.\r\n */\r\n Chart.prototype.feedLegend = function () {\r\n // Nothing here. This method is provided only as a \"placeholder\" for\r\n // extending classes to override\r\n };\r\n /**\r\n * Adds a new title to the chart when it is inserted into chart's titles\r\n * list.\r\n * @param event An event object which is triggered when inserting into titles list\r\n * @return Label object\r\n */\r\n Chart.prototype.processTitle = function (event) {\r\n var title = event.newValue;\r\n title.parent = this;\r\n title.toBack();\r\n title.shouldClone = false;\r\n title.align = \"center\";\r\n // Need to explicitly apply the `id` attribute so it can be referenced by\r\n // `aria-labelledby`\r\n title.uidAttr();\r\n return title;\r\n };\r\n /**\r\n * Checks if chart has any title elements. If it does, we will use them in an\r\n * `aria-labelledby` attribute so that screen readers can use them to properly\r\n * describe the chart when it is focused or hovered.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Chart.prototype.updateReaderTitleReferences = function () {\r\n if (this.titles.length) {\r\n var titleIds_1 = [];\r\n $iter.each(this.titles.iterator(), function (title) {\r\n titleIds_1.push(title.uid);\r\n });\r\n this.setSVGAttribute({ \"aria-labelledby\": titleIds_1.join(\" \") });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-labelledby\");\r\n }\r\n };\r\n Object.defineProperty(Chart.prototype, \"legend\", {\r\n /**\r\n * @return Legend\r\n */\r\n get: function () {\r\n return this._legend.get();\r\n },\r\n /**\r\n * Holds the instance of chart's [[Leged]].\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/legend/} for more information about legends\r\n * @param Legend\r\n */\r\n set: function (legend) {\r\n this.setLegend(legend);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Prepares the legend instance for use in this chart.\r\n *\r\n * @param legend Legend\r\n */\r\n Chart.prototype.setLegend = function (legend) {\r\n var _this = this;\r\n if (this._legend.get() !== legend) {\r\n if (legend) {\r\n // Set legend options\r\n legend.parent = this.chartAndLegendContainer;\r\n this._legend.set(legend, legend.events.on(\"propertychanged\", function (event) {\r\n if (event.property == \"position\") {\r\n _this.fixLayout();\r\n }\r\n }, undefined, false));\r\n legend.addDisposer(new Disposer(function () {\r\n _this.legend = undefined;\r\n }));\r\n }\r\n else {\r\n this._legend.reset();\r\n }\r\n this.feedLegend();\r\n }\r\n };\r\n /**\r\n * Destroys this object and all related data.\r\n */\r\n Chart.prototype.dispose = function () {\r\n // otherwise there might be some errors when disposing chart which was just inited\r\n if (this.legend) {\r\n this.legend.dispose();\r\n }\r\n _super.prototype.dispose.call(this);\r\n };\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n Chart.prototype.processConfig = function (config) {\r\n if (config) {\r\n // Set up legend\r\n if ($type.hasValue(config.legend) && !$type.hasValue(config.legend.type)) {\r\n config.legend.type = \"Legend\";\r\n }\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n /**\r\n * Copies all properties from another instance of [[Series]].\r\n *\r\n * @param source Source series\r\n */\r\n Chart.prototype.copyFrom = function (source) {\r\n this.titles.copyFrom(source.titles);\r\n this.chartContainer.copyFrom(source.chartContainer);\r\n if (source.legend) {\r\n this.legend = source.legend.clone();\r\n this.legend.removeChildren();\r\n }\r\n _super.prototype.copyFrom.call(this, source);\r\n };\r\n Object.defineProperty(Chart.prototype, \"dragGrip\", {\r\n /**\r\n * @return Grip\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._dragGrip) {\r\n var grip_1 = this.tooltipContainer.createChild(Grip);\r\n grip_1.align = \"right\";\r\n grip_1.valign = \"middle\";\r\n grip_1.hide(0);\r\n grip_1.events.on(\"down\", function (ev) {\r\n if (ev.touch) {\r\n _this.interactionsEnabled = false;\r\n }\r\n });\r\n grip_1.events.on(\"up\", function (ev) {\r\n _this.interactionsEnabled = true;\r\n });\r\n this.events.on(\"down\", function (ev) {\r\n if (ev.touch) {\r\n grip_1.show();\r\n }\r\n });\r\n this._dragGrip = grip_1;\r\n }\r\n return this._dragGrip;\r\n },\r\n /**\r\n * An instance of [[Grip]] which serves as a grip point which appears on\r\n * touch and allows scrolling whole page even if chart is occupying the\r\n * whole of the screen and would otherwise prevent scrolling.\r\n *\r\n * @since 4.4.0\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/touch/} For more information.\r\n * @param value Grip\r\n */\r\n set: function (value) {\r\n this._dragGrip = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Chart.prototype, \"focusable\", {\r\n get: function () {\r\n return this.parent.focusable;\r\n },\r\n set: function (value) {\r\n this.parent.focusable = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Chart;\r\n}(Component));\r\nexport { Chart };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Chart\"] = Chart;\r\n/**\r\n * Add default responsive rules\r\n */\r\n/**\r\n * Reduce horizontal margins\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.widthXS,\r\n state: function (target, stateId) {\r\n if (target instanceof Chart) {\r\n var state = target.states.create(stateId);\r\n if (target.pixelPaddingLeft > 10) {\r\n state.properties.paddingLeft = 10;\r\n }\r\n if (target.pixelPaddingRight > 10) {\r\n state.properties.paddingRight = 10;\r\n }\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n/**\r\n * Reduce vertical margins\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.heightXS,\r\n state: function (target, stateId) {\r\n if (target instanceof Chart) {\r\n var state = target.states.create(stateId);\r\n if (target.pixelPaddingTop > 10) {\r\n state.properties.paddingTop = 10;\r\n }\r\n if (target.pixelPaddingBottom > 10) {\r\n state.properties.paddingBottom = 10;\r\n }\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n/**\r\n * Remove horizontal padding\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.widthXXS,\r\n state: function (target, stateId) {\r\n if (target instanceof Chart) {\r\n var state = target.states.create(stateId);\r\n state.properties.paddingLeft = 0;\r\n state.properties.paddingRight = 0;\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n/**\r\n * Remove vertical padding\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.heightXXS,\r\n state: function (target, stateId) {\r\n if (target instanceof Chart) {\r\n var state = target.states.create(stateId);\r\n state.properties.paddingTop = 0;\r\n state.properties.paddingBottom = 0;\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n//# sourceMappingURL=Chart.js.map","/**\r\n * Module that defines everything related to building bullets.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../../core/Container\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { defaultRules, ResponsiveBreakpoints } from \"../../core/utils/Responsive\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Class used to creates bullets.\r\n *\r\n * @see {@link IBulletEvents} for a list of available events\r\n * @see {@link IBulletAdapters} for a list of available Adapters\r\n * @todo Usage example\r\n * @important\r\n */\r\nvar Bullet = /** @class */ (function (_super) {\r\n __extends(Bullet, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Bullet() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Bullet\";\r\n _this.isMeasured = false;\r\n _this.tooltipX = 0;\r\n _this.tooltipY = 0;\r\n _this.layout = \"none\";\r\n _this.applyOnClones = true;\r\n _this.copyToLegendMarker = true;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(Bullet.prototype, \"locationX\", {\r\n /**\r\n * @return Location (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"locationX\");\r\n },\r\n /**\r\n * Relative horizontal location within cell. (0-1)\r\n *\r\n * @param value Location (0-1)\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"locationX\", value)) {\r\n var dataItem = this.dataItem;\r\n if (dataItem && dataItem.component) {\r\n dataItem.component.invalidate();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Bullet.prototype, \"locationY\", {\r\n /**\r\n * @return Location (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"locationY\");\r\n },\r\n /**\r\n * Relative vertical location within cell. (0-1)\r\n *\r\n * @param value Location (0-1)\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"locationY\", value)) {\r\n var dataItem = this.dataItem;\r\n if (dataItem && dataItem.component) {\r\n dataItem.component.invalidate();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Bullet.prototype, \"xField\", {\r\n /**\r\n * @return [description]\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"xField\");\r\n },\r\n /**\r\n * [xField description]\r\n *\r\n * @todo Description\r\n * @param value [description]\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"xField\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Bullet.prototype, \"yField\", {\r\n /**\r\n * @return [description]\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"yField\");\r\n },\r\n /**\r\n * [yField description]\r\n *\r\n * Description\r\n * @param value [description]\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"yField\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Bullet.prototype, \"isDynamic\", {\r\n /**\r\n * @return Redraw on data change?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"isDynamic\");\r\n },\r\n /**\r\n * Indicates if the bullet is \"dynamic\".\r\n *\r\n * In most cases the bullets remain the same, even if the underlying data\r\n * changes.\r\n *\r\n * However, in cases where bullet also displays a label, or its size depends\r\n * on data, it also needs to be redrawn when the underlying data changes.\r\n *\r\n * Only those bullets that have set `isDynamic = true` will be redrawn each\r\n * time data changes. Regular bullets will be reused as they are.\r\n *\r\n * @default false\r\n * @param value Redraw on data change?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"isDynamic\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Bullet.prototype, \"copyToLegendMarker\", {\r\n /**\r\n * @return Redraw on data change?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"copyToLegendMarker\");\r\n },\r\n /**\r\n * Indicates if the bullet should be copied to legend marker\r\n *\r\n * @default false\r\n * @param value Redraw on data change?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"copyToLegendMarker\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Bullet;\r\n}(Container));\r\nexport { Bullet };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Bullet\"] = Bullet;\r\n/**\r\n * Add default responsive rules\r\n */\r\n/**\r\n * Hide bullets\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.isXS,\r\n state: function (target, stateId) {\r\n if (target instanceof Bullet) {\r\n var state = target.states.create(stateId);\r\n state.properties.disabled = true;\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n//# sourceMappingURL=Bullet.js.map","/**\r\n * Functionality for any series-based elements, like Line Series (graphs),\r\n * Pie slice lists, etc.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Component } from \"../../core/Component\";\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport { List, ListTemplate, ListDisposer } from \"../../core/utils/List\";\r\nimport { Dictionary, DictionaryDisposer } from \"../../core/utils/Dictionary\";\r\nimport { DataItem } from \"../../core/DataItem\";\r\nimport { Container } from \"../../core/Container\";\r\nimport { Tooltip } from \"../../core/elements/Tooltip\";\r\nimport { Bullet } from \"../elements/Bullet\";\r\nimport { LegendSettings } from \"../Legend\";\r\nimport { options } from \"../../core/Options\";\r\nimport { Color } from \"../../core/utils/Color\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $ease from \"../../core/utils/Ease\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $object from \"../../core/utils/Object\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $array from \"../../core/utils/Array\";\r\nimport * as $colors from \"../../core/utils/Colors\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a [[DataItem]] for [[Series]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nvar SeriesDataItem = /** @class */ (function (_super) {\r\n __extends(SeriesDataItem, _super);\r\n /**\r\n * Constructor\r\n */\r\n function SeriesDataItem() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"SeriesDataItem\";\r\n //@todo Should we make `bullets` list disposable?\r\n //this._disposers.push(new DictionaryDisposer(this.bullets));\r\n _this.values.value = {};\r\n _this.values.value = {};\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(SeriesDataItem.prototype, \"bullets\", {\r\n /**\r\n * A dictionary of data items bullets, where key is uid of a bullet template.\r\n */\r\n get: function () {\r\n if (!this._bullets) {\r\n this._bullets = new Dictionary();\r\n this._disposers.push(new DictionaryDisposer(this._bullets));\r\n }\r\n return this._bullets;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Destroys this object and all related data.\r\n */\r\n SeriesDataItem.prototype.dispose = function () {\r\n this.bullets.clear();\r\n _super.prototype.dispose.call(this);\r\n };\r\n Object.defineProperty(SeriesDataItem.prototype, \"value\", {\r\n /**\r\n * @return Value\r\n */\r\n get: function () {\r\n return this.values.value.value;\r\n },\r\n /**\r\n * data items's numeric value.\r\n *\r\n * @param value Value\r\n */\r\n set: function (value) {\r\n this.setValue(\"value\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return SeriesDataItem;\r\n}(DataItem));\r\nexport { SeriesDataItem };\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines base class for any kind of serial data.\r\n *\r\n * @see {@link ISeriesEvents} for a list of available Events\r\n * @see {@link ISeriesAdapters} for a list of available Adapters\r\n * @todo Separate axis-related stuff to some other class so that MapSeries would not have unrelated stuff\r\n */\r\nvar Series = /** @class */ (function (_super) {\r\n __extends(Series, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Series() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Should this series excluded from the axis scale calculations?\r\n *\r\n * @default false\r\n */\r\n _this._ignoreMinMax = false;\r\n /**\r\n * Should series' bullets?\r\n *\r\n * @default true\r\n */\r\n _this._showBullets = true;\r\n /**\r\n * Settings for the appearance of the related legend items.\r\n */\r\n _this.legendSettings = new LegendSettings();\r\n /**\r\n * Lowest overal values by type.\r\n */\r\n _this._tmin = new Dictionary();\r\n /**\r\n * Highest overal values by type.\r\n */\r\n _this._tmax = new Dictionary();\r\n /**\r\n * Lowest values in current selection by type.\r\n */\r\n _this._smin = new Dictionary();\r\n /**\r\n * Highest values in current selection by type.\r\n */\r\n _this._smax = new Dictionary();\r\n /**\r\n * [dataItemsByAxis description]\r\n *\r\n * Both by category and date.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n _this.dataItemsByAxis = new Dictionary();\r\n /**\r\n * Normally series items are focusable using keyboard, so that people can\r\n * select them with a TAB key. However, if there are a lot of data points on\r\n * screen it might be long and useless to tab through all o fthem.\r\n *\r\n * This is where `skipFocusThreshold` comes in. If there are more items than\r\n * the value set here, we will not make those focusable and rather let screen\r\n * reader software rely on the series summary, or authors provide alternative\r\n * detailed information display, such as HTML table.\r\n *\r\n * Different series might have different threshold defaults.\r\n */\r\n _this.skipFocusThreshold = 20;\r\n /**\r\n * Used to indicate if `itemReaderText` was changed \"from the outside\".\r\n */\r\n _this._itemReaderTextChanged = false;\r\n /**\r\n * Most of the series use absolute values. However sometimes various\r\n * calculated percent values are need, e.g. item's percent representation\r\n * across all values in series, etc.\r\n *\r\n * It's a resource-intensive operation, so it is disabled by default.\r\n *\r\n * If you need percents to be calculated, e.g. for showing them in tooltips,\r\n * or creating 100% stacks, this setting needs to be set to `true`.\r\n *\r\n * NOTE: `PieChart`, which relies on slice percentages, has this\r\n * automatically set to `true`.\r\n *\r\n * @default false\r\n */\r\n _this.calculatePercent = false;\r\n /**\r\n * When `calculatePercent` is enabled and data item's percent value is\r\n * calculated, last item's real value is used instead of its working value.\r\n *\r\n * This is done for the animations when last item in series (e.g. slice in\r\n * a `PieSeries`) is hidden or shown. (if we would use real value, the\r\n * calculated percent would always be 100%).\r\n *\r\n * Sometimes there is a need (e.g. for drill-down Sunburst) to disable this\r\n * hack by setting `usePercentHack` to `false`.\r\n *\r\n * @since 4.9.13\r\n * @default true\r\n */\r\n _this.usePercentHack = true;\r\n /**\r\n * Specifies if series should be automatically disposed when removing from\r\n * chart's `series` list.\r\n *\r\n * @default true\r\n */\r\n _this.autoDispose = true;\r\n /**\r\n * When chart/series' data is processed, all kinds of derivative values are\r\n * calculated. E.g. sum, min, max, change, etc. This is a potentially\r\n * time-consuming operation, especially prominent in data-heavy charts.\r\n *\r\n * If your chart does not need those values, and you have a lot of data,\r\n * setting this to `true` might give a dramatic increase in initial chart\r\n * load speed.\r\n *\r\n * Please note, regular column and line series usage scenarios do not\r\n * require derivative values. Those come into play only when you do advanced\r\n * functionality like coloring segments of charts in different colors\r\n * depending on change between open and close values, have stacked series, or\r\n * display any of the derived values, like percent, in tooltips or bullets.\r\n *\r\n * @default false\r\n */\r\n _this.simplifiedProcessing = false;\r\n if (_this.constructor === Series) {\r\n throw new Error(\"'Series' cannot be instantiated directly. Please use a specific series type.\");\r\n }\r\n _this.className = \"Series\";\r\n _this.isMeasured = false;\r\n _this.layout = \"none\";\r\n _this.shouldClone = false;\r\n _this.setPropertyValue(\"hidden\", false);\r\n _this.axisRanges = new List();\r\n _this.axisRanges.events.on(\"inserted\", _this.processAxisRange, _this, false);\r\n _this.minBulletDistance = 0; // otherwise we'll have a lot of cases when people won't see bullets and think it's a bug\r\n _this.mainContainer = _this.createChild(Container);\r\n _this.mainContainer.shouldClone = false;\r\n _this.mainContainer.mask = _this.createChild(Sprite);\r\n _this._disposers.push(_this.mainContainer);\r\n // all bullets should go on top of lines/fills. So we add a separate container for bullets and later set it's parent to chart.bulletsContainer\r\n var bulletsContainer = _this.mainContainer.createChild(Container);\r\n _this._shouldBeReady.push(bulletsContainer);\r\n bulletsContainer.shouldClone = false;\r\n bulletsContainer.layout = \"none\";\r\n bulletsContainer.virtualParent = _this;\r\n _this._disposers.push(bulletsContainer);\r\n _this.bulletsContainer = bulletsContainer;\r\n _this.tooltip = new Tooltip();\r\n _this.tooltip.virtualParent = _this;\r\n _this._disposers.push(_this.tooltip);\r\n _this.hiddenState.transitionEasing = $ease.cubicIn;\r\n // this data item holds sums, averages, etc\r\n _this.dataItem = _this.createDataItem();\r\n _this._disposers.push(_this.dataItem);\r\n _this.dataItem.component = _this;\r\n // Apply accessibility\r\n _this.role = \"group\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * We need this here so that class names can be applied to bullets container.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Series.prototype.applyTheme = function () {\r\n _super.prototype.applyTheme.call(this);\r\n if (options.autoSetClassName && this.bulletsContainer) {\r\n this.bulletsContainer.className = this.className + \"-bullets\";\r\n this.bulletsContainer.setClassName();\r\n }\r\n };\r\n /**\r\n * Sets defaults that instantiate some objects that rely on parent, so they\r\n * cannot be set in constructor.\r\n */\r\n Series.prototype.applyInternalDefaults = function () {\r\n _super.prototype.applyInternalDefaults.call(this);\r\n if (!$type.hasValue(this.readerTitle)) {\r\n this.readerTitle = this.language.translate(\"Series\");\r\n }\r\n };\r\n /**\r\n * Returns a new/empty DataItem of the type appropriate for this object.\r\n *\r\n * @see {@link DataItem}\r\n * @return Data Item\r\n */\r\n Series.prototype.createDataItem = function () {\r\n return new SeriesDataItem();\r\n };\r\n Object.defineProperty(Series.prototype, \"chart\", {\r\n /**\r\n * @return Chart\r\n */\r\n get: function () {\r\n return this._chart;\r\n },\r\n /**\r\n * Chart series is used on.\r\n *\r\n * @param value Chart\r\n */\r\n set: function (value) {\r\n this._chart = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Positions bullet.\r\n *\r\n * @param bullet Sprite\r\n */\r\n Series.prototype.positionBullet = function (bullet) {\r\n // Placeholder method for extending classes to override.\r\n };\r\n /**\r\n * Decorates newly created bullet after it has been instert into the list.\r\n *\r\n * @param event List event\r\n * @todo investigate why itemReaderText is undefined\r\n */\r\n Series.prototype.processBullet = function (event) {\r\n var _this = this;\r\n var bullet = event.newValue;\r\n bullet.isTemplate = true;\r\n // Add accessibility options to bullet\r\n // If there are relatively few bullets, make them focusable\r\n this.events.once(\"datavalidated\", function (ev) {\r\n if (_this.itemsFocusable()) {\r\n bullet.focusable = true;\r\n }\r\n });\r\n this.invalidate();\r\n };\r\n /**\r\n * removes bullets\r\n *\r\n * @param event List event\r\n */\r\n Series.prototype.removeBullet = function (event) {\r\n var bullet = event.oldValue;\r\n this.dataItems.each(function (dataItem) {\r\n var eachBullet = dataItem.bullets.getKey(bullet.uid);\r\n if (eachBullet) {\r\n eachBullet.dispose();\r\n }\r\n });\r\n this.invalidate();\r\n };\r\n /**\r\n * Validates data items.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Series.prototype.validateDataItems = function () {\r\n _super.prototype.validateDataItems.call(this);\r\n this.processValues(false);\r\n };\r\n /**\r\n * Returns first value for the specific key in the series.\r\n *\r\n * @param key Key\r\n * @return Value\r\n * @todo Description\r\n * @todo Convert to propert object property iterator\r\n */\r\n Series.prototype.getFirstValue = function (key, startIndex) {\r\n // find first\r\n /*\r\n return $iter.findMap(this.dataItems.iterator(), (dataItem) => {\r\n for (let key in dataItem.values) {\r\n if ($object.hasKey(dataItem.values, key)) {\r\n let value: number = dataItem.values[key].workingValue;\r\n if ($type.isNumber(value)) {\r\n return value;\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n });*/\r\n //if (startIndex > 0 && startIndex < this.dataItems.length - 1) {\r\n //startIndex++;\r\n //}\r\n for (var i = startIndex; i >= 0; i--) {\r\n var dataItem = this.dataItems.getIndex(i);\r\n var value = dataItem.getActualWorkingValue(key);\r\n if ($type.isNumber(value)) {\r\n return value;\r\n }\r\n }\r\n return null;\r\n };\r\n /**\r\n * Returns first value for the specific key in the series.\r\n *\r\n * @param key Key\r\n * @return Value\r\n * @todo Description\r\n * @todo Convert to propert object property iterator\r\n */\r\n Series.prototype.getAbsoluteFirstValue = function (key) {\r\n for (var i = 0; i < this.dataItems.length; i++) {\r\n var dataItem = this.dataItems.getIndex(i);\r\n var value = dataItem.values[key].value;\r\n if ($type.isNumber(value)) {\r\n return value;\r\n }\r\n }\r\n return null;\r\n };\r\n /**\r\n * [rangeChangeUpdate description]\r\n *\r\n * @todo Description\r\n */\r\n Series.prototype.rangeChangeUpdate = function () {\r\n _super.prototype.rangeChangeUpdate.call(this);\r\n this.processValues(true);\r\n };\r\n /**\r\n * [processValues description]\r\n *\r\n * @todo Description\r\n * @todo Convert to propert object property iterator\r\n * @param dataItems [description]\r\n */\r\n Series.prototype.processValues = function (working) {\r\n var _this = this;\r\n if (!this.simplifiedProcessing) {\r\n var dataItems = this.dataItems;\r\n var count_1 = {};\r\n var sum_1 = {};\r\n var absoluteSum_1 = {};\r\n var low_1 = {};\r\n var high_1 = {};\r\n var open_1 = {};\r\n var close_1 = {};\r\n var previous_1 = {};\r\n var first_1 = {};\r\n var absoluteFirst_1 = {};\r\n //let duration: number = 0; // todo: check if series uses selection.change or selection.change.percent and set duration to interpolationduration\r\n var startIndex_1 = $math.max(0, this.startIndex);\r\n startIndex_1 = $math.min(startIndex_1, this.dataItems.length);\r\n var endIndex = $math.min(this.endIndex, this.dataItems.length);\r\n if (!$type.isNumber(startIndex_1)) {\r\n startIndex_1 = 0;\r\n }\r\n if (!$type.isNumber(endIndex)) {\r\n endIndex = this.dataItems.length;\r\n }\r\n if (startIndex_1 > 0) {\r\n var dataItem_1 = dataItems.getIndex(startIndex_1 - 1);\r\n $object.each(dataItem_1.values, function (key, values) {\r\n var value = dataItem_1.getActualWorkingValue(key);\r\n if ($type.isNumber(value)) {\r\n // save previous\r\n previous_1[key] = value;\r\n }\r\n });\r\n }\r\n var _loop_1 = function (i) {\r\n var dataItem_2 = dataItems.getIndex(i);\r\n $object.each(dataItem_2.values, function (key, values) {\r\n var value = dataItem_2.getActualWorkingValue(key);\r\n //if (i >= startIndex && i <= endIndex) { // do not add to count, sum etc if it is not within start/end index\r\n if ($type.isNumber(value)) {\r\n // count values\r\n if (!$type.isNumber(count_1[key])) {\r\n count_1[key] = 0;\r\n }\r\n count_1[key]++;\r\n // sum values\r\n if (!$type.isNumber(sum_1[key])) {\r\n sum_1[key] = 0;\r\n }\r\n sum_1[key] += value;\r\n // absolute sum values\r\n if (!$type.isNumber(absoluteSum_1[key])) {\r\n absoluteSum_1[key] = 0;\r\n }\r\n absoluteSum_1[key] += Math.abs(value);\r\n // open\r\n if (!$type.isNumber(open_1[key])) {\r\n open_1[key] = value;\r\n }\r\n // close\r\n close_1[key] = value;\r\n // low\r\n if (!$type.isNumber(low_1[key])) {\r\n low_1[key] = value;\r\n }\r\n else {\r\n if (low_1[key] > value) {\r\n low_1[key] = value;\r\n }\r\n }\r\n // high\r\n if (!$type.isNumber(high_1[key])) {\r\n high_1[key] = value;\r\n }\r\n else {\r\n if (high_1[key] < value) {\r\n high_1[key] = value;\r\n }\r\n }\r\n if (!$type.isNumber(first_1[key])) {\r\n first_1[key] = _this.getFirstValue(key, startIndex_1);\r\n }\r\n if (!$type.isNumber(absoluteFirst_1[key])) {\r\n absoluteFirst_1[key] = _this.getAbsoluteFirstValue(key);\r\n }\r\n // change\r\n dataItem_2.setCalculatedValue(key, value - first_1[key], \"change\");\r\n // change from start percent\r\n // will fail if first value is 0\r\n dataItem_2.setCalculatedValue(key, (value - first_1[key]) / first_1[key] * 100, \"changePercent\");\r\n dataItem_2.setCalculatedValue(key, (value - absoluteFirst_1[key]), \"startChange\");\r\n dataItem_2.setCalculatedValue(key, (value - absoluteFirst_1[key]) / absoluteFirst_1[key] * 100, \"startChangePercent\");\r\n // previous change\r\n var prevValue = previous_1[key];\r\n if (!$type.isNumber(prevValue)) {\r\n prevValue = value;\r\n }\r\n dataItem_2.setCalculatedValue(key, value - prevValue, \"previousChange\");\r\n // previous change percent\r\n dataItem_2.setCalculatedValue(key, (value - prevValue) / prevValue * 100, \"previousChangePercent\");\r\n // save previous\r\n previous_1[key] = value;\r\n }\r\n });\r\n };\r\n for (var i = startIndex_1; i < endIndex; i++) {\r\n _loop_1(i);\r\n }\r\n if (this.calculatePercent) {\r\n var _loop_2 = function (i) {\r\n var dataItem_3 = dataItems.getIndex(i);\r\n $object.each(dataItem_3.values, function (key) {\r\n var ksum = absoluteSum_1[key];\r\n var value = dataItem_3.getActualWorkingValue(key);\r\n if ($type.isNumber(value)) {\r\n if (ksum > 0) {\r\n if (_this.usePercentHack) {\r\n // this hack is made in order to make it possible to animate single slice to 0\r\n // if there is only one slice left, percent value is always 100%, so it won't animate\r\n // so we use real value of a slice instead of current value\r\n if (value == ksum) {\r\n ksum = dataItem_3.values[key].value;\r\n }\r\n }\r\n var percent = value / ksum * 100;\r\n dataItem_3.setCalculatedValue(key, percent, \"percent\");\r\n }\r\n else {\r\n dataItem_3.setCalculatedValue(key, 0, \"percent\");\r\n }\r\n }\r\n });\r\n };\r\n for (var i = startIndex_1; i < endIndex; i++) {\r\n _loop_2(i);\r\n }\r\n }\r\n // calculate one before first (cant do that in cycle, as we don't know open yet\r\n // when drawing line chart we should draw line to the invisible data point to the left, otherwise the line will always look like it starts from the selected point\r\n // so we do startIndex - 1\r\n if (startIndex_1 > 0) {\r\n var zeroItem_1 = dataItems.getIndex(startIndex_1 - 1);\r\n $object.each(zeroItem_1.values, function (key) {\r\n var value = zeroItem_1.values[key].value;\r\n // change\r\n zeroItem_1.setCalculatedValue(key, value - open_1[key], \"change\");\r\n // change percent\r\n zeroItem_1.setCalculatedValue(key, (value - open_1[key]) / open_1[key] * 100, \"changePercent\");\r\n });\r\n }\r\n // we save various data like sum, average to dataPoint of the series\r\n var dataItem_4 = this.dataItem;\r\n $object.each(dataItem_4.values, function (key) {\r\n dataItem_4.setCalculatedValue(key, sum_1[key], \"sum\");\r\n dataItem_4.setCalculatedValue(key, absoluteSum_1[key], \"absoluteSum\");\r\n dataItem_4.setCalculatedValue(key, sum_1[key] / count_1[key], \"average\");\r\n dataItem_4.setCalculatedValue(key, open_1[key], \"open\");\r\n dataItem_4.setCalculatedValue(key, close_1[key], \"close\");\r\n dataItem_4.setCalculatedValue(key, low_1[key], \"low\");\r\n dataItem_4.setCalculatedValue(key, high_1[key], \"high\");\r\n dataItem_4.setCalculatedValue(key, count_1[key], \"count\");\r\n });\r\n }\r\n };\r\n /**\r\n * (Re)validates the whole series, effectively causing it to redraw.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Series.prototype.validate = function () {\r\n if ($utils.isIE()) {\r\n this.filters.clear();\r\n }\r\n $iter.each(this.axisRanges.iterator(), function (axisRange) {\r\n //axisRange.contents.disposeChildren(); // not good for columns, as they are reused\r\n //\t\t\taxisRange.appendChildren();\r\n axisRange.validate();\r\n });\r\n _super.prototype.validate.call(this);\r\n var bulletsContainer = this.bulletsContainer;\r\n bulletsContainer.fill = this.fill;\r\n bulletsContainer.stroke = this.stroke;\r\n bulletsContainer.x = this.pixelX;\r\n bulletsContainer.y = this.pixelY;\r\n if (this.bulletsContainer.children.length > 0) {\r\n if (this._showBullets) {\r\n for (var i = 0; i < this.startIndex; i++) {\r\n var dataItem = this.dataItems.getIndex(i);\r\n if (dataItem) {\r\n dataItem.bullets.each(function (key, bullet) {\r\n bullet.__disabled = true;\r\n });\r\n }\r\n }\r\n for (var i = this.dataItems.length - 1; i > this.endIndex; i--) {\r\n var dataItem = this.dataItems.getIndex(i);\r\n if (dataItem) {\r\n dataItem.bullets.each(function (key, bullet) {\r\n bullet.__disabled = true;\r\n });\r\n }\r\n }\r\n }\r\n else {\r\n this.bulletsContainer.children.each(function (bullet) {\r\n bullet.__disabled = true;\r\n });\r\n }\r\n }\r\n this.updateTooltipBounds();\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Series.prototype.updateTooltipBounds = function () {\r\n if (this.topParent) {\r\n var x = 0;\r\n var y = 0;\r\n var w = this.topParent.maxWidth;\r\n var h = this.topParent.maxHeight;\r\n var rect = { x: x, y: y, width: w, height: h };\r\n this.tooltip.setBounds(rect);\r\n }\r\n };\r\n Series.prototype.shouldCreateBullet = function (dataItem, bulletTemplate) {\r\n return true;\r\n };\r\n /**\r\n * Validates data item's element, effectively redrawing it.\r\n *\r\n * @ignore Exclude from docs\r\n * @param dataItem Data item\r\n */\r\n Series.prototype.validateDataElement = function (dataItem) {\r\n var _this = this;\r\n _super.prototype.validateDataElement.call(this, dataItem);\r\n if (this._showBullets) {\r\n if (!this.isHidden) {\r\n this.bulletsContainer.visible = true;\r\n }\r\n this.bullets.each(function (bulletTemplate) {\r\n // always better to use the same, this helps to avoid redrawing\r\n var bullet = dataItem.bullets.getKey(bulletTemplate.uid);\r\n if (_this.shouldCreateBullet(dataItem, bulletTemplate)) {\r\n if (!bullet) {\r\n var disabledField = bulletTemplate.propertyFields.disabled;\r\n var dataContext = dataItem.dataContext;\r\n if (disabledField && dataContext && dataContext[disabledField] === false) {\r\n bulletTemplate.applyOnClones = false;\r\n bulletTemplate.disabled = false;\r\n bullet = bulletTemplate.clone();\r\n bulletTemplate.disabled = true;\r\n bulletTemplate.applyOnClones = true;\r\n }\r\n else {\r\n bullet = bulletTemplate.clone();\r\n }\r\n bullet.shouldClone = false;\r\n dataItem.addSprite(bullet);\r\n if (!_this.visible || _this.isHiding) {\r\n bullet.hide(0);\r\n }\r\n }\r\n var currentDataItem = bullet.dataItem;\r\n if (currentDataItem != dataItem) {\r\n // set to undefined in order not to reuse\r\n if (currentDataItem) {\r\n currentDataItem.bullets.setKey(bulletTemplate.uid, undefined);\r\n }\r\n var readerText_1 = _this.itemReaderText;\r\n if (bullet instanceof Bullet) {\r\n if (!readerText_1) {\r\n readerText_1 = (\"{\" + bullet.xField + \"}: {\" + bullet.yField + \"}\");\r\n }\r\n if (bullet.isDynamic) {\r\n dataItem.events.on(\"workingvaluechanged\", bullet.deepInvalidate, bullet, false);\r\n //dataItem.events.on(\"calculatedvaluechanged\", bullet.deepInvalidate, bullet, false);\r\n _this.dataItem.events.on(\"workingvaluechanged\", bullet.deepInvalidate, bullet, false);\r\n }\r\n bullet.deepInvalidate();\r\n }\r\n // Add accessibility to bullet\r\n if (bullet.focusable) {\r\n bullet.events.on(\"focus\", function (ev) {\r\n bullet.readerTitle = _this.populateString(readerText_1, bullet.dataItem);\r\n }, undefined, false);\r\n bullet.events.on(\"blur\", function (ev) {\r\n bullet.readerTitle = \"\";\r\n }, undefined, false);\r\n }\r\n if (bullet.hoverable) {\r\n bullet.events.on(\"over\", function (ev) {\r\n bullet.readerTitle = _this.populateString(readerText_1, bullet.dataItem);\r\n }, undefined, false);\r\n bullet.events.on(\"out\", function (ev) {\r\n bullet.readerTitle = \"\";\r\n }, undefined, false);\r\n }\r\n }\r\n bullet.parent = _this.bulletsContainer;\r\n dataItem.bullets.setKey(bulletTemplate.uid, bullet);\r\n // pass max w/h so we'd know if we should show/hide somethings\r\n bullet.maxWidth = dataItem.itemWidth;\r\n bullet.maxHeight = dataItem.itemHeight;\r\n bullet.__disabled = false;\r\n _this.positionBullet(bullet);\r\n }\r\n else {\r\n if (bullet) {\r\n bullet.__disabled = true;\r\n }\r\n }\r\n });\r\n }\r\n else {\r\n this.bulletsContainer.visible = false;\r\n }\r\n };\r\n /**\r\n * [handleDataItemWorkingValueChange description]\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Series.prototype.handleDataItemWorkingValueChange = function (dataItem, name) {\r\n if (!this.dataRangeInvalid) {\r\n this.invalidateProcessedData();\r\n }\r\n };\r\n Object.defineProperty(Series.prototype, \"ignoreMinMax\", {\r\n /**\r\n * @return Exclude from calculations?\r\n */\r\n get: function () {\r\n return this._ignoreMinMax;\r\n },\r\n /**\r\n * Should this series excluded from the axis scale calculations?\r\n *\r\n * @default false\r\n * @param value Exclude from calculations?\r\n */\r\n set: function (value) {\r\n this._ignoreMinMax = value;\r\n this.invalidateDataItems();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Create a mask for the series.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Series.prototype.createMask = function () {\r\n // A placeholder method for extending classes to override.\r\n };\r\n /**\r\n * Process axis range after it has been added to the list.\r\n *\r\n * @param event Event\r\n */\r\n Series.prototype.processAxisRange = function (event) {\r\n // create container if not existing\r\n if (!this.rangesContainer) {\r\n this.rangesContainer = this.createChild(Container);\r\n this.rangesContainer.shouldClone = false;\r\n this.rangesContainer.isMeasured = false;\r\n }\r\n var axisRange = event.newValue;\r\n if (axisRange) {\r\n axisRange.contents.parent = this.rangesContainer;\r\n axisRange.isRange = true;\r\n axisRange.events.on(\"valuechanged\", this.invalidateDataItems, this, false);\r\n }\r\n };\r\n /**\r\n * [getAxisField description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param axis [description]\r\n * @return [description]\r\n */\r\n Series.prototype.getAxisField = function (axis) {\r\n return;\r\n };\r\n /**\r\n * Shows the tooltip at specific position.\r\n *\r\n * @ignore Exclude from docs\r\n * @param xPosition X\r\n * @param yPosition Y\r\n */\r\n Series.prototype.showTooltipAtPosition = function (xPosition, yPosition) {\r\n // Placeholder method for extending classes to override.\r\n };\r\n Object.defineProperty(Series.prototype, \"minBulletDistance\", {\r\n /**\r\n * @return Distance (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"minBulletDistance\");\r\n },\r\n /**\r\n * Minimal distance between data points in pixels.\r\n *\r\n * If distance gets smaller than this, bullets are turned off to avoid\r\n * overlapping.\r\n *\r\n * `0` (zero) disables this behavior.\r\n *\r\n * IMPORTANT: This setting will work only when Series' base axis\r\n * is [[CategoryAxis]] or [[DateAxis]]. If base axis is [[ValueAxis]] the\r\n * setting will be ignored, because it would be a huge overhead to measure\r\n * distance between each and every bullet.\r\n *\r\n * @default 0\r\n * @param value Distance (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"minBulletDistance\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Series.prototype, \"bullets\", {\r\n /**\r\n * A list of bullets that will be added to each and every items in the\r\n * series.\r\n *\r\n * You can push any object that is a descendant of a [[Sprite]] here. All\r\n * items added to this list will be copied and used as a bullet on all data\r\n * items, including their properties, events, etc.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/bullets/} for more info about the concept of Bullets\r\n * @return List of bullets.\r\n */\r\n get: function () {\r\n if (!this._bullets) {\r\n this._bullets = new ListTemplate(new Bullet());\r\n this._bullets.template.virtualParent = this;\r\n this._bullets.events.on(\"inserted\", this.processBullet, this, false);\r\n this._bullets.events.on(\"removed\", this.removeBullet, this, false);\r\n this._disposers.push(new ListDisposer(this._bullets));\r\n this._disposers.push(this._bullets.template);\r\n }\r\n return this._bullets;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Binds related legend data item's visual settings to this series' visual\r\n * settings.\r\n *\r\n * @ignore Exclude from docs\r\n * @param marker Legend item container\r\n */\r\n Series.prototype.createLegendMarker = function (marker) {\r\n // This is a placeholder method for extending classes to override.\r\n };\r\n Object.defineProperty(Series.prototype, \"hiddenInLegend\", {\r\n /**\r\n * @return Hidden in legend?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"hiddenInLegend\");\r\n },\r\n /**\r\n * Should the series be hidden in legend?\r\n *\r\n * @param value Hidden in legend?\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"hiddenInLegend\", value)) {\r\n if (this.chart) {\r\n this.chart.feedLegend();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Series.prototype, \"name\", {\r\n /**\r\n * @return Name\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"name\");\r\n },\r\n /**\r\n * Series' name.\r\n *\r\n * @param value Name\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"name\", value);\r\n var legendDataItem = this.legendDataItem;\r\n if (legendDataItem) {\r\n legendDataItem.component.invalidate();\r\n legendDataItem.component.invalidateRawData();\r\n }\r\n this.readerTitle = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Series.prototype, \"itemReaderText\", {\r\n /**\r\n * @return Screen reader text template\r\n */\r\n get: function () {\r\n // Get explicitly set reader text\r\n var readerText = this._itemReaderText;\r\n // Not set? Let's try something else\r\n if (!readerText) {\r\n // Tooltip text?\r\n if (this.tooltipText) {\r\n readerText = $utils.plainText(this.tooltipText);\r\n }\r\n else if (this.tooltipHTML) {\r\n readerText = $utils.plainText(this.tooltipHTML);\r\n }\r\n }\r\n if (!this._adapterO) {\r\n return readerText;\r\n }\r\n else {\r\n return this._adapterO.apply(\"itemReaderText\", readerText);\r\n }\r\n },\r\n /**\r\n * Screen reader text to be applied to each individual data item, such\r\n * as bullets, columns or slices.\r\n *\r\n * The template can contain field reference meta codes, i.e. `{dateX}`,\r\n * `{valueY}`, etc.\r\n *\r\n * Any text formatting options, e.g. `[bold]` will be ignored.\r\n *\r\n * @param value Screen reader text template\r\n */\r\n set: function (value) {\r\n this._itemReaderText = value;\r\n this._itemReaderTextChanged = true;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns if number of data items in the series are beyond non-focusable\r\n * count and should not be available for TAB-through.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Items focusable?\r\n */\r\n Series.prototype.itemsFocusable = function () {\r\n return this.dataItems.length >= this.skipFocusThreshold ? false : true;\r\n };\r\n Object.defineProperty(Series.prototype, \"legendDataItem\", {\r\n /**\r\n * @return Data item\r\n */\r\n get: function () {\r\n return this._legendDataItem;\r\n },\r\n /**\r\n * Legend data item that corresponds to this series.\r\n *\r\n * @param value Data item\r\n */\r\n set: function (value) {\r\n this._legendDataItem = value;\r\n this._legendDataItem.itemContainer.deepInvalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Updates corresponding legend data item with current values.\r\n *\r\n * @ignore Exclude from docs\r\n * @param dataItem Data item\r\n */\r\n Series.prototype.updateLegendValue = function (dataItem, notRange) {\r\n // if this series has legend item\r\n if (this.legendDataItem) {\r\n var legendSettings = this.legendSettings;\r\n var legendDataItem = this.legendDataItem;\r\n var label = legendDataItem.label;\r\n var valueLabel = legendDataItem.valueLabel;\r\n // update legend\r\n if ((dataItem && !dataItem.isDisposed()) || notRange) {\r\n if (valueLabel) {\r\n if (legendSettings.itemValueText) {\r\n valueLabel.text = legendSettings.itemValueText;\r\n }\r\n valueLabel.dataItem = dataItem;\r\n }\r\n if (label) {\r\n if (legendSettings.itemLabelText) {\r\n label.text = legendSettings.itemLabelText;\r\n }\r\n label.dataItem = dataItem;\r\n }\r\n }\r\n else {\r\n if (label) {\r\n // if itemLabelText is set, means we have to reset label even if labelText is not set\r\n if (legendSettings.labelText || legendSettings.itemLabelText != undefined) {\r\n label.text = legendSettings.labelText;\r\n }\r\n label.dataItem = this.dataItem;\r\n }\r\n if (valueLabel) {\r\n if (legendSettings.valueText || legendSettings.itemValueText != undefined) {\r\n valueLabel.text = legendSettings.valueText;\r\n }\r\n valueLabel.dataItem = this.dataItem;\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Copies all properties from another instance of [[Series]].\r\n *\r\n * @param source Source series\r\n */\r\n Series.prototype.copyFrom = function (source) {\r\n this.bullets.copyFrom(source.bullets);\r\n this.bulletsContainer.copyFrom(source.bulletsContainer);\r\n this.calculatePercent = source.calculatePercent;\r\n this.usePercentHack = source.usePercentHack;\r\n this.simplifiedProcessing = source.simplifiedProcessing;\r\n _super.prototype.copyFrom.call(this, source);\r\n };\r\n /**\r\n * Displays a modal or console message with error, and halts any further\r\n * processing of this element.\r\n *\r\n * @param e Error\r\n */\r\n Series.prototype.raiseCriticalError = function (e) {\r\n if (this._chart && this._chart.modal) {\r\n this._chart.modal.content = this._chart.adapter.apply(\"criticalError\", e).message;\r\n this._chart.modal.closable = false;\r\n if (!options.suppressErrors) {\r\n this._chart.modal.open();\r\n }\r\n this._chart.disabled = true;\r\n }\r\n if (options.verbose) {\r\n console.log(e);\r\n }\r\n };\r\n /**\r\n * Applies filters to the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Series.prototype.applyFilters = function () {\r\n var _this = this;\r\n _super.prototype.applyFilters.call(this);\r\n this.bulletsContainer.filters.clear();\r\n // copyFrom of a list copies, does not clone\r\n $iter.each(this.filters.iterator(), function (filter) {\r\n _this.bulletsContainer.filters.push(filter.clone());\r\n });\r\n };\r\n Object.defineProperty(Series.prototype, \"heatRules\", {\r\n /**\r\n * A list of heat rules to apply to series' elements based on the value\r\n * of the data item.\r\n *\r\n * Heat rules can be any \"numeric\" (including `Color`) property, and can also\r\n * be applied to child objects of series, like columns, bullets, etc.\r\n *\r\n * E.g.:\r\n *\r\n * ```TypeScript\r\n * series.heatRules.push({\r\n * \"target\": series.columns.template,\r\n * \"property\": \"fill\",\r\n * \"min\": am4core.color(\"#F5DBCB\"),\r\n * \"max\": am4core.color(\"#ED7B84\"),\r\n * \"dataField\": \"valueY\"\r\n *});\r\n *```\r\n * ```Javacript\r\n * series.heatRules.push({\r\n * \"target\": series.columns.template,\r\n * \"property\": \"fill\",\r\n * \"min\": am4core.color(\"#F5DBCB\"),\r\n * \"max\": am4core.color(\"#ED7B84\"),\r\n * \"dataField\": \"valueY\"\r\n *});\r\n *```\r\n *```JSON\r\n *{\r\n * // ...\r\n * \"series\": [{\r\n * \"type\": \"ColumnSeries\",\r\n * \"heatRules\": [{\r\n * \"target\": \"columns.template\",\r\n * \"property\": \"fill\",\r\n * \"min\": \"#F5DBCB\",\r\n * \"max\": \"#ED7B84\",\r\n * \"dataField\": \"valueY\"\r\n * }]\r\n * }]\r\n *}\r\n *```\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/series/#Heat_maps} for more about heat rules\r\n * @return Heat rules\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._heatRules) {\r\n this._heatRules = new List();\r\n this._heatRules.events.on(\"inserted\", function (event) {\r\n var heatRule = event.newValue;\r\n var target = heatRule.target;\r\n if (target) {\r\n var dataField_1 = heatRule.dataField;\r\n if (!$type.hasValue(dataField_1)) {\r\n dataField_1 = \"value\";\r\n }\r\n var seriesDataItem_1 = _this.dataItem;\r\n var property_1 = heatRule.property;\r\n var minValue = $type.toNumber(heatRule.minValue);\r\n var maxValue = $type.toNumber(heatRule.maxValue);\r\n if (!$type.isNumber(minValue) && !$type.isNumber(maxValue)) {\r\n _this.dataItem.events.on(\"calculatedvaluechanged\", function (event) {\r\n if (event.property == dataField_1) {\r\n $iter.each(_this.dataItems.iterator(), function (dataItem) {\r\n var foundSprite = false;\r\n $array.each(dataItem.sprites, function (sprite) {\r\n if (sprite.clonedFrom == target) {\r\n var anySprite = sprite;\r\n anySprite[property_1] = anySprite[property_1];\r\n foundSprite = true;\r\n }\r\n });\r\n if (!foundSprite) {\r\n $array.each(dataItem.sprites, function (sprite) {\r\n if (sprite instanceof Container) {\r\n $iter.each(sprite.children.iterator(), function (child) {\r\n if (child.className == target.className) {\r\n var anyChild = child;\r\n anyChild[property_1] = anyChild[property_1];\r\n }\r\n // giveup here\r\n else if (child instanceof Container) {\r\n child.deepInvalidate();\r\n }\r\n });\r\n }\r\n });\r\n }\r\n });\r\n }\r\n });\r\n }\r\n _this.dataItems.template.events.on(\"workingvaluechanged\", function (event) {\r\n if (event.property == dataField_1) {\r\n var dataItem = event.target;\r\n var foundSprite_1 = false;\r\n $array.each(dataItem.sprites, function (sprite) {\r\n if (sprite.clonedFrom == target) {\r\n var anySprite = sprite;\r\n anySprite[property_1] = anySprite[property_1];\r\n foundSprite_1 = true;\r\n }\r\n });\r\n if (!foundSprite_1) {\r\n $array.each(dataItem.sprites, function (sprite) {\r\n if (sprite instanceof Container) {\r\n $iter.each(sprite.children.iterator(), function (child) {\r\n if (child.className == target.className) {\r\n var anyChild = child;\r\n anyChild[property_1] = anyChild[property_1];\r\n }\r\n // givup here\r\n else if (child instanceof Container) {\r\n child.deepInvalidate();\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n });\r\n target.adapter.add(property_1, function (value, ruleTarget, property) {\r\n var minValue = $type.toNumber(heatRule.minValue);\r\n var maxValue = $type.toNumber(heatRule.maxValue);\r\n var min = heatRule.min;\r\n var max = heatRule.max;\r\n if (ruleTarget instanceof Sprite) {\r\n var anySprite = ruleTarget;\r\n var propertyField = anySprite.propertyFields[property];\r\n if (propertyField && ruleTarget.dataItem) {\r\n var dataContext = ruleTarget.dataItem.dataContext;\r\n if (dataContext && $type.hasValue(dataContext[propertyField])) {\r\n return value;\r\n }\r\n }\r\n }\r\n var dataItem = ruleTarget.dataItem;\r\n if (!$type.isNumber(minValue)) {\r\n minValue = seriesDataItem_1.values[dataField_1].low;\r\n }\r\n if (!$type.isNumber(maxValue)) {\r\n maxValue = seriesDataItem_1.values[dataField_1].high;\r\n }\r\n if (dataItem) {\r\n var fieldValues = dataItem.values[dataField_1];\r\n if (fieldValues) {\r\n var workingValue = dataItem.getActualWorkingValue(dataField_1);\r\n if ($type.hasValue(min) && $type.hasValue(max) && $type.isNumber(minValue) && $type.isNumber(maxValue) && $type.isNumber(workingValue)) {\r\n var percent = void 0;\r\n if (heatRule.logarithmic) {\r\n percent = (Math.log(workingValue) * Math.LOG10E - Math.log(minValue) * Math.LOG10E) / ((Math.log(maxValue) * Math.LOG10E - Math.log(minValue) * Math.LOG10E));\r\n }\r\n else {\r\n percent = (workingValue - minValue) / (maxValue - minValue);\r\n }\r\n if ($type.isNumber(workingValue) && (!$type.isNumber(percent) || Math.abs(percent) == Infinity)) {\r\n percent = 0.5;\r\n }\r\n // fixes problems if all values are the same\r\n if ($type.isNumber(min)) {\r\n return min + (max - min) * percent;\r\n }\r\n else if (min instanceof Color) {\r\n return new Color($colors.interpolate(min.rgb, max.rgb, percent));\r\n }\r\n }\r\n }\r\n }\r\n return value;\r\n });\r\n }\r\n });\r\n }\r\n return this._heatRules;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n Series.prototype.processConfig = function (config) {\r\n var heatRules;\r\n if (config) {\r\n // Set up bullets\r\n if ($type.hasValue(config.bullets) && $type.isArray(config.bullets)) {\r\n for (var i = 0, len = config.bullets.length; i < len; i++) {\r\n var bullets = config.bullets[i];\r\n if (!$type.hasValue(bullets.type)) {\r\n bullets.type = \"Bullet\";\r\n }\r\n }\r\n }\r\n // Let's take heatRules out of the config, so that we can process\r\n // them later, when bullets are already there\r\n if ($type.hasValue(config.heatRules) && $type.isArray(config.heatRules)) {\r\n heatRules = config.heatRules;\r\n delete config.heatRules;\r\n }\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n // Process heat rules again, when all other elements are ready\r\n if (heatRules) {\r\n for (var i = 0, len = heatRules.length; i < len; i++) {\r\n var rule = heatRules[i];\r\n // Resolve target\r\n var target = this;\r\n if ($type.hasValue(rule.target) && $type.isString(rule.target)) {\r\n // Check if we can find this element by id\r\n if (this.map.hasKey(rule.target)) {\r\n target = this.map.getKey(rule.target);\r\n }\r\n else {\r\n var parts = rule.target.split(\".\");\r\n for (var x = 0; x < parts.length; x++) {\r\n if (target instanceof List) {\r\n var listitem = target.getIndex($type.toNumber(parts[x]));\r\n if (!listitem) {\r\n target = target[parts[x]];\r\n }\r\n else {\r\n target = listitem;\r\n }\r\n }\r\n else {\r\n var maybeIndex = parts[x].match(/^(.*)\\[([0-9]+)\\]/);\r\n if (maybeIndex) {\r\n if (target[maybeIndex[1]] instanceof List) {\r\n target = target[maybeIndex[1]].getIndex($type.toNumber(maybeIndex[2]));\r\n }\r\n else {\r\n target = target[maybeIndex[1]][$type.toNumber(maybeIndex[2])];\r\n }\r\n }\r\n else {\r\n target = target[parts[x]];\r\n }\r\n }\r\n }\r\n }\r\n }\r\n rule.target = target;\r\n // Resolve colors and percents\r\n if ($type.hasValue(rule.min)) {\r\n rule.min = this.maybeColorOrPercent(rule.min);\r\n }\r\n if ($type.hasValue(rule.max)) {\r\n rule.max = this.maybeColorOrPercent(rule.max);\r\n }\r\n }\r\n _super.prototype.processConfig.call(this, {\r\n heatRules: heatRules\r\n });\r\n }\r\n };\r\n /**\r\n * Returns visibility value\r\n * @ignore\r\n */\r\n /*\r\n protected getVisibility(): boolean {\r\n let hidden = this.getPropertyValue(\"hidden\");\r\n if (hidden) {\r\n return false;\r\n }\r\n else {\r\n return super.getVisibility();\r\n }\r\n }*/\r\n /**\r\n * This function is used to sort element's JSON config properties, so that\r\n * some properties that absolutely need to be processed last, can be put at\r\n * the end.\r\n *\r\n * @ignore Exclude from docs\r\n * @param a Element 1\r\n * @param b Element 2\r\n * @return Sorting number\r\n */\r\n Series.prototype.configOrder = function (a, b) {\r\n if (a == b) {\r\n return 0;\r\n }\r\n // Must come last\r\n else if (a == \"heatRules\") {\r\n return 1;\r\n }\r\n else if (b == \"heatRules\") {\r\n return -1;\r\n }\r\n else {\r\n return _super.prototype.configOrder.call(this, a, b);\r\n }\r\n };\r\n /**\r\n * Sets `visibility` property:\r\n *\r\n * * `true` - visible\r\n * * `false` - hidden\r\n *\r\n * @param value true - visible, false - hidden\r\n * @return Current visibility\r\n */\r\n Series.prototype.setVisibility = function (value) {\r\n _super.prototype.setVisibility.call(this, value);\r\n this.bulletsContainer.visible = value;\r\n };\r\n return Series;\r\n}(Component));\r\nexport { Series };\r\n/**\r\n * Register class, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Series\"] = Series;\r\nregistry.registeredClasses[\"SeriesDataItem\"] = SeriesDataItem;\r\n//# sourceMappingURL=Series.js.map","/**\r\n * Serial chart module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Chart, ChartDataItem } from \"../Chart\";\r\nimport { ListTemplate, ListDisposer } from \"../../core/utils/List\";\r\nimport { Container } from \"../../core/Container\";\r\nimport { Series } from \"../series/Series\";\r\nimport { percent } from \"../../core/utils/Percent\";\r\nimport { ColorSet } from \"../../core/utils/ColorSet\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $array from \"../../core/utils/Array\";\r\nimport { Disposer } from \"../../core/utils/Disposer\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a [[DataItem]] for [[SerialChart]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nvar SerialChartDataItem = /** @class */ (function (_super) {\r\n __extends(SerialChartDataItem, _super);\r\n /**\r\n * Constructor\r\n */\r\n function SerialChartDataItem() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"SerialChartDataItem\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n return SerialChartDataItem;\r\n}(ChartDataItem));\r\nexport { SerialChartDataItem };\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A base class for all series-based charts, like XY, Pie, etc.\r\n *\r\n * Is not useful on its own.\r\n *\r\n * @see {@link ISerialChartEvents} for a list of available Events\r\n * @see {@link ISerialChartAdapters} for a list of available Adapters\r\n */\r\nvar SerialChart = /** @class */ (function (_super) {\r\n __extends(SerialChart, _super);\r\n /**\r\n * Constructor\r\n */\r\n function SerialChart() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this._exitDP = {};\r\n _this.className = \"SerialChart\";\r\n _this.colors = new ColorSet();\r\n _this._usesData = false;\r\n // Create a container for series\r\n var seriesContainer = _this.chartContainer.createChild(Container);\r\n seriesContainer.shouldClone = false;\r\n seriesContainer.width = percent(100);\r\n seriesContainer.height = percent(100);\r\n seriesContainer.isMeasured = false;\r\n seriesContainer.layout = \"none\";\r\n seriesContainer.zIndex = 2;\r\n _this.seriesContainer = seriesContainer;\r\n // Create a container for bullets\r\n var bulletsContainer = _this.chartContainer.createChild(Container);\r\n bulletsContainer.shouldClone = false;\r\n bulletsContainer.width = percent(100);\r\n bulletsContainer.height = percent(100);\r\n bulletsContainer.isMeasured = false;\r\n bulletsContainer.zIndex = 3;\r\n bulletsContainer.layout = \"none\";\r\n _this.bulletsContainer = bulletsContainer;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n SerialChart.prototype.dispose = function () {\r\n _super.prototype.dispose.call(this);\r\n if (this.colors) {\r\n this.colors.dispose();\r\n }\r\n if (this.patterns) {\r\n this.patterns.dispose();\r\n }\r\n };\r\n /**\r\n * Sets defaults that instantiate some objects that rely on parent, so they\r\n * cannot be set in constructor\r\n */\r\n SerialChart.prototype.applyInternalDefaults = function () {\r\n _super.prototype.applyInternalDefaults.call(this);\r\n // Add a default screen reader title for accessibility\r\n // This will be overridden in screen reader if there are any `titles` set\r\n if (!$type.hasValue(this.readerTitle)) {\r\n this.readerTitle = this.language.translate(\"Serial chart\");\r\n }\r\n };\r\n Object.defineProperty(SerialChart.prototype, \"series\", {\r\n /**\r\n * A list of chart's series.\r\n *\r\n * @return Chart's series\r\n */\r\n get: function () {\r\n if (!this._series) {\r\n this._series = new ListTemplate(this.createSeries());\r\n this._series.events.on(\"inserted\", this.handleSeriesAdded, this, false);\r\n this._series.events.on(\"removed\", this.handleSeriesRemoved, this, false);\r\n this._disposers.push(new ListDisposer(this._series, false));\r\n this._disposers.push(this._series.template);\r\n }\r\n return this._series;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n SerialChart.prototype.handleSeriesRemoved = function (event) {\r\n var series = event.oldValue;\r\n this.dataUsers.removeValue(series);\r\n this.dataUsers.each(function (dataUser) {\r\n dataUser.invalidateDataItems();\r\n });\r\n if (this._exitDP[series.uid]) {\r\n this._exitDP[series.uid].dispose();\r\n delete this._exitDP[series.uid];\r\n }\r\n if (series.autoDispose) {\r\n series.dispose();\r\n }\r\n else {\r\n series.parent = undefined;\r\n series.bulletsContainer.parent = undefined;\r\n }\r\n //this.feedLegend();\r\n var legend = this.legend;\r\n if (legend) {\r\n var dataItems = this.legend.dataItems;\r\n for (var i = dataItems.length - 1; i >= 0; i--) {\r\n var dataItem = dataItems.getIndex(i);\r\n if (dataItem && dataItem.dataContext == series) {\r\n legend.dataItems.remove(dataItem);\r\n }\r\n }\r\n for (var i = legend.data.length - 1; i >= 0; i--) {\r\n var di = legend.data[i];\r\n if (di && di == series) {\r\n $array.remove(legend.data, di);\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Decorates a new [[Series]] object with required parameters when it is\r\n * added to the chart.\r\n *\r\n * @ignore Exclude from docs\r\n * @param event Event\r\n */\r\n SerialChart.prototype.handleSeriesAdded = function (event) {\r\n var _this = this;\r\n var series = event.newValue;\r\n if (series.isDisposed()) {\r\n return;\r\n }\r\n series.chart = this;\r\n series.parent = this.seriesContainer;\r\n series.bulletsContainer.parent = this.bulletsContainer;\r\n this._dataUsers.moveValue(series);\r\n series.addDisposer(new Disposer(function () {\r\n _this.dataUsers.removeValue(series);\r\n }));\r\n this.handleSeriesAdded2(series);\r\n this.handleLegendSeriesAdded(series);\r\n };\r\n SerialChart.prototype.handleLegendSeriesAdded = function (series) {\r\n if (!series.hiddenInLegend) {\r\n if (this.legend) {\r\n this.legend.addData(series);\r\n }\r\n }\r\n };\r\n SerialChart.prototype.handleSeriesAdded2 = function (series) {\r\n var _this = this;\r\n if (!this.dataInvalid) {\r\n this._exitDP[series.uid] = registry.events.once(\"exitframe\", function () {\r\n if (!series.data || series.data.length == 0) {\r\n series.data = _this.data;\r\n if (series.showOnInit) {\r\n series.reinit();\r\n series.setPropertyValue(\"showOnInit\", false);\r\n series.showOnInit = true;\r\n }\r\n if (!series.isDisposed()) {\r\n series.events.once(\"datavalidated\", function () {\r\n if (series.data == _this.data) {\r\n series._data = [];\r\n }\r\n });\r\n }\r\n }\r\n });\r\n this._disposers.push(this._exitDP[series.uid]);\r\n }\r\n };\r\n /**\r\n * Setups the legend to use the chart's data.\r\n * @ignore\r\n */\r\n SerialChart.prototype.feedLegend = function () {\r\n var legend = this.legend;\r\n if (legend) {\r\n var legendData_1 = [];\r\n $iter.each(this.series.iterator(), function (series) {\r\n if (!series.hiddenInLegend) {\r\n legendData_1.push(series);\r\n }\r\n });\r\n legend.dataFields.name = \"name\";\r\n legend.data = legendData_1;\r\n }\r\n };\r\n /**\r\n * Creates and returns a new Series, suitable for this chart type.\r\n *\r\n * @return New series\r\n */\r\n SerialChart.prototype.createSeries = function () {\r\n return new Series();\r\n };\r\n Object.defineProperty(SerialChart.prototype, \"colors\", {\r\n /**\r\n * @return Color list\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"colors\");\r\n },\r\n /**\r\n * Chart's color list.\r\n *\r\n * This list can be used by a number of serial items, like applying a new\r\n * color for each Series added. Or, applying a new color for each slice\r\n * of a Pie chart.\r\n *\r\n * Please see [[ColorSet]] for information on how you can set up to generate\r\n * unique colors.\r\n *\r\n * A theme you are using may override default pre-defined colors.\r\n *\r\n * @param value Color list\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"colors\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SerialChart.prototype, \"patterns\", {\r\n /**\r\n * @return Pattern set\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"patterns\");\r\n },\r\n /**\r\n * A [[PatternSet]] to use when creating patterned fills for slices.\r\n *\r\n * @since 4.7.5\r\n * @param value Pattern set\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"patterns\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies all parameters from another [[SerialChart]].\r\n *\r\n * @param source Source SerialChart\r\n */\r\n SerialChart.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.series.copyFrom(source.series);\r\n };\r\n /**\r\n * Hides the chart instantly and then shows it. If defaultState.transitionDuration > 0, this will result an animation in which properties of hidden state will animate to properties of visible state.\r\n */\r\n SerialChart.prototype.appear = function () {\r\n _super.prototype.appear.call(this);\r\n this.series.each(function (series) {\r\n if (series.showOnInit && series.inited) {\r\n series.appear();\r\n }\r\n });\r\n };\r\n return SerialChart;\r\n}(Chart));\r\nexport { SerialChart };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"SerialChart\"] = SerialChart;\r\n//# sourceMappingURL=SerialChart.js.map","// https://github.com/python/cpython/blob/a74eea238f5baba15797e2e8b570d153bc8690a7/Modules/mathmodule.c#L1423\nexport class Adder {\n constructor() {\n this._partials = new Float64Array(32);\n this._n = 0;\n }\n add(x) {\n const p = this._partials;\n let i = 0;\n for (let j = 0; j < this._n && j < 32; j++) {\n const y = p[j],\n hi = x + y,\n lo = Math.abs(x) < Math.abs(y) ? x - (hi - y) : y - (hi - x);\n if (lo) p[i++] = lo;\n x = hi;\n }\n p[i] = x;\n this._n = i + 1;\n return this;\n }\n valueOf() {\n const p = this._partials;\n let n = this._n, x, y, lo, hi = 0;\n if (n > 0) {\n hi = p[--n];\n while (n > 0) {\n x = hi;\n y = p[--n];\n hi = x + y;\n lo = y - (hi - x);\n if (lo) break;\n }\n if (n > 0 && ((lo < 0 && p[n - 1] < 0) || (lo > 0 && p[n - 1] > 0))) {\n y = lo * 2;\n x = hi + y;\n if (y == x - hi) hi = x;\n }\n }\n return hi;\n }\n}\n\nexport function fsum(values, valueof) {\n const adder = new Adder();\n if (valueof === undefined) {\n for (let value of values) {\n if (value = +value) {\n adder.add(value);\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if (value = +valueof(value, ++index, values)) {\n adder.add(value);\n }\n }\n }\n return +adder;\n}\n\nexport function fcumsum(values, valueof) {\n const adder = new Adder();\n let index = -1;\n return Float64Array.from(values, valueof === undefined\n ? v => adder.add(+v || 0)\n : v => adder.add(+valueof(v, ++index, values) || 0)\n );\n}\n","export var epsilon = 1e-6;\nexport var epsilon2 = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var quarterPi = pi / 4;\nexport var tau = pi * 2;\n\nexport var degrees = 180 / pi;\nexport var radians = pi / 180;\n\nexport var abs = Math.abs;\nexport var atan = Math.atan;\nexport var atan2 = Math.atan2;\nexport var cos = Math.cos;\nexport var ceil = Math.ceil;\nexport var exp = Math.exp;\nexport var floor = Math.floor;\nexport var hypot = Math.hypot;\nexport var log = Math.log;\nexport var pow = Math.pow;\nexport var sin = Math.sin;\nexport var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };\nexport var sqrt = Math.sqrt;\nexport var tan = Math.tan;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x > 1 ? halfPi : x < -1 ? -halfPi : Math.asin(x);\n}\n\nexport function haversin(x) {\n return (x = sin(x / 2)) * x;\n}\n","export default function noop() {}\n","function streamGeometry(geometry, stream) {\n if (geometry && streamGeometryType.hasOwnProperty(geometry.type)) {\n streamGeometryType[geometry.type](geometry, stream);\n }\n}\n\nvar streamObjectType = {\n Feature: function(object, stream) {\n streamGeometry(object.geometry, stream);\n },\n FeatureCollection: function(object, stream) {\n var features = object.features, i = -1, n = features.length;\n while (++i < n) streamGeometry(features[i].geometry, stream);\n }\n};\n\nvar streamGeometryType = {\n Sphere: function(object, stream) {\n stream.sphere();\n },\n Point: function(object, stream) {\n object = object.coordinates;\n stream.point(object[0], object[1], object[2]);\n },\n MultiPoint: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) object = coordinates[i], stream.point(object[0], object[1], object[2]);\n },\n LineString: function(object, stream) {\n streamLine(object.coordinates, stream, 0);\n },\n MultiLineString: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamLine(coordinates[i], stream, 0);\n },\n Polygon: function(object, stream) {\n streamPolygon(object.coordinates, stream);\n },\n MultiPolygon: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamPolygon(coordinates[i], stream);\n },\n GeometryCollection: function(object, stream) {\n var geometries = object.geometries, i = -1, n = geometries.length;\n while (++i < n) streamGeometry(geometries[i], stream);\n }\n};\n\nfunction streamLine(coordinates, stream, closed) {\n var i = -1, n = coordinates.length - closed, coordinate;\n stream.lineStart();\n while (++i < n) coordinate = coordinates[i], stream.point(coordinate[0], coordinate[1], coordinate[2]);\n stream.lineEnd();\n}\n\nfunction streamPolygon(coordinates, stream) {\n var i = -1, n = coordinates.length;\n stream.polygonStart();\n while (++i < n) streamLine(coordinates[i], stream, 1);\n stream.polygonEnd();\n}\n\nexport default function(object, stream) {\n if (object && streamObjectType.hasOwnProperty(object.type)) {\n streamObjectType[object.type](object, stream);\n } else {\n streamGeometry(object, stream);\n }\n}\n","import {Adder} from \"d3-array\";\nimport {atan2, cos, quarterPi, radians, sin, tau} from \"./math.js\";\nimport noop from \"./noop.js\";\nimport stream from \"./stream.js\";\n\nexport var areaRingSum = new Adder();\n\n// hello?\n\nvar areaSum = new Adder(),\n lambda00,\n phi00,\n lambda0,\n cosPhi0,\n sinPhi0;\n\nexport var areaStream = {\n point: noop,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: function() {\n areaRingSum = new Adder();\n areaStream.lineStart = areaRingStart;\n areaStream.lineEnd = areaRingEnd;\n },\n polygonEnd: function() {\n var areaRing = +areaRingSum;\n areaSum.add(areaRing < 0 ? tau + areaRing : areaRing);\n this.lineStart = this.lineEnd = this.point = noop;\n },\n sphere: function() {\n areaSum.add(tau);\n }\n};\n\nfunction areaRingStart() {\n areaStream.point = areaPointFirst;\n}\n\nfunction areaRingEnd() {\n areaPoint(lambda00, phi00);\n}\n\nfunction areaPointFirst(lambda, phi) {\n areaStream.point = areaPoint;\n lambda00 = lambda, phi00 = phi;\n lambda *= radians, phi *= radians;\n lambda0 = lambda, cosPhi0 = cos(phi = phi / 2 + quarterPi), sinPhi0 = sin(phi);\n}\n\nfunction areaPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n phi = phi / 2 + quarterPi; // half the angular distance from south pole\n\n // Spherical excess E for a spherical triangle with vertices: south pole,\n // previous point, current point. Uses a formula derived from Cagnoli’s\n // theorem. See Todhunter, Spherical Trig. (1871), Sec. 103, Eq. (2).\n var dLambda = lambda - lambda0,\n sdLambda = dLambda >= 0 ? 1 : -1,\n adLambda = sdLambda * dLambda,\n cosPhi = cos(phi),\n sinPhi = sin(phi),\n k = sinPhi0 * sinPhi,\n u = cosPhi0 * cosPhi + k * cos(adLambda),\n v = k * sdLambda * sin(adLambda);\n areaRingSum.add(atan2(v, u));\n\n // Advance the previous points.\n lambda0 = lambda, cosPhi0 = cosPhi, sinPhi0 = sinPhi;\n}\n\nexport default function(object) {\n areaSum = new Adder();\n stream(object, areaStream);\n return areaSum * 2;\n}\n","import {Adder} from \"d3-array\";\nimport {areaStream, areaRingSum} from \"./area.js\";\nimport {cartesian, cartesianCross, cartesianNormalizeInPlace, spherical} from \"./cartesian.js\";\nimport {abs, degrees, epsilon, radians} from \"./math.js\";\nimport stream from \"./stream.js\";\n\nvar lambda0, phi0, lambda1, phi1, // bounds\n lambda2, // previous lambda-coordinate\n lambda00, phi00, // first point\n p0, // previous 3D point\n deltaSum,\n ranges,\n range;\n\nvar boundsStream = {\n point: boundsPoint,\n lineStart: boundsLineStart,\n lineEnd: boundsLineEnd,\n polygonStart: function() {\n boundsStream.point = boundsRingPoint;\n boundsStream.lineStart = boundsRingStart;\n boundsStream.lineEnd = boundsRingEnd;\n deltaSum = new Adder();\n areaStream.polygonStart();\n },\n polygonEnd: function() {\n areaStream.polygonEnd();\n boundsStream.point = boundsPoint;\n boundsStream.lineStart = boundsLineStart;\n boundsStream.lineEnd = boundsLineEnd;\n if (areaRingSum < 0) lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90);\n else if (deltaSum > epsilon) phi1 = 90;\n else if (deltaSum < -epsilon) phi0 = -90;\n range[0] = lambda0, range[1] = lambda1;\n },\n sphere: function() {\n lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90);\n }\n};\n\nfunction boundsPoint(lambda, phi) {\n ranges.push(range = [lambda0 = lambda, lambda1 = lambda]);\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n}\n\nfunction linePoint(lambda, phi) {\n var p = cartesian([lambda * radians, phi * radians]);\n if (p0) {\n var normal = cartesianCross(p0, p),\n equatorial = [normal[1], -normal[0], 0],\n inflection = cartesianCross(equatorial, normal);\n cartesianNormalizeInPlace(inflection);\n inflection = spherical(inflection);\n var delta = lambda - lambda2,\n sign = delta > 0 ? 1 : -1,\n lambdai = inflection[0] * degrees * sign,\n phii,\n antimeridian = abs(delta) > 180;\n if (antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) {\n phii = inflection[1] * degrees;\n if (phii > phi1) phi1 = phii;\n } else if (lambdai = (lambdai + 360) % 360 - 180, antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) {\n phii = -inflection[1] * degrees;\n if (phii < phi0) phi0 = phii;\n } else {\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n }\n if (antimeridian) {\n if (lambda < lambda2) {\n if (angle(lambda0, lambda) > angle(lambda0, lambda1)) lambda1 = lambda;\n } else {\n if (angle(lambda, lambda1) > angle(lambda0, lambda1)) lambda0 = lambda;\n }\n } else {\n if (lambda1 >= lambda0) {\n if (lambda < lambda0) lambda0 = lambda;\n if (lambda > lambda1) lambda1 = lambda;\n } else {\n if (lambda > lambda2) {\n if (angle(lambda0, lambda) > angle(lambda0, lambda1)) lambda1 = lambda;\n } else {\n if (angle(lambda, lambda1) > angle(lambda0, lambda1)) lambda0 = lambda;\n }\n }\n }\n } else {\n ranges.push(range = [lambda0 = lambda, lambda1 = lambda]);\n }\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n p0 = p, lambda2 = lambda;\n}\n\nfunction boundsLineStart() {\n boundsStream.point = linePoint;\n}\n\nfunction boundsLineEnd() {\n range[0] = lambda0, range[1] = lambda1;\n boundsStream.point = boundsPoint;\n p0 = null;\n}\n\nfunction boundsRingPoint(lambda, phi) {\n if (p0) {\n var delta = lambda - lambda2;\n deltaSum.add(abs(delta) > 180 ? delta + (delta > 0 ? 360 : -360) : delta);\n } else {\n lambda00 = lambda, phi00 = phi;\n }\n areaStream.point(lambda, phi);\n linePoint(lambda, phi);\n}\n\nfunction boundsRingStart() {\n areaStream.lineStart();\n}\n\nfunction boundsRingEnd() {\n boundsRingPoint(lambda00, phi00);\n areaStream.lineEnd();\n if (abs(deltaSum) > epsilon) lambda0 = -(lambda1 = 180);\n range[0] = lambda0, range[1] = lambda1;\n p0 = null;\n}\n\n// Finds the left-right distance between two longitudes.\n// This is almost the same as (lambda1 - lambda0 + 360°) % 360°, except that we want\n// the distance between ±180° to be 360°.\nfunction angle(lambda0, lambda1) {\n return (lambda1 -= lambda0) < 0 ? lambda1 + 360 : lambda1;\n}\n\nfunction rangeCompare(a, b) {\n return a[0] - b[0];\n}\n\nfunction rangeContains(range, x) {\n return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x;\n}\n\nexport default function(feature) {\n var i, n, a, b, merged, deltaMax, delta;\n\n phi1 = lambda1 = -(lambda0 = phi0 = Infinity);\n ranges = [];\n stream(feature, boundsStream);\n\n // First, sort ranges by their minimum longitudes.\n if (n = ranges.length) {\n ranges.sort(rangeCompare);\n\n // Then, merge any ranges that overlap.\n for (i = 1, a = ranges[0], merged = [a]; i < n; ++i) {\n b = ranges[i];\n if (rangeContains(a, b[0]) || rangeContains(a, b[1])) {\n if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1];\n if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0];\n } else {\n merged.push(a = b);\n }\n }\n\n // Finally, find the largest gap between the merged ranges.\n // The final bounding box will be the inverse of this gap.\n for (deltaMax = -Infinity, n = merged.length - 1, i = 0, a = merged[n]; i <= n; a = b, ++i) {\n b = merged[i];\n if ((delta = angle(a[1], b[0])) > deltaMax) deltaMax = delta, lambda0 = b[0], lambda1 = a[1];\n }\n }\n\n ranges = range = null;\n\n return lambda0 === Infinity || phi0 === Infinity\n ? [[NaN, NaN], [NaN, NaN]]\n : [[lambda0, phi0], [lambda1, phi1]];\n}\n","import {asin, atan2, cos, sin, sqrt} from \"./math.js\";\n\nexport function spherical(cartesian) {\n return [atan2(cartesian[1], cartesian[0]), asin(cartesian[2])];\n}\n\nexport function cartesian(spherical) {\n var lambda = spherical[0], phi = spherical[1], cosPhi = cos(phi);\n return [cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi)];\n}\n\nexport function cartesianDot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n\nexport function cartesianCross(a, b) {\n return [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]];\n}\n\n// TODO return a\nexport function cartesianAddInPlace(a, b) {\n a[0] += b[0], a[1] += b[1], a[2] += b[2];\n}\n\nexport function cartesianScale(vector, k) {\n return [vector[0] * k, vector[1] * k, vector[2] * k];\n}\n\n// TODO return d\nexport function cartesianNormalizeInPlace(d) {\n var l = sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);\n d[0] /= l, d[1] /= l, d[2] /= l;\n}\n","/**\r\n * Map series module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Series, SeriesDataItem } from \"../series/Series\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as d3geo from \"d3-geo\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a [[DataItem]] for [[MapSeries]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nvar MapSeriesDataItem = /** @class */ (function (_super) {\r\n __extends(MapSeriesDataItem, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapSeriesDataItem() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"MapSeriesDataItem\";\r\n _this.values.value = {};\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(MapSeriesDataItem.prototype, \"value\", {\r\n /**\r\n * @return Value\r\n */\r\n get: function () {\r\n return this.values.value.value;\r\n },\r\n /**\r\n * Numeric value of the data item.\r\n *\r\n * Value may be used in heat-map calculations.\r\n *\r\n * @param value Value\r\n */\r\n set: function (value) {\r\n this.setValue(\"value\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapSeriesDataItem.prototype, \"zoomLevel\", {\r\n /**\r\n * @return Zoom level\r\n */\r\n get: function () {\r\n return this.properties[\"zoomLevel\"];\r\n },\r\n /**\r\n * When `zoomToMapObject()` is called the map will either calculate suitable\r\n * zoom level itself or use object's `zoomLevel` if set.\r\n *\r\n * @param value Zoom level\r\n */\r\n set: function (value) {\r\n this.setProperty(\"zoomLevel\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapSeriesDataItem.prototype, \"zoomGeoPoint\", {\r\n /**\r\n * @return Zoom geo point\r\n */\r\n get: function () {\r\n return this.properties[\"zoomGeoPoint\"];\r\n },\r\n /**\r\n * When `zoomToMapObject()` is called the map will either calculate suitable\r\n * center position itself or use object's `zoomGeoPoint` if set.\r\n *\r\n * @param value Zoom geo point\r\n */\r\n set: function (value) {\r\n this.setProperty(\"zoomGeoPoint\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapSeriesDataItem.prototype, \"east\", {\r\n /**\r\n * Longitude of the East-most point of the element.\r\n */\r\n get: function () {\r\n return this._east;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapSeriesDataItem.prototype, \"west\", {\r\n /**\r\n * Longitude of the West-most point of the element.\r\n */\r\n get: function () {\r\n return this._west;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapSeriesDataItem.prototype, \"south\", {\r\n /**\r\n * Latitude of the South-most point of the element.\r\n */\r\n get: function () {\r\n return this._south;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapSeriesDataItem.prototype, \"north\", {\r\n /**\r\n * Latitude of the North-most point of the element.\r\n */\r\n get: function () {\r\n return this._north;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Updates the item's bounding coordinates: coordinates of the East, West,\r\n * North, and South-most points.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapSeriesDataItem.prototype.updateExtremes = function () {\r\n var geometry = this.getFeature().geometry;\r\n if (geometry) {\r\n var bounds = d3geo.geoBounds(geometry);\r\n var west = bounds[0][0];\r\n var south = bounds[0][1];\r\n var north = bounds[1][1];\r\n var east = bounds[1][0];\r\n var changed = false;\r\n if (north != this.north) {\r\n this._north = $math.round(north, 6);\r\n changed = true;\r\n }\r\n if (south != this.south) {\r\n this._south = $math.round(south, 6);\r\n changed = true;\r\n }\r\n if (east != this.east) {\r\n this._east = $math.round(east, 6);\r\n changed = true;\r\n }\r\n if (west != this.west) {\r\n this._west = $math.round(west, 6);\r\n changed = true;\r\n }\r\n // solves single russia prob\r\n if (this._east < this._west) {\r\n this._east = 180;\r\n this._west = -180;\r\n }\r\n if (changed) {\r\n this.component.invalidateDataItems();\r\n }\r\n }\r\n };\r\n MapSeriesDataItem.prototype.getFeature = function () {\r\n return {};\r\n };\r\n return MapSeriesDataItem;\r\n}(SeriesDataItem));\r\nexport { MapSeriesDataItem };\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A base class for series of map objects.\r\n *\r\n * @see {@link IMapSeriesEvents} for a list of available Events\r\n * @see {@link IMapSeriesAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar MapSeries = /** @class */ (function (_super) {\r\n __extends(MapSeries, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapSeries() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"MapSeries\";\r\n // Set defaults\r\n _this.isMeasured = false;\r\n _this.nonScalingStroke = true;\r\n // Set data fields\r\n _this.dataFields.value = \"value\";\r\n _this.ignoreBounds = false;\r\n if (_this.tooltip) {\r\n _this.tooltip.showInViewport = true;\r\n }\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Returns a new/empty DataItem of the type appropriate for this object.\r\n *\r\n * @see {@link DataItem}\r\n * @return Data Item\r\n */\r\n MapSeries.prototype.createDataItem = function () {\r\n return new MapSeriesDataItem();\r\n };\r\n /**\r\n * Checks whether object should be included in series.\r\n *\r\n * @param includes A list of explicitly included ids\r\n * @param excludes A list of explicitly excluded ids\r\n * @param id Id of the object\r\n * @return Include?\r\n */\r\n MapSeries.prototype.checkInclude = function (includes, excludes, id) {\r\n if (includes) {\r\n if (includes.length == 0) {\r\n return false;\r\n }\r\n else {\r\n if (includes.indexOf(id) == -1) {\r\n return false;\r\n }\r\n }\r\n }\r\n if (excludes && excludes.length > 0) {\r\n if (excludes.indexOf(id) != -1) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n Object.defineProperty(MapSeries.prototype, \"useGeodata\", {\r\n /**\r\n * @return Use GeoJSON data?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"useGeodata\");\r\n },\r\n /**\r\n * Should the map extract all the data about element from the GeoJSON?\r\n *\r\n * This is especially relevant for [[MapPolygonSeries]]. If not set to `true`\r\n * polygon series will need to contain geographical data in itself in order\r\n * to be drawn.\r\n *\r\n * If this is set to `true`, series will try to extract data for its objects\r\n * from either chart-level `geodata` or from series' `geodata` which holds\r\n * map infor in GeoJSON format.\r\n *\r\n * @default false\r\n * @param value Use GeoJSON data?\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"useGeodata\", value)) {\r\n this.invalidateData();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapSeries.prototype, \"include\", {\r\n /**\r\n * @return Included objects\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"include\");\r\n },\r\n /**\r\n * A list of object ids that should be explictly included in the series.\r\n *\r\n * If this is not set, the series will automatically include all of the\r\n * objects, available in the GeoJSON map. (minus the ones listed in\r\n * `exclude`)\r\n *\r\n * If you need to display only specific objects, use `include`. E.g.:\r\n *\r\n * `include = [\"FR\", \"ES\", \"DE\"];`\r\n *\r\n * The above will show only France, Spain, and Germany out of the whole map.\r\n *\r\n * @param value Included objects\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"include\", value)) {\r\n this.processIncExc();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n MapSeries.prototype.processIncExc = function () {\r\n //this.data = [];\r\n this.invalidateData();\r\n };\r\n Object.defineProperty(MapSeries.prototype, \"ignoreBounds\", {\r\n /**\r\n * @return Ignore bounds?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"ignoreBounds\");\r\n },\r\n /**\r\n * Should this series be included when calculating bounds of the map?\r\n *\r\n * This affects initial zoom as well as limits for zoom/pan.\r\n *\r\n * By default, `MapPolygonSeries` included (true), while `MapImageSeries` and\r\n * `MapLineSeries` are not (`false`).\r\n *\r\n * @since 4.3.0\r\n * @param value Ignore bounds?\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"ignoreBounds\", value)) {\r\n if (this.chart) {\r\n this.chart.updateExtremes();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapSeries.prototype, \"exclude\", {\r\n /**\r\n * @return Excluded ids\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"exclude\");\r\n },\r\n /**\r\n * A list of object ids that should be excluded from the series.\r\n *\r\n * E.g. you want to include all of the areas from a GeoJSON map, except\r\n * Antarctica.\r\n *\r\n * You'd leave `include` empty, and set `exclude = [\"AQ\"]`.\r\n *\r\n * @param value Excluded ids\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"exclude\", value)) {\r\n this.processIncExc();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Decorates a newly added object.\r\n *\r\n * @param event [description]\r\n */\r\n MapSeries.prototype.handleObjectAdded = function (event) {\r\n var mapObject = event.newValue;\r\n mapObject.parent = this;\r\n mapObject.series = this;\r\n mapObject.strokeWidth = mapObject.strokeWidth;\r\n };\r\n Object.defineProperty(MapSeries.prototype, \"geodata\", {\r\n /**\r\n * @return GeoJSON data\r\n */\r\n get: function () {\r\n return this._geodata;\r\n },\r\n /**\r\n * Map data in GeoJSON format.\r\n *\r\n * The series supports the following GeoJSON objects: `Point`, `LineString`,\r\n * `Polygon`, `MultiPoint`, `MultiLineString`, and `MultiPolygon`.\r\n *\r\n * @see {@link http://geojson.org/} Official GeoJSON format specification\r\n * @param geoJSON GeoJSON data\r\n */\r\n set: function (geodata) {\r\n if (geodata != this._geodata) {\r\n this._geodata = geodata;\r\n if (this.reverseGeodata) {\r\n this.chart.processReverseGeodata(this._geodata);\r\n }\r\n for (var i = this.data.length - 1; i >= 0; i--) {\r\n if (this.data[i].madeFromGeoData == true) {\r\n this.data.splice(i, 1);\r\n }\r\n }\r\n this.disposeData();\r\n this.invalidateData();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapSeries.prototype, \"reverseGeodata\", {\r\n /**\r\n * @returns Reverse the order of geodata coordinates?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"reverseGeodata\");\r\n },\r\n /**\r\n * Indicates whether GeoJSON geodata supplied to the chart uses\r\n * ESRI (clockwise) or non-ESRI (counter-clockwise) order of the polygon\r\n * coordinates.\r\n *\r\n * `MapChart` supports only ESRI standard, so if your custom maps appears\r\n * garbled, try setting `reverseGeodata = true`.\r\n *\r\n * @default false\r\n * @since 4.10.11\r\n * @param value Reverse the order of geodata coordinates?\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"reverseGeodata\", value) && this._geodata) {\r\n this.chart.processReverseGeodata(this._geodata);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapSeries.prototype, \"geodataSource\", {\r\n /**\r\n * Returns a [[DataSource]] specifically for loading Component's data.\r\n *\r\n * @return Data source\r\n */\r\n get: function () {\r\n if (!this._dataSources[\"geodata\"]) {\r\n this.getDataSource(\"geodata\");\r\n }\r\n return this._dataSources[\"geodata\"];\r\n },\r\n /**\r\n * Sets a [[DataSource]] to be used for loading Component's data.\r\n *\r\n * @param value Data source\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n if (this._dataSources[\"geodata\"]) {\r\n this.removeDispose(this._dataSources[\"geodata\"]);\r\n }\r\n this._dataSources[\"geodata\"] = value;\r\n this._dataSources[\"geodata\"].component = this;\r\n this.events.on(\"inited\", function () {\r\n _this.loadData(\"geodata\");\r\n }, undefined, false);\r\n this.setDataSourceEvents(value, \"geodata\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n MapSeries.prototype.getFeatures = function () {\r\n return;\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapSeries.prototype.validateDataItems = function () {\r\n _super.prototype.validateDataItems.call(this);\r\n this.updateExtremes();\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapSeries.prototype.updateExtremes = function () {\r\n var north;\r\n var south;\r\n var east;\r\n var west;\r\n this.dataItems.each(function (dataItem) {\r\n if (dataItem.north > north || !$type.isNumber(north)) {\r\n north = dataItem.north;\r\n }\r\n if (dataItem.south < south || !$type.isNumber(south)) {\r\n south = dataItem.south;\r\n }\r\n if (dataItem.west < west || !$type.isNumber(west)) {\r\n west = dataItem.west;\r\n }\r\n if (dataItem.east > east || !$type.isNumber(east)) {\r\n east = dataItem.east;\r\n }\r\n });\r\n if (this._mapObjects) {\r\n this._mapObjects.each(function (mapObject) {\r\n if (mapObject.north > north || !$type.isNumber(north)) {\r\n north = mapObject.north;\r\n }\r\n if (mapObject.south < south || !$type.isNumber(south)) {\r\n south = mapObject.south;\r\n }\r\n if (mapObject.west < west || !$type.isNumber(west)) {\r\n west = mapObject.west;\r\n }\r\n if (mapObject.east > east || !$type.isNumber(east)) {\r\n east = mapObject.east;\r\n }\r\n });\r\n }\r\n if (this.north != north || this.east != east || this.south != south || this.west != west) {\r\n this._north = north;\r\n this._east = east;\r\n this._west = west;\r\n this._south = south;\r\n this.dispatch(\"geoBoundsChanged\");\r\n if (!this.ignoreBounds) {\r\n this.chart.updateExtremes();\r\n }\r\n }\r\n };\r\n Object.defineProperty(MapSeries.prototype, \"north\", {\r\n /**\r\n * @return Latitude\r\n */\r\n get: function () {\r\n if ($type.isNumber(this._northDefined)) {\r\n return this._northDefined;\r\n }\r\n return this._north;\r\n },\r\n /**\r\n * North-most latitude of the series.\r\n *\r\n * By default, this holds auto-calculated latitude of the extremity.\r\n *\r\n * It can be overridden manually.\r\n *\r\n * @param value Latitude\r\n */\r\n set: function (value) {\r\n this._northDefined = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapSeries.prototype, \"south\", {\r\n /**\r\n * @return Latitude\r\n */\r\n get: function () {\r\n if ($type.isNumber(this._southDefined)) {\r\n return this._southDefined;\r\n }\r\n return this._south;\r\n },\r\n /**\r\n * South-most latitude of the series.\r\n *\r\n * By default, this holds auto-calculated latitude of the extremity.\r\n *\r\n * It can be overridden manually.\r\n *\r\n * @param value Latitude\r\n */\r\n set: function (value) {\r\n this._southDefined = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapSeries.prototype, \"west\", {\r\n /**\r\n * @return Longitude\r\n */\r\n get: function () {\r\n if ($type.isNumber(this._westDefined)) {\r\n return this._westDefined;\r\n }\r\n return this._west;\r\n },\r\n /**\r\n * West-most longitude of the series.\r\n *\r\n * By default, this holds auto-calculated longitude of the extremity.\r\n *\r\n * It can be overridden manually.\r\n *\r\n * @param value Longitude\r\n */\r\n set: function (value) {\r\n this._westDefined = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapSeries.prototype, \"east\", {\r\n /**\r\n * @return Longitude\r\n */\r\n get: function () {\r\n if ($type.isNumber(this._eastDefined)) {\r\n return this._eastDefined;\r\n }\r\n return this._east;\r\n },\r\n /**\r\n * East-most longitude of the series.\r\n *\r\n * By default, this holds auto-calculated longitude of the extremity.\r\n *\r\n * It can be overridden manually.\r\n *\r\n * @param value Longitude\r\n */\r\n set: function (value) {\r\n this._eastDefined = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n MapSeries.prototype.processConfig = function (config) {\r\n if ($type.hasValue(config[\"geodata\"]) && $type.isString(config[\"geodata\"])) {\r\n var name_1 = config[\"geodata\"];\r\n // Check if there's a map loaded by such name\r\n if ($type.hasValue(window[\"am4geodata_\" + config[\"geodata\"]])) {\r\n config[\"geodata\"] = window[\"am4geodata_\" + config[\"geodata\"]];\r\n }\r\n // Nope. Let's try maybe we got JSON as string?\r\n else {\r\n try {\r\n config[\"geodata\"] = JSON.parse(config[\"geodata\"]);\r\n }\r\n catch (e) {\r\n // No go again. Error out.\r\n throw Error(\"MapChart error: Geodata `\" + name_1 + \"` is not loaded or is incorrect.\");\r\n }\r\n }\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n /**\r\n * Adds `projection` to \"as is\" fields.\r\n *\r\n * @param field Field name\r\n * @return Assign as is?\r\n */\r\n MapSeries.prototype.asIs = function (field) {\r\n return field == \"geodata\" || _super.prototype.asIs.call(this, field);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapSeries.prototype.updateTooltipBounds = function () {\r\n if (this.tooltip && this.topParent) {\r\n this.tooltip.setBounds({ x: 10, y: 10, width: this.topParent.maxWidth - 20, height: this.topParent.maxHeight - 20 });\r\n }\r\n };\r\n return MapSeries;\r\n}(Series));\r\nexport { MapSeries };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"MapSeries\"] = MapSeries;\r\nregistry.registeredClasses[\"MapSeriesDataItem\"] = MapSeriesDataItem;\r\n//# sourceMappingURL=MapSeries.js.map","/**\r\n * Map object module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../../core/Container\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as d3geo from \"d3-geo\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A base class for all map objects: lines, images, etc.\r\n *\r\n * @see {@link IMapObjectEvents} for a list of available events\r\n * @see {@link IMapObjectAdapters} for a list of available Adapters\r\n */\r\nvar MapObject = /** @class */ (function (_super) {\r\n __extends(MapObject, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapObject() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"MapObject\";\r\n // Set defaults\r\n _this.isMeasured = false;\r\n _this.layout = \"none\";\r\n _this.clickable = true;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * (Re)validates this object, forcing it to redraw.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapObject.prototype.validate = function () {\r\n if (this.series && this.series.itemReaderText) {\r\n this.readerTitle = this.series.itemReaderText;\r\n }\r\n _super.prototype.validate.call(this);\r\n };\r\n /**\r\n * Updates the item's bounding coordinates: coordinates of the East, West,\r\n * North, and South-most points.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapObject.prototype.updateExtremes = function () {\r\n var feature = this.getFeature();\r\n if (feature) {\r\n var geometry = feature.geometry;\r\n if (geometry) {\r\n var bounds = d3geo.geoBounds(geometry);\r\n var west = bounds[0][0];\r\n var south = bounds[0][1];\r\n var north = bounds[1][1];\r\n var east = bounds[1][0];\r\n var changed = false;\r\n if (north != this.north) {\r\n this._north = $math.round(north, 8);\r\n changed = true;\r\n }\r\n if (south != this.south) {\r\n this._south = $math.round(south);\r\n changed = true;\r\n }\r\n if (east != this.east) {\r\n this._east = $math.round(east);\r\n changed = true;\r\n }\r\n if (west != this.west) {\r\n this._west = $math.round(west);\r\n changed = true;\r\n }\r\n if (changed) {\r\n this.dispatch(\"geoBoundsChanged\");\r\n if (this.series) {\r\n this.series.invalidateDataItems();\r\n }\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapObject.prototype.getFeature = function () {\r\n return {};\r\n };\r\n Object.defineProperty(MapObject.prototype, \"east\", {\r\n /**\r\n * Longitude of the East-most point of the element.\r\n */\r\n get: function () {\r\n if ($type.isNumber(this._east)) {\r\n return this._east;\r\n }\r\n else if (this.dataItem) {\r\n return this.dataItem.east;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapObject.prototype, \"west\", {\r\n /**\r\n * Longitude of the West-most point of the element.\r\n */\r\n get: function () {\r\n if ($type.isNumber(this._west)) {\r\n return this._west;\r\n }\r\n else if (this.dataItem) {\r\n return this.dataItem.west;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapObject.prototype, \"south\", {\r\n /**\r\n * Latitude of the South-most point of the element.\r\n */\r\n get: function () {\r\n if ($type.isNumber(this._south)) {\r\n return this._south;\r\n }\r\n else if (this.dataItem) {\r\n return this.dataItem.south;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapObject.prototype, \"north\", {\r\n /**\r\n * Latitude of the North-most point of the element.\r\n */\r\n get: function () {\r\n if ($type.isNumber(this._north)) {\r\n return this._north;\r\n }\r\n else if (this.dataItem) {\r\n return this.dataItem.north;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Shows the element's [[Tooltip]].\r\n *\r\n * A tooltip will be populated using text templates in either `tooltipHTML` or\r\n * `tooltipText` as well as data in `tooltipDataItem`.\r\n *\r\n * @see {@link Tooltip}\r\n * @param optional point (sprite-related) to which tooltip must point.\r\n * @return returns true if the tooltip was shown and false if it wasn't (no text was found)\r\n */\r\n MapObject.prototype.showTooltip = function (point) {\r\n var res = _super.prototype.showTooltip.call(this, point);\r\n if (res && this.showTooltipOn == \"always\" && !this.series.chart.events.has(\"mappositionchanged\", this.handleTooltipMove, this)) {\r\n this.addDisposer(this.series.chart.events.on(\"mappositionchanged\", this.handleTooltipMove, this));\r\n }\r\n return res;\r\n };\r\n MapObject.prototype.handleTooltipMove = function (ev) {\r\n if (!this.tooltip.isHidden) {\r\n this.showTooltip();\r\n }\r\n };\r\n /**\r\n * Sets a [[DataItem]].\r\n * @param dataItem DataItem\r\n */\r\n MapObject.prototype.setDataItem = function (dataItem) {\r\n _super.prototype.setDataItem.call(this, dataItem);\r\n this.applyAccessibility();\r\n };\r\n return MapObject;\r\n}(Container));\r\nexport { MapObject };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"MapObject\"] = MapObject;\r\n//# sourceMappingURL=MapObject.js.map","/**\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { MapObject } from \"./MapObject\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Used to place an image on the map.\r\n *\r\n * @see {@link IMapImageEvents} for a list of available events\r\n * @see {@link IMapImageAdapters} for a list of available Adapters\r\n */\r\nvar MapImage = /** @class */ (function (_super) {\r\n __extends(MapImage, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapImage() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"MapImage\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(MapImage.prototype, \"latitude\", {\r\n /**\r\n * @return Latitude\r\n */\r\n get: function () {\r\n var latitude = this.getPropertyValue(\"latitude\");\r\n if (!$type.isNumber(latitude) && this.dataItem && this.dataItem.geoPoint) {\r\n latitude = this.dataItem.geoPoint.latitude;\r\n }\r\n return latitude;\r\n },\r\n /**\r\n * Latitude image is placed at.\r\n *\r\n * @param value Latitude\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"latitude\", value, false, true);\r\n this.updateExtremes();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapImage.prototype, \"longitude\", {\r\n /**\r\n * @return Longitude\r\n */\r\n get: function () {\r\n var longitude = this.getPropertyValue(\"longitude\");\r\n if (!$type.isNumber(longitude) && this.dataItem && this.dataItem.geoPoint) {\r\n longitude = this.dataItem.geoPoint.longitude;\r\n }\r\n return longitude;\r\n },\r\n /**\r\n * Longitude image is placed on.\r\n *\r\n * @param value Longitude\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"longitude\", value, false, true);\r\n this.updateExtremes();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Repositions the image to it's current position.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapImage.prototype.validatePosition = function () {\r\n if ($type.isNumber(this.latitude) && $type.isNumber(this.longitude)) {\r\n //this.moveTo(this.series.chart.projection.convert({ latitude: this.latitude, longitude: this.longitude }));\r\n var p = this.series.chart.projection.d3Projection([this.longitude, this.latitude]);\r\n var visible = this.series.chart.projection.d3Path({ type: 'Point', coordinates: [this.longitude, this.latitude] });\r\n if (!visible) {\r\n this.__disabled = true;\r\n }\r\n else {\r\n this.__disabled = false;\r\n }\r\n this.moveTo({ x: p[0], y: p[1] });\r\n }\r\n _super.prototype.validatePosition.call(this);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapImage.prototype.getFeature = function () {\r\n return { \"type\": \"Feature\", geometry: { type: \"Point\", coordinates: [this.longitude, this.latitude] } };\r\n };\r\n return MapImage;\r\n}(MapObject));\r\nexport { MapImage };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"MapImage\"] = MapImage;\r\n//# sourceMappingURL=MapImage.js.map","/**\r\n * A collection of Map-related utility functions.\r\n */\r\nimport * as $array from \"../../core/utils/Array\";\r\nimport * as d3geo from \"d3-geo\";\r\n/**\r\n * Converts a multi-part polygon in X/Y coordinates to a geo-multipolygon in\r\n * geo-points (lat/long).\r\n *\r\n * @param multiPolygon Source multi-polygon\r\n * @return Geo-multipolygon\r\n */\r\nexport function multiPolygonToGeo(multiPolygon) {\r\n return $array.map(multiPolygon, function (polygon) {\r\n var surface = polygon[0];\r\n var hole = polygon[1];\r\n //let holePoints: Array<IGeoPoint> = [];\r\n var geoArea = [];\r\n if (surface) {\r\n geoArea.push(multiPointToGeo(surface));\r\n }\r\n if (hole) {\r\n geoArea.push(multiPointToGeo(hole));\r\n }\r\n return geoArea;\r\n });\r\n}\r\n/**\r\n * Converts a multiline in X/Y coordinates to a geo-multiline in geo-points\r\n * (lat/long).\r\n *\r\n * @param multiLine Source multiline\r\n * @return Geo-multiline\r\n */\r\nexport function multiLineToGeo(multiLine) {\r\n return $array.map(multiLine, function (multiLine) {\r\n return multiPointToGeo(multiLine);\r\n });\r\n}\r\n/**\r\n * Converts multiple X/Y points into a lat/long geo-points.\r\n *\r\n * @param points Source points\r\n * @return Geo-points\r\n */\r\nexport function multiPointToGeo(points) {\r\n return $array.map(points, function (point) {\r\n return pointToGeo(point);\r\n });\r\n}\r\n/**\r\n * Converts multiple X/Y points into a lat/long geo-points.\r\n *\r\n * @param points Source points\r\n * @return Geo-points\r\n */\r\nexport function multiGeoToPoint(geoPoints) {\r\n return $array.map(geoPoints, geoToPoint);\r\n}\r\n/**\r\n * Converts X/Y point into a lat/long geo-point.\r\n *\r\n * @param point Source point\r\n * @return Geo-point\r\n */\r\nexport function pointToGeo(point) {\r\n return { longitude: point[0], latitude: point[1] };\r\n}\r\n/**\r\n * Converts lat/long geo-point into a X/Y point.\r\n *\r\n * @param point Source geo-point\r\n * @return X/Y point\r\n */\r\nexport function geoToPoint(geoPoint) {\r\n return [geoPoint.longitude, geoPoint.latitude];\r\n}\r\n/**\r\n * Converts geo line (collection of lat/long coordinates) to screen line (x/y).\r\n *\r\n * @param multiGeoLine Source geo line\r\n * @return Screen line\r\n */\r\nexport function multiGeoLineToMultiLine(multiGeoLine) {\r\n return $array.map(multiGeoLine, function (segment) {\r\n return $array.map(segment, geoToPoint);\r\n });\r\n}\r\n/**\r\n * Converts a geo polygon (collection of lat/long coordinates) to screen\r\n * polygon (x/y).\r\n *\r\n * @param multiGeoPolygon Source polygon\r\n * @return Screen polygon\r\n */\r\nexport function multiGeoPolygonToMultipolygon(multiGeoPolygon) {\r\n return $array.map(multiGeoPolygon, function (geoPolygon) {\r\n var surface = geoPolygon[0];\r\n var hole = geoPolygon[1];\r\n var multiPolygon = [];\r\n if (surface) {\r\n multiPolygon.push(multiGeoToPoint(surface));\r\n }\r\n if (hole) {\r\n multiPolygon.push(multiGeoToPoint(hole));\r\n }\r\n return multiPolygon;\r\n });\r\n}\r\n/**\r\n * Returns a set of geographical coordinates for the circle with a center\r\n * at specific lat/long coordinates and radius (in degrees).\r\n *\r\n * @since 4.3.0\r\n * @param longitude Center longitude\r\n * @param latitude Center latitude\r\n * @param radius Radius (degrees)\r\n * @return Circle coordinates\r\n */\r\nexport function getCircle(longitude, latitude, radius) {\r\n return [d3geo.geoCircle().center([longitude, latitude]).radius(radius)().coordinates];\r\n}\r\n/**\r\n * Returns a set of screen coordinates that represents a \"background\" area\r\n * between provided extremities.\r\n *\r\n * @since 4.3.0\r\n * @param north North latitude\r\n * @param east East longitude\r\n * @param south South latitude\r\n * @param west West longitude\r\n * @return Polygon\r\n */\r\nexport function getBackground(north, east, south, west) {\r\n var multiPolygon = [];\r\n if (west == -180) {\r\n west = -179.9999;\r\n }\r\n if (south == -90) {\r\n south = -89.9999;\r\n }\r\n if (north == 90) {\r\n north = 89.9999;\r\n }\r\n if (east == 180) {\r\n east = 179.9999;\r\n }\r\n var stepLong = Math.min(90, (east - west) / Math.ceil((east - west) / 90));\r\n var stepLat = (north - south) / Math.ceil((north - south) / 90);\r\n for (var ln = west; ln < east; ln = ln + stepLong) {\r\n var surface = [];\r\n multiPolygon.push([surface]);\r\n if (ln + stepLong > east) {\r\n stepLong = east - ln;\r\n }\r\n for (var ll = ln; ll <= ln + stepLong; ll = ll + 5) {\r\n surface.push([ll, north]);\r\n }\r\n for (var lt = north; lt >= south; lt = lt - stepLat) {\r\n surface.push([ln + stepLong, lt]);\r\n }\r\n for (var ll = ln + stepLong; ll >= ln; ll = ll - 5) {\r\n surface.push([ll, south]);\r\n }\r\n for (var lt = south; lt <= north; lt = lt + stepLat) {\r\n surface.push([ln, lt]);\r\n }\r\n }\r\n return multiPolygon;\r\n}\r\n//# sourceMappingURL=MapUtils.js.map","/**\r\n * Map polygon module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { MapObject } from \"./MapObject\";\r\nimport { Polygon } from \"../../core/elements/Polygon\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport $polylabel from \"polylabel\";\r\nimport * as $mapUtils from \"./MapUtils\";\r\nimport * as d3geo from \"d3-geo\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Used to draw a polygon on the map.\r\n *\r\n * @see {@link IMapPolygonEvents} for a list of available events\r\n * @see {@link IMapPolygonAdapters} for a list of available Adapters\r\n */\r\nvar MapPolygon = /** @class */ (function (_super) {\r\n __extends(MapPolygon, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapPolygon() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"MapPolygon\";\r\n _this.polygon = _this.createChild(Polygon);\r\n _this.polygon.shouldClone = false;\r\n _this.polygon.applyOnClones = true;\r\n _this.setPropertyValue(\"precision\", 0.5);\r\n var interfaceColors = new InterfaceColorSet();\r\n _this.fill = interfaceColors.getFor(\"secondaryButton\");\r\n _this.stroke = interfaceColors.getFor(\"secondaryButtonStroke\");\r\n _this.strokeOpacity = 1;\r\n _this.tooltipPosition = \"pointer\";\r\n _this.nonScalingStroke = true;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * @ignore\r\n */\r\n MapPolygon.prototype.getFeature = function () {\r\n if (this.multiPolygon && this.multiPolygon.length > 0) {\r\n return { \"type\": \"Feature\", geometry: { type: \"MultiPolygon\", coordinates: this.multiPolygon } };\r\n }\r\n };\r\n Object.defineProperty(MapPolygon.prototype, \"multiGeoPolygon\", {\r\n /**\r\n * @return Polygon coordinates\r\n */\r\n get: function () {\r\n var multiGeoPolygon = this.getPropertyValue(\"multiGeoPolygon\");\r\n if (!multiGeoPolygon && this.dataItem) {\r\n multiGeoPolygon = this.dataItem.multiGeoPolygon;\r\n }\r\n return multiGeoPolygon;\r\n },\r\n /**\r\n * Set of coordinates for the polygon.\r\n *\r\n * @param multiGeoPolygon Polygon coordinates\r\n */\r\n set: function (multiGeoPolygon) {\r\n this.setPropertyValue(\"multiGeoPolygon\", multiGeoPolygon, true);\r\n this.multiPolygon = $mapUtils.multiGeoPolygonToMultipolygon(multiGeoPolygon);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapPolygon.prototype, \"multiPolygon\", {\r\n /**\r\n * @return Coordinates\r\n */\r\n get: function () {\r\n var multiPolygon = this.getPropertyValue(\"multiPolygon\");\r\n if (!multiPolygon && this.dataItem) {\r\n multiPolygon = this.dataItem.multiPolygon;\r\n }\r\n return multiPolygon;\r\n },\r\n /**\r\n * A collection of X/Y coordinates for a multi-part polygon. E.g.:\r\n *\r\n * ```JSON\r\n * [\r\n * // Part 1\r\n * [\r\n * [\r\n * [ 100, 150 ],\r\n * [ 120, 200 ],\r\n * [ 150, 220 ],\r\n * [ 170, 240 ],\r\n * [ 100, 150 ]\r\n * ]\r\n * ],\r\n *\r\n * // Part 2\r\n * [\r\n * [\r\n * [ 300, 350 ],\r\n * [ 320, 400 ],\r\n * [ 350, 420 ],\r\n * [ 370, 440 ],\r\n * [ 300, 350 ]\r\n * ]\r\n * ]\r\n * ]\r\n * ```\r\n *\r\n * @param multiPolygon Coordinates\r\n */\r\n set: function (multiPolygon) {\r\n if (this.setPropertyValue(\"multiPolygon\", multiPolygon)) {\r\n this.updateExtremes();\r\n this.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * (Re)validates the polygon, effectively redrawing it.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapPolygon.prototype.validate = function () {\r\n if (this.series) {\r\n var projection = this.series.chart.projection;\r\n var pathGenerator = projection.d3Path;\r\n if (this.multiPolygon) {\r\n if (this.series) {\r\n var feature = { type: \"MultiPolygon\", coordinates: this.multiPolygon };\r\n projection.d3Projection.precision(this.precision);\r\n this.polygon.path = pathGenerator(feature);\r\n }\r\n if (this.series.calculateVisualCenter) {\r\n var biggestArea = 0;\r\n var biggestPolygon = this.multiPolygon[0];\r\n if (this.multiPolygon.length > 1) {\r\n for (var i = 0; i < this.multiPolygon.length; i++) {\r\n var polygon = this.multiPolygon[i];\r\n var area = d3geo.geoArea({ type: \"Polygon\", coordinates: polygon });\r\n if (area > biggestArea) {\r\n biggestPolygon = polygon;\r\n biggestArea = area;\r\n }\r\n }\r\n }\r\n var center = $polylabel(biggestPolygon);\r\n this._visualLongitude = center[0];\r\n this._visualLatitude = center[1];\r\n }\r\n else {\r\n this._visualLongitude = this.longitude;\r\n this._visualLatitude = this.latitude;\r\n }\r\n }\r\n }\r\n _super.prototype.validate.call(this);\r\n };\r\n /**\r\n * @ignore Exclude from docs\r\n */\r\n MapPolygon.prototype.measureElement = function () {\r\n // Overriding, just to avoid extra measure\r\n };\r\n Object.defineProperty(MapPolygon.prototype, \"latitude\", {\r\n /**\r\n * Latitude of the geometrical center of the polygon.\r\n *\r\n * @readonly\r\n * @return Center latitude\r\n */\r\n get: function () {\r\n return this.north + (this.south - this.north) / 2;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapPolygon.prototype, \"longitude\", {\r\n /**\r\n * Longitude of the geometrical center of the polygon.\r\n *\r\n * @readonly\r\n * @return Center longitude\r\n */\r\n get: function () {\r\n return this.east + (this.west - this.east) / 2;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapPolygon.prototype, \"visualLatitude\", {\r\n /**\r\n * @return Latitude\r\n */\r\n get: function () {\r\n var latitude = this.getPropertyValue(\"visualLatitude\");\r\n if ($type.isNumber(latitude)) {\r\n return (latitude);\r\n }\r\n if (!this._adapterO) {\r\n return this._visualLatitude;\r\n }\r\n else {\r\n return this._adapterO.apply(\"visualLatitude\", this._visualLatitude);\r\n }\r\n },\r\n /**\r\n * Latitude of the visual center of the polygon.\r\n *\r\n * It may (and probably won't) coincide with geometrical center.\r\n *\r\n * @since 4.3.0\r\n * @param value Latitude\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"visualLatitude\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapPolygon.prototype, \"visualLongitude\", {\r\n /**\r\n * @return Longitude\r\n */\r\n get: function () {\r\n var longitude = this.getPropertyValue(\"visualLongitude\");\r\n if ($type.isNumber(longitude)) {\r\n return (longitude);\r\n }\r\n if (!this._adapterO) {\r\n return this._visualLongitude;\r\n }\r\n else {\r\n return this._adapterO.apply(\"visualLongitude\", this._visualLongitude);\r\n }\r\n },\r\n /**\r\n * Longitude of the visual center of the polygon.\r\n *\r\n * It may (and probably won't) coincide with geometrical center.\r\n *\r\n * @since 4.3.0\r\n * @param value Longitude\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"visualLongitude\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapPolygon.prototype, \"pixelWidth\", {\r\n /**\r\n * Not 100% sure about this, as if we add something to MapPolygon this\r\n * won't be true, but otherwise we will get all 0 and the tooltip won't\r\n * be positioned properly\r\n * @hidden\r\n */\r\n /**\r\n * Element's width in pixels.\r\n *\r\n * @readonly\r\n * @return Width (px)\r\n */\r\n get: function () {\r\n return this.polygon.pixelWidth;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapPolygon.prototype, \"pixelHeight\", {\r\n /**\r\n * Element's height in pixels.\r\n *\r\n * @readonly\r\n * @return Width (px)\r\n */\r\n get: function () {\r\n return this.polygon.pixelHeight;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies all properties from another instance of [[MapPolygon]].\r\n *\r\n * @param source Source series\r\n */\r\n MapPolygon.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.polygon.copyFrom(source.polygon);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapPolygon.prototype.updateExtremes = function () {\r\n _super.prototype.updateExtremes.call(this);\r\n };\r\n Object.defineProperty(MapPolygon.prototype, \"boxArea\", {\r\n /**\r\n * @ignore\r\n * used to sorth polygons from big to small\r\n */\r\n get: function () {\r\n return (this.north - this.south) * (this.east - this.west);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * X coordinate for the slice tooltip.\r\n *\r\n * @ignore\r\n * @return X\r\n */\r\n MapPolygon.prototype.getTooltipX = function () {\r\n return this.series.chart.projection.convert({ longitude: this.visualLongitude, latitude: this.visualLatitude }).x;\r\n };\r\n /**\r\n * Y coordinate for the slice tooltip.\r\n *\r\n * @ignore\r\n * @return Y\r\n */\r\n MapPolygon.prototype.getTooltipY = function () {\r\n return this.series.chart.projection.convert({ longitude: this.visualLongitude, latitude: this.visualLatitude }).y;\r\n };\r\n Object.defineProperty(MapPolygon.prototype, \"precision\", {\r\n get: function () {\r\n return this.getPropertyValue(\"precision\");\r\n },\r\n /**\r\n * When polygon's sides are plotted, they are bent according to the used\r\n * projection.\r\n *\r\n * `precision` introduces a setting which can control when such bending\r\n * occurs.\r\n *\r\n * If the distance (in degrees) between two points of polygon's side is less\r\n * than `precision`, no bending will take place and the line will be straight.\r\n *\r\n * Set to large number (e.g. 10000) for perfectly straight lines on all\r\n * polygon's sides.\r\n *\r\n * @since 4.9.1\r\n * @default 0.5\r\n * @param value Precision\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"precision\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return MapPolygon;\r\n}(MapObject));\r\nexport { MapPolygon };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"MapPolygon\"] = MapPolygon;\r\n//# sourceMappingURL=MapPolygon.js.map","/**\r\n * Map polygon series module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { MapSeries, MapSeriesDataItem } from \"./MapSeries\";\r\nimport { MapPolygon } from \"./MapPolygon\";\r\nimport { ListTemplate, ListDisposer } from \"../../core/utils/List\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $mapUtils from \"./MapUtils\";\r\nimport * as $array from \"../../core/utils/Array\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport { Disposer } from \"../../core/utils/Disposer\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a [[DataItem]] for [[MapPolygonSeries]]\r\n * @see {@link DataItem}\r\n */\r\nvar MapPolygonSeriesDataItem = /** @class */ (function (_super) {\r\n __extends(MapPolygonSeriesDataItem, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapPolygonSeriesDataItem() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"MapPolygonSeriesDataItem\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * @ignore\r\n */\r\n MapPolygonSeriesDataItem.prototype.getFeature = function () {\r\n if (this.multiPolygon && this.multiPolygon.length > 0) {\r\n return { \"type\": \"Feature\", geometry: { type: \"MultiPolygon\", coordinates: this.multiPolygon } };\r\n }\r\n };\r\n Object.defineProperty(MapPolygonSeriesDataItem.prototype, \"mapPolygon\", {\r\n /**\r\n * A [[MapPolygon]] element related to this data item.\r\n *\r\n * @readonly\r\n * @return Element\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._mapPolygon) {\r\n var mapPolygon_1 = this.component.mapPolygons.create();\r\n this._mapPolygon = mapPolygon_1;\r\n this.addSprite(mapPolygon_1);\r\n this._disposers.push(new Disposer(function () {\r\n if (_this.component) {\r\n _this.component.mapPolygons.removeValue(mapPolygon_1);\r\n }\r\n }));\r\n this.mapObject = mapPolygon_1;\r\n }\r\n return this._mapPolygon;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapPolygonSeriesDataItem.prototype, \"polygon\", {\r\n /**\r\n * @return Coordinates\r\n */\r\n get: function () {\r\n return this._polygon;\r\n },\r\n /**\r\n * A collection of X/Y coordinates for a single polygon. E.g.:\r\n *\r\n * ```JSON\r\n * [\r\n * [\r\n * [ 100, 150 ],\r\n * [ 120, 200 ],\r\n * [ 150, 200 ],\r\n * [ 170, 240 ],\r\n * [ 100, 150 ]\r\n * ]\r\n * ]\r\n * ```\r\n *\r\n * @param polygon Coordinates\r\n */\r\n set: function (polygon) {\r\n this._polygon = polygon;\r\n this.multiPolygon = [polygon];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapPolygonSeriesDataItem.prototype, \"multiPolygon\", {\r\n /**\r\n * @return Coordinates\r\n */\r\n get: function () {\r\n return this._multiPolygon;\r\n },\r\n /**\r\n * A collection of X/Y coordinates for a multi-part polygon. E.g.:\r\n *\r\n * ```JSON\r\n * [\r\n * // Part 1\r\n * [\r\n * [\r\n * [ 100, 150 ],\r\n * [ 120, 200 ],\r\n * [ 150, 220 ],\r\n * [ 170, 240 ],\r\n * [ 100, 150 ]\r\n * ]\r\n * ],\r\n *\r\n * // Part 2\r\n * [\r\n * [\r\n * [ 300, 350 ],\r\n * [ 320, 400 ],\r\n * [ 350, 420 ],\r\n * [ 370, 440 ],\r\n * [ 300, 350 ]\r\n * ]\r\n * ]\r\n * ]\r\n * ```\r\n *\r\n * @param multiPolygon Coordinates\r\n */\r\n set: function (multiPolygon) {\r\n this._multiPolygon = multiPolygon;\r\n this.updateExtremes();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapPolygonSeriesDataItem.prototype, \"geoPolygon\", {\r\n /**\r\n * @return Coordinates\r\n */\r\n get: function () {\r\n return this._geoPolygon;\r\n },\r\n /**\r\n * A collection of lat/long coordinates for a single polygon. E.g.:\r\n *\r\n * ```JSON\r\n * [\r\n * [\r\n * { latitude: -10.0, longitude: -10.0 },\r\n * { latitude: 10.0, longitude: -10.0 },\r\n * { latitude: 10.0, longitude: 10.0 },\r\n * { latitude: -10.0, longitude: -10.0 }\r\n * ]\r\n * ]\r\n * ```\r\n *\r\n * @see {@link https://tools.ietf.org/html/rfc7946#section-3.1.6} GeoJSON Polygon reference\r\n * @param geoPolygon Coordinates\r\n */\r\n set: function (geoPolygon) {\r\n this._geoPolygon = geoPolygon;\r\n this.multiGeoPolygon = [geoPolygon];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapPolygonSeriesDataItem.prototype, \"multiGeoPolygon\", {\r\n /**\r\n * @return Coordinates\r\n */\r\n get: function () {\r\n return this._multiGeoPolygon;\r\n },\r\n /**\r\n * A collection of lat/long coordinates for a multi-part polygon. E.g.:\r\n *\r\n * ```JSON\r\n * [\r\n * [\r\n * [\r\n * { longitude: 180.0, latitude: 40.0 },\r\n * { longitude: 180.0, latitude: 50.0 },\r\n * { longitude: 170.0, latitude: 50.0 },\r\n * { longitude: 170.0, latitude: 40.0 },\r\n * { longitude: 180.0, latitude: 40.0 }\r\n * ]\r\n * ],\r\n * [\r\n * [\r\n * { longitude: -170.0, latitude: 40.0 },\r\n * { longitude: -170.0, latitude: 50.0 },\r\n * { longitude: -180.0, latitude: 50.0 },\r\n * { longitude: -180.0, latitude: 40.0 },\r\n * { longitude: -170.0, latitude: 40.0 }\r\n * ]\r\n * ]\r\n * ]\r\n * ```\r\n *\r\n * @see {@link https://tools.ietf.org/html/rfc7946#section-3.1.7} GeoJSON MultiPolygon reference\r\n * @param multiGeoPolygon Coordinates\r\n */\r\n set: function (multiGeoPolygon) {\r\n this._multiGeoPolygon = multiGeoPolygon;\r\n this.multiPolygon = $mapUtils.multiGeoPolygonToMultipolygon(multiGeoPolygon);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return MapPolygonSeriesDataItem;\r\n}(MapSeriesDataItem));\r\nexport { MapPolygonSeriesDataItem };\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A series of map polygon elements.\r\n *\r\n * @see {@link IMapPolygonSeriesEvents} for a list of available Events\r\n * @see {@link IMapPolygonSeriesAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar MapPolygonSeries = /** @class */ (function (_super) {\r\n __extends(MapPolygonSeries, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapPolygonSeries() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * Indicates if series should automatically calculate visual center of the\r\n * polygons (accessible via `visualLongitude` and `visualLatitude` properties\r\n * of the [[MapPolygon]]).\r\n *\r\n * @default false\r\n * @since 4.3.0\r\n */\r\n _this.calculateVisualCenter = false;\r\n _this.className = \"MapPolygonSeries\";\r\n // Set data fields\r\n _this.dataFields.multiPolygon = \"multiPolygon\";\r\n _this.dataFields.polygon = \"polygon\";\r\n _this.dataFields.geoPolygon = \"geoPolygon\";\r\n _this.dataFields.multiGeoPolygon = \"multiGeoPolygon\";\r\n _this.setPropertyValue(\"sortPolygonsBy\", \"area\");\r\n _this.setPropertyValue(\"sortPolygonsReversed\", false);\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Returns a new/empty DataItem of the type appropriate for this object.\r\n *\r\n * @see {@link DataItem}\r\n * @return Data Item\r\n */\r\n MapPolygonSeries.prototype.createDataItem = function () {\r\n return new MapPolygonSeriesDataItem();\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapPolygonSeries.prototype.processIncExc = function () {\r\n this.mapPolygons.clear();\r\n _super.prototype.processIncExc.call(this);\r\n };\r\n /**\r\n * (Re)validates series data, effectively causing the whole series to be\r\n * redrawn.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapPolygonSeries.prototype.validateData = function () {\r\n // process geoJSON and created map objects\r\n if (this.useGeodata || this.geodata) {\r\n var geoJSON = !this._dataSources[\"geodata\"] ? this.chart.geodata : undefined;\r\n if (this.geodata) {\r\n geoJSON = this.geodata;\r\n }\r\n if (geoJSON) {\r\n var features = void 0;\r\n if (geoJSON.type == \"FeatureCollection\") {\r\n features = geoJSON.features;\r\n }\r\n else if (geoJSON.type == \"Feature\") {\r\n features = [geoJSON];\r\n }\r\n else if ([\"Point\", \"LineString\", \"Polygon\", \"MultiPoint\", \"MultiLineString\", \"MultiPolygon\"].indexOf(geoJSON.type) != -1) {\r\n features = [{ geometry: geoJSON }];\r\n }\r\n else {\r\n console.log(\"nothing found in geoJSON\");\r\n }\r\n if (features) {\r\n var _loop_1 = function (i, len) {\r\n var feature = features[i];\r\n var geometry = feature.geometry;\r\n if (geometry) {\r\n var type = geometry.type;\r\n var id_1 = feature.id;\r\n if (this_1.chart.geodataNames && this_1.chart.geodataNames[id_1]) {\r\n feature.properties.name = this_1.chart.geodataNames[id_1];\r\n }\r\n if (type == \"Polygon\" || type == \"MultiPolygon\") {\r\n if (!this_1.checkInclude(this_1.include, this_1.exclude, id_1)) {\r\n return \"continue\";\r\n }\r\n var coordinates = geometry.coordinates;\r\n if (coordinates) {\r\n // make the same as MultiPolygon\r\n if (type == \"Polygon\") {\r\n coordinates = [coordinates];\r\n }\r\n }\r\n // find data object in user-provided data\r\n var dataObject = $array.find(this_1.data, function (value, i) {\r\n return value.id == id_1;\r\n });\r\n // create one if not found\r\n if (!dataObject) {\r\n dataObject = { multiPolygon: coordinates, id: id_1, madeFromGeoData: true };\r\n this_1.data.push(dataObject);\r\n }\r\n // in case found\r\n else {\r\n // if user-provided object doesn't have points data provided in any way:\r\n if (!dataObject.multiPolygon) {\r\n dataObject.multiPolygon = coordinates;\r\n }\r\n }\r\n // copy properties data to datacontext\r\n $utils.softCopyProperties(feature.properties, dataObject);\r\n }\r\n }\r\n };\r\n var this_1 = this;\r\n for (var i = 0, len = features.length; i < len; i++) {\r\n _loop_1(i, len);\r\n }\r\n }\r\n }\r\n }\r\n _super.prototype.validateData.call(this);\r\n };\r\n /**\r\n * (Re)validates the series\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapPolygonSeries.prototype.validate = function () {\r\n _super.prototype.validate.call(this);\r\n this.dataItems.each(function (dataItem) {\r\n $utils.used(dataItem.mapPolygon);\r\n });\r\n if (this.sortPolygonsBy != \"none\") {\r\n var sortBy_1 = this.sortPolygonsBy;\r\n var reversed_1 = this.sortPolygonsReversed;\r\n this.mapPolygons.sort(function (a, b) {\r\n var valA = \"\";\r\n var valB = \"\";\r\n var dirA = -1;\r\n var dirB = 1;\r\n switch (sortBy_1) {\r\n case \"area\":\r\n valA = a.boxArea;\r\n valB = b.boxArea;\r\n dirA = -1;\r\n dirB = 1;\r\n break;\r\n case \"name\":\r\n valA = a.dataItem.dataContext.name || \"\";\r\n valB = b.dataItem.dataContext.name || \"\";\r\n dirA = 1;\r\n dirB = -1;\r\n break;\r\n case \"id\":\r\n valA = a.dataItem.dataContext.id || \"\";\r\n valB = b.dataItem.dataContext.id || \"\";\r\n dirA = 1;\r\n dirB = -1;\r\n break;\r\n case \"latitude\":\r\n valA = reversed_1 ? a.south : a.north;\r\n valB = reversed_1 ? b.south : b.north;\r\n dirA = -1;\r\n dirB = 1;\r\n break;\r\n case \"longitude\":\r\n valA = reversed_1 ? a.east : a.west;\r\n valB = reversed_1 ? b.east : b.west;\r\n dirA = 1;\r\n dirB = -1;\r\n break;\r\n }\r\n if (valA < valB) {\r\n return reversed_1 ? dirB : dirA;\r\n }\r\n if (valA > valB) {\r\n return reversed_1 ? dirA : dirB;\r\n }\r\n return 0;\r\n });\r\n this.mapPolygons.each(function (mapPolygon, index) {\r\n mapPolygon.validate();\r\n // makes small go first to avoid hover problems with IE\r\n if (!mapPolygon.zIndex && !mapPolygon.propertyFields.zIndex) {\r\n mapPolygon.zIndex = 1000000 - index;\r\n }\r\n });\r\n }\r\n };\r\n Object.defineProperty(MapPolygonSeries.prototype, \"mapPolygons\", {\r\n /**\r\n * List of polygon elements in the series.\r\n *\r\n * @return Polygon list\r\n */\r\n get: function () {\r\n if (!this._mapPolygons) {\r\n var polygonTemplate = new MapPolygon();\r\n var mapPolygons = new ListTemplate(polygonTemplate);\r\n this._disposers.push(new ListDisposer(mapPolygons));\r\n this._disposers.push(mapPolygons.template);\r\n mapPolygons.template.focusable = true;\r\n mapPolygons.events.on(\"inserted\", this.handleObjectAdded, this, false);\r\n this._mapPolygons = mapPolygons;\r\n this._mapObjects = mapPolygons;\r\n }\r\n return this._mapPolygons;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * returns MapPolygon by id in geoJSON file\r\n * @param polygon id\r\n * @return {MapPolygon}\r\n */\r\n MapPolygonSeries.prototype.getPolygonById = function (id) {\r\n return $iter.find(this.mapPolygons.iterator(), function (mapPolygon) {\r\n var dataContext = mapPolygon.dataItem.dataContext;\r\n return dataContext.id == id;\r\n });\r\n };\r\n /**\r\n * Copies all properties from another instance of [[Series]].\r\n *\r\n * @param source Source series\r\n */\r\n MapPolygonSeries.prototype.copyFrom = function (source) {\r\n this.mapPolygons.template.copyFrom(source.mapPolygons.template);\r\n _super.prototype.copyFrom.call(this, source);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapPolygonSeries.prototype.getFeatures = function () {\r\n var _this = this;\r\n var features = [];\r\n this.dataItems.each(function (dataItem) {\r\n var feature = dataItem.getFeature();\r\n if (feature) {\r\n features.push(feature);\r\n }\r\n });\r\n this.mapPolygons.each(function (mapPolygon) {\r\n if (_this.dataItems.indexOf(mapPolygon._dataItem) == -1) {\r\n var feature = mapPolygon.getFeature();\r\n if (feature) {\r\n features.push(feature);\r\n }\r\n }\r\n });\r\n return features;\r\n };\r\n Object.defineProperty(MapPolygonSeries.prototype, \"sortPolygonsBy\", {\r\n /**\r\n * @return How to sort map polygons\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"sortPolygonsBy\");\r\n },\r\n /**\r\n * How to order polygons in actual SVG document. Affects selection order\r\n * using TAB key.\r\n *\r\n * Available options: `\"area\"` (default), `\"name\"`, `\"longitude\"`,\r\n * `\"latitude\"`, `\"id\"`, and `\"none\"`.\r\n *\r\n * @default area\r\n * @since 4.9.36\r\n * @param value How to sort map polygons\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"sortPolygonsBy\", value)) {\r\n this.invalidateData();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapPolygonSeries.prototype, \"sortPolygonsReversed\", {\r\n /**\r\n * @return Reverse polygon sort direction\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"sortPolygonsReversed\");\r\n },\r\n /**\r\n * If `sortPolygonsBy` is set to something other than `\"none\"`, polygons\r\n * will be sorted by the given parameter, using natural sort direction.\r\n *\r\n * Setting `sortPolygonsReversed = true` will reverse this direction.\r\n *\r\n * @default false\r\n * @since 4.9.36\r\n * @param value Reverse polygon sort direction\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"sortPolygonsReversed\", value)) {\r\n this.invalidateData();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return MapPolygonSeries;\r\n}(MapSeries));\r\nexport { MapPolygonSeries };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"MapPolygonSeries\"] = MapPolygonSeries;\r\nregistry.registeredClasses[\"MapPolygonSeriesDataItem\"] = MapPolygonSeriesDataItem;\r\n//# sourceMappingURL=MapPolygonSeries.js.map","import noop from \"../noop.js\";\n\nexport default function() {\n var lines = [],\n line;\n return {\n point: function(x, y, m) {\n line.push([x, y, m]);\n },\n lineStart: function() {\n lines.push(line = []);\n },\n lineEnd: noop,\n rejoin: function() {\n if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));\n },\n result: function() {\n var result = lines;\n lines = [];\n line = null;\n return result;\n }\n };\n}\n","import {abs, epsilon} from \"./math.js\";\n\nexport default function(a, b) {\n return abs(a[0] - b[0]) < epsilon && abs(a[1] - b[1]) < epsilon;\n}\n","import pointEqual from \"../pointEqual.js\";\nimport {epsilon} from \"../math.js\";\n\nfunction Intersection(point, points, other, entry) {\n this.x = point;\n this.z = points;\n this.o = other; // another intersection\n this.e = entry; // is an entry?\n this.v = false; // visited\n this.n = this.p = null; // next & previous\n}\n\n// A generalized polygon clipping algorithm: given a polygon that has been cut\n// into its visible line segments, and rejoins the segments by interpolating\n// along the clip edge.\nexport default function(segments, compareIntersection, startInside, interpolate, stream) {\n var subject = [],\n clip = [],\n i,\n n;\n\n segments.forEach(function(segment) {\n if ((n = segment.length - 1) <= 0) return;\n var n, p0 = segment[0], p1 = segment[n], x;\n\n if (pointEqual(p0, p1)) {\n if (!p0[2] && !p1[2]) {\n stream.lineStart();\n for (i = 0; i < n; ++i) stream.point((p0 = segment[i])[0], p0[1]);\n stream.lineEnd();\n return;\n }\n // handle degenerate cases by moving the point\n p1[0] += 2 * epsilon;\n }\n\n subject.push(x = new Intersection(p0, segment, null, true));\n clip.push(x.o = new Intersection(p0, null, x, false));\n subject.push(x = new Intersection(p1, segment, null, false));\n clip.push(x.o = new Intersection(p1, null, x, true));\n });\n\n if (!subject.length) return;\n\n clip.sort(compareIntersection);\n link(subject);\n link(clip);\n\n for (i = 0, n = clip.length; i < n; ++i) {\n clip[i].e = startInside = !startInside;\n }\n\n var start = subject[0],\n points,\n point;\n\n while (1) {\n // Find first unvisited intersection.\n var current = start,\n isSubject = true;\n while (current.v) if ((current = current.n) === start) return;\n points = current.z;\n stream.lineStart();\n do {\n current.v = current.o.v = true;\n if (current.e) {\n if (isSubject) {\n for (i = 0, n = points.length; i < n; ++i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.n.x, 1, stream);\n }\n current = current.n;\n } else {\n if (isSubject) {\n points = current.p.z;\n for (i = points.length - 1; i >= 0; --i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.p.x, -1, stream);\n }\n current = current.p;\n }\n current = current.o;\n points = current.z;\n isSubject = !isSubject;\n } while (!current.v);\n stream.lineEnd();\n }\n}\n\nfunction link(array) {\n if (!(n = array.length)) return;\n var n,\n i = 0,\n a = array[0],\n b;\n while (++i < n) {\n a.n = b = array[i];\n b.p = a;\n a = b;\n }\n a.n = b = array[0];\n b.p = a;\n}\n","import {Adder} from \"d3-array\";\nimport {cartesian, cartesianCross, cartesianNormalizeInPlace} from \"./cartesian.js\";\nimport {abs, asin, atan2, cos, epsilon, epsilon2, halfPi, pi, quarterPi, sign, sin, tau} from \"./math.js\";\n\nfunction longitude(point) {\n return abs(point[0]) <= pi ? point[0] : sign(point[0]) * ((abs(point[0]) + pi) % tau - pi);\n}\n\nexport default function(polygon, point) {\n var lambda = longitude(point),\n phi = point[1],\n sinPhi = sin(phi),\n normal = [sin(lambda), -cos(lambda), 0],\n angle = 0,\n winding = 0;\n\n var sum = new Adder();\n\n if (sinPhi === 1) phi = halfPi + epsilon;\n else if (sinPhi === -1) phi = -halfPi - epsilon;\n\n for (var i = 0, n = polygon.length; i < n; ++i) {\n if (!(m = (ring = polygon[i]).length)) continue;\n var ring,\n m,\n point0 = ring[m - 1],\n lambda0 = longitude(point0),\n phi0 = point0[1] / 2 + quarterPi,\n sinPhi0 = sin(phi0),\n cosPhi0 = cos(phi0);\n\n for (var j = 0; j < m; ++j, lambda0 = lambda1, sinPhi0 = sinPhi1, cosPhi0 = cosPhi1, point0 = point1) {\n var point1 = ring[j],\n lambda1 = longitude(point1),\n phi1 = point1[1] / 2 + quarterPi,\n sinPhi1 = sin(phi1),\n cosPhi1 = cos(phi1),\n delta = lambda1 - lambda0,\n sign = delta >= 0 ? 1 : -1,\n absDelta = sign * delta,\n antimeridian = absDelta > pi,\n k = sinPhi0 * sinPhi1;\n\n sum.add(atan2(k * sign * sin(absDelta), cosPhi0 * cosPhi1 + k * cos(absDelta)));\n angle += antimeridian ? delta + sign * tau : delta;\n\n // Are the longitudes either side of the point’s meridian (lambda),\n // and are the latitudes smaller than the parallel (phi)?\n if (antimeridian ^ lambda0 >= lambda ^ lambda1 >= lambda) {\n var arc = cartesianCross(cartesian(point0), cartesian(point1));\n cartesianNormalizeInPlace(arc);\n var intersection = cartesianCross(normal, arc);\n cartesianNormalizeInPlace(intersection);\n var phiArc = (antimeridian ^ delta >= 0 ? -1 : 1) * asin(intersection[2]);\n if (phi > phiArc || phi === phiArc && (arc[0] || arc[1])) {\n winding += antimeridian ^ delta >= 0 ? 1 : -1;\n }\n }\n }\n }\n\n // First, determine whether the South pole is inside or outside:\n //\n // It is inside if:\n // * the polygon winds around it in a clockwise direction.\n // * the polygon does not (cumulatively) wind around it, but has a negative\n // (counter-clockwise) area.\n //\n // Second, count the (signed) number of times a segment crosses a lambda\n // from the point to the South pole. If it is zero, then the point is the\n // same side as the South pole.\n\n return (angle < -epsilon || angle < epsilon && sum < -epsilon2) ^ (winding & 1);\n}\n","function* flatten(arrays) {\n for (const array of arrays) {\n yield* array;\n }\n}\n\nexport default function merge(arrays) {\n return Array.from(flatten(arrays));\n}\n","import clipBuffer from \"./buffer.js\";\nimport clipRejoin from \"./rejoin.js\";\nimport {epsilon, halfPi} from \"../math.js\";\nimport polygonContains from \"../polygonContains.js\";\nimport {merge} from \"d3-array\";\n\nexport default function(pointVisible, clipLine, interpolate, start) {\n return function(sink) {\n var line = clipLine(sink),\n ringBuffer = clipBuffer(),\n ringSink = clipLine(ringBuffer),\n polygonStarted = false,\n polygon,\n segments,\n ring;\n\n var clip = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() {\n clip.point = pointRing;\n clip.lineStart = ringStart;\n clip.lineEnd = ringEnd;\n segments = [];\n polygon = [];\n },\n polygonEnd: function() {\n clip.point = point;\n clip.lineStart = lineStart;\n clip.lineEnd = lineEnd;\n segments = merge(segments);\n var startInside = polygonContains(polygon, start);\n if (segments.length) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n clipRejoin(segments, compareIntersection, startInside, interpolate, sink);\n } else if (startInside) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n sink.lineStart();\n interpolate(null, null, 1, sink);\n sink.lineEnd();\n }\n if (polygonStarted) sink.polygonEnd(), polygonStarted = false;\n segments = polygon = null;\n },\n sphere: function() {\n sink.polygonStart();\n sink.lineStart();\n interpolate(null, null, 1, sink);\n sink.lineEnd();\n sink.polygonEnd();\n }\n };\n\n function point(lambda, phi) {\n if (pointVisible(lambda, phi)) sink.point(lambda, phi);\n }\n\n function pointLine(lambda, phi) {\n line.point(lambda, phi);\n }\n\n function lineStart() {\n clip.point = pointLine;\n line.lineStart();\n }\n\n function lineEnd() {\n clip.point = point;\n line.lineEnd();\n }\n\n function pointRing(lambda, phi) {\n ring.push([lambda, phi]);\n ringSink.point(lambda, phi);\n }\n\n function ringStart() {\n ringSink.lineStart();\n ring = [];\n }\n\n function ringEnd() {\n pointRing(ring[0][0], ring[0][1]);\n ringSink.lineEnd();\n\n var clean = ringSink.clean(),\n ringSegments = ringBuffer.result(),\n i, n = ringSegments.length, m,\n segment,\n point;\n\n ring.pop();\n polygon.push(ring);\n ring = null;\n\n if (!n) return;\n\n // No intersections.\n if (clean & 1) {\n segment = ringSegments[0];\n if ((m = segment.length - 1) > 0) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n sink.lineStart();\n for (i = 0; i < m; ++i) sink.point((point = segment[i])[0], point[1]);\n sink.lineEnd();\n }\n return;\n }\n\n // Rejoin connected segments.\n // TODO reuse ringBuffer.rejoin()?\n if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));\n\n segments.push(ringSegments.filter(validSegment));\n }\n\n return clip;\n };\n}\n\nfunction validSegment(segment) {\n return segment.length > 1;\n}\n\n// Intersections are sorted along the clip edge. For both antimeridian cutting\n// and circle clipping, the same comparison is used.\nfunction compareIntersection(a, b) {\n return ((a = a.x)[0] < 0 ? a[1] - halfPi - epsilon : halfPi - a[1])\n - ((b = b.x)[0] < 0 ? b[1] - halfPi - epsilon : halfPi - b[1]);\n}\n","import clip from \"./index.js\";\nimport {abs, atan, cos, epsilon, halfPi, pi, sin} from \"../math.js\";\n\nexport default clip(\n function() { return true; },\n clipAntimeridianLine,\n clipAntimeridianInterpolate,\n [-pi, -halfPi]\n);\n\n// Takes a line and cuts into visible segments. Return values: 0 - there were\n// intersections or the line was empty; 1 - no intersections; 2 - there were\n// intersections, and the first and last segments should be rejoined.\nfunction clipAntimeridianLine(stream) {\n var lambda0 = NaN,\n phi0 = NaN,\n sign0 = NaN,\n clean; // no intersections\n\n return {\n lineStart: function() {\n stream.lineStart();\n clean = 1;\n },\n point: function(lambda1, phi1) {\n var sign1 = lambda1 > 0 ? pi : -pi,\n delta = abs(lambda1 - lambda0);\n if (abs(delta - pi) < epsilon) { // line crosses a pole\n stream.point(lambda0, phi0 = (phi0 + phi1) / 2 > 0 ? halfPi : -halfPi);\n stream.point(sign0, phi0);\n stream.lineEnd();\n stream.lineStart();\n stream.point(sign1, phi0);\n stream.point(lambda1, phi0);\n clean = 0;\n } else if (sign0 !== sign1 && delta >= pi) { // line crosses antimeridian\n if (abs(lambda0 - sign0) < epsilon) lambda0 -= sign0 * epsilon; // handle degeneracies\n if (abs(lambda1 - sign1) < epsilon) lambda1 -= sign1 * epsilon;\n phi0 = clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1);\n stream.point(sign0, phi0);\n stream.lineEnd();\n stream.lineStart();\n stream.point(sign1, phi0);\n clean = 0;\n }\n stream.point(lambda0 = lambda1, phi0 = phi1);\n sign0 = sign1;\n },\n lineEnd: function() {\n stream.lineEnd();\n lambda0 = phi0 = NaN;\n },\n clean: function() {\n return 2 - clean; // if intersections, rejoin first and last segments\n }\n };\n}\n\nfunction clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1) {\n var cosPhi0,\n cosPhi1,\n sinLambda0Lambda1 = sin(lambda0 - lambda1);\n return abs(sinLambda0Lambda1) > epsilon\n ? atan((sin(phi0) * (cosPhi1 = cos(phi1)) * sin(lambda1)\n - sin(phi1) * (cosPhi0 = cos(phi0)) * sin(lambda0))\n / (cosPhi0 * cosPhi1 * sinLambda0Lambda1))\n : (phi0 + phi1) / 2;\n}\n\nfunction clipAntimeridianInterpolate(from, to, direction, stream) {\n var phi;\n if (from == null) {\n phi = direction * halfPi;\n stream.point(-pi, phi);\n stream.point(0, phi);\n stream.point(pi, phi);\n stream.point(pi, 0);\n stream.point(pi, -phi);\n stream.point(0, -phi);\n stream.point(-pi, -phi);\n stream.point(-pi, 0);\n stream.point(-pi, phi);\n } else if (abs(from[0] - to[0]) > epsilon) {\n var lambda = from[0] < to[0] ? pi : -pi;\n phi = direction * lambda / 2;\n stream.point(-lambda, phi);\n stream.point(0, phi);\n stream.point(lambda, phi);\n } else {\n stream.point(to[0], to[1]);\n }\n}\n","import {cartesian, cartesianNormalizeInPlace, spherical} from \"./cartesian.js\";\nimport constant from \"./constant.js\";\nimport {acos, cos, degrees, epsilon, radians, sin, tau} from \"./math.js\";\nimport {rotateRadians} from \"./rotation.js\";\n\n// Generates a circle centered at [0°, 0°], with a given radius and precision.\nexport function circleStream(stream, radius, delta, direction, t0, t1) {\n if (!delta) return;\n var cosRadius = cos(radius),\n sinRadius = sin(radius),\n step = direction * delta;\n if (t0 == null) {\n t0 = radius + direction * tau;\n t1 = radius - step / 2;\n } else {\n t0 = circleRadius(cosRadius, t0);\n t1 = circleRadius(cosRadius, t1);\n if (direction > 0 ? t0 < t1 : t0 > t1) t0 += direction * tau;\n }\n for (var point, t = t0; direction > 0 ? t > t1 : t < t1; t -= step) {\n point = spherical([cosRadius, -sinRadius * cos(t), -sinRadius * sin(t)]);\n stream.point(point[0], point[1]);\n }\n}\n\n// Returns the signed angle of a cartesian point relative to [cosRadius, 0, 0].\nfunction circleRadius(cosRadius, point) {\n point = cartesian(point), point[0] -= cosRadius;\n cartesianNormalizeInPlace(point);\n var radius = acos(-point[1]);\n return ((-point[2] < 0 ? -radius : radius) + tau - epsilon) % tau;\n}\n\nexport default function() {\n var center = constant([0, 0]),\n radius = constant(90),\n precision = constant(2),\n ring,\n rotate,\n stream = {point: point};\n\n function point(x, y) {\n ring.push(x = rotate(x, y));\n x[0] *= degrees, x[1] *= degrees;\n }\n\n function circle() {\n var c = center.apply(this, arguments),\n r = radius.apply(this, arguments) * radians,\n p = precision.apply(this, arguments) * radians;\n ring = [];\n rotate = rotateRadians(-c[0] * radians, -c[1] * radians, 0).invert;\n circleStream(stream, r, p, 1);\n c = {type: \"Polygon\", coordinates: [ring]};\n ring = rotate = null;\n return c;\n }\n\n circle.center = function(_) {\n return arguments.length ? (center = typeof _ === \"function\" ? _ : constant([+_[0], +_[1]]), circle) : center;\n };\n\n circle.radius = function(_) {\n return arguments.length ? (radius = typeof _ === \"function\" ? _ : constant(+_), circle) : radius;\n };\n\n circle.precision = function(_) {\n return arguments.length ? (precision = typeof _ === \"function\" ? _ : constant(+_), circle) : precision;\n };\n\n return circle;\n}\n","import {cartesian, cartesianAddInPlace, cartesianCross, cartesianDot, cartesianScale, spherical} from \"../cartesian.js\";\nimport {circleStream} from \"../circle.js\";\nimport {abs, cos, epsilon, pi, radians, sqrt} from \"../math.js\";\nimport pointEqual from \"../pointEqual.js\";\nimport clip from \"./index.js\";\n\nexport default function(radius) {\n var cr = cos(radius),\n delta = 2 * radians,\n smallRadius = cr > 0,\n notHemisphere = abs(cr) > epsilon; // TODO optimise for this common case\n\n function interpolate(from, to, direction, stream) {\n circleStream(stream, radius, delta, direction, from, to);\n }\n\n function visible(lambda, phi) {\n return cos(lambda) * cos(phi) > cr;\n }\n\n // Takes a line and cuts into visible segments. Return values used for polygon\n // clipping: 0 - there were intersections or the line was empty; 1 - no\n // intersections 2 - there were intersections, and the first and last segments\n // should be rejoined.\n function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2))\n point1[2] = 1;\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }\n\n // Intersects the great circle between a and b with the clip circle.\n function intersect(a, b, two) {\n var pa = cartesian(a),\n pb = cartesian(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = cartesianCross(pa, pb),\n n2n2 = cartesianDot(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = cartesianCross(n1, n2),\n A = cartesianScale(n1, c1),\n B = cartesianScale(n2, c2);\n cartesianAddInPlace(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = cartesianDot(A, u),\n uu = cartesianDot(u, u),\n t2 = w * w - uu * (cartesianDot(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = sqrt(t2),\n q = cartesianScale(u, (-w - t) / uu);\n cartesianAddInPlace(q, A);\n q = spherical(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = abs(delta - pi) < epsilon,\n meridian = polar || delta < epsilon;\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < (abs(q[0] - lambda0) < epsilon ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > pi ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = cartesianScale(u, (-w + t) / uu);\n cartesianAddInPlace(q1, A);\n return [q, spherical(q1)];\n }\n }\n\n // Generates a 4-bit vector representing the location of a point relative to\n // the small circle's bounding box.\n function code(lambda, phi) {\n var r = smallRadius ? radius : pi - radius,\n code = 0;\n if (lambda < -r) code |= 1; // left\n else if (lambda > r) code |= 2; // right\n if (phi < -r) code |= 4; // below\n else if (phi > r) code |= 8; // above\n return code;\n }\n\n return clip(visible, clipLine, interpolate, smallRadius ? [0, -radius] : [-pi, radius - pi]);\n}\n","import {abs, epsilon} from \"../math.js\";\nimport clipBuffer from \"./buffer.js\";\nimport clipLine from \"./line.js\";\nimport clipRejoin from \"./rejoin.js\";\nimport {merge} from \"d3-array\";\n\nvar clipMax = 1e9, clipMin = -clipMax;\n\n// TODO Use d3-polygon’s polygonContains here for the ring check?\n// TODO Eliminate duplicate buffering in clipBuffer and polygon.push?\n\nexport default function clipRectangle(x0, y0, x1, y1) {\n\n function visible(x, y) {\n return x0 <= x && x <= x1 && y0 <= y && y <= y1;\n }\n\n function interpolate(from, to, direction, stream) {\n var a = 0, a1 = 0;\n if (from == null\n || (a = corner(from, direction)) !== (a1 = corner(to, direction))\n || comparePoint(from, to) < 0 ^ direction > 0) {\n do stream.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0);\n while ((a = (a + direction + 4) % 4) !== a1);\n } else {\n stream.point(to[0], to[1]);\n }\n }\n\n function corner(p, direction) {\n return abs(p[0] - x0) < epsilon ? direction > 0 ? 0 : 3\n : abs(p[0] - x1) < epsilon ? direction > 0 ? 2 : 1\n : abs(p[1] - y0) < epsilon ? direction > 0 ? 1 : 0\n : direction > 0 ? 3 : 2; // abs(p[1] - y1) < epsilon\n }\n\n function compareIntersection(a, b) {\n return comparePoint(a.x, b.x);\n }\n\n function comparePoint(a, b) {\n var ca = corner(a, 1),\n cb = corner(b, 1);\n return ca !== cb ? ca - cb\n : ca === 0 ? b[1] - a[1]\n : ca === 1 ? a[0] - b[0]\n : ca === 2 ? a[1] - b[1]\n : b[0] - a[0];\n }\n\n return function(stream) {\n var activeStream = stream,\n bufferStream = clipBuffer(),\n segments,\n polygon,\n ring,\n x__, y__, v__, // first point\n x_, y_, v_, // previous point\n first,\n clean;\n\n var clipStream = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: polygonStart,\n polygonEnd: polygonEnd\n };\n\n function point(x, y) {\n if (visible(x, y)) activeStream.point(x, y);\n }\n\n function polygonInside() {\n var winding = 0;\n\n for (var i = 0, n = polygon.length; i < n; ++i) {\n for (var ring = polygon[i], j = 1, m = ring.length, point = ring[0], a0, a1, b0 = point[0], b1 = point[1]; j < m; ++j) {\n a0 = b0, a1 = b1, point = ring[j], b0 = point[0], b1 = point[1];\n if (a1 <= y1) { if (b1 > y1 && (b0 - a0) * (y1 - a1) > (b1 - a1) * (x0 - a0)) ++winding; }\n else { if (b1 <= y1 && (b0 - a0) * (y1 - a1) < (b1 - a1) * (x0 - a0)) --winding; }\n }\n }\n\n return winding;\n }\n\n // Buffer geometry within a polygon and then clip it en masse.\n function polygonStart() {\n activeStream = bufferStream, segments = [], polygon = [], clean = true;\n }\n\n function polygonEnd() {\n var startInside = polygonInside(),\n cleanInside = clean && startInside,\n visible = (segments = merge(segments)).length;\n if (cleanInside || visible) {\n stream.polygonStart();\n if (cleanInside) {\n stream.lineStart();\n interpolate(null, null, 1, stream);\n stream.lineEnd();\n }\n if (visible) {\n clipRejoin(segments, compareIntersection, startInside, interpolate, stream);\n }\n stream.polygonEnd();\n }\n activeStream = stream, segments = polygon = ring = null;\n }\n\n function lineStart() {\n clipStream.point = linePoint;\n if (polygon) polygon.push(ring = []);\n first = true;\n v_ = false;\n x_ = y_ = NaN;\n }\n\n // TODO rather than special-case polygons, simply handle them separately.\n // Ideally, coincident intersection points should be jittered to avoid\n // clipping issues.\n function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }\n\n function linePoint(x, y) {\n var v = visible(x, y);\n if (polygon) ring.push([x, y]);\n if (first) {\n x__ = x, y__ = y, v__ = v;\n first = false;\n if (v) {\n activeStream.lineStart();\n activeStream.point(x, y);\n }\n } else {\n if (v && v_) activeStream.point(x, y);\n else {\n var a = [x_ = Math.max(clipMin, Math.min(clipMax, x_)), y_ = Math.max(clipMin, Math.min(clipMax, y_))],\n b = [x = Math.max(clipMin, Math.min(clipMax, x)), y = Math.max(clipMin, Math.min(clipMax, y))];\n if (clipLine(a, b, x0, y0, x1, y1)) {\n if (!v_) {\n activeStream.lineStart();\n activeStream.point(a[0], a[1]);\n }\n activeStream.point(b[0], b[1]);\n if (!v) activeStream.lineEnd();\n clean = false;\n } else if (v) {\n activeStream.lineStart();\n activeStream.point(x, y);\n clean = false;\n }\n }\n }\n x_ = x, y_ = y, v_ = v;\n }\n\n return clipStream;\n };\n}\n","export default function(a, b, x0, y0, x1, y1) {\n var ax = a[0],\n ay = a[1],\n bx = b[0],\n by = b[1],\n t0 = 0,\n t1 = 1,\n dx = bx - ax,\n dy = by - ay,\n r;\n\n r = x0 - ax;\n if (!dx && r > 0) return;\n r /= dx;\n if (dx < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dx > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = x1 - ax;\n if (!dx && r < 0) return;\n r /= dx;\n if (dx < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dx > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n r = y0 - ay;\n if (!dy && r > 0) return;\n r /= dy;\n if (dy < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dy > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = y1 - ay;\n if (!dy && r < 0) return;\n r /= dy;\n if (dy < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dy > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n if (t0 > 0) a[0] = ax + t0 * dx, a[1] = ay + t0 * dy;\n if (t1 < 1) b[0] = ax + t1 * dx, b[1] = ay + t1 * dy;\n return true;\n}\n","export default function(a, b) {\n\n function compose(x, y) {\n return x = a(x, y), b(x[0], x[1]);\n }\n\n if (a.invert && b.invert) compose.invert = function(x, y) {\n return x = b.invert(x, y), x && a.invert(x[0], x[1]);\n };\n\n return compose;\n}\n","export default x => x;\n","import compose from \"./compose.js\";\nimport {abs, asin, atan2, cos, degrees, pi, radians, sin, tau} from \"./math.js\";\n\nfunction rotationIdentity(lambda, phi) {\n if (abs(lambda) > pi) lambda -= Math.round(lambda / tau) * tau;\n return [lambda, phi];\n}\n\nrotationIdentity.invert = rotationIdentity;\n\nexport function rotateRadians(deltaLambda, deltaPhi, deltaGamma) {\n return (deltaLambda %= tau) ? (deltaPhi || deltaGamma ? compose(rotationLambda(deltaLambda), rotationPhiGamma(deltaPhi, deltaGamma))\n : rotationLambda(deltaLambda))\n : (deltaPhi || deltaGamma ? rotationPhiGamma(deltaPhi, deltaGamma)\n : rotationIdentity);\n}\n\nfunction forwardRotationLambda(deltaLambda) {\n return function(lambda, phi) {\n lambda += deltaLambda;\n if (abs(lambda) > pi) lambda -= Math.round(lambda / tau) * tau;\n return [lambda, phi];\n };\n}\n\nfunction rotationLambda(deltaLambda) {\n var rotation = forwardRotationLambda(deltaLambda);\n rotation.invert = forwardRotationLambda(-deltaLambda);\n return rotation;\n}\n\nfunction rotationPhiGamma(deltaPhi, deltaGamma) {\n var cosDeltaPhi = cos(deltaPhi),\n sinDeltaPhi = sin(deltaPhi),\n cosDeltaGamma = cos(deltaGamma),\n sinDeltaGamma = sin(deltaGamma);\n\n function rotation(lambda, phi) {\n var cosPhi = cos(phi),\n x = cos(lambda) * cosPhi,\n y = sin(lambda) * cosPhi,\n z = sin(phi),\n k = z * cosDeltaPhi + x * sinDeltaPhi;\n return [\n atan2(y * cosDeltaGamma - k * sinDeltaGamma, x * cosDeltaPhi - z * sinDeltaPhi),\n asin(k * cosDeltaGamma + y * sinDeltaGamma)\n ];\n }\n\n rotation.invert = function(lambda, phi) {\n var cosPhi = cos(phi),\n x = cos(lambda) * cosPhi,\n y = sin(lambda) * cosPhi,\n z = sin(phi),\n k = z * cosDeltaGamma - y * sinDeltaGamma;\n return [\n atan2(y * cosDeltaGamma + z * sinDeltaGamma, x * cosDeltaPhi + k * sinDeltaPhi),\n asin(k * cosDeltaPhi - x * sinDeltaPhi)\n ];\n };\n\n return rotation;\n}\n\nexport default function(rotate) {\n rotate = rotateRadians(rotate[0] * radians, rotate[1] * radians, rotate.length > 2 ? rotate[2] * radians : 0);\n\n function forward(coordinates) {\n coordinates = rotate(coordinates[0] * radians, coordinates[1] * radians);\n return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;\n }\n\n forward.invert = function(coordinates) {\n coordinates = rotate.invert(coordinates[0] * radians, coordinates[1] * radians);\n return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;\n };\n\n return forward;\n}\n","export default function(methods) {\n return {\n stream: transformer(methods)\n };\n}\n\nexport function transformer(methods) {\n return function(stream) {\n var s = new TransformStream;\n for (var key in methods) s[key] = methods[key];\n s.stream = stream;\n return s;\n };\n}\n\nfunction TransformStream() {}\n\nTransformStream.prototype = {\n constructor: TransformStream,\n point: function(x, y) { this.stream.point(x, y); },\n sphere: function() { this.stream.sphere(); },\n lineStart: function() { this.stream.lineStart(); },\n lineEnd: function() { this.stream.lineEnd(); },\n polygonStart: function() { this.stream.polygonStart(); },\n polygonEnd: function() { this.stream.polygonEnd(); }\n};\n","import noop from \"../noop.js\";\n\nvar x0 = Infinity,\n y0 = x0,\n x1 = -x0,\n y1 = x1;\n\nvar boundsStream = {\n point: boundsPoint,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: noop,\n polygonEnd: noop,\n result: function() {\n var bounds = [[x0, y0], [x1, y1]];\n x1 = y1 = -(y0 = x0 = Infinity);\n return bounds;\n }\n};\n\nfunction boundsPoint(x, y) {\n if (x < x0) x0 = x;\n if (x > x1) x1 = x;\n if (y < y0) y0 = y;\n if (y > y1) y1 = y;\n}\n\nexport default boundsStream;\n","import {default as geoStream} from \"../stream.js\";\nimport boundsStream from \"../path/bounds.js\";\n\nfunction fit(projection, fitBounds, object) {\n var clip = projection.clipExtent && projection.clipExtent();\n projection.scale(150).translate([0, 0]);\n if (clip != null) projection.clipExtent(null);\n geoStream(object, projection.stream(boundsStream));\n fitBounds(boundsStream.result());\n if (clip != null) projection.clipExtent(clip);\n return projection;\n}\n\nexport function fitExtent(projection, extent, object) {\n return fit(projection, function(b) {\n var w = extent[1][0] - extent[0][0],\n h = extent[1][1] - extent[0][1],\n k = Math.min(w / (b[1][0] - b[0][0]), h / (b[1][1] - b[0][1])),\n x = +extent[0][0] + (w - k * (b[1][0] + b[0][0])) / 2,\n y = +extent[0][1] + (h - k * (b[1][1] + b[0][1])) / 2;\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n\nexport function fitSize(projection, size, object) {\n return fitExtent(projection, [[0, 0], size], object);\n}\n\nexport function fitWidth(projection, width, object) {\n return fit(projection, function(b) {\n var w = +width,\n k = w / (b[1][0] - b[0][0]),\n x = (w - k * (b[1][0] + b[0][0])) / 2,\n y = -k * b[0][1];\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n\nexport function fitHeight(projection, height, object) {\n return fit(projection, function(b) {\n var h = +height,\n k = h / (b[1][1] - b[0][1]),\n x = -k * b[0][0],\n y = (h - k * (b[1][1] + b[0][1])) / 2;\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n","import {cartesian} from \"../cartesian.js\";\nimport {abs, asin, atan2, cos, epsilon, radians, sqrt} from \"../math.js\";\nimport {transformer} from \"../transform.js\";\n\nvar maxDepth = 16, // maximum depth of subdivision\n cosMinDistance = cos(30 * radians); // cos(minimum angular distance)\n\nexport default function(project, delta2) {\n return +delta2 ? resample(project, delta2) : resampleNone(project);\n}\n\nfunction resampleNone(project) {\n return transformer({\n point: function(x, y) {\n x = project(x, y);\n this.stream.point(x[0], x[1]);\n }\n });\n}\n\nfunction resample(project, delta2) {\n\n function resampleLineTo(x0, y0, lambda0, a0, b0, c0, x1, y1, lambda1, a1, b1, c1, depth, stream) {\n var dx = x1 - x0,\n dy = y1 - y0,\n d2 = dx * dx + dy * dy;\n if (d2 > 4 * delta2 && depth--) {\n var a = a0 + a1,\n b = b0 + b1,\n c = c0 + c1,\n m = sqrt(a * a + b * b + c * c),\n phi2 = asin(c /= m),\n lambda2 = abs(abs(c) - 1) < epsilon || abs(lambda0 - lambda1) < epsilon ? (lambda0 + lambda1) / 2 : atan2(b, a),\n p = project(lambda2, phi2),\n x2 = p[0],\n y2 = p[1],\n dx2 = x2 - x0,\n dy2 = y2 - y0,\n dz = dy * dx2 - dx * dy2;\n if (dz * dz / d2 > delta2 // perpendicular projected distance\n || abs((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 // midpoint close to an end\n || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) { // angular distance\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x2, y2, lambda2, a /= m, b /= m, c, depth, stream);\n stream.point(x2, y2);\n resampleLineTo(x2, y2, lambda2, a, b, c, x1, y1, lambda1, a1, b1, c1, depth, stream);\n }\n }\n }\n return function(stream) {\n var lambda00, x00, y00, a00, b00, c00, // first point\n lambda0, x0, y0, a0, b0, c0; // previous point\n\n var resampleStream = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() { stream.polygonStart(); resampleStream.lineStart = ringStart; },\n polygonEnd: function() { stream.polygonEnd(); resampleStream.lineStart = lineStart; }\n };\n\n function point(x, y) {\n x = project(x, y);\n stream.point(x[0], x[1]);\n }\n\n function lineStart() {\n x0 = NaN;\n resampleStream.point = linePoint;\n stream.lineStart();\n }\n\n function linePoint(lambda, phi) {\n var c = cartesian([lambda, phi]), p = project(lambda, phi);\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x0 = p[0], y0 = p[1], lambda0 = lambda, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream);\n stream.point(x0, y0);\n }\n\n function lineEnd() {\n resampleStream.point = point;\n stream.lineEnd();\n }\n\n function ringStart() {\n lineStart();\n resampleStream.point = ringPoint;\n resampleStream.lineEnd = ringEnd;\n }\n\n function ringPoint(lambda, phi) {\n linePoint(lambda00 = lambda, phi), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0;\n resampleStream.point = linePoint;\n }\n\n function ringEnd() {\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x00, y00, lambda00, a00, b00, c00, maxDepth, stream);\n resampleStream.lineEnd = lineEnd;\n lineEnd();\n }\n\n return resampleStream;\n };\n}\n","import clipAntimeridian from \"../clip/antimeridian.js\";\nimport clipCircle from \"../clip/circle.js\";\nimport clipRectangle from \"../clip/rectangle.js\";\nimport compose from \"../compose.js\";\nimport identity from \"../identity.js\";\nimport {cos, degrees, radians, sin, sqrt} from \"../math.js\";\nimport {rotateRadians} from \"../rotation.js\";\nimport {transformer} from \"../transform.js\";\nimport {fitExtent, fitSize, fitWidth, fitHeight} from \"./fit.js\";\nimport resample from \"./resample.js\";\n\nvar transformRadians = transformer({\n point: function(x, y) {\n this.stream.point(x * radians, y * radians);\n }\n});\n\nfunction transformRotate(rotate) {\n return transformer({\n point: function(x, y) {\n var r = rotate(x, y);\n return this.stream.point(r[0], r[1]);\n }\n });\n}\n\nfunction scaleTranslate(k, dx, dy, sx, sy) {\n function transform(x, y) {\n x *= sx; y *= sy;\n return [dx + k * x, dy - k * y];\n }\n transform.invert = function(x, y) {\n return [(x - dx) / k * sx, (dy - y) / k * sy];\n };\n return transform;\n}\n\nfunction scaleTranslateRotate(k, dx, dy, sx, sy, alpha) {\n if (!alpha) return scaleTranslate(k, dx, dy, sx, sy);\n var cosAlpha = cos(alpha),\n sinAlpha = sin(alpha),\n a = cosAlpha * k,\n b = sinAlpha * k,\n ai = cosAlpha / k,\n bi = sinAlpha / k,\n ci = (sinAlpha * dy - cosAlpha * dx) / k,\n fi = (sinAlpha * dx + cosAlpha * dy) / k;\n function transform(x, y) {\n x *= sx; y *= sy;\n return [a * x - b * y + dx, dy - b * x - a * y];\n }\n transform.invert = function(x, y) {\n return [sx * (ai * x - bi * y + ci), sy * (fi - bi * x - ai * y)];\n };\n return transform;\n}\n\nexport default function projection(project) {\n return projectionMutator(function() { return project; })();\n}\n\nexport function projectionMutator(projectAt) {\n var project,\n k = 150, // scale\n x = 480, y = 250, // translate\n lambda = 0, phi = 0, // center\n deltaLambda = 0, deltaPhi = 0, deltaGamma = 0, rotate, // pre-rotate\n alpha = 0, // post-rotate angle\n sx = 1, // reflectX\n sy = 1, // reflectX\n theta = null, preclip = clipAntimeridian, // pre-clip angle\n x0 = null, y0, x1, y1, postclip = identity, // post-clip extent\n delta2 = 0.5, // precision\n projectResample,\n projectTransform,\n projectRotateTransform,\n cache,\n cacheStream;\n\n function projection(point) {\n return projectRotateTransform(point[0] * radians, point[1] * radians);\n }\n\n function invert(point) {\n point = projectRotateTransform.invert(point[0], point[1]);\n return point && [point[0] * degrees, point[1] * degrees];\n }\n\n projection.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = transformRadians(transformRotate(rotate)(preclip(projectResample(postclip(cacheStream = stream)))));\n };\n\n projection.preclip = function(_) {\n return arguments.length ? (preclip = _, theta = undefined, reset()) : preclip;\n };\n\n projection.postclip = function(_) {\n return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip;\n };\n\n projection.clipAngle = function(_) {\n return arguments.length ? (preclip = +_ ? clipCircle(theta = _ * radians) : (theta = null, clipAntimeridian), reset()) : theta * degrees;\n };\n\n projection.clipExtent = function(_) {\n return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, identity) : clipRectangle(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n\n projection.scale = function(_) {\n return arguments.length ? (k = +_, recenter()) : k;\n };\n\n projection.translate = function(_) {\n return arguments.length ? (x = +_[0], y = +_[1], recenter()) : [x, y];\n };\n\n projection.center = function(_) {\n return arguments.length ? (lambda = _[0] % 360 * radians, phi = _[1] % 360 * radians, recenter()) : [lambda * degrees, phi * degrees];\n };\n\n projection.rotate = function(_) {\n return arguments.length ? (deltaLambda = _[0] % 360 * radians, deltaPhi = _[1] % 360 * radians, deltaGamma = _.length > 2 ? _[2] % 360 * radians : 0, recenter()) : [deltaLambda * degrees, deltaPhi * degrees, deltaGamma * degrees];\n };\n\n projection.angle = function(_) {\n return arguments.length ? (alpha = _ % 360 * radians, recenter()) : alpha * degrees;\n };\n\n projection.reflectX = function(_) {\n return arguments.length ? (sx = _ ? -1 : 1, recenter()) : sx < 0;\n };\n\n projection.reflectY = function(_) {\n return arguments.length ? (sy = _ ? -1 : 1, recenter()) : sy < 0;\n };\n\n projection.precision = function(_) {\n return arguments.length ? (projectResample = resample(projectTransform, delta2 = _ * _), reset()) : sqrt(delta2);\n };\n\n projection.fitExtent = function(extent, object) {\n return fitExtent(projection, extent, object);\n };\n\n projection.fitSize = function(size, object) {\n return fitSize(projection, size, object);\n };\n\n projection.fitWidth = function(width, object) {\n return fitWidth(projection, width, object);\n };\n\n projection.fitHeight = function(height, object) {\n return fitHeight(projection, height, object);\n };\n\n function recenter() {\n var center = scaleTranslateRotate(k, 0, 0, sx, sy, alpha).apply(null, project(lambda, phi)),\n transform = scaleTranslateRotate(k, x - center[0], y - center[1], sx, sy, alpha);\n rotate = rotateRadians(deltaLambda, deltaPhi, deltaGamma);\n projectTransform = compose(project, transform);\n projectRotateTransform = compose(rotate, projectTransform);\n projectResample = resample(projectTransform, delta2);\n return reset();\n }\n\n function reset() {\n cache = cacheStream = null;\n return projection;\n }\n\n return function() {\n project = projectAt.apply(this, arguments);\n projection.invert = project.invert && invert;\n return recenter();\n };\n}\n","import projection from \"./index.js\";\n\nexport function equirectangularRaw(lambda, phi) {\n return [lambda, phi];\n}\n\nequirectangularRaw.invert = equirectangularRaw;\n\nexport default function() {\n return projection(equirectangularRaw)\n .scale(152.63);\n}\n","import {Adder} from \"d3-array\";\nimport {abs} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nvar areaSum = new Adder(),\n areaRingSum = new Adder(),\n x00,\n y00,\n x0,\n y0;\n\nvar areaStream = {\n point: noop,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: function() {\n areaStream.lineStart = areaRingStart;\n areaStream.lineEnd = areaRingEnd;\n },\n polygonEnd: function() {\n areaStream.lineStart = areaStream.lineEnd = areaStream.point = noop;\n areaSum.add(abs(areaRingSum));\n areaRingSum = new Adder();\n },\n result: function() {\n var area = areaSum / 2;\n areaSum = new Adder();\n return area;\n }\n};\n\nfunction areaRingStart() {\n areaStream.point = areaPointFirst;\n}\n\nfunction areaPointFirst(x, y) {\n areaStream.point = areaPoint;\n x00 = x0 = x, y00 = y0 = y;\n}\n\nfunction areaPoint(x, y) {\n areaRingSum.add(y0 * x - x0 * y);\n x0 = x, y0 = y;\n}\n\nfunction areaRingEnd() {\n areaPoint(x00, y00);\n}\n\nexport default areaStream;\n","import {sqrt} from \"../math.js\";\n\n// TODO Enforce positive area for exterior, negative area for interior?\n\nvar X0 = 0,\n Y0 = 0,\n Z0 = 0,\n X1 = 0,\n Y1 = 0,\n Z1 = 0,\n X2 = 0,\n Y2 = 0,\n Z2 = 0,\n x00,\n y00,\n x0,\n y0;\n\nvar centroidStream = {\n point: centroidPoint,\n lineStart: centroidLineStart,\n lineEnd: centroidLineEnd,\n polygonStart: function() {\n centroidStream.lineStart = centroidRingStart;\n centroidStream.lineEnd = centroidRingEnd;\n },\n polygonEnd: function() {\n centroidStream.point = centroidPoint;\n centroidStream.lineStart = centroidLineStart;\n centroidStream.lineEnd = centroidLineEnd;\n },\n result: function() {\n var centroid = Z2 ? [X2 / Z2, Y2 / Z2]\n : Z1 ? [X1 / Z1, Y1 / Z1]\n : Z0 ? [X0 / Z0, Y0 / Z0]\n : [NaN, NaN];\n X0 = Y0 = Z0 =\n X1 = Y1 = Z1 =\n X2 = Y2 = Z2 = 0;\n return centroid;\n }\n};\n\nfunction centroidPoint(x, y) {\n X0 += x;\n Y0 += y;\n ++Z0;\n}\n\nfunction centroidLineStart() {\n centroidStream.point = centroidPointFirstLine;\n}\n\nfunction centroidPointFirstLine(x, y) {\n centroidStream.point = centroidPointLine;\n centroidPoint(x0 = x, y0 = y);\n}\n\nfunction centroidPointLine(x, y) {\n var dx = x - x0, dy = y - y0, z = sqrt(dx * dx + dy * dy);\n X1 += z * (x0 + x) / 2;\n Y1 += z * (y0 + y) / 2;\n Z1 += z;\n centroidPoint(x0 = x, y0 = y);\n}\n\nfunction centroidLineEnd() {\n centroidStream.point = centroidPoint;\n}\n\nfunction centroidRingStart() {\n centroidStream.point = centroidPointFirstRing;\n}\n\nfunction centroidRingEnd() {\n centroidPointRing(x00, y00);\n}\n\nfunction centroidPointFirstRing(x, y) {\n centroidStream.point = centroidPointRing;\n centroidPoint(x00 = x0 = x, y00 = y0 = y);\n}\n\nfunction centroidPointRing(x, y) {\n var dx = x - x0,\n dy = y - y0,\n z = sqrt(dx * dx + dy * dy);\n\n X1 += z * (x0 + x) / 2;\n Y1 += z * (y0 + y) / 2;\n Z1 += z;\n\n z = y0 * x - x0 * y;\n X2 += z * (x0 + x);\n Y2 += z * (y0 + y);\n Z2 += z * 3;\n centroidPoint(x0 = x, y0 = y);\n}\n\nexport default centroidStream;\n","import {tau} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nexport default function PathContext(context) {\n this._context = context;\n}\n\nPathContext.prototype = {\n _radius: 4.5,\n pointRadius: function(_) {\n return this._radius = _, this;\n },\n polygonStart: function() {\n this._line = 0;\n },\n polygonEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line === 0) this._context.closePath();\n this._point = NaN;\n },\n point: function(x, y) {\n switch (this._point) {\n case 0: {\n this._context.moveTo(x, y);\n this._point = 1;\n break;\n }\n case 1: {\n this._context.lineTo(x, y);\n break;\n }\n default: {\n this._context.moveTo(x + this._radius, y);\n this._context.arc(x, y, this._radius, 0, tau);\n break;\n }\n }\n },\n result: noop\n};\n","import {Adder} from \"d3-array\";\nimport {sqrt} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nvar lengthSum = new Adder(),\n lengthRing,\n x00,\n y00,\n x0,\n y0;\n\nvar lengthStream = {\n point: noop,\n lineStart: function() {\n lengthStream.point = lengthPointFirst;\n },\n lineEnd: function() {\n if (lengthRing) lengthPoint(x00, y00);\n lengthStream.point = noop;\n },\n polygonStart: function() {\n lengthRing = true;\n },\n polygonEnd: function() {\n lengthRing = null;\n },\n result: function() {\n var length = +lengthSum;\n lengthSum = new Adder();\n return length;\n }\n};\n\nfunction lengthPointFirst(x, y) {\n lengthStream.point = lengthPoint;\n x00 = x0 = x, y00 = y0 = y;\n}\n\nfunction lengthPoint(x, y) {\n x0 -= x, y0 -= y;\n lengthSum.add(sqrt(x0 * x0 + y0 * y0));\n x0 = x, y0 = y;\n}\n\nexport default lengthStream;\n","// Simple caching for constant-radius points.\nlet cacheDigits, cacheAppend, cacheRadius, cacheCircle;\n\nexport default class PathString {\n constructor(digits) {\n this._append = digits == null ? append : appendRound(digits);\n this._radius = 4.5;\n this._ = \"\";\n }\n pointRadius(_) {\n this._radius = +_;\n return this;\n }\n polygonStart() {\n this._line = 0;\n }\n polygonEnd() {\n this._line = NaN;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {\n if (this._line === 0) this._ += \"Z\";\n this._point = NaN;\n }\n point(x, y) {\n switch (this._point) {\n case 0: {\n this._append`M${x},${y}`;\n this._point = 1;\n break;\n }\n case 1: {\n this._append`L${x},${y}`;\n break;\n }\n default: {\n this._append`M${x},${y}`;\n if (this._radius !== cacheRadius || this._append !== cacheAppend) {\n const r = this._radius;\n const s = this._;\n this._ = \"\"; // stash the old string so we can cache the circle path fragment\n this._append`m0,${r}a${r},${r} 0 1,1 0,${-2 * r}a${r},${r} 0 1,1 0,${2 * r}z`;\n cacheRadius = r;\n cacheAppend = this._append;\n cacheCircle = this._;\n this._ = s;\n }\n this._ += cacheCircle;\n break;\n }\n }\n }\n result() {\n const result = this._;\n this._ = \"\";\n return result.length ? result : null;\n }\n}\n\nfunction append(strings) {\n let i = 1;\n this._ += strings[0];\n for (const j = strings.length; i < j; ++i) {\n this._ += arguments[i] + strings[i];\n }\n}\n\nfunction appendRound(digits) {\n const d = Math.floor(digits);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${digits}`);\n if (d > 15) return append;\n if (d !== cacheDigits) {\n const k = 10 ** d;\n cacheDigits = d;\n cacheAppend = function append(strings) {\n let i = 1;\n this._ += strings[0];\n for (const j = strings.length; i < j; ++i) {\n this._ += Math.round(arguments[i] * k) / k + strings[i];\n }\n };\n }\n return cacheAppend;\n}\n","import {Adder} from \"d3-array\";\nimport {abs, atan2, cos, radians, sin, sqrt} from \"./math.js\";\nimport noop from \"./noop.js\";\nimport stream from \"./stream.js\";\n\nvar lengthSum,\n lambda0,\n sinPhi0,\n cosPhi0;\n\nvar lengthStream = {\n sphere: noop,\n point: noop,\n lineStart: lengthLineStart,\n lineEnd: noop,\n polygonStart: noop,\n polygonEnd: noop\n};\n\nfunction lengthLineStart() {\n lengthStream.point = lengthPointFirst;\n lengthStream.lineEnd = lengthLineEnd;\n}\n\nfunction lengthLineEnd() {\n lengthStream.point = lengthStream.lineEnd = noop;\n}\n\nfunction lengthPointFirst(lambda, phi) {\n lambda *= radians, phi *= radians;\n lambda0 = lambda, sinPhi0 = sin(phi), cosPhi0 = cos(phi);\n lengthStream.point = lengthPoint;\n}\n\nfunction lengthPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var sinPhi = sin(phi),\n cosPhi = cos(phi),\n delta = abs(lambda - lambda0),\n cosDelta = cos(delta),\n sinDelta = sin(delta),\n x = cosPhi * sinDelta,\n y = cosPhi0 * sinPhi - sinPhi0 * cosPhi * cosDelta,\n z = sinPhi0 * sinPhi + cosPhi0 * cosPhi * cosDelta;\n lengthSum.add(atan2(sqrt(x * x + y * y), z));\n lambda0 = lambda, sinPhi0 = sinPhi, cosPhi0 = cosPhi;\n}\n\nexport default function(object) {\n lengthSum = new Adder();\n stream(object, lengthStream);\n return +lengthSum;\n}\n","import length from \"./length.js\";\n\nvar coordinates = [null, null],\n object = {type: \"LineString\", coordinates: coordinates};\n\nexport default function(a, b) {\n coordinates[0] = a;\n coordinates[1] = b;\n return length(object);\n}\n","/**\r\n * This module contains funcitonality related to geographical projections\r\n */\r\nimport { registry } from \"../../../core/Registry\";\r\nimport * as $math from \"../../../core/utils/Math\";\r\nimport * as d3geo from \"d3-geo\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * This is a base class for a geographical projection.\r\n */\r\nvar Projection = /** @class */ (function () {\r\n function Projection() {\r\n this.d3Projection = d3geo.geoEquirectangular();\r\n }\r\n Object.defineProperty(Projection.prototype, \"d3Projection\", {\r\n /**\r\n * d3 projection\r\n */\r\n get: function () {\r\n return this._d3Projection;\r\n },\r\n /**\r\n * d3 projection\r\n */\r\n set: function (projection) {\r\n this._d3Projection = projection;\r\n projection.precision(0.1);\r\n this._d3Path = d3geo.geoPath().projection(projection);\r\n if (this.chart) {\r\n this.chart.invalidateProjection();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Projection.prototype, \"d3Path\", {\r\n /**\r\n * d3 path generator method\r\n * @ignore\r\n */\r\n get: function () {\r\n return this._d3Path;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Projection.prototype, \"scale\", {\r\n /**\r\n * @ignore\r\n */\r\n get: function () {\r\n return this.d3Projection.scale() / 100;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Converts a geographical point (lat/long) to a screen point (x/y)\r\n * @param geoPoint Geo point (lat/long)\r\n * @return Screen point (x/y)\r\n */\r\n Projection.prototype.convert = function (geoPoint) {\r\n /*\r\n geoPoint = $geo.normalizePoint(geoPoint);\r\n geoPoint = this.rotate(geoPoint, this.deltaLongitude, this.deltaLatitude, this.deltaGama);\r\n let pointInRadians: IPoint = this.project(geoPoint.longitude * $math.RADIANS, geoPoint.latitude * $math.RADIANS);\r\n return {\r\n x: $math.round(pointInRadians.x * $math.DEGREES - this.centerPoint.x, 4) * this.scale,\r\n y: $math.round(-pointInRadians.y * $math.DEGREES - this.centerPoint.y, 4) * this.scale\r\n };*/\r\n var p = this.d3Projection([geoPoint.longitude, geoPoint.latitude]);\r\n if (p) {\r\n return { x: p[0], y: p[1] };\r\n }\r\n };\r\n /**\r\n * Converts a screen point (x/y) to a geographical point (lat/long)\r\n * @param point Screen point (x/y)\r\n * @return Geo point (lat/long)\r\n */\r\n Projection.prototype.invert = function (point) {\r\n /*\r\n let pointInRadians: IGeoPoint = this.unproject((point.x / this.scale + this.centerPoint.x) * $math.RADIANS, (-point.y / this.scale - this.centerPoint.y) * $math.RADIANS);\r\n\r\n let geoPoint = { longitude: pointInRadians.longitude * $math.DEGREES, latitude: pointInRadians.latitude * $math.DEGREES };\r\n\r\n geoPoint = this.unrotate(geoPoint, this.deltaLongitude, this.deltaLatitude, this.deltaGama);\r\n */\r\n var p = this.d3Projection.invert([point.x, point.y]);\r\n if (p) {\r\n return { longitude: p[0], latitude: p[1] };\r\n }\r\n };\r\n /**\r\n * Returns X/Y coordinates.\r\n * Individual projections will override this method to apply their own\r\n * projection logic.\r\n * @deprecated\r\n * @param lambda [description]\r\n * @param phi [description]\r\n * @return X/Y coordinates\r\n * @todo Needs description\r\n */\r\n Projection.prototype.project = function (lambda, phi) {\r\n return this.convert({ longitude: lambda * $math.DEGREES, latitude: phi * $math.DEGREES });\r\n };\r\n /**\r\n * Returns geographical coordinates (lat/long).\r\n * Individual projections will override this method to apply their own\r\n * projection logic.\r\n * @deprecated\r\n * @param x X coordinate\r\n * @param y Y coordinate\r\n * @return Geographical point\r\n * @todo Needs description\r\n */\r\n Projection.prototype.unproject = function (x, y) {\r\n return this.invert({ x: x, y: y });\r\n };\r\n /**\r\n * @ignore\r\n * @deprecated\r\n */\r\n Projection.prototype.rotate = function (geoPoint, deltaLongitude, deltaLatitude, deltaGamma) {\r\n var deltaLambda = deltaLongitude * $math.RADIANS;\r\n var deltaPhi = deltaLatitude * $math.RADIANS;\r\n deltaGamma = deltaGamma * $math.RADIANS;\r\n var lambda = geoPoint.longitude * $math.RADIANS + deltaLambda;\r\n var phi = geoPoint.latitude * $math.RADIANS;\r\n var cosDeltaPhi = Math.cos(deltaPhi);\r\n var sinDeltaPhi = Math.sin(deltaPhi);\r\n var cosDeltaGamma = Math.cos(deltaGamma);\r\n var sinDeltaGamma = Math.sin(deltaGamma);\r\n var cosPhi = Math.cos(phi);\r\n var x = Math.cos(lambda) * cosPhi;\r\n var y = Math.sin(lambda) * cosPhi;\r\n var z = Math.sin(phi);\r\n var k = z * cosDeltaPhi + x * sinDeltaPhi;\r\n return { longitude: $math.DEGREES * Math.atan2(y * cosDeltaGamma - k * sinDeltaGamma, x * cosDeltaPhi - z * sinDeltaPhi), latitude: $math.DEGREES * Math.asin(k * cosDeltaGamma + y * sinDeltaGamma) };\r\n };\r\n /**\r\n * @ignore\r\n * @deprecated\r\n */\r\n Projection.prototype.unrotate = function (geoPoint, deltaLongitude, deltaLatitude, deltaGamma) {\r\n var deltaLambda = deltaLongitude * $math.RADIANS;\r\n var deltaPhi = deltaLatitude * $math.RADIANS;\r\n deltaGamma = deltaGamma * $math.RADIANS;\r\n var lambda = geoPoint.longitude * $math.RADIANS - deltaLambda;\r\n var phi = geoPoint.latitude * $math.RADIANS;\r\n var cosDeltaPhi = Math.cos(deltaPhi);\r\n var sinDeltaPhi = Math.sin(deltaPhi);\r\n var cosDeltaGamma = Math.cos(deltaGamma);\r\n var sinDeltaGamma = Math.sin(deltaGamma);\r\n var cosPhi = Math.cos(phi);\r\n var x = Math.cos(lambda) * cosPhi;\r\n var y = Math.sin(lambda) * cosPhi;\r\n var z = Math.sin(phi);\r\n var k = z * cosDeltaGamma - y * sinDeltaGamma;\r\n return { longitude: $math.DEGREES * Math.atan2(y * cosDeltaGamma + z * sinDeltaGamma, x * cosDeltaPhi + k * sinDeltaPhi), latitude: $math.DEGREES * Math.asin(k * cosDeltaPhi - x * sinDeltaPhi) };\r\n };\r\n //@todo: move to some utils?\r\n //@todo: add credits to: https://www.movable-type.co.uk/scripts/latlong.html\r\n Projection.prototype.intermediatePoint = function (pointA, pointB, position) {\r\n var p = d3geo.geoInterpolate([pointA.longitude, pointA.latitude], [pointB.longitude, pointB.latitude])(position);\r\n return { longitude: p[0], latitude: p[1] };\r\n };\r\n ;\r\n // returns radians\r\n Projection.prototype.multiDistance = function (multiGeoLine) {\r\n var distance = 0;\r\n for (var s = 0; s < multiGeoLine.length; s++) {\r\n var points = multiGeoLine[s];\r\n if (points.length > 1) {\r\n for (var p = 1; p < points.length; p++) {\r\n var pointA = points[p - 1];\r\n var pointB = points[p];\r\n distance += this.distance(pointA, pointB);\r\n }\r\n }\r\n }\r\n return distance;\r\n };\r\n // returns radians\r\n Projection.prototype.distance = function (pointA, pointB) {\r\n return d3geo.geoDistance([pointA.longitude, pointA.latitude], [pointB.longitude, pointB.latitude]);\r\n };\r\n /**\r\n * Converts relative position along the line (0-1) into pixel coordinates.\r\n *\r\n * @param position Position (0-1)\r\n * @return Coordinates\r\n */\r\n Projection.prototype.positionToPoint = function (multiGeoLine, position) {\r\n if (multiGeoLine) {\r\n var intermediatePoint = this.positionToGeoPoint(multiGeoLine, position);\r\n var intermediatePointA = this.positionToGeoPoint(multiGeoLine, position - 0.01);\r\n var intermediatePointB = this.positionToGeoPoint(multiGeoLine, position + 0.01);\r\n if (intermediatePointA && intermediatePointB) {\r\n var point = this.convert(intermediatePoint);\r\n var pa = this.convert(intermediatePointA);\r\n var pb = this.convert(intermediatePointB);\r\n return { x: point.x, y: point.y, angle: $math.getAngle(pa, pb) };\r\n }\r\n }\r\n return { x: 0, y: 0, angle: 0 };\r\n };\r\n /**\r\n * Converts relative position along the line (0-1) into pixel coordinates.\r\n *\r\n * @param position Position (0-1)\r\n * @return Coordinates\r\n */\r\n Projection.prototype.positionToGeoPoint = function (multiGeoLine, position) {\r\n if (multiGeoLine) {\r\n var totalDistance = this.multiDistance(multiGeoLine);\r\n var currentDistance = 0;\r\n var distanceAB = void 0;\r\n var positionA = 0;\r\n var positionB = 0;\r\n var pointA = void 0;\r\n var pointB = void 0;\r\n for (var s = 0; s < multiGeoLine.length; s++) {\r\n var points = multiGeoLine[s];\r\n if (points.length > 1) {\r\n for (var p = 1; p < points.length; p++) {\r\n pointA = points[p - 1];\r\n pointB = points[p];\r\n positionA = currentDistance / totalDistance;\r\n distanceAB = this.distance(pointA, pointB);\r\n currentDistance += distanceAB;\r\n positionB = currentDistance / totalDistance;\r\n if (positionA <= position && positionB > position) {\r\n s = multiGeoLine.length;\r\n break;\r\n }\r\n }\r\n }\r\n else if (points.length == 1) {\r\n pointA = points[0];\r\n pointB = points[0];\r\n positionA = 0;\r\n positionB = 1;\r\n }\r\n }\r\n if (pointA && pointB) {\r\n var positionAB = (position - positionA) / (positionB - positionA);\r\n return this.intermediatePoint(pointA, pointB, positionAB);\r\n }\r\n }\r\n return { longitude: 0, latitude: 0 };\r\n };\r\n return Projection;\r\n}());\r\nexport { Projection };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Projection\"] = Projection;\r\n//# sourceMappingURL=Projection.js.map","import identity from \"../identity.js\";\nimport stream from \"../stream.js\";\nimport pathArea from \"./area.js\";\nimport pathBounds from \"./bounds.js\";\nimport pathCentroid from \"./centroid.js\";\nimport PathContext from \"./context.js\";\nimport pathMeasure from \"./measure.js\";\nimport PathString from \"./string.js\";\n\nexport default function(projection, context) {\n let digits = 3,\n pointRadius = 4.5,\n projectionStream,\n contextStream;\n\n function path(object) {\n if (object) {\n if (typeof pointRadius === \"function\") contextStream.pointRadius(+pointRadius.apply(this, arguments));\n stream(object, projectionStream(contextStream));\n }\n return contextStream.result();\n }\n\n path.area = function(object) {\n stream(object, projectionStream(pathArea));\n return pathArea.result();\n };\n\n path.measure = function(object) {\n stream(object, projectionStream(pathMeasure));\n return pathMeasure.result();\n };\n\n path.bounds = function(object) {\n stream(object, projectionStream(pathBounds));\n return pathBounds.result();\n };\n\n path.centroid = function(object) {\n stream(object, projectionStream(pathCentroid));\n return pathCentroid.result();\n };\n\n path.projection = function(_) {\n if (!arguments.length) return projection;\n projectionStream = _ == null ? (projection = null, identity) : (projection = _).stream;\n return path;\n };\n\n path.context = function(_) {\n if (!arguments.length) return context;\n contextStream = _ == null ? (context = null, new PathString(digits)) : new PathContext(context = _);\n if (typeof pointRadius !== \"function\") contextStream.pointRadius(pointRadius);\n return path;\n };\n\n path.pointRadius = function(_) {\n if (!arguments.length) return pointRadius;\n pointRadius = typeof _ === \"function\" ? _ : (contextStream.pointRadius(+_), +_);\n return path;\n };\n\n path.digits = function(_) {\n if (!arguments.length) return digits;\n if (_ == null) digits = null;\n else {\n const d = Math.floor(_);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);\n digits = d;\n }\n if (context === null) contextStream = new PathString(digits);\n return path;\n };\n\n return path.projection(projection).digits(digits).context(context);\n}\n","import {asin, atan2, cos, degrees, haversin, radians, sin, sqrt} from \"./math.js\";\n\nexport default function(a, b) {\n var x0 = a[0] * radians,\n y0 = a[1] * radians,\n x1 = b[0] * radians,\n y1 = b[1] * radians,\n cy0 = cos(y0),\n sy0 = sin(y0),\n cy1 = cos(y1),\n sy1 = sin(y1),\n kx0 = cy0 * cos(x0),\n ky0 = cy0 * sin(x0),\n kx1 = cy1 * cos(x1),\n ky1 = cy1 * sin(x1),\n d = 2 * asin(sqrt(haversin(y1 - y0) + cy0 * cy1 * haversin(x1 - x0))),\n k = sin(d);\n\n var interpolate = d ? function(t) {\n var B = sin(t *= d) / k,\n A = sin(d - t) / k,\n x = A * kx0 + B * kx1,\n y = A * ky0 + B * ky1,\n z = A * sy0 + B * sy1;\n return [\n atan2(y, x) * degrees,\n atan2(z, sqrt(x * x + y * y)) * degrees\n ];\n } : function() {\n return [x0 * degrees, y0 * degrees];\n };\n\n interpolate.distance = d;\n\n return interpolate;\n}\n","/**\r\n * A module for the mini-map control.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../../core/Container\";\r\nimport { Rectangle } from \"../../core/elements/Rectangle\";\r\nimport { List } from \"../../core/utils/List\";\r\nimport { MutableValueDisposer, MultiDisposer } from \"../../core/utils/Disposer\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { color } from \"../../core/utils/Color\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a \"bird's eye\" view of the whole map.\r\n *\r\n * This control creates a mini-map with the whole of the map, highlighting\r\n * the area which is in the current viewport of the map map.\r\n *\r\n * @see {@link ISmallMapEvents} for a list of available events\r\n * @see {@link ISmallMapAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar SmallMap = /** @class */ (function (_super) {\r\n __extends(SmallMap, _super);\r\n /**\r\n * Constructor\r\n */\r\n function SmallMap() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * A target map.\r\n */\r\n _this._chart = new MutableValueDisposer();\r\n _this.className = \"SmallMap\";\r\n // Set defaults\r\n _this.align = \"left\";\r\n _this.valign = \"bottom\";\r\n _this.percentHeight = 20;\r\n _this.percentWidth = 20;\r\n _this.margin(5, 5, 5, 5);\r\n var interfaceColors = new InterfaceColorSet();\r\n // Set background defailts\r\n _this.background.fillOpacity = 0.9;\r\n _this.background.fill = interfaceColors.getFor(\"background\");\r\n // Set up events\r\n _this.events.on(\"hit\", _this.moveToPosition, _this, false);\r\n _this.events.on(\"maxsizechanged\", _this.updateMapSize, _this, false);\r\n // Create a container\r\n _this.seriesContainer = _this.createChild(Container);\r\n _this.seriesContainer.shouldClone = false;\r\n // Create an outline rectangle\r\n var rectangle = _this.createChild(Rectangle);\r\n rectangle.shouldClone = false;\r\n rectangle.stroke = interfaceColors.getFor(\"alternativeBackground\");\r\n rectangle.strokeWidth = 1;\r\n rectangle.strokeOpacity = 0.5;\r\n rectangle.fill = color(); //\"none\";\r\n rectangle.verticalCenter = \"middle\";\r\n rectangle.horizontalCenter = \"middle\";\r\n rectangle.isMeasured = false;\r\n rectangle.visible = false;\r\n _this.rectangle = rectangle;\r\n _this._disposers.push(_this._chart);\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(SmallMap.prototype, \"series\", {\r\n /**\r\n * A list of map series used to draw the mini-map.\r\n *\r\n * @readonly\r\n * @return Series\r\n */\r\n get: function () {\r\n if (!this._series) {\r\n this._series = new List();\r\n this._series.events.on(\"inserted\", this.handleSeriesAdded, this, false);\r\n this._series.events.on(\"removed\", this.handleSeriesRemoved, this, false);\r\n }\r\n return this._series;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Decorates a new series when they are pushed into a `series` list.\r\n *\r\n * @param event Event\r\n */\r\n SmallMap.prototype.handleSeriesAdded = function (event) {\r\n var series = event.newValue;\r\n if (this.chart.series.contains(series)) {\r\n var newSeries = series.clone();\r\n this._series.removeValue(series);\r\n this._series.push(newSeries);\r\n series = newSeries;\r\n this.chart.dataUsers.push(newSeries);\r\n }\r\n series.chart = this.chart;\r\n series.parent = this.seriesContainer;\r\n series.interactionsEnabled = false;\r\n series.events.on(\"inited\", this.updateMapSize, this, false);\r\n series.hidden = false;\r\n };\r\n /**\r\n * Cleans up after series are removed from Scrollbar.\r\n *\r\n * @param event Event\r\n */\r\n SmallMap.prototype.handleSeriesRemoved = function (event) {\r\n //let sourceSeries: MapSeries = event.oldValue;\r\n this.invalidate();\r\n };\r\n /**\r\n * Moves main map pan position after click on the small map.\r\n *\r\n * @ignore Exclude from docs\r\n * @param event Event\r\n */\r\n SmallMap.prototype.moveToPosition = function (event) {\r\n var rectPoint = $utils.spritePointToSprite(event.spritePoint, this, this.seriesContainer);\r\n var geoPoint = this.chart.seriesPointToGeo(rectPoint);\r\n this.chart.zoomToGeoPoint(geoPoint, this.chart.zoomLevel, true);\r\n };\r\n Object.defineProperty(SmallMap.prototype, \"chart\", {\r\n /**\r\n * @return Chart/map\r\n */\r\n get: function () {\r\n return this._chart.get();\r\n },\r\n /**\r\n * A chart/map that this control is meant for.\r\n *\r\n * @param chart Chart/map\r\n */\r\n set: function (chart) {\r\n if (this.chart != chart) {\r\n this._chart.set(chart, new MultiDisposer([\r\n //chart.events.on(\"zoomlevelchanged\", this.updateRectangle, this, false),\r\n chart.events.on(\"mappositionchanged\", this.updateRectangle, this, false),\r\n chart.events.on(\"scaleratiochanged\", this.updateMapSize, this, false)\r\n ]));\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Updates the viewport recangle as per current map zoom/pan position.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n SmallMap.prototype.updateRectangle = function () {\r\n var chart = this.chart;\r\n var zoomLevel = chart.zoomLevel;\r\n var rectangle = this.rectangle;\r\n rectangle.width = this.pixelWidth / zoomLevel;\r\n rectangle.height = this.pixelHeight / zoomLevel;\r\n var scale = Math.min(this.percentWidth, this.percentHeight) / 100;\r\n var seriesContainer = chart.seriesContainer;\r\n rectangle.x = Math.ceil((-seriesContainer.pixelX) * scale / zoomLevel) + this.seriesContainer.pixelX;\r\n rectangle.y = Math.ceil((-seriesContainer.pixelY) * scale / zoomLevel) + this.seriesContainer.pixelY;\r\n rectangle.validate();\r\n };\r\n /**\r\n * Update map size so that internal elements can redraw themselves after\r\n * the size of the small map changes.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n SmallMap.prototype.updateMapSize = function () {\r\n if (this.chart) {\r\n var scale = this.chart.scaleRatio * Math.min(this.percentWidth, this.percentHeight) / 100;\r\n this.seriesContainer.scale = scale;\r\n var bbox = {\r\n width: 0,\r\n height: 0,\r\n x: 0,\r\n y: 0\r\n };\r\n try { // Add exception catching to tame FF\r\n bbox = this.seriesContainer.group.node.getBBox();\r\n }\r\n catch (err) { }\r\n if (bbox.width > 0) {\r\n this.rectangle.visible = true;\r\n }\r\n this.seriesContainer.x = this.pixelWidth / 2 - bbox.x * scale - bbox.width / 2 * scale;\r\n this.seriesContainer.y = this.pixelHeight / 2 - bbox.y * scale - bbox.height / 2 * scale;\r\n this.updateRectangle();\r\n this.afterDraw();\r\n }\r\n };\r\n /**\r\n * Update elements after drawing the small map.\r\n */\r\n SmallMap.prototype.afterDraw = function () {\r\n _super.prototype.afterDraw.call(this);\r\n //this.seriesContainer.moveTo({ x: this.pixelWidth / 2, y: this.pixelHeight / 2 });\r\n this.rectangle.maskRectangle = { x: -1, y: -1, width: Math.ceil(this.pixelWidth + 2), height: Math.ceil(this.pixelHeight + 2) };\r\n };\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n SmallMap.prototype.processConfig = function (config) {\r\n if (config) {\r\n // Set up series\r\n if ($type.hasValue(config.series) && $type.isArray(config.series)) {\r\n for (var i = 0, len = config.series.length; i < len; i++) {\r\n var series = config.series[i];\r\n if ($type.hasValue(series) && $type.isString(series) && this.map.hasKey(series)) {\r\n config.series[i] = this.map.getKey(series);\r\n }\r\n }\r\n }\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n return SmallMap;\r\n}(Container));\r\nexport { SmallMap };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"SmallMap\"] = SmallMap;\r\n//# sourceMappingURL=SmallMap.js.map","/**\r\n * A collection of GeoJSON format-related utility functions.\r\n */\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $array from \"../../core/utils/Array\";\r\n/**\r\n * Normalizes a geo-point.\r\n *\r\n * @ignore Exclude from docs\r\n * @param geoPoint Source geo-point\r\n * @return Normalized geo-point\r\n */\r\nexport function normalizePoint(geoPoint) {\r\n var longitude = wrapAngleTo180(geoPoint.longitude);\r\n var latitude = Math.asin(Math.sin((geoPoint.latitude * $math.RADIANS))) * $math.DEGREES;\r\n var latitude180 = wrapAngleTo180(geoPoint.latitude);\r\n if (Math.abs(latitude180) > 90) {\r\n longitude = wrapAngleTo180(longitude + 180);\r\n }\r\n geoPoint.longitude = longitude;\r\n geoPoint.latitude = latitude;\r\n return geoPoint;\r\n}\r\n/**\r\n * Normalizes all points of a geo-line.\r\n *\r\n * @ignore Exclude from docs\r\n * @param multiline Source geo-line\r\n * @return Normalized geo-line\r\n */\r\nexport function normalizeMultiline(multiline) {\r\n $array.each(multiline, function (segment) {\r\n $array.each(segment, function (point) {\r\n normalizePoint(point);\r\n });\r\n });\r\n return multiline;\r\n}\r\n/**\r\n * [wrapAngleTo180 description]\r\n *\r\n * @todo Description\r\n * @ignore Exclude from docs\r\n * @param angle Angle\r\n * @return Angle\r\n */\r\nexport function wrapAngleTo180(angle) {\r\n angle = angle % 360;\r\n if (angle > 180) {\r\n angle -= 360;\r\n }\r\n if (angle < -180) {\r\n angle += 360;\r\n }\r\n return angle;\r\n}\r\n/**\r\n * Converts a geo point to a regular point object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param geoPoint Source geo point\r\n * @return Point\r\n */\r\nexport function geoToPoint(geoPoint) {\r\n return { x: geoPoint.longitude, y: geoPoint.latitude };\r\n}\r\n//# sourceMappingURL=Geo.js.map","/**\r\n * Map line module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../../core/Container\";\r\nimport { registry } from \"../../core/Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws a line on the map.\r\n *\r\n * @see {@link IMapLineObjectEvents} for a list of available events\r\n * @see {@link IMapLineObjectAdapters} for a list of available Adapters\r\n */\r\nvar MapLineObject = /** @class */ (function (_super) {\r\n __extends(MapLineObject, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapLineObject() {\r\n var _this = _super.call(this) || this;\r\n _this.adjustRotation = true;\r\n _this.className = \"MapLineObject\";\r\n _this.isMeasured = false;\r\n _this.layout = \"none\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * (Re)validates element's position.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapLineObject.prototype.validatePosition = function () {\r\n var mapLine = this.mapLine;\r\n if (mapLine) {\r\n var point = mapLine.positionToPoint(this.position);\r\n this.x = point.x;\r\n this.y = point.y;\r\n if (this.adjustRotation) {\r\n this.rotation = point.angle;\r\n }\r\n var dataItem = this.mapLine.dataItem;\r\n if (dataItem) {\r\n var series = this.mapLine.dataItem.component;\r\n this.scale = 1 / series.scale;\r\n }\r\n // hide out of bounds\r\n if (mapLine.shortestDistance) {\r\n var projection = this.mapLine.series.chart.projection;\r\n var geoPoint = projection.positionToGeoPoint(mapLine.multiGeoLine, this.position);\r\n var visible = projection.d3Path({ type: 'Point', coordinates: [geoPoint.longitude, geoPoint.latitude] });\r\n if (!visible) {\r\n this.__disabled = true;\r\n }\r\n else {\r\n this.__disabled = false;\r\n }\r\n }\r\n }\r\n _super.prototype.validatePosition.call(this);\r\n };\r\n Object.defineProperty(MapLineObject.prototype, \"position\", {\r\n /**\r\n * @return Position within the line\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"position\");\r\n },\r\n /**\r\n * Sets object's relative position (0-1) within the line.\r\n *\r\n * `0` will place the object at the beginning of the line. `1` - at the end.\r\n *\r\n * Any intermediate number will place the object at some point within the\r\n * line.\r\n *\r\n * @param value Position within the line (0-1)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"position\", value, false, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapLineObject.prototype, \"adjustRotation\", {\r\n /**\r\n * @return Auto-rotate\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"adjustRotation\");\r\n },\r\n /**\r\n * If set to `true`, the object will be automatically rotated to face the\r\n * direction of the line at the specific position.\r\n *\r\n * This allows creating images that has its \"front\" always facing the logical\r\n * direction of the line.\r\n *\r\n * @default false\r\n * @param value Auto-rotate\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"adjustRotation\", value, false, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return MapLineObject;\r\n}(Container));\r\nexport { MapLineObject };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"MapLineObject\"] = MapLineObject;\r\n//# sourceMappingURL=MapLineObject.js.map","/**\r\n * Map image series module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { MapSeries, MapSeriesDataItem } from \"./MapSeries\";\r\nimport { MapImage } from \"./MapImage\";\r\nimport { ListTemplate, ListDisposer } from \"../../core/utils/List\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $array from \"../../core/utils/Array\";\r\nimport * as $mapUtils from \"./MapUtils\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport { Disposer } from \"../../core/utils/Disposer\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a [[DataItem]] for [[MapImageSeries]]\r\n * @see {@link DataItem}\r\n */\r\nvar MapImageSeriesDataItem = /** @class */ (function (_super) {\r\n __extends(MapImageSeriesDataItem, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapImageSeriesDataItem() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"MapImageSeriesDataItem\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * @ignore\r\n */\r\n MapImageSeriesDataItem.prototype.getFeature = function () {\r\n return { \"type\": \"Feature\", geometry: { type: \"Point\", coordinates: this.point } };\r\n };\r\n Object.defineProperty(MapImageSeriesDataItem.prototype, \"mapImage\", {\r\n /**\r\n * A [[MapImage]] element related to this data item.\r\n *\r\n * @return Element\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._mapImage) {\r\n var mapImage_1 = this.component.mapImages.create();\r\n this.addSprite(mapImage_1);\r\n this._mapImage = mapImage_1;\r\n this._disposers.push(mapImage_1);\r\n this._disposers.push(new Disposer(function () {\r\n if (_this.component) {\r\n _this.component.mapImages.removeValue(mapImage_1);\r\n }\r\n }));\r\n this.mapObject = mapImage_1;\r\n }\r\n return this._mapImage;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapImageSeriesDataItem.prototype, \"point\", {\r\n /**\r\n * @return [description]\r\n */\r\n get: function () {\r\n return this._point;\r\n },\r\n /**\r\n * [point description]\r\n *\r\n * @todo Description\r\n * @param point [description]\r\n */\r\n set: function (point) {\r\n this._point = point;\r\n this._geoPoint = $mapUtils.pointToGeo(point);\r\n this.updateExtremes();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapImageSeriesDataItem.prototype, \"multiPoint\", {\r\n /**\r\n * @return [description]\r\n */\r\n get: function () {\r\n return [this._point];\r\n },\r\n /**\r\n * [point description]\r\n *\r\n * @todo Description\r\n * @param point [description]\r\n */\r\n set: function (multiPoint) {\r\n this._point = multiPoint[0];\r\n this._geoPoint = $mapUtils.pointToGeo(this._point);\r\n this.updateExtremes();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapImageSeriesDataItem.prototype, \"geoPoint\", {\r\n /**\r\n * @return Image coordinates\r\n */\r\n get: function () {\r\n return this._geoPoint;\r\n },\r\n /**\r\n * Geographical coordinates (lat/long) image is placed at.\r\n *\r\n * @param geoPoint Image coordinates\r\n */\r\n set: function (geoPoint) {\r\n this._geoPoint = geoPoint;\r\n this.point = [geoPoint.longitude, geoPoint.latitude];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return MapImageSeriesDataItem;\r\n}(MapSeriesDataItem));\r\nexport { MapImageSeriesDataItem };\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A series of map image (marker) elements.\r\n *\r\n * @see {@link IMapImageSeriesEvents} for a list of available Events\r\n * @see {@link IMapImageSeriesAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar MapImageSeries = /** @class */ (function (_super) {\r\n __extends(MapImageSeries, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapImageSeries() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"MapImageSeries\";\r\n // Set data fields\r\n _this.dataFields.multiPoint = \"multiPoint\";\r\n _this.dataFields.point = \"point\";\r\n _this.dataFields.geoPoint = \"geoPoint\";\r\n _this.dataFields.multiGeoPoint = \"multiGeoPoint\";\r\n _this.ignoreBounds = true;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Returns a new/empty DataItem of the type appropriate for this object.\r\n *\r\n * @see {@link DataItem}\r\n * @return Data Item\r\n */\r\n MapImageSeries.prototype.createDataItem = function () {\r\n return new MapImageSeriesDataItem();\r\n };\r\n /**\r\n * (Re)validates the data of the sries, effectively forcing it to redraw\r\n * all of its elements.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapImageSeries.prototype.validateData = function () {\r\n var _this = this;\r\n if (this.data.length > 0 && this._parseDataFrom == 0) {\r\n this.mapImages.clear();\r\n }\r\n // process geoJSON and created map objects\r\n if (this.useGeodata) {\r\n if (this.useGeodata || this.geodata) {\r\n var geoJSON = this.chart.geodata;\r\n var features = void 0;\r\n if (geoJSON.type == \"FeatureCollection\") {\r\n features = geoJSON.features;\r\n }\r\n else if (geoJSON.type == \"Feature\") {\r\n features = [geoJSON];\r\n }\r\n else if ([\"Point\", \"LineString\", \"Polygon\", \"MultiPoint\", \"MultiLineString\", \"MultiPolygon\"].indexOf(geoJSON.type) != -1) {\r\n features = [{ geometry: geoJSON }];\r\n }\r\n else {\r\n console.log(\"nothing found in geoJSON\");\r\n }\r\n if (features) {\r\n var _loop_1 = function (i, len) {\r\n var feature = features[i];\r\n var geometry = feature.geometry;\r\n if (geometry) {\r\n var type = geometry.type;\r\n var id_1 = feature.id;\r\n if (type == \"Point\" || type == \"MultiPoint\") { // todo: we don't support multipoints at the moment actually\r\n if (!this_1.checkInclude(this_1.include, this_1.exclude, id_1)) {\r\n return \"continue\";\r\n }\r\n var coordinates = geometry.coordinates;\r\n // make the same as MultiPoint\r\n if (type == \"Point\") {\r\n coordinates = [coordinates];\r\n }\r\n var dataObject = $array.find(this_1.data, function (value, i) {\r\n return value.id == id_1;\r\n });\r\n if (!dataObject) {\r\n dataObject = { multiPoint: coordinates, id: id_1, madeFromGeoData: true };\r\n this_1.data.push(dataObject);\r\n }\r\n else {\r\n if (!dataObject.multiPoint) {\r\n dataObject.multiPoint = coordinates;\r\n }\r\n }\r\n // copy properties data to datacontext\r\n $utils.softCopyProperties(feature.properties, dataObject);\r\n }\r\n }\r\n };\r\n var this_1 = this;\r\n for (var i = 0, len = features.length; i < len; i++) {\r\n _loop_1(i, len);\r\n }\r\n }\r\n }\r\n }\r\n _super.prototype.validateData.call(this);\r\n // important! this should go after super.validateData\r\n // if data is parsed in chunks, images list is corrupted, fix it here\r\n $iter.each(this.dataItems.iterator(), function (dataItem) {\r\n var mapImage = dataItem.mapImage;\r\n if (!mapImage.isDisposed()) {\r\n _this.mapImages.moveValue(mapImage);\r\n if ($type.isNumber(mapImage.latitude) && $type.isNumber(mapImage.latitude)) {\r\n dataItem.geoPoint = { latitude: mapImage.latitude, longitude: mapImage.longitude };\r\n }\r\n }\r\n });\r\n };\r\n Object.defineProperty(MapImageSeries.prototype, \"mapImages\", {\r\n /**\r\n * A list of map images in the series.\r\n *\r\n * @return Map images\r\n */\r\n get: function () {\r\n if (!this._mapImages) {\r\n var template = new MapImage();\r\n var mapImages = new ListTemplate(template);\r\n this._disposers.push(new ListDisposer(mapImages));\r\n this._disposers.push(mapImages.template);\r\n mapImages.template.focusable = true;\r\n mapImages.events.on(\"inserted\", this.handleObjectAdded, this, false);\r\n this._mapImages = mapImages;\r\n this._mapObjects = mapImages;\r\n }\r\n return this._mapImages;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * (Re)validates data element, effectively triggering its redrawal.\r\n *\r\n * @ignore Exclude from docs\r\n * @param dataItem Data item\r\n */\r\n MapImageSeries.prototype.validateDataElement = function (dataItem) {\r\n _super.prototype.validateDataElement.call(this, dataItem);\r\n dataItem.mapImage.invalidate();\r\n };\r\n /**\r\n * (Re)validates the series\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapImageSeries.prototype.validate = function () {\r\n _super.prototype.validate.call(this);\r\n $iter.each(this.mapImages.iterator(), function (mapImage) {\r\n mapImage.validatePosition();\r\n });\r\n };\r\n /**\r\n * Copies all properties from another instance of [[Series]].\r\n *\r\n * @param source Source series\r\n */\r\n MapImageSeries.prototype.copyFrom = function (source) {\r\n this.mapImages.template.copyFrom(source.mapImages.template);\r\n _super.prototype.copyFrom.call(this, source);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapImageSeries.prototype.getFeatures = function () {\r\n var _this = this;\r\n var features = [];\r\n this.dataItems.each(function (dataItem) {\r\n var feature = dataItem.getFeature();\r\n if (feature) {\r\n features.push(feature);\r\n }\r\n });\r\n this.mapImages.each(function (mapImage) {\r\n if (_this.dataItems.indexOf(mapImage._dataItem) == -1) {\r\n var feature = mapImage.getFeature();\r\n if (feature) {\r\n features.push(feature);\r\n }\r\n }\r\n });\r\n return features;\r\n };\r\n /**\r\n * returns MapImage by id\r\n * @param image id\r\n * @return {MapImage}\r\n */\r\n MapImageSeries.prototype.getImageById = function (id) {\r\n return $iter.find(this.mapImages.iterator(), function (mapImage) {\r\n var dataContext = mapImage.dataItem.dataContext;\r\n if (mapImage.id == id || (dataContext && dataContext.id == id)) {\r\n return true;\r\n }\r\n });\r\n };\r\n return MapImageSeries;\r\n}(MapSeries));\r\nexport { MapImageSeries };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"MapImageSeries\"] = MapImageSeries;\r\nregistry.registeredClasses[\"MapImageSeriesDataItem\"] = MapImageSeriesDataItem;\r\n//# sourceMappingURL=MapImageSeries.js.map","/**\r\n * Map line module\r\n */\r\nimport { __extends, __values } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { MapObject } from \"./MapObject\";\r\nimport { MapLineObject } from \"./MapLineObject\";\r\nimport { MapImage } from \"./MapImage\";\r\nimport { MapImageSeries } from \"./MapImageSeries\";\r\nimport { Triangle } from \"../../core/elements/Triangle\";\r\nimport { ListTemplate, ListDisposer } from \"../../core/utils/List\";\r\nimport { Polyline } from \"../../core/elements/Polyline\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { color } from \"../../core/utils/Color\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { percent, Percent } from \"../../core/utils/Percent\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $geo from \"./Geo\";\r\nimport * as $mapUtils from \"./MapUtils\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Used to draw a line on the map.\r\n *\r\n * @see {@link IMapLineEvents} for a list of available events\r\n * @see {@link IMapLineAdapters} for a list of available Adapters\r\n */\r\nvar MapLine = /** @class */ (function (_super) {\r\n __extends(MapLine, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapLine() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * A list of event disposers for images.\r\n */\r\n _this._imageListeners = {};\r\n _this.className = \"MapLine\";\r\n _this.createLine();\r\n _this.line.stroke = color();\r\n _this.line.parent = _this;\r\n _this.strokeOpacity = 1;\r\n _this.setPropertyValue(\"precision\", 0.1);\r\n var interfaceColors = new InterfaceColorSet();\r\n _this.stroke = interfaceColors.getFor(\"grid\");\r\n _this.shortestDistance = true;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * @ignore\r\n */\r\n MapLine.prototype.createLine = function () {\r\n this.line = new Polyline();\r\n };\r\n /**\r\n * Converts a position within the line (0-1) to a physical point\r\n * coordinates.\r\n *\r\n * 0 indicates start of the line, 0.5 - middle, while 1 indicates the end.\r\n *\r\n * @param position Position (0-1)\r\n * @return Coordinates\r\n */\r\n MapLine.prototype.positionToPoint = function (position) {\r\n if (this.shortestDistance) {\r\n return this.series.chart.projection.positionToPoint(this.multiGeoLine, position);\r\n }\r\n else {\r\n if (this.line) {\r\n return this.line.positionToPoint(position);\r\n }\r\n }\r\n return { x: 0, y: 0, angle: 0 };\r\n };\r\n Object.defineProperty(MapLine.prototype, \"multiGeoLine\", {\r\n /**\r\n * @return Coordinates\r\n */\r\n get: function () {\r\n var multiGeoLine = this.getPropertyValue(\"multiGeoLine\");\r\n if (!multiGeoLine && this.dataItem && this.dataItem.multiGeoLine) {\r\n multiGeoLine = this.dataItem.multiGeoLine;\r\n }\r\n return multiGeoLine;\r\n },\r\n /**\r\n * A collection of X/Y coordinates for a multi-segment line. E.g.:\r\n *\r\n * ```JSON\r\n * [\r\n * // Segment 1\r\n * [\r\n * { longitude: 3.121, latitude: 0.58 },\r\n * { longitude: -5.199, latitude: 21.223 }\r\n * ],\r\n *\r\n * // Segment 2\r\n * [\r\n * { longitude: -5.199, latitude: 21.223 },\r\n * { longitude: -12.9, latitude: 25.85 }\r\n * ]\r\n * ]\r\n * ```\r\n *\r\n * @see {@link https://tools.ietf.org/html/rfc7946#section-3.1.5} GeoJSON MultiLineString reference\r\n * @param multiGeoLine Coordinates\r\n */\r\n set: function (multiGeoLine) {\r\n if (multiGeoLine && multiGeoLine.length > 0) {\r\n this.setPropertyValue(\"multiGeoLine\", $geo.normalizeMultiline(multiGeoLine), true);\r\n var multiLine = $mapUtils.multiGeoLineToMultiLine(multiGeoLine);\r\n this.setPropertyValue(\"multiLine\", multiLine);\r\n this.updateExtremes();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapLine.prototype, \"multiLine\", {\r\n /**\r\n * @return Coordinates\r\n */\r\n get: function () {\r\n var multiLine = this.getPropertyValue(\"multiLine\");\r\n if (!multiLine && this.dataItem && this.dataItem.multiLine) {\r\n multiLine = this.dataItem.multiLine;\r\n }\r\n return multiLine;\r\n },\r\n /**\r\n * A collection of X/Y coordinates for a multi-segment line. E.g.:\r\n *\r\n * ```JSON\r\n * [\r\n * // Segment 1\r\n * [\r\n * [ 100, 150 ],\r\n * [ 120, 200 ]\r\n * ],\r\n *\r\n * // Segment 2\r\n * [\r\n * [ 120, 200 ],\r\n * [ 150, 100 ]\r\n * ]\r\n * ]\r\n * ```\r\n *\r\n * @param multiLine Coordinates\r\n */\r\n set: function (multiLine) {\r\n this.setPropertyValue(\"multiLine\", multiLine);\r\n this.multiGeoLine = $mapUtils.multiLineToGeo(multiLine);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapLine.prototype, \"imagesToConnect\", {\r\n /**\r\n * @return {MapImages[]}\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"imagesToConnect\");\r\n },\r\n /**\r\n * Instead of setting longitudes/latitudes you can set an array of images\r\n * which will be connected by the line.\r\n *\r\n * Parameter is an array that can hold string `id`'s to of the images, or\r\n * references to actual [[MapImage]] objects.\r\n *\r\n * @param images Images\r\n */\r\n set: function (images) {\r\n var _this = this;\r\n this.setPropertyValue(\"imagesToConnect\", images, true);\r\n this.handleImagesToConnect();\r\n if (this.series) {\r\n var chart = this.series.chart;\r\n if (chart) {\r\n chart.series.each(function (series) {\r\n if (series instanceof MapImageSeries) {\r\n if (!series.isReady()) {\r\n _this._disposers.push(series.events.on(\"ready\", _this.handleImagesToConnect, _this, false));\r\n }\r\n }\r\n });\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n MapLine.prototype.handleImagesToConnect = function () {\r\n var e_1, _a;\r\n var _this = this;\r\n if (this.imagesToConnect) {\r\n var segment = [];\r\n var multiGeoLine = [segment];\r\n var _loop_1 = function (image) {\r\n if ($type.isString(image)) {\r\n var chart = this_1.series.chart;\r\n if (chart) {\r\n chart.series.each(function (series) {\r\n if (series instanceof MapImageSeries) {\r\n var img = series.getImageById(image);\r\n if (img) {\r\n image = img;\r\n }\r\n }\r\n });\r\n }\r\n }\r\n if (image instanceof MapImage) {\r\n segment.push({ longitude: image.longitude, latitude: image.latitude });\r\n if (!this_1._imageListeners[image.uid]) {\r\n var disposer = image.events.on(\"propertychanged\", function (event) {\r\n if (event.property == \"longitude\" || event.property == \"latitude\") {\r\n _this.handleImagesToConnect();\r\n _this.invalidate();\r\n }\r\n }, this_1, false);\r\n this_1._imageListeners[image.uid] = disposer;\r\n this_1._disposers.push(disposer);\r\n }\r\n }\r\n };\r\n var this_1 = this;\r\n try {\r\n for (var _b = __values(this.imagesToConnect), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var image = _c.value;\r\n _loop_1(image);\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n this.multiGeoLine = multiGeoLine;\r\n }\r\n };\r\n /**\r\n * (Re)validates the line, effectively forcing it to redraw.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapLine.prototype.validate = function () {\r\n var chart = this.series.chart;\r\n if (this.multiLine) {\r\n if (!this.shortestDistance) {\r\n var convertedPoints = [];\r\n for (var i = 0, len = this.multiLine.length; i < len; i++) {\r\n var segment = this.multiLine[i];\r\n var convertedSegmentPoints = [];\r\n for (var s = 0, slen = segment.length; s < slen; s++) {\r\n var geoPoint = segment[s];\r\n var point = this.series.chart.projection.convert({ longitude: geoPoint[0], latitude: geoPoint[1] });\r\n convertedSegmentPoints.push(point);\r\n }\r\n convertedPoints.push(convertedSegmentPoints);\r\n }\r\n this.line.segments = convertedPoints;\r\n }\r\n else {\r\n chart.projection.d3Projection.precision(this.precision);\r\n this.line.path = chart.projection.d3Path(this.getFeature());\r\n }\r\n if (this._arrow) {\r\n this._arrow.validatePosition();\r\n }\r\n $iter.each(this.lineObjects.iterator(), function (x) {\r\n x.validatePosition();\r\n });\r\n this.handleGlobalScale();\r\n }\r\n else if (this.imagesToConnect) {\r\n this.handleImagesToConnect();\r\n }\r\n _super.prototype.validate.call(this);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapLine.prototype.getFeature = function () {\r\n if (this.multiLine && this.multiLine.length > 0 && this.multiLine[0] && this.multiLine[0].length > 0) {\r\n return { \"type\": \"Feature\", geometry: { type: \"MultiLineString\", coordinates: this.multiLine } };\r\n }\r\n };\r\n /**\r\n * @ignore Exclude from docs\r\n */\r\n MapLine.prototype.measureElement = function () {\r\n // Overriding, just to avoid extra measure\r\n };\r\n Object.defineProperty(MapLine.prototype, \"shortestDistance\", {\r\n /**\r\n * @return Real path?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"shortestDistance\");\r\n },\r\n /**\r\n * The line should take the shortest path over the globe.\r\n *\r\n * Enabling this will make the line look differently in different\r\n * projections. Only `MapLine` supports this setting, `MapArc` and\r\n * `MapSplice` don't.\r\n *\r\n * @default true\r\n * @param value Real path?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"shortestDistance\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapLine.prototype, \"lineObjects\", {\r\n /**\r\n * List of separate line objects the line consists of.\r\n *\r\n * @readonly\r\n * @return List of line objects\r\n */\r\n get: function () {\r\n if (!this._lineObjects) {\r\n this._lineObjects = new ListTemplate(new MapLineObject());\r\n this._lineObjects.events.on(\"inserted\", this.handleLineObjectAdded, this, false);\r\n this._disposers.push(new ListDisposer(this._lineObjects));\r\n this._disposers.push(this._lineObjects.template);\r\n }\r\n return this._lineObjects;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Decorate a [[LineObject]] when it is added to the line.\r\n *\r\n * @param event Event\r\n */\r\n MapLine.prototype.handleLineObjectAdded = function (event) {\r\n var mapLineObject = event.newValue;\r\n mapLineObject.mapLine = this;\r\n mapLineObject.shouldClone = false;\r\n mapLineObject.parent = this;\r\n };\r\n Object.defineProperty(MapLine.prototype, \"arrow\", {\r\n /**\r\n * @return Arrow element\r\n */\r\n get: function () {\r\n if (!this._arrow) {\r\n var arrow = this.createChild(MapLineObject);\r\n arrow.shouldClone = false;\r\n arrow.width = 8;\r\n arrow.height = 10;\r\n arrow.mapLine = this;\r\n arrow.position = 0.5;\r\n var triangle = arrow.createChild(Triangle);\r\n //triangle.shouldClone = false;\r\n triangle.fillOpacity = 1;\r\n triangle.width = percent(100);\r\n triangle.height = percent(100);\r\n triangle.rotation = 90;\r\n triangle.horizontalCenter = \"middle\";\r\n triangle.verticalCenter = \"middle\";\r\n this._arrow = arrow;\r\n }\r\n return this._arrow;\r\n },\r\n /**\r\n * A [[MapLineObject]] to use as an option arrowhead on the line.\r\n *\r\n * Just accessing this property will create a default arrowhead on the line\r\n * automatically.\r\n *\r\n * @param arrow Arrow element\r\n */\r\n set: function (arrow) {\r\n this._arrow = arrow;\r\n arrow.mapLine = this;\r\n arrow.parent = this;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies line properties and other attributes, like arrow, from another\r\n * instance of [[MapLine]].\r\n *\r\n * @param source Source map line\r\n */\r\n MapLine.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.line.copyFrom(source.line);\r\n this.lineObjects.copyFrom(source.lineObjects);\r\n if (source._arrow) {\r\n this.arrow = source.arrow.clone();\r\n }\r\n };\r\n Object.defineProperty(MapLine.prototype, \"latitude\", {\r\n /**\r\n * Latitude of the line center.\r\n *\r\n * @readonly\r\n * @return Latitude\r\n */\r\n get: function () {\r\n return this.north + (this.south - this.north) / 2;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapLine.prototype, \"longitude\", {\r\n /**\r\n * Longitude of the line center.\r\n *\r\n * @readonly\r\n * @return Latitude\r\n */\r\n get: function () {\r\n return this.east + (this.west - this.east) / 2;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * X coordinate for the slice tooltip.\r\n *\r\n * @ignore\r\n * @return X\r\n */\r\n MapLine.prototype.getTooltipX = function () {\r\n var x = this.getPropertyValue(\"tooltipX\");\r\n if (!(x instanceof Percent)) {\r\n x = percent(50);\r\n }\r\n if (x instanceof Percent) {\r\n return this.positionToPoint(x.value).x;\r\n }\r\n else {\r\n return 0;\r\n }\r\n };\r\n /**\r\n * Y coordinate for the slice tooltip.\r\n *\r\n * @ignore\r\n * @return Y\r\n */\r\n MapLine.prototype.getTooltipY = function () {\r\n var y = this.getPropertyValue(\"tooltipY\");\r\n if (!(y instanceof Percent)) {\r\n y = percent(50);\r\n }\r\n if (y instanceof Percent) {\r\n return this.positionToPoint(y.value).y;\r\n }\r\n else {\r\n return 0;\r\n }\r\n };\r\n Object.defineProperty(MapLine.prototype, \"precision\", {\r\n /**\r\n * @return Precision\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"precision\");\r\n },\r\n /**\r\n * When line is plotted, if its `shortestDistance` is set to `true` it is\r\n * bent according to the used projection, to depict the shortest distance how\r\n * it would go on the actual land.\r\n *\r\n * `precision` introduces a setting which can control when such bending\r\n * occurs.\r\n *\r\n * If the distance (in degrees) between line start and end points\r\n * is less than `precision`, no bending will take place and the line will be\r\n * straight.\r\n *\r\n * Set to large number (e.g. 10000) for perfectly straight line.\r\n *\r\n * @since 4.9.1\r\n * @default 0.1\r\n * @param value Precision\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"precision\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return MapLine;\r\n}(MapObject));\r\nexport { MapLine };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"MapLine\"] = MapLine;\r\n//# sourceMappingURL=MapLine.js.map","/**\r\n * Map line series module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { MapSeries, MapSeriesDataItem } from \"./MapSeries\";\r\nimport { MapLine } from \"./MapLine\";\r\nimport { ListTemplate, ListDisposer } from \"../../core/utils/List\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $mapUtils from \"./MapUtils\";\r\nimport * as $array from \"../../core/utils/Array\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport { Disposer } from \"../../core/utils/Disposer\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a [[DataItem]] for [[MapLineSeries]]\r\n * @see {@link DataItem}\r\n */\r\nvar MapLineSeriesDataItem = /** @class */ (function (_super) {\r\n __extends(MapLineSeriesDataItem, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapLineSeriesDataItem() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"MapLineSeriesDataItem\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n MapLineSeriesDataItem.prototype.getFeature = function () {\r\n if (this.multiLine && this.multiLine.length > 0) {\r\n return { \"type\": \"Feature\", geometry: { type: \"MultiLineString\", coordinates: this.multiLine } };\r\n }\r\n };\r\n Object.defineProperty(MapLineSeriesDataItem.prototype, \"mapLine\", {\r\n /**\r\n * A [[MapLine]] element related to this data item.\r\n *\r\n * @readonly\r\n * @return Element\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._mapLine) {\r\n var mapLine_1 = this.component.mapLines.create();\r\n this._mapLine = mapLine_1;\r\n this.addSprite(mapLine_1);\r\n this._disposers.push(mapLine_1);\r\n this._disposers.push(new Disposer(function () {\r\n if (_this.component) {\r\n _this.component.mapLines.removeValue(mapLine_1);\r\n }\r\n }));\r\n this.mapObject = mapLine_1;\r\n }\r\n return this._mapLine;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapLineSeriesDataItem.prototype, \"line\", {\r\n /**\r\n * @return Coordinates\r\n */\r\n get: function () {\r\n return this._line;\r\n },\r\n /**\r\n * A collection of X/Y coordinates for a single-segment line. E.g.:\r\n *\r\n * ```JSON\r\n * [\r\n * [ 100, 150 ],\r\n * [ 120, 200 ]\r\n * ]\r\n * ```\r\n *\r\n * @param line Coordinates\r\n */\r\n set: function (line) {\r\n this._line = line;\r\n this.multiLine = [line];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapLineSeriesDataItem.prototype, \"multiLine\", {\r\n /**\r\n * @return Coordinates\r\n */\r\n get: function () {\r\n return this._multiLine;\r\n },\r\n /**\r\n * A collection of X/Y coordinates for a multi-segment line. E.g.:\r\n *\r\n * ```JSON\r\n * [\r\n * // Segment 1\r\n * [\r\n * [ 100, 150 ],\r\n * [ 120, 200 ]\r\n * ],\r\n *\r\n * // Segment 2\r\n * [\r\n * [ 120, 200 ],\r\n * [ 150, 100 ]\r\n * ]\r\n * ]\r\n * ```\r\n *\r\n * @param multiLine Coordinates\r\n */\r\n set: function (multiLine) {\r\n this._multiLine = multiLine;\r\n this._multiGeoLine = $mapUtils.multiLineToGeo(multiLine);\r\n this.updateExtremes();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapLineSeriesDataItem.prototype, \"geoLine\", {\r\n /**\r\n * @return Coordinates\r\n */\r\n get: function () {\r\n return this._geoLine;\r\n },\r\n /**\r\n * A collection of lat/long coordinates for a single-segment line. E.g.:\r\n *\r\n * ```JSON\r\n * [\r\n * { longitude: 3.121, latitude: 0.58 },\r\n * { longitude: -5.199, latitude: 21.223 }\r\n * ]\r\n * ```\r\n *\r\n * @see {@link https://tools.ietf.org/html/rfc7946#section-3.1.4} GeoJSON LineString reference\r\n * @param geoLine Coordinates\r\n */\r\n set: function (geoLine) {\r\n this._geoLine = geoLine;\r\n this.multiLine = $mapUtils.multiGeoLineToMultiLine([geoLine]);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapLineSeriesDataItem.prototype, \"multiGeoLine\", {\r\n /**\r\n * @return Coordinates\r\n */\r\n get: function () {\r\n return this._multiGeoLine;\r\n },\r\n /**\r\n * A collection of X/Y coordinates for a multi-segment line. E.g.:\r\n *\r\n * ```JSON\r\n * [\r\n * // Segment 1\r\n * [\r\n * { longitude: 3.121, latitude: 0.58 },\r\n * { longitude: -5.199, latitude: 21.223 }\r\n * ],\r\n *\r\n * // Segment 2\r\n * [\r\n * { longitude: -5.199, latitude: 21.223 },\r\n * { longitude: -12.9, latitude: 25.85 }\r\n * ]\r\n * ]\r\n * ```\r\n *\r\n * @see {@link https://tools.ietf.org/html/rfc7946#section-3.1.5} GeoJSON MultiLineString reference\r\n * @param multiGeoLine Coordinates\r\n */\r\n set: function (multiGeoLine) {\r\n this._multiGeoLine = multiGeoLine;\r\n this.multiLine = $mapUtils.multiGeoLineToMultiLine(multiGeoLine);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return MapLineSeriesDataItem;\r\n}(MapSeriesDataItem));\r\nexport { MapLineSeriesDataItem };\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A series of map line series.\r\n *\r\n * @see {@link IMapLineSeriesEvents} for a list of available Events\r\n * @see {@link IMapLineSeriesAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar MapLineSeries = /** @class */ (function (_super) {\r\n __extends(MapLineSeries, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapLineSeries() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"MapLineSeries\";\r\n // Set data fields\r\n _this.dataFields.multiLine = \"multiLine\";\r\n _this.dataFields.line = \"line\";\r\n _this.dataFields.geoLine = \"geoLine\";\r\n _this.dataFields.multiGeoLine = \"multiGeoLine\";\r\n _this.ignoreBounds = true;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Returns a new/empty DataItem of the type appropriate for this object.\r\n *\r\n * @see {@link DataItem}\r\n * @return Data Item\r\n */\r\n MapLineSeries.prototype.createDataItem = function () {\r\n return new MapLineSeriesDataItem();\r\n };\r\n /**\r\n * (Re)validates series data, effectively causing the whole series to be\r\n * redrawn.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapLineSeries.prototype.validateData = function () {\r\n // process geoJSON and created map objects\r\n if (this.useGeodata || this.geodata) {\r\n var geoJSON = this.chart.geodata;\r\n if (geoJSON) {\r\n var features = void 0;\r\n if (geoJSON.type == \"FeatureCollection\") {\r\n features = geoJSON.features;\r\n }\r\n else if (geoJSON.type == \"Feature\") {\r\n features = [geoJSON];\r\n }\r\n else if ([\"Point\", \"LineString\", \"Polygon\", \"MultiPoint\", \"MultiLineString\", \"MultiPolygon\"].indexOf(geoJSON.type) != -1) {\r\n features = [{ geometry: geoJSON }];\r\n }\r\n else {\r\n console.log(\"nothing found in geoJSON\");\r\n }\r\n if (features) {\r\n var _loop_1 = function (i, len) {\r\n var feature = features[i];\r\n var geometry = feature.geometry;\r\n if (geometry) {\r\n var type = geometry.type;\r\n var id_1 = feature.id;\r\n if (type == \"LineString\" || type == \"MultiLineString\") {\r\n if (!this_1.checkInclude(this_1.include, this_1.exclude, id_1)) {\r\n return \"continue\";\r\n }\r\n var coordinates = geometry.coordinates;\r\n var dataObject = $array.find(this_1.data, function (value, i) {\r\n return value.id == id_1;\r\n });\r\n if (type == \"LineString\") {\r\n coordinates = [coordinates];\r\n }\r\n if (!dataObject) {\r\n dataObject = { multiLine: coordinates, id: id_1, madeFromGeoData: true };\r\n this_1.data.push(dataObject);\r\n }\r\n else {\r\n if (!dataObject.multiLine) {\r\n dataObject.multiLine = coordinates;\r\n }\r\n }\r\n // copy properties data to datacontext\r\n $utils.softCopyProperties(feature.properties, dataObject);\r\n }\r\n }\r\n };\r\n var this_1 = this;\r\n for (var i = 0, len = features.length; i < len; i++) {\r\n _loop_1(i, len);\r\n }\r\n }\r\n }\r\n }\r\n _super.prototype.validateData.call(this);\r\n };\r\n Object.defineProperty(MapLineSeries.prototype, \"mapLines\", {\r\n /**\r\n * A list of lines in the series.\r\n *\r\n * @return Lines\r\n */\r\n get: function () {\r\n if (!this._mapLines) {\r\n var lineTemplate = this.createLine();\r\n var mapLines = new ListTemplate(lineTemplate);\r\n this._disposers.push(new ListDisposer(mapLines));\r\n this._disposers.push(mapLines.template);\r\n mapLines.events.on(\"inserted\", this.handleObjectAdded, this, false);\r\n this._mapLines = mapLines;\r\n this._mapObjects = mapLines;\r\n }\r\n return this._mapLines;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns a new line instance of suitable type.\r\n *\r\n * @return New line\r\n */\r\n MapLineSeries.prototype.createLine = function () {\r\n return new MapLine();\r\n };\r\n /**\r\n * (Re)validates the series\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapLineSeries.prototype.validate = function () {\r\n this.dataItems.each(function (dataItem) {\r\n $utils.used(dataItem.mapLine);\r\n });\r\n _super.prototype.validate.call(this);\r\n this.mapLines.each(function (mapLine) {\r\n mapLine.validate();\r\n });\r\n };\r\n /**\r\n * Copies all properties from another instance of [[Series]].\r\n *\r\n * @param source Source series\r\n */\r\n MapLineSeries.prototype.copyFrom = function (source) {\r\n this.mapLines.template.copyFrom(source.mapLines.template);\r\n _super.prototype.copyFrom.call(this, source);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapLineSeries.prototype.getFeatures = function () {\r\n var _this = this;\r\n var features = [];\r\n this.dataItems.each(function (dataItem) {\r\n var feature = dataItem.getFeature();\r\n if (feature) {\r\n features.push(feature);\r\n }\r\n });\r\n this.mapLines.each(function (mapLine) {\r\n if (_this.dataItems.indexOf(mapLine._dataItem) == -1) {\r\n var feature = mapLine.getFeature();\r\n if (feature) {\r\n features.push(feature);\r\n }\r\n }\r\n });\r\n return features;\r\n };\r\n /**\r\n * returns MapLine by id\r\n * @param line id\r\n * @return {MapLine}\r\n */\r\n MapLineSeries.prototype.getLineById = function (id) {\r\n return $iter.find(this.mapLines.iterator(), function (mapLine) {\r\n var dataContext = mapLine.dataItem.dataContext;\r\n return dataContext.id == id;\r\n });\r\n };\r\n return MapLineSeries;\r\n}(MapSeries));\r\nexport { MapLineSeries };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"MapLineSeries\"] = MapLineSeries;\r\nregistry.registeredClasses[\"MapLineSeriesDataItem\"] = MapLineSeriesDataItem;\r\n//# sourceMappingURL=MapLineSeries.js.map","/**\r\n * Graticule (map grid line).\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { MapLine } from \"./MapLine\";\r\nimport { registry } from \"../../core/Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Graticule is a map line spanning from the poles or around the globe.\r\n *\r\n * @since 4.3.0\r\n * @see {@link IGraticuleEvents} for a list of available events\r\n * @see {@link IGraticuleAdapters} for a list of available Adapters\r\n */\r\nvar Graticule = /** @class */ (function (_super) {\r\n __extends(Graticule, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Graticule() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"Graticule\";\r\n // Apply theme\r\n _this.applyTheme();\r\n _this.shortestDistance = true;\r\n return _this;\r\n }\r\n return Graticule;\r\n}(MapLine));\r\nexport { Graticule };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Graticule\"] = Graticule;\r\n//# sourceMappingURL=Graticule.js.map","export default function range(start, stop, step) {\n start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;\n\n var i = -1,\n n = Math.max(0, Math.ceil((stop - start) / step)) | 0,\n range = new Array(n);\n\n while (++i < n) {\n range[i] = start + i * step;\n }\n\n return range;\n}\n","import {range} from \"d3-array\";\nimport {abs, ceil, epsilon} from \"./math.js\";\n\nfunction graticuleX(y0, y1, dy) {\n var y = range(y0, y1 - epsilon, dy).concat(y1);\n return function(x) { return y.map(function(y) { return [x, y]; }); };\n}\n\nfunction graticuleY(x0, x1, dx) {\n var x = range(x0, x1 - epsilon, dx).concat(x1);\n return function(y) { return x.map(function(x) { return [x, y]; }); };\n}\n\nexport default function graticule() {\n var x1, x0, X1, X0,\n y1, y0, Y1, Y0,\n dx = 10, dy = dx, DX = 90, DY = 360,\n x, y, X, Y,\n precision = 2.5;\n\n function graticule() {\n return {type: \"MultiLineString\", coordinates: lines()};\n }\n\n function lines() {\n return range(ceil(X0 / DX) * DX, X1, DX).map(X)\n .concat(range(ceil(Y0 / DY) * DY, Y1, DY).map(Y))\n .concat(range(ceil(x0 / dx) * dx, x1, dx).filter(function(x) { return abs(x % DX) > epsilon; }).map(x))\n .concat(range(ceil(y0 / dy) * dy, y1, dy).filter(function(y) { return abs(y % DY) > epsilon; }).map(y));\n }\n\n graticule.lines = function() {\n return lines().map(function(coordinates) { return {type: \"LineString\", coordinates: coordinates}; });\n };\n\n graticule.outline = function() {\n return {\n type: \"Polygon\",\n coordinates: [\n X(X0).concat(\n Y(Y1).slice(1),\n X(X1).reverse().slice(1),\n Y(Y0).reverse().slice(1))\n ]\n };\n };\n\n graticule.extent = function(_) {\n if (!arguments.length) return graticule.extentMinor();\n return graticule.extentMajor(_).extentMinor(_);\n };\n\n graticule.extentMajor = function(_) {\n if (!arguments.length) return [[X0, Y0], [X1, Y1]];\n X0 = +_[0][0], X1 = +_[1][0];\n Y0 = +_[0][1], Y1 = +_[1][1];\n if (X0 > X1) _ = X0, X0 = X1, X1 = _;\n if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _;\n return graticule.precision(precision);\n };\n\n graticule.extentMinor = function(_) {\n if (!arguments.length) return [[x0, y0], [x1, y1]];\n x0 = +_[0][0], x1 = +_[1][0];\n y0 = +_[0][1], y1 = +_[1][1];\n if (x0 > x1) _ = x0, x0 = x1, x1 = _;\n if (y0 > y1) _ = y0, y0 = y1, y1 = _;\n return graticule.precision(precision);\n };\n\n graticule.step = function(_) {\n if (!arguments.length) return graticule.stepMinor();\n return graticule.stepMajor(_).stepMinor(_);\n };\n\n graticule.stepMajor = function(_) {\n if (!arguments.length) return [DX, DY];\n DX = +_[0], DY = +_[1];\n return graticule;\n };\n\n graticule.stepMinor = function(_) {\n if (!arguments.length) return [dx, dy];\n dx = +_[0], dy = +_[1];\n return graticule;\n };\n\n graticule.precision = function(_) {\n if (!arguments.length) return precision;\n precision = +_;\n x = graticuleX(y0, y1, 90);\n y = graticuleY(x0, x1, precision);\n X = graticuleX(Y0, Y1, 90);\n Y = graticuleY(X0, X1, precision);\n return graticule;\n };\n\n return graticule\n .extentMajor([[-180, -90 + epsilon], [180, 90 - epsilon]])\n .extentMinor([[-180, -80 - epsilon], [180, 80 + epsilon]]);\n}\n\nexport function graticule10() {\n return graticule()();\n}\n","/**\r\n * Graticule (map grid) series functionality.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { MapLineSeries, MapLineSeriesDataItem } from \"./MapLineSeries\";\r\nimport { Graticule } from \"./Graticule\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as d3geo from \"d3-geo\";\r\nimport * as $array from \"../../core/utils/Array\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a [[DataItem]] for [[GraticuleSeries]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nvar GraticuleSeriesDataItem = /** @class */ (function (_super) {\r\n __extends(GraticuleSeriesDataItem, _super);\r\n /**\r\n * Constructor\r\n */\r\n function GraticuleSeriesDataItem() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"GraticuleSeriesDataItem\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n return GraticuleSeriesDataItem;\r\n}(MapLineSeriesDataItem));\r\nexport { GraticuleSeriesDataItem };\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * This class is used to create a set of graticules (map grid).\r\n *\r\n * To enable, create like you would create any regular map series:\r\n *\r\n * ```TypeScript\r\n * let graticule = chart.series.push(new am4maps.GraticuleSeries())\r\n * graticule.mapLines.template.line.stroke = am4core.color(\"#000000\");\r\n * graticule.mapLines.template.line.strokeOpacity = 0.1;\r\n * ```\r\n * ```JavaScript\r\n * var graticule = chart.series.push(new am4maps.GraticuleSeries())\r\n * graticule.mapLines.template.line.stroke = am4core.color(\"#000000\");\r\n * graticule.mapLines.template.line.strokeOpacity = 0.1;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"series\": [{\r\n * \"type\": \"GraticuleSeries\",\r\n * \"mapLines\": {\r\n * \"line\": {\r\n * \"stroke\": \"#000000\",\r\n * \"strokeOpacity\": 0.1\r\n * }\r\n * }\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * @since 4.3.0\r\n * @see {@link IGraticuleSeriesEvents} for a list of available Events\r\n * @see {@link IGraticuleSeriesAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar GraticuleSeries = /** @class */ (function (_super) {\r\n __extends(GraticuleSeries, _super);\r\n /**\r\n * Constructor\r\n */\r\n function GraticuleSeries() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"GraticuleSeries\";\r\n _this.longitudeStep = 10;\r\n _this.latitudeStep = 10;\r\n _this.north = 90;\r\n _this.south = -90;\r\n _this.east = -180;\r\n _this.west = 180;\r\n //this.majorLatitudeStep = 90;\r\n //this.majorLongitudeStep = 360;\r\n _this.fitExtent = true;\r\n _this.singleSprite = true;\r\n _this.events.disableType(\"geoBoundsChanged\");\r\n _this.mapLines.template.line.strokeOpacity = 0.08;\r\n _this.ignoreBounds = false;\r\n _this.hiddenInLegend = true;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Returns a new/empty DataItem of the type appropriate for this object.\r\n *\r\n * @see {@link DataItem}\r\n * @return Data Item\r\n */\r\n GraticuleSeries.prototype.createDataItem = function () {\r\n return new GraticuleSeriesDataItem();\r\n };\r\n GraticuleSeries.prototype.validateData = function () {\r\n var _this = this;\r\n _super.prototype.validateData.call(this);\r\n this.mapLines.clear();\r\n var graticule = d3geo.geoGraticule();\r\n if (graticule) {\r\n graticule.stepMinor([this.longitudeStep, this.latitudeStep]);\r\n graticule.stepMajor([360, 360]);\r\n var chart = this.chart;\r\n if (this.fitExtent) {\r\n graticule.extent([[chart.east, chart.north], [chart.west, chart.south]]);\r\n }\r\n else {\r\n graticule.extent([[this.east, this.north], [this.west, this.south]]);\r\n }\r\n if (this.singleSprite) {\r\n var mapLine = this.mapLines.create();\r\n mapLine.multiLine = graticule().coordinates;\r\n }\r\n else {\r\n var lineStrings = graticule.lines();\r\n $array.each(lineStrings, function (lineString) {\r\n var mapLine = _this.mapLines.create();\r\n mapLine.multiLine = [lineString.coordinates];\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * Returns a new line instance of suitable type.\r\n *\r\n * @return New line\r\n */\r\n GraticuleSeries.prototype.createLine = function () {\r\n return new Graticule();\r\n };\r\n Object.defineProperty(GraticuleSeries.prototype, \"latitudeStep\", {\r\n /**\r\n * @return Step\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"latitudeStep\");\r\n },\r\n /**\r\n * Draw a graticule (grid) every X degrees of latitude.\r\n *\r\n * @default 10\r\n * @param value Step\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"latitudeStep\", value)) {\r\n this.invalidateData();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(GraticuleSeries.prototype, \"longitudeStep\", {\r\n /**\r\n * @return Step\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"longitudeStep\");\r\n },\r\n /**\r\n * Draw a graticule (grid) every X degrees of longitude.\r\n *\r\n * @default 10\r\n * @param value Step\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"longitudeStep\", value)) {\r\n this.invalidateData();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(GraticuleSeries.prototype, \"fitExtent\", {\r\n /**\r\n * @return Fit?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"fitExtent\");\r\n },\r\n /**\r\n * Draw a thicker (major) graticule every X degrees of latitude.\r\n *\r\n * @default 90\r\n * @param value Step\r\n */\r\n // public set majorLatitudeStep(value: number) {\r\n // \tif (this.setPropertyValue(\"majorLatitudeStep\", value)) {\r\n // \t\tthis.invalidateData();\r\n // \t}\r\n // }\r\n /**\r\n * @return Step\r\n */\r\n // public get majorLatitudeStep(): number {\r\n // \treturn this.getPropertyValue(\"majorLatitudeStep\");\r\n // }\r\n /**\r\n * Draw a thicker (major) graticule every X degrees of longitude.\r\n *\r\n * @default 360\r\n * @param value Step\r\n */\r\n // public set majorLongitudeStep(value: number) {\r\n // \tif (this.setPropertyValue(\"majorLongitudeStep\", value)) {\r\n // \t\tthis.invalidateData();\r\n // \t}\r\n // }\r\n /**\r\n * @return Step\r\n */\r\n // public get majorLongitudeStep(): number {\r\n // \treturn this.getPropertyValue(\"majorLongitudeStep\");\r\n // }\r\n /**\r\n * Whether to cap graticules (grid) to actual span of the map (`true`), e.g.\r\n * where there are polygons, or draw full-world grid (`false`).\r\n *\r\n * For world maps, using `false` makes sense. For smaller maps - not so much.\r\n *\r\n * If set to `false`, the grid will be drawn from this series `east` to\r\n * `west`, and from `south` to `north` (default values: `east = -180`;\r\n * `west = 180`; `south =-90`; `north =90`).\r\n *\r\n * These can be overridden by setting `GraticuleSeries`' respective\r\n * properties.\r\n *\r\n * @default true\r\n * @param value Fit?\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"fitExtent\", value)) {\r\n this.invalidateData();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(GraticuleSeries.prototype, \"singleSprite\", {\r\n /**\r\n * @return Use single sprite?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"singleSprite\");\r\n },\r\n /**\r\n * Whether to draw all the grid as a single element or as separate lines.\r\n *\r\n * Setting `true` (default) will result in better performance, whereas\r\n * `false` allows setting visual properties of each line individually.\r\n *\r\n * @default true\r\n * @param value Use single sprite?\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"singleSprite\", value)) {\r\n this.invalidateData();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return GraticuleSeries;\r\n}(MapLineSeries));\r\nexport { GraticuleSeries };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"GraticuleSeries\"] = GraticuleSeries;\r\nregistry.registeredClasses[\"GraticuleSeriesDataItem\"] = GraticuleSeriesDataItem;\r\n//# sourceMappingURL=GraticuleSeries.js.map","/**\r\n * Map module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { SerialChart, SerialChartDataItem } from \"./SerialChart\";\r\nimport { Disposer } from \"../../core/utils/Disposer\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { MapSeries } from \"../map/MapSeries\";\r\nimport { MapImage } from \"../map/MapImage\";\r\nimport { MapPolygon } from \"../map/MapPolygon\";\r\nimport { MapPolygonSeries } from \"../map/MapPolygonSeries\";\r\nimport { Projection } from \"../map/projections/Projection\";\r\nimport { Circle } from \"../../core/elements/Circle\";\r\nimport { SmallMap } from \"../map/SmallMap\";\r\nimport * as $mapUtils from \"../map/MapUtils\";\r\nimport { keyboard } from \"../../core/utils/Keyboard\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { options } from \"../../core/Options\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $ease from \"../../core/utils/Ease\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $geo from \"../map/Geo\";\r\nimport { GraticuleSeries } from \"../map/GraticuleSeries\";\r\nimport { getInteraction } from \"../../core/interaction/Interaction\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a [[DataItem]] for [[MapChart]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nvar MapChartDataItem = /** @class */ (function (_super) {\r\n __extends(MapChartDataItem, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapChartDataItem() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"MapChartDataItem\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n return MapChartDataItem;\r\n}(SerialChartDataItem));\r\nexport { MapChartDataItem };\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a map.\r\n *\r\n * @see {@link IMapChartEvents} for a list of available Events\r\n * @see {@link IMapChartAdapters} for a list of available Adapters\r\n * @see {@link https://www.amcharts.com/docs/v4/chart-types/map/} for documentation\r\n */\r\nvar MapChart = /** @class */ (function (_super) {\r\n __extends(MapChart, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapChart() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * A ratio to be used when scaling the map shapes.\r\n *\r\n * @readonly\r\n */\r\n _this.scaleRatio = 1;\r\n /**\r\n * Default duration of zoom animations (ms).\r\n */\r\n _this.zoomDuration = 1000;\r\n /**\r\n * Default zooming animation easing function.\r\n */\r\n _this.zoomEasing = $ease.cubicOut;\r\n /**\r\n * Smallest available zoom level. The map will not allow to zoom out past\r\n * this setting.\r\n *\r\n * NOTE: Should be power of 2.\r\n *\r\n * @default 1\r\n */\r\n _this.minZoomLevel = 1;\r\n /**\r\n * Biggest available zoom level. The map will not allow to zoom in past\r\n * this setting.\r\n *\r\n * NOTE: Should be power of 2.\r\n *\r\n * @default 32\r\n */\r\n _this.maxZoomLevel = 32;\r\n /**\r\n * [_prevZoomGeoPoint description]\r\n *\r\n * @todo Description\r\n */\r\n _this._prevZoomGeoPoint = { latitude: 0, longitude: 0 };\r\n _this.className = \"MapChart\";\r\n // Set default projection\r\n _this.projection = new Projection();\r\n _this.setPropertyValue(\"deltaLatitude\", 0);\r\n _this.setPropertyValue(\"deltaLongitude\", 0);\r\n _this.setPropertyValue(\"deltaGamma\", 0);\r\n _this.maxPanOut = 0.7;\r\n _this.homeZoomLevel = 1;\r\n _this.zoomStep = 2;\r\n _this.layout = \"absolute\";\r\n _this.centerMapOnZoomOut = true;\r\n // Set padding\r\n _this.padding(0, 0, 0, 0);\r\n $utils.used(_this.backgroundSeries);\r\n // so that the map would render in a hidden div too\r\n _this.minWidth = 10;\r\n _this.minHeight = 10;\r\n _this.events.once(\"inited\", _this.handleAllInited, _this, false);\r\n // Create a container for map series\r\n var seriesContainer = _this.seriesContainer;\r\n seriesContainer.visible = false;\r\n seriesContainer.inert = true;\r\n seriesContainer.resizable = true;\r\n seriesContainer.events.on(\"transformed\", _this.handleMapTransform, _this, false);\r\n seriesContainer.events.on(\"doublehit\", _this.handleDoubleHit, _this, false);\r\n seriesContainer.events.on(\"dragged\", _this.handleDrag, _this, false);\r\n seriesContainer.zIndex = 0;\r\n seriesContainer.dragWhileResize = true;\r\n //seriesContainer.background.fillOpacity = 0;\r\n seriesContainer.adapter.add(\"scale\", function (scale, target) {\r\n return $math.fitToRange(scale, _this.minZoomLevel, _this.maxZoomLevel);\r\n });\r\n // Set up events\r\n //this.events.on(\"validated\", this.updateExtremes, this);\r\n //this.events.on(\"datavalidated\", this.handleAllValidated, this, false);\r\n //this.events.on(\"datavalidated\", this.updateExtremes, this, false);\r\n _this.events.on(\"maxsizechanged\", function (event) {\r\n if (event.previousWidth == 0 || event.previousHeight == 0) {\r\n _this.updateExtremes();\r\n _this.updateCenterGeoPoint();\r\n }\r\n }, undefined, false);\r\n // Set up main chart container, e.g. set backgrounds and events to monitor\r\n // size changes, etc.\r\n var chartContainer = _this.chartContainer;\r\n chartContainer.parent = _this;\r\n chartContainer.zIndex = -1;\r\n _this._disposers.push(_this.events.on(\"maxsizechanged\", function () {\r\n if (_this.inited) {\r\n if (_this._mapAnimation) {\r\n _this._mapAnimation.stop();\r\n }\r\n var allInited_1 = true;\r\n _this.series.each(function (series) {\r\n series.updateTooltipBounds();\r\n if (!series.inited || series.dataInvalid) {\r\n allInited_1 = false;\r\n }\r\n });\r\n if (allInited_1) {\r\n _this.updateScaleRatio();\r\n }\r\n _this.zoomToGeoPoint(_this._zoomGeoPointReal, _this.zoomLevel, true, 0);\r\n }\r\n }, undefined, false));\r\n var chartContainerBg = chartContainer.background;\r\n chartContainerBg.fillOpacity = 0;\r\n chartContainerBg.events.on(\"down\", function (e) { _this.seriesContainer.dragStart(e.target.interactions.downPointers.getIndex(0)); }, _this);\r\n chartContainerBg.events.on(\"up\", function (e) { _this.seriesContainer.dragStop(); }, _this);\r\n chartContainerBg.events.on(\"doublehit\", _this.handleDoubleHit, _this);\r\n chartContainerBg.focusable = true;\r\n chartContainer.events.on(\"down\", _this.handleMapDown, _this, false);\r\n _this.addDisposer(seriesContainer.events.on(\"down\", function () {\r\n // Cancel any move inertia if there is one\r\n var inertia = _this.seriesContainer.interactions.inertias.getKey(\"move\");\r\n if (inertia) {\r\n inertia.done();\r\n }\r\n }));\r\n // Add description to background\r\n _this.background.fillOpacity = 0;\r\n // Add keyboard events for panning\r\n _this._disposers.push(getInteraction().body.events.on(\"keyup\", function (ev) {\r\n if (_this.topParent.hasFocused) {\r\n var key = keyboard.getEventKey(ev.event);\r\n if (!_this._zoomControl || !_this._zoomControl.thumb.isFocused) {\r\n switch (key) {\r\n case \"up\":\r\n _this.pan({ x: 0, y: 0.1 });\r\n break;\r\n case \"down\":\r\n _this.pan({ x: 0, y: -0.1 });\r\n break;\r\n case \"left\":\r\n _this.pan({ x: 0.1, y: 0 });\r\n break;\r\n case \"right\":\r\n _this.pan({ x: -0.1, y: 0 });\r\n break;\r\n }\r\n }\r\n }\r\n }, _this));\r\n _this.mouseWheelBehavior = \"zoom\";\r\n var interaction = getInteraction();\r\n _this._disposers.push(interaction.body.events.on(\"down\", _this.handlePanDown, _this));\r\n _this._disposers.push(interaction.body.events.on(\"up\", _this.handlePanUp, _this));\r\n //this._disposers.push(interaction.body.events.on(\"track\", this.handlePanMove, this));\r\n var panSprite = _this.seriesContainer.createChild(Circle);\r\n panSprite.radius = 10;\r\n panSprite.inert = true;\r\n panSprite.isMeasured = false;\r\n panSprite.events.on(\"transformed\", _this.handlePanMove, _this, false);\r\n panSprite.interactionsEnabled = false;\r\n panSprite.opacity = 0;\r\n panSprite.x = 0;\r\n panSprite.y = 0;\r\n _this.panSprite = panSprite;\r\n _this.panBehavior = \"move\";\r\n /*\r\n this.panSprite.inertiaOptions.setKey(\"move\", {\r\n \"time\": 100,\r\n \"duration\": 1000,\r\n \"factor\": 3,\r\n \"easing\": $ease.sinOut\r\n });*/\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * @ignore\r\n */\r\n MapChart.prototype.handlePanDown = function (event) {\r\n var svgPoint = $utils.documentPointToSvg(event.pointer.point, this.htmlContainer);\r\n if (svgPoint.x > 0 && svgPoint.y > 0 && svgPoint.x < this.svgContainer.width && svgPoint.y < this.svgContainer.height) {\r\n // Get local point\r\n this._downPointOrig = $utils.documentPointToSprite(event.pointer.point, this.seriesContainer);\r\n this.panSprite.moveTo(this._downPointOrig);\r\n this.panSprite.dragStart(event.pointer);\r\n this._downDeltaLongitude = this.deltaLongitude;\r\n this._downDeltaLatitude = this.deltaLatitude;\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapChart.prototype.handlePanUp = function (event) {\r\n if (this._downPointOrig) {\r\n this.panSprite.dragStop(event.pointer, true);\r\n }\r\n this._downPointOrig = undefined;\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapChart.prototype.handlePanMove = function () {\r\n if (!this.seriesContainer.isResized) {\r\n if (getInteraction().areTransformed([this.panSprite.interactions, this.seriesContainer.interactions])) {\r\n return;\r\n }\r\n var d3Projection = this.projection.d3Projection;\r\n var panBehavior = this.panBehavior;\r\n if (panBehavior != \"move\" && panBehavior != \"none\" && this._downPointOrig && d3Projection.rotate) {\r\n var rotation = d3Projection.rotate();\r\n var dln = rotation[0];\r\n var dlt = rotation[1];\r\n var dlg = rotation[2];\r\n d3Projection.rotate([0, 0, 0]);\r\n var downGeoLocal = this.projection.invert(this._downPointOrig);\r\n var local = { x: this.panSprite.pixelX, y: this.panSprite.pixelY };\r\n var geoLocal = void 0;\r\n if (local) {\r\n geoLocal = this.projection.invert(local);\r\n }\r\n d3Projection.rotate([dln, dlt, dlg]);\r\n if (geoLocal) {\r\n if (panBehavior == \"rotateLat\" || panBehavior == \"rotateLongLat\") {\r\n this.deltaLatitude = this._downDeltaLatitude + geoLocal.latitude - downGeoLocal.latitude;\r\n }\r\n if (panBehavior == \"rotateLong\" || panBehavior == \"rotateLongLat\") {\r\n this.deltaLongitude = this._downDeltaLongitude + geoLocal.longitude - downGeoLocal.longitude;\r\n }\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapChart.prototype.handleAllInited = function () {\r\n var _this = this;\r\n var inited = true;\r\n this.seriesContainer.visible = true;\r\n this.series.each(function (series) {\r\n if (!series.inited || series.dataInvalid) {\r\n inited = false;\r\n }\r\n });\r\n if (inited) {\r\n this.updateCenterGeoPoint();\r\n this.updateScaleRatio();\r\n this.goHome(0);\r\n }\r\n else {\r\n // TODO verify that this is correct\r\n var disposer_1 = registry.events.once(\"exitframe\", function () {\r\n _this.removeDispose(disposer_1);\r\n _this.handleAllInited();\r\n }, this, false);\r\n this.addDisposer(disposer_1);\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapChart.prototype.updateZoomGeoPoint = function () {\r\n var seriesPoint = $utils.svgPointToSprite({ x: this.innerWidth / 2 + this.pixelPaddingLeft, y: this.innerHeight / 2 + this.pixelPaddingTop }, this.series.getIndex(0));\r\n var geoPoint = this.projection.invert(seriesPoint);\r\n this._zoomGeoPointReal = geoPoint;\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapChart.prototype.updateCenterGeoPoint = function () {\r\n var maxLeft;\r\n var maxRight;\r\n var maxTop;\r\n var maxBottom;\r\n if (this.backgroundSeries) {\r\n var features = this.backgroundSeries.getFeatures();\r\n if (features.length > 0) {\r\n var bounds = this.projection.d3Path.bounds(features[0].geometry);\r\n maxLeft = bounds[0][0];\r\n maxTop = bounds[0][1];\r\n maxRight = bounds[1][0];\r\n maxBottom = bounds[1][1];\r\n }\r\n }\r\n else {\r\n this.series.each(function (series) {\r\n var bbox = series.group.node.getBBox();\r\n if (maxLeft > bbox.x || !$type.isNumber(maxLeft)) {\r\n maxLeft = bbox.x;\r\n }\r\n if (maxRight < bbox.x + bbox.width || !$type.isNumber(maxRight)) {\r\n maxRight = bbox.x + bbox.width;\r\n }\r\n if (maxTop > bbox.y || !$type.isNumber(maxTop)) {\r\n maxTop = bbox.y;\r\n }\r\n if (maxBottom < bbox.y + bbox.height || !$type.isNumber(maxBottom)) {\r\n maxBottom = bbox.y + bbox.height;\r\n }\r\n });\r\n }\r\n this.seriesMaxLeft = maxLeft;\r\n this.seriesMaxRight = maxRight;\r\n this.seriesMaxTop = maxTop;\r\n this.seriesMaxBottom = maxBottom;\r\n this.seriesWidth = maxRight - maxLeft;\r\n this.seriesHeight = maxBottom - maxTop;\r\n if (this.seriesWidth > 0 && this.seriesHeight > 0) {\r\n this.chartContainer.visible = true;\r\n this._centerGeoPoint = this.projection.invert({ x: maxLeft + (maxRight - maxLeft) / 2, y: maxTop + (maxBottom - maxTop) / 2 });\r\n if (!this._zoomGeoPointReal || !$type.isNumber(this._zoomGeoPointReal.latitude)) {\r\n this._zoomGeoPointReal = this._centerGeoPoint;\r\n }\r\n }\r\n else {\r\n this.chartContainer.visible = false;\r\n }\r\n };\r\n /**\r\n * Prevents map to be dragged out of the container area\r\n * @ignore\r\n */\r\n MapChart.prototype.handleDrag = function () {\r\n var d = this.zoomLevel * this.scaleRatio;\r\n var ww = this.seriesWidth * d;\r\n var hh = this.seriesHeight * d;\r\n var seriesContainer = this.seriesContainer;\r\n var maxLeft = this.seriesMaxLeft * d;\r\n var maxRight = this.seriesMaxRight * d;\r\n var maxTop = this.seriesMaxTop * d;\r\n var maxBottom = this.seriesMaxBottom * d;\r\n var x = seriesContainer.pixelX;\r\n var y = seriesContainer.pixelY;\r\n var maxPanOut = this.maxPanOut;\r\n var minX = Math.min(this.maxWidth * (1 - maxPanOut) - ww - maxLeft, -maxLeft);\r\n if (x < minX) {\r\n x = minX;\r\n }\r\n var maxX = Math.max(this.maxWidth * maxPanOut - maxLeft, this.maxWidth - maxRight);\r\n if (x > maxX) {\r\n x = maxX;\r\n }\r\n var minY = Math.min(this.maxHeight * (1 - maxPanOut) - hh - maxTop, -maxTop);\r\n if (y < minY) {\r\n y = minY;\r\n }\r\n var maxY = Math.max(this.maxHeight * maxPanOut - maxTop, this.maxHeight - maxBottom);\r\n if (y > maxY) {\r\n y = maxY;\r\n }\r\n seriesContainer.moveTo({ x: x, y: y }, undefined, undefined, true);\r\n this._zoomGeoPointReal = this.zoomGeoPoint;\r\n };\r\n /**\r\n * Sets defaults that instantiate some objects that rely on parent, so they\r\n * cannot be set in constructor.\r\n */\r\n MapChart.prototype.applyInternalDefaults = function () {\r\n _super.prototype.applyInternalDefaults.call(this);\r\n // Add a default screen reader title for accessibility\r\n // This will be overridden in screen reader if there are any `titles` set\r\n if (!$type.hasValue(this.readerTitle)) {\r\n this.readerTitle = this.language.translate(\"Map\");\r\n }\r\n if (!$type.hasValue(this.background.readerTitle)) {\r\n this.background.role = \"application\";\r\n this.background.readerTitle = this.language.translate(\"Use plus and minus keys on your keyboard to zoom in and out\");\r\n }\r\n };\r\n /**\r\n * Handles event when a pointer presses down on the map, e.g. user presses\r\n * down mouse or touches the map on a screen.\r\n *\r\n * Stops all animations currently going on.\r\n */\r\n MapChart.prototype.handleMapDown = function () {\r\n if (this._mapAnimation) {\r\n this._mapAnimation.stop();\r\n }\r\n };\r\n /**\r\n * Handles the event when user doubleclicks or dooubletaps the map: zooms\r\n * in on the reference point.\r\n *\r\n * @param event Original event\r\n */\r\n MapChart.prototype.handleDoubleHit = function (event) {\r\n var svgPoint = $utils.documentPointToSvg(event.point, this.htmlContainer, this.svgContainer.cssScale);\r\n var geoPoint = this.svgPointToGeo(svgPoint);\r\n this.zoomIn(geoPoint);\r\n };\r\n /**\r\n * Handles mouse wheel event, e.g. user rotates mouse wheel while over the\r\n * map: zooms in or out depending on the direction of the wheel turn.\r\n *\r\n * @param event Original event\r\n */\r\n MapChart.prototype.handleWheel = function (event) {\r\n // Cancel any move inertia if there is one\r\n var inertia = this.seriesContainer.interactions.inertias.getKey(\"move\");\r\n if (inertia) {\r\n inertia.done();\r\n }\r\n var svgPoint = $utils.documentPointToSvg(event.point, this.htmlContainer, this.svgContainer.cssScale);\r\n var geoPoint = this.svgPointToGeo(svgPoint);\r\n if (event.shift.y < 0) {\r\n this.zoomIn(geoPoint, undefined, this.interactions.mouseOptions.sensitivity);\r\n }\r\n else {\r\n this.zoomOut(geoPoint, undefined, this.interactions.mouseOptions.sensitivity);\r\n }\r\n };\r\n Object.defineProperty(MapChart.prototype, \"mouseWheelBehavior\", {\r\n /**\r\n * @return mouse wheel behavior\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"mouseWheelBehavior\");\r\n },\r\n /**\r\n * Specifies what should chart do if when mouse wheel is rotated.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/reference/sprite/#mouseOptions_property} More information about `mouseOptions`\r\n * @param mouse wheel behavior\r\n * @default zoomX\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"mouseWheelBehavior\", value)) {\r\n if (value != \"none\") {\r\n this._mouseWheelDisposer = this.chartContainer.events.on(\"wheel\", this.handleWheel, this, false);\r\n this._disposers.push(this._mouseWheelDisposer);\r\n }\r\n else {\r\n if (this._mouseWheelDisposer) {\r\n this._mouseWheelDisposer.dispose();\r\n }\r\n this.chartContainer.wheelable = false;\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapChart.prototype, \"panBehavior\", {\r\n /**\r\n * @returns Behavior\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"panBehavior\");\r\n },\r\n /**\r\n * What \"dragging\" map does.\r\n *\r\n * Available values:\r\n * * `\"move\"` (default): changes position of the map.\r\n * * `\"rotateLat\"`: changes `deltaLatitude` (rotates the globe vertically).\r\n * * `\"rotateLong\"`: changes `deltaLongitude` (rotates the globe horizontally).\r\n * * `\"rotateLongLat\"`: changes both `deltaLongitude` and `deltaLatitude` (rotates the globe in any direction).\r\n *\r\n * @default \"move\"\r\n * @since 4.3.0\r\n * @param value Behavior\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"panBehavior\", value)) {\r\n var seriesContainer = this.seriesContainer;\r\n this.panSprite.draggable = false;\r\n seriesContainer.draggable = false;\r\n switch (value) {\r\n case \"move\":\r\n seriesContainer.draggable = true;\r\n break;\r\n default:\r\n this.panSprite.draggable = true;\r\n break;\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapChart.prototype, \"centerMapOnZoomOut\", {\r\n /**\r\n * @returns If the map should be centered when zooming out.\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"centerMapOnZoomOut\");\r\n },\r\n /**\r\n * Specifies if the map should be centered when zooming out\r\n * @default true\r\n * @since 4.7.12\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"centerMapOnZoomOut\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapChart.prototype, \"projection\", {\r\n /**\r\n * @return Projection\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"projection\");\r\n },\r\n /**\r\n * Projection to use for the map.\r\n *\r\n * Available projections:\r\n * * Albers\r\n * * AlbersUSA\r\n * * AzimuthalEqualArea\r\n * * Eckert6\r\n * * EqualEarth\r\n * * Mercator\r\n * * Miller\r\n * * NaturalEarth\r\n * * Orthographic\r\n * * Stereographic\r\n *\r\n * ```TypeScript\r\n * map.projection = new am4maps.projections.Mercator();\r\n * ```\r\n * ```JavaScript\r\n * map.projection = new am4maps.projections.Mercator();\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"projection\": \"Mercator\"\r\n * // ...\r\n * }\r\n * ```\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/chart-types/map/#Setting_projection} More about projections\r\n * @param projection Projection\r\n */\r\n set: function (projection) {\r\n var _this = this;\r\n if (this.setPropertyValue(\"projection\", projection)) {\r\n this.invalidateProjection();\r\n projection.chart = this;\r\n if (this._backgroundSeries) {\r\n this._backgroundSeries.invalidate();\r\n }\r\n if (this.inited) {\r\n this.updateExtremes();\r\n }\r\n this.series.each(function (series) {\r\n series.events.once(\"validated\", function () {\r\n _this.updateCenterGeoPoint();\r\n _this.updateScaleRatio();\r\n _this.goHome(0);\r\n });\r\n });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Validates (processes) data items.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapChart.prototype.validateDataItems = function () {\r\n _super.prototype.validateDataItems.call(this);\r\n this.updateExtremes();\r\n };\r\n /**\r\n * Calculates the longitudes and latitudes of the most distant points from\r\n * the center in all four directions: West, East, North, and South.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapChart.prototype.updateExtremes = function () {\r\n var east;\r\n var north;\r\n var west;\r\n var south;\r\n this.series.each(function (series) {\r\n if (series.ignoreBounds || (series instanceof GraticuleSeries && series.fitExtent)) {\r\n }\r\n else {\r\n if (series.north > north || !$type.isNumber(north)) {\r\n north = series.north;\r\n }\r\n if (series.south < south || !$type.isNumber(south)) {\r\n south = series.south;\r\n }\r\n if (series.west < west || !$type.isNumber(west)) {\r\n west = series.west;\r\n }\r\n if (series.east > east || !$type.isNumber(east)) {\r\n east = series.east;\r\n }\r\n }\r\n });\r\n var features = [];\r\n var foundGraticule = false;\r\n // if we gave graticule, get features of these series only for faster fitSize\r\n this.series.each(function (series) {\r\n if (series instanceof GraticuleSeries && !series.fitExtent) {\r\n features = series.getFeatures();\r\n foundGraticule = true;\r\n }\r\n });\r\n if (!foundGraticule) {\r\n this.series.each(function (series) {\r\n if (series.ignoreBounds || (series instanceof GraticuleSeries && series.fitExtent)) {\r\n }\r\n else {\r\n features = features.concat(series.getFeatures());\r\n }\r\n });\r\n }\r\n var w = $math.max(50, this.innerWidth);\r\n var h = $math.max(50, this.innerHeight);\r\n var d3Projection = this.projection.d3Projection;\r\n if (features.length > 0 && d3Projection && (this.east != east || this.west != west || this.north != north || this.south != south)) {\r\n this.east = east;\r\n this.west = west;\r\n this.north = north;\r\n this.south = south;\r\n if (d3Projection.rotate) {\r\n var rotation = d3Projection.rotate();\r\n var deltaLong = rotation[0];\r\n var deltaLat = rotation[1];\r\n var deltaGamma = rotation[2];\r\n this.deltaLongitude = deltaLong;\r\n this.deltaLatitude = deltaLat;\r\n this.deltaGamma = deltaGamma;\r\n }\r\n var geoJSON = { \"type\": \"FeatureCollection\", features: features };\r\n var initialScale = d3Projection.scale();\r\n d3Projection.fitSize([w, h], geoJSON);\r\n if (d3Projection.scale() != initialScale) {\r\n this.invalidateDataUsers();\r\n }\r\n this.series.each(function (series) {\r\n if (series instanceof GraticuleSeries) {\r\n series.invalidateData();\r\n }\r\n });\r\n if (this._backgroundSeries) {\r\n var polygon = this._backgroundSeries.mapPolygons.getIndex(0);\r\n if (polygon) {\r\n polygon.multiPolygon = $mapUtils.getBackground(this.north, this.east, this.south, this.west);\r\n }\r\n }\r\n this._fitWidth = w;\r\n this._fitHeight = h;\r\n }\r\n if (!this._zoomGeoPointReal || !$type.isNumber(this._zoomGeoPointReal.latitude)) {\r\n this.goHome(0);\r\n }\r\n };\r\n /**\r\n * (Re)calculates a ratio which should be used to scale the actual map so\r\n * that it fits perfectly into available space. Helps to avoid redrawing of all the map if container size changes\r\n * @ignore\r\n */\r\n MapChart.prototype.updateScaleRatio = function () {\r\n var scaleRatio;\r\n this.updateCenterGeoPoint();\r\n var hScale = this.innerWidth / this.seriesWidth;\r\n var vScale = this.innerHeight / this.seriesHeight;\r\n scaleRatio = $math.min(hScale, vScale);\r\n if ($type.isNaN(scaleRatio) || scaleRatio == Infinity) {\r\n scaleRatio = 1;\r\n }\r\n if (scaleRatio != this.scaleRatio) {\r\n this.scaleRatio = scaleRatio;\r\n $iter.each(this.series.iterator(), function (series) {\r\n series.scale = scaleRatio;\r\n series.updateTooltipBounds();\r\n });\r\n this.backgroundSeries.scale = scaleRatio;\r\n this.dispatch(\"scaleratiochanged\");\r\n }\r\n };\r\n /**\r\n * Converts a point within map container to geographical (lat/long)\r\n * coordinates.\r\n *\r\n * @param point Source point\r\n * @return Geo-point\r\n */\r\n MapChart.prototype.svgPointToGeo = function (point) {\r\n var series = this.series.getIndex(0);\r\n if (series) {\r\n var seriesPoint = $utils.svgPointToSprite(point, series);\r\n return this.seriesPointToGeo(seriesPoint);\r\n }\r\n };\r\n /**\r\n * Converts geographical (lat/long) coordinates to an X/Y point within map's\r\n * container.\r\n *\r\n * @param point Source geo-point\r\n * @return Point\r\n */\r\n MapChart.prototype.geoPointToSVG = function (point) {\r\n var series = this.series.getIndex(0);\r\n if (series) {\r\n var seriesPoint = this.geoPointToSeries(point);\r\n return $utils.spritePointToSvg(seriesPoint, series);\r\n }\r\n };\r\n /**\r\n * Converts a point (X/Y) within actual objects of the map to geographical\r\n * (lat/long) coordinates.\r\n *\r\n * @param point Source point\r\n * @return Geo-point\r\n */\r\n MapChart.prototype.seriesPointToGeo = function (point) {\r\n return this.projection.invert(point);\r\n };\r\n /**\r\n * Converts geographical (lat/long) coordinates to an X/Y point within\r\n * actual elements/objects of the maps.\r\n *\r\n * @param point Source geo-point\r\n * @return Point\r\n */\r\n MapChart.prototype.geoPointToSeries = function (point) {\r\n return this.projection.convert(point);\r\n };\r\n Object.defineProperty(MapChart.prototype, \"geodata\", {\r\n /**\r\n * @return GeoJSON data\r\n */\r\n get: function () {\r\n return this._geodata;\r\n },\r\n /**\r\n * Map data in GeoJSON format.\r\n *\r\n * The Map supports the following GeoJSON objects: `Point`, `LineString`,\r\n * `Polygon`, `MultiPoint`, `MultiLineString`, and `MultiPolygon`.\r\n *\r\n * @see {@link http://geojson.org/} Official GeoJSON format specification\r\n * @param geoJSON GeoJSON data\r\n */\r\n set: function (geodata) {\r\n if (geodata != this._geodata) {\r\n this._geodata = geodata;\r\n if (this.reverseGeodata) {\r\n this.processReverseGeodata(this._geodata);\r\n }\r\n this.invalidateData();\r\n this.dataUsers.each(function (dataUser) {\r\n for (var i = dataUser.data.length - 1; i >= 0; i--) {\r\n if (dataUser.data[i].madeFromGeoData == true) {\r\n dataUser.data.splice(i, 1);\r\n }\r\n }\r\n dataUser.disposeData();\r\n dataUser.invalidateData();\r\n });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapChart.prototype, \"reverseGeodata\", {\r\n /**\r\n * @returns Reverse the order of geodata coordinates?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"reverseGeodata\");\r\n },\r\n /**\r\n * Indicates whether GeoJSON geodata supplied to the chart uses\r\n * ESRI (clockwise) or non-ESRI (counter-clockwise) order of the polygon\r\n * coordinates.\r\n *\r\n * `MapChart` supports only ESRI standard, so if your custom maps appears\r\n * garbled, try setting `reverseGeodata = true`.\r\n *\r\n * @default false\r\n * @since 4.10.11\r\n * @param value Reverse the order of geodata coordinates?\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"reverseGeodata\", value) && this._geodata) {\r\n this.processReverseGeodata(this._geodata);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Reverses the order of polygons on a GeoJSON data.\r\n *\r\n * @since 4.10.11\r\n * @param geodata Source geodata\r\n */\r\n MapChart.prototype.processReverseGeodata = function (geodata) {\r\n for (var i = 0; i < geodata.features.length; i++) {\r\n var feature = geodata.features[i];\r\n for (var x = 0; x < feature.geometry.coordinates.length; x++) {\r\n if (feature.geometry.type == \"MultiPolygon\") {\r\n for (var y = 0; y < feature.geometry.coordinates[x].length; y++) {\r\n feature.geometry.coordinates[x][y].reverse();\r\n }\r\n }\r\n else {\r\n feature.geometry.coordinates[x].reverse();\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Zooms the map to particular zoom level and centers on a latitude/longitude\r\n * coordinate.\r\n *\r\n * @param point Center coordinate\r\n * @param zoomLevel Zoom level\r\n * @param center Center on the given coordinate?\r\n * @param duration Duration for zoom animation (ms)\r\n * @return Zoom animation\r\n */\r\n MapChart.prototype.zoomToGeoPoint = function (point, zoomLevel, center, duration, mapObject) {\r\n var _this = this;\r\n if (!point) {\r\n var hasData_1 = false;\r\n this.series.each(function (series) {\r\n if (series.dataItems.length > 0) {\r\n hasData_1 = true;\r\n }\r\n });\r\n if (hasData_1) {\r\n point = this.zoomGeoPoint;\r\n }\r\n else {\r\n return;\r\n }\r\n }\r\n if (!point || !$type.isNumber(point.longitude) || !$type.isNumber(point.latitude)) {\r\n return;\r\n }\r\n this._zoomGeoPointReal = point;\r\n zoomLevel = $math.fitToRange(zoomLevel, this.minZoomLevel, this.maxZoomLevel);\r\n var seriesPoint = this.projection.convert(point);\r\n if (seriesPoint) {\r\n var svgPoint = this.geoPointToSVG(point);\r\n var mapPoint = $utils.svgPointToSprite(svgPoint, this);\r\n if (center) {\r\n mapPoint = {\r\n x: this.innerWidth / 2,\r\n y: this.innerHeight / 2\r\n };\r\n }\r\n if (!$type.isNumber(duration)) {\r\n duration = this.zoomDuration;\r\n }\r\n var x = mapPoint.x - seriesPoint.x * zoomLevel * this.scaleRatio;\r\n var y = mapPoint.y - seriesPoint.y * zoomLevel * this.scaleRatio;\r\n if (!mapObject && zoomLevel < this.zoomLevel && this.centerMapOnZoomOut && zoomLevel < 1.5) {\r\n x = this.innerWidth / 2 - (this.seriesMaxLeft + (this.seriesMaxRight - this.seriesMaxLeft) / 2) * zoomLevel * this.scaleRatio;\r\n y = this.innerHeight / 2 - (this.seriesMaxTop + (this.seriesMaxBottom - this.seriesMaxTop) / 2) * zoomLevel * this.scaleRatio;\r\n }\r\n this._mapAnimation = this.seriesContainer.animate([{\r\n property: \"scale\",\r\n to: zoomLevel\r\n }, {\r\n property: \"x\", from: this.seriesContainer.pixelX,\r\n to: x\r\n }, {\r\n property: \"y\", from: this.seriesContainer.pixelY,\r\n to: y\r\n }], duration, this.zoomEasing);\r\n this._disposers.push(this._mapAnimation.events.on(\"animationended\", function () {\r\n _this._zoomGeoPointReal = _this.zoomGeoPoint;\r\n }));\r\n this.seriesContainer.validatePosition();\r\n return this._mapAnimation;\r\n }\r\n };\r\n /**\r\n * Zooms the map to a particular map object.\r\n *\r\n * @param mapObject Target map object\r\n * @param zoomLevel Zoom level\r\n * @param center Center on the given coordinate?\r\n * @param duration Duration for zoom animation (ms)\r\n * @return Zoom animation\r\n */\r\n MapChart.prototype.zoomToMapObject = function (mapObject, zoomLevel, center, duration) {\r\n if (center == undefined) {\r\n center = true;\r\n }\r\n var inertia = this.seriesContainer.interactions.inertias.getKey(\"move\");\r\n if (inertia) {\r\n inertia.done();\r\n }\r\n if (mapObject instanceof MapImage) {\r\n if ($type.isNaN(zoomLevel)) {\r\n zoomLevel = 5;\r\n }\r\n return this.zoomToGeoPoint({ latitude: mapObject.latitude, longitude: mapObject.longitude }, zoomLevel, center, duration, true);\r\n }\r\n var dataItem = mapObject.dataItem;\r\n if (dataItem && $type.isNumber(dataItem.zoomLevel)) {\r\n zoomLevel = dataItem.zoomLevel;\r\n }\r\n if (mapObject instanceof MapPolygon) {\r\n var dataItem_1 = mapObject.dataItem;\r\n var bbox = mapObject.polygon.bbox;\r\n if (bbox.width == 0 || bbox.height == 0) {\r\n bbox = mapObject.polygon.group.getBBox();\r\n }\r\n if (!$type.isNumber(zoomLevel)) {\r\n zoomLevel = Math.min(this.seriesWidth / bbox.width, this.seriesHeight / bbox.height);\r\n }\r\n var geoPoint = void 0;\r\n if (dataItem_1 && $type.hasValue(dataItem_1.zoomGeoPoint)) {\r\n geoPoint = dataItem_1.zoomGeoPoint;\r\n }\r\n else {\r\n // this is more accurate\r\n var polygonPoint = { x: bbox.x + bbox.width / 2, y: bbox.y + bbox.height / 2 };\r\n var seriesPoint = $utils.spritePointToSprite(polygonPoint, mapObject.polygon, mapObject.series);\r\n geoPoint = this.seriesPointToGeo(seriesPoint);\r\n }\r\n return this.zoomToGeoPoint(geoPoint, zoomLevel, true, duration, true);\r\n }\r\n };\r\n /**\r\n * Zooms the map to a particular viewport.\r\n *\r\n * The `north`, `east`, `south`, and `west` define boundaries of the\r\n * imaginary viewort we want to zoom the map to.\r\n *\r\n * `level` is not actual zoom level. The map will determine the zoom level\r\n * required to accommodated such zoom, and will adjust it by `level` if set.\r\n *\r\n * @param north Latitude of the North-most boundary\r\n * @param east Longitude of the East-most boundary\r\n * @param south Latitude of the South-most boundary\r\n * @param west Longitude of the West-most boundary\r\n * @param level Adjust zoom level\r\n * @param center Center on the given coordinate?\r\n * @param duration Duration for zoom animation (ms)\r\n * @return Zoom animation\r\n */\r\n MapChart.prototype.zoomToRectangle = function (north, east, south, west, level, center, duration) {\r\n if ($type.isNaN(level)) {\r\n level = 1;\r\n }\r\n var w = $math.min(west, east);\r\n var e = $math.max(west, east);\r\n west = w;\r\n east = e;\r\n var splitLongitude = $math.normalizeAngle(180 - this.deltaLongitude);\r\n if (splitLongitude > 180) {\r\n splitLongitude -= 360;\r\n }\r\n var newLong = west + (east - west) / 2;\r\n var d = (west - east);\r\n if (west < splitLongitude && east > splitLongitude) {\r\n newLong += 180;\r\n d = $math.normalizeAngle(east - west - 360);\r\n }\r\n var zoomLevel = level * Math.min((this.south - this.north) / (south - north), Math.abs((this.west - this.east) / d));\r\n return this.zoomToGeoPoint({ latitude: north + (south - north) / 2, longitude: newLong }, zoomLevel, center, duration, true);\r\n };\r\n /**\r\n * Zooms in the map, optionally centering on particular latitude/longitude\r\n * point.\r\n *\r\n * @param geoPoint Optional center point\r\n * @param duration Duration for zoom animation (ms)\r\n * @return Zoom animation\r\n */\r\n MapChart.prototype.zoomIn = function (geoPoint, duration, sensitivity) {\r\n if (sensitivity === void 0) { sensitivity = 1; }\r\n var step = 1 + (this.zoomStep - 1) * sensitivity;\r\n if (step < 1) {\r\n step = 1;\r\n }\r\n return this.zoomToGeoPoint(geoPoint, this.zoomLevel * step, false, duration);\r\n };\r\n /**\r\n * Zooms out the map, optionally centering on particular latitude/longitude\r\n * point.\r\n *\r\n * @param geoPoint Optional center point\r\n * @param duration Duration for zoom animation (ms)\r\n * @return Zoom animation\r\n */\r\n MapChart.prototype.zoomOut = function (geoPoint, duration, sensitivity) {\r\n if (sensitivity === void 0) { sensitivity = 1; }\r\n var step = 1 + (this.zoomStep - 1) * sensitivity;\r\n if (step < 1) {\r\n step = 1;\r\n }\r\n return this.zoomToGeoPoint(geoPoint, this.zoomLevel / step, false, duration);\r\n };\r\n /**\r\n * Pans the maps using relative coordinates. E.g.:\r\n *\r\n * ```JSON\r\n * {\r\n * x: 0.1,\r\n * y: -0.1\r\n * }\r\n * ```\r\n *\r\n * The above will move the map by 10% to the right, and by 10% upwards.\r\n *\r\n * @param shift Vertical and horizontal shift\r\n * @param duration Pan animation duration (ms)\r\n */\r\n MapChart.prototype.pan = function (shift, duration) {\r\n var point = this.geoPointToSVG(this.zoomGeoPoint);\r\n point.x += this.pixelWidth * shift.x;\r\n point.y += this.pixelHeight * shift.y;\r\n this.zoomToGeoPoint(this.svgPointToGeo(point), this.zoomLevel, true, duration, true);\r\n };\r\n Object.defineProperty(MapChart.prototype, \"zoomGeoPoint\", {\r\n /**\r\n * Current lat/long coordinates for the center of the viewport. (default\r\n * zoom reference point)\r\n *\r\n * @readonly\r\n * @return Coordinates\r\n */\r\n get: function () {\r\n var point = $utils.spritePointToSvg({ x: this.pixelWidth / 2, y: this.pixelHeight / 2 }, this);\r\n return this.svgPointToGeo(point);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapChart.prototype, \"zoomLevel\", {\r\n /**\r\n * @return Zoom level\r\n */\r\n get: function () {\r\n return this.seriesContainer.scale;\r\n },\r\n /**\r\n * Current zoom level.\r\n *\r\n * @readonly\r\n * @return Zoom level\r\n */\r\n set: function (value) {\r\n this.seriesContainer.scale = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Dispatches events after some map transformation, like pan or zoom.\r\n *\r\n * @ignore\r\n */\r\n MapChart.prototype.handleMapTransform = function () {\r\n if (this.zoomLevel != this._prevZoomLevel) {\r\n this.dispatch(\"zoomlevelchanged\");\r\n this._prevZoomLevel = this.zoomLevel;\r\n this.svgContainer.readerAlert(this.language.translate(\"Zoom level changed to %1\", this.language.locale, $type.castString(this.zoomLevel)));\r\n }\r\n if (this.zoomGeoPoint && (this._prevZoomGeoPoint.latitude != this.zoomGeoPoint.latitude || this._prevZoomGeoPoint.longitude != this.zoomGeoPoint.longitude)) {\r\n this.dispatch(\"mappositionchanged\");\r\n }\r\n };\r\n Object.defineProperty(MapChart.prototype, \"smallMap\", {\r\n /**\r\n * @return Small map\r\n */\r\n get: function () {\r\n if (!this._smallMap) {\r\n var smallMap = new SmallMap();\r\n this.smallMap = smallMap;\r\n }\r\n return this._smallMap;\r\n },\r\n /**\r\n * A [[SmallMap]] to be used on the map.\r\n *\r\n * Please note, that accessing this property will NOT create a small map\r\n * if it has not yet been created. (except in JSON)\r\n *\r\n * ```TypeScript\r\n * // Create a small map\r\n * map.smallMap = new am4maps.SmallMap();\r\n * ```\r\n * ```JavaScript\r\n * // Create a small map\r\n * map.smallMap = new am4maps.SmallMap();\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"smallMap\": {}\r\n * // ...\r\n * }\r\n * ```\r\n *\r\n * @param smallMap Small map\r\n */\r\n set: function (smallMap) {\r\n if (this._smallMap) {\r\n this.removeDispose(this._smallMap);\r\n }\r\n this._smallMap = smallMap;\r\n this._smallMap.chart = this;\r\n smallMap.parent = this.chartContainer;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapChart.prototype, \"zoomControl\", {\r\n /**\r\n * @return Zoom control\r\n */\r\n get: function () {\r\n return this._zoomControl;\r\n },\r\n /**\r\n * A [[ZoomControl]] to be used on the map.\r\n *\r\n * Please note, that accessing this property will NOT create a zoom control\r\n * if it has not yet been created. (except in JSON)\r\n *\r\n * ```TypeScript\r\n * // Create a zoom control\r\n * map.zoomControl = new am4maps.ZoomControl();\r\n * ```\r\n * ```JavaScript\r\n * // Create a zoom control\r\n * map.zoomControl = new am4maps.ZoomControl();\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"zoomControl\": {}\r\n * // ...\r\n * }\r\n * ```\r\n *\r\n * @param zoomControl Zoom control\r\n */\r\n set: function (zoomControl) {\r\n if (this._zoomControl) {\r\n this.removeDispose(this._zoomControl);\r\n }\r\n this._zoomControl = zoomControl;\r\n zoomControl.chart = this;\r\n zoomControl.parent = this.chartContainer;\r\n zoomControl.plusButton.exportable = false;\r\n zoomControl.minusButton.exportable = false;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates and returns a map series of appropriate type.\r\n *\r\n * @return Map series\r\n */\r\n MapChart.prototype.createSeries = function () {\r\n return new MapSeries();\r\n };\r\n Object.defineProperty(MapChart.prototype, \"deltaLongitude\", {\r\n /**\r\n * @return Rotation\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"deltaLongitude\");\r\n },\r\n /**\r\n * Degrees to rotate the map around vertical axis (Y).\r\n *\r\n * E.g. if set to -160, the longitude 20 will become a new center, creating\r\n * a Pacific-centered map.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/chart-types/map/#Map_rotation} For more info on map rotation.\r\n * @param value Rotation\r\n */\r\n set: function (value) {\r\n value = $math.round(value, 3);\r\n if (this.setPropertyValue(\"deltaLongitude\", $geo.wrapAngleTo180(value))) {\r\n this.rotateMap();\r\n this.updateZoomGeoPoint();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapChart.prototype, \"deltaLatitude\", {\r\n /**\r\n * @return Rotation\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"deltaLatitude\");\r\n },\r\n /**\r\n * Degrees to rotate the map around horizontal axis (X).\r\n *\r\n * E.g. setting this to 90 will put Antarctica directly in the center of\r\n * the map.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/chart-types/map/#Map_rotation} For more info on map rotation.\r\n * @since 4.3.0\r\n * @param value Rotation\r\n */\r\n set: function (value) {\r\n value = $math.round(value, 3);\r\n if (this.setPropertyValue(\"deltaLatitude\", value)) {\r\n this.rotateMap();\r\n this.updateZoomGeoPoint();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapChart.prototype, \"deltaGamma\", {\r\n /**\r\n * @return Rotation\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"deltaGamma\");\r\n },\r\n /**\r\n * Degrees to rotate the map around \"Z\" axis. This is the axis that pierces\r\n * the globe directly from the viewer's point of view.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/chart-types/map/#Map_rotation} For more info on map rotation.\r\n * @since 4.3.0\r\n * @param value Rotation\r\n */\r\n set: function (value) {\r\n value = $math.round(value, 3);\r\n if (this.setPropertyValue(\"deltaGamma\", value)) {\r\n this.rotateMap();\r\n this.updateZoomGeoPoint();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n MapChart.prototype.rotateMap = function () {\r\n if (this.projection.d3Projection) {\r\n if (this.projection.d3Projection.rotate) {\r\n this.projection.d3Projection.rotate([this.deltaLongitude, this.deltaLatitude, this.deltaGamma]);\r\n this.invalidateProjection();\r\n //this.updateExtremes(); // removal fixes #3292\r\n }\r\n }\r\n };\r\n Object.defineProperty(MapChart.prototype, \"maxPanOut\", {\r\n /**\r\n * @return Max pan out\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"maxPanOut\");\r\n },\r\n /**\r\n * Maximum portion of the map's width/height to allow panning \"off screen\".\r\n *\r\n * A value of 0 (zero) will prevent any portion of the the map to be panned\r\n * outside the viewport.\r\n *\r\n * 0.5 will allow half of the map to be outside viewable area.\r\n *\r\n * @default 0.7\r\n * @param value Max pan out\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"maxPanOut\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapChart.prototype, \"homeGeoPoint\", {\r\n /**\r\n * @return Home geo point\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"homeGeoPoint\");\r\n },\r\n /**\r\n * The geographical point to center map on when it is first loaded.\r\n *\r\n * The map will also be centered to this point when you call `goHome()`\r\n * method.\r\n *\r\n * @param value Home geo point\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"homeGeoPoint\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapChart.prototype, \"homeZoomLevel\", {\r\n /**\r\n * @return Home zoom level\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"homeZoomLevel\");\r\n },\r\n /**\r\n * The zoom level to put the map in when it is first loaded.\r\n *\r\n * The map will also be set to this zoom level when you call `goHome()`\r\n * method.\r\n *\r\n * @param value Home zoom level\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"homeZoomLevel\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapChart.prototype, \"zoomStep\", {\r\n /**\r\n * @return Zoom factor\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"zoomStep\");\r\n },\r\n /**\r\n * When user zooms in or out current zoom level is multiplied or divided\r\n * by value of this setting.\r\n *\r\n * @default 2\r\n * @param value Zoom factor\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"zoomStep\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Invalidates projection, causing all series to be redrawn.\r\n *\r\n * Call this after changing projection or its settings.\r\n */\r\n MapChart.prototype.invalidateProjection = function () {\r\n this.east = undefined;\r\n this.invalidateDataUsers();\r\n this.updateCenterGeoPoint();\r\n };\r\n Object.defineProperty(MapChart.prototype, \"geodataSource\", {\r\n /**\r\n * Returns a [[DataSource]] specifically for loading Component's data.\r\n *\r\n * @return Data source\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._dataSources[\"geodata\"]) {\r\n var dataSource = this.getDataSource(\"geodata\");\r\n dataSource.events.on(\"parseended\", function () {\r\n _this.events.once(\"datavalidated\", function () {\r\n _this.goHome(0);\r\n });\r\n });\r\n }\r\n return this._dataSources[\"geodata\"];\r\n },\r\n /**\r\n * Sets a [[DataSource]] to be used for loading Component's data.\r\n *\r\n * @param value Data source\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n if (this._dataSources[\"geodata\"]) {\r\n this.removeDispose(this._dataSources[\"geodata\"]);\r\n }\r\n this._dataSources[\"geodata\"] = value;\r\n this._dataSources[\"geodata\"].component = this;\r\n this.events.on(\"inited\", function () {\r\n _this.loadData(\"geodata\");\r\n }, this, false);\r\n this.setDataSourceEvents(value, \"geodata\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n MapChart.prototype.processConfig = function (config) {\r\n if ($type.hasValue(config[\"geodata\"]) && $type.isString(config[\"geodata\"])) {\r\n var name_1 = config[\"geodata\"];\r\n // Check if there's a map loaded by such name\r\n if ($type.hasValue(window[\"am4geodata_\" + config[\"geodata\"]])) {\r\n config[\"geodata\"] = window[\"am4geodata_\" + config[\"geodata\"]];\r\n }\r\n // Nope. Let's try maybe we got JSON as string?\r\n else {\r\n try {\r\n config[\"geodata\"] = JSON.parse(config[\"geodata\"]);\r\n }\r\n catch (e) {\r\n // No go again. Error out.\r\n this.raiseCriticalError(Error(\"MapChart error: Geodata `\" + name_1 + \"` is not loaded or is incorrect.\"), true);\r\n }\r\n }\r\n }\r\n // Instantiate projection\r\n if ($type.hasValue(config[\"projection\"]) && $type.isString(config[\"projection\"])) {\r\n config[\"projection\"] = this.createClassInstance(config[\"projection\"]);\r\n }\r\n // Set up small map\r\n if ($type.hasValue(config.smallMap) && !$type.hasValue(config.smallMap.type)) {\r\n config.smallMap.type = \"SmallMap\";\r\n }\r\n // Set up zoom control\r\n if ($type.hasValue(config.zoomControl) && !$type.hasValue(config.zoomControl.type)) {\r\n config.zoomControl.type = \"ZoomControl\";\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n /**\r\n * Decorates a new [[Series]] object with required parameters when it is\r\n * added to the chart.\r\n *\r\n * @ignore Exclude from docs\r\n * @param event Event\r\n */\r\n MapChart.prototype.handleSeriesAdded = function (event) {\r\n _super.prototype.handleSeriesAdded.call(this, event);\r\n var series = event.newValue;\r\n series.scale = this.scaleRatio;\r\n series.events.on(\"validated\", this.updateCenterGeoPoint, this, false);\r\n };\r\n /**\r\n * This function is used to sort element's JSON config properties, so that\r\n * some properties that absolutely need to be processed last, can be put at\r\n * the end.\r\n *\r\n * @ignore Exclude from docs\r\n * @param a Element 1\r\n * @param b Element 2\r\n * @return Sorting number\r\n */\r\n MapChart.prototype.configOrder = function (a, b) {\r\n if (a == b) {\r\n return 0;\r\n }\r\n // Must come last\r\n else if (a == \"smallMap\") {\r\n return 1;\r\n }\r\n else if (b == \"smallMap\") {\r\n return -1;\r\n }\r\n else if (a == \"series\") {\r\n return 1;\r\n }\r\n else if (b == \"series\") {\r\n return -1;\r\n }\r\n else {\r\n return _super.prototype.configOrder.call(this, a, b);\r\n }\r\n };\r\n /**\r\n * Adds `projection` to \"as is\" fields.\r\n *\r\n * @param field Field name\r\n * @return Assign as is?\r\n */\r\n MapChart.prototype.asIs = function (field) {\r\n return field == \"projection\" || field == \"geodata\" || _super.prototype.asIs.call(this, field);\r\n };\r\n Object.defineProperty(MapChart.prototype, \"centerGeoPoint\", {\r\n /**\r\n * Geo point of map center\r\n *\r\n * @readonly\r\n */\r\n get: function () {\r\n return this._centerGeoPoint;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Resets the map to its original position and zoom level.\r\n *\r\n * Use the only parameter to set number of milliseconds for the zoom\r\n * animation to play.\r\n *\r\n * @param duration Duration (ms)\r\n */\r\n MapChart.prototype.goHome = function (duration) {\r\n var homeGeoPoint = this.homeGeoPoint;\r\n if (!homeGeoPoint) {\r\n homeGeoPoint = this.centerGeoPoint;\r\n }\r\n if (homeGeoPoint) {\r\n this.zoomToGeoPoint(homeGeoPoint, this.homeZoomLevel, true, duration, true);\r\n }\r\n };\r\n /**\r\n * Sets [[Paper]] instance to use to draw elements.\r\n *\r\n * @ignore\r\n * @param paper Paper\r\n * @return true if paper was changed, false, if it's the same\r\n */\r\n MapChart.prototype.setPaper = function (paper) {\r\n if (this.svgContainer) {\r\n this.svgContainer.hideOverflow = true;\r\n }\r\n return _super.prototype.setPaper.call(this, paper);\r\n };\r\n Object.defineProperty(MapChart.prototype, \"backgroundSeries\", {\r\n /**\r\n * Background series will create polygons that will fill all the map area\r\n * with some color (or other fill).\r\n *\r\n * This might be useful with non-rectangular projections, like Orthographic,\r\n * Albers, etc.\r\n *\r\n * To change background color/opacity access polygon template.\r\n *\r\n * ```TypeScript\r\n * chart.backgroundSeries.mapPolygons.template.polygon.fill = am4core.color(\"#fff\");\r\n * chart.backgroundSeries.mapPolygons.template.polygon.fillOpacity = 0.1;\r\n * ```\r\n * ```JavaScript\r\n * chart.backgroundSeries.mapPolygons.template.polygon.fill = am4core.color(\"#fff\");\r\n * chart.backgroundSeries.mapPolygons.template.polygon.fillOpacity = 0.1;\r\n * ```\r\n * ```JSON\r\n * {\r\n * \"backgroundSeries\": {\r\n * \"mapPolygons\": {\r\n * \"polygon\": {\r\n * \"fill\": \"#fff\",\r\n * \"fillOpacity\": 0.1\r\n * }\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * @since 4.3.0\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._backgroundSeries) {\r\n var backgroundSeries = new MapPolygonSeries();\r\n backgroundSeries.parent = this.seriesContainer;\r\n backgroundSeries.chart = this;\r\n backgroundSeries.hiddenInLegend = true;\r\n backgroundSeries.mapPolygons.template.focusable = false;\r\n backgroundSeries.addDisposer(new Disposer(function () {\r\n _this._backgroundSeries = undefined;\r\n }));\r\n this._disposers.push(backgroundSeries);\r\n var interfaceColors = new InterfaceColorSet();\r\n var color = interfaceColors.getFor(\"background\");\r\n var polygonTemplate = backgroundSeries.mapPolygons.template.polygon;\r\n polygonTemplate.stroke = color;\r\n polygonTemplate.fill = color;\r\n polygonTemplate.fillOpacity = 0;\r\n polygonTemplate.strokeOpacity = 0;\r\n //polygonTemplate.focusable = false;\r\n backgroundSeries.mapPolygons.create();\r\n this._backgroundSeries = backgroundSeries;\r\n }\r\n return this._backgroundSeries;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Prepares the legend instance for use in this chart.\r\n *\r\n * @param legend Legend\r\n */\r\n MapChart.prototype.setLegend = function (legend) {\r\n _super.prototype.setLegend.call(this, legend);\r\n if (legend) {\r\n legend.parent = this;\r\n }\r\n };\r\n /**\r\n * @param value Tap to activate?\r\n */\r\n MapChart.prototype.setTapToActivate = function (value) {\r\n _super.prototype.setTapToActivate.call(this, value);\r\n // setup other containers\r\n this.seriesContainer.interactions.isTouchProtected = true;\r\n this.panSprite.interactions.isTouchProtected = true;\r\n };\r\n MapChart.prototype.handleTapToActivate = function () {\r\n _super.prototype.handleTapToActivate.call(this);\r\n this.seriesContainer.interactions.isTouchProtected = false;\r\n this.panSprite.interactions.isTouchProtected = false;\r\n };\r\n MapChart.prototype.handleTapToActivateDeactivation = function () {\r\n _super.prototype.handleTapToActivateDeactivation.call(this);\r\n this.seriesContainer.interactions.isTouchProtected = true;\r\n this.panSprite.interactions.isTouchProtected = true;\r\n };\r\n /**\r\n * Adds easing functions to \"function\" fields.\r\n *\r\n * @param field Field name\r\n * @return Assign as function?\r\n */\r\n MapChart.prototype.asFunction = function (field) {\r\n return field == \"zoomEasing\" || _super.prototype.asIs.call(this, field);\r\n };\r\n /**\r\n * @ignore\r\n * @return Has license?\r\n */\r\n MapChart.prototype.hasLicense = function () {\r\n if (options.commercialLicense) {\r\n return true;\r\n }\r\n if (!_super.prototype.hasLicense.call(this)) {\r\n return false;\r\n }\r\n for (var i = 0; i < options.licenses.length; i++) {\r\n if (options.licenses[i].match(/^MP.{5,}/i)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n return MapChart;\r\n}(SerialChart));\r\nexport { MapChart };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"MapChart\"] = MapChart;\r\n//# sourceMappingURL=MapChart.js.map","/**\r\n * Map spline module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { MapLine } from \"./MapLine\";\r\nimport { Polyspline } from \"../../core/elements/Polyspline\";\r\nimport { registry } from \"../../core/Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Used to draw a spline on the map.\r\n *\r\n * @see {@link IMapSplineEvents} for a list of available events\r\n * @see {@link IMapSplineAdapters} for a list of available Adapters\r\n */\r\nvar MapSpline = /** @class */ (function (_super) {\r\n __extends(MapSpline, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapSpline() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"MapSpline\";\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * @ignore\r\n */\r\n MapSpline.prototype.createLine = function () {\r\n this.line = new Polyspline();\r\n this.line.tensionX = 0.8;\r\n this.line.tensionY = 0.8;\r\n };\r\n Object.defineProperty(MapSpline.prototype, \"shortestDistance\", {\r\n /**\r\n * ShortestDistance = true is not supported by MapSpline, only MapLine does support it\r\n * @default false\r\n * @param value\r\n * @todo: review description\r\n */\r\n get: function () {\r\n return false;\r\n },\r\n set: function (value) {\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return MapSpline;\r\n}(MapLine));\r\nexport { MapSpline };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"MapSpline\"] = MapSpline;\r\n//# sourceMappingURL=MapSpline.js.map","/**\r\n * Map arched line module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { MapLine } from \"./MapLine\";\r\nimport { Polyarc } from \"../../core/elements/Polyarc\";\r\nimport { registry } from \"../../core/Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Used to draw an arched line on the map.\r\n *\r\n * @see {@link IMapArcEvents} for a list of available events\r\n * @see {@link IMapArcAdapters} for a list of available Adapters\r\n */\r\nvar MapArc = /** @class */ (function (_super) {\r\n __extends(MapArc, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapArc() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"MapArc\";\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * @ignore\r\n */\r\n MapArc.prototype.createLine = function () {\r\n this.line = new Polyarc();\r\n };\r\n Object.defineProperty(MapArc.prototype, \"shortestDistance\", {\r\n get: function () {\r\n return false;\r\n },\r\n /**\r\n * `shortestDistance = true` is not supported by `MapArc`.\r\n *\r\n * Only [[MapLine]] supports it.\r\n *\r\n * @default false\r\n * @param value\r\n */\r\n set: function (value) {\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return MapArc;\r\n}(MapLine));\r\nexport { MapArc };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"MapArc\"] = MapArc;\r\n//# sourceMappingURL=MapArc.js.map","/**\r\n * Map spline series module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { MapLineSeries, MapLineSeriesDataItem } from \"./MapLineSeries\";\r\nimport { MapSpline } from \"./MapSpline\";\r\nimport { registry } from \"../../core/Registry\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a [[DataItem]] for [[MapSplineSeries]]\r\n * @see {@link DataItem}\r\n */\r\nvar MapSplineSeriesDataItem = /** @class */ (function (_super) {\r\n __extends(MapSplineSeriesDataItem, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapSplineSeriesDataItem() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"MapSplineSeriesDataItem\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n return MapSplineSeriesDataItem;\r\n}(MapLineSeriesDataItem));\r\nexport { MapSplineSeriesDataItem };\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A series of map spline elements.\r\n *\r\n * @see {@link IMapSplineSeriesEvents} for a list of available Events\r\n * @see {@link IMapSplineSeriesAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar MapSplineSeries = /** @class */ (function (_super) {\r\n __extends(MapSplineSeries, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapSplineSeries() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"MapSplineSeries\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Returns a new/empty DataItem of the type appropriate for this object.\r\n *\r\n * @see {@link DataItem}\r\n * @return Data Item\r\n */\r\n MapSplineSeries.prototype.createDataItem = function () {\r\n return new MapSplineSeriesDataItem();\r\n };\r\n /**\r\n * Returns a new line instance of suitable type.\r\n *\r\n * @return New line\r\n */\r\n MapSplineSeries.prototype.createLine = function () {\r\n return new MapSpline();\r\n };\r\n return MapSplineSeries;\r\n}(MapLineSeries));\r\nexport { MapSplineSeries };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"MapSplineSeries\"] = MapSplineSeries;\r\nregistry.registeredClasses[\"MapSplineSeriesDataItem\"] = MapSplineSeriesDataItem;\r\n//# sourceMappingURL=MapSplineSeries.js.map","/**\r\n * Map arc series module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { MapLineSeries, MapLineSeriesDataItem } from \"./MapLineSeries\";\r\nimport { MapArc } from \"./MapArc\";\r\nimport { registry } from \"../../core/Registry\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a [[DataItem]] for [[MapArcSeries]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nvar MapArcSeriesDataItem = /** @class */ (function (_super) {\r\n __extends(MapArcSeriesDataItem, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapArcSeriesDataItem() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"MapArcSeriesDataItem\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n return MapArcSeriesDataItem;\r\n}(MapLineSeriesDataItem));\r\nexport { MapArcSeriesDataItem };\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A series of arc elements. (curved lines)\r\n *\r\n * @see {@link IMapArcSeriesEvents} for a list of available Events\r\n * @see {@link IMapArcSeriesAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar MapArcSeries = /** @class */ (function (_super) {\r\n __extends(MapArcSeries, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapArcSeries() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"MapArcSeries\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Returns a new/empty DataItem of the type appropriate for this object.\r\n *\r\n * @see {@link DataItem}\r\n * @return Data Item\r\n */\r\n MapArcSeries.prototype.createDataItem = function () {\r\n return new MapArcSeriesDataItem();\r\n };\r\n /**\r\n * Returns a new line instance of suitable type.\r\n *\r\n * @return New line\r\n */\r\n MapArcSeries.prototype.createLine = function () {\r\n return new MapArc();\r\n };\r\n return MapArcSeries;\r\n}(MapLineSeries));\r\nexport { MapArcSeries };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"MapArcSeries\"] = MapArcSeries;\r\nregistry.registeredClasses[\"MapArcSeriesDataItem\"] = MapArcSeriesDataItem;\r\n//# sourceMappingURL=MapArcSeries.js.map","/**\r\n * Zoom control module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../../core/Container\";\r\nimport { Button } from \"../../core/elements/Button\";\r\nimport { RoundedRectangle } from \"../../core/elements/RoundedRectangle\";\r\nimport { MutableValueDisposer, MultiDisposer } from \"../../core/utils/Disposer\";\r\nimport { keyboard } from \"../../core/utils/Keyboard\";\r\nimport { getInteraction } from \"../../core/interaction/Interaction\";\r\nimport { percent } from \"../../core/utils/Percent\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a control for zooming the map.\r\n *\r\n * @see {@link IZoomControlEvents} for a list of available events\r\n * @see {@link IZoomControlAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar ZoomControl = /** @class */ (function (_super) {\r\n __extends(ZoomControl, _super);\r\n /**\r\n * Constructor\r\n */\r\n function ZoomControl() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * A target map.\r\n */\r\n _this._chart = new MutableValueDisposer();\r\n _this.className = \"ZoomControl\";\r\n _this.align = \"right\";\r\n _this.valign = \"bottom\";\r\n _this.layout = \"vertical\";\r\n _this.padding(5, 5, 5, 5);\r\n var interfaceColors = new InterfaceColorSet();\r\n var plusButton = _this.createChild(Button);\r\n plusButton.shouldClone = false;\r\n plusButton.label.text = \"+\";\r\n //plusButton.fontFamily = \"Verdana\";\r\n _this.plusButton = plusButton;\r\n var slider = _this.createChild(Container);\r\n slider.shouldClone = false;\r\n slider.background.fill = interfaceColors.getFor(\"alternativeBackground\");\r\n slider.background.fillOpacity = 0.05;\r\n slider.background.events.on(\"hit\", _this.handleBackgroundClick, _this, false);\r\n slider.events.on(\"sizechanged\", _this.updateThumbSize, _this, false);\r\n _this.slider = slider;\r\n var thumb = slider.createChild(Button);\r\n thumb.shouldClone = false;\r\n thumb.padding(0, 0, 0, 0);\r\n thumb.draggable = true;\r\n thumb.events.on(\"drag\", _this.handleThumbDrag, _this, false);\r\n _this.thumb = thumb;\r\n var minusButton = _this.createChild(Button);\r\n minusButton.shouldClone = false;\r\n minusButton.label.text = \"-\";\r\n //minusButton.fontFamily = \"Verdana\";\r\n _this.minusButton = minusButton;\r\n // Set roles\r\n _this.thumb.role = \"slider\";\r\n _this.thumb.readerLive = \"polite\";\r\n // Set reader text\r\n _this.thumb.readerTitle = _this.language.translate(\"Use arrow keys to zoom in and out\");\r\n _this.minusButton.readerTitle = _this.language.translate(\"Press ENTER to zoom in\");\r\n _this.plusButton.readerTitle = _this.language.translate(\"Press ENTER to zoom out\");\r\n _this.applyTheme();\r\n _this.events.on(\"propertychanged\", function (event) {\r\n if (event.property == \"layout\") {\r\n _this.fixLayout();\r\n }\r\n }, undefined, false);\r\n _this._disposers.push(_this._chart);\r\n _this.fixLayout();\r\n return _this;\r\n }\r\n /**\r\n * @ignore\r\n */\r\n ZoomControl.prototype.fixLayout = function () {\r\n var plusButton = this.plusButton;\r\n var minusButton = this.minusButton;\r\n var thumb = this.thumb;\r\n var slider = this.slider;\r\n plusButton.x = undefined;\r\n plusButton.y = undefined;\r\n minusButton.x = undefined;\r\n minusButton.y = undefined;\r\n thumb.x = undefined;\r\n thumb.y = undefined;\r\n slider.x = undefined;\r\n slider.y = undefined;\r\n plusButton.padding(6, 10, 6, 10);\r\n minusButton.padding(6, 10, 6, 10);\r\n minusButton.label.align = \"center\";\r\n minusButton.label.valign = \"middle\";\r\n plusButton.label.align = \"center\";\r\n plusButton.label.valign = \"middle\";\r\n if (this.layout == \"vertical\") {\r\n this.width = 40;\r\n this.height = undefined;\r\n minusButton.width = percent(100);\r\n minusButton.height = undefined;\r\n thumb.width = percent(100);\r\n thumb.height = undefined;\r\n plusButton.width = percent(100);\r\n plusButton.height = undefined;\r\n slider.width = percent(100);\r\n minusButton.marginTop = 1;\r\n plusButton.marginBottom = 2;\r\n slider.height = 0;\r\n minusButton.toFront();\r\n plusButton.toBack();\r\n thumb.minX = 0;\r\n thumb.maxX = 0;\r\n thumb.minY = 0;\r\n }\r\n else if (this.layout == \"horizontal\") {\r\n this.height = 40;\r\n this.width = undefined;\r\n minusButton.height = percent(100);\r\n minusButton.width = undefined;\r\n plusButton.height = percent(100);\r\n plusButton.width = undefined;\r\n thumb.height = percent(100);\r\n thumb.width = undefined;\r\n thumb.minX = 0;\r\n thumb.minY = 0;\r\n thumb.maxY = 0;\r\n slider.height = percent(100);\r\n slider.width = 0;\r\n minusButton.toBack();\r\n plusButton.toFront();\r\n }\r\n };\r\n /**\r\n * Handles zoom operation after clicking on the slider background.\r\n *\r\n * @ignore Exclude from docs\r\n * @param event Event\r\n */\r\n ZoomControl.prototype.handleBackgroundClick = function (event) {\r\n var sprite = event.target;\r\n var y = event.spritePoint.y;\r\n var chart = this.chart;\r\n var maxPower = Math.log(chart.maxZoomLevel) / Math.LN2;\r\n var minPower = Math.log(chart.minZoomLevel) / Math.LN2;\r\n var power = (sprite.pixelHeight - y) / sprite.pixelHeight * (minPower + (maxPower - minPower));\r\n var zoomLevel = Math.pow(2, power);\r\n chart.zoomToGeoPoint(chart.zoomGeoPoint, zoomLevel);\r\n };\r\n Object.defineProperty(ZoomControl.prototype, \"chart\", {\r\n /**\r\n * @return Map/chart\r\n */\r\n get: function () {\r\n return this._chart.get();\r\n },\r\n /**\r\n * A main chart/map that this zoom control is for.\r\n *\r\n * @param chart Map/chart\r\n */\r\n set: function (chart) {\r\n var _this = this;\r\n this._chart.set(chart, new MultiDisposer([\r\n chart.events.on(\"maxsizechanged\", this.updateThumbSize, this, false),\r\n chart.events.on(\"zoomlevelchanged\", this.updateThumb, this, false),\r\n this.minusButton.events.on(\"hit\", function () { chart.zoomOut(chart.zoomGeoPoint); }, chart, false),\r\n getInteraction().body.events.on(\"keyup\", function (ev) {\r\n if (_this.topParent.hasFocused) {\r\n // ENTER is now handled globally\r\n if (keyboard.isKey(ev.event, \"plus\")) {\r\n chart.zoomIn();\r\n }\r\n else if (keyboard.isKey(ev.event, \"minus\")) {\r\n chart.zoomOut();\r\n }\r\n }\r\n }, chart),\r\n this.plusButton.events.on(\"hit\", function () { chart.zoomIn(chart.zoomGeoPoint); }, chart, false)\r\n ]));\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Updates the slider's thumb size based on the available zoom space.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n ZoomControl.prototype.updateThumbSize = function () {\r\n var chart = this.chart;\r\n if (chart) {\r\n var slider = this.slider;\r\n var thumb = this.thumb;\r\n if (this.layout == \"vertical\") {\r\n thumb.minHeight = Math.min(this.slider.pixelHeight, 20);\r\n thumb.height = slider.pixelHeight / this.stepCount;\r\n thumb.maxY = slider.pixelHeight - thumb.pixelHeight;\r\n if (thumb.pixelHeight <= 1) {\r\n thumb.visible = false;\r\n }\r\n else {\r\n thumb.visible = true;\r\n }\r\n }\r\n else {\r\n thumb.minWidth = Math.min(this.slider.pixelWidth, 20);\r\n thumb.width = slider.pixelWidth / this.stepCount;\r\n thumb.maxX = slider.pixelWidth - thumb.pixelWidth;\r\n if (thumb.pixelWidth <= 1) {\r\n thumb.visible = false;\r\n }\r\n else {\r\n thumb.visible = true;\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Updates thumb according to current zoom position from map.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n ZoomControl.prototype.updateThumb = function () {\r\n var slider = this.slider;\r\n var chart = this.chart;\r\n var thumb = this.thumb;\r\n if (!thumb.isDown) {\r\n var step = (Math.log(chart.zoomLevel) - Math.log(this.chart.minZoomLevel)) / Math.LN2;\r\n if (this.layout == \"vertical\") {\r\n thumb.y = slider.pixelHeight - (slider.pixelHeight - thumb.pixelHeight) * step / this.stepCount - thumb.pixelHeight;\r\n }\r\n else {\r\n thumb.x = slider.pixelWidth * step / this.stepCount;\r\n }\r\n }\r\n };\r\n /**\r\n * Zooms the actual map when slider position changes.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n ZoomControl.prototype.handleThumbDrag = function () {\r\n var slider = this.slider;\r\n var chart = this.chart;\r\n var thumb = this.thumb;\r\n var step;\r\n var minStep = Math.log(this.chart.minZoomLevel) / Math.LN2;\r\n if (this.layout == \"vertical\") {\r\n step = this.stepCount * (slider.pixelHeight - thumb.pixelY - thumb.pixelHeight) / (slider.pixelHeight - thumb.pixelHeight);\r\n }\r\n else {\r\n step = this.stepCount * thumb.pixelX / slider.pixelWidth;\r\n }\r\n step = minStep + step;\r\n var zoomLevel = Math.pow(2, step);\r\n chart.zoomToGeoPoint(undefined, zoomLevel, false, 0);\r\n };\r\n Object.defineProperty(ZoomControl.prototype, \"stepCount\", {\r\n /**\r\n * Returns the step countfor the slider grid according to map's min and max\r\n * zoom level settings.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Step count\r\n */\r\n get: function () {\r\n return Math.log(this.chart.maxZoomLevel) / Math.LN2 - Math.log(this.chart.minZoomLevel) / Math.LN2;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates a background element for slider control.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Background\r\n */\r\n ZoomControl.prototype.createBackground = function () {\r\n return new RoundedRectangle();\r\n };\r\n return ZoomControl;\r\n}(Container));\r\nexport { ZoomControl };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ZoomControl\"] = ZoomControl;\r\n//# sourceMappingURL=ZoomControl.js.map","import {atan, exp, halfPi, log, pi, tan, tau} from \"../math.js\";\nimport rotation from \"../rotation.js\";\nimport projection from \"./index.js\";\n\nexport function mercatorRaw(lambda, phi) {\n return [lambda, log(tan((halfPi + phi) / 2))];\n}\n\nmercatorRaw.invert = function(x, y) {\n return [x, 2 * atan(exp(y)) - halfPi];\n};\n\nexport default function() {\n return mercatorProjection(mercatorRaw)\n .scale(961 / tau);\n}\n\nexport function mercatorProjection(project) {\n var m = projection(project),\n center = m.center,\n scale = m.scale,\n translate = m.translate,\n clipExtent = m.clipExtent,\n x0 = null, y0, x1, y1; // clip extent\n\n m.scale = function(_) {\n return arguments.length ? (scale(_), reclip()) : scale();\n };\n\n m.translate = function(_) {\n return arguments.length ? (translate(_), reclip()) : translate();\n };\n\n m.center = function(_) {\n return arguments.length ? (center(_), reclip()) : center();\n };\n\n m.clipExtent = function(_) {\n return arguments.length ? ((_ == null ? x0 = y0 = x1 = y1 = null : (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1])), reclip()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n\n function reclip() {\n var k = pi * scale(),\n t = m(rotation(m.rotate()).invert([0, 0]));\n return clipExtent(x0 == null\n ? [[t[0] - k, t[1] - k], [t[0] + k, t[1] + k]] : project === mercatorRaw\n ? [[Math.max(t[0] - k, x0), y0], [Math.min(t[0] + k, x1), y1]]\n : [[x0, Math.max(t[1] - k, y0)], [x1, Math.min(t[1] + k, y1)]]);\n }\n\n return reclip();\n}\n","/**\r\n * Functionality for Mercator projection\r\n *\r\n * The function(s) below are from D3.js library (https://d3js.org/)\r\n *\r\n * ```\r\n * Copyright 2017 Mike Bostock\r\n *\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * 1. Redistributions of source code must retain the above copyright notice,\r\n * this list of conditions and the following disclaimer.\r\n *\r\n * 2. Redistributions in binary form must reproduce the above copyright notice,\r\n * this list of conditions and the following disclaimer in the documentation\r\n * and/or other materials provided with the distribution.\r\n *\r\n * 3. Neither the name of the copyright holder nor the names of its\r\n * contributors may be used to endorse or promote products derived from this\r\n * software without specific prior written permission.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n * ```\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Projection } from \"./Projection\";\r\nimport { registry } from \"../../../core/Registry\";\r\nimport * as d3geo from \"d3-geo\";\r\n/**\r\n * Mercator projection.\r\n */\r\nvar Mercator = /** @class */ (function (_super) {\r\n __extends(Mercator, _super);\r\n function Mercator() {\r\n var _this = _super.call(this) || this;\r\n _this.d3Projection = d3geo.geoMercator();\r\n return _this;\r\n }\r\n return Mercator;\r\n}(Projection));\r\nexport { Mercator };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Mercator\"] = Mercator;\r\n//# sourceMappingURL=Mercator.js.map","export var abs = Math.abs;\nexport var atan = Math.atan;\nexport var atan2 = Math.atan2;\nexport var ceil = Math.ceil;\nexport var cos = Math.cos;\nexport var exp = Math.exp;\nexport var floor = Math.floor;\nexport var log = Math.log;\nexport var max = Math.max;\nexport var min = Math.min;\nexport var pow = Math.pow;\nexport var round = Math.round;\nexport var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };\nexport var sin = Math.sin;\nexport var tan = Math.tan;\n\nexport var epsilon = 1e-6;\nexport var epsilon2 = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var quarterPi = pi / 4;\nexport var sqrt1_2 = Math.SQRT1_2;\nexport var sqrt2 = sqrt(2);\nexport var sqrtPi = sqrt(pi);\nexport var tau = pi * 2;\nexport var degrees = 180 / pi;\nexport var radians = pi / 180;\n\nexport function sinci(x) {\n return x ? x / Math.sin(x) : 1;\n}\n\nexport function asin(x) {\n return x > 1 ? halfPi : x < -1 ? -halfPi : Math.asin(x);\n}\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function sqrt(x) {\n return x > 0 ? Math.sqrt(x) : 0;\n}\n\nexport function tanh(x) {\n x = exp(2 * x);\n return (x - 1) / (x + 1);\n}\n\nexport function sinh(x) {\n return (exp(x) - exp(-x)) / 2;\n}\n\nexport function cosh(x) {\n return (exp(x) + exp(-x)) / 2;\n}\n\nexport function arsinh(x) {\n return log(x + sqrt(x * x + 1));\n}\n\nexport function arcosh(x) {\n return log(x + sqrt(x * x - 1));\n}\n","import {geoProjection as projection} from \"d3-geo\";\nimport {atan, exp, log, quarterPi, pi, tan} from \"./math.js\";\n\nexport function millerRaw(lambda, phi) {\n return [lambda, 1.25 * log(tan(quarterPi + 0.4 * phi))];\n}\n\nmillerRaw.invert = function(x, y) {\n return [x, 2.5 * atan(exp(0.8 * y)) - 0.625 * pi];\n};\n\nexport default function() {\n return projection(millerRaw)\n .scale(108.318);\n}\n","/**\r\n * Functionality for Miller projection\r\n *\r\n * The function(s) below are from D3.js library (https://d3js.org/)\r\n *\r\n * ```\r\n * Copyright 2017 Mike Bostock\r\n *\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * 1. Redistributions of source code must retain the above copyright notice,\r\n * this list of conditions and the following disclaimer.\r\n *\r\n * 2. Redistributions in binary form must reproduce the above copyright notice,\r\n * this list of conditions and the following disclaimer in the documentation\r\n * and/or other materials provided with the distribution.\r\n *\r\n * 3. Neither the name of the copyright holder nor the names of its\r\n * contributors may be used to endorse or promote products derived from this\r\n * software without specific prior written permission.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n * ```\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Projection } from \"./Projection\";\r\nimport { registry } from \"../../../core/Registry\";\r\n// @ts-ignore\r\nimport * as d3geoprojection from \"d3-geo-projection\";\r\n/**\r\n * Miller projection.\r\n */\r\nvar Miller = /** @class */ (function (_super) {\r\n __extends(Miller, _super);\r\n function Miller() {\r\n var _this = _super.call(this) || this;\r\n _this.d3Projection = d3geoprojection.geoMiller();\r\n return _this;\r\n }\r\n return Miller;\r\n}(Projection));\r\nexport { Miller };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Miller\"] = Miller;\r\n//# sourceMappingURL=Miller.js.map","import {geoProjection as projection} from \"d3-geo\";\nimport {abs, asin, cos, epsilon, halfPi, pi, sin, sqrt} from \"./math.js\";\n\nexport function eckert6Raw(lambda, phi) {\n var k = (1 + halfPi) * sin(phi);\n for (var i = 0, delta = Infinity; i < 10 && abs(delta) > epsilon; i++) {\n phi -= delta = (phi + sin(phi) - k) / (1 + cos(phi));\n }\n k = sqrt(2 + pi);\n return [\n lambda * (1 + cos(phi)) / k,\n 2 * phi / k\n ];\n}\n\neckert6Raw.invert = function(x, y) {\n var j = 1 + halfPi,\n k = sqrt(j / 2);\n return [\n x * 2 * k / (1 + cos(y *= k)),\n asin((y + sin(y)) / j)\n ];\n};\n\nexport default function() {\n return projection(eckert6Raw)\n .scale(173.044);\n}\n","/**\r\n * Functionality for Eckert6 projection\r\n *\r\n * The function(s) below are from D3.js library (https://d3js.org/)\r\n *\r\n * ```\r\n * Copyright 2017 Mike Bostock\r\n *\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * 1. Redistributions of source code must retain the above copyright notice,\r\n * this list of conditions and the following disclaimer.\r\n *\r\n * 2. Redistributions in binary form must reproduce the above copyright notice,\r\n * this list of conditions and the following disclaimer in the documentation\r\n * and/or other materials provided with the distribution.\r\n *\r\n * 3. Neither the name of the copyright holder nor the names of its\r\n * contributors may be used to endorse or promote products derived from this\r\n * software without specific prior written permission.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n * ```\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Projection } from \"./Projection\";\r\nimport { registry } from \"../../../core/Registry\";\r\n// @ts-ignore\r\nimport * as d3geoprojection from \"d3-geo-projection\";\r\n/**\r\n * Eckert6 projection.\r\n */\r\nvar Eckert6 = /** @class */ (function (_super) {\r\n __extends(Eckert6, _super);\r\n function Eckert6() {\r\n var _this = _super.call(this) || this;\r\n _this.d3Projection = d3geoprojection.geoEckert6();\r\n return _this;\r\n }\r\n return Eckert6;\r\n}(Projection));\r\nexport { Eckert6 };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Eckert6\"] = Eckert6;\r\n//# sourceMappingURL=Eckert6.js.map","import {asin, atan2, cos, sin, sqrt} from \"../math.js\";\n\nexport function azimuthalRaw(scale) {\n return function(x, y) {\n var cx = cos(x),\n cy = cos(y),\n k = scale(cx * cy);\n if (k === Infinity) return [2, 0];\n return [\n k * cy * sin(x),\n k * sin(y)\n ];\n }\n}\n\nexport function azimuthalInvert(angle) {\n return function(x, y) {\n var z = sqrt(x * x + y * y),\n c = angle(z),\n sc = sin(c),\n cc = cos(c);\n return [\n atan2(x * sc, z * cc),\n asin(z && y * sc / z)\n ];\n }\n}\n","import {asin, cos, epsilon, sin} from \"../math.js\";\nimport {azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport function orthographicRaw(x, y) {\n return [cos(y) * sin(x), sin(y)];\n}\n\northographicRaw.invert = azimuthalInvert(asin);\n\nexport default function() {\n return projection(orthographicRaw)\n .scale(249.5)\n .clipAngle(90 + epsilon);\n}\n","/**\r\n * Functionality for Mercator projection\r\n *\r\n * The function(s) below are from D3.js library (https://d3js.org/)\r\n *\r\n * ```\r\n * Copyright 2017 Mike Bostock\r\n *\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * 1. Redistributions of source code must retain the above copyright notice,\r\n * this list of conditions and the following disclaimer.\r\n *\r\n * 2. Redistributions in binary form must reproduce the above copyright notice,\r\n * this list of conditions and the following disclaimer in the documentation\r\n * and/or other materials provided with the distribution.\r\n *\r\n * 3. Neither the name of the copyright holder nor the names of its\r\n * contributors may be used to endorse or promote products derived from this\r\n * software without specific prior written permission.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n * ```\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Projection } from \"./Projection\";\r\nimport { registry } from \"../../../core/Registry\";\r\nimport * as d3geo from \"d3-geo\";\r\n/**\r\n * Orthographic projection.\r\n */\r\nvar Orthographic = /** @class */ (function (_super) {\r\n __extends(Orthographic, _super);\r\n function Orthographic() {\r\n var _this = _super.call(this) || this;\r\n _this.d3Projection = d3geo.geoOrthographic();\r\n return _this;\r\n }\r\n return Orthographic;\r\n}(Projection));\r\nexport { Orthographic };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Orthographic\"] = Orthographic;\r\n//# sourceMappingURL=Orthographic.js.map","import {atan, cos, sin} from \"../math.js\";\nimport {azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport function stereographicRaw(x, y) {\n var cy = cos(y), k = 1 + cos(x) * cy;\n return [cy * sin(x) / k, sin(y) / k];\n}\n\nstereographicRaw.invert = azimuthalInvert(function(z) {\n return 2 * atan(z);\n});\n\nexport default function() {\n return projection(stereographicRaw)\n .scale(250)\n .clipAngle(142);\n}\n","/**\r\n * Functionality for Mercator projection\r\n *\r\n * The function(s) below are from D3.js library (https://d3js.org/)\r\n *\r\n * ```\r\n * Copyright 2017 Mike Bostock\r\n *\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * 1. Redistributions of source code must retain the above copyright notice,\r\n * this list of conditions and the following disclaimer.\r\n *\r\n * 2. Redistributions in binary form must reproduce the above copyright notice,\r\n * this list of conditions and the following disclaimer in the documentation\r\n * and/or other materials provided with the distribution.\r\n *\r\n * 3. Neither the name of the copyright holder nor the names of its\r\n * contributors may be used to endorse or promote products derived from this\r\n * software without specific prior written permission.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n * ```\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Projection } from \"./Projection\";\r\nimport { registry } from \"../../../core/Registry\";\r\nimport * as d3geo from \"d3-geo\";\r\n/**\r\n * Orthographic projection.\r\n */\r\nvar Stereographic = /** @class */ (function (_super) {\r\n __extends(Stereographic, _super);\r\n function Stereographic() {\r\n var _this = _super.call(this) || this;\r\n _this.d3Projection = d3geo.geoStereographic();\r\n return _this;\r\n }\r\n return Stereographic;\r\n}(Projection));\r\nexport { Stereographic };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Stereographic\"] = Stereographic;\r\n//# sourceMappingURL=Stereographic.js.map","import {abs, asin, atan2, cos, epsilon, pi, sign, sin, sqrt} from \"../math.js\";\nimport {conicProjection} from \"./conic.js\";\nimport {cylindricalEqualAreaRaw} from \"./cylindricalEqualArea.js\";\n\nexport function conicEqualAreaRaw(y0, y1) {\n var sy0 = sin(y0), n = (sy0 + sin(y1)) / 2;\n\n // Are the parallels symmetrical around the Equator?\n if (abs(n) < epsilon) return cylindricalEqualAreaRaw(y0);\n\n var c = 1 + sy0 * (2 * n - sy0), r0 = sqrt(c) / n;\n\n function project(x, y) {\n var r = sqrt(c - 2 * n * sin(y)) / n;\n return [r * sin(x *= n), r0 - r * cos(x)];\n }\n\n project.invert = function(x, y) {\n var r0y = r0 - y,\n l = atan2(x, abs(r0y)) * sign(r0y);\n if (r0y * n < 0)\n l -= pi * sign(x) * sign(r0y);\n return [l / n, asin((c - (x * x + r0y * r0y) * n * n) / (2 * n))];\n };\n\n return project;\n}\n\nexport default function() {\n return conicProjection(conicEqualAreaRaw)\n .scale(155.424)\n .center([0, 33.6442]);\n}\n","import {asin, cos, sin} from \"../math.js\";\n\nexport function cylindricalEqualAreaRaw(phi0) {\n var cosPhi0 = cos(phi0);\n\n function forward(lambda, phi) {\n return [lambda * cosPhi0, sin(phi) / cosPhi0];\n }\n\n forward.invert = function(x, y) {\n return [x / cosPhi0, asin(y * cosPhi0)];\n };\n\n return forward;\n}\n","import {degrees, pi, radians} from \"../math.js\";\nimport {projectionMutator} from \"./index.js\";\n\nexport function conicProjection(projectAt) {\n var phi0 = 0,\n phi1 = pi / 3,\n m = projectionMutator(projectAt),\n p = m(phi0, phi1);\n\n p.parallels = function(_) {\n return arguments.length ? m(phi0 = _[0] * radians, phi1 = _[1] * radians) : [phi0 * degrees, phi1 * degrees];\n };\n\n return p;\n}\n","import conicEqualArea from \"./conicEqualArea.js\";\n\nexport default function() {\n return conicEqualArea()\n .parallels([29.5, 45.5])\n .scale(1070)\n .translate([480, 250])\n .rotate([96, 0])\n .center([-0.6, 38.7]);\n}\n","/**\r\n * Functionality for Mercator projection\r\n *\r\n * The function(s) below are from D3.js library (https://d3js.org/)\r\n *\r\n * ```\r\n * Copyright 2017 Mike Bostock\r\n *\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * 1. Redistributions of source code must retain the above copyright notice,\r\n * this list of conditions and the following disclaimer.\r\n *\r\n * 2. Redistributions in binary form must reproduce the above copyright notice,\r\n * this list of conditions and the following disclaimer in the documentation\r\n * and/or other materials provided with the distribution.\r\n *\r\n * 3. Neither the name of the copyright holder nor the names of its\r\n * contributors may be used to endorse or promote products derived from this\r\n * software without specific prior written permission.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n * ```\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Projection } from \"./Projection\";\r\nimport { registry } from \"../../../core/Registry\";\r\nimport * as d3geo from \"d3-geo\";\r\n/**\r\n * Orthographic projection.\r\n */\r\nvar Albers = /** @class */ (function (_super) {\r\n __extends(Albers, _super);\r\n function Albers() {\r\n var _this = _super.call(this) || this;\r\n _this.d3Projection = d3geo.geoAlbers();\r\n return _this;\r\n }\r\n return Albers;\r\n}(Projection));\r\nexport { Albers };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Albers\"] = Albers;\r\n//# sourceMappingURL=Albers.js.map","/**\r\n * Functionality for Mercator projection\r\n *\r\n * The function(s) below are from D3.js library (https://d3js.org/)\r\n *\r\n * ```\r\n * Copyright 2017 Mike Bostock\r\n *\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * 1. Redistributions of source code must retain the above copyright notice,\r\n * this list of conditions and the following disclaimer.\r\n *\r\n * 2. Redistributions in binary form must reproduce the above copyright notice,\r\n * this list of conditions and the following disclaimer in the documentation\r\n * and/or other materials provided with the distribution.\r\n *\r\n * 3. Neither the name of the copyright holder nor the names of its\r\n * contributors may be used to endorse or promote products derived from this\r\n * software without specific prior written permission.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n * ```\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Projection } from \"./Projection\";\r\nimport { registry } from \"../../../core/Registry\";\r\nimport * as d3geo from \"d3-geo\";\r\n/**\r\n * Orthographic projection.\r\n */\r\nvar AlbersUsa = /** @class */ (function (_super) {\r\n __extends(AlbersUsa, _super);\r\n function AlbersUsa() {\r\n var _this = _super.call(this) || this;\r\n _this.d3Projection = d3geo.geoAlbersUsa();\r\n return _this;\r\n }\r\n return AlbersUsa;\r\n}(Projection));\r\nexport { AlbersUsa };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AlbersUsa\"] = AlbersUsa;\r\n//# sourceMappingURL=AlbersUSA.js.map","import {epsilon} from \"../math.js\";\nimport albers from \"./albers.js\";\nimport conicEqualArea from \"./conicEqualArea.js\";\nimport {fitExtent, fitSize, fitWidth, fitHeight} from \"./fit.js\";\n\n// The projections must have mutually exclusive clip regions on the sphere,\n// as this will avoid emitting interleaving lines and polygons.\nfunction multiplex(streams) {\n var n = streams.length;\n return {\n point: function(x, y) { var i = -1; while (++i < n) streams[i].point(x, y); },\n sphere: function() { var i = -1; while (++i < n) streams[i].sphere(); },\n lineStart: function() { var i = -1; while (++i < n) streams[i].lineStart(); },\n lineEnd: function() { var i = -1; while (++i < n) streams[i].lineEnd(); },\n polygonStart: function() { var i = -1; while (++i < n) streams[i].polygonStart(); },\n polygonEnd: function() { var i = -1; while (++i < n) streams[i].polygonEnd(); }\n };\n}\n\n// A composite projection for the United States, configured by default for\n// 960×500. The projection also works quite well at 960×600 if you change the\n// scale to 1285 and adjust the translate accordingly. The set of standard\n// parallels for each region comes from USGS, which is published here:\n// http://egsc.usgs.gov/isb/pubs/MapProjections/projections.html#albers\nexport default function() {\n var cache,\n cacheStream,\n lower48 = albers(), lower48Point,\n alaska = conicEqualArea().rotate([154, 0]).center([-2, 58.5]).parallels([55, 65]), alaskaPoint, // EPSG:3338\n hawaii = conicEqualArea().rotate([157, 0]).center([-3, 19.9]).parallels([8, 18]), hawaiiPoint, // ESRI:102007\n point, pointStream = {point: function(x, y) { point = [x, y]; }};\n\n function albersUsa(coordinates) {\n var x = coordinates[0], y = coordinates[1];\n return point = null,\n (lower48Point.point(x, y), point)\n || (alaskaPoint.point(x, y), point)\n || (hawaiiPoint.point(x, y), point);\n }\n\n albersUsa.invert = function(coordinates) {\n var k = lower48.scale(),\n t = lower48.translate(),\n x = (coordinates[0] - t[0]) / k,\n y = (coordinates[1] - t[1]) / k;\n return (y >= 0.120 && y < 0.234 && x >= -0.425 && x < -0.214 ? alaska\n : y >= 0.166 && y < 0.234 && x >= -0.214 && x < -0.115 ? hawaii\n : lower48).invert(coordinates);\n };\n\n albersUsa.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = multiplex([lower48.stream(cacheStream = stream), alaska.stream(stream), hawaii.stream(stream)]);\n };\n\n albersUsa.precision = function(_) {\n if (!arguments.length) return lower48.precision();\n lower48.precision(_), alaska.precision(_), hawaii.precision(_);\n return reset();\n };\n\n albersUsa.scale = function(_) {\n if (!arguments.length) return lower48.scale();\n lower48.scale(_), alaska.scale(_ * 0.35), hawaii.scale(_);\n return albersUsa.translate(lower48.translate());\n };\n\n albersUsa.translate = function(_) {\n if (!arguments.length) return lower48.translate();\n var k = lower48.scale(), x = +_[0], y = +_[1];\n\n lower48Point = lower48\n .translate(_)\n .clipExtent([[x - 0.455 * k, y - 0.238 * k], [x + 0.455 * k, y + 0.238 * k]])\n .stream(pointStream);\n\n alaskaPoint = alaska\n .translate([x - 0.307 * k, y + 0.201 * k])\n .clipExtent([[x - 0.425 * k + epsilon, y + 0.120 * k + epsilon], [x - 0.214 * k - epsilon, y + 0.234 * k - epsilon]])\n .stream(pointStream);\n\n hawaiiPoint = hawaii\n .translate([x - 0.205 * k, y + 0.212 * k])\n .clipExtent([[x - 0.214 * k + epsilon, y + 0.166 * k + epsilon], [x - 0.115 * k - epsilon, y + 0.234 * k - epsilon]])\n .stream(pointStream);\n\n return reset();\n };\n\n albersUsa.fitExtent = function(extent, object) {\n return fitExtent(albersUsa, extent, object);\n };\n\n albersUsa.fitSize = function(size, object) {\n return fitSize(albersUsa, size, object);\n };\n\n albersUsa.fitWidth = function(width, object) {\n return fitWidth(albersUsa, width, object);\n };\n\n albersUsa.fitHeight = function(height, object) {\n return fitHeight(albersUsa, height, object);\n };\n\n function reset() {\n cache = cacheStream = null;\n return albersUsa;\n }\n\n return albersUsa.scale(1070);\n}\n","import projection from \"./index.js\";\nimport {abs, epsilon} from \"../math.js\";\n\nexport function naturalEarth1Raw(lambda, phi) {\n var phi2 = phi * phi, phi4 = phi2 * phi2;\n return [\n lambda * (0.8707 - 0.131979 * phi2 + phi4 * (-0.013791 + phi4 * (0.003971 * phi2 - 0.001529 * phi4))),\n phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4)))\n ];\n}\n\nnaturalEarth1Raw.invert = function(x, y) {\n var phi = y, i = 25, delta;\n do {\n var phi2 = phi * phi, phi4 = phi2 * phi2;\n phi -= delta = (phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4))) - y) /\n (1.007226 + phi2 * (0.015085 * 3 + phi4 * (-0.044475 * 7 + 0.028874 * 9 * phi2 - 0.005916 * 11 * phi4)));\n } while (abs(delta) > epsilon && --i > 0);\n return [\n x / (0.8707 + (phi2 = phi * phi) * (-0.131979 + phi2 * (-0.013791 + phi2 * phi2 * phi2 * (0.003971 - 0.001529 * phi2)))),\n phi\n ];\n};\n\nexport default function() {\n return projection(naturalEarth1Raw)\n .scale(175.295);\n}\n","/**\r\n * Functionality for Mercator projection\r\n *\r\n * The function(s) below are from D3.js library (https://d3js.org/)\r\n *\r\n * ```\r\n * Copyright 2017 Mike Bostock\r\n *\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * 1. Redistributions of source code must retain the above copyright notice,\r\n * this list of conditions and the following disclaimer.\r\n *\r\n * 2. Redistributions in binary form must reproduce the above copyright notice,\r\n * this list of conditions and the following disclaimer in the documentation\r\n * and/or other materials provided with the distribution.\r\n *\r\n * 3. Neither the name of the copyright holder nor the names of its\r\n * contributors may be used to endorse or promote products derived from this\r\n * software without specific prior written permission.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n * ```\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Projection } from \"./Projection\";\r\nimport { registry } from \"../../../core/Registry\";\r\nimport * as d3geo from \"d3-geo\";\r\n/**\r\n * Orthographic projection.\r\n */\r\nvar NaturalEarth1 = /** @class */ (function (_super) {\r\n __extends(NaturalEarth1, _super);\r\n function NaturalEarth1() {\r\n var _this = _super.call(this) || this;\r\n _this.d3Projection = d3geo.geoNaturalEarth1();\r\n return _this;\r\n }\r\n return NaturalEarth1;\r\n}(Projection));\r\nexport { NaturalEarth1 };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"NaturalEarth1\"] = NaturalEarth1;\r\n//# sourceMappingURL=NaturalEarth1.js.map","import {asin, sqrt} from \"../math.js\";\nimport {azimuthalRaw, azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport var azimuthalEqualAreaRaw = azimuthalRaw(function(cxcy) {\n return sqrt(2 / (1 + cxcy));\n});\n\nazimuthalEqualAreaRaw.invert = azimuthalInvert(function(z) {\n return 2 * asin(z / 2);\n});\n\nexport default function() {\n return projection(azimuthalEqualAreaRaw)\n .scale(124.75)\n .clipAngle(180 - 1e-3);\n}\n","/**\r\n * Functionality for Mercator projection\r\n *\r\n * The function(s) below are from D3.js library (https://d3js.org/)\r\n *\r\n * ```\r\n * Copyright 2017 Mike Bostock\r\n *\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * 1. Redistributions of source code must retain the above copyright notice,\r\n * this list of conditions and the following disclaimer.\r\n *\r\n * 2. Redistributions in binary form must reproduce the above copyright notice,\r\n * this list of conditions and the following disclaimer in the documentation\r\n * and/or other materials provided with the distribution.\r\n *\r\n * 3. Neither the name of the copyright holder nor the names of its\r\n * contributors may be used to endorse or promote products derived from this\r\n * software without specific prior written permission.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n * ```\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Projection } from \"./Projection\";\r\nimport { registry } from \"../../../core/Registry\";\r\nimport * as d3geo from \"d3-geo\";\r\n/**\r\n * Orthographic projection.\r\n */\r\nvar AzimuthalEqualArea = /** @class */ (function (_super) {\r\n __extends(AzimuthalEqualArea, _super);\r\n function AzimuthalEqualArea() {\r\n var _this = _super.call(this) || this;\r\n _this.d3Projection = d3geo.geoAzimuthalEqualArea();\r\n return _this;\r\n }\r\n return AzimuthalEqualArea;\r\n}(Projection));\r\nexport { AzimuthalEqualArea };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AzimuthalEqualArea\"] = AzimuthalEqualArea;\r\n//# sourceMappingURL=AzimuthalEqualArea.js.map","import projection from \"./index.js\";\nimport {abs, asin, cos, epsilon2, sin, sqrt} from \"../math.js\";\n\nvar A1 = 1.340264,\n A2 = -0.081106,\n A3 = 0.000893,\n A4 = 0.003796,\n M = sqrt(3) / 2,\n iterations = 12;\n\nexport function equalEarthRaw(lambda, phi) {\n var l = asin(M * sin(phi)), l2 = l * l, l6 = l2 * l2 * l2;\n return [\n lambda * cos(l) / (M * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2))),\n l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2))\n ];\n}\n\nequalEarthRaw.invert = function(x, y) {\n var l = y, l2 = l * l, l6 = l2 * l2 * l2;\n for (var i = 0, delta, fy, fpy; i < iterations; ++i) {\n fy = l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2)) - y;\n fpy = A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2);\n l -= delta = fy / fpy, l2 = l * l, l6 = l2 * l2 * l2;\n if (abs(delta) < epsilon2) break;\n }\n return [\n M * x * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2)) / cos(l),\n asin(sin(l) / M)\n ];\n};\n\nexport default function() {\n return projection(equalEarthRaw)\n .scale(177.158);\n}\n","/**\r\n * Functionality for Mercator projection\r\n *\r\n * The function(s) below are from D3.js library (https://d3js.org/)\r\n *\r\n * ```\r\n * Copyright 2017 Mike Bostock\r\n *\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * 1. Redistributions of source code must retain the above copyright notice,\r\n * this list of conditions and the following disclaimer.\r\n *\r\n * 2. Redistributions in binary form must reproduce the above copyright notice,\r\n * this list of conditions and the following disclaimer in the documentation\r\n * and/or other materials provided with the distribution.\r\n *\r\n * 3. Neither the name of the copyright holder nor the names of its\r\n * contributors may be used to endorse or promote products derived from this\r\n * software without specific prior written permission.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n * ```\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Projection } from \"./Projection\";\r\nimport { registry } from \"../../../core/Registry\";\r\nimport * as d3geo from \"d3-geo\";\r\n/**\r\n * Orthographic projection.\r\n */\r\nvar EqualEarth = /** @class */ (function (_super) {\r\n __extends(EqualEarth, _super);\r\n function EqualEarth() {\r\n var _this = _super.call(this) || this;\r\n _this.d3Projection = d3geo.geoEqualEarth();\r\n return _this;\r\n }\r\n return EqualEarth;\r\n}(Projection));\r\nexport { EqualEarth };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"EqualEarth\"] = EqualEarth;\r\n//# sourceMappingURL=EqualEarth.js.map","/**\r\n * Tab Component\r\n *\r\n * @file tab.js\r\n */\r\n\r\nimport $ from \"jquery\";\r\nimport Swiper from 'swiper';\r\nimport SwiperCore, { Navigation, Pagination, Autoplay, EffectFade, Controller, Thumbs, Keyboard, Mousewheel } from 'swiper/core';\r\nSwiperCore.use([Navigation, Pagination, Autoplay, EffectFade, Controller, Thumbs, Keyboard, Mousewheel]);\r\n\r\nimport * as am4core from \"@amcharts/amcharts4/core\";\r\nimport * as am4maps from \"@amcharts/amcharts4/maps\";\r\nimport am4geodata_worldLow from \"@amcharts/amcharts4-geodata/worldLow\";\r\nimport am4themes_animated from \"@amcharts/amcharts4/themes/animated\";\r\n\r\nimport 'swiper/swiper-bundle.css';\r\nconst tabs = (() => {\r\n /**\r\n * Default Tab\r\n * Project default tab style\r\n */\r\n const defaultTab = () => {\r\n const tabsBtns = document.querySelectorAll(\".a-tab-item\");\r\n const tabsContents = document.querySelectorAll(\".a-tab-content\");\r\n\r\n\r\n for (let i = 0; i < tabsBtns.length; i += 1) {\r\n tabsBtns[i].addEventListener('click', function (event) {\r\n [].forEach.call(tabsBtns, function (el) {\r\n el.classList.remove('active');\r\n });\r\n tabsBtns[i].classList.toggle(\"active\");\r\n [].forEach.call(tabsContents, function (el) {\r\n el.classList.remove('tab-active');\r\n });\r\n tabsContents[i].classList.toggle(\"tab-active\");\r\n event.preventDefault();\r\n });\r\n }\r\n };\r\n\r\n const defaultTab2 = () => {\r\n const tabsBtns = document.querySelectorAll(\".a-tab-item2\");\r\n const tabsContents = document.querySelectorAll(\".a-tab-content2\");\r\n\r\n\r\n for (let i = 0; i < tabsBtns.length; i += 1) {\r\n tabsBtns[i].addEventListener('click', function (event) {\r\n [].forEach.call(tabsBtns, function (el) {\r\n el.classList.remove('active');\r\n });\r\n tabsBtns[i].classList.toggle(\"active\");\r\n [].forEach.call(tabsContents, function (el) {\r\n el.classList.remove('tab-active');\r\n });\r\n tabsContents[i].classList.toggle(\"tab-active\");\r\n event.preventDefault();\r\n });\r\n }\r\n };\r\n\r\n const defaultTab3 = () => {\r\n const tabsBtns = document.querySelectorAll(\".a-tab-item3\");\r\n const tabsContents = document.querySelectorAll(\".a-tab-content3\");\r\n\r\n\r\n for (let i = 0; i < tabsBtns.length; i += 1) {\r\n tabsBtns[i].addEventListener('click', function (event) {\r\n [].forEach.call(tabsBtns, function (el) {\r\n el.classList.remove('active');\r\n });\r\n tabsBtns[i].classList.toggle(\"active\");\r\n [].forEach.call(tabsContents, function (el) {\r\n el.classList.remove('tab-active');\r\n });\r\n tabsContents[i].classList.toggle(\"tab-active\");\r\n event.preventDefault();\r\n });\r\n }\r\n };\r\n const defaultTab4 = () => {\r\n \r\n\r\n };\r\n\r\n const init = () => {\r\n defaultTab();\r\n defaultTab2();\r\n defaultTab3();\r\n defaultTab4();\r\n };\r\n\r\n return {\r\n init,\r\n };\r\n})();\r\n\r\nexport default tabs;\r\n","/**\r\n * Slider Component\r\n *\r\n * @file slider.js\r\n */\r\n\r\nimport $ from \"jquery\";\r\nimport Swiper from 'swiper';\r\nimport SwiperCore, { Navigation, Pagination, Autoplay, EffectFade, Controller, Thumbs, Keyboard, Mousewheel } from 'swiper/core';\r\nSwiperCore.use([Navigation, Pagination, Autoplay, EffectFade, Controller, Thumbs, Keyboard, Mousewheel]);\r\n\r\nimport 'swiper/swiper-bundle.css';\r\n\r\nconst slider = (() => {\r\n /**\r\n * fullSlider\r\n * Full width slider settings\r\n */\r\n const fullSlider = () => {\r\n const homeSlide = new Swiper('.main-slide', {\r\n effect: 'fade', \r\n fadeEffect: {\r\n crossFade: true\r\n },\r\n speed: 1500,\r\n loop: false,\r\n navigation: {\r\n nextEl: \".main-slide-next\",\r\n prevEl: \".main-slide-prev\",\r\n }\r\n });\r\n };\r\n \r\n const homeNumberCarousel = () => {\r\n var homeNumberCarousel = new Swiper('.number-value-item', {\r\n // direction: 'horizontal',\r\n // mousewheel: {\r\n\t\t\t// \treleaseOnEdges: true,\r\n\t\t\t// },\r\n\t\t\t// touchReleaseOnEdges: true,\r\n slidesPerView: 4.2,\r\n spaceBetween: 25,\r\n loop:false,\r\n navigation: {\r\n nextEl: \".number-sl-next\",\r\n prevEl: \".number-sl-prev\",\r\n },\r\n breakpoints: {\r\n 0: {\r\n slidesPerView: 1.1,\r\n spaceBetween: 15,\r\n },\r\n 768: {\r\n slidesPerView: 2,\r\n spaceBetween: 25,\r\n },\r\n 1024: {\r\n slidesPerView: 3.04,\r\n spaceBetween: 25,\r\n },\r\n 1380: {\r\n slidesPerView: 3.5,\r\n spaceBetween: 25,\r\n },\r\n 1480: {\r\n slidesPerView: 4.2,\r\n spaceBetween: 25,\r\n },\r\n },\r\n });\r\n };\r\n \r\n const homeMobileMapCarousel = () => {\r\n var homeMobileMapCarousel = new Swiper('.mobile-map-list', {\r\n // direction: 'horizontal',\r\n // mousewheel: {\r\n\t\t\t// \treleaseOnEdges: true,\r\n\t\t\t// },\r\n\t\t\t// touchReleaseOnEdges: true,\r\n slidesPerView: 1.2,\r\n spaceBetween: 10,\r\n loop:false,\r\n observer: true,\r\n observeParents: true,\r\n navigation: {\r\n nextEl: \".mb-map-sl-next\",\r\n prevEl: \".mb-map-sl-prev\",\r\n },\r\n breakpoints: {\r\n 0: {\r\n slidesPerView: 1.2,\r\n spaceBetween: 10,\r\n },\r\n 768: {\r\n slidesPerView: 2,\r\n spaceBetween: 10,\r\n },\r\n },\r\n });\r\n };\r\n \r\n const homeJobCarousel = () => {\r\n var homeJobCarousel = new Swiper('.job-value-item-carousel', {\r\n // direction: 'horizontal',\r\n // mousewheel: {\r\n\t\t\t// \treleaseOnEdges: true,\r\n\t\t\t// },\r\n\t\t\t// touchReleaseOnEdges: true,\r\n slidesPerView: 4.3,\r\n spaceBetween: 15,\r\n loop:false,\r\n navigation: {\r\n nextEl: \".job-sl-next\",\r\n prevEl: \".job-sl-prev\",\r\n },\r\n breakpoints: {\r\n 0: {\r\n slidesPerView: 1.2,\r\n spaceBetween: 15,\r\n },\r\n 768: {\r\n slidesPerView: 2,\r\n spaceBetween: 15,\r\n },\r\n 1024: {\r\n slidesPerView: 3.5,\r\n spaceBetween: 15,\r\n },\r\n 1380: {\r\n slidesPerView: 4.1,\r\n spaceBetween: 15,\r\n },\r\n 1480: {\r\n slidesPerView: 4.3,\r\n spaceBetween: 15,\r\n },\r\n },\r\n });\r\n };\r\n \r\n const homecompanyCarousel = () => {\r\n var homecompanyCarousel = new Swiper('.group-company-value-item', {\r\n // direction: 'horizontal',\r\n // mousewheel: {\r\n\t\t\t// \treleaseOnEdges: true,\r\n\t\t\t// },\r\n\t\t\t// touchReleaseOnEdges: true,\r\n slidesPerView: 4.3,\r\n spaceBetween: 40,\r\n loop:false,\r\n navigation: {\r\n nextEl: \".company-sl-next\",\r\n prevEl: \".company-sl-prev\",\r\n },\r\n breakpoints: {\r\n 0: {\r\n slidesPerView: 1.2,\r\n spaceBetween: 15,\r\n },\r\n 768: {\r\n slidesPerView: 2,\r\n spaceBetween: 25,\r\n },\r\n 1024: {\r\n slidesPerView: 3.04,\r\n spaceBetween: 25,\r\n },\r\n 1380: {\r\n slidesPerView: 3.5,\r\n spaceBetween: 25,\r\n },\r\n 1480: {\r\n slidesPerView: 4.3,\r\n spaceBetween: 40,\r\n },\r\n },\r\n });\r\n };\r\n \r\n const videoMainCarousel = () => {\r\n var videoThumbCarousel = new Swiper('.video-container-thumb-slide', {\r\n // direction: 'horizontal',\r\n // mousewheel: {\r\n\t\t\t// \treleaseOnEdges: true,\r\n\t\t\t// },\r\n\t\t\t// touchReleaseOnEdges: true,\r\n slidesPerView: 10,\r\n spaceBetween: 8,\r\n loop:false, \r\n freeMode: true,\r\n breakpoints: {\r\n 0: {\r\n slidesPerView: 4,\r\n spaceBetween: 8,\r\n },\r\n 768: {\r\n slidesPerView: 6,\r\n spaceBetween: 8,\r\n },\r\n 1024: {\r\n slidesPerView: 8,\r\n spaceBetween: 8,\r\n },\r\n 1200: {\r\n slidesPerView: 10,\r\n spaceBetween: 8,\r\n },\r\n },\r\n });\r\n var videoMainCarousel = new Swiper('.video-container-main-slide', {\r\n // direction: 'horizontal',\r\n // mousewheel: {\r\n\t\t\t// \treleaseOnEdges: true,\r\n\t\t\t// },\r\n\t\t\t// touchReleaseOnEdges: true,\r\n slidesPerView: 1,\r\n spaceBetween: 0,\r\n loop:false,\r\n effect: 'fade', \r\n fadeEffect: {\r\n crossFade: true\r\n },\r\n thumbs: {\r\n swiper: videoThumbCarousel,\r\n },\r\n on: {\r\n init: function() {\r\n if($(\"video-container-main-slide .swiper-slide\").length <= 1) {\r\n $(\".video-container-thumb-slide\").hide();\r\n }\r\n }\r\n }\r\n });\r\n };\r\n \r\n const historyCarousel = () => {\r\n const historyTextCarousel = new Swiper('.history-text-carousel', {\r\n // direction: 'horizontal',\r\n // mousewheel: {\r\n\t\t\t// \treleaseOnEdges: true,\r\n\t\t\t// },\r\n\t\t\t// touchReleaseOnEdges: true,\r\n slidesPerView: 1.3,\r\n spaceBetween: 0,\r\n loop: false,\r\n watchSlidesProgress: true,\r\n allowTouchMove: true,\r\n speed:1200,\r\n breakpoints: {\r\n 0: {\r\n slidesPerView: 1.1,\r\n spaceBetween: 15,\r\n },\r\n 768: {\r\n slidesPerView: 1.2,\r\n spaceBetween: 0,\r\n },\r\n 1024: {\r\n slidesPerView: 1.3,\r\n spaceBetween: 0,\r\n },\r\n },\r\n });\r\n historyTextCarousel.on('slideChange', function () {\r\n // console.log(this.realIndex);\r\n historyNumberCarousel.slideTo(this.realIndex)\r\n });\r\n var historyNumberCarousel = new Swiper('.history-number-carousel', {\r\n // direction: 'horizontal',\r\n // mousewheel: {\r\n\t\t\t// \treleaseOnEdges: true,\r\n\t\t\t// },\r\n\t\t\t// touchReleaseOnEdges: true,\r\n slidesPerView: \"auto\",\r\n spaceBetween: 40,\r\n speed:1200,\r\n loop:false,\r\n centeredSlides: true,\r\n slideToClickedSlide: true,\r\n navigation: {\r\n nextEl: \".history-sl-next\",\r\n prevEl: \".history-sl-prev\",\r\n },\r\n thumbs: {\r\n swiper: historyTextCarousel,\r\n },\r\n });\r\n };\r\n \r\n const privilegesCarousel = () => {\r\n const privilegesCarousel = new Swiper('.privileges-carousel ', {\r\n // direction: 'horizontal',\r\n // mousewheel: {\r\n\t\t\t// \treleaseOnEdges: true,\r\n\t\t\t// },\r\n\t\t\t// touchReleaseOnEdges: true,\r\n slidesPerView: 4,\r\n spaceBetween: 35,\r\n loop:false,\r\n navigation: {\r\n nextEl: \".privileges-sl-next\",\r\n prevEl: \".privileges-sl-prev\",\r\n },\r\n breakpoints: {\r\n 0: {\r\n slidesPerView: 1.2,\r\n spaceBetween: 15,\r\n },\r\n 768: {\r\n slidesPerView: 2,\r\n spaceBetween: 25,\r\n },\r\n 1024: {\r\n slidesPerView: 3,\r\n spaceBetween: 25,\r\n },\r\n 1380: {\r\n slidesPerView: 4,\r\n spaceBetween: 25,\r\n },\r\n 1480: {\r\n slidesPerView: 4,\r\n spaceBetween: 35,\r\n },\r\n },\r\n });\r\n };\r\n \r\n const galleryCarousel = () => {\r\n const galleryCarousel = new Swiper('.gallery-carousel ', {\r\n // direction: 'horizontal',\r\n // mousewheel: {\r\n\t\t\t// \treleaseOnEdges: true,\r\n\t\t\t// },\r\n\t\t\t// touchReleaseOnEdges: true,\r\n slidesPerView: 4,\r\n spaceBetween: 40,\r\n loop:false,\r\n centerMode:true,\r\n navigation: {\r\n nextEl: \".gallery-sl-next\",\r\n prevEl: \".gallery-sl-prev\",\r\n },\r\n breakpoints: {\r\n 0: {\r\n slidesPerView: 1.2,\r\n spaceBetween: 15,\r\n },\r\n 768: {\r\n slidesPerView: 2,\r\n spaceBetween: 25,\r\n },\r\n 1024: {\r\n slidesPerView: 3.04,\r\n spaceBetween: 25,\r\n },\r\n 1380: {\r\n slidesPerView: 3.5,\r\n spaceBetween: 25,\r\n },\r\n 1480: {\r\n slidesPerView: 4,\r\n spaceBetween: 40,\r\n },\r\n },\r\n });\r\n const galleryCarouselv3 = new Swiper('.gallery-carousel-w3 ', {\r\n // direction: 'horizontal',\r\n // mousewheel: {\r\n\t\t\t// \treleaseOnEdges: true,\r\n\t\t\t// },\r\n\t\t\t// touchReleaseOnEdges: true,\r\n slidesPerView: 3.1,\r\n spaceBetween: 40,\r\n loop:false,\r\n centerMode:true,\r\n navigation: {\r\n nextEl: \".gallery-v3-sl-next\",\r\n prevEl: \".gallery-v3-sl-prev\",\r\n },\r\n breakpoints: {\r\n 0: {\r\n slidesPerView: 1.2,\r\n spaceBetween: 15,\r\n },\r\n 768: {\r\n slidesPerView: 2,\r\n spaceBetween: 25,\r\n },\r\n 1024: {\r\n slidesPerView: 3.04,\r\n spaceBetween: 25,\r\n },\r\n 1380: {\r\n slidesPerView: 3.5,\r\n spaceBetween: 25,\r\n },\r\n 1480: {\r\n slidesPerView: 3.1,\r\n spaceBetween: 40,\r\n },\r\n },\r\n });\r\n };\r\n \r\n const jobVideoCarousel = () => {\r\n const jobVideoCarousel1 = new Swiper('.job-value-video-carousel-1 ', {\r\n // direction: 'horizontal',\r\n // mousewheel: {\r\n\t\t\t// \treleaseOnEdges: true,\r\n\t\t\t// },\r\n\t\t\t// touchReleaseOnEdges: true,\r\n slidesPerView: 3.1,\r\n spaceBetween: 20,\r\n loop:false,\r\n navigation: {\r\n nextEl: \".job-video-sl-next1\",\r\n prevEl: \".job-video-sl-prev1\",\r\n },\r\n breakpoints: {\r\n 0: {\r\n slidesPerView: 1.2,\r\n spaceBetween: 15,\r\n },\r\n 768: {\r\n slidesPerView: 2,\r\n spaceBetween: 25,\r\n },\r\n 1024: {\r\n slidesPerView: 3.04,\r\n spaceBetween: 25,\r\n },\r\n 1380: {\r\n slidesPerView: 3.5,\r\n spaceBetween: 25,\r\n },\r\n 1480: {\r\n slidesPerView: 3.1,\r\n spaceBetween: 20,\r\n },\r\n },\r\n });\r\n const jobVideoCarousel2 = new Swiper('.job-value-video-carousel-2 ', {\r\n // direction: 'horizontal',\r\n // mousewheel: {\r\n\t\t\t// \treleaseOnEdges: true,\r\n\t\t\t// },\r\n\t\t\t// touchReleaseOnEdges: true,\r\n slidesPerView: 3.1,\r\n spaceBetween: 20,\r\n loop:false,\r\n navigation: {\r\n nextEl: \".job-video-sl-next2\",\r\n prevEl: \".job-video-sl-prev2\",\r\n },\r\n breakpoints: {\r\n 0: {\r\n slidesPerView: 1.2,\r\n spaceBetween: 15,\r\n },\r\n 768: {\r\n slidesPerView: 2,\r\n spaceBetween: 25,\r\n },\r\n 1024: {\r\n slidesPerView: 3.04,\r\n spaceBetween: 25,\r\n },\r\n 1380: {\r\n slidesPerView: 3.5,\r\n spaceBetween: 25,\r\n },\r\n 1480: {\r\n slidesPerView: 3.1,\r\n spaceBetween: 20,\r\n },\r\n },\r\n });\r\n };\r\n\r\n const otherNewsCarousel = () => {\r\n const otherNewsCarousel = new Swiper('.other-news-carousel', {\r\n // direction: 'horizontal',\r\n // mousewheel: {\r\n\t\t\t// \treleaseOnEdges: true,\r\n\t\t\t// },\r\n\t\t\t// touchReleaseOnEdges: true,\r\n slidesPerView: 3,\r\n spaceBetween: 30,\r\n autoplay: {\r\n delay: 5000,\r\n disableOnInteraction: false, \r\n },\r\n navigation: {\r\n nextEl: \".oth-sl-next\",\r\n prevEl: \".oth-sl-prev\",\r\n },\r\n breakpoints: {\r\n 0: {\r\n slidesPerView: 1.2,\r\n spaceBetween: 15,\r\n },\r\n 768: {\r\n slidesPerView: 2,\r\n spaceBetween: 15,\r\n },\r\n 992: {\r\n slidesPerView: 2.5,\r\n spaceBetween: 30,\r\n },\r\n 1100: {\r\n slidesPerView: 3,\r\n spaceBetween: 30,\r\n },\r\n },\r\n });\r\n };\r\n\r\n const init = () => {\r\n fullSlider();\r\n homeNumberCarousel();\r\n homeMobileMapCarousel();\r\n homeJobCarousel();\r\n homecompanyCarousel();\r\n videoMainCarousel();\r\n historyCarousel();\r\n privilegesCarousel();\r\n galleryCarousel();\r\n jobVideoCarousel();\r\n otherNewsCarousel();\r\n };\r\n\r\n return {\r\n init,\r\n };\r\n})();\r\n\r\nexport default slider;\r\n","\r\nimport $ from 'jquery';\r\n\r\nconst accordion = (() => {\r\n const arrowDownBtn = () => {\r\n // $(\".arrow-down-btn\").on(\"click\", function(){\r\n // $('body,html').animate({ scrollTop: $(this).parents(\"section\").next(\"section\").offset().top}, 800);\r\n // });\r\n };\r\n const defaultAccordion = () => {\r\n const accordionItem = document.getElementsByClassName('js-trigger-accordion');\r\n\r\n for (let i = 0; i < accordionItem.length; i += 1) {\r\n accordionItem[i].addEventListener('click', function (event) {\r\n event.currentTarget.classList.toggle('js-active');\r\n const accordionContent = this.nextElementSibling;\r\n accordionContent.classList.toggle('js-active');\r\n });\r\n }\r\n };\r\n \r\n const stickyArrow = () => {\r\n // var scrollTopButton = document.getElementById(\"scrollTopBtn\");\r\n\r\n // window.onscroll = function() {\r\n // scrollFunction();\r\n // };\r\n\r\n // function scrollFunction() {\r\n // if (document.body.scrollTop > 250 || document.documentElement.scrollTop > 250) {\r\n // scrollTopButton.classList.add(\"active\");\r\n // } else {\r\n // scrollTopButton.classList.remove(\"active\");\r\n // }\r\n // }\r\n // scrollTopButton.addEventListener(\"click\", scrollToTop); \r\n // function scrollToTop() {\r\n // scrollToTopAnimation();\r\n // }\r\n\r\n // function scrollToTopAnimation() {\r\n // var currentPosition = document.documentElement.scrollTop || document.body.scrollTop;\r\n\r\n // if (currentPosition > 0) {\r\n // window.requestAnimationFrame(scrollToTopAnimation);\r\n // window.scrollTo(0, currentPosition - currentPosition / 8);\r\n // }\r\n // }\r\n }\r\n\r\n const reservationScroll = () => {\r\n var floatingDiv = document.querySelector('.position-search');\r\n if (floatingDiv) {\r\n var floatingDivParent = document.querySelector(\".position-search\");\r\n var scrollPosition = window.scrollY || document.documentElement.scrollTop;\r\n var scrollFirstPosition = floatingDivParent.offsetTop + floatingDiv.offsetTop - 20;\r\n var scrolldDataPos = floatingDivParent.setAttribute('data-offset-top', scrollFirstPosition);\r\n var scrollDataPosAt = floatingDivParent.getAttribute('data-offset-top');\r\n if (scrollPosition >= scrollDataPosAt) { \r\n floatingDivParent.classList.add('fixed');\r\n } else { \r\n floatingDivParent.classList.remove('fixed');\r\n }\r\n var minWidth = 992;\r\n\r\n // Check if the current window width is less than the threshold\r\n if (window.innerWidth >= minWidth) {\r\n $(window).scroll(function() {\r\n var scrollPosition = window.scrollY || document.documentElement.scrollTop;\r\n if (scrollPosition >= scrollDataPosAt) { \r\n floatingDivParent.classList.add('fixed');\r\n } else { \r\n floatingDivParent.classList.remove('fixed');\r\n }\r\n });\r\n }\r\n } \r\n };\r\n\r\n const filterAccordion = () => {\r\n // document.addEventListener(\"DOMContentLoaded\", function() {\r\n // const accordion = document.getElementById(\"pos-left-menu\");\r\n // if(accordion){\r\n // document.querySelectorAll('.col-sel').forEach(item => {\r\n // item.addEventListener('click', function() {\r\n // const nextElement = this.nextElementSibling;\r\n // if (nextElement && nextElement.classList.contains('col-list')) {\r\n // nextElement.classList.toggle('active'); // Toggle 'active' class\r\n // }\r\n // });\r\n // });\r\n // }\r\n // });\r\n const isMobile = window.matchMedia(\"(max-width: 992px)\");\r\n\r\n // Mobilde click olayını dinle\r\n if (isMobile.matches) {\r\n $(\".col-sel\").on(\"click\", function() {\r\n $(this).next(\".col-list\").toggleClass(\"active\");\r\n });\r\n }\r\n\r\n };\r\n\r\n const activeJobScroll = () => {\r\n if ($('.active-job').is(\":visible\")){\r\n var targetScroll = $('.home-current-job-eksim').offset().top;\r\n $(\".active-job .bt-arr\").on(\"click\", function(){\r\n $('html, body').animate({scrollTop: targetScroll }, 'slow');\r\n });\r\n }\r\n }\r\n\r\n const init = () => {\r\n arrowDownBtn();\r\n defaultAccordion();\r\n stickyArrow();\r\n reservationScroll();\r\n filterAccordion();\r\n activeJobScroll();\r\n };\r\n\r\n return {\r\n init,\r\n };\r\n})();\r\n\r\nexport default accordion;\r\n","import $ from 'jquery';\r\nconst aosAnim = (() => {\r\n\r\n const socialAnim = () => {\r\n var elems = [$('.circle-bg-fb'), $('.circle-bg-tw'), $('.circle-bg-p')];\r\n var cls = [\"circle-bg-fb-end\", \"circle-bg-tw-end\", \"circle-bg-p-end\"];\r\n\r\n $('div#social-holder').on(\"click\", function(){\r\n for(var i=0; i<elems.length; i++) {\r\n elems[i].toggleClass(cls[i]);\r\n };\r\n });\r\n $(\"#social-holder a\").on(\"click\", function(){\r\n var iMyWidth;\r\n var iMyHeight;\r\n var thLnk = $(this).attr(\"href\");\r\n //half the screen width minus half the new window width (plus 5 pixel borders).\r\n iMyWidth = (window.screen.width/2) - (75 + 10);\r\n //half the screen height minus half the new window height (plus title and status bars).\r\n iMyHeight = (window.screen.height/2) - (100 + 50);\r\n //Open the window.\r\n var win2 = window.open(thLnk,\"Window2\",\"status=no,height=500,width=700,resizable=yes,left=\" + iMyWidth + \",top=\" + iMyHeight + \",screenX=\" + iMyWidth + \",screenY=\" + iMyHeight + \",toolbar=no,menubar=no,scrollbars=no,location=no,directories=no\");\r\n win2.focus();\r\n });\r\n };\r\n\r\n\r\n const init = () => {\r\n socialAnim();\r\n };\r\n\r\n return {\r\n init,\r\n };\r\n})();\r\n\r\nexport default aosAnim;\r\n","const t=(t,e=1e4)=>(t=parseFloat(t+\"\")||0,Math.round((t+Number.EPSILON)*e)/e),e=function(t){if(!(t&&t instanceof Element&&t.offsetParent))return!1;const e=t.scrollHeight>t.clientHeight,i=window.getComputedStyle(t).overflowY,n=-1!==i.indexOf(\"hidden\"),s=-1!==i.indexOf(\"visible\");return e&&!n&&!s},i=function(t,n=void 0){return!(!t||t===document.body||n&&t===n)&&(e(t)?t:i(t.parentElement,n))},n=function(t){var e=(new DOMParser).parseFromString(t,\"text/html\").body;if(e.childElementCount>1){for(var i=document.createElement(\"div\");e.firstChild;)i.appendChild(e.firstChild);return i}return e.firstChild},s=t=>`${t||\"\"}`.split(\" \").filter((t=>!!t)),o=(t,e,i)=>{s(e).forEach((e=>{t&&t.classList.toggle(e,i||!1)}))};class a{constructor(t){Object.defineProperty(this,\"pageX\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"pageY\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"clientX\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"clientY\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"id\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"time\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"nativePointer\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.nativePointer=t,this.pageX=t.pageX,this.pageY=t.pageY,this.clientX=t.clientX,this.clientY=t.clientY,this.id=self.Touch&&t instanceof Touch?t.identifier:-1,this.time=Date.now()}}const r={passive:!1};class l{constructor(t,{start:e=(()=>!0),move:i=(()=>{}),end:n=(()=>{})}){Object.defineProperty(this,\"element\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"startCallback\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"moveCallback\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"endCallback\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"currentPointers\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"startPointers\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this.element=t,this.startCallback=e,this.moveCallback=i,this.endCallback=n;for(const t of[\"onPointerStart\",\"onTouchStart\",\"onMove\",\"onTouchEnd\",\"onPointerEnd\",\"onWindowBlur\"])this[t]=this[t].bind(this);this.element.addEventListener(\"mousedown\",this.onPointerStart,r),this.element.addEventListener(\"touchstart\",this.onTouchStart,r),this.element.addEventListener(\"touchmove\",this.onMove,r),this.element.addEventListener(\"touchend\",this.onTouchEnd),this.element.addEventListener(\"touchcancel\",this.onTouchEnd)}onPointerStart(t){if(!t.buttons||0!==t.button)return;const e=new a(t);this.currentPointers.some((t=>t.id===e.id))||this.triggerPointerStart(e,t)&&(window.addEventListener(\"mousemove\",this.onMove),window.addEventListener(\"mouseup\",this.onPointerEnd),window.addEventListener(\"blur\",this.onWindowBlur))}onTouchStart(t){for(const e of Array.from(t.changedTouches||[]))this.triggerPointerStart(new a(e),t);window.addEventListener(\"blur\",this.onWindowBlur)}onMove(t){const e=this.currentPointers.slice(),i=\"changedTouches\"in t?Array.from(t.changedTouches||[]).map((t=>new a(t))):[new a(t)],n=[];for(const t of i){const e=this.currentPointers.findIndex((e=>e.id===t.id));e<0||(n.push(t),this.currentPointers[e]=t)}n.length&&this.moveCallback(t,this.currentPointers.slice(),e)}onPointerEnd(t){t.buttons>0&&0!==t.button||(this.triggerPointerEnd(t,new a(t)),window.removeEventListener(\"mousemove\",this.onMove),window.removeEventListener(\"mouseup\",this.onPointerEnd),window.removeEventListener(\"blur\",this.onWindowBlur))}onTouchEnd(t){for(const e of Array.from(t.changedTouches||[]))this.triggerPointerEnd(t,new a(e))}triggerPointerStart(t,e){return!!this.startCallback(e,t,this.currentPointers.slice())&&(this.currentPointers.push(t),this.startPointers.push(t),!0)}triggerPointerEnd(t,e){const i=this.currentPointers.findIndex((t=>t.id===e.id));i<0||(this.currentPointers.splice(i,1),this.startPointers.splice(i,1),this.endCallback(t,e,this.currentPointers.slice()))}onWindowBlur(){this.clear()}clear(){for(;this.currentPointers.length;){const t=this.currentPointers[this.currentPointers.length-1];this.currentPointers.splice(this.currentPointers.length-1,1),this.startPointers.splice(this.currentPointers.length-1,1),this.endCallback(new Event(\"touchend\",{bubbles:!0,cancelable:!0,clientX:t.clientX,clientY:t.clientY}),t,this.currentPointers.slice())}}stop(){this.element.removeEventListener(\"mousedown\",this.onPointerStart,r),this.element.removeEventListener(\"touchstart\",this.onTouchStart,r),this.element.removeEventListener(\"touchmove\",this.onMove,r),this.element.removeEventListener(\"touchend\",this.onTouchEnd),this.element.removeEventListener(\"touchcancel\",this.onTouchEnd),window.removeEventListener(\"mousemove\",this.onMove),window.removeEventListener(\"mouseup\",this.onPointerEnd),window.removeEventListener(\"blur\",this.onWindowBlur)}}function c(t,e){return e?Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2)):0}function h(t,e){return e?{clientX:(t.clientX+e.clientX)/2,clientY:(t.clientY+e.clientY)/2}:t}const d=t=>\"object\"==typeof t&&null!==t&&t.constructor===Object&&\"[object Object]\"===Object.prototype.toString.call(t),u=(t,...e)=>{const i=e.length;for(let n=0;n<i;n++){const i=e[n]||{};Object.entries(i).forEach((([e,i])=>{const n=Array.isArray(i)?[]:{};t[e]||Object.assign(t,{[e]:n}),d(i)?Object.assign(t[e],u(n,i)):Array.isArray(i)?Object.assign(t,{[e]:[...i]}):Object.assign(t,{[e]:i})}))}return t},p=function(t,e){return t.split(\".\").reduce(((t,e)=>\"object\"==typeof t?t[e]:void 0),e)};class f{constructor(t={}){Object.defineProperty(this,\"options\",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,\"events\",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),this.setOptions(t);for(const t of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))t.startsWith(\"on\")&&\"function\"==typeof this[t]&&(this[t]=this[t].bind(this))}setOptions(t){this.options=t?u({},this.constructor.defaults,t):{};for(const[t,e]of Object.entries(this.option(\"on\")||{}))this.on(t,e)}option(t,...e){let i=p(t,this.options);return i&&\"function\"==typeof i&&(i=i.call(this,this,...e)),i}optionFor(t,e,i,...n){let s=p(e,t);var o;\"string\"!=typeof(o=s)||isNaN(o)||isNaN(parseFloat(o))||(s=parseFloat(s)),\"true\"===s&&(s=!0),\"false\"===s&&(s=!1),s&&\"function\"==typeof s&&(s=s.call(this,this,t,...n));let a=p(e,this.options);return a&&\"function\"==typeof a?s=a.call(this,this,t,...n,s):void 0===s&&(s=a),void 0===s?i:s}cn(t){const e=this.options.classes;return e&&e[t]||\"\"}localize(t,e=[]){t=String(t).replace(/\\{\\{(\\w+).?(\\w+)?\\}\\}/g,((t,e,i)=>{let n=\"\";return i?n=this.option(`${e[0]+e.toLowerCase().substring(1)}.l10n.${i}`):e&&(n=this.option(`l10n.${e}`)),n||(n=t),n}));for(let i=0;i<e.length;i++)t=t.split(e[i][0]).join(e[i][1]);return t=t.replace(/\\{\\{(.*?)\\}\\}/g,((t,e)=>e))}on(t,e){let i=[];\"string\"==typeof t?i=t.split(\" \"):Array.isArray(t)&&(i=t),this.events||(this.events=new Map),i.forEach((t=>{let i=this.events.get(t);i||(this.events.set(t,[]),i=[]),i.includes(e)||i.push(e),this.events.set(t,i)}))}off(t,e){let i=[];\"string\"==typeof t?i=t.split(\" \"):Array.isArray(t)&&(i=t),i.forEach((t=>{const i=this.events.get(t);if(Array.isArray(i)){const t=i.indexOf(e);t>-1&&i.splice(t,1)}}))}emit(t,...e){[...this.events.get(t)||[]].forEach((t=>t(this,...e))),\"*\"!==t&&this.emit(\"*\",t,...e)}}Object.defineProperty(f,\"version\",{enumerable:!0,configurable:!0,writable:!0,value:\"5.0.22\"}),Object.defineProperty(f,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:{}});class m extends f{constructor(t={}){super(t),Object.defineProperty(this,\"plugins\",{enumerable:!0,configurable:!0,writable:!0,value:{}})}attachPlugins(t={}){const e=new Map;for(const[i,n]of Object.entries(t)){const t=this.option(i),s=this.plugins[i];s||!1===t?s&&!1===t&&(s.detach(),delete this.plugins[i]):e.set(i,new n(this,t||{}))}for(const[t,i]of e)this.plugins[t]=i,i.attach();this.emit(\"attachPlugins\")}detachPlugins(t){t=t||Object.keys(this.plugins);for(const e of t){const t=this.plugins[e];t&&t.detach(),delete this.plugins[e]}return this.emit(\"detachPlugins\"),this}}var g;!function(t){t[t.Init=0]=\"Init\",t[t.Error=1]=\"Error\",t[t.Ready=2]=\"Ready\",t[t.Panning=3]=\"Panning\",t[t.Mousemove=4]=\"Mousemove\",t[t.Destroy=5]=\"Destroy\"}(g||(g={}));const b=[\"a\",\"b\",\"c\",\"d\",\"e\",\"f\"],v={PANUP:\"Move up\",PANDOWN:\"Move down\",PANLEFT:\"Move left\",PANRIGHT:\"Move right\",ZOOMIN:\"Zoom in\",ZOOMOUT:\"Zoom out\",TOGGLEZOOM:\"Toggle zoom level\",TOGGLE1TO1:\"Toggle zoom level\",ITERATEZOOM:\"Toggle zoom level\",ROTATECCW:\"Rotate counterclockwise\",ROTATECW:\"Rotate clockwise\",FLIPX:\"Flip horizontally\",FLIPY:\"Flip vertically\",FITX:\"Fit horizontally\",FITY:\"Fit vertically\",RESET:\"Reset\",TOGGLEFS:\"Toggle fullscreen\"},y={content:null,width:\"auto\",height:\"auto\",panMode:\"drag\",touch:!0,dragMinThreshold:3,lockAxis:!1,mouseMoveFactor:1,mouseMoveFriction:.12,zoom:!0,pinchToZoom:!0,panOnlyZoomed:\"auto\",minScale:1,maxScale:2,friction:.25,dragFriction:.35,decelFriction:.05,click:\"toggleZoom\",dblClick:!1,wheel:\"zoom\",wheelLimit:7,spinner:!0,bounds:\"auto\",infinite:!1,rubberband:!0,bounce:!0,maxVelocity:75,transformParent:!1,classes:{content:\"f-panzoom__content\",isLoading:\"is-loading\",canZoomIn:\"can-zoom_in\",canZoomOut:\"can-zoom_out\",isDraggable:\"is-draggable\",isDragging:\"is-dragging\",inFullscreen:\"in-fullscreen\",htmlHasFullscreen:\"with-panzoom-in-fullscreen\"},l10n:v},w='<div class=\"f-spinner\"><svg viewBox=\"0 0 50 50\"><circle cx=\"25\" cy=\"25\" r=\"20\"></circle><circle cx=\"25\" cy=\"25\" r=\"20\"></circle></svg></div>',x=t=>t&&null!==t&&t instanceof Element&&\"nodeType\"in t,E=(t,e)=>{t&&s(e).forEach((e=>{t.classList.remove(e)}))},S=(t,e)=>{t&&s(e).forEach((e=>{t.classList.add(e)}))},P={a:1,b:0,c:0,d:1,e:0,f:0},C=1e5,M=1e3,T=\"mousemove\",O=\"drag\",A=\"content\";let z=null,L=null;class R extends m{get isTouchDevice(){return null===L&&(L=window.matchMedia(\"(hover: none)\").matches),L}get isMobile(){return null===z&&(z=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)),z}get panMode(){return this.options.panMode!==T||this.isTouchDevice?O:T}get panOnlyZoomed(){const t=this.options.panOnlyZoomed;return\"auto\"===t?this.isTouchDevice:t}get isInfinite(){return this.option(\"infinite\")}get angle(){return 180*Math.atan2(this.current.b,this.current.a)/Math.PI||0}get targetAngle(){return 180*Math.atan2(this.target.b,this.target.a)/Math.PI||0}get scale(){const{a:t,b:e}=this.current;return Math.sqrt(t*t+e*e)||1}get targetScale(){const{a:t,b:e}=this.target;return Math.sqrt(t*t+e*e)||1}get minScale(){return this.option(\"minScale\")||1}get fullScale(){const{contentRect:t}=this;return t.fullWidth/t.fitWidth||1}get maxScale(){return this.fullScale*(this.option(\"maxScale\")||1)||1}get coverScale(){const{containerRect:t,contentRect:e}=this,i=Math.max(t.height/e.fitHeight,t.width/e.fitWidth)||1;return Math.min(this.fullScale,i)}get isScaling(){return Math.abs(this.targetScale-this.scale)>1e-5&&!this.isResting}get isContentLoading(){const t=this.content;return!!(t&&t instanceof HTMLImageElement)&&!t.complete}get isResting(){if(this.isBouncingX||this.isBouncingY)return!1;for(const t of b){const e=\"e\"==t||\"f\"===t?.001:1e-5;if(Math.abs(this.target[t]-this.current[t])>e)return!1}return!(!this.ignoreBounds&&!this.checkBounds().inBounds)}constructor(t,e={},i={}){var s;if(super(e),Object.defineProperty(this,\"pointerTracker\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"resizeObserver\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"updateTimer\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"clickTimer\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"rAF\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"isTicking\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"friction\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"ignoreBounds\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"isBouncingX\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"isBouncingY\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"clicks\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"trackingPoints\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"pwt\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"cwd\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"pmme\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"state\",{enumerable:!0,configurable:!0,writable:!0,value:g.Init}),Object.defineProperty(this,\"isDragging\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"container\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"content\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"spinner\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"containerRect\",{enumerable:!0,configurable:!0,writable:!0,value:{width:0,height:0,innerWidth:0,innerHeight:0}}),Object.defineProperty(this,\"contentRect\",{enumerable:!0,configurable:!0,writable:!0,value:{top:0,right:0,bottom:0,left:0,fullWidth:0,fullHeight:0,fitWidth:0,fitHeight:0,width:0,height:0}}),Object.defineProperty(this,\"dragStart\",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0,top:0,left:0,time:0}}),Object.defineProperty(this,\"dragOffset\",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0,time:0}}),Object.defineProperty(this,\"current\",{enumerable:!0,configurable:!0,writable:!0,value:Object.assign({},P)}),Object.defineProperty(this,\"target\",{enumerable:!0,configurable:!0,writable:!0,value:Object.assign({},P)}),Object.defineProperty(this,\"velocity\",{enumerable:!0,configurable:!0,writable:!0,value:{a:0,b:0,c:0,d:0,e:0,f:0}}),Object.defineProperty(this,\"lockedAxis\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),!t)throw new Error(\"Container Element Not Found\");this.container=t,this.initContent(),this.attachPlugins(Object.assign(Object.assign({},R.Plugins),i)),this.emit(\"init\");const o=this.content;if(o.addEventListener(\"load\",this.onLoad),o.addEventListener(\"error\",this.onError),this.isContentLoading){if(this.option(\"spinner\")){t.classList.add(this.cn(\"isLoading\"));const e=n(w);!t.contains(o)||o.parentElement instanceof HTMLPictureElement?this.spinner=t.appendChild(e):this.spinner=(null===(s=o.parentElement)||void 0===s?void 0:s.insertBefore(e,o))||null}this.emit(\"beforeLoad\")}else queueMicrotask((()=>{this.enable()}))}initContent(){const{container:t}=this,e=this.cn(A);let i=this.option(A)||t.querySelector(`.${e}`);if(i||(i=t.querySelector(\"img,picture\")||t.firstElementChild,i&&S(i,e)),i instanceof HTMLPictureElement&&(i=i.querySelector(\"img\")),!i)throw new Error(\"No content found\");this.content=i}onLoad(){this.spinner&&(this.spinner.remove(),this.spinner=null),this.option(\"spinner\")&&this.container.classList.remove(this.cn(\"isLoading\")),this.emit(\"afterLoad\"),this.state===g.Init?this.enable():this.updateMetrics()}onError(){this.state!==g.Destroy&&(this.spinner&&(this.spinner.remove(),this.spinner=null),this.stop(),this.detachEvents(),this.state=g.Error,this.emit(\"error\"))}attachObserver(){var t;const e=()=>Math.abs(this.containerRect.width-this.container.getBoundingClientRect().width)>.1||Math.abs(this.containerRect.height-this.container.getBoundingClientRect().height)>.1;this.resizeObserver||void 0===window.ResizeObserver||(this.resizeObserver=new ResizeObserver((()=>{this.updateTimer||(e()?(this.onResize(),this.isMobile&&(this.updateTimer=setTimeout((()=>{e()&&this.onResize(),this.updateTimer=null}),500))):this.updateTimer&&(clearTimeout(this.updateTimer),this.updateTimer=null))}))),null===(t=this.resizeObserver)||void 0===t||t.observe(this.container)}detachObserver(){var t;null===(t=this.resizeObserver)||void 0===t||t.disconnect()}attachEvents(){const{container:t}=this;t.addEventListener(\"click\",this.onClick,{passive:!1,capture:!1}),t.addEventListener(\"wheel\",this.onWheel,{passive:!1}),this.pointerTracker=new l(t,{start:this.onPointerDown,move:this.onPointerMove,end:this.onPointerUp}),document.addEventListener(T,this.onMouseMove)}detachEvents(){var t;const{container:e}=this;e.removeEventListener(\"click\",this.onClick,{passive:!1,capture:!1}),e.removeEventListener(\"wheel\",this.onWheel,{passive:!1}),null===(t=this.pointerTracker)||void 0===t||t.stop(),this.pointerTracker=null,document.removeEventListener(T,this.onMouseMove),document.removeEventListener(\"keydown\",this.onKeydown,!0),this.clickTimer&&(clearTimeout(this.clickTimer),this.clickTimer=null),this.updateTimer&&(clearTimeout(this.updateTimer),this.updateTimer=null)}animate(){const t=this.friction;this.setTargetForce();const e=this.option(\"maxVelocity\");for(const i of b)t?(this.velocity[i]*=1-t,e&&!this.isScaling&&(this.velocity[i]=Math.max(Math.min(this.velocity[i],e),-1*e)),this.current[i]+=this.velocity[i]):this.current[i]=this.target[i];this.setTransform(),this.setEdgeForce(),!this.isResting||this.isDragging?this.rAF=requestAnimationFrame((()=>this.animate())):this.stop(\"current\")}setTargetForce(){for(const t of b)\"e\"===t&&this.isBouncingX||\"f\"===t&&this.isBouncingY||(this.velocity[t]=(1/(1-this.friction)-1)*(this.target[t]-this.current[t]))}checkBounds(t=0,e=0){const{current:i}=this,n=i.e+t,s=i.f+e,o=this.getBounds(),{x:a,y:r}=o,l=a.min,c=a.max,h=r.min,d=r.max;let u=0,p=0;return l!==1/0&&n<l?u=l-n:c!==1/0&&n>c&&(u=c-n),h!==1/0&&s<h?p=h-s:d!==1/0&&s>d&&(p=d-s),Math.abs(u)<.001&&(u=0),Math.abs(p)<.001&&(p=0),Object.assign(Object.assign({},o),{xDiff:u,yDiff:p,inBounds:!u&&!p})}clampTargetBounds(){const{target:t}=this,{x:e,y:i}=this.getBounds();e.min!==1/0&&(t.e=Math.max(t.e,e.min)),e.max!==1/0&&(t.e=Math.min(t.e,e.max)),i.min!==1/0&&(t.f=Math.max(t.f,i.min)),i.max!==1/0&&(t.f=Math.min(t.f,i.max))}calculateContentDim(t=this.current){const{content:e,contentRect:i}=this,{fitWidth:n,fitHeight:s,fullWidth:o,fullHeight:a}=i;let r=o,l=a;if(this.option(\"zoom\")||0!==this.angle){const i=!(e instanceof HTMLImageElement)&&(\"none\"===window.getComputedStyle(e).maxWidth||\"none\"===window.getComputedStyle(e).maxHeight),c=i?o:n,h=i?a:s,d=this.getMatrix(t),u=new DOMPoint(0,0).matrixTransform(d),p=new DOMPoint(0+c,0).matrixTransform(d),f=new DOMPoint(0+c,0+h).matrixTransform(d),m=new DOMPoint(0,0+h).matrixTransform(d),g=Math.abs(f.x-u.x),b=Math.abs(f.y-u.y),v=Math.abs(m.x-p.x),y=Math.abs(m.y-p.y);r=Math.max(g,v),l=Math.max(b,y)}return{contentWidth:r,contentHeight:l}}setEdgeForce(){if(this.ignoreBounds||this.isDragging||this.panMode===T||this.targetScale<this.scale)return this.isBouncingX=!1,void(this.isBouncingY=!1);const{target:t}=this,{x:e,y:i,xDiff:n,yDiff:s}=this.checkBounds();const o=this.option(\"maxVelocity\");let a=this.velocity.e,r=this.velocity.f;0!==n?(this.isBouncingX=!0,n*a<=0?a+=.14*n:(a=.14*n,e.min!==1/0&&(this.target.e=Math.max(t.e,e.min)),e.max!==1/0&&(this.target.e=Math.min(t.e,e.max))),o&&(a=Math.max(Math.min(a,o),-1*o))):this.isBouncingX=!1,0!==s?(this.isBouncingY=!0,s*r<=0?r+=.14*s:(r=.14*s,i.min!==1/0&&(this.target.f=Math.max(t.f,i.min)),i.max!==1/0&&(this.target.f=Math.min(t.f,i.max))),o&&(r=Math.max(Math.min(r,o),-1*o))):this.isBouncingY=!1,this.isBouncingX&&(this.velocity.e=a),this.isBouncingY&&(this.velocity.f=r)}enable(){const{content:t}=this,e=new DOMMatrixReadOnly(window.getComputedStyle(t).transform);for(const t of b)this.current[t]=this.target[t]=e[t];this.updateMetrics(),this.attachObserver(),this.attachEvents(),this.state=g.Ready,this.emit(\"ready\")}onClick(t){var e;this.isDragging&&(null===(e=this.pointerTracker)||void 0===e||e.clear(),this.trackingPoints=[],this.startDecelAnim());const i=t.target;if(!i||t.defaultPrevented)return;if(i&&i.hasAttribute(\"disabled\"))return t.preventDefault(),void t.stopPropagation();if((()=>{const t=window.getSelection();return t&&\"Range\"===t.type})()&&!i.closest(\"button\"))return;const n=i.closest(\"[data-panzoom-action]\"),s=i.closest(\"[data-panzoom-change]\"),o=n||s,a=o&&x(o)?o.dataset:null;if(a){const e=a.panzoomChange,i=a.panzoomAction;if((e||i)&&t.preventDefault(),e){let t={};try{t=JSON.parse(e)}catch(t){console&&console.warn(\"The given data was not valid JSON\")}return void this.applyChange(t)}if(i)return void(this[i]&&this[i]())}if(Math.abs(this.dragOffset.x)>3||Math.abs(this.dragOffset.y)>3)return t.preventDefault(),void t.stopPropagation();const r=this.content.getBoundingClientRect();if(this.dragStart.time&&!this.canZoomOut()&&(Math.abs(r.x-this.dragStart.x)>2||Math.abs(r.y-this.dragStart.y)>2))return;this.dragStart.time=0;const l=e=>{this.option(\"zoom\")&&e&&\"string\"==typeof e&&/(iterateZoom)|(toggle(Zoom|Full|Cover|Max)|(zoomTo(Fit|Cover|Max)))/.test(e)&&\"function\"==typeof this[e]&&(t.preventDefault(),this[e]({event:t}))},c=this.option(\"click\",t),h=this.option(\"dblClick\",t);h?(this.clicks++,1==this.clicks&&(this.clickTimer=setTimeout((()=>{1===this.clicks?(this.emit(\"click\",t),!t.defaultPrevented&&c&&l(c)):(this.emit(\"dblClick\",t),t.defaultPrevented||l(h)),this.clicks=0,this.clickTimer=null}),350))):(this.emit(\"click\",t),!t.defaultPrevented&&c&&l(c))}addTrackingPoint(t){const e=this.trackingPoints.filter((t=>t.time>Date.now()-100));e.push(t),this.trackingPoints=e}onPointerDown(t,e,i){var n;if(!1===this.option(\"touch\",t))return!1;this.pwt=0,this.dragOffset={x:0,y:0,time:0},this.trackingPoints=[];const s=this.content.getBoundingClientRect();if(this.dragStart={x:s.x,y:s.y,top:s.top,left:s.left,time:Date.now()},this.clickTimer)return!1;if(this.panMode===T&&this.targetScale>1)return t.preventDefault(),t.stopPropagation(),!1;const o=t.composedPath()[0];if(!i.length){if([\"TEXTAREA\",\"OPTION\",\"INPUT\",\"SELECT\",\"VIDEO\",\"IFRAME\"].includes(o.nodeName)||o.closest(\"[contenteditable]\")||o.closest(\"[data-selectable]\")||o.closest(\"[data-draggable]\")||o.closest(\"[data-clickable]\")||o.closest(\"[data-panzoom-change]\")||o.closest(\"[data-panzoom-action]\"))return!1;null===(n=window.getSelection())||void 0===n||n.removeAllRanges()}if(\"mousedown\"===t.type)[\"A\",\"BUTTON\"].includes(o.nodeName)||t.preventDefault();else if(Math.abs(this.velocity.a)>.3)return!1;return this.target.e=this.current.e,this.target.f=this.current.f,this.stop(),this.isDragging||(this.isDragging=!0,this.addTrackingPoint(e),this.emit(\"touchStart\",t)),!0}onPointerMove(e,n,s){if(!1===this.option(\"touch\",e))return;if(!this.isDragging)return;if(n.length<2&&this.panOnlyZoomed&&t(this.targetScale)<=t(this.minScale))return;if(this.emit(\"touchMove\",e),e.defaultPrevented)return;this.addTrackingPoint(n[0]);const{content:o}=this,a=h(s[0],s[1]),r=h(n[0],n[1]);let l=0,d=0;if(n.length>1){const t=o.getBoundingClientRect();l=a.clientX-t.left-.5*t.width,d=a.clientY-t.top-.5*t.height}const u=c(s[0],s[1]),p=c(n[0],n[1]);let f=u?p/u:1,m=r.clientX-a.clientX,g=r.clientY-a.clientY;this.dragOffset.x+=m,this.dragOffset.y+=g,this.dragOffset.time=Date.now()-this.dragStart.time;let b=t(this.targetScale)===t(this.minScale)&&this.option(\"lockAxis\");if(b&&!this.lockedAxis)if(\"xy\"===b||\"y\"===b||\"touchmove\"===e.type){if(Math.abs(this.dragOffset.x)<6&&Math.abs(this.dragOffset.y)<6)return void e.preventDefault();const t=Math.abs(180*Math.atan2(this.dragOffset.y,this.dragOffset.x)/Math.PI);this.lockedAxis=t>45&&t<135?\"y\":\"x\",this.dragOffset.x=0,this.dragOffset.y=0,m=0,g=0}else this.lockedAxis=b;if(i(e.target,this.content)&&(b=\"x\",this.dragOffset.y=0),b&&\"xy\"!==b&&this.lockedAxis!==b&&t(this.targetScale)===t(this.minScale))return;e.cancelable&&e.preventDefault(),this.container.classList.add(this.cn(\"isDragging\"));const v=this.checkBounds(m,g);this.option(\"rubberband\")?(\"x\"!==this.isInfinite&&(v.xDiff>0&&m<0||v.xDiff<0&&m>0)&&(m*=Math.max(0,.5-Math.abs(.75/this.contentRect.fitWidth*v.xDiff))),\"y\"!==this.isInfinite&&(v.yDiff>0&&g<0||v.yDiff<0&&g>0)&&(g*=Math.max(0,.5-Math.abs(.75/this.contentRect.fitHeight*v.yDiff)))):(v.xDiff&&(m=0),v.yDiff&&(g=0));const y=this.targetScale,w=this.minScale,x=this.maxScale;y<.5*w&&(f=Math.max(f,w)),y>1.5*x&&(f=Math.min(f,x)),\"y\"===this.lockedAxis&&t(y)===t(w)&&(m=0),\"x\"===this.lockedAxis&&t(y)===t(w)&&(g=0),this.applyChange({originX:l,originY:d,panX:m,panY:g,scale:f,friction:this.option(\"dragFriction\"),ignoreBounds:!0})}onPointerUp(t,e,n){if(n.length)return this.dragOffset.x=0,this.dragOffset.y=0,void(this.trackingPoints=[]);this.container.classList.remove(this.cn(\"isDragging\")),this.isDragging&&(this.addTrackingPoint(e),this.panOnlyZoomed&&this.contentRect.width-this.contentRect.fitWidth<1&&this.contentRect.height-this.contentRect.fitHeight<1&&(this.trackingPoints=[]),i(t.target,this.content)&&\"y\"===this.lockedAxis&&(this.trackingPoints=[]),this.emit(\"touchEnd\",t),this.isDragging=!1,this.lockedAxis=!1,this.state!==g.Destroy&&(t.defaultPrevented||this.startDecelAnim()))}startDecelAnim(){var e;const i=this.isScaling;this.rAF&&(cancelAnimationFrame(this.rAF),this.rAF=null),this.isBouncingX=!1,this.isBouncingY=!1;for(const t of b)this.velocity[t]=0;this.target.e=this.current.e,this.target.f=this.current.f,E(this.container,\"is-scaling\"),E(this.container,\"is-animating\"),this.isTicking=!1;const{trackingPoints:n}=this,s=n[0],o=n[n.length-1];let a=0,r=0,l=0;o&&s&&(a=o.clientX-s.clientX,r=o.clientY-s.clientY,l=o.time-s.time);const c=(null===(e=window.visualViewport)||void 0===e?void 0:e.scale)||1;1!==c&&(a*=c,r*=c);let h=0,d=0,u=0,p=0,f=this.option(\"decelFriction\");const m=this.targetScale;if(l>0){u=Math.abs(a)>3?a/(l/30):0,p=Math.abs(r)>3?r/(l/30):0;const t=this.option(\"maxVelocity\");t&&(u=Math.max(Math.min(u,t),-1*t),p=Math.max(Math.min(p,t),-1*t))}u&&(h=u/(1/(1-f)-1)),p&&(d=p/(1/(1-f)-1)),(\"y\"===this.option(\"lockAxis\")||\"xy\"===this.option(\"lockAxis\")&&\"y\"===this.lockedAxis&&t(m)===this.minScale)&&(h=u=0),(\"x\"===this.option(\"lockAxis\")||\"xy\"===this.option(\"lockAxis\")&&\"x\"===this.lockedAxis&&t(m)===this.minScale)&&(d=p=0);const g=this.dragOffset.x,v=this.dragOffset.y,y=this.option(\"dragMinThreshold\")||0;Math.abs(g)<y&&Math.abs(v)<y&&(h=d=0,u=p=0),(m<this.minScale-1e-5||m>this.maxScale+1e-5||i&&!h&&!d)&&(f=.35),this.applyChange({panX:h,panY:d,friction:f}),this.emit(\"decel\",u,p,g,v)}onWheel(t){var e=[-t.deltaX||0,-t.deltaY||0,-t.detail||0].reduce((function(t,e){return Math.abs(e)>Math.abs(t)?e:t}));const i=Math.max(-1,Math.min(1,e));if(this.emit(\"wheel\",t,i),this.panMode===T)return;if(t.defaultPrevented)return;const n=this.option(\"wheel\");\"pan\"===n?(t.preventDefault(),this.panOnlyZoomed&&!this.canZoomOut()||this.applyChange({panX:2*-t.deltaX,panY:2*-t.deltaY,bounce:!1})):\"zoom\"===n&&!1!==this.option(\"zoom\")&&this.zoomWithWheel(t)}onMouseMove(t){this.panWithMouse(t)}onKeydown(t){\"Escape\"===t.key&&this.toggleFS()}onResize(){this.updateMetrics(),this.checkBounds().inBounds||this.requestTick()}setTransform(){this.emit(\"beforeTransform\");const{current:e,target:i,content:n,contentRect:s}=this,o=Object.assign({},P);for(const n of b){const s=\"e\"==n||\"f\"===n?M:C;o[n]=t(e[n],s),Math.abs(i[n]-e[n])<(\"e\"==n||\"f\"===n?.51:.001)&&(e[n]=i[n])}let{a:a,b:r,c:l,d:c,e:h,f:d}=o,u=`matrix(${a}, ${r}, ${l}, ${c}, ${h}, ${d})`,p=n.parentElement instanceof HTMLPictureElement?n.parentElement:n;if(this.option(\"transformParent\")&&(p=p.parentElement||p),p.style.transform===u)return;p.style.transform=u;const{contentWidth:f,contentHeight:m}=this.calculateContentDim();s.width=f,s.height=m,this.emit(\"afterTransform\")}updateMetrics(e=!1){var i;if(!this||this.state===g.Destroy)return;if(this.isContentLoading)return;const n=Math.max(1,(null===(i=window.visualViewport)||void 0===i?void 0:i.scale)||1),{container:s,content:o}=this,a=o instanceof HTMLImageElement,r=s.getBoundingClientRect(),l=getComputedStyle(this.container);let c=r.width*n,h=r.height*n;const d=parseFloat(l.paddingTop)+parseFloat(l.paddingBottom),u=c-(parseFloat(l.paddingLeft)+parseFloat(l.paddingRight)),p=h-d;this.containerRect={width:c,height:h,innerWidth:u,innerHeight:p};let f=this.option(\"width\")||\"auto\",m=this.option(\"height\")||\"auto\";\"auto\"===f&&(f=parseFloat(o.dataset.width||\"\")||(t=>{let e=0;return e=t instanceof HTMLImageElement?t.naturalWidth:t instanceof SVGElement?t.width.baseVal.value:Math.max(t.offsetWidth,t.scrollWidth),e||0})(o)),\"auto\"===m&&(m=parseFloat(o.dataset.height||\"\")||(t=>{let e=0;return e=t instanceof HTMLImageElement?t.naturalHeight:t instanceof SVGElement?t.height.baseVal.value:Math.max(t.offsetHeight,t.scrollHeight),e||0})(o));let b=o.parentElement instanceof HTMLPictureElement?o.parentElement:o;this.option(\"transformParent\")&&(b=b.parentElement||b);const v=b.getAttribute(\"style\")||\"\";b.style.setProperty(\"transform\",\"none\",\"important\"),a&&(b.style.width=\"\",b.style.height=\"\"),b.offsetHeight;const y=o.getBoundingClientRect();let w=y.width*n,x=y.height*n,E=0,S=0;a&&(Math.abs(f-w)>1||Math.abs(m-x)>1)&&({width:w,height:x,top:E,left:S}=((t,e,i,n)=>{const s=i/n;return s>t/e?(i=t,n=t/s):(i=e*s,n=e),{width:i,height:n,top:.5*(e-n),left:.5*(t-i)}})(w,x,f,m)),this.contentRect=Object.assign(Object.assign({},this.contentRect),{top:y.top-r.top+E,bottom:r.bottom-y.bottom+E,left:y.left-r.left+S,right:r.right-y.right+S,fitWidth:w,fitHeight:x,width:w,height:x,fullWidth:f,fullHeight:m}),b.style.cssText=v,a&&(b.style.width=`${w}px`,b.style.height=`${x}px`),this.setTransform(),!0!==e&&this.emit(\"refresh\"),this.ignoreBounds||(t(this.targetScale)<t(this.minScale)?this.zoomTo(this.minScale,{friction:0}):this.targetScale>this.maxScale?this.zoomTo(this.maxScale,{friction:0}):this.state===g.Init||this.checkBounds().inBounds||this.requestTick()),this.updateControls()}getBounds(){const e=this.option(\"bounds\");if(\"auto\"!==e)return e;const{contentWidth:i,contentHeight:n}=this.calculateContentDim(this.target);let s=0,o=0,a=0,r=0;const l=this.option(\"infinite\");if(!0===l||this.lockedAxis&&l===this.lockedAxis)s=-1/0,a=1/0,o=-1/0,r=1/0;else{let{containerRect:e,contentRect:l}=this,c=t(this.contentRect.fitWidth*this.targetScale,M),h=t(this.contentRect.fitHeight*this.targetScale,M),{innerWidth:d,innerHeight:u}=e;if(this.containerRect.width===c&&(d=e.width),this.containerRect.width===h&&(u=e.height),i>d){a=.5*(i-d),s=-1*a;let t=.5*(l.right-l.left);s+=t,a+=t}if(this.contentRect.fitWidth>d&&i<d&&(s-=.5*(this.contentRect.fitWidth-d),a-=.5*(this.contentRect.fitWidth-d)),n>u){r=.5*(n-u),o=-1*r;let t=.5*(l.bottom-l.top);o+=t,r+=t}this.contentRect.fitHeight>u&&n<u&&(s-=.5*(this.contentRect.fitHeight-u),a-=.5*(this.contentRect.fitHeight-u))}return{x:{min:s,max:a},y:{min:o,max:r}}}updateControls(){const e=this,i=e.container,{panMode:n,contentRect:s,fullScale:a,targetScale:r,coverScale:l,maxScale:c,minScale:h}=e;let d={toggleMax:r-h<.5*(c-h)?c:h,toggleCover:r-h<.5*(l-h)?l:h,toggleZoom:r-h<.5*(a-h)?a:h}[e.option(\"click\")||\"\"]||h,u=e.canZoomIn(),p=e.canZoomOut(),f=n===O&&!!this.option(\"touch\"),m=p&&f;f&&(t(r)<t(h)&&!this.panOnlyZoomed&&(m=!0),(t(s.width,1)>t(s.fitWidth,1)||t(s.height,1)>t(s.fitHeight,1))&&(m=!0)),t(s.width*r,1)<t(s.fitWidth,1)&&(m=!1),n===T&&(m=!1);let g=u&&t(d)>t(r),b=!g&&!m&&p&&t(d)<t(r);o(i,this.cn(\"canZoomIn\"),g),o(i,this.cn(\"canZoomOut\"),b),o(i,this.cn(\"isDraggable\"),m);for(const t of i.querySelectorAll('[data-panzoom-action=\"zoomIn\"]'))u?(t.removeAttribute(\"disabled\"),t.removeAttribute(\"tabindex\")):(t.setAttribute(\"disabled\",\"\"),t.setAttribute(\"tabindex\",\"-1\"));for(const t of i.querySelectorAll('[data-panzoom-action=\"zoomOut\"]'))p?(t.removeAttribute(\"disabled\"),t.removeAttribute(\"tabindex\")):(t.setAttribute(\"disabled\",\"\"),t.setAttribute(\"tabindex\",\"-1\"));for(const t of i.querySelectorAll('[data-panzoom-action=\"toggleZoom\"],[data-panzoom-action=\"iterateZoom\"]')){u||p?(t.removeAttribute(\"disabled\"),t.removeAttribute(\"tabindex\")):(t.setAttribute(\"disabled\",\"\"),t.setAttribute(\"tabindex\",\"-1\"));const e=t.querySelector(\"g\");e&&(e.style.display=u?\"\":\"none\")}}panTo({x:t=this.target.e,y:e=this.target.f,scale:i=this.targetScale,friction:n=this.option(\"friction\"),angle:s=0,originX:o=0,originY:a=0,flipX:r=!1,flipY:l=!1,ignoreBounds:c=!1}){this.state!==g.Destroy&&this.applyChange({panX:t-this.target.e,panY:e-this.target.f,scale:i/this.targetScale,angle:s,originX:o,originY:a,friction:n,flipX:r,flipY:l,ignoreBounds:c})}applyChange({panX:e=0,panY:i=0,scale:n=1,angle:s=0,originX:o=-this.current.e,originY:a=-this.current.f,friction:r=this.option(\"friction\"),flipX:l=!1,flipY:c=!1,ignoreBounds:h=!1,bounce:d=this.option(\"bounce\")}){if(this.state===g.Destroy)return;this.rAF&&(cancelAnimationFrame(this.rAF),this.rAF=null),this.friction=r||0,this.ignoreBounds=h;const{current:u}=this,p=u.e,f=u.f,m=this.getMatrix(this.target);let v=(new DOMMatrix).translate(p,f).translate(o,a).translate(e,i);if(this.option(\"zoom\")){if(!h){const t=this.targetScale,e=this.minScale,i=this.maxScale;t*n<e&&(n=e/t),t*n>i&&(n=i/t)}v=v.scale(n)}v=v.translate(-o,-a).translate(-p,-f).multiply(m),s&&(v=v.rotate(s)),l&&(v=v.scale(-1,1)),c&&(v=v.scale(1,-1));for(const e of b)\"e\"!==e&&\"f\"!==e&&(v[e]>this.minScale+1e-5||v[e]<this.minScale-1e-5)?this.target[e]=v[e]:this.target[e]=t(v[e],M);(this.targetScale<this.scale||Math.abs(n-1)>.1||this.panMode===T||!1===d)&&!h&&this.clampTargetBounds(),this.isResting||(this.state=g.Panning,this.requestTick())}stop(t=!1){if(this.state===g.Init||this.state===g.Destroy)return;const e=this.isTicking;this.rAF&&(cancelAnimationFrame(this.rAF),this.rAF=null),this.isBouncingX=!1,this.isBouncingY=!1;for(const e of b)this.velocity[e]=0,\"current\"===t?this.current[e]=this.target[e]:\"target\"===t&&(this.target[e]=this.current[e]);this.setTransform(),E(this.container,\"is-scaling\"),E(this.container,\"is-animating\"),this.isTicking=!1,this.state=g.Ready,e&&(this.emit(\"endAnimation\"),this.updateControls())}requestTick(){this.isTicking||(this.emit(\"startAnimation\"),this.updateControls(),S(this.container,\"is-animating\"),this.isScaling&&S(this.container,\"is-scaling\")),this.isTicking=!0,this.rAF||(this.rAF=requestAnimationFrame((()=>this.animate())))}panWithMouse(e,i=this.option(\"mouseMoveFriction\")){if(this.pmme=e,this.panMode!==T||!e)return;if(t(this.targetScale)<=t(this.minScale))return;this.emit(\"mouseMove\",e);const{container:n,containerRect:s,contentRect:o}=this,a=s.width,r=s.height,l=n.getBoundingClientRect(),c=(e.clientX||0)-l.left,h=(e.clientY||0)-l.top;let{contentWidth:d,contentHeight:u}=this.calculateContentDim(this.target);const p=this.option(\"mouseMoveFactor\");p>1&&(d!==a&&(d*=p),u!==r&&(u*=p));let f=.5*(d-a)-c/a*100/100*(d-a);f+=.5*(o.right-o.left);let m=.5*(u-r)-h/r*100/100*(u-r);m+=.5*(o.bottom-o.top),this.applyChange({panX:f-this.target.e,panY:m-this.target.f,friction:i})}zoomWithWheel(e){if(this.state===g.Destroy||this.state===g.Init)return;const i=Date.now();if(i-this.pwt<45)return void e.preventDefault();this.pwt=i;var n=[-e.deltaX||0,-e.deltaY||0,-e.detail||0].reduce((function(t,e){return Math.abs(e)>Math.abs(t)?e:t}));const s=Math.max(-1,Math.min(1,n)),{targetScale:o,maxScale:a,minScale:r}=this;let l=o*(100+45*s)/100;t(l)<t(r)&&t(o)<=t(r)?(this.cwd+=Math.abs(s),l=r):t(l)>t(a)&&t(o)>=t(a)?(this.cwd+=Math.abs(s),l=a):(this.cwd=0,l=Math.max(Math.min(l,a),r)),this.cwd>this.option(\"wheelLimit\")||(e.preventDefault(),t(l)!==t(o)&&this.zoomTo(l,{event:e}))}canZoomIn(){return this.option(\"zoom\")&&(t(this.contentRect.width,1)<t(this.contentRect.fitWidth,1)||t(this.targetScale)<t(this.maxScale))}canZoomOut(){return this.option(\"zoom\")&&t(this.targetScale)>t(this.minScale)}zoomIn(t=1.25,e){this.zoomTo(this.targetScale*t,e)}zoomOut(t=.8,e){this.zoomTo(this.targetScale*t,e)}zoomToFit(t){this.zoomTo(\"fit\",t)}zoomToCover(t){this.zoomTo(\"cover\",t)}zoomToFull(t){this.zoomTo(\"full\",t)}zoomToMax(t){this.zoomTo(\"max\",t)}toggleZoom(t){this.zoomTo(this.targetScale-this.minScale<.5*(this.fullScale-this.minScale)?\"full\":\"fit\",t)}toggleMax(t){this.zoomTo(this.targetScale-this.minScale<.5*(this.maxScale-this.minScale)?\"max\":\"fit\",t)}toggleCover(t){this.zoomTo(this.targetScale-this.minScale<.5*(this.coverScale-this.minScale)?\"cover\":\"fit\",t)}iterateZoom(t){this.zoomTo(\"next\",t)}zoomTo(t=1,{friction:e=\"auto\",originX:i=\"auto\",originY:n=\"auto\",event:s}={}){if(this.isContentLoading||this.state===g.Destroy)return;const{targetScale:o}=this;this.stop();let a=1;if(this.panMode===T&&(s=this.pmme||s),s||\"auto\"===i||\"auto\"===n){const t=this.content.getBoundingClientRect(),e=this.container.getBoundingClientRect(),o=s?s.clientX:e.left+.5*e.width,a=s?s.clientY:e.top+.5*e.height;i=o-t.left-.5*t.width,n=a-t.top-.5*t.height}const r=this.fullScale,l=this.maxScale;let c=this.coverScale;\"number\"==typeof t?a=t/o:(\"next\"===t&&(r-c<.2&&(c=r),t=o<r-1e-5?\"full\":o<l-1e-5?\"max\":\"fit\"),a=\"full\"===t?r/o||1:\"cover\"===t?c/o||1:\"max\"===t?l/o||1:1/o||1),e=\"auto\"===e?a>1?.15:.25:e,this.applyChange({scale:a,originX:i,originY:n,friction:e}),s&&this.panMode===T&&this.panWithMouse(s,e)}rotateCCW(){this.applyChange({angle:-90})}rotateCW(){this.applyChange({angle:90})}flipX(){this.applyChange({flipX:!0})}flipY(){this.applyChange({flipY:!0})}fitX(){this.stop(\"target\");const{containerRect:t,contentRect:e,target:i}=this;this.applyChange({panX:.5*t.width-(e.left+.5*e.fitWidth)-i.e,panY:.5*t.height-(e.top+.5*e.fitHeight)-i.f,scale:t.width/e.fitWidth/this.targetScale,originX:0,originY:0,ignoreBounds:!0})}fitY(){this.stop(\"target\");const{containerRect:t,contentRect:e,target:i}=this;this.applyChange({panX:.5*t.width-(e.left+.5*e.fitWidth)-i.e,panY:.5*t.innerHeight-(e.top+.5*e.fitHeight)-i.f,scale:t.height/e.fitHeight/this.targetScale,originX:0,originY:0,ignoreBounds:!0})}toggleFS(){const{container:t}=this,e=this.cn(\"inFullscreen\"),i=this.cn(\"htmlHasFullscreen\");t.classList.toggle(e);const n=t.classList.contains(e);n?(document.documentElement.classList.add(i),document.addEventListener(\"keydown\",this.onKeydown,!0)):(document.documentElement.classList.remove(i),document.removeEventListener(\"keydown\",this.onKeydown,!0)),this.updateMetrics(),this.emit(n?\"enterFS\":\"exitFS\")}getMatrix(t=this.current){const{a:e,b:i,c:n,d:s,e:o,f:a}=t;return new DOMMatrix([e,i,n,s,o,a])}reset(t){if(this.state!==g.Init&&this.state!==g.Destroy){this.stop(\"current\");for(const t of b)this.target[t]=P[t];this.target.a=this.minScale,this.target.d=this.minScale,this.clampTargetBounds(),this.isResting||(this.friction=void 0===t?this.option(\"friction\"):t,this.state=g.Panning,this.requestTick())}}destroy(){this.stop(),this.state=g.Destroy,this.detachEvents(),this.detachObserver();const{container:t,content:e}=this,i=this.option(\"classes\")||{};for(const e of Object.values(i))t.classList.remove(e+\"\");e&&(e.removeEventListener(\"load\",this.onLoad),e.removeEventListener(\"error\",this.onError)),this.detachPlugins()}}Object.defineProperty(R,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:y}),Object.defineProperty(R,\"Plugins\",{enumerable:!0,configurable:!0,writable:!0,value:{}});const k=function(t,e){let i=!0;return(...n)=>{i&&(i=!1,t(...n),setTimeout((()=>{i=!0}),e))}},I=(t,e)=>{let i=[];return t.childNodes.forEach((t=>{t.nodeType!==Node.ELEMENT_NODE||e&&!t.matches(e)||i.push(t)})),i},D={viewport:null,track:null,enabled:!0,slides:[],axis:\"x\",transition:\"fade\",preload:1,slidesPerPage:\"auto\",initialPage:0,friction:.12,Panzoom:{decelFriction:.12},center:!0,infinite:!0,fill:!0,dragFree:!1,adaptiveHeight:!1,direction:\"ltr\",classes:{container:\"f-carousel\",viewport:\"f-carousel__viewport\",track:\"f-carousel__track\",slide:\"f-carousel__slide\",isLTR:\"is-ltr\",isRTL:\"is-rtl\",isHorizontal:\"is-horizontal\",isVertical:\"is-vertical\",inTransition:\"in-transition\",isSelected:\"is-selected\"},l10n:{NEXT:\"Next slide\",PREV:\"Previous slide\",GOTO:\"Go to slide #%d\"}};var F;!function(t){t[t.Init=0]=\"Init\",t[t.Ready=1]=\"Ready\",t[t.Destroy=2]=\"Destroy\"}(F||(F={}));const j=t=>{if(\"string\"==typeof t||t instanceof HTMLElement)t={html:t};else{const e=t.thumb;void 0!==e&&(\"string\"==typeof e&&(t.thumbSrc=e),e instanceof HTMLImageElement&&(t.thumbEl=e,t.thumbElSrc=e.src,t.thumbSrc=e.src),delete t.thumb)}return Object.assign({html:\"\",el:null,isDom:!1,class:\"\",customClass:\"\",index:-1,dim:0,gap:0,pos:0,transition:!1},t)},H=(t={})=>Object.assign({index:-1,slides:[],dim:0,pos:-1},t);class B extends f{constructor(t,e){super(e),Object.defineProperty(this,\"instance\",{enumerable:!0,configurable:!0,writable:!0,value:t})}attach(){}detach(){}}const N={classes:{list:\"f-carousel__dots\",isDynamic:\"is-dynamic\",hasDots:\"has-dots\",dot:\"f-carousel__dot\",isBeforePrev:\"is-before-prev\",isPrev:\"is-prev\",isCurrent:\"is-current\",isNext:\"is-next\",isAfterNext:\"is-after-next\"},dotTpl:'<button type=\"button\" data-carousel-page=\"%i\" aria-label=\"{{GOTO}}\"><span class=\"f-carousel__dot\" aria-hidden=\"true\"></span></button>',dynamicFrom:11,maxCount:1/0,minCount:2};class _ extends B{constructor(){super(...arguments),Object.defineProperty(this,\"isDynamic\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"list\",{enumerable:!0,configurable:!0,writable:!0,value:null})}onRefresh(){this.refresh()}build(){let t=this.list;return t||(t=document.createElement(\"ul\"),S(t,this.cn(\"list\")),t.setAttribute(\"role\",\"tablist\"),this.instance.container.appendChild(t),S(this.instance.container,this.cn(\"hasDots\")),this.list=t),t}refresh(){var t;const e=this.instance.pages.length,i=Math.min(2,this.option(\"minCount\")),n=Math.max(2e3,this.option(\"maxCount\")),s=this.option(\"dynamicFrom\");if(e<i||e>n)return void this.cleanup();const a=\"number\"==typeof s&&e>5&&e>=s,r=!this.list||this.isDynamic!==a||this.list.children.length!==e;r&&this.cleanup();const l=this.build();if(o(l,this.cn(\"isDynamic\"),!!a),r)for(let t=0;t<e;t++)l.append(this.createItem(t));let c,h=0;for(const e of[...l.children]){const i=h===this.instance.page;i&&(c=e),o(e,this.cn(\"isCurrent\"),i),null===(t=e.children[0])||void 0===t||t.setAttribute(\"aria-selected\",i?\"true\":\"false\");for(const t of[\"isBeforePrev\",\"isPrev\",\"isNext\",\"isAfterNext\"])E(e,this.cn(t));h++}if(c=c||l.firstChild,a&&c){const t=c.previousElementSibling,e=t&&t.previousElementSibling;S(t,this.cn(\"isPrev\")),S(e,this.cn(\"isBeforePrev\"));const i=c.nextElementSibling,n=i&&i.nextElementSibling;S(i,this.cn(\"isNext\")),S(n,this.cn(\"isAfterNext\"))}this.isDynamic=a}createItem(t=0){var e;const i=document.createElement(\"li\");i.setAttribute(\"role\",\"presentation\");const s=n(this.instance.localize(this.option(\"dotTpl\"),[[\"%d\",t+1]]).replace(/\\%i/g,t+\"\"));return i.appendChild(s),null===(e=i.children[0])||void 0===e||e.setAttribute(\"role\",\"tab\"),i}cleanup(){this.list&&(this.list.remove(),this.list=null),this.isDynamic=!1,E(this.instance.container,this.cn(\"hasDots\"))}attach(){this.instance.on([\"refresh\",\"change\"],this.onRefresh)}detach(){this.instance.off([\"refresh\",\"change\"],this.onRefresh),this.cleanup()}}Object.defineProperty(_,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:N});const W=\"disabled\",$=\"next\",X=\"prev\";class Y extends B{constructor(){super(...arguments),Object.defineProperty(this,\"container\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"prev\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"next\",{enumerable:!0,configurable:!0,writable:!0,value:null})}onRefresh(){const t=this.instance,e=t.pages.length,i=t.page;if(e<2)return void this.cleanup();this.build();let n=this.prev,s=this.next;n&&s&&(n.removeAttribute(W),s.removeAttribute(W),t.isInfinite||(i<=0&&n.setAttribute(W,\"\"),i>=e-1&&s.setAttribute(W,\"\")))}createButton(t){const e=this.instance,i=document.createElement(\"button\");i.setAttribute(\"tabindex\",\"0\"),i.setAttribute(\"title\",e.localize(`{{${t.toUpperCase()}}}`)),S(i,this.cn(\"button\")+\" \"+this.cn(t===$?\"isNext\":\"isPrev\"));const n=e.isRTL?t===$?X:$:t;var s;return i.innerHTML=e.localize(this.option(`${n}Tpl`)),i.dataset[`carousel${s=t,s?s.match(\"^[a-z]\")?s.charAt(0).toUpperCase()+s.substring(1):s:\"\"}`]=\"true\",i}build(){let t=this.container;t||(this.container=t=document.createElement(\"div\"),S(t,this.cn(\"container\")),this.instance.container.appendChild(t)),this.next||(this.next=t.appendChild(this.createButton($))),this.prev||(this.prev=t.appendChild(this.createButton(X)))}cleanup(){this.prev&&this.prev.remove(),this.next&&this.next.remove(),this.container&&this.container.remove(),this.prev=null,this.next=null,this.container=null}attach(){this.instance.on([\"refresh\",\"change\"],this.onRefresh)}detach(){this.instance.off([\"refresh\",\"change\"],this.onRefresh),this.cleanup()}}Object.defineProperty(Y,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:{classes:{container:\"f-carousel__nav\",button:\"f-button\",isNext:\"is-next\",isPrev:\"is-prev\"},nextTpl:'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" tabindex=\"-1\"><path d=\"M9 3l9 9-9 9\"/></svg>',prevTpl:'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" tabindex=\"-1\"><path d=\"M15 3l-9 9 9 9\"/></svg>'}});class q extends B{constructor(){super(...arguments),Object.defineProperty(this,\"selectedIndex\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"target\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"nav\",{enumerable:!0,configurable:!0,writable:!0,value:null})}addAsTargetFor(t){this.target=this.instance,this.nav=t,this.attachEvents()}addAsNavFor(t){this.nav=this.instance,this.target=t,this.attachEvents()}attachEvents(){this.nav&&this.target&&(this.nav.options.initialSlide=this.target.options.initialPage,this.nav.on(\"ready\",this.onNavReady),this.nav.state===F.Ready&&this.onNavReady(this.nav),this.target.on(\"ready\",this.onTargetReady),this.target.state===F.Ready&&this.onTargetReady(this.target))}onNavReady(t){t.on(\"createSlide\",this.onNavCreateSlide),t.on(\"Panzoom.click\",this.onNavClick),t.on(\"Panzoom.touchEnd\",this.onNavTouch),this.onTargetChange()}onTargetReady(t){t.on(\"change\",this.onTargetChange),t.on(\"Panzoom.refresh\",this.onTargetChange),this.onTargetChange()}onNavClick(t,e,i){this.onNavTouch(t,t.panzoom,i)}onNavTouch(t,e,i){var n,s;if(Math.abs(e.dragOffset.x)>3||Math.abs(e.dragOffset.y)>3)return;const o=i.target,{nav:a,target:r}=this;if(!a||!r||!o)return;const l=o.closest(\"[data-index]\");if(i.stopPropagation(),i.preventDefault(),!l)return;const c=parseInt(l.dataset.index||\"\",10)||0,h=r.getPageForSlide(c),d=a.getPageForSlide(c);a.slideTo(d),r.slideTo(h,{friction:(null===(s=null===(n=this.nav)||void 0===n?void 0:n.plugins)||void 0===s?void 0:s.Sync.option(\"friction\"))||0}),this.markSelectedSlide(c)}onNavCreateSlide(t,e){e.index===this.selectedIndex&&this.markSelectedSlide(e.index)}onTargetChange(){const{target:t,nav:e}=this;if(!t||!e)return;if(e.state!==F.Ready||t.state!==F.Ready)return;const i=t.pages[t.page].slides[0].index,n=e.getPageForSlide(i);this.markSelectedSlide(i),e.slideTo(n)}markSelectedSlide(t){const e=this.nav;e&&e.state===F.Ready&&(this.selectedIndex=t,[...e.slides].map((e=>{e.el&&e.el.classList[e.index===t?\"add\":\"remove\"](\"is-nav-selected\")})))}attach(){const t=this;let e=t.options.target,i=t.options.nav;e?t.addAsNavFor(e):i&&t.addAsTargetFor(i)}detach(){const t=this,e=t.nav,i=t.target;e&&(e.off(\"ready\",t.onNavReady),e.off(\"createSlide\",t.onNavCreateSlide),e.off(\"Panzoom.click\",t.onNavClick),e.off(\"Panzoom.touchEnd\",t.onNavTouch)),t.nav=null,i&&(i.off(\"ready\",t.onTargetReady),i.off(\"refresh\",t.onTargetChange),i.off(\"change\",t.onTargetChange)),t.target=null}}Object.defineProperty(q,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:{friction:.35}});const V={Navigation:Y,Dots:_,Sync:q};class Z extends m{get axis(){return this.isHorizontal?\"e\":\"f\"}get isEnabled(){return this.state===F.Ready}get isInfinite(){let t=!1;const{contentDim:e,viewportDim:i,pages:n,slides:s}=this;return n.length>=2&&e+s[0].dim>=i&&(t=this.option(\"infinite\")),t}get isRTL(){return\"rtl\"===this.option(\"direction\")}get isHorizontal(){return\"x\"===this.option(\"axis\")}constructor(t,e={},i={}){if(super(),Object.defineProperty(this,\"userOptions\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"userPlugins\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"bp\",{enumerable:!0,configurable:!0,writable:!0,value:\"\"}),Object.defineProperty(this,\"lp\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"state\",{enumerable:!0,configurable:!0,writable:!0,value:F.Init}),Object.defineProperty(this,\"page\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"prevPage\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"container\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"viewport\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"track\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"slides\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"pages\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"panzoom\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"inTransition\",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,\"contentDim\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"viewportDim\",{enumerable:!0,configurable:!0,writable:!0,value:0}),\"string\"==typeof t&&(t=document.querySelector(t)),!t||!x(t))throw new Error(\"No Element found\");this.container=t,this.slideNext=k(this.slideNext.bind(this),150),this.slidePrev=k(this.slidePrev.bind(this),150),this.userOptions=e,this.userPlugins=i,queueMicrotask((()=>{this.processOptions()}))}processOptions(){const t=u({},Z.defaults,this.userOptions);let e=\"\";const i=t.breakpoints;if(i&&d(i))for(const[n,s]of Object.entries(i))window.matchMedia(n).matches&&d(s)&&(e+=n,u(t,s));e===this.bp&&this.state!==F.Init||(this.bp=e,this.state===F.Ready&&(t.initialSlide=this.pages[this.page].slides[0].index),this.state!==F.Init&&this.destroy(),super.setOptions(t),!1===this.option(\"enabled\")?this.attachEvents():setTimeout((()=>{this.init()}),0))}init(){this.state=F.Init,this.emit(\"init\"),this.attachPlugins(Object.assign(Object.assign({},Z.Plugins),this.userPlugins)),this.initLayout(),this.initSlides(),this.updateMetrics(),this.setInitialPosition(),this.initPanzoom(),this.attachEvents(),this.state=F.Ready,this.emit(\"ready\")}initLayout(){const{container:t}=this,e=this.option(\"classes\");S(t,this.cn(\"container\")),o(t,e.isLTR,!this.isRTL),o(t,e.isRTL,this.isRTL),o(t,e.isVertical,!this.isHorizontal),o(t,e.isHorizontal,this.isHorizontal);let i=this.option(\"viewport\")||t.querySelector(`.${e.viewport}`);i||(i=document.createElement(\"div\"),S(i,e.viewport),i.append(...I(t,`.${e.slide}`)),t.prepend(i));let n=this.option(\"track\")||t.querySelector(`.${e.track}`);n||(n=document.createElement(\"div\"),S(n,e.track),n.append(...Array.from(i.childNodes))),n.setAttribute(\"aria-live\",\"polite\"),i.contains(n)||i.prepend(n),this.viewport=i,this.track=n,this.emit(\"initLayout\")}initSlides(){const{track:t}=this;if(t){this.slides=[],[...I(t,`.${this.cn(\"slide\")}`)].forEach((t=>{if(x(t)){const e=j({el:t,isDom:!0,index:this.slides.length});this.slides.push(e),this.emit(\"initSlide\",e,this.slides.length)}}));for(let t of this.option(\"slides\",[])){const e=j(t);e.index=this.slides.length,this.slides.push(e),this.emit(\"initSlide\",e,this.slides.length)}this.emit(\"initSlides\")}}setInitialPage(){let t=0;const e=this.option(\"initialSlide\");t=\"number\"==typeof e?this.getPageForSlide(e):parseInt(this.option(\"initialPage\",0)+\"\",10)||0,this.page=t}setInitialPosition(){if(!this.track||!this.pages.length)return;const t=this.isHorizontal;let e=this.page;this.pages[e]||(this.page=e=0);const i=this.pages[e].pos*(this.isRTL&&t?1:-1),n=t?`${i}px`:\"0\",s=t?\"0\":`${i}px`;this.track.style.transform=`translate3d(${n}, ${s}, 0) scale(1)`,this.option(\"adaptiveHeight\")&&this.setViewportHeight()}initPanzoom(){this.panzoom&&(this.panzoom.destroy(),this.panzoom=null);const t=this.option(\"Panzoom\")||{};this.panzoom=new R(this.viewport,u({},{content:this.track,zoom:!1,panOnlyZoomed:!1,lockAxis:this.isHorizontal?\"x\":\"y\",infinite:this.isInfinite,click:!1,dblClick:!1,touch:t=>!(this.pages.length<2&&!t.options.infinite),bounds:()=>this.getBounds(),maxVelocity:t=>Math.abs(t.target[this.axis]-t.current[this.axis])<2*this.viewportDim?100:0},t)),this.panzoom.on(\"*\",((t,e,...i)=>{this.emit(`Panzoom.${e}`,t,...i)})),this.panzoom.on(\"decel\",this.onDecel),this.panzoom.on(\"refresh\",this.onRefresh),this.panzoom.on(\"beforeTransform\",this.onBeforeTransform),this.panzoom.on(\"endAnimation\",this.onEndAnimation)}attachEvents(){const t=this.container;t&&(t.addEventListener(\"click\",this.onClick,{passive:!1,capture:!1}),t.addEventListener(\"slideTo\",this.onSlideTo)),window.addEventListener(\"resize\",this.onResize)}createPages(){let t=[];const{contentDim:e,viewportDim:i}=this;let n=this.option(\"slidesPerPage\");(\"number\"!=typeof n||e<=i)&&(n=1/0);let s=0,o=0,a=0;for(const e of this.slides)(!t.length||o+e.dim>i||a===n)&&(t.push(H()),s=t.length-1,o=0,a=0),t[s].slides.push(e),o+=e.dim+e.gap,a++;return t}processPages(){const e=this.pages,{contentDim:i,viewportDim:n}=this,s=this.option(\"center\"),o=this.option(\"fill\"),a=o&&s&&i>n&&!this.isInfinite;if(e.forEach(((t,e)=>{t.index=e,t.pos=t.slides[0].pos,t.dim=0;for(const[e,i]of t.slides.entries())t.dim+=i.dim,e<t.slides.length-1&&(t.dim+=i.gap);a&&t.pos+.5*t.dim<.5*n?t.pos=0:a&&t.pos+.5*t.dim>=i-.5*n?t.pos=i-n:s&&(t.pos+=-.5*(n-t.dim))})),e.forEach(((e,s)=>{o&&!this.isInfinite&&i>n&&(e.pos=Math.max(e.pos,0),e.pos=Math.min(e.pos,i-n)),e.pos=t(e.pos,1e3),e.dim=t(e.dim,1e3),Math.abs(e.pos)<=.1&&(e.pos=0)})),this.isInfinite)return e;const r=[];let l;return e.forEach((t=>{const e=Object.assign({},t);l&&e.pos===l.pos?(l.dim+=e.dim,l.slides=[...l.slides,...e.slides]):(e.index=r.length,l=e,r.push(e))})),r}getPageFromIndex(t=0){const e=this.pages.length;let i;return t=parseInt((t||0).toString())||0,i=this.isInfinite?(t%e+e)%e:Math.max(Math.min(t,e-1),0),i}getSlideMetrics(e){var i,n;const s=this.isHorizontal?\"width\":\"height\";let o=0,a=0,r=e.el;const l=r&&!r.parentNode;if(r?o=parseFloat(r.dataset[s]||\"\")||0:(r=document.createElement(\"div\"),r.style.visibility=\"hidden\",(this.track||document.body).prepend(r)),S(r,this.cn(\"slide\")+\" \"+e.class+\" \"+e.customClass),o)r.style[s]=`${o}px`,r.style[\"width\"===s?\"height\":\"width\"]=\"\";else{l&&(this.track||document.body).prepend(r);const t=Math.max(1,(null===(i=window.visualViewport)||void 0===i?void 0:i.scale)||1);o=r.getBoundingClientRect()[s]*t}const c=getComputedStyle(r);return\"content-box\"===c.boxSizing&&(this.isHorizontal?(o+=parseFloat(c.paddingLeft)||0,o+=parseFloat(c.paddingRight)||0):(o+=parseFloat(c.paddingTop)||0,o+=parseFloat(c.paddingBottom)||0)),a=parseFloat(c[this.isHorizontal?\"marginRight\":\"marginBottom\"])||0,l?null===(n=r.parentElement)||void 0===n||n.removeChild(r):e.el||r.remove(),{dim:t(o,1e3),gap:t(a,1e3)}}getBounds(){const{isInfinite:t,isRTL:e,isHorizontal:i,pages:n}=this;let s={min:0,max:0};if(t)s={min:-1/0,max:1/0};else if(n.length){const t=n[0].pos,o=n[n.length-1].pos;s=e&&i?{min:t,max:o}:{min:-1*o,max:-1*t}}return{x:i?s:{min:0,max:0},y:i?{min:0,max:0}:s}}repositionSlides(){let e,{isHorizontal:i,isRTL:n,isInfinite:s,viewport:o,viewportDim:a,contentDim:r,page:l,pages:c,slides:h,panzoom:d}=this,u=0,p=0,f=0,m=0;d?m=-1*d.current[this.axis]:c[l]&&(m=c[l].pos||0),e=i?n?\"right\":\"left\":\"top\",n&&i&&(m*=-1);for(const i of h)i.el?(\"top\"===e?(i.el.style.right=\"\",i.el.style.left=\"\"):i.el.style.top=\"\",i.index!==u?i.el.style[e]=0===p?\"\":`${t(p,1e3)}px`:i.el.style[e]=\"\",f+=i.dim+i.gap,u++):p+=i.dim+i.gap;if(s&&f&&o){let n=getComputedStyle(o),s=\"padding\",l=i?\"Right\":\"Bottom\",c=parseFloat(n[s+(i?\"Left\":\"Top\")]);m-=c,a+=c,a+=parseFloat(n[s+l]);for(const i of h)i.el&&(t(i.pos)<t(a)&&t(i.pos+i.dim+i.gap)<t(m)&&t(m)>t(r-a)&&(i.el.style[e]=`${t(p+f,1e3)}px`),t(i.pos+i.gap)>=t(r-a)&&t(i.pos)>t(m+a)&&t(m)<t(a)&&(i.el.style[e]=`-${t(f,1e3)}px`))}let g,b,v=[...this.inTransition];if(v.length>1&&(g=c[v[0]],b=c[v[1]]),g&&b){let i=0;for(const n of h)n.el?this.inTransition.has(n.index)&&g.slides.indexOf(n)<0&&(n.el.style[e]=`${t(i+(g.pos-b.pos),1e3)}px`):i+=n.dim+n.gap}}createSlideEl(t){const{track:e,slides:i}=this;if(!e||!t)return;if(t.el&&t.el.parentNode)return;const n=t.el||document.createElement(\"div\");S(n,this.cn(\"slide\")),S(n,t.class),S(n,t.customClass);const s=t.html;s&&(s instanceof HTMLElement?n.appendChild(s):n.innerHTML=t.html+\"\");const o=[];i.forEach(((t,e)=>{t.el&&o.push(e)}));const a=t.index;let r=null;if(o.length){r=i[o.reduce(((t,e)=>Math.abs(e-a)<Math.abs(t-a)?e:t))]}const l=r&&r.el&&r.el.parentNode?r.index<t.index?r.el.nextSibling:r.el:null;e.insertBefore(n,e.contains(l)?l:null),t.el=n,this.emit(\"createSlide\",t)}removeSlideEl(t,e=!1){const i=t.el;if(!i||!i.parentNode)return;if(E(i,this.cn(\"isSelected\")),t.isDom&&!e)return i.removeAttribute(\"aria-hidden\"),i.removeAttribute(\"data-index\"),E(i,this.cn(\"isSelected\")),void(i.style.left=\"\");this.emit(\"removeSlide\",t);const n=new CustomEvent(\"animationend\");i.dispatchEvent(n),t.el&&(t.el.remove(),t.el=null)}transitionTo(t=0,e=this.option(\"transition\")){if(!e)return!1;const{pages:i,panzoom:n}=this;t=parseInt((t||0).toString())||0;const s=this.getPageFromIndex(t);if(!n||!i[s]||i.length<2||Math.abs(i[this.page].slides[0].dim-this.viewportDim)>1)return!1;const o=t>this.page?1:-1,a=this.pages[s].pos*(this.isRTL?1:-1);if(this.page===s&&Math.abs(a-n.target[this.axis])<1)return!1;this.clearTransitions();const r=n.isResting;S(this.container,this.cn(\"inTransition\"));const l=this.pages[this.page].slides[0],c=this.pages[s].slides[0];this.inTransition.add(c.index),this.createSlideEl(c);let h=l.el,d=c.el;r||\"slide\"===e||(e=\"fadeFast\",h=null);const u=this.isRTL?\"next\":\"prev\",p=this.isRTL?\"prev\":\"next\";return h&&(this.inTransition.add(l.index),l.transition=e,h.addEventListener(\"animationend\",this.onAnimationEnd),h.classList.add(`f-${e}Out`,`to-${o>0?p:u}`)),d&&(c.transition=e,d.addEventListener(\"animationend\",this.onAnimationEnd),d.classList.add(`f-${e}In`,`from-${o>0?u:p}`)),n.panTo({x:this.isHorizontal?a:0,y:this.isHorizontal?0:a,friction:0}),this.onChange(s),!0}manageSlideVisiblity(){const t=new Set,e=new Set,i=this.getVisibleSlides(parseFloat(this.option(\"preload\",0)+\"\")||0);for(const n of this.slides)i.has(n)?t.add(n):e.add(n);for(const e of this.inTransition)t.add(this.slides[e]);for(const e of t)this.createSlideEl(e),this.lazyLoadSlide(e);for(const i of e)t.has(i)||this.removeSlideEl(i);this.markSelectedSlides(),this.repositionSlides()}markSelectedSlides(){if(!this.pages[this.page]||!this.pages[this.page].slides)return;const t=\"aria-hidden\";let e=this.cn(\"isSelected\");if(e)for(const i of this.slides)i.el&&(i.el.dataset.index=`${i.index}`,this.pages[this.page].slides.includes(i)?(i.el.classList.contains(e)||(S(i.el,e),this.emit(\"selectSlide\",i)),i.el.removeAttribute(t)):(i.el.classList.contains(e)&&(E(i.el,e),this.emit(\"unselectSlide\",i)),i.el.setAttribute(t,\"true\")))}flipInfiniteTrack(){const t=this.panzoom;if(!t||!this.isInfinite)return;const e=\"x\"===this.option(\"axis\")?\"e\":\"f\",{viewportDim:i,contentDim:n}=this;let s=t.current[e],o=t.target[e]-s,a=0,r=.5*i,l=n;this.isRTL&&this.isHorizontal?(s<-r&&(a=-1,s+=l),s>l-r&&(a=1,s-=l)):(s>r&&(a=1,s-=l),s<-l+r&&(a=-1,s+=l)),a&&(t.current[e]=s,t.target[e]=s+o)}lazyLoadSlide(t){const e=this,i=t&&t.el;if(!i)return;const s=new Set,o=\"f-fadeIn\";i.querySelectorAll(\"[data-lazy-srcset]\").forEach((t=>{t instanceof HTMLImageElement&&s.add(t)}));let a=Array.from(i.querySelectorAll(\"[data-lazy-src]\"));i.dataset.lazySrc&&a.push(i),a.map((t=>{t instanceof HTMLImageElement?s.add(t):x(t)&&(t.style.backgroundImage=`url('${t.dataset.lazySrc||\"\"}')`,delete t.dataset.lazySrc)}));const r=(t,i,n)=>{n&&(n.remove(),n=null),i.complete&&(i.classList.add(o),setTimeout((()=>{i.classList.remove(o)}),350),i.style.display=\"\"),this.option(\"adaptiveHeight\")&&t.el&&this.pages[this.page].slides.indexOf(t)>-1&&(e.updateMetrics(),e.setViewportHeight()),this.emit(\"load\",t)};for(const e of s){let i=null;e.src=e.dataset.lazySrcset||e.dataset.lazySrc||\"\",delete e.dataset.lazySrc,delete e.dataset.lazySrcset,e.style.display=\"none\",e.addEventListener(\"error\",(()=>{r(t,e,i)})),e.addEventListener(\"load\",(()=>{r(t,e,i)})),setTimeout((()=>{e.parentNode&&t.el&&(e.complete?r(t,e,i):(i=n(w),e.parentNode.insertBefore(i,e)))}),300)}}onAnimationEnd(t){var e;const i=t.target,n=i?parseInt(i.dataset.index||\"\",10)||0:-1,s=this.slides[n],o=t.animationName;if(!i||!s||!o)return;const a=!!this.inTransition.has(n)&&s.transition;a&&o.substring(0,a.length+2)===`f-${a}`&&this.inTransition.delete(n),this.inTransition.size||this.clearTransitions(),n===this.page&&(null===(e=this.panzoom)||void 0===e?void 0:e.isResting)&&this.emit(\"settle\")}onDecel(t,e=0,i=0,n=0,s=0){const{isRTL:o,isHorizontal:a,axis:r,pages:l}=this,c=l.length,h=Math.abs(Math.atan2(i,e)/(Math.PI/180));let d=0;if(d=h>45&&h<135?a?0:i:a?e:0,!c)return;const u=this.option(\"dragFree\");let p=this.page,f=o&&a?1:-1;const m=t.target[r]*f,g=t.current[r]*f;let{pageIndex:b}=this.getPageFromPosition(m),{pageIndex:v}=this.getPageFromPosition(g);u?this.onChange(b):(Math.abs(d)>5?(l[p].dim<document.documentElement[\"client\"+(this.isHorizontal?\"Width\":\"Height\")]-1&&(p=v),p=o&&a?d<0?p-1:p+1:d<0?p+1:p-1):p=0===n&&0===s?p:v,this.slideTo(p,{transition:!1,friction:t.option(\"decelFriction\")}))}onClick(t){const e=t.target,i=e&&x(e)?e.dataset:null;let n,s;i&&(void 0!==i.carouselPage?(s=\"slideTo\",n=i.carouselPage):void 0!==i.carouselNext?s=\"slideNext\":void 0!==i.carouselPrev&&(s=\"slidePrev\")),s?(t.preventDefault(),t.stopPropagation(),e&&!e.hasAttribute(\"disabled\")&&this[s](n)):this.emit(\"click\",t)}onSlideTo(t){const e=t.detail||0;this.slideTo(this.getPageForSlide(e),{friction:0})}onChange(t,e=0){const i=this.page;this.prevPage=i,this.page=t,this.option(\"adaptiveHeight\")&&this.setViewportHeight(),t!==i&&(this.markSelectedSlides(),this.emit(\"change\",t,i,e))}onRefresh(){let t=this.contentDim,e=this.viewportDim;this.updateMetrics(),this.contentDim===t&&this.viewportDim===e||this.slideTo(this.page,{friction:0,transition:!1})}onResize(){this.option(\"breakpoints\")&&this.processOptions()}onBeforeTransform(t){this.lp!==t.current[this.axis]&&(this.flipInfiniteTrack(),this.manageSlideVisiblity()),this.lp=t.current.e}onEndAnimation(){this.inTransition.size||this.emit(\"settle\")}reInit(t=null,e=null){this.destroy(),this.state=F.Init,this.userOptions=t||this.userOptions,this.userPlugins=e||this.userPlugins,this.processOptions()}slideTo(t=0,{friction:e=this.option(\"friction\"),transition:i=this.option(\"transition\")}={}){if(this.state===F.Destroy)return;const{axis:n,isHorizontal:s,isRTL:o,pages:a,panzoom:r}=this,l=a.length,c=o&&s?1:-1;if(!r||!l)return;if(this.transitionTo(t,i))return;const h=this.getPageFromIndex(t);let d=a[h].pos;if(this.isInfinite){const e=this.contentDim,i=r.target[n]*c;if(2===l)d+=e*Math.floor(parseFloat(t+\"\")/2);else{const t=i;d=[d,d-e,d+e].reduce((function(e,i){return Math.abs(i-t)<Math.abs(e-t)?i:e}))}}d*=c,Math.abs(r.target[n]-d)<.1||(r.panTo({x:s?d:0,y:s?0:d,friction:e}),this.onChange(h))}slideToClosest(t){if(this.panzoom){const{pageIndex:e}=this.getPageFromPosition(this.panzoom.current[this.isHorizontal?\"e\":\"f\"]);this.slideTo(e,t)}}slideNext(){this.slideTo(this.page+1)}slidePrev(){this.slideTo(this.page-1)}clearTransitions(){this.inTransition.clear(),E(this.container,this.cn(\"inTransition\"));const t=[\"to-prev\",\"to-next\",\"from-prev\",\"from-next\"];for(const e of this.slides){const i=e.el;if(i){i.removeEventListener(\"animationend\",this.onAnimationEnd),i.classList.remove(...t);const n=e.transition;n&&i.classList.remove(`f-${n}Out`,`f-${n}In`)}}this.manageSlideVisiblity()}prependSlide(t){var e,i;let n=Array.isArray(t)?t:[t];for(const t of n.reverse())this.slides.unshift(j(t));for(let t=0;t<this.slides.length;t++)this.slides[t].index=t;const s=(null===(e=this.pages[this.page])||void 0===e?void 0:e.pos)||0;this.page+=n.length,this.updateMetrics();const o=(null===(i=this.pages[this.page])||void 0===i?void 0:i.pos)||0;if(this.panzoom){const t=this.isRTL?s-o:o-s;this.panzoom.target.e-=t,this.panzoom.current.e-=t,this.panzoom.requestTick()}}appendSlide(t){let e=Array.isArray(t)?t:[t];for(const t of e){const e=j(t);e.index=this.slides.length,this.slides.push(e),this.emit(\"initSlide\",e,this.slides.length)}this.updateMetrics()}removeSlide(t){const e=this.slides.length;t=(t%e+e)%e,this.removeSlideEl(this.slides[t],!0),this.slides.splice(t,1);for(let t=0;t<this.slides.length;t++)this.slides[t].index=t;this.updateMetrics(),this.slideTo(this.page,{friction:0,transition:!1})}updateMetrics(){const{panzoom:e,viewport:i,track:n,isHorizontal:s}=this;if(!n)return;const o=s?\"width\":\"height\",a=s?\"offsetWidth\":\"offsetHeight\";if(i){let e=Math.max(i[a],t(i.getBoundingClientRect()[o],1e3)),n=getComputedStyle(i),r=\"padding\",l=s?\"Right\":\"Bottom\";e-=parseFloat(n[r+(s?\"Left\":\"Top\")])+parseFloat(n[r+l]),this.viewportDim=e}let r,l=this.pages.length,c=0;for(const[e,i]of this.slides.entries()){let n=0,s=0;!i.el&&r?(n=r.dim,s=r.gap):(({dim:n,gap:s}=this.getSlideMetrics(i)),r=i),n=t(n,1e3),s=t(s,1e3),i.dim=n,i.gap=s,i.pos=c,c+=n,(this.isInfinite||e<this.slides.length-1)&&(c+=s)}const h=this.contentDim;c=t(c,1e3),this.contentDim=c,e&&(e.contentRect[o]=c,e.contentRect[\"e\"===this.axis?\"fullWidth\":\"fullHeight\"]=c),this.pages=this.createPages(),this.pages=this.processPages(),this.state===F.Init&&this.setInitialPage(),this.page=Math.max(0,Math.min(this.page,this.pages.length-1)),e&&l===this.pages.length&&Math.abs(c-h)>.5&&(e.target[this.axis]=-1*this.pages[this.page].pos,e.current[this.axis]=-1*this.pages[this.page].pos,e.stop()),this.manageSlideVisiblity(),this.emit(\"refresh\")}getProgress(e,i=!1){void 0===e&&(e=this.page);const n=this,s=n.panzoom,o=n.pages[e]||0;if(!o||!s)return 0;let a=-1*s.current.e,r=n.contentDim;var l=[t((a-o.pos)/(1*o.dim),1e3),t((a+r-o.pos)/(1*o.dim),1e3),t((a-r-o.pos)/(1*o.dim),1e3)].reduce((function(t,e){return Math.abs(e)<Math.abs(t)?e:t}));return i?l:Math.max(-1,Math.min(1,l))}setViewportHeight(){const{page:t,pages:e,viewport:i,isHorizontal:n}=this;if(!i||!e[t])return;let s=0;n&&this.track&&(this.track.style.height=\"auto\",e[t].slides.forEach((t=>{t.el&&(s=Math.max(s,t.el.offsetHeight))}))),i.style.height=s?`${s}px`:\"\"}getPageForSlide(t){for(const e of this.pages)for(const i of e.slides)if(i.index===t)return e.index;return-1}getVisibleSlides(t=0){var e;const i=new Set;let{contentDim:n,viewportDim:s,pages:o,page:a}=this;n=n+(null===(e=this.slides[this.slides.length-1])||void 0===e?void 0:e.gap)||0;let r=0;r=this.panzoom?-1*this.panzoom.current[this.axis]:o[a]&&o[a].pos||0,this.isInfinite&&(r-=Math.floor(r/n)*n),this.isRTL&&this.isHorizontal&&(r*=-1);const l=r-s*t,c=r+s*(t+1),h=this.isInfinite?[-1,0,1]:[0];for(const t of this.slides)for(const e of h){const s=t.pos+e*n,o=t.pos+t.dim+t.gap+e*n;s<c&&o>l&&i.add(t)}return i}getPageFromPosition(t){const{viewportDim:e,contentDim:i}=this,n=this.pages.length,s=this.slides.length,o=this.slides[s-1];let a=0,r=0,l=0;const c=this.option(\"center\");c&&(t+=.5*e),this.isInfinite||(t=Math.max(this.slides[0].pos,Math.min(t,o.pos)));const h=i+o.gap;l=Math.floor(t/h)||0,t-=l*h;let d=o,u=this.slides.find((e=>{const i=t+(d&&!c?.5*d.dim:0);return d=e,e.pos<=i&&e.pos+e.dim+e.gap>i}));return u||(u=o),r=this.getPageForSlide(u.index),a=r+l*n,{page:a,pageIndex:r}}destroy(){if([F.Destroy].includes(this.state))return;this.state=F.Destroy;const{container:t,viewport:e,track:i,slides:n,panzoom:s}=this,o=this.option(\"classes\");t.removeEventListener(\"click\",this.onClick,{passive:!1,capture:!1}),t.removeEventListener(\"slideTo\",this.onSlideTo),window.removeEventListener(\"resize\",this.onResize),s&&(s.destroy(),this.panzoom=null),n&&n.forEach((t=>{this.removeSlideEl(t)})),this.detachPlugins(),e&&e.offsetParent&&i&&i.offsetParent&&e.replaceWith(...i.childNodes);for(const[e,i]of Object.entries(o))\"container\"!==e&&i&&t.classList.remove(i);this.track=null,this.viewport=null,this.page=0,this.slides=[];const a=this.events.get(\"ready\");this.events=new Map,a&&this.events.set(\"ready\",a)}}Object.defineProperty(Z,\"Panzoom\",{enumerable:!0,configurable:!0,writable:!0,value:R}),Object.defineProperty(Z,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:D}),Object.defineProperty(Z,\"Plugins\",{enumerable:!0,configurable:!0,writable:!0,value:V});const U=function(t){const e=window.pageYOffset,i=window.pageYOffset+window.innerHeight;if(!x(t))return 0;const n=t.getBoundingClientRect(),s=n.y+window.pageYOffset,o=n.y+n.height+window.pageYOffset;if(e>o||i<s)return 0;if(e<s&&i>o)return 100;if(s<e&&o>i)return 100;let a=n.height;s<e&&(a-=window.pageYOffset-s),o>i&&(a-=o-i);const r=a/window.innerHeight*100;return Math.round(r)},G=!(\"undefined\"==typeof window||!window.document||!window.document.createElement);let K;const J=[\"a[href]\",\"area[href]\",'input:not([disabled]):not([type=\"hidden\"]):not([aria-hidden])',\"select:not([disabled]):not([aria-hidden])\",\"textarea:not([disabled]):not([aria-hidden])\",\"button:not([disabled]):not([aria-hidden]):not(.fancybox-focus-guard)\",\"iframe\",\"object\",\"embed\",\"video\",\"audio\",\"[contenteditable]\",'[tabindex]:not([tabindex^=\"-\"]):not([disabled]):not([aria-hidden])'].join(\",\"),Q=t=>{if(t&&G){void 0===K&&document.createElement(\"div\").focus({get preventScroll(){return K=!0,!1}});try{if(K)t.focus({preventScroll:!0});else{const e=window.pageXOffset||document.body.scrollTop,i=window.pageYOffset||document.body.scrollLeft;t.focus(),document.body.scrollTo({top:e,left:i,behavior:\"auto\"})}}catch(t){}}},tt={dragToClose:!0,hideScrollbar:!0,Carousel:{classes:{container:\"fancybox__carousel\",viewport:\"fancybox__viewport\",track:\"fancybox__track\",slide:\"fancybox__slide\"}},contentClick:\"toggleZoom\",contentDblClick:!1,backdropClick:\"close\",animated:!0,idle:3500,showClass:\"f-zoomInUp\",hideClass:\"f-fadeOut\",commonCaption:!1,parentEl:null,startIndex:0,l10n:Object.assign(Object.assign({},v),{CLOSE:\"Close\",NEXT:\"Next\",PREV:\"Previous\",MODAL:\"You can close this modal content with the ESC key\",ERROR:\"Something Went Wrong, Please Try Again Later\",IMAGE_ERROR:\"Image Not Found\",ELEMENT_NOT_FOUND:\"HTML Element Not Found\",AJAX_NOT_FOUND:\"Error Loading AJAX : Not Found\",AJAX_FORBIDDEN:\"Error Loading AJAX : Forbidden\",IFRAME_ERROR:\"Error Loading Page\",TOGGLE_ZOOM:\"Toggle zoom level\",TOGGLE_THUMBS:\"Toggle thumbnails\",TOGGLE_SLIDESHOW:\"Toggle slideshow\",TOGGLE_FULLSCREEN:\"Toggle full-screen mode\",DOWNLOAD:\"Download\"}),tpl:{closeButton:'<button data-fancybox-close class=\"f-button is-close-btn\" title=\"{{CLOSE}}\"><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" tabindex=\"-1\"><path d=\"M20 20L4 4m16 0L4 20\"/></svg></button>',main:'<div class=\"fancybox__container\" role=\"dialog\" aria-modal=\"true\" aria-label=\"{{MODAL}}\" tabindex=\"-1\">\\n <div class=\"fancybox__backdrop\"></div>\\n <div class=\"fancybox__carousel\"></div>\\n <div class=\"fancybox__footer\"></div>\\n </div>'},groupAll:!1,groupAttr:\"data-fancybox\",defaultType:\"image\",defaultDisplay:\"block\",autoFocus:!0,trapFocus:!0,placeFocusBack:!0,closeButton:\"auto\",keyboard:{Escape:\"close\",Delete:\"close\",Backspace:\"close\",PageUp:\"next\",PageDown:\"prev\",ArrowUp:\"prev\",ArrowDown:\"next\",ArrowRight:\"next\",ArrowLeft:\"prev\"},Fullscreen:{autoStart:!1},compact:()=>window.matchMedia(\"(max-width: 578px), (max-height: 578px)\").matches,wheel:\"zoom\"};var et,it;!function(t){t[t.Init=0]=\"Init\",t[t.Ready=1]=\"Ready\",t[t.Closing=2]=\"Closing\",t[t.CustomClosing=3]=\"CustomClosing\",t[t.Destroy=4]=\"Destroy\"}(et||(et={})),function(t){t[t.Loading=0]=\"Loading\",t[t.Opening=1]=\"Opening\",t[t.Ready=2]=\"Ready\",t[t.Closing=3]=\"Closing\"}(it||(it={}));const nt=()=>{queueMicrotask((()=>{(()=>{const{slug:t,index:e}=st.parseURL(),i=_t.getInstance();if(i&&!1!==i.option(\"Hash\")){const n=i.carousel;if(t&&n){for(let e of n.slides)if(e.slug&&e.slug===t)return n.slideTo(e.index);if(t===i.option(\"slug\"))return n.slideTo(e-1);const s=i.getSlide(),o=s&&s.triggerEl&&s.triggerEl.dataset;if(o&&o.fancybox===t)return n.slideTo(e-1)}st.hasSilentClose=!0,i.close()}st.startFromUrl()})()}))};class st extends B{constructor(){super(...arguments),Object.defineProperty(this,\"origHash\",{enumerable:!0,configurable:!0,writable:!0,value:\"\"}),Object.defineProperty(this,\"timer\",{enumerable:!0,configurable:!0,writable:!0,value:null})}onChange(){const t=this.instance,e=t.carousel;this.timer&&clearTimeout(this.timer);const i=t.getSlide();if(!e||!i)return;const n=t.isOpeningSlide(i),s=new URL(document.URL).hash;let o,a=i.slug||void 0,r=i.triggerEl||void 0;o=a||this.instance.option(\"slug\"),!o&&r&&r.dataset&&(o=r.dataset.fancybox);let l=\"\";o&&\"true\"!==o&&(l=\"#\"+o+(!a&&e.slides.length>1?\"-\"+(i.index+1):\"\")),n&&(this.origHash=s!==l?s:\"\"),l&&s!==l&&(this.timer=setTimeout((()=>{try{t.state===et.Ready&&window.history[n?\"pushState\":\"replaceState\"]({},document.title,window.location.pathname+window.location.search+l)}catch(t){}}),300))}onClose(){if(this.timer&&clearTimeout(this.timer),!0!==st.hasSilentClose)try{window.history.replaceState({},document.title,window.location.pathname+window.location.search+(this.origHash||\"\"))}catch(t){}}attach(){const t=this.instance;t.on(\"Carousel.ready\",this.onChange),t.on(\"Carousel.change\",this.onChange),t.on(\"close\",this.onClose)}detach(){const t=this.instance;t.off(\"Carousel.ready\",this.onChange),t.off(\"Carousel.change\",this.onChange),t.off(\"close\",this.onClose)}static parseURL(){const t=window.location.hash.slice(1),e=t.split(\"-\"),i=e[e.length-1],n=i&&/^\\+?\\d+$/.test(i)&&parseInt(e.pop()||\"1\",10)||1;return{hash:t,slug:e.join(\"-\"),index:n}}static startFromUrl(){if(st.hasSilentClose=!1,_t.getInstance()||!1===_t.defaults.Hash)return;const{hash:t,slug:e,index:i}=st.parseURL();if(!e)return;let n=document.querySelector(`[data-slug=\"${t}\"]`);if(n&&n.dispatchEvent(new CustomEvent(\"click\",{bubbles:!0,cancelable:!0})),_t.getInstance())return;const s=document.querySelectorAll(`[data-fancybox=\"${e}\"]`);s.length&&(n=s[i-1],n&&n.dispatchEvent(new CustomEvent(\"click\",{bubbles:!0,cancelable:!0})))}static destroy(){window.removeEventListener(\"hashchange\",nt,!1)}}function ot(){window.addEventListener(\"hashchange\",nt,!1),setTimeout((()=>{st.startFromUrl()}),500)}Object.defineProperty(st,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(st,\"hasSilentClose\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),G&&(/complete|interactive|loaded/.test(document.readyState)?ot():document.addEventListener(\"DOMContentLoaded\",ot));class at extends B{onCreateSlide(t,e,i){const n=this.instance.optionFor(i,\"src\")||\"\";i.el&&\"image\"===i.type&&\"string\"==typeof n&&this.setImage(i,n)}onRemoveSlide(t,e,i){i.panzoom&&i.panzoom.destroy(),i.panzoom=void 0,i.imageEl=void 0}onChange(t,e,i,n){for(const t of e.slides){const e=t.panzoom;e&&t.index!==i&&e.reset(.35)}}onClose(){var t;const e=this.instance,i=e.container,n=e.getSlide();if(!i||!i.parentElement||!n)return;const{el:s,contentEl:o,panzoom:a}=n,r=n.thumbElSrc;if(!s||!r||!o||!a||a.isContentLoading||a.state===g.Init||a.state===g.Destroy)return;a.updateMetrics();let l=this.getZoomInfo(n);if(!l)return;this.instance.state=et.CustomClosing,i.classList.remove(\"is-zooming-in\"),i.classList.add(\"is-zooming-out\"),o.style.backgroundImage=`url('${r}')`;const c=i.getBoundingClientRect();1===((null===(t=window.visualViewport)||void 0===t?void 0:t.scale)||1)&&Object.assign(i.style,{position:\"absolute\",top:`${window.pageYOffset}px`,left:`${window.pageXOffset}px`,bottom:\"auto\",right:\"auto\",width:`${c.width}px`,height:`${c.height}px`,overflow:\"hidden\"});const{x:h,y:d,scale:u,opacity:p}=l;if(p){const t=((t,e,i,n)=>{const s=e-t,o=n-i;return e=>i+((e-t)/s*o||0)})(a.scale,u,1,0);a.on(\"afterTransform\",(()=>{o.style.opacity=t(a.scale)+\"\"}))}a.on(\"endAnimation\",(()=>{e.destroy()})),a.target.a=u,a.target.b=0,a.target.c=0,a.target.d=u,a.panTo({x:h,y:d,scale:u,friction:p?.2:.33,ignoreBounds:!0}),a.isResting&&e.destroy()}setImage(t,e){const i=this.instance;t.src=e,this.process(t,e).then((e=>{var n;const s=t.contentEl,o=t.imageEl,a=t.thumbElSrc;if(i.isClosing()||!s||!o)return;s.offsetHeight;const r=!!i.isOpeningSlide(t)&&this.getZoomInfo(t);if(this.option(\"protected\")){null===(n=t.el)||void 0===n||n.addEventListener(\"contextmenu\",(t=>{t.preventDefault()}));const e=document.createElement(\"div\");S(e,\"fancybox-protected\"),s.appendChild(e)}if(a&&r){const n=e.contentRect,o=Math.max(n.fullWidth,n.fullHeight);let c=null;!r.opacity&&o>1200&&(c=document.createElement(\"img\"),S(c,\"fancybox-ghost\"),c.src=a,s.appendChild(c));const h=()=>{c&&(S(c,\"f-fadeFastOut\"),setTimeout((()=>{c&&(c.remove(),c=null)}),200))};(l=a,new Promise(((t,e)=>{const i=new Image;i.onload=t,i.onerror=e,i.src=l}))).then((()=>{t.state=it.Opening,this.instance.emit(\"reveal\",t),this.zoomIn(t).then((()=>{h(),this.instance.done(t)}),(()=>{i.hideLoading(t)})),c&&setTimeout((()=>{h()}),o>2500?800:200)}),(()=>{i.hideLoading(t),i.revealContent(t)}))}else{const n=this.optionFor(t,\"initialSize\"),s=this.optionFor(t,\"zoom\"),o={event:i.prevMouseMoveEvent||i.options.event,friction:s?.12:0};let a=i.optionFor(t,\"showClass\")||void 0,r=!0;i.isOpeningSlide(t)&&(\"full\"===n?e.zoomToFull(o):\"cover\"===n?e.zoomToCover(o):\"max\"===n?e.zoomToMax(o):r=!1,e.stop(\"current\")),r&&a&&(a=e.isDragging?\"f-fadeIn\":\"\"),i.revealContent(t,a)}var l}),(()=>{i.setError(t,\"{{IMAGE_ERROR}}\")}))}process(t,e){return new Promise(((i,s)=>{var o;const a=this.instance,r=t.el;a.clearContent(t),a.showLoading(t);let l=this.optionFor(t,\"content\");if(\"string\"==typeof l&&(l=n(l)),!l||!x(l)){if(l=document.createElement(\"img\"),l instanceof HTMLImageElement){let i=\"\",n=t.caption;i=\"string\"==typeof n&&n?n.replace(/<[^>]+>/gi,\"\").substring(0,1e3):`Image ${t.index+1} of ${null===(o=a.carousel)||void 0===o?void 0:o.pages.length}`,l.src=e||\"\",l.alt=i,l.draggable=!1,t.srcset&&l.setAttribute(\"srcset\",t.srcset)}t.sizes&&l.setAttribute(\"sizes\",t.sizes)}l.classList.add(\"fancybox-image\"),t.imageEl=l,a.setContent(t,l,!1);t.panzoom=new R(r,u({transformParent:!0},this.option(\"Panzoom\")||{},{content:l,width:a.optionFor(t,\"width\",\"auto\"),height:a.optionFor(t,\"height\",\"auto\"),wheel:()=>{const t=a.option(\"wheel\");return(\"zoom\"===t||\"pan\"==t)&&t},click:(e,i)=>{var n,s;if(a.isCompact||a.isClosing())return!1;if(t.index!==(null===(n=a.getSlide())||void 0===n?void 0:n.index))return!1;if(i){const t=i.composedPath()[0];if([\"A\",\"BUTTON\",\"TEXTAREA\",\"OPTION\",\"INPUT\",\"SELECT\",\"VIDEO\"].includes(t.nodeName))return!1}let o=!i||i.target&&(null===(s=t.contentEl)||void 0===s?void 0:s.contains(i.target));return a.option(o?\"contentClick\":\"backdropClick\")||!1},dblClick:()=>a.isCompact?\"toggleZoom\":a.option(\"contentDblClick\")||!1,spinner:!1,panOnlyZoomed:!0,wheelLimit:1/0,on:{ready:t=>{i(t)},error:()=>{s()},destroy:()=>{s()}}}))}))}zoomIn(t){return new Promise(((e,i)=>{const n=this.instance,s=n.container,{panzoom:o,contentEl:a,el:r}=t;o&&o.updateMetrics();const l=this.getZoomInfo(t);if(!(l&&r&&a&&o&&s))return void i();const{x:c,y:h,scale:d,opacity:u}=l,p=()=>{t.state!==it.Closing&&(u&&(a.style.opacity=Math.max(Math.min(1,1-(1-o.scale)/(1-d)),0)+\"\"),o.scale>=1&&o.scale>o.targetScale-.1&&e(o))},f=t=>{E(s,\"is-zooming-in\"),t.scale<.99||t.scale>1.01||(a.style.opacity=\"\",t.off(\"endAnimation\",f),t.off(\"touchStart\",f),t.off(\"afterTransform\",p),e(t))};o.on(\"endAnimation\",f),o.on(\"touchStart\",f),o.on(\"afterTransform\",p),o.on([\"error\",\"destroy\"],(()=>{i()})),o.panTo({x:c,y:h,scale:d,friction:0,ignoreBounds:!0}),o.stop(\"current\");const m={event:\"mousemove\"===o.panMode?n.prevMouseMoveEvent||n.options.event:void 0},g=this.optionFor(t,\"initialSize\");S(s,\"is-zooming-in\"),n.hideLoading(t),\"full\"===g?o.zoomToFull(m):\"cover\"===g?o.zoomToCover(m):\"max\"===g?o.zoomToMax(m):o.reset(.172)}))}getZoomInfo(t){var e;const{el:i,imageEl:n,thumbEl:s,panzoom:o}=t;if(!i||!n||!s||!o||U(s)<3||!this.optionFor(t,\"zoom\")||this.instance.state===et.Destroy)return!1;if(1!==((null===(e=window.visualViewport)||void 0===e?void 0:e.scale)||1))return!1;let{top:a,left:r,width:l,height:c}=s.getBoundingClientRect(),{top:h,left:d,fitWidth:u,fitHeight:p}=o.contentRect;if(!(l&&c&&u&&p))return!1;const f=o.container.getBoundingClientRect();d+=f.left,h+=f.top;const m=-1*(d+.5*u-(r+.5*l)),g=-1*(h+.5*p-(a+.5*c)),b=l/u;let v=this.option(\"zoomOpacity\")||!1;return\"auto\"===v&&(v=Math.abs(l/c-u/p)>.1),{x:m,y:g,scale:b,opacity:v}}attach(){const t=this,e=t.instance;e.on(\"Carousel.change\",t.onChange),e.on(\"Carousel.createSlide\",t.onCreateSlide),e.on(\"Carousel.removeSlide\",t.onRemoveSlide),e.on(\"close\",t.onClose)}detach(){const t=this,e=t.instance;e.off(\"Carousel.change\",t.onChange),e.off(\"Carousel.createSlide\",t.onCreateSlide),e.off(\"Carousel.removeSlide\",t.onRemoveSlide),e.off(\"close\",t.onClose)}}Object.defineProperty(at,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:{initialSize:\"fit\",Panzoom:{maxScale:1},protected:!1,zoom:!0,zoomOpacity:\"auto\"}}),\"function\"==typeof SuppressedError&&SuppressedError;const rt=(t,e={})=>{const i=new URL(t),n=new URLSearchParams(i.search),s=new URLSearchParams;for(const[t,i]of[...n,...Object.entries(e)]){let e=i.toString();\"t\"===t?s.set(\"start\",parseInt(e).toString()):s.set(t,e)}let o=s.toString(),a=t.match(/#t=((.*)?\\d+s)/);return a&&(o+=`#t=${a[1]}`),o},lt={ajax:null,autoSize:!0,iframeAttr:{allow:\"autoplay; fullscreen\",scrolling:\"auto\"},preload:!0,videoAutoplay:!0,videoRatio:16/9,videoTpl:'<video class=\"fancybox__html5video\" playsinline controls controlsList=\"nodownload\" poster=\"{{poster}}\">\\n <source src=\"{{src}}\" type=\"{{format}}\" />Sorry, your browser doesn\\'t support embedded videos.</video>',videoFormat:\"\",vimeo:{byline:1,color:\"00adef\",controls:1,dnt:1,muted:0},youtube:{controls:1,enablejsapi:1,nocookie:1,rel:0,fs:1}},ct=[\"image\",\"html\",\"ajax\",\"inline\",\"clone\",\"iframe\",\"map\",\"pdf\",\"html5video\",\"youtube\",\"vimeo\",\"video\"];class ht extends B{onInitSlide(t,e,i){this.processType(i)}onCreateSlide(t,e,i){this.setContent(i)}onRemoveSlide(t,e,i){i.xhr&&(i.xhr.abort(),i.xhr=null);const n=i.iframeEl;n&&(n.onload=n.onerror=null,n.src=\"//about:blank\",i.iframeEl=null);const s=i.contentEl,o=i.placeholderEl;if(\"inline\"===i.type&&s&&o)s.classList.remove(\"fancybox__content\"),\"none\"!==s.style.display&&(s.style.display=\"none\"),o.parentNode&&o.parentNode.insertBefore(s,o),o.remove(),i.contentEl=void 0,i.placeholderEl=void 0;else for(;i.el&&i.el.firstChild;)i.el.removeChild(i.el.firstChild)}onSelectSlide(t,e,i){i.state===it.Ready&&this.playVideo()}onUnselectSlide(t,e,i){var n,s;if(\"html5video\"===i.type){try{null===(s=null===(n=i.el)||void 0===n?void 0:n.querySelector(\"video\"))||void 0===s||s.pause()}catch(t){}return}let o;\"vimeo\"===i.type?o={method:\"pause\",value:\"true\"}:\"youtube\"===i.type&&(o={event:\"command\",func:\"pauseVideo\"}),o&&i.iframeEl&&i.iframeEl.contentWindow&&i.iframeEl.contentWindow.postMessage(JSON.stringify(o),\"*\"),i.poller&&clearTimeout(i.poller)}onDone(t,e){t.isCurrentSlide(e)&&!t.isClosing()&&this.playVideo()}onRefresh(t,e){e.slides.forEach((t=>{t.el&&(this.setAspectRatio(t),this.resizeIframe(t))}))}onMessage(t){try{let e=JSON.parse(t.data);if(\"https://player.vimeo.com\"===t.origin){if(\"ready\"===e.event)for(let e of Array.from(document.getElementsByClassName(\"fancybox__iframe\")))e instanceof HTMLIFrameElement&&e.contentWindow===t.source&&(e.dataset.ready=\"true\")}else if(t.origin.match(/^https:\\/\\/(www.)?youtube(-nocookie)?.com$/)&&\"onReady\"===e.event){const t=document.getElementById(e.id);t&&(t.dataset.ready=\"true\")}}catch(t){}}loadAjaxContent(t){const e=this.instance.optionFor(t,\"src\")||\"\";this.instance.showLoading(t);const i=this.instance,n=new XMLHttpRequest;i.showLoading(t),n.onreadystatechange=function(){n.readyState===XMLHttpRequest.DONE&&i.state===et.Ready&&(i.hideLoading(t),200===n.status?i.setContent(t,n.responseText):i.setError(t,404===n.status?\"{{AJAX_NOT_FOUND}}\":\"{{AJAX_FORBIDDEN}}\"))};const s=t.ajax||null;n.open(s?\"POST\":\"GET\",e+\"\"),n.setRequestHeader(\"Content-Type\",\"application/x-www-form-urlencoded\"),n.setRequestHeader(\"X-Requested-With\",\"XMLHttpRequest\"),n.send(s),t.xhr=n}setInlineContent(t){let e=null;if(x(t.src))e=t.src;else if(\"string\"==typeof t.src){const i=t.src.split(\"#\",2).pop();e=i?document.getElementById(i):null}if(e){if(\"clone\"===t.type||e.closest(\".fancybox__slide\")){e=e.cloneNode(!0);const i=e.dataset.animationName;i&&(e.classList.remove(i),delete e.dataset.animationName);let n=e.getAttribute(\"id\");n=n?`${n}--clone`:`clone-${this.instance.id}-${t.index}`,e.setAttribute(\"id\",n)}else if(e.parentNode){const i=document.createElement(\"div\");i.classList.add(\"fancybox-placeholder\"),e.parentNode.insertBefore(i,e),t.placeholderEl=i}this.instance.setContent(t,e)}else this.instance.setError(t,\"{{ELEMENT_NOT_FOUND}}\")}setIframeContent(t){const{src:e,el:i}=t;if(!e||\"string\"!=typeof e||!i)return;i.classList.add(\"is-loading\");const n=this.instance,s=document.createElement(\"iframe\");s.className=\"fancybox__iframe\",s.setAttribute(\"id\",`fancybox__iframe_${n.id}_${t.index}`);for(const[e,i]of Object.entries(this.optionFor(t,\"iframeAttr\")||{}))s.setAttribute(e,i);s.onerror=()=>{n.setError(t,\"{{IFRAME_ERROR}}\")},t.iframeEl=s;const o=this.optionFor(t,\"preload\");if(\"iframe\"!==t.type||!1===o)return s.setAttribute(\"src\",t.src+\"\"),n.setContent(t,s,!1),this.resizeIframe(t),void n.revealContent(t);n.showLoading(t),s.onload=()=>{if(!s.src.length)return;const e=\"true\"!==s.dataset.ready;s.dataset.ready=\"true\",this.resizeIframe(t),e?n.revealContent(t):n.hideLoading(t)},s.setAttribute(\"src\",e),n.setContent(t,s,!1)}resizeIframe(t){const e=t.iframeEl,i=null==e?void 0:e.parentElement;if(!e||!i)return;let n=t.autoSize,s=t.width||0,o=t.height||0;s&&o&&(n=!1);const a=i&&i.style;if(!1!==t.preload&&!1!==n&&a)try{const t=window.getComputedStyle(i),n=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight),r=parseFloat(t.paddingTop)+parseFloat(t.paddingBottom),l=e.contentWindow;if(l){const t=l.document,e=t.getElementsByTagName(\"html\")[0],i=t.body;a.width=\"\",i.style.overflow=\"hidden\",s=s||e.scrollWidth+n,a.width=`${s}px`,i.style.overflow=\"\",a.flex=\"0 0 auto\",a.height=`${i.scrollHeight}px`,o=e.scrollHeight+r}}catch(t){}if(s||o){const t={flex:\"0 1 auto\",width:\"\",height:\"\"};s&&(t.width=`${s}px`),o&&(t.height=`${o}px`),Object.assign(a,t)}}playVideo(){const t=this.instance.getSlide();if(!t)return;const{el:e}=t;if(!e||!e.offsetParent)return;if(!this.optionFor(t,\"videoAutoplay\"))return;if(\"html5video\"===t.type)try{const t=e.querySelector(\"video\");if(t){const e=t.play();void 0!==e&&e.then((()=>{})).catch((e=>{t.muted=!0,t.play()}))}}catch(t){}if(\"youtube\"!==t.type&&\"vimeo\"!==t.type)return;const i=()=>{if(t.iframeEl&&t.iframeEl.contentWindow){let e;if(\"true\"===t.iframeEl.dataset.ready)return e=\"youtube\"===t.type?{event:\"command\",func:\"playVideo\"}:{method:\"play\",value:\"true\"},e&&t.iframeEl.contentWindow.postMessage(JSON.stringify(e),\"*\"),void(t.poller=void 0);\"youtube\"===t.type&&(e={event:\"listening\",id:t.iframeEl.getAttribute(\"id\")},t.iframeEl.contentWindow.postMessage(JSON.stringify(e),\"*\"))}t.poller=setTimeout(i,250)};i()}processType(t){if(t.html)return t.type=\"html\",t.src=t.html,void(t.html=\"\");const e=this.instance.optionFor(t,\"src\",\"\");if(!e||\"string\"!=typeof e)return;let i=t.type,n=null;if(n=e.match(/(youtube\\.com|youtu\\.be|youtube\\-nocookie\\.com)\\/(?:watch\\?(?:.*&)?v=|v\\/|u\\/|shorts\\/|embed\\/?)?(videoseries\\?list=(?:.*)|[\\w-]{11}|\\?listType=(?:.*)&list=(?:.*))(?:.*)/i)){const s=this.optionFor(t,\"youtube\"),{nocookie:o}=s,a=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&\"function\"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i}(s,[\"nocookie\"]),r=`www.youtube${o?\"-nocookie\":\"\"}.com`,l=rt(e,a),c=encodeURIComponent(n[2]);t.videoId=c,t.src=`https://${r}/embed/${c}?${l}`,t.thumbSrc=t.thumbSrc||`https://i.ytimg.com/vi/${c}/mqdefault.jpg`,i=\"youtube\"}else if(n=e.match(/^.+vimeo.com\\/(?:\\/)?([\\d]+)((\\/|\\?h=)([a-z0-9]+))?(.*)?/)){const s=rt(e,this.optionFor(t,\"vimeo\")),o=encodeURIComponent(n[1]),a=n[4]||\"\";t.videoId=o,t.src=`https://player.vimeo.com/video/${o}?${a?`h=${a}${s?\"&\":\"\"}`:\"\"}${s}`,i=\"vimeo\"}if(!i&&t.triggerEl){const e=t.triggerEl.dataset.type;ct.includes(e)&&(i=e)}i||\"string\"==typeof e&&(\"#\"===e.charAt(0)?i=\"inline\":(n=e.match(/\\.(mp4|mov|ogv|webm)((\\?|#).*)?$/i))?(i=\"html5video\",t.videoFormat=t.videoFormat||\"video/\"+(\"ogv\"===n[1]?\"ogg\":n[1])):e.match(/(^data:image\\/[a-z0-9+\\/=]*,)|(\\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\\?|#).*)?$)/i)?i=\"image\":e.match(/\\.(pdf)((\\?|#).*)?$/i)?i=\"pdf\":(n=e.match(/(?:maps\\.)?google\\.([a-z]{2,3}(?:\\.[a-z]{2})?)\\/(?:(?:(?:maps\\/(?:place\\/(?:.*)\\/)?\\@(.*),(\\d+.?\\d+?)z))|(?:\\?ll=))(.*)?/i))?(t.src=`https://maps.google.${n[1]}/?ll=${(n[2]?n[2]+\"&z=\"+Math.floor(parseFloat(n[3]))+(n[4]?n[4].replace(/^\\//,\"&\"):\"\"):n[4]+\"\").replace(/\\?/,\"&\")}&output=${n[4]&&n[4].indexOf(\"layer=c\")>0?\"svembed\":\"embed\"}`,i=\"map\"):(n=e.match(/(?:maps\\.)?google\\.([a-z]{2,3}(?:\\.[a-z]{2})?)\\/(?:maps\\/search\\/)(.*)/i))&&(t.src=`https://maps.google.${n[1]}/maps?q=${n[2].replace(\"query=\",\"q=\").replace(\"api=1\",\"\")}&output=embed`,i=\"map\")),i=i||this.instance.option(\"defaultType\"),t.type=i,\"image\"===i&&(t.thumbSrc=t.thumbSrc||t.src)}setContent(t){const e=this.instance.optionFor(t,\"src\")||\"\";if(t&&t.type&&e){switch(t.type){case\"html\":this.instance.setContent(t,e);break;case\"html5video\":const i=this.option(\"videoTpl\");i&&this.instance.setContent(t,i.replace(/\\{\\{src\\}\\}/gi,e+\"\").replace(/\\{\\{format\\}\\}/gi,this.optionFor(t,\"videoFormat\")||\"\").replace(/\\{\\{poster\\}\\}/gi,t.poster||t.thumbSrc||\"\"));break;case\"inline\":case\"clone\":this.setInlineContent(t);break;case\"ajax\":this.loadAjaxContent(t);break;case\"pdf\":case\"map\":case\"youtube\":case\"vimeo\":t.preload=!1;case\"iframe\":this.setIframeContent(t)}this.setAspectRatio(t)}}setAspectRatio(t){var e;const i=t.width||0,n=t.height||0;if(i&&n)return;const s=t.contentEl,o=this.optionFor(t,\"videoRatio\"),a=null===(e=t.el)||void 0===e?void 0:e.getBoundingClientRect();if(!(s&&a&&o&&1!==o&&t.type&&[\"video\",\"youtube\",\"vimeo\",\"html5video\"].includes(t.type)))return;const r=a.width,l=a.height;s.style.aspectRatio=o+\"\",s.style.width=r/l>o?\"auto\":\"\",s.style.height=r/l>o?\"\":\"auto\"}attach(){const t=this,e=t.instance;e.on(\"Carousel.initSlide\",t.onInitSlide),e.on(\"Carousel.createSlide\",t.onCreateSlide),e.on(\"Carousel.removeSlide\",t.onRemoveSlide),e.on(\"Carousel.selectSlide\",t.onSelectSlide),e.on(\"Carousel.unselectSlide\",t.onUnselectSlide),e.on(\"Carousel.Panzoom.refresh\",t.onRefresh),e.on(\"done\",t.onDone),window.addEventListener(\"message\",t.onMessage)}detach(){const t=this,e=t.instance;e.off(\"Carousel.initSlide\",t.onInitSlide),e.off(\"Carousel.createSlide\",t.onCreateSlide),e.off(\"Carousel.removeSlide\",t.onRemoveSlide),e.off(\"Carousel.selectSlide\",t.onSelectSlide),e.off(\"Carousel.unselectSlide\",t.onUnselectSlide),e.off(\"Carousel.Panzoom.refresh\",t.onRefresh),e.off(\"done\",t.onDone),window.removeEventListener(\"message\",t.onMessage)}}Object.defineProperty(ht,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:lt});const dt=\"play\",ut=\"pause\",pt=\"ready\";class ft extends B{constructor(){super(...arguments),Object.defineProperty(this,\"state\",{enumerable:!0,configurable:!0,writable:!0,value:pt}),Object.defineProperty(this,\"inHover\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"timer\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"progressBar\",{enumerable:!0,configurable:!0,writable:!0,value:null})}get isActive(){return this.state!==pt}onReady(t){this.option(\"autoStart\")&&(t.isInfinite||t.page<t.pages.length-1)&&this.start()}onChange(){var t;(null===(t=this.instance.panzoom)||void 0===t?void 0:t.isResting)||(this.removeProgressBar(),this.pause())}onSettle(){this.resume()}onVisibilityChange(){\"visible\"===document.visibilityState?this.resume():this.pause()}onMouseEnter(){this.inHover=!0,this.pause()}onMouseLeave(){var t;this.inHover=!1,(null===(t=this.instance.panzoom)||void 0===t?void 0:t.isResting)&&this.resume()}onTimerEnd(){const t=this.instance;\"play\"===this.state&&(t.isInfinite||t.page!==t.pages.length-1?t.slideNext():t.slideTo(0))}removeProgressBar(){this.progressBar&&(this.progressBar.remove(),this.progressBar=null)}createProgressBar(){var t;if(!this.option(\"showProgress\"))return null;this.removeProgressBar();const e=this.instance,i=(null===(t=e.pages[e.page])||void 0===t?void 0:t.slides)||[];let n=this.option(\"progressParentEl\");if(n||(n=(1===i.length?i[0].el:null)||e.viewport),!n)return null;const s=document.createElement(\"div\");return S(s,\"f-progress\"),n.prepend(s),this.progressBar=s,s.offsetHeight,s}set(){const t=this,e=t.instance;if(e.pages.length<2)return;if(t.timer)return;const i=t.option(\"timeout\");t.state=dt,S(e.container,\"has-autoplay\");let n=t.createProgressBar();n&&(n.style.transitionDuration=`${i}ms`,n.style.transform=\"scaleX(1)\"),t.timer=setTimeout((()=>{t.timer=null,t.inHover||t.onTimerEnd()}),i),t.emit(\"set\")}clear(){const t=this;t.timer&&(clearTimeout(t.timer),t.timer=null),t.removeProgressBar()}start(){const t=this;if(t.set(),t.state!==pt){if(t.option(\"pauseOnHover\")){const e=t.instance.container;e.addEventListener(\"mouseenter\",t.onMouseEnter,!1),e.addEventListener(\"mouseleave\",t.onMouseLeave,!1)}document.addEventListener(\"visibilitychange\",t.onVisibilityChange,!1),t.emit(\"start\")}}stop(){const t=this,e=t.state,i=t.instance.container;t.clear(),t.state=pt,i.removeEventListener(\"mouseenter\",t.onMouseEnter,!1),i.removeEventListener(\"mouseleave\",t.onMouseLeave,!1),document.removeEventListener(\"visibilitychange\",t.onVisibilityChange,!1),E(i,\"has-autoplay\"),e!==pt&&t.emit(\"stop\")}pause(){const t=this;t.state===dt&&(t.state=ut,t.clear(),t.emit(ut))}resume(){const t=this,e=t.instance;if(e.isInfinite||e.page!==e.pages.length-1)if(t.state!==dt){if(t.state===ut&&!t.inHover){const e=new Event(\"resume\",{bubbles:!0,cancelable:!0});t.emit(\"resume\",e),e.defaultPrevented||t.set()}}else t.set();else t.stop()}toggle(){this.state===dt||this.state===ut?this.stop():this.start()}attach(){const t=this,e=t.instance;e.on(\"ready\",t.onReady),e.on(\"Panzoom.startAnimation\",t.onChange),e.on(\"Panzoom.endAnimation\",t.onSettle),e.on(\"Panzoom.touchMove\",t.onChange)}detach(){const t=this,e=t.instance;e.off(\"ready\",t.onReady),e.off(\"Panzoom.startAnimation\",t.onChange),e.off(\"Panzoom.endAnimation\",t.onSettle),e.off(\"Panzoom.touchMove\",t.onChange),t.stop()}}Object.defineProperty(ft,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:{autoStart:!0,pauseOnHover:!0,progressParentEl:null,showProgress:!0,timeout:3e3}});class mt extends B{constructor(){super(...arguments),Object.defineProperty(this,\"ref\",{enumerable:!0,configurable:!0,writable:!0,value:null})}onPrepare(t){const e=t.carousel;if(!e)return;const i=t.container;i&&(e.options.Autoplay=u({autoStart:!1},this.option(\"Autoplay\")||{},{pauseOnHover:!1,timeout:this.option(\"timeout\"),progressParentEl:()=>this.option(\"progressParentEl\")||null,on:{start:()=>{t.emit(\"startSlideshow\")},set:e=>{var n;i.classList.add(\"has-slideshow\"),(null===(n=t.getSlide())||void 0===n?void 0:n.state)!==it.Ready&&e.pause()},stop:()=>{i.classList.remove(\"has-slideshow\"),t.isCompact||t.endIdle(),t.emit(\"endSlideshow\")},resume:(e,i)=>{var n,s,o;!i||!i.cancelable||(null===(n=t.getSlide())||void 0===n?void 0:n.state)===it.Ready&&(null===(o=null===(s=t.carousel)||void 0===s?void 0:s.panzoom)||void 0===o?void 0:o.isResting)||i.preventDefault()}}}),e.attachPlugins({Autoplay:ft}),this.ref=e.plugins.Autoplay)}onReady(t){const e=t.carousel,i=this.ref;e&&i&&this.option(\"playOnStart\")&&(e.isInfinite||e.page<e.pages.length-1)&&i.start()}onDone(t,e){const i=this.ref;if(!i)return;const n=e.panzoom;n&&n.on(\"startAnimation\",(()=>{t.isCurrentSlide(e)&&i.stop()})),t.isCurrentSlide(e)&&i.resume()}onKeydown(t,e){var i;const n=this.ref;n&&e===this.option(\"key\")&&\"BUTTON\"!==(null===(i=document.activeElement)||void 0===i?void 0:i.nodeName)&&n.toggle()}attach(){const t=this,e=t.instance;e.on(\"Carousel.init\",t.onPrepare),e.on(\"Carousel.ready\",t.onReady),e.on(\"done\",t.onDone),e.on(\"keydown\",t.onKeydown)}detach(){const t=this,e=t.instance;e.off(\"Carousel.init\",t.onPrepare),e.off(\"Carousel.ready\",t.onReady),e.off(\"done\",t.onDone),e.off(\"keydown\",t.onKeydown)}}Object.defineProperty(mt,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:{key:\" \",playOnStart:!1,progressParentEl:t=>{var e;return(null===(e=t.instance.container)||void 0===e?void 0:e.querySelector(\".fancybox__toolbar [data-fancybox-toggle-slideshow]\"))||t.instance.container},timeout:3e3}});const gt={classes:{container:\"f-thumbs f-carousel__thumbs\",viewport:\"f-thumbs__viewport\",track:\"f-thumbs__track\",slide:\"f-thumbs__slide\",isResting:\"is-resting\",isSelected:\"is-selected\",isLoading:\"is-loading\",hasThumbs:\"has-thumbs\"},minCount:2,parentEl:null,thumbTpl:'<button class=\"f-thumbs__slide__button\" tabindex=\"0\" type=\"button\" aria-label=\"{{GOTO}}\" data-carousel-index=\"%i\"><img class=\"f-thumbs__slide__img\" data-lazy-src=\"{{%s}}\" alt=\"\" /></button>',type:\"modern\"};var bt;!function(t){t[t.Init=0]=\"Init\",t[t.Ready=1]=\"Ready\",t[t.Hidden=2]=\"Hidden\",t[t.Disabled=3]=\"Disabled\"}(bt||(bt={}));let vt=class extends B{constructor(){super(...arguments),Object.defineProperty(this,\"type\",{enumerable:!0,configurable:!0,writable:!0,value:\"modern\"}),Object.defineProperty(this,\"container\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"track\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"carousel\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"panzoom\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"thumbWidth\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"thumbClipWidth\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"thumbHeight\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"thumbGap\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"thumbExtraGap\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"shouldCenter\",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,\"state\",{enumerable:!0,configurable:!0,writable:!0,value:bt.Init})}formatThumb(t,e){return this.instance.localize(e,[[\"%i\",t.index],[\"%d\",t.index+1],[\"%s\",t.thumbSrc||\"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\"]])}getSlides(){const t=[],e=this.option(\"thumbTpl\")||\"\";if(e)for(const i of this.instance.slides||[]){let n=\"\";i.type&&(n=`for-${i.type}`,i.type&&[\"video\",\"youtube\",\"vimeo\",\"html5video\"].includes(i.type)&&(n+=\" for-video\")),t.push({html:this.formatThumb(i,e),customClass:n})}return t}onInitSlide(t,e){const i=e.el;i&&(e.thumbSrc=i.dataset.thumbSrc||e.thumbSrc||\"\",e.thumbClipWidth=parseFloat(i.dataset.thumbClipWidth||\"\")||e.thumbClipWidth||0,e.thumbHeight=parseFloat(i.dataset.thumbHeight||\"\")||e.thumbHeight||0)}onInitSlides(){this.state===bt.Init&&this.build()}onRefreshM(){this.refreshModern()}onChangeM(){\"modern\"===this.type&&(this.shouldCenter=!0,this.centerModern())}onClickModern(t){t.preventDefault(),t.stopPropagation();const e=this.instance,i=e.page,n=t=>{if(t){const e=t.closest(\"[data-carousel-index]\");if(e)return parseInt(e.dataset.carouselIndex||\"\",10)||0}return-1},s=(t,e)=>{const i=document.elementFromPoint(t,e);return i?n(i):-1};let o=n(t.target);o<0&&(o=s(t.clientX+this.thumbGap,t.clientY),o===i&&(o=i-1)),o<0&&(o=s(t.clientX-this.thumbGap,t.clientY),o===i&&(o=i+1)),o<0&&(o=(e=>{let n=s(t.clientX-e,t.clientY),a=s(t.clientX+e,t.clientY);return o<0&&n===i&&(o=i+1),o<0&&a===i&&(o=i-1),o})(this.thumbExtraGap)),o===i?this.centerModern():o>-1&&o<e.pages.length&&e.slideTo(o)}onTransformM(){if(\"modern\"!==this.type)return;const{instance:t,container:e,track:i}=this,n=t.panzoom;if(!(e&&i&&n&&this.panzoom))return;o(e,this.cn(\"isResting\"),n.state!==g.Init&&n.isResting);const s=this.thumbGap,a=this.thumbExtraGap,r=this.thumbClipWidth;let l=0,c=0,h=0;for(const e of t.slides){let i=e.index,n=e.thumbSlideEl;if(!n)continue;o(n,this.cn(\"isSelected\"),i===t.page),c=1-Math.abs(t.getProgress(i)),n.style.setProperty(\"--progress\",c?c+\"\":\"\");const d=.5*((e.thumbWidth||0)-r);l+=s,l+=d,c&&(l-=c*(d+a)),n.style.setProperty(\"--shift\",l-s+\"\"),l+=d,c&&(l-=c*(d+a)),l-=s,0===i&&(h=a*c)}i&&(i.style.setProperty(\"--left\",h+\"\"),i.style.setProperty(\"--width\",l+h+s+a*c+\"\")),this.shouldCenter&&this.centerModern()}buildClassic(){const{container:t,track:e}=this,i=this.getSlides();if(!t||!e||!i)return;const n=new this.instance.constructor(t,u({track:e,infinite:!1,center:!0,fill:!0,dragFree:!0,slidesPerPage:1,transition:!1,Dots:!1,Navigation:!1,classes:{container:\"f-thumbs\",viewport:\"f-thumbs__viewport\",track:\"f-thumbs__track\",slide:\"f-thumbs__slide\"}},this.option(\"Carousel\")||{},{Sync:{target:this.instance},slides:i}));this.carousel=n,this.track=e,n.on(\"ready\",(()=>{this.emit(\"ready\")})),n.on(\"createSlide\",((t,e)=>{this.emit(\"createSlide\",e,e.el)}))}buildModern(){if(\"modern\"!==this.type)return;const{container:t,track:e,instance:i}=this,s=this.option(\"thumbTpl\")||\"\";if(!t||!e||!s)return;t.addEventListener(\"keydown\",(()=>{E(t,\"is-using-mouse\")})),S(t,\"is-horizontal\"),this.updateModern();for(const t of i.slides||[]){const i=document.createElement(\"div\");if(S(i,this.cn(\"slide\")),t.type){let e=`for-${t.type}`;[\"video\",\"youtube\",\"vimeo\",\"html5video\"].includes(t.type)&&(e+=\" for-video\"),S(i,e)}i.appendChild(n(this.formatThumb(t,s))),this.emit(\"createSlide\",t,i),t.thumbSlideEl=i,e.appendChild(i),this.resizeModernSlide(t)}const o=new i.constructor.Panzoom(t,{content:e,lockAxis:\"x\",zoom:!1,panOnlyZoomed:!1,bounds:()=>{let t=0,e=0,n=i.slides[0],s=i.slides[i.slides.length-1],o=i.slides[i.page];return n&&s&&o&&(e=-1*this.getModernThumbPos(0),0!==i.page&&(e+=.5*(n.thumbWidth||0)),t=-1*this.getModernThumbPos(i.slides.length-1),i.page!==i.slides.length-1&&(t+=(s.thumbWidth||0)-(o.thumbWidth||0)-.5*(s.thumbWidth||0))),{x:{min:t,max:e},y:{min:0,max:0}}}});o.on(\"touchStart\",((t,e)=>{this.shouldCenter=!1,S(this.container,\"is-using-mouse\")})),o.on(\"click\",((t,e)=>this.onClickModern(e))),o.on(\"ready\",(()=>{this.centerModern(),this.emit(\"ready\")})),o.on([\"afterTransform\",\"refresh\"],(t=>{this.lazyLoadModern()})),this.panzoom=o,this.refreshModern()}updateModern(){if(\"modern\"!==this.type)return;const{container:t}=this;t&&(this.thumbGap=parseFloat(getComputedStyle(t).getPropertyValue(\"--f-thumb-gap\"))||0,this.thumbExtraGap=parseFloat(getComputedStyle(t).getPropertyValue(\"--f-thumb-extra-gap\"))||0,this.thumbWidth=parseFloat(getComputedStyle(t).getPropertyValue(\"--f-thumb-width\"))||40,this.thumbClipWidth=parseFloat(getComputedStyle(t).getPropertyValue(\"--f-thumb-clip-width\"))||40,this.thumbHeight=parseFloat(getComputedStyle(t).getPropertyValue(\"--f-thumb-height\"))||40)}refreshModern(){var t;if(\"modern\"===this.type){this.updateModern();for(const t of this.instance.slides||[])this.resizeModernSlide(t);this.onTransformM(),null===(t=this.panzoom)||void 0===t||t.updateMetrics(!0),this.centerModern(0)}}centerModern(e){const i=this.instance,{container:n,panzoom:s}=this;if(!n||!s||s.state===g.Init)return;const o=i.page;let a=this.getModernThumbPos(o),r=a;for(let t=i.page-3;t<i.page+3;t++){if(t<0||t>i.pages.length-1||t===i.page)continue;const e=1-Math.abs(i.getProgress(t));e>0&&e<1&&(r+=e*(this.getModernThumbPos(t)-a))}let l=100;void 0===e&&(e=.2,i.inTransition.size>0&&(e=.12),Math.abs(-1*s.current.e-r)>s.containerRect.width&&(e=.5,l=0)),s.options.maxVelocity=l,s.applyChange({panX:t(-1*r-s.target.e,1e3),friction:null===i.prevPage?0:e})}lazyLoadModern(){const{instance:t,panzoom:e}=this;if(!e)return;const i=-1*e.current.e||0;let s=this.getModernThumbPos(t.page);if(e.state!==g.Init||0===s)for(const s of t.slides||[]){const t=s.thumbSlideEl;if(!t)continue;const o=t.querySelector(\"img[data-lazy-src]\"),a=s.index,r=this.getModernThumbPos(a),l=i-.5*e.containerRect.innerWidth,c=l+e.containerRect.innerWidth;if(!o||r<l||r>c)continue;let h=o.dataset.lazySrc;if(!h||!h.length)continue;if(delete o.dataset.lazySrc,o.src=h,o.complete)continue;S(t,this.cn(\"isLoading\"));const d=n(w);t.appendChild(d),o.addEventListener(\"load\",(()=>{t.offsetParent&&(t.classList.remove(this.cn(\"isLoading\")),d.remove())}),!1)}}resizeModernSlide(t){if(\"modern\"!==this.type)return;if(!t.thumbSlideEl)return;const e=t.thumbClipWidth&&t.thumbHeight?Math.round(this.thumbHeight*(t.thumbClipWidth/t.thumbHeight)):this.thumbWidth;t.thumbWidth=e}getModernThumbPos(e){const i=this.instance.slides[e],n=this.panzoom;if(!n||!n.contentRect.fitWidth)return 0;let s=n.containerRect.innerWidth,o=n.contentRect.width;2===this.instance.slides.length&&(e-=1,o=2*this.thumbClipWidth);let a=e*(this.thumbClipWidth+this.thumbGap)+this.thumbExtraGap+.5*(i.thumbWidth||0);return a-=o>s?.5*s:.5*o,t(a||0,1)}build(){const t=this.instance,e=t.container,i=this.option(\"minCount\")||0;if(i){let e=0;for(const i of t.slides||[])i.thumbSrc&&e++;if(e<i)return this.cleanup(),void(this.state=bt.Disabled)}const n=this.option(\"type\");if([\"modern\",\"classic\"].indexOf(n)<0)return void(this.state=bt.Disabled);this.type=n;const s=document.createElement(\"div\");S(s,this.cn(\"container\")),S(s,`is-${n}`);const o=this.option(\"parentEl\");o?o.appendChild(s):e.after(s),this.container=s,S(e,this.cn(\"hasThumbs\"));const a=document.createElement(\"div\");S(a,this.cn(\"track\")),s.appendChild(a),this.track=a,\"classic\"===n?this.buildClassic():this.buildModern(),this.state=bt.Ready}cleanup(){this.carousel&&this.carousel.destroy(),this.carousel=null,this.panzoom&&this.panzoom.destroy(),this.panzoom=null,this.container&&this.container.remove(),this.container=null,this.track=null,this.state=bt.Init,E(this.instance.container,this.cn(\"hasThumbs\"))}attach(){const t=this,e=t.instance;e.on(\"initSlide\",t.onInitSlide),e.state===F.Init?e.on(\"initSlides\",t.onInitSlides):t.onInitSlides(),e.on(\"Panzoom.afterTransform\",t.onTransformM),e.on(\"Panzoom.refresh\",t.onRefreshM),e.on(\"change\",t.onChangeM)}detach(){const t=this,e=t.instance;e.off(\"initSlide\",t.onInitSlide),e.off(\"initSlides\",t.onInitSlides),e.off(\"Panzoom.afterTransform\",t.onTransformM),e.off(\"Panzoom.refresh\",t.onRefreshM),e.off(\"change\",t.onChangeM),t.cleanup()}};Object.defineProperty(vt,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:gt});const yt=Object.assign(Object.assign({},gt),{key:\"t\",showOnStart:!0,parentEl:null}),wt=\"is-masked\",xt=\"aria-hidden\";class Et extends B{constructor(){super(...arguments),Object.defineProperty(this,\"ref\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"hidden\",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get isEnabled(){const t=this.ref;return t&&t.state!==bt.Disabled}get isHidden(){return this.hidden}onInit(){var t;const e=this,i=e.instance,n=i.carousel;if(e.ref||!n)return;const s=e.option(\"parentEl\")||i.footer||i.container;if(!s)return;const o=u({},e.options,{parentEl:s,classes:{container:\"f-thumbs fancybox__thumbs\"},Carousel:{Sync:{friction:i.option(\"Carousel.friction\")||0}},on:{ready:t=>{const i=t.container;i&&this.hidden&&(e.refresh(),i.style.transition=\"none\",e.hide(),i.offsetHeight,queueMicrotask((()=>{i.style.transition=\"\",e.show()})))}}});o.Carousel=o.Carousel||{},o.Carousel.on=u((null===(t=e.options.Carousel)||void 0===t?void 0:t.on)||{},{click:(t,e)=>{e.stopPropagation()}}),n.options.Thumbs=o,n.attachPlugins({Thumbs:vt}),e.ref=n.plugins.Thumbs,e.option(\"showOnStart\")||(e.ref.state=bt.Hidden,e.hidden=!0)}onResize(){var t;const e=null===(t=this.ref)||void 0===t?void 0:t.container;e&&(e.style.maxHeight=\"\")}onKeydown(t,e){const i=this.option(\"key\");i&&i===e&&this.toggle()}toggle(){const t=this.ref;t&&t.state!==bt.Disabled&&(t.state!==bt.Hidden?this.hidden?this.show():this.hide():t.build())}show(){const t=this.ref,e=t&&t.state!==bt.Disabled&&t.container;e&&(this.refresh(),e.offsetHeight,e.removeAttribute(xt),e.classList.remove(wt),this.hidden=!1)}hide(){const t=this.ref,e=t&&t.container;e&&(this.refresh(),e.offsetHeight,e.classList.add(wt),e.setAttribute(xt,\"true\")),this.hidden=!0}refresh(){const t=this.ref;if(!t||t.state===bt.Disabled)return;const e=t.container,i=(null==e?void 0:e.firstChild)||null;e&&i&&i.childNodes.length&&(e.style.maxHeight=`${i.getBoundingClientRect().height}px`)}attach(){const t=this,e=t.instance;e.state===et.Init?e.on(\"Carousel.init\",t.onInit):t.onInit(),e.on(\"resize\",t.onResize),e.on(\"keydown\",t.onKeydown)}detach(){var t;const e=this,i=e.instance;i.off(\"Carousel.init\",e.onInit),i.off(\"resize\",e.onResize),i.off(\"keydown\",e.onKeydown),null===(t=i.carousel)||void 0===t||t.detachPlugins([\"Thumbs\"]),e.ref=null}}Object.defineProperty(Et,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:yt});const St={panLeft:{icon:'<svg><path d=\"M5 12h14M5 12l6 6M5 12l6-6\"/></svg>',change:{panX:-100}},panRight:{icon:'<svg><path d=\"M5 12h14M13 18l6-6M13 6l6 6\"/></svg>',change:{panX:100}},panUp:{icon:'<svg><path d=\"M12 5v14M18 11l-6-6M6 11l6-6\"/></svg>',change:{panY:-100}},panDown:{icon:'<svg><path d=\"M12 5v14M18 13l-6 6M6 13l6 6\"/></svg>',change:{panY:100}},zoomIn:{icon:'<svg><circle cx=\"11\" cy=\"11\" r=\"7.5\"/><path d=\"m21 21-4.35-4.35M11 8v6M8 11h6\"/></svg>',action:\"zoomIn\"},zoomOut:{icon:'<svg><circle cx=\"11\" cy=\"11\" r=\"7.5\"/><path d=\"m21 21-4.35-4.35M8 11h6\"/></svg>',action:\"zoomOut\"},toggle1to1:{icon:'<svg><path d=\"M3.51 3.07c5.74.02 11.48-.02 17.22.02 1.37.1 2.34 1.64 2.18 3.13 0 4.08.02 8.16 0 12.23-.1 1.54-1.47 2.64-2.79 2.46-5.61-.01-11.24.02-16.86-.01-1.36-.12-2.33-1.65-2.17-3.14 0-4.07-.02-8.16 0-12.23.1-1.36 1.22-2.48 2.42-2.46Z\"/><path d=\"M5.65 8.54h1.49v6.92m8.94-6.92h1.49v6.92M11.5 9.4v.02m0 5.18v0\"/></svg>',action:\"toggleZoom\"},toggleZoom:{icon:'<svg><g><line x1=\"11\" y1=\"8\" x2=\"11\" y2=\"14\"></line></g><circle cx=\"11\" cy=\"11\" r=\"7.5\"/><path d=\"m21 21-4.35-4.35M8 11h6\"/></svg>',action:\"toggleZoom\"},iterateZoom:{icon:'<svg><g><line x1=\"11\" y1=\"8\" x2=\"11\" y2=\"14\"></line></g><circle cx=\"11\" cy=\"11\" r=\"7.5\"/><path d=\"m21 21-4.35-4.35M8 11h6\"/></svg>',action:\"iterateZoom\"},rotateCCW:{icon:'<svg><path d=\"M15 4.55a8 8 0 0 0-6 14.9M9 15v5H4M18.37 7.16v.01M13 19.94v.01M16.84 18.37v.01M19.37 15.1v.01M19.94 11v.01\"/></svg>',action:\"rotateCCW\"},rotateCW:{icon:'<svg><path d=\"M9 4.55a8 8 0 0 1 6 14.9M15 15v5h5M5.63 7.16v.01M4.06 11v.01M4.63 15.1v.01M7.16 18.37v.01M11 19.94v.01\"/></svg>',action:\"rotateCW\"},flipX:{icon:'<svg style=\"stroke-width: 1.3\"><path d=\"M12 3v18M16 7v10h5L16 7M8 7v10H3L8 7\"/></svg>',action:\"flipX\"},flipY:{icon:'<svg style=\"stroke-width: 1.3\"><path d=\"M3 12h18M7 16h10L7 21v-5M7 8h10L7 3v5\"/></svg>',action:\"flipY\"},fitX:{icon:'<svg><path d=\"M4 12V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v6M10 18H3M21 18h-7M6 15l-3 3 3 3M18 15l3 3-3 3\"/></svg>',action:\"fitX\"},fitY:{icon:'<svg><path d=\"M12 20H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h6M18 14v7M18 3v7M15 18l3 3 3-3M15 6l3-3 3 3\"/></svg>',action:\"fitY\"},reset:{icon:'<svg><path d=\"M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4\"/></svg>',action:\"reset\"},toggleFS:{icon:'<svg><g><path d=\"M14.5 9.5 21 3m0 0h-6m6 0v6M3 21l6.5-6.5M3 21v-6m0 6h6\"/></g><g><path d=\"m14 10 7-7m-7 7h6m-6 0V4M3 21l7-7m0 0v6m0-6H4\"/></g></svg>',action:\"toggleFS\"}};var Pt;!function(t){t[t.Init=0]=\"Init\",t[t.Ready=1]=\"Ready\",t[t.Disabled=2]=\"Disabled\"}(Pt||(Pt={}));const Ct={absolute:\"auto\",display:{left:[\"infobar\"],middle:[],right:[\"iterateZoom\",\"slideshow\",\"fullscreen\",\"thumbs\",\"close\"]},enabled:\"auto\",items:{infobar:{tpl:'<div class=\"fancybox__infobar\" tabindex=\"-1\"><span data-fancybox-current-index></span>/<span data-fancybox-count></span></div>'},download:{tpl:'<a class=\"f-button\" title=\"{{DOWNLOAD}}\" data-fancybox-download href=\"javasript:;\"><svg><path d=\"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2M7 11l5 5 5-5M12 4v12\"/></svg></a>'},prev:{tpl:'<button class=\"f-button\" title=\"{{PREV}}\" data-fancybox-prev><svg><path d=\"m15 6-6 6 6 6\"/></svg></button>'},next:{tpl:'<button class=\"f-button\" title=\"{{NEXT}}\" data-fancybox-next><svg><path d=\"m9 6 6 6-6 6\"/></svg></button>'},slideshow:{tpl:'<button class=\"f-button\" title=\"{{TOGGLE_SLIDESHOW}}\" data-fancybox-toggle-slideshow><svg><g><path d=\"M8 4v16l13 -8z\"></path></g><g><path d=\"M8 4v15M17 4v15\"/></g></svg></button>'},fullscreen:{tpl:'<button class=\"f-button\" title=\"{{TOGGLE_FULLSCREEN}}\" data-fancybox-toggle-fullscreen><svg><g><path d=\"M4 8V6a2 2 0 0 1 2-2h2M4 16v2a2 2 0 0 0 2 2h2M16 4h2a2 2 0 0 1 2 2v2M16 20h2a2 2 0 0 0 2-2v-2\"/></g><g><path d=\"M15 19v-2a2 2 0 0 1 2-2h2M15 5v2a2 2 0 0 0 2 2h2M5 15h2a2 2 0 0 1 2 2v2M5 9h2a2 2 0 0 0 2-2V5\"/></g></svg></button>'},thumbs:{tpl:'<button class=\"f-button\" title=\"{{TOGGLE_THUMBS}}\" data-fancybox-toggle-thumbs><svg><circle cx=\"5.5\" cy=\"5.5\" r=\"1\"/><circle cx=\"12\" cy=\"5.5\" r=\"1\"/><circle cx=\"18.5\" cy=\"5.5\" r=\"1\"/><circle cx=\"5.5\" cy=\"12\" r=\"1\"/><circle cx=\"12\" cy=\"12\" r=\"1\"/><circle cx=\"18.5\" cy=\"12\" r=\"1\"/><circle cx=\"5.5\" cy=\"18.5\" r=\"1\"/><circle cx=\"12\" cy=\"18.5\" r=\"1\"/><circle cx=\"18.5\" cy=\"18.5\" r=\"1\"/></svg></button>'},close:{tpl:'<button class=\"f-button\" title=\"{{CLOSE}}\" data-fancybox-close><svg><path d=\"m19.5 4.5-15 15M4.5 4.5l15 15\"/></svg></button>'}},parentEl:null},Mt={tabindex:\"-1\",width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",xmlns:\"http://www.w3.org/2000/svg\"};class Tt extends B{constructor(){super(...arguments),Object.defineProperty(this,\"state\",{enumerable:!0,configurable:!0,writable:!0,value:Pt.Init}),Object.defineProperty(this,\"container\",{enumerable:!0,configurable:!0,writable:!0,value:null})}onReady(t){var e;if(!t.carousel)return;let i=this.option(\"display\"),n=this.option(\"absolute\"),s=this.option(\"enabled\");if(\"auto\"===s){const t=this.instance.carousel;let e=0;if(t)for(const i of t.slides)(i.panzoom||\"image\"===i.type)&&e++;e||(s=!1)}s||(i=void 0);let o=0;const a={left:[],middle:[],right:[]};if(i)for(const t of[\"left\",\"middle\",\"right\"])for(const n of i[t]){const i=this.createEl(n);i&&(null===(e=a[t])||void 0===e||e.push(i),o++)}let r=null;if(o&&(r=this.createContainer()),r){for(const[t,e]of Object.entries(a)){const i=document.createElement(\"div\");S(i,\"fancybox__toolbar__column is-\"+t);for(const t of e)i.appendChild(t);\"auto\"!==n||\"middle\"!==t||e.length||(n=!0),r.appendChild(i)}!0===n&&S(r,\"is-absolute\"),this.state=Pt.Ready,this.onRefresh()}else this.state=Pt.Disabled}onClick(t){var e,i;const n=this.instance,s=n.getSlide(),o=null==s?void 0:s.panzoom,a=t.target,r=a&&x(a)?a.dataset:null;if(!r)return;if(void 0!==r.fancyboxToggleThumbs)return t.preventDefault(),t.stopPropagation(),void(null===(e=n.plugins.Thumbs)||void 0===e||e.toggle());if(void 0!==r.fancyboxToggleFullscreen)return t.preventDefault(),t.stopPropagation(),void this.instance.toggleFullscreen();if(void 0!==r.fancyboxToggleSlideshow){t.preventDefault(),t.stopPropagation();const e=null===(i=n.carousel)||void 0===i?void 0:i.plugins.Autoplay;let s=e.isActive;return o&&\"mousemove\"===o.panMode&&!s&&o.reset(),void(s?e.stop():e.start())}const l=r.panzoomAction,c=r.panzoomChange;if((c||l)&&(t.preventDefault(),t.stopPropagation()),c){let t={};try{t=JSON.parse(c)}catch(t){}o&&o.applyChange(t)}else l&&o&&o[l]&&o[l]()}onChange(){this.onRefresh()}onRefresh(){if(this.instance.isClosing())return;const t=this.container;if(!t)return;const e=this.instance.getSlide();if(!e||e.state!==it.Ready)return;const i=e&&!e.error&&e.panzoom;for(const e of t.querySelectorAll(\"[data-panzoom-action]\"))i?(e.removeAttribute(\"disabled\"),e.removeAttribute(\"tabindex\")):(e.setAttribute(\"disabled\",\"\"),e.setAttribute(\"tabindex\",\"-1\"));let n=i&&i.canZoomIn(),s=i&&i.canZoomOut();for(const e of t.querySelectorAll('[data-panzoom-action=\"zoomIn\"]'))n?(e.removeAttribute(\"disabled\"),e.removeAttribute(\"tabindex\")):(e.setAttribute(\"disabled\",\"\"),e.setAttribute(\"tabindex\",\"-1\"));for(const e of t.querySelectorAll('[data-panzoom-action=\"zoomOut\"]'))s?(e.removeAttribute(\"disabled\"),e.removeAttribute(\"tabindex\")):(e.setAttribute(\"disabled\",\"\"),e.setAttribute(\"tabindex\",\"-1\"));for(const e of t.querySelectorAll('[data-panzoom-action=\"toggleZoom\"],[data-panzoom-action=\"iterateZoom\"]')){s||n?(e.removeAttribute(\"disabled\"),e.removeAttribute(\"tabindex\")):(e.setAttribute(\"disabled\",\"\"),e.setAttribute(\"tabindex\",\"-1\"));const t=e.querySelector(\"g\");t&&(t.style.display=n?\"\":\"none\")}}onDone(t,e){var i;null===(i=e.panzoom)||void 0===i||i.on(\"afterTransform\",(()=>{this.instance.isCurrentSlide(e)&&this.onRefresh()})),this.instance.isCurrentSlide(e)&&this.onRefresh()}createContainer(){const t=this.instance.container;if(!t)return null;const e=this.option(\"parentEl\")||t,i=document.createElement(\"div\");return S(i,\"fancybox__toolbar\"),e.prepend(i),i.addEventListener(\"click\",this.onClick,{passive:!1,capture:!0}),t&&S(t,\"has-toolbar\"),this.container=i,i}createEl(t){const e=this.instance,i=e.carousel;if(!i)return null;if(\"toggleFS\"===t)return null;if(\"fullscreen\"===t&&!e.fsAPI)return null;let s=null;const o=i.slides.length||0;let a=0,r=0;for(const t of i.slides)(t.panzoom||\"image\"===t.type)&&a++,(\"image\"===t.type||t.downloadSrc)&&r++;if(o<2&&[\"infobar\",\"prev\",\"next\"].includes(t))return s;if(void 0!==St[t]&&!a)return null;if(\"download\"===t&&!r)return null;if(\"thumbs\"===t){const t=e.plugins.Thumbs;if(!t||!t.isEnabled)return null}if(\"slideshow\"===t){if(!i.plugins.Autoplay||o<2)return null}if(void 0!==St[t]){const e=St[t];s=document.createElement(\"button\"),s.setAttribute(\"title\",this.instance.localize(`{{${t.toUpperCase()}}}`)),S(s,\"f-button\"),e.action&&(s.dataset.panzoomAction=e.action),e.change&&(s.dataset.panzoomChange=JSON.stringify(e.change)),s.appendChild(n(this.instance.localize(e.icon)))}else{const e=(this.option(\"items\")||[])[t];e&&(s=n(this.instance.localize(e.tpl)),\"function\"==typeof e.click&&s.addEventListener(\"click\",(t=>{t.preventDefault(),t.stopPropagation(),\"function\"==typeof e.click&&e.click.call(this,this,t)})))}const l=null==s?void 0:s.querySelector(\"svg\");if(l)for(const[t,e]of Object.entries(Mt))l.getAttribute(t)||l.setAttribute(t,String(e));return s}removeContainer(){const t=this.container;t&&t.remove(),this.container=null,this.state=Pt.Disabled;const e=this.instance.container;e&&E(e,\"has-toolbar\")}attach(){const t=this,e=t.instance;e.on(\"Carousel.initSlides\",t.onReady),e.on(\"done\",t.onDone),e.on(\"reveal\",t.onChange),e.on(\"Carousel.change\",t.onChange),t.onReady(t.instance)}detach(){const t=this,e=t.instance;e.off(\"Carousel.initSlides\",t.onReady),e.off(\"done\",t.onDone),e.off(\"reveal\",t.onChange),e.off(\"Carousel.change\",t.onChange),t.removeContainer()}}Object.defineProperty(Tt,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:Ct});const Ot={Hash:st,Html:ht,Images:at,Slideshow:mt,Thumbs:Et,Toolbar:Tt},At=\"with-fancybox\",zt=\"hide-scrollbar\",Lt=\"--fancybox-scrollbar-compensate\",Rt=\"--fancybox-body-margin\",kt=\"is-animated\",It=\"is-compact\",Dt=\"is-loading\",Ft=function(){var t=window.getSelection();return t&&\"Range\"===t.type};let jt=null,Ht=null;const Bt=new Map;let Nt=0;class _t extends m{get isIdle(){return this.idle}get isCompact(){return this.option(\"compact\")}constructor(t=[],e={},i={}){super(e),Object.defineProperty(this,\"userSlides\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"userPlugins\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"idle\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"idleTimer\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"clickTimer\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"pwt\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"ignoreFocusChange\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"state\",{enumerable:!0,configurable:!0,writable:!0,value:et.Init}),Object.defineProperty(this,\"id\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"container\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"footer\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"caption\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"carousel\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"lastFocus\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"prevMouseMoveEvent\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"fsAPI\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.fsAPI=(()=>{let t,e=\"\",i=\"\",n=\"\";return document.fullscreenEnabled?(e=\"requestFullscreen\",i=\"exitFullscreen\",n=\"fullscreenElement\"):document.webkitFullscreenEnabled&&(e=\"webkitRequestFullscreen\",i=\"webkitExitFullscreen\",n=\"webkitFullscreenElement\"),e&&(t={request:function(t){return\"webkitRequestFullscreen\"===e?t[e](Element.ALLOW_KEYBOARD_INPUT):t[e]()},exit:function(){return document[n]&&document[i]()},isFullscreen:function(){return document[n]}}),t})(),this.id=e.id||++Nt,Bt.set(this.id,this),this.userSlides=t,this.userPlugins=i,queueMicrotask((()=>{this.init()}))}init(){if(this.state===et.Destroy)return;this.state=et.Init,this.attachPlugins(Object.assign(Object.assign({},_t.Plugins),this.userPlugins)),this.emit(\"init\"),!0===this.option(\"hideScrollbar\")&&(()=>{if(!G)return;const t=document.body;if(t.classList.contains(zt))return;let e=window.innerWidth-document.documentElement.getBoundingClientRect().width;e<0&&(e=0);const i=t.currentStyle||window.getComputedStyle(t),n=parseFloat(i.marginRight);document.documentElement.style.setProperty(Lt,`${e}px`),n&&t.style.setProperty(Rt,`${n}px`),t.classList.add(zt)})(),this.initLayout(),this.scale();const t=()=>{this.initCarousel(this.userSlides),this.state=et.Ready,this.attachEvents(),this.emit(\"ready\"),setTimeout((()=>{this.container&&this.container.setAttribute(\"aria-hidden\",\"false\")}),16)},e=this.fsAPI;this.option(\"Fullscreen.autoStart\")&&e&&!e.isFullscreen()?e.request(this.container).then((()=>t())).catch((()=>t())):t()}initLayout(){var t,e;const i=this.option(\"parentEl\")||document.body,s=n(this.localize(this.option(\"tpl.main\")||\"\"));s&&(s.setAttribute(\"id\",`fancybox-${this.id}`),s.setAttribute(\"aria-label\",this.localize(\"{{MODAL}}\")),s.classList.toggle(It,this.isCompact),S(s,this.option(\"mainClass\")||\"\"),this.container=s,this.footer=s.querySelector(\".fancybox__footer\"),i.appendChild(s),S(document.documentElement,At),jt&&Ht||(jt=document.createElement(\"span\"),S(jt,\"fancybox-focus-guard\"),jt.setAttribute(\"tabindex\",\"0\"),jt.setAttribute(\"aria-hidden\",\"true\"),jt.setAttribute(\"aria-label\",\"Focus guard\"),Ht=jt.cloneNode(),null===(t=s.parentElement)||void 0===t||t.insertBefore(jt,s),null===(e=s.parentElement)||void 0===e||e.append(Ht)),this.option(\"animated\")&&(S(s,kt),setTimeout((()=>{this.isClosing()||E(s,kt)}),350)),this.emit(\"initLayout\"))}initCarousel(t){const i=this.container;if(!i)return;const n=i.querySelector(\".fancybox__carousel\");if(!n)return;const s=this.carousel=new Z(n,u({},{slides:t,transition:\"fade\",Panzoom:{lockAxis:this.option(\"dragToClose\")?\"xy\":\"x\",infinite:!!this.option(\"dragToClose\")&&\"y\"},Dots:!1,Navigation:{classes:{container:\"fancybox__nav\",button:\"f-button\",isNext:\"is-next\",isPrev:\"is-prev\"}},initialPage:this.option(\"startIndex\"),l10n:this.option(\"l10n\")},this.option(\"Carousel\")||{}));s.on(\"*\",((t,e,...i)=>{this.emit(`Carousel.${e}`,t,...i)})),s.on([\"ready\",\"change\"],(()=>{var t;const e=this.getSlide();e&&(null===(t=e.panzoom)||void 0===t||t.updateControls()),this.manageCaption(e)})),this.on(\"Carousel.removeSlide\",((t,e,i)=>{i.contentEl&&(i.contentEl.remove(),i.contentEl=void 0);const n=i.el;n&&(E(n,\"has-error\"),E(n,\"has-unknown\"),E(n,`has-${i.type||\"unknown\"}`)),i.closeBtnEl&&i.closeBtnEl.remove(),i.closeBtnEl=void 0,i.captionEl&&i.captionEl.remove(),i.captionEl=void 0,i.spinnerEl&&i.spinnerEl.remove(),i.spinnerEl=void 0,i.state=void 0})),s.on(\"Panzoom.touchStart\",(()=>{var t,e;this.isCompact||this.endIdle(),(null===(t=document.activeElement)||void 0===t?void 0:t.closest(\".f-thumbs\"))&&(null===(e=this.container)||void 0===e||e.focus())})),s.on(\"settle\",(()=>{this.idleTimer||this.isCompact||!this.option(\"idle\")||this.setIdle(),this.option(\"autoFocus\")&&!this.isClosing&&this.checkFocus()})),this.option(\"dragToClose\")&&(s.on(\"Panzoom.afterTransform\",((t,i)=>{const n=this.getSlide();if(n&&e(n.el))return;const s=this.container;if(s){const t=Math.abs(i.current.f),e=t<1?\"\":Math.max(.5,Math.min(1,1-t/i.contentRect.fitHeight*1.5));s.style.setProperty(\"--fancybox-ts\",e?\"0s\":\"\"),s.style.setProperty(\"--fancybox-opacity\",e+\"\")}})),s.on(\"Panzoom.touchEnd\",((t,i,n)=>{var s;const o=this.getSlide();if(o&&e(o.el))return;if(i.isMobile&&document.activeElement&&-1!==[\"TEXTAREA\",\"INPUT\"].indexOf(null===(s=document.activeElement)||void 0===s?void 0:s.nodeName))return;const a=Math.abs(i.dragOffset.y);\"y\"===i.lockedAxis&&(a>=200||a>=50&&i.dragOffset.time<300)&&(n&&n.cancelable&&n.preventDefault(),this.close(n,\"f-throwOut\"+(i.current.f<0?\"Up\":\"Down\")))}))),s.on(\"change\",(t=>{var e;let i=null===(e=this.getSlide())||void 0===e?void 0:e.triggerEl;if(i){const e=new CustomEvent(\"slideTo\",{bubbles:!0,cancelable:!0,detail:t.page});i.dispatchEvent(e)}})),s.on([\"refresh\",\"change\"],(t=>{const e=this.container;if(!e)return;for(const i of e.querySelectorAll(\"[data-fancybox-current-index]\"))i.innerHTML=t.page+1;for(const i of e.querySelectorAll(\"[data-fancybox-count]\"))i.innerHTML=t.pages.length;if(!t.isInfinite){for(const i of e.querySelectorAll(\"[data-fancybox-next]\"))t.page<t.pages.length-1?(i.removeAttribute(\"disabled\"),i.removeAttribute(\"tabindex\")):(i.setAttribute(\"disabled\",\"\"),i.setAttribute(\"tabindex\",\"-1\"));for(const i of e.querySelectorAll(\"[data-fancybox-prev]\"))t.page>0?(i.removeAttribute(\"disabled\"),i.removeAttribute(\"tabindex\")):(i.setAttribute(\"disabled\",\"\"),i.setAttribute(\"tabindex\",\"-1\"))}const i=this.getSlide();if(!i)return;let n=i.downloadSrc||\"\";n||\"image\"!==i.type||i.error||\"string\"!=typeof i.src||(n=i.src);const s=\"disabled\",o=\"tabindex\",a=\"download\",r=\"href\";for(const t of e.querySelectorAll(\"[data-fancybox-download]\")){const e=i.downloadFilename;n?(t.removeAttribute(s),t.removeAttribute(o),t.setAttribute(r,n),t.setAttribute(a,e||n),t.setAttribute(\"target\",\"_blank\")):(t.setAttribute(s,\"\"),t.setAttribute(o,\"-1\"),t.removeAttribute(r),t.removeAttribute(a))}})),this.emit(\"initCarousel\")}attachEvents(){const t=this,e=t.container;if(!e)return;e.addEventListener(\"click\",t.onClick,{passive:!1,capture:!1}),e.addEventListener(\"wheel\",t.onWheel,{passive:!1,capture:!1}),document.addEventListener(\"keydown\",t.onKeydown,{passive:!1,capture:!0}),document.addEventListener(\"visibilitychange\",t.onVisibilityChange,!1),document.addEventListener(\"mousemove\",t.onMousemove),t.option(\"trapFocus\")&&document.addEventListener(\"focus\",t.onFocus,!0),window.addEventListener(\"resize\",t.onResize);const i=window.visualViewport;i&&(i.addEventListener(\"scroll\",t.onResize),i.addEventListener(\"resize\",t.onResize))}detachEvents(){const t=this,e=t.container;if(!e)return;document.removeEventListener(\"keydown\",t.onKeydown,{passive:!1,capture:!0}),e.removeEventListener(\"wheel\",t.onWheel,{passive:!1,capture:!1}),e.removeEventListener(\"click\",t.onClick,{passive:!1,capture:!1}),document.removeEventListener(\"mousemove\",t.onMousemove),window.removeEventListener(\"resize\",t.onResize);const i=window.visualViewport;i&&(i.removeEventListener(\"resize\",t.onResize),i.removeEventListener(\"scroll\",t.onResize)),document.removeEventListener(\"visibilitychange\",t.onVisibilityChange,!1),document.removeEventListener(\"focus\",t.onFocus,!0)}scale(){const t=this.container;if(!t)return;const e=window.visualViewport,i=Math.max(1,(null==e?void 0:e.scale)||1);let n=\"\",s=\"\",o=\"\";if(e&&i>1){let t=`${e.offsetLeft}px`,a=`${e.offsetTop}px`;n=e.width*i+\"px\",s=e.height*i+\"px\",o=`translate3d(${t}, ${a}, 0) scale(${1/i})`}t.style.transform=o,t.style.width=n,t.style.height=s}onClick(t){var e,i;const{container:n,isCompact:s}=this;if(!n||this.isClosing())return;!s&&this.option(\"idle\")&&this.resetIdle();const o=document.activeElement;if(Ft()&&o&&n.contains(o))return;const a=t.composedPath()[0];if(a===(null===(e=this.carousel)||void 0===e?void 0:e.container))return;if(a.closest(\".f-spinner\")||a.closest(\"[data-fancybox-close]\"))return t.preventDefault(),void this.close(t);if(a.closest(\"[data-fancybox-prev]\"))return t.preventDefault(),void this.prev();if(a.closest(\"[data-fancybox-next]\"))return t.preventDefault(),void this.next();if(s&&\"image\"===(null===(i=this.getSlide())||void 0===i?void 0:i.type))return void(this.clickTimer?(clearTimeout(this.clickTimer),this.clickTimer=null):this.clickTimer=setTimeout((()=>{this.toggleIdle(),this.clickTimer=null}),350));if(this.emit(\"click\",t),t.defaultPrevented)return;let r=!1;if(a.closest(\".fancybox__content\")){if(o){if(o.closest(\"[contenteditable]\"))return;a.matches(J)||o.blur()}if(Ft())return;r=this.option(\"contentClick\")}else a.closest(\".fancybox__carousel\")&&!a.matches(J)&&(r=this.option(\"backdropClick\"));\"close\"===r?(t.preventDefault(),this.close(t)):\"next\"===r?(t.preventDefault(),this.next()):\"prev\"===r&&(t.preventDefault(),this.prev())}onWheel(t){var e;let i=this.option(\"wheel\",t);(null===(e=t.target)||void 0===e?void 0:e.closest(\".fancybox__thumbs\"))&&(i=\"slide\");const n=\"slide\"===i,s=[-t.deltaX||0,-t.deltaY||0,-t.detail||0].reduce((function(t,e){return Math.abs(e)>Math.abs(t)?e:t})),o=Math.max(-1,Math.min(1,s)),a=Date.now();this.pwt&&a-this.pwt<300?n&&t.preventDefault():(this.pwt=a,this.emit(\"wheel\",t),t.defaultPrevented||(\"close\"===i?(t.preventDefault(),this.close(t)):\"slide\"===i&&(t.preventDefault(),this[o>0?\"prev\":\"next\"]())))}onKeydown(t){if(!this.isTopmost())return;this.isCompact||!this.option(\"idle\")||this.isClosing()||this.resetIdle();const e=t.key,i=this.option(\"keyboard\");if(!i||t.ctrlKey||t.altKey||t.shiftKey)return;const n=t.composedPath()[0],s=document.activeElement&&document.activeElement.classList,o=s&&s.contains(\"f-button\")||n.dataset.carouselPage||n.dataset.carouselIndex;if(\"Escape\"!==e&&!o&&x(n)){if(n.isContentEditable||-1!==[\"TEXTAREA\",\"OPTION\",\"INPUT\",\"SELECT\",\"VIDEO\"].indexOf(n.nodeName))return}this.emit(\"keydown\",e,t);const a=i[e];\"function\"==typeof this[a]&&(t.preventDefault(),this[a]())}onResize(){const t=It,e=this.container;if(!e)return;const i=this.isCompact;e.classList.toggle(t,i),this.manageCaption(this.getSlide()),this.isCompact?this.clearIdle():this.endIdle(),this.scale(),this.emit(\"resize\")}onFocus(t){this.isTopmost()&&this.checkFocus(t)}onMousemove(t){this.prevMouseMoveEvent=t,!this.isCompact&&this.option(\"idle\")&&this.resetIdle()}onVisibilityChange(){\"visible\"===document.visibilityState?this.checkFocus():this.endIdle()}manageCloseBtn(t){const e=this.optionFor(t,\"closeButton\")||!1;if(\"auto\"===e){const t=this.plugins.Toolbar;if(t&&t.state===Pt.Ready)return}if(!e)return;if(!t.contentEl||t.closeBtnEl)return;const i=this.option(\"tpl.closeButton\");if(i){const e=n(this.localize(i));t.closeBtnEl=t.contentEl.appendChild(e),t.el&&S(t.el,\"has-close-btn\")}}manageCaption(t=void 0){var e,i;const n=\"fancybox__caption\",s=\"has-caption\",o=this.container;if(!o)return;const a=this.isCompact||this.option(\"commonCaption\"),r=!a;if(this.caption&&this.stop(this.caption),r&&this.caption&&(this.caption.remove(),this.caption=null),a&&!this.caption)for(const t of(null===(e=this.carousel)||void 0===e?void 0:e.slides)||[])t.captionEl&&(t.captionEl.remove(),t.captionEl=void 0,E(t.el,s),null===(i=t.el)||void 0===i||i.removeAttribute(\"aria-labelledby\"));if(t||(t=this.getSlide()),!t||a&&!this.isCurrentSlide(t))return;const l=t.el;let c=this.optionFor(t,\"caption\",\"\");if(!c)return void(a&&this.caption&&this.animate(this.caption,\"f-fadeOut\",(()=>{this.caption&&(this.caption.innerHTML=\"\")})));let h=null;if(r){if(h=t.captionEl||null,l&&!h){const e=n+`_${this.id}_${t.index}`;h=document.createElement(\"div\"),S(h,n),h.setAttribute(\"id\",e),t.captionEl=l.appendChild(h),S(l,s),l.setAttribute(\"aria-labelledby\",e)}}else{if(h=this.caption,h||(h=o.querySelector(\".\"+n)),!h){h=document.createElement(\"div\"),h.dataset.fancyboxCaption=\"\",S(h,n);(this.footer||o).prepend(h)}S(o,s),this.caption=h}h&&(h.innerHTML=\"\",\"string\"==typeof c?h.innerHTML=c:c instanceof HTMLElement&&h.appendChild(c))}checkFocus(t){var e;const i=document.activeElement||null;i&&(null===(e=this.container)||void 0===e?void 0:e.contains(i))||this.focus(t)}focus(t){var e;if(this.ignoreFocusChange)return;const i=document.activeElement||null,n=(null==t?void 0:t.target)||null,s=this.container,o=this.getSlide();if(!s||!(null===(e=this.carousel)||void 0===e?void 0:e.viewport))return;if(!t&&i&&s.contains(i))return;const a=o&&o.state===it.Ready?o.el:null;if(!a||a.contains(i)||s===i)return;t&&t.cancelable&&t.preventDefault(),this.ignoreFocusChange=!0;const r=Array.from(s.querySelectorAll(J));let l=[],c=null;for(let t of r){const e=!t.offsetParent||t.closest('[aria-hidden=\"true\"]'),i=a&&a.contains(t),n=!this.carousel.viewport.contains(t);if(t===s||(i||n)&&!e){l.push(t);const e=t.dataset.origTabindex;void 0!==e&&e&&(t.tabIndex=parseFloat(e)),t.removeAttribute(\"data-orig-tabindex\"),!t.hasAttribute(\"autoFocus\")&&c||(c=t)}else{const e=void 0===t.dataset.origTabindex?t.getAttribute(\"tabindex\")||\"\":t.dataset.origTabindex;e&&(t.dataset.origTabindex=e),t.tabIndex=-1}}let h=null;t?(!n||l.indexOf(n)<0)&&(h=c||s,l.length&&(i===Ht?h=l[0]:this.lastFocus!==s&&i!==jt||(h=l[l.length-1]))):h=o&&\"image\"===o.type?s:c||s,h&&Q(h),this.lastFocus=document.activeElement,this.ignoreFocusChange=!1}next(){const t=this.carousel;t&&t.pages.length>1&&t.slideNext()}prev(){const t=this.carousel;t&&t.pages.length>1&&t.slidePrev()}jumpTo(...t){this.carousel&&this.carousel.slideTo(...t)}isTopmost(){var t;return(null===(t=_t.getInstance())||void 0===t?void 0:t.id)==this.id}animate(t=null,e=\"\",i){if(!t||!e)return void(i&&i());this.stop(t);const n=s=>{s.target===t&&t.dataset.animationName&&(t.removeEventListener(\"animationend\",n),delete t.dataset.animationName,i&&i(),E(t,e))};t.dataset.animationName=e,t.addEventListener(\"animationend\",n),S(t,e)}stop(t){t&&t.dispatchEvent(new CustomEvent(\"animationend\",{bubbles:!1,cancelable:!0,currentTarget:t}))}setContent(t,e=\"\",i=!0){if(this.isClosing())return;const s=t.el;if(!s)return;let o=null;if(x(e)?o=e:(o=n(e+\"\"),x(o)||(o=document.createElement(\"div\"),o.innerHTML=e+\"\")),[\"img\",\"picture\",\"iframe\",\"video\",\"audio\"].includes(o.nodeName.toLowerCase())){const t=document.createElement(\"div\");t.appendChild(o),o=t}x(o)&&t.filter&&!t.error&&(o=o.querySelector(t.filter)),o&&x(o)?(S(o,\"fancybox__content\"),t.id&&o.setAttribute(\"id\",t.id),\"none\"!==o.style.display&&\"none\"!==getComputedStyle(o).getPropertyValue(\"display\")||(o.style.display=t.display||this.option(\"defaultDisplay\")||\"flex\"),s.classList.add(`has-${t.error?\"error\":t.type||\"unknown\"}`),s.prepend(o),t.contentEl=o,i&&this.revealContent(t),this.manageCloseBtn(t),this.manageCaption(t)):this.setError(t,\"{{ELEMENT_NOT_FOUND}}\")}revealContent(t,e){const i=t.el,n=t.contentEl;i&&n&&(this.emit(\"reveal\",t),this.hideLoading(t),t.state=it.Opening,(e=this.isOpeningSlide(t)?void 0===e?this.optionFor(t,\"showClass\"):e:\"f-fadeIn\")?this.animate(n,e,(()=>{this.done(t)})):this.done(t))}done(t){this.isClosing()||(t.state=it.Ready,this.emit(\"done\",t),S(t.el,\"is-done\"),this.isCurrentSlide(t)&&this.option(\"autoFocus\")&&queueMicrotask((()=>{this.option(\"autoFocus\")&&(this.option(\"autoFocus\")?this.focus():this.checkFocus())})),this.isOpeningSlide(t)&&!this.isCompact&&this.option(\"idle\")&&this.setIdle())}isCurrentSlide(t){const e=this.getSlide();return!(!t||!e)&&e.index===t.index}isOpeningSlide(t){var e,i;return null===(null===(e=this.carousel)||void 0===e?void 0:e.prevPage)&&t.index===(null===(i=this.getSlide())||void 0===i?void 0:i.index)}showLoading(t){t.state=it.Loading;const e=t.el;if(!e)return;S(e,Dt),this.emit(\"loading\",t),t.spinnerEl||setTimeout((()=>{if(!this.isClosing()&&!t.spinnerEl&&t.state===it.Loading){let i=n(w);t.spinnerEl=i,e.prepend(i),this.animate(i,\"f-fadeIn\")}}),250)}hideLoading(t){const e=t.el;if(!e)return;const i=t.spinnerEl;this.isClosing()?null==i||i.remove():(E(e,Dt),i&&this.animate(i,\"f-fadeOut\",(()=>{i.remove()})),t.state===it.Loading&&(this.emit(\"loaded\",t),t.state=it.Ready))}setError(t,e){if(this.isClosing())return;const i=new Event(\"error\",{bubbles:!0,cancelable:!0});if(this.emit(\"error\",i,t),i.defaultPrevented)return;t.error=e,this.hideLoading(t),this.clearContent(t);const n=document.createElement(\"div\");n.classList.add(\"fancybox-error\"),n.innerHTML=this.localize(e||\"<p>{{ERROR}}</p>\"),this.setContent(t,n)}clearContent(t){var e;null===(e=this.carousel)||void 0===e||e.emit(\"removeSlide\",t)}getSlide(){var t;const e=this.carousel;return(null===(t=null==e?void 0:e.pages[null==e?void 0:e.page])||void 0===t?void 0:t.slides[0])||void 0}close(t,e){if(this.isClosing())return;const i=new Event(\"shouldClose\",{bubbles:!0,cancelable:!0});if(this.emit(\"shouldClose\",i,t),i.defaultPrevented)return;t&&t.cancelable&&(t.preventDefault(),t.stopPropagation());const n=this.fsAPI,s=()=>{this.proceedClose(t,e)};n&&n.isFullscreen()?Promise.resolve(n.exit()).then((()=>s())):s()}clearIdle(){this.idleTimer&&clearTimeout(this.idleTimer),this.idleTimer=null}setIdle(t=!1){const e=()=>{this.clearIdle(),this.idle=!0,S(this.container,\"is-idle\"),this.emit(\"setIdle\")};if(this.clearIdle(),!this.isClosing())if(t)e();else{const t=this.option(\"idle\");t&&(this.idleTimer=setTimeout(e,t))}}endIdle(){this.clearIdle(),this.idle&&!this.isClosing()&&(this.idle=!1,E(this.container,\"is-idle\"),this.emit(\"endIdle\"))}resetIdle(){this.endIdle(),this.setIdle()}toggleIdle(){this.idle?this.endIdle():this.setIdle(!0)}toggleFullscreen(){const t=this.fsAPI;t&&(t.isFullscreen()?t.exit():this.container&&t.request(this.container))}isClosing(){return[et.Closing,et.CustomClosing,et.Destroy].includes(this.state)}proceedClose(t,e){var i,n;this.state=et.Closing,this.clearIdle(),this.detachEvents();const s=this.container,o=this.carousel,a=this.getSlide(),r=a&&this.option(\"placeFocusBack\")?a.triggerEl||this.option(\"triggerEl\"):null;if(r&&(U(r)?Q(r):r.focus()),s&&(S(s,\"is-closing\"),s.setAttribute(\"aria-hidden\",\"true\"),this.option(\"animated\")&&S(s,kt),s.style.pointerEvents=\"none\"),o){o.clearTransitions(),null===(i=o.panzoom)||void 0===i||i.destroy(),null===(n=o.plugins.Navigation)||void 0===n||n.detach();for(const t of o.slides){t.state=it.Closing,this.hideLoading(t);const e=t.contentEl;e&&this.stop(e);const i=null==t?void 0:t.panzoom;i&&(i.stop(),i.detachEvents(),i.detachObserver()),this.isCurrentSlide(t)||o.emit(\"removeSlide\",t)}}this.emit(\"close\",t),this.state!==et.CustomClosing?(void 0===e&&a&&(e=this.optionFor(a,\"hideClass\")),e&&a?(this.animate(a.contentEl,e,(()=>{o&&o.emit(\"removeSlide\",a)})),setTimeout((()=>{this.destroy()}),500)):this.destroy()):setTimeout((()=>{this.destroy()}),500)}destroy(){var t;if(this.state===et.Destroy)return;this.state=et.Destroy,null===(t=this.carousel)||void 0===t||t.destroy();const e=this.container;e&&e.remove(),Bt.delete(this.id);const i=_t.getInstance();i?i.focus():(jt&&(jt.remove(),jt=null),Ht&&(Ht.remove(),Ht=null),E(document.documentElement,At),(()=>{if(!G)return;const t=document,e=t.body;e.classList.remove(zt),e.style.setProperty(Rt,\"\"),t.documentElement.style.setProperty(Lt,\"\")})(),this.emit(\"destroy\"))}static bind(t,e,i){if(!G)return;let n,s=\"\",o={};if(void 0===t?n=document.body:\"string\"==typeof t?(n=document.body,s=t,\"object\"==typeof e&&(o=e||{})):(n=t,\"string\"==typeof e&&(s=e),\"object\"==typeof i&&(o=i||{})),!n||!x(n))return;s=s||\"[data-fancybox]\";const a=_t.openers.get(n)||new Map;a.set(s,o),_t.openers.set(n,a),1===a.size&&n.addEventListener(\"click\",_t.fromEvent)}static unbind(t,e){let i,n=\"\";if(\"string\"==typeof t?(i=document.body,n=t):(i=t,\"string\"==typeof e&&(n=e)),!i)return;const s=_t.openers.get(i);s&&n&&s.delete(n),n&&s||(_t.openers.delete(i),i.removeEventListener(\"click\",_t.fromEvent))}static destroy(){let t;for(;t=_t.getInstance();)t.destroy();for(const t of _t.openers.keys())t.removeEventListener(\"click\",_t.fromEvent);_t.openers=new Map}static fromEvent(t){if(t.defaultPrevented)return;if(t.button&&0!==t.button)return;if(t.ctrlKey||t.metaKey||t.shiftKey)return;let e=t.composedPath()[0];const i=e.closest(\"[data-fancybox-trigger]\");if(i){const t=i.dataset.fancyboxTrigger||\"\",n=document.querySelectorAll(`[data-fancybox=\"${t}\"]`),s=parseInt(i.dataset.fancyboxIndex||\"\",10)||0;e=n[s]||e}if(!(e&&e instanceof Element))return;let n,s,o,a;if([..._t.openers].reverse().find((([t,i])=>!(!t.contains(e)||![...i].reverse().find((([i,r])=>{let l=e.closest(i);return!!l&&(n=t,s=i,o=l,a=r,!0)}))))),!n||!s||!o)return;a=a||{},t.preventDefault(),e=o;let r=[],l=u({},tt,a);l.event=t,l.triggerEl=e,l.delegate=i;const c=l.groupAll,h=l.groupAttr,d=h&&e?e.getAttribute(`${h}`):\"\";if((!e||d||c)&&(r=[].slice.call(n.querySelectorAll(s))),e&&!c&&(r=d?r.filter((t=>t.getAttribute(`${h}`)===d)):[e]),!r.length)return;const p=_t.getInstance();return p&&p.options.triggerEl&&r.indexOf(p.options.triggerEl)>-1?void 0:(e&&(l.startIndex=r.indexOf(e)),_t.fromNodes(r,l))}static fromSelector(t,e){let i=null,n=\"\";if(\"string\"==typeof t?(i=document.body,n=t):t instanceof HTMLElement&&\"string\"==typeof e&&(i=t,n=e),!i||!n)return!1;const s=_t.openers.get(i);if(!s)return!1;const o=s.get(n);return!!o&&_t.fromNodes(Array.from(i.querySelectorAll(n)),o)}static fromNodes(t,e){e=u({},tt,e||{});const i=[];for(const n of t){const t=n.dataset||{},s=t.src||n.getAttribute(\"href\")||n.getAttribute(\"currentSrc\")||n.getAttribute(\"src\")||void 0;let o;const a=e.delegate;let r;a&&i.length===e.startIndex&&(o=a instanceof HTMLImageElement?a:a.querySelector(\"img:not([aria-hidden])\")),o||(o=n instanceof HTMLImageElement?n:n.querySelector(\"img:not([aria-hidden])\")),o&&(r=o.currentSrc||o.src||void 0,!r&&o.dataset&&(r=o.dataset.lazySrc||o.dataset.src||void 0));const l={src:s,triggerEl:n,thumbEl:o,thumbElSrc:r,thumbSrc:r};for(const e in t)l[e]=t[e]+\"\";i.push(l)}return new _t(i,e)}static getInstance(t){if(t)return Bt.get(t);return Array.from(Bt.values()).reverse().find((t=>!t.isClosing()&&t))||null}static getSlide(){var t;return(null===(t=_t.getInstance())||void 0===t?void 0:t.getSlide())||null}static show(t=[],e={}){return new _t(t,e)}static next(){const t=_t.getInstance();t&&t.next()}static prev(){const t=_t.getInstance();t&&t.prev()}static close(t=!0,...e){if(t)for(const t of Bt.values())t.close(...e);else{const t=_t.getInstance();t&&t.close(...e)}}}Object.defineProperty(_t,\"version\",{enumerable:!0,configurable:!0,writable:!0,value:\"5.0.22\"}),Object.defineProperty(_t,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:tt}),Object.defineProperty(_t,\"Plugins\",{enumerable:!0,configurable:!0,writable:!0,value:Ot}),Object.defineProperty(_t,\"openers\",{enumerable:!0,configurable:!0,writable:!0,value:new Map});export{Z as Carousel,_t as Fancybox,R as Panzoom};\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 { getDocument } from 'ssr-window';\nimport $ from '../../utils/dom';\nimport { extend, nextTick, bindModuleMethods, createElementIfNotDefined } from '../../utils/utils';\nvar Scrollbar = {\n setTranslate: function setTranslate() {\n var swiper = this;\n if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return;\n var scrollbar = swiper.scrollbar,\n rtl = swiper.rtlTranslate,\n progress = swiper.progress;\n var dragSize = scrollbar.dragSize,\n trackSize = scrollbar.trackSize,\n $dragEl = scrollbar.$dragEl,\n $el = scrollbar.$el;\n var params = swiper.params.scrollbar;\n var newSize = dragSize;\n var newPos = (trackSize - dragSize) * progress;\n\n if (rtl) {\n newPos = -newPos;\n\n if (newPos > 0) {\n newSize = dragSize - newPos;\n newPos = 0;\n } else if (-newPos + dragSize > trackSize) {\n newSize = trackSize + newPos;\n }\n } else if (newPos < 0) {\n newSize = dragSize + newPos;\n newPos = 0;\n } else if (newPos + dragSize > trackSize) {\n newSize = trackSize - newPos;\n }\n\n if (swiper.isHorizontal()) {\n $dragEl.transform(\"translate3d(\" + newPos + \"px, 0, 0)\");\n $dragEl[0].style.width = newSize + \"px\";\n } else {\n $dragEl.transform(\"translate3d(0px, \" + newPos + \"px, 0)\");\n $dragEl[0].style.height = newSize + \"px\";\n }\n\n if (params.hide) {\n clearTimeout(swiper.scrollbar.timeout);\n $el[0].style.opacity = 1;\n swiper.scrollbar.timeout = setTimeout(function () {\n $el[0].style.opacity = 0;\n $el.transition(400);\n }, 1000);\n }\n },\n setTransition: function setTransition(duration) {\n var swiper = this;\n if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return;\n swiper.scrollbar.$dragEl.transition(duration);\n },\n updateSize: function updateSize() {\n var swiper = this;\n if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return;\n var scrollbar = swiper.scrollbar;\n var $dragEl = scrollbar.$dragEl,\n $el = scrollbar.$el;\n $dragEl[0].style.width = '';\n $dragEl[0].style.height = '';\n var trackSize = swiper.isHorizontal() ? $el[0].offsetWidth : $el[0].offsetHeight;\n var divider = swiper.size / swiper.virtualSize;\n var moveDivider = divider * (trackSize / swiper.size);\n var dragSize;\n\n if (swiper.params.scrollbar.dragSize === 'auto') {\n dragSize = trackSize * divider;\n } else {\n dragSize = parseInt(swiper.params.scrollbar.dragSize, 10);\n }\n\n if (swiper.isHorizontal()) {\n $dragEl[0].style.width = dragSize + \"px\";\n } else {\n $dragEl[0].style.height = dragSize + \"px\";\n }\n\n if (divider >= 1) {\n $el[0].style.display = 'none';\n } else {\n $el[0].style.display = '';\n }\n\n if (swiper.params.scrollbar.hide) {\n $el[0].style.opacity = 0;\n }\n\n extend(scrollbar, {\n trackSize: trackSize,\n divider: divider,\n moveDivider: moveDivider,\n dragSize: dragSize\n });\n\n if (swiper.params.watchOverflow && swiper.enabled) {\n scrollbar.$el[swiper.isLocked ? 'addClass' : 'removeClass'](swiper.params.scrollbar.lockClass);\n }\n },\n getPointerPosition: function getPointerPosition(e) {\n var swiper = this;\n\n if (swiper.isHorizontal()) {\n return e.type === 'touchstart' || e.type === 'touchmove' ? e.targetTouches[0].clientX : e.clientX;\n }\n\n return e.type === 'touchstart' || e.type === 'touchmove' ? e.targetTouches[0].clientY : e.clientY;\n },\n setDragPosition: function setDragPosition(e) {\n var swiper = this;\n var scrollbar = swiper.scrollbar,\n rtl = swiper.rtlTranslate;\n var $el = scrollbar.$el,\n dragSize = scrollbar.dragSize,\n trackSize = scrollbar.trackSize,\n dragStartPos = scrollbar.dragStartPos;\n var positionRatio;\n positionRatio = (scrollbar.getPointerPosition(e) - $el.offset()[swiper.isHorizontal() ? 'left' : 'top'] - (dragStartPos !== null ? dragStartPos : dragSize / 2)) / (trackSize - dragSize);\n positionRatio = Math.max(Math.min(positionRatio, 1), 0);\n\n if (rtl) {\n positionRatio = 1 - positionRatio;\n }\n\n var position = swiper.minTranslate() + (swiper.maxTranslate() - swiper.minTranslate()) * positionRatio;\n swiper.updateProgress(position);\n swiper.setTranslate(position);\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n },\n onDragStart: function onDragStart(e) {\n var swiper = this;\n var params = swiper.params.scrollbar;\n var scrollbar = swiper.scrollbar,\n $wrapperEl = swiper.$wrapperEl;\n var $el = scrollbar.$el,\n $dragEl = scrollbar.$dragEl;\n swiper.scrollbar.isTouched = true;\n swiper.scrollbar.dragStartPos = e.target === $dragEl[0] || e.target === $dragEl ? scrollbar.getPointerPosition(e) - e.target.getBoundingClientRect()[swiper.isHorizontal() ? 'left' : 'top'] : null;\n e.preventDefault();\n e.stopPropagation();\n $wrapperEl.transition(100);\n $dragEl.transition(100);\n scrollbar.setDragPosition(e);\n clearTimeout(swiper.scrollbar.dragTimeout);\n $el.transition(0);\n\n if (params.hide) {\n $el.css('opacity', 1);\n }\n\n if (swiper.params.cssMode) {\n swiper.$wrapperEl.css('scroll-snap-type', 'none');\n }\n\n swiper.emit('scrollbarDragStart', e);\n },\n onDragMove: function onDragMove(e) {\n var swiper = this;\n var scrollbar = swiper.scrollbar,\n $wrapperEl = swiper.$wrapperEl;\n var $el = scrollbar.$el,\n $dragEl = scrollbar.$dragEl;\n if (!swiper.scrollbar.isTouched) return;\n if (e.preventDefault) e.preventDefault();else e.returnValue = false;\n scrollbar.setDragPosition(e);\n $wrapperEl.transition(0);\n $el.transition(0);\n $dragEl.transition(0);\n swiper.emit('scrollbarDragMove', e);\n },\n onDragEnd: function onDragEnd(e) {\n var swiper = this;\n var params = swiper.params.scrollbar;\n var scrollbar = swiper.scrollbar,\n $wrapperEl = swiper.$wrapperEl;\n var $el = scrollbar.$el;\n if (!swiper.scrollbar.isTouched) return;\n swiper.scrollbar.isTouched = false;\n\n if (swiper.params.cssMode) {\n swiper.$wrapperEl.css('scroll-snap-type', '');\n $wrapperEl.transition('');\n }\n\n if (params.hide) {\n clearTimeout(swiper.scrollbar.dragTimeout);\n swiper.scrollbar.dragTimeout = nextTick(function () {\n $el.css('opacity', 0);\n $el.transition(400);\n }, 1000);\n }\n\n swiper.emit('scrollbarDragEnd', e);\n\n if (params.snapOnRelease) {\n swiper.slideToClosest();\n }\n },\n enableDraggable: function enableDraggable() {\n var swiper = this;\n if (!swiper.params.scrollbar.el) return;\n var document = getDocument();\n var scrollbar = swiper.scrollbar,\n touchEventsTouch = swiper.touchEventsTouch,\n touchEventsDesktop = swiper.touchEventsDesktop,\n params = swiper.params,\n support = swiper.support;\n var $el = scrollbar.$el;\n var target = $el[0];\n var activeListener = support.passiveListener && params.passiveListeners ? {\n passive: false,\n capture: false\n } : false;\n var passiveListener = support.passiveListener && params.passiveListeners ? {\n passive: true,\n capture: false\n } : false;\n if (!target) return;\n\n if (!support.touch) {\n target.addEventListener(touchEventsDesktop.start, swiper.scrollbar.onDragStart, activeListener);\n document.addEventListener(touchEventsDesktop.move, swiper.scrollbar.onDragMove, activeListener);\n document.addEventListener(touchEventsDesktop.end, swiper.scrollbar.onDragEnd, passiveListener);\n } else {\n target.addEventListener(touchEventsTouch.start, swiper.scrollbar.onDragStart, activeListener);\n target.addEventListener(touchEventsTouch.move, swiper.scrollbar.onDragMove, activeListener);\n target.addEventListener(touchEventsTouch.end, swiper.scrollbar.onDragEnd, passiveListener);\n }\n },\n disableDraggable: function disableDraggable() {\n var swiper = this;\n if (!swiper.params.scrollbar.el) return;\n var document = getDocument();\n var scrollbar = swiper.scrollbar,\n touchEventsTouch = swiper.touchEventsTouch,\n touchEventsDesktop = swiper.touchEventsDesktop,\n params = swiper.params,\n support = swiper.support;\n var $el = scrollbar.$el;\n var target = $el[0];\n var activeListener = support.passiveListener && params.passiveListeners ? {\n passive: false,\n capture: false\n } : false;\n var passiveListener = support.passiveListener && params.passiveListeners ? {\n passive: true,\n capture: false\n } : false;\n if (!target) return;\n\n if (!support.touch) {\n target.removeEventListener(touchEventsDesktop.start, swiper.scrollbar.onDragStart, activeListener);\n document.removeEventListener(touchEventsDesktop.move, swiper.scrollbar.onDragMove, activeListener);\n document.removeEventListener(touchEventsDesktop.end, swiper.scrollbar.onDragEnd, passiveListener);\n } else {\n target.removeEventListener(touchEventsTouch.start, swiper.scrollbar.onDragStart, activeListener);\n target.removeEventListener(touchEventsTouch.move, swiper.scrollbar.onDragMove, activeListener);\n target.removeEventListener(touchEventsTouch.end, swiper.scrollbar.onDragEnd, passiveListener);\n }\n },\n init: function init() {\n var swiper = this;\n var scrollbar = swiper.scrollbar,\n $swiperEl = swiper.$el;\n swiper.params.scrollbar = createElementIfNotDefined($swiperEl, swiper.params.scrollbar, swiper.params.createElements, {\n el: 'swiper-scrollbar'\n });\n var params = swiper.params.scrollbar;\n if (!params.el) return;\n var $el = $(params.el);\n\n if (swiper.params.uniqueNavElements && typeof params.el === 'string' && $el.length > 1 && $swiperEl.find(params.el).length === 1) {\n $el = $swiperEl.find(params.el);\n }\n\n var $dragEl = $el.find(\".\" + swiper.params.scrollbar.dragClass);\n\n if ($dragEl.length === 0) {\n $dragEl = $(\"<div class=\\\"\" + swiper.params.scrollbar.dragClass + \"\\\"></div>\");\n $el.append($dragEl);\n }\n\n extend(scrollbar, {\n $el: $el,\n el: $el[0],\n $dragEl: $dragEl,\n dragEl: $dragEl[0]\n });\n\n if (params.draggable) {\n scrollbar.enableDraggable();\n }\n\n if ($el) {\n $el[swiper.enabled ? 'removeClass' : 'addClass'](swiper.params.scrollbar.lockClass);\n }\n },\n destroy: function destroy() {\n var swiper = this;\n swiper.scrollbar.disableDraggable();\n }\n};\nexport default {\n name: 'scrollbar',\n params: {\n scrollbar: {\n el: null,\n dragSize: 'auto',\n hide: false,\n draggable: false,\n snapOnRelease: true,\n lockClass: 'swiper-scrollbar-lock',\n dragClass: 'swiper-scrollbar-drag'\n }\n },\n create: function create() {\n var swiper = this;\n bindModuleMethods(swiper, {\n scrollbar: _extends({\n isTouched: false,\n timeout: null,\n dragTimeout: null\n }, Scrollbar)\n });\n },\n on: {\n init: function init(swiper) {\n swiper.scrollbar.init();\n swiper.scrollbar.updateSize();\n swiper.scrollbar.setTranslate();\n },\n update: function update(swiper) {\n swiper.scrollbar.updateSize();\n },\n resize: function resize(swiper) {\n swiper.scrollbar.updateSize();\n },\n observerUpdate: function observerUpdate(swiper) {\n swiper.scrollbar.updateSize();\n },\n setTranslate: function setTranslate(swiper) {\n swiper.scrollbar.setTranslate();\n },\n setTransition: function setTransition(swiper, duration) {\n swiper.scrollbar.setTransition(duration);\n },\n 'enable disable': function enableDisable(swiper) {\n var $el = swiper.scrollbar.$el;\n\n if ($el) {\n $el[swiper.enabled ? 'removeClass' : 'addClass'](swiper.params.scrollbar.lockClass);\n }\n },\n destroy: function destroy(swiper) {\n swiper.scrollbar.destroy();\n }\n }\n};","/**\r\n * fancyboxGallery Component\r\n *\r\n * @file slider.js\r\n */\r\n\r\nimport $ from \"jquery\";\r\nimport { Fancybox } from \"@fancyapps/ui\";\r\nimport \"@fancyapps/ui/dist/fancybox/fancybox.css\";\r\nimport Swiper from 'swiper';\r\nimport SwiperCore, { Navigation, Pagination, Autoplay, EffectFade, Controller, Thumbs, Keyboard, Mousewheel, Scrollbar } from 'swiper/core';\r\nSwiperCore.use([Navigation, Pagination, Autoplay, EffectFade, Controller, Thumbs, Keyboard, Mousewheel, Scrollbar]);\r\n\r\nimport 'swiper/swiper-bundle.css';\r\n\r\n\r\nconst fancyboxGallery = (() => {\r\n /**\r\n * fullSlider\r\n * Full width slider settings\r\n */\r\n const defaultFancybox = () => {\r\n Fancybox.bind('[data-fancybox]', {\r\n // Custom options for all galleries\r\n }); \r\n Fancybox.bind('[data-fancybox=\"home-video-gallery\"]', {\r\n // Custom options for all galleries\r\n Thumbs:false\r\n }); \r\n $('.cookie-accept').on('click', function(){\r\n Fancybox.close();\r\n }); \r\n };\r\n\r\n const balloonModal = () => {\r\n var e = document.getElementsByClassName(\"svg-map-hr\")\r\n , t = document.querySelector(\".map-balloon\");\r\n for (let i = 0; i < e.length; i += 1) {\r\n e[i].addEventListener(\"mouseover\", function(e) {\r\n if (e.target.getAttribute(\"data-value\") === \"1\"){\r\n $(\".svg-map-hr\").addClass(\"hover\");\r\n if (e.target.getAttribute(\"data-box2\") !== null){\r\n t.innerHTML = ['<div class=\"map-box-item\">', e.target.getAttribute(\"data-box\") + e.target.getAttribute(\"data-box2\"), \"</div>\"].join(\"\");\r\n } else{\r\n t.innerHTML = ['<div class=\"map-box-item\">', e.target.getAttribute(\"data-box\"), \"</div>\"].join(\"\");\r\n }\r\n } else{\r\n t.innerHTML = \"\"\r\n $(\".svg-map-hr\").removeClass(\"hover\");\r\n }\r\n });\r\n e[i].addEventListener(\"mousemove\", function(e) {\r\n var t = $(this).parent().offset(),\r\n mouse_x = e.pageX - t.left + -170 + \"px\",\r\n mouse_y = e.pageY - t.top + -150 + \"px\",\r\n mouse_x = mouse_x,\r\n mouse_y = mouse_y;\r\n $(\".map-balloon\").css({\r\n left: mouse_x,\r\n top: mouse_y\r\n });\r\n }),\r\n e[i].addEventListener(\"mouseout\", function(e) {\r\n t.innerHTML = \"\";\r\n $(\".svg-map-hr\").removeClass(\"hover\");\r\n });\r\n }\r\n };\r\n\r\n const popupImgCarousel = () => {\r\n Fancybox.bind('[data-fancybox=\"popupGallery\"]', {\r\n groupAttr: false,\r\n dragToClose:false,\r\n hash : false,\r\n on: {\r\n done: (fancybox, eventName) => {\r\n var popupTextCarousel = new Swiper('.text-'+eventName.contentEl.id+\"-carousel\", {\r\n slidesPerView: 1.5,\r\n spaceBetween: 30,\r\n watchSlidesProgress: true,\r\n direction:\"vertical\",\r\n observer:true,\r\n observeParents:true,\r\n mousewheel: {\r\n \treleaseOnEdges: true,\r\n },\r\n touchReleaseOnEdges: true,\r\n scrollbar: {\r\n el: '.swiper-scrollbar',\r\n draggable: true,\r\n },\r\n breakpoints: {\r\n 0: {\r\n direction:\"horizontal\",\r\n slidesPerView: 1.2,\r\n spaceBetween: 15,\r\n // centeredSlides: false,\r\n },\r\n 768: {\r\n slidesPerView: 1.5,\r\n spaceBetween: 15,\r\n direction:\"vertical\",\r\n // centeredSlides: true,\r\n },\r\n 992: {\r\n slidesPerView: 1.5,\r\n spaceBetween: 30,\r\n },\r\n }\r\n });\r\n var popupImgCarousel = new Swiper('.img-'+eventName.contentEl.id+\"-carousel\", {\r\n slidesPerView: 1,\r\n spaceBetween: 0,\r\n allowTouchMove: false,\r\n });\r\n popupTextCarousel.on('slideChange', function () {\r\n popupImgCarousel.slideTo(this.realIndex);\t\r\n });\r\n popupTextCarousel.on('reachEnd', function () {\r\n $(\".dty-popup-carousel-text .swiper-slide\").addClass(\"last-ph\");\r\n });\r\n popupTextCarousel.on('fromEdge', function(){\r\n $(\".dty-popup-carousel-text .swiper-slide\").removeClass(\"last-ph\");\r\n });\r\n },\r\n close: (fancybox, eventName) => {\r\n var popupTextCarousel = new Swiper('.text-'+fancybox.userSlides[0].src.replace(\"#\", \"\")+\"-carousel\", {\r\n slidesPerView: 1.5,\r\n spaceBetween: 30,\r\n watchSlidesProgress: true,\r\n direction:\"vertical\",\r\n observer:true,\r\n observeParents:true,\r\n mousewheel: {\r\n \treleaseOnEdges: true,\r\n },\r\n touchReleaseOnEdges: true,\r\n scrollbar: {\r\n el: '.swiper-scrollbar',\r\n draggable: true,\r\n },\r\n breakpoints: {\r\n 0: {\r\n direction:\"horizontal\",\r\n slidesPerView: 1.2,\r\n spaceBetween: 15,\r\n // centeredSlides: false,\r\n },\r\n 768: {\r\n slidesPerView: 1.5,\r\n spaceBetween: 15,\r\n direction:\"vertical\",\r\n // centeredSlides: true,\r\n },\r\n 992: {\r\n slidesPerView: 1.5,\r\n spaceBetween: 30,\r\n },\r\n }\r\n });\r\n var popupImgCarousel = new Swiper('.img-'+fancybox.userSlides[0].src.replace(\"#\", \"\")+\"-carousel\", {\r\n slidesPerView: 1,\r\n spaceBetween: 0,\r\n allowTouchMove: false,\r\n });\r\n popupTextCarousel.update();\r\n popupImgCarousel.update();\r\n },\r\n },\r\n });\r\n };\r\n\r\n const customSelect = () => {\r\n var x, i, j, l, ll, selElmnt, a, b, c;\r\n /*look for any elements with the class \"custom-select\":*/\r\n x = document.getElementsByClassName(\"custom-select\");\r\n l = x.length;\r\n for (i = 0; i < l; i++) {\r\n selElmnt = x[i].getElementsByTagName(\"select\")[0];\r\n ll = selElmnt.length;\r\n /*for each element, create a new DIV that will act as the selected item:*/\r\n a = document.createElement(\"DIV\");\r\n a.setAttribute(\"class\", \"select-selected\");\r\n a.innerHTML = selElmnt.options[selElmnt.selectedIndex].innerHTML;\r\n x[i].appendChild(a);\r\n /*for each element, create a new DIV that will contain the option list:*/\r\n b = document.createElement(\"DIV\");\r\n b.setAttribute(\"class\", \"select-items select-hide\");\r\n for (j = 1; j < ll; j++) {\r\n /*for each option in the original select element,\r\n create a new DIV that will act as an option item:*/\r\n c = document.createElement(\"DIV\");\r\n c.innerHTML = selElmnt.options[j].innerHTML;\r\n c.addEventListener(\"click\", function(e) {\r\n /*when an item is clicked, update the original select box,\r\n and the selected item:*/\r\n var y, i, k, s, h, sl, yl;\r\n s = this.parentNode.parentNode.getElementsByTagName(\"select\")[0];\r\n sl = s.length;\r\n h = this.parentNode.previousSibling;\r\n for (i = 0; i < sl; i++) {\r\n if (s.options[i].innerHTML == this.innerHTML) {\r\n s.selectedIndex = i;\r\n h.innerHTML = this.innerHTML;\r\n y = this.parentNode.getElementsByClassName(\"same-as-selected\");\r\n yl = y.length;\r\n for (k = 0; k < yl; k++) {\r\n y[k].removeAttribute(\"class\");\r\n }\r\n this.setAttribute(\"class\", \"same-as-selected\");\r\n break;\r\n }\r\n }\r\n h.click();\r\n });\r\n b.appendChild(c);\r\n }\r\n x[i].appendChild(b);\r\n a.addEventListener(\"click\", function(e) {\r\n /*when the select box is clicked, close any other select boxes,\r\n and open/close the current select box:*/\r\n e.stopPropagation();\r\n closeAllSelect(this);\r\n this.nextSibling.classList.toggle(\"select-hide\");\r\n this.classList.toggle(\"select-arrow-active\");\r\n });\r\n }\r\n function closeAllSelect(elmnt) {\r\n /*a function that will close all select boxes in the document,\r\n except the current select box:*/\r\n var x, y, i, xl, yl, arrNo = [];\r\n x = document.getElementsByClassName(\"select-items\");\r\n y = document.getElementsByClassName(\"select-selected\");\r\n xl = x.length;\r\n yl = y.length;\r\n for (i = 0; i < yl; i++) {\r\n if (elmnt == y[i]) {\r\n arrNo.push(i)\r\n } else {\r\n y[i].classList.remove(\"select-arrow-active\");\r\n }\r\n }\r\n for (i = 0; i < xl; i++) {\r\n if (arrNo.indexOf(i)) {\r\n x[i].classList.add(\"select-hide\");\r\n }\r\n }\r\n }\r\n /*if the user clicks anywhere outside the select box,\r\n then close all select boxes:*/\r\n document.addEventListener(\"click\", closeAllSelect);\r\n };\r\n\r\n const init = () => {\r\n defaultFancybox();\r\n balloonModal();\r\n customSelect();\r\n popupImgCarousel();\r\n };\r\n\r\n return {\r\n init,\r\n };\r\n})();\r\n\r\nexport default fancyboxGallery;","import URLToolkit from 'url-toolkit';\nimport window from 'global/window';\nvar DEFAULT_LOCATION = 'http://example.com';\n\nvar resolveUrl = function resolveUrl(baseUrl, relativeUrl) {\n // return early if we don't need to resolve\n if (/^[a-z]+:/i.test(relativeUrl)) {\n return relativeUrl;\n } // if baseUrl is a data URI, ignore it and resolve everything relative to window.location\n\n\n if (/^data:/.test(baseUrl)) {\n baseUrl = window.location && window.location.href || '';\n } // IE11 supports URL but not the URL constructor\n // feature detect the behavior we want\n\n\n var nativeURL = typeof window.URL === 'function';\n var protocolLess = /^\\/\\//.test(baseUrl); // remove location if window.location isn't available (i.e. we're in node)\n // and if baseUrl isn't an absolute url\n\n var removeLocation = !window.location && !/\\/\\//i.test(baseUrl); // if the base URL is relative then combine with the current location\n\n if (nativeURL) {\n baseUrl = new window.URL(baseUrl, window.location || DEFAULT_LOCATION);\n } else if (!/\\/\\//i.test(baseUrl)) {\n baseUrl = URLToolkit.buildAbsoluteURL(window.location && window.location.href || '', baseUrl);\n }\n\n if (nativeURL) {\n var newUrl = new URL(relativeUrl, baseUrl); // if we're a protocol-less url, remove the protocol\n // and if we're location-less, remove the location\n // otherwise, return the url unmodified\n\n if (removeLocation) {\n return newUrl.href.slice(DEFAULT_LOCATION.length);\n } else if (protocolLess) {\n return newUrl.href.slice(newUrl.protocol.length);\n }\n\n return newUrl.href;\n }\n\n return URLToolkit.buildAbsoluteURL(baseUrl, relativeUrl);\n};\n\nexport default resolveUrl;","export default function _extends() {\n _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\n return _extends.apply(this, arguments);\n}","/**\n * @file stream.js\n */\n\n/**\n * A lightweight readable stream implemention that handles event dispatching.\n *\n * @class Stream\n */\nvar Stream = /*#__PURE__*/function () {\n function Stream() {\n this.listeners = {};\n }\n /**\n * Add a listener for a specified event type.\n *\n * @param {string} type the event name\n * @param {Function} listener the callback to be invoked when an event of\n * the specified type occurs\n */\n\n\n var _proto = Stream.prototype;\n\n _proto.on = function on(type, listener) {\n if (!this.listeners[type]) {\n this.listeners[type] = [];\n }\n\n this.listeners[type].push(listener);\n }\n /**\n * Remove a listener for a specified event type.\n *\n * @param {string} type the event name\n * @param {Function} listener a function previously registered for this\n * type of event through `on`\n * @return {boolean} if we could turn it off or not\n */\n ;\n\n _proto.off = function off(type, listener) {\n if (!this.listeners[type]) {\n return false;\n }\n\n var index = this.listeners[type].indexOf(listener); // TODO: which is better?\n // In Video.js we slice listener functions\n // on trigger so that it does not mess up the order\n // while we loop through.\n //\n // Here we slice on off so that the loop in trigger\n // can continue using it's old reference to loop without\n // messing up the order.\n\n this.listeners[type] = this.listeners[type].slice(0);\n this.listeners[type].splice(index, 1);\n return index > -1;\n }\n /**\n * Trigger an event of the specified type on this stream. Any additional\n * arguments to this function are passed as parameters to event listeners.\n *\n * @param {string} type the event name\n */\n ;\n\n _proto.trigger = function trigger(type) {\n var callbacks = this.listeners[type];\n\n if (!callbacks) {\n return;\n } // Slicing the arguments on every invocation of this method\n // can add a significant amount of overhead. Avoid the\n // intermediate object creation for the common case of a\n // single callback argument\n\n\n if (arguments.length === 2) {\n var length = callbacks.length;\n\n for (var i = 0; i < length; ++i) {\n callbacks[i].call(this, arguments[1]);\n }\n } else {\n var args = Array.prototype.slice.call(arguments, 1);\n var _length = callbacks.length;\n\n for (var _i = 0; _i < _length; ++_i) {\n callbacks[_i].apply(this, args);\n }\n }\n }\n /**\n * Destroys the stream and cleans up.\n */\n ;\n\n _proto.dispose = function dispose() {\n this.listeners = {};\n }\n /**\n * Forwards all `data` events on this stream to the destination stream. The\n * destination stream should provide a method `push` to receive the data\n * events as they arrive.\n *\n * @param {Stream} destination the stream that will receive all `data` events\n * @see http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options\n */\n ;\n\n _proto.pipe = function pipe(destination) {\n this.on('data', function (data) {\n destination.push(data);\n });\n };\n\n return Stream;\n}();\n\nexport { Stream as default };","import window from 'global/window';\n\nvar atob = function atob(s) {\n return window.atob ? window.atob(s) : Buffer.from(s, 'base64').toString('binary');\n};\n\nexport default function decodeB64ToUint8Array(b64Text) {\n var decodedString = atob(b64Text);\n var array = new Uint8Array(decodedString.length);\n\n for (var i = 0; i < decodedString.length; i++) {\n array[i] = decodedString.charCodeAt(i);\n }\n\n return array;\n}","/*! @name m3u8-parser @version 6.2.0 @license Apache-2.0 */\nimport Stream from '@videojs/vhs-utils/es/stream.js';\nimport _extends from '@babel/runtime/helpers/extends';\nimport decodeB64ToUint8Array from '@videojs/vhs-utils/es/decode-b64-to-uint8-array.js';\n\n/**\n * @file m3u8/line-stream.js\n */\n/**\n * A stream that buffers string input and generates a `data` event for each\n * line.\n *\n * @class LineStream\n * @extends Stream\n */\n\nclass LineStream extends Stream {\n constructor() {\n super();\n this.buffer = '';\n }\n /**\n * Add new data to be parsed.\n *\n * @param {string} data the text to process\n */\n\n\n push(data) {\n let nextNewline;\n this.buffer += data;\n nextNewline = this.buffer.indexOf('\\n');\n\n for (; nextNewline > -1; nextNewline = this.buffer.indexOf('\\n')) {\n this.trigger('data', this.buffer.substring(0, nextNewline));\n this.buffer = this.buffer.substring(nextNewline + 1);\n }\n }\n\n}\n\nconst TAB = String.fromCharCode(0x09);\n\nconst parseByterange = function (byterangeString) {\n // optionally match and capture 0+ digits before `@`\n // optionally match and capture 0+ digits after `@`\n const match = /([0-9.]*)?@?([0-9.]*)?/.exec(byterangeString || '');\n const result = {};\n\n if (match[1]) {\n result.length = parseInt(match[1], 10);\n }\n\n if (match[2]) {\n result.offset = parseInt(match[2], 10);\n }\n\n return result;\n};\n/**\n * \"forgiving\" attribute list psuedo-grammar:\n * attributes -> keyvalue (',' keyvalue)*\n * keyvalue -> key '=' value\n * key -> [^=]*\n * value -> '\"' [^\"]* '\"' | [^,]*\n */\n\n\nconst attributeSeparator = function () {\n const key = '[^=]*';\n const value = '\"[^\"]*\"|[^,]*';\n const keyvalue = '(?:' + key + ')=(?:' + value + ')';\n return new RegExp('(?:^|,)(' + keyvalue + ')');\n};\n/**\n * Parse attributes from a line given the separator\n *\n * @param {string} attributes the attribute line to parse\n */\n\n\nconst parseAttributes = function (attributes) {\n const result = {};\n\n if (!attributes) {\n return result;\n } // split the string using attributes as the separator\n\n\n const attrs = attributes.split(attributeSeparator());\n let i = attrs.length;\n let attr;\n\n while (i--) {\n // filter out unmatched portions of the string\n if (attrs[i] === '') {\n continue;\n } // split the key and value\n\n\n attr = /([^=]*)=(.*)/.exec(attrs[i]).slice(1); // trim whitespace and remove optional quotes around the value\n\n attr[0] = attr[0].replace(/^\\s+|\\s+$/g, '');\n attr[1] = attr[1].replace(/^\\s+|\\s+$/g, '');\n attr[1] = attr[1].replace(/^['\"](.*)['\"]$/g, '$1');\n result[attr[0]] = attr[1];\n }\n\n return result;\n};\n/**\n * A line-level M3U8 parser event stream. It expects to receive input one\n * line at a time and performs a context-free parse of its contents. A stream\n * interpretation of a manifest can be useful if the manifest is expected to\n * be too large to fit comfortably into memory or the entirety of the input\n * is not immediately available. Otherwise, it's probably much easier to work\n * with a regular `Parser` object.\n *\n * Produces `data` events with an object that captures the parser's\n * interpretation of the input. That object has a property `tag` that is one\n * of `uri`, `comment`, or `tag`. URIs only have a single additional\n * property, `line`, which captures the entirety of the input without\n * interpretation. Comments similarly have a single additional property\n * `text` which is the input without the leading `#`.\n *\n * Tags always have a property `tagType` which is the lower-cased version of\n * the M3U8 directive without the `#EXT` or `#EXT-X-` prefix. For instance,\n * `#EXT-X-MEDIA-SEQUENCE` becomes `media-sequence` when parsed. Unrecognized\n * tags are given the tag type `unknown` and a single additional property\n * `data` with the remainder of the input.\n *\n * @class ParseStream\n * @extends Stream\n */\n\n\nclass ParseStream extends Stream {\n constructor() {\n super();\n this.customParsers = [];\n this.tagMappers = [];\n }\n /**\n * Parses an additional line of input.\n *\n * @param {string} line a single line of an M3U8 file to parse\n */\n\n\n push(line) {\n let match;\n let event; // strip whitespace\n\n line = line.trim();\n\n if (line.length === 0) {\n // ignore empty lines\n return;\n } // URIs\n\n\n if (line[0] !== '#') {\n this.trigger('data', {\n type: 'uri',\n uri: line\n });\n return;\n } // map tags\n\n\n const newLines = this.tagMappers.reduce((acc, mapper) => {\n const mappedLine = mapper(line); // skip if unchanged\n\n if (mappedLine === line) {\n return acc;\n }\n\n return acc.concat([mappedLine]);\n }, [line]);\n newLines.forEach(newLine => {\n for (let i = 0; i < this.customParsers.length; i++) {\n if (this.customParsers[i].call(this, newLine)) {\n return;\n }\n } // Comments\n\n\n if (newLine.indexOf('#EXT') !== 0) {\n this.trigger('data', {\n type: 'comment',\n text: newLine.slice(1)\n });\n return;\n } // strip off any carriage returns here so the regex matching\n // doesn't have to account for them.\n\n\n newLine = newLine.replace('\\r', ''); // Tags\n\n match = /^#EXTM3U/.exec(newLine);\n\n if (match) {\n this.trigger('data', {\n type: 'tag',\n tagType: 'm3u'\n });\n return;\n }\n\n match = /^#EXTINF:([0-9\\.]*)?,?(.*)?$/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'inf'\n };\n\n if (match[1]) {\n event.duration = parseFloat(match[1]);\n }\n\n if (match[2]) {\n event.title = match[2];\n }\n\n this.trigger('data', event);\n return;\n }\n\n match = /^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'targetduration'\n };\n\n if (match[1]) {\n event.duration = parseInt(match[1], 10);\n }\n\n this.trigger('data', event);\n return;\n }\n\n match = /^#EXT-X-VERSION:([0-9.]*)?/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'version'\n };\n\n if (match[1]) {\n event.version = parseInt(match[1], 10);\n }\n\n this.trigger('data', event);\n return;\n }\n\n match = /^#EXT-X-MEDIA-SEQUENCE:(\\-?[0-9.]*)?/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'media-sequence'\n };\n\n if (match[1]) {\n event.number = parseInt(match[1], 10);\n }\n\n this.trigger('data', event);\n return;\n }\n\n match = /^#EXT-X-DISCONTINUITY-SEQUENCE:(\\-?[0-9.]*)?/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'discontinuity-sequence'\n };\n\n if (match[1]) {\n event.number = parseInt(match[1], 10);\n }\n\n this.trigger('data', event);\n return;\n }\n\n match = /^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'playlist-type'\n };\n\n if (match[1]) {\n event.playlistType = match[1];\n }\n\n this.trigger('data', event);\n return;\n }\n\n match = /^#EXT-X-BYTERANGE:(.*)?$/.exec(newLine);\n\n if (match) {\n event = _extends(parseByterange(match[1]), {\n type: 'tag',\n tagType: 'byterange'\n });\n this.trigger('data', event);\n return;\n }\n\n match = /^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'allow-cache'\n };\n\n if (match[1]) {\n event.allowed = !/NO/.test(match[1]);\n }\n\n this.trigger('data', event);\n return;\n }\n\n match = /^#EXT-X-MAP:(.*)$/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'map'\n };\n\n if (match[1]) {\n const attributes = parseAttributes(match[1]);\n\n if (attributes.URI) {\n event.uri = attributes.URI;\n }\n\n if (attributes.BYTERANGE) {\n event.byterange = parseByterange(attributes.BYTERANGE);\n }\n }\n\n this.trigger('data', event);\n return;\n }\n\n match = /^#EXT-X-STREAM-INF:(.*)$/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'stream-inf'\n };\n\n if (match[1]) {\n event.attributes = parseAttributes(match[1]);\n\n if (event.attributes.RESOLUTION) {\n const split = event.attributes.RESOLUTION.split('x');\n const resolution = {};\n\n if (split[0]) {\n resolution.width = parseInt(split[0], 10);\n }\n\n if (split[1]) {\n resolution.height = parseInt(split[1], 10);\n }\n\n event.attributes.RESOLUTION = resolution;\n }\n\n if (event.attributes.BANDWIDTH) {\n event.attributes.BANDWIDTH = parseInt(event.attributes.BANDWIDTH, 10);\n }\n\n if (event.attributes['FRAME-RATE']) {\n event.attributes['FRAME-RATE'] = parseFloat(event.attributes['FRAME-RATE']);\n }\n\n if (event.attributes['PROGRAM-ID']) {\n event.attributes['PROGRAM-ID'] = parseInt(event.attributes['PROGRAM-ID'], 10);\n }\n }\n\n this.trigger('data', event);\n return;\n }\n\n match = /^#EXT-X-MEDIA:(.*)$/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'media'\n };\n\n if (match[1]) {\n event.attributes = parseAttributes(match[1]);\n }\n\n this.trigger('data', event);\n return;\n }\n\n match = /^#EXT-X-ENDLIST/.exec(newLine);\n\n if (match) {\n this.trigger('data', {\n type: 'tag',\n tagType: 'endlist'\n });\n return;\n }\n\n match = /^#EXT-X-DISCONTINUITY/.exec(newLine);\n\n if (match) {\n this.trigger('data', {\n type: 'tag',\n tagType: 'discontinuity'\n });\n return;\n }\n\n match = /^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'program-date-time'\n };\n\n if (match[1]) {\n event.dateTimeString = match[1];\n event.dateTimeObject = new Date(match[1]);\n }\n\n this.trigger('data', event);\n return;\n }\n\n match = /^#EXT-X-KEY:(.*)$/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'key'\n };\n\n if (match[1]) {\n event.attributes = parseAttributes(match[1]); // parse the IV string into a Uint32Array\n\n if (event.attributes.IV) {\n if (event.attributes.IV.substring(0, 2).toLowerCase() === '0x') {\n event.attributes.IV = event.attributes.IV.substring(2);\n }\n\n event.attributes.IV = event.attributes.IV.match(/.{8}/g);\n event.attributes.IV[0] = parseInt(event.attributes.IV[0], 16);\n event.attributes.IV[1] = parseInt(event.attributes.IV[1], 16);\n event.attributes.IV[2] = parseInt(event.attributes.IV[2], 16);\n event.attributes.IV[3] = parseInt(event.attributes.IV[3], 16);\n event.attributes.IV = new Uint32Array(event.attributes.IV);\n }\n }\n\n this.trigger('data', event);\n return;\n }\n\n match = /^#EXT-X-START:(.*)$/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'start'\n };\n\n if (match[1]) {\n event.attributes = parseAttributes(match[1]);\n event.attributes['TIME-OFFSET'] = parseFloat(event.attributes['TIME-OFFSET']);\n event.attributes.PRECISE = /YES/.test(event.attributes.PRECISE);\n }\n\n this.trigger('data', event);\n return;\n }\n\n match = /^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'cue-out-cont'\n };\n\n if (match[1]) {\n event.data = match[1];\n } else {\n event.data = '';\n }\n\n this.trigger('data', event);\n return;\n }\n\n match = /^#EXT-X-CUE-OUT:(.*)?$/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'cue-out'\n };\n\n if (match[1]) {\n event.data = match[1];\n } else {\n event.data = '';\n }\n\n this.trigger('data', event);\n return;\n }\n\n match = /^#EXT-X-CUE-IN:(.*)?$/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'cue-in'\n };\n\n if (match[1]) {\n event.data = match[1];\n } else {\n event.data = '';\n }\n\n this.trigger('data', event);\n return;\n }\n\n match = /^#EXT-X-SKIP:(.*)$/.exec(newLine);\n\n if (match && match[1]) {\n event = {\n type: 'tag',\n tagType: 'skip'\n };\n event.attributes = parseAttributes(match[1]);\n\n if (event.attributes.hasOwnProperty('SKIPPED-SEGMENTS')) {\n event.attributes['SKIPPED-SEGMENTS'] = parseInt(event.attributes['SKIPPED-SEGMENTS'], 10);\n }\n\n if (event.attributes.hasOwnProperty('RECENTLY-REMOVED-DATERANGES')) {\n event.attributes['RECENTLY-REMOVED-DATERANGES'] = event.attributes['RECENTLY-REMOVED-DATERANGES'].split(TAB);\n }\n\n this.trigger('data', event);\n return;\n }\n\n match = /^#EXT-X-PART:(.*)$/.exec(newLine);\n\n if (match && match[1]) {\n event = {\n type: 'tag',\n tagType: 'part'\n };\n event.attributes = parseAttributes(match[1]);\n ['DURATION'].forEach(function (key) {\n if (event.attributes.hasOwnProperty(key)) {\n event.attributes[key] = parseFloat(event.attributes[key]);\n }\n });\n ['INDEPENDENT', 'GAP'].forEach(function (key) {\n if (event.attributes.hasOwnProperty(key)) {\n event.attributes[key] = /YES/.test(event.attributes[key]);\n }\n });\n\n if (event.attributes.hasOwnProperty('BYTERANGE')) {\n event.attributes.byterange = parseByterange(event.attributes.BYTERANGE);\n }\n\n this.trigger('data', event);\n return;\n }\n\n match = /^#EXT-X-SERVER-CONTROL:(.*)$/.exec(newLine);\n\n if (match && match[1]) {\n event = {\n type: 'tag',\n tagType: 'server-control'\n };\n event.attributes = parseAttributes(match[1]);\n ['CAN-SKIP-UNTIL', 'PART-HOLD-BACK', 'HOLD-BACK'].forEach(function (key) {\n if (event.attributes.hasOwnProperty(key)) {\n event.attributes[key] = parseFloat(event.attributes[key]);\n }\n });\n ['CAN-SKIP-DATERANGES', 'CAN-BLOCK-RELOAD'].forEach(function (key) {\n if (event.attributes.hasOwnProperty(key)) {\n event.attributes[key] = /YES/.test(event.attributes[key]);\n }\n });\n this.trigger('data', event);\n return;\n }\n\n match = /^#EXT-X-PART-INF:(.*)$/.exec(newLine);\n\n if (match && match[1]) {\n event = {\n type: 'tag',\n tagType: 'part-inf'\n };\n event.attributes = parseAttributes(match[1]);\n ['PART-TARGET'].forEach(function (key) {\n if (event.attributes.hasOwnProperty(key)) {\n event.attributes[key] = parseFloat(event.attributes[key]);\n }\n });\n this.trigger('data', event);\n return;\n }\n\n match = /^#EXT-X-PRELOAD-HINT:(.*)$/.exec(newLine);\n\n if (match && match[1]) {\n event = {\n type: 'tag',\n tagType: 'preload-hint'\n };\n event.attributes = parseAttributes(match[1]);\n ['BYTERANGE-START', 'BYTERANGE-LENGTH'].forEach(function (key) {\n if (event.attributes.hasOwnProperty(key)) {\n event.attributes[key] = parseInt(event.attributes[key], 10);\n const subkey = key === 'BYTERANGE-LENGTH' ? 'length' : 'offset';\n event.attributes.byterange = event.attributes.byterange || {};\n event.attributes.byterange[subkey] = event.attributes[key]; // only keep the parsed byterange object.\n\n delete event.attributes[key];\n }\n });\n this.trigger('data', event);\n return;\n }\n\n match = /^#EXT-X-RENDITION-REPORT:(.*)$/.exec(newLine);\n\n if (match && match[1]) {\n event = {\n type: 'tag',\n tagType: 'rendition-report'\n };\n event.attributes = parseAttributes(match[1]);\n ['LAST-MSN', 'LAST-PART'].forEach(function (key) {\n if (event.attributes.hasOwnProperty(key)) {\n event.attributes[key] = parseInt(event.attributes[key], 10);\n }\n });\n this.trigger('data', event);\n return;\n }\n\n match = /^#EXT-X-DATERANGE:(.*)$/.exec(newLine);\n\n if (match && match[1]) {\n event = {\n type: 'tag',\n tagType: 'daterange'\n };\n event.attributes = parseAttributes(match[1]);\n ['ID', 'CLASS'].forEach(function (key) {\n if (event.attributes.hasOwnProperty(key)) {\n event.attributes[key] = String(event.attributes[key]);\n }\n });\n ['START-DATE', 'END-DATE'].forEach(function (key) {\n if (event.attributes.hasOwnProperty(key)) {\n event.attributes[key] = new Date(event.attributes[key]);\n }\n });\n ['DURATION', 'PLANNED-DURATION'].forEach(function (key) {\n if (event.attributes.hasOwnProperty(key)) {\n event.attributes[key] = parseFloat(event.attributes[key]);\n }\n });\n ['END-ON-NEXT'].forEach(function (key) {\n if (event.attributes.hasOwnProperty(key)) {\n event.attributes[key] = /YES/i.test(event.attributes[key]);\n }\n });\n ['SCTE35-CMD', ' SCTE35-OUT', 'SCTE35-IN'].forEach(function (key) {\n if (event.attributes.hasOwnProperty(key)) {\n event.attributes[key] = event.attributes[key].toString(16);\n }\n });\n const clientAttributePattern = /^X-([A-Z]+-)+[A-Z]+$/;\n\n for (const key in event.attributes) {\n if (!clientAttributePattern.test(key)) {\n continue;\n }\n\n const isHexaDecimal = /[0-9A-Fa-f]{6}/g.test(event.attributes[key]);\n const isDecimalFloating = /^\\d+(\\.\\d+)?$/.test(event.attributes[key]);\n event.attributes[key] = isHexaDecimal ? event.attributes[key].toString(16) : isDecimalFloating ? parseFloat(event.attributes[key]) : String(event.attributes[key]);\n }\n\n this.trigger('data', event);\n return;\n }\n\n match = /^#EXT-X-INDEPENDENT-SEGMENTS/.exec(newLine);\n\n if (match) {\n this.trigger('data', {\n type: 'tag',\n tagType: 'independent-segments'\n });\n return;\n } // unknown tag type\n\n\n this.trigger('data', {\n type: 'tag',\n data: newLine.slice(4)\n });\n });\n }\n /**\n * Add a parser for custom headers\n *\n * @param {Object} options a map of options for the added parser\n * @param {RegExp} options.expression a regular expression to match the custom header\n * @param {string} options.customType the custom type to register to the output\n * @param {Function} [options.dataParser] function to parse the line into an object\n * @param {boolean} [options.segment] should tag data be attached to the segment object\n */\n\n\n addParser({\n expression,\n customType,\n dataParser,\n segment\n }) {\n if (typeof dataParser !== 'function') {\n dataParser = line => line;\n }\n\n this.customParsers.push(line => {\n const match = expression.exec(line);\n\n if (match) {\n this.trigger('data', {\n type: 'custom',\n data: dataParser(line),\n customType,\n segment\n });\n return true;\n }\n });\n }\n /**\n * Add a custom header mapper\n *\n * @param {Object} options\n * @param {RegExp} options.expression a regular expression to match the custom header\n * @param {Function} options.map function to translate tag into a different tag\n */\n\n\n addTagMapper({\n expression,\n map\n }) {\n const mapFn = line => {\n if (expression.test(line)) {\n return map(line);\n }\n\n return line;\n };\n\n this.tagMappers.push(mapFn);\n }\n\n}\n\nconst camelCase = str => str.toLowerCase().replace(/-(\\w)/g, a => a[1].toUpperCase());\n\nconst camelCaseKeys = function (attributes) {\n const result = {};\n Object.keys(attributes).forEach(function (key) {\n result[camelCase(key)] = attributes[key];\n });\n return result;\n}; // set SERVER-CONTROL hold back based upon targetDuration and partTargetDuration\n// we need this helper because defaults are based upon targetDuration and\n// partTargetDuration being set, but they may not be if SERVER-CONTROL appears before\n// target durations are set.\n\n\nconst setHoldBack = function (manifest) {\n const {\n serverControl,\n targetDuration,\n partTargetDuration\n } = manifest;\n\n if (!serverControl) {\n return;\n }\n\n const tag = '#EXT-X-SERVER-CONTROL';\n const hb = 'holdBack';\n const phb = 'partHoldBack';\n const minTargetDuration = targetDuration && targetDuration * 3;\n const minPartDuration = partTargetDuration && partTargetDuration * 2;\n\n if (targetDuration && !serverControl.hasOwnProperty(hb)) {\n serverControl[hb] = minTargetDuration;\n this.trigger('info', {\n message: `${tag} defaulting HOLD-BACK to targetDuration * 3 (${minTargetDuration}).`\n });\n }\n\n if (minTargetDuration && serverControl[hb] < minTargetDuration) {\n this.trigger('warn', {\n message: `${tag} clamping HOLD-BACK (${serverControl[hb]}) to targetDuration * 3 (${minTargetDuration})`\n });\n serverControl[hb] = minTargetDuration;\n } // default no part hold back to part target duration * 3\n\n\n if (partTargetDuration && !serverControl.hasOwnProperty(phb)) {\n serverControl[phb] = partTargetDuration * 3;\n this.trigger('info', {\n message: `${tag} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${serverControl[phb]}).`\n });\n } // if part hold back is too small default it to part target duration * 2\n\n\n if (partTargetDuration && serverControl[phb] < minPartDuration) {\n this.trigger('warn', {\n message: `${tag} clamping PART-HOLD-BACK (${serverControl[phb]}) to partTargetDuration * 2 (${minPartDuration}).`\n });\n serverControl[phb] = minPartDuration;\n }\n};\n/**\n * A parser for M3U8 files. The current interpretation of the input is\n * exposed as a property `manifest` on parser objects. It's just two lines to\n * create and parse a manifest once you have the contents available as a string:\n *\n * ```js\n * var parser = new m3u8.Parser();\n * parser.push(xhr.responseText);\n * ```\n *\n * New input can later be applied to update the manifest object by calling\n * `push` again.\n *\n * The parser attempts to create a usable manifest object even if the\n * underlying input is somewhat nonsensical. It emits `info` and `warning`\n * events during the parse if it encounters input that seems invalid or\n * requires some property of the manifest object to be defaulted.\n *\n * @class Parser\n * @extends Stream\n */\n\n\nclass Parser extends Stream {\n constructor() {\n super();\n this.lineStream = new LineStream();\n this.parseStream = new ParseStream();\n this.lineStream.pipe(this.parseStream);\n /* eslint-disable consistent-this */\n\n const self = this;\n /* eslint-enable consistent-this */\n\n const uris = [];\n let currentUri = {}; // if specified, the active EXT-X-MAP definition\n\n let currentMap; // if specified, the active decryption key\n\n let key;\n let hasParts = false;\n\n const noop = function () {};\n\n const defaultMediaGroups = {\n 'AUDIO': {},\n 'VIDEO': {},\n 'CLOSED-CAPTIONS': {},\n 'SUBTITLES': {}\n }; // This is the Widevine UUID from DASH IF IOP. The same exact string is\n // used in MPDs with Widevine encrypted streams.\n\n const widevineUuid = 'urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed'; // group segments into numbered timelines delineated by discontinuities\n\n let currentTimeline = 0; // the manifest is empty until the parse stream begins delivering data\n\n this.manifest = {\n allowCache: true,\n discontinuityStarts: [],\n segments: []\n }; // keep track of the last seen segment's byte range end, as segments are not required\n // to provide the offset, in which case it defaults to the next byte after the\n // previous segment\n\n let lastByterangeEnd = 0; // keep track of the last seen part's byte range end.\n\n let lastPartByterangeEnd = 0;\n const daterangeTags = {};\n this.on('end', () => {\n // only add preloadSegment if we don't yet have a uri for it.\n // and we actually have parts/preloadHints\n if (currentUri.uri || !currentUri.parts && !currentUri.preloadHints) {\n return;\n }\n\n if (!currentUri.map && currentMap) {\n currentUri.map = currentMap;\n }\n\n if (!currentUri.key && key) {\n currentUri.key = key;\n }\n\n if (!currentUri.timeline && typeof currentTimeline === 'number') {\n currentUri.timeline = currentTimeline;\n }\n\n this.manifest.preloadSegment = currentUri;\n }); // update the manifest with the m3u8 entry from the parse stream\n\n this.parseStream.on('data', function (entry) {\n let mediaGroup;\n let rendition;\n ({\n tag() {\n // switch based on the tag type\n (({\n version() {\n if (entry.version) {\n this.manifest.version = entry.version;\n }\n },\n\n 'allow-cache'() {\n this.manifest.allowCache = entry.allowed;\n\n if (!('allowed' in entry)) {\n this.trigger('info', {\n message: 'defaulting allowCache to YES'\n });\n this.manifest.allowCache = true;\n }\n },\n\n byterange() {\n const byterange = {};\n\n if ('length' in entry) {\n currentUri.byterange = byterange;\n byterange.length = entry.length;\n\n if (!('offset' in entry)) {\n /*\n * From the latest spec (as of this writing):\n * https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.2.2\n *\n * Same text since EXT-X-BYTERANGE's introduction in draft 7:\n * https://tools.ietf.org/html/draft-pantos-http-live-streaming-07#section-3.3.1)\n *\n * \"If o [offset] is not present, the sub-range begins at the next byte\n * following the sub-range of the previous media segment.\"\n */\n entry.offset = lastByterangeEnd;\n }\n }\n\n if ('offset' in entry) {\n currentUri.byterange = byterange;\n byterange.offset = entry.offset;\n }\n\n lastByterangeEnd = byterange.offset + byterange.length;\n },\n\n endlist() {\n this.manifest.endList = true;\n },\n\n inf() {\n if (!('mediaSequence' in this.manifest)) {\n this.manifest.mediaSequence = 0;\n this.trigger('info', {\n message: 'defaulting media sequence to zero'\n });\n }\n\n if (!('discontinuitySequence' in this.manifest)) {\n this.manifest.discontinuitySequence = 0;\n this.trigger('info', {\n message: 'defaulting discontinuity sequence to zero'\n });\n }\n\n if (entry.duration > 0) {\n currentUri.duration = entry.duration;\n }\n\n if (entry.duration === 0) {\n currentUri.duration = 0.01;\n this.trigger('info', {\n message: 'updating zero segment duration to a small value'\n });\n }\n\n this.manifest.segments = uris;\n },\n\n key() {\n if (!entry.attributes) {\n this.trigger('warn', {\n message: 'ignoring key declaration without attribute list'\n });\n return;\n } // clear the active encryption key\n\n\n if (entry.attributes.METHOD === 'NONE') {\n key = null;\n return;\n }\n\n if (!entry.attributes.URI) {\n this.trigger('warn', {\n message: 'ignoring key declaration without URI'\n });\n return;\n }\n\n if (entry.attributes.KEYFORMAT === 'com.apple.streamingkeydelivery') {\n this.manifest.contentProtection = this.manifest.contentProtection || {}; // TODO: add full support for this.\n\n this.manifest.contentProtection['com.apple.fps.1_0'] = {\n attributes: entry.attributes\n };\n return;\n }\n\n if (entry.attributes.KEYFORMAT === 'com.microsoft.playready') {\n this.manifest.contentProtection = this.manifest.contentProtection || {}; // TODO: add full support for this.\n\n this.manifest.contentProtection['com.microsoft.playready'] = {\n uri: entry.attributes.URI\n };\n return;\n } // check if the content is encrypted for Widevine\n // Widevine/HLS spec: https://storage.googleapis.com/wvdocs/Widevine_DRM_HLS.pdf\n\n\n if (entry.attributes.KEYFORMAT === widevineUuid) {\n const VALID_METHODS = ['SAMPLE-AES', 'SAMPLE-AES-CTR', 'SAMPLE-AES-CENC'];\n\n if (VALID_METHODS.indexOf(entry.attributes.METHOD) === -1) {\n this.trigger('warn', {\n message: 'invalid key method provided for Widevine'\n });\n return;\n }\n\n if (entry.attributes.METHOD === 'SAMPLE-AES-CENC') {\n this.trigger('warn', {\n message: 'SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead'\n });\n }\n\n if (entry.attributes.URI.substring(0, 23) !== 'data:text/plain;base64,') {\n this.trigger('warn', {\n message: 'invalid key URI provided for Widevine'\n });\n return;\n }\n\n if (!(entry.attributes.KEYID && entry.attributes.KEYID.substring(0, 2) === '0x')) {\n this.trigger('warn', {\n message: 'invalid key ID provided for Widevine'\n });\n return;\n } // if Widevine key attributes are valid, store them as `contentProtection`\n // on the manifest to emulate Widevine tag structure in a DASH mpd\n\n\n this.manifest.contentProtection = this.manifest.contentProtection || {};\n this.manifest.contentProtection['com.widevine.alpha'] = {\n attributes: {\n schemeIdUri: entry.attributes.KEYFORMAT,\n // remove '0x' from the key id string\n keyId: entry.attributes.KEYID.substring(2)\n },\n // decode the base64-encoded PSSH box\n pssh: decodeB64ToUint8Array(entry.attributes.URI.split(',')[1])\n };\n return;\n }\n\n if (!entry.attributes.METHOD) {\n this.trigger('warn', {\n message: 'defaulting key method to AES-128'\n });\n } // setup an encryption key for upcoming segments\n\n\n key = {\n method: entry.attributes.METHOD || 'AES-128',\n uri: entry.attributes.URI\n };\n\n if (typeof entry.attributes.IV !== 'undefined') {\n key.iv = entry.attributes.IV;\n }\n },\n\n 'media-sequence'() {\n if (!isFinite(entry.number)) {\n this.trigger('warn', {\n message: 'ignoring invalid media sequence: ' + entry.number\n });\n return;\n }\n\n this.manifest.mediaSequence = entry.number;\n },\n\n 'discontinuity-sequence'() {\n if (!isFinite(entry.number)) {\n this.trigger('warn', {\n message: 'ignoring invalid discontinuity sequence: ' + entry.number\n });\n return;\n }\n\n this.manifest.discontinuitySequence = entry.number;\n currentTimeline = entry.number;\n },\n\n 'playlist-type'() {\n if (!/VOD|EVENT/.test(entry.playlistType)) {\n this.trigger('warn', {\n message: 'ignoring unknown playlist type: ' + entry.playlist\n });\n return;\n }\n\n this.manifest.playlistType = entry.playlistType;\n },\n\n map() {\n currentMap = {};\n\n if (entry.uri) {\n currentMap.uri = entry.uri;\n }\n\n if (entry.byterange) {\n currentMap.byterange = entry.byterange;\n }\n\n if (key) {\n currentMap.key = key;\n }\n },\n\n 'stream-inf'() {\n this.manifest.playlists = uris;\n this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups;\n\n if (!entry.attributes) {\n this.trigger('warn', {\n message: 'ignoring empty stream-inf attributes'\n });\n return;\n }\n\n if (!currentUri.attributes) {\n currentUri.attributes = {};\n }\n\n _extends(currentUri.attributes, entry.attributes);\n },\n\n media() {\n this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups;\n\n if (!(entry.attributes && entry.attributes.TYPE && entry.attributes['GROUP-ID'] && entry.attributes.NAME)) {\n this.trigger('warn', {\n message: 'ignoring incomplete or missing media group'\n });\n return;\n } // find the media group, creating defaults as necessary\n\n\n const mediaGroupType = this.manifest.mediaGroups[entry.attributes.TYPE];\n mediaGroupType[entry.attributes['GROUP-ID']] = mediaGroupType[entry.attributes['GROUP-ID']] || {};\n mediaGroup = mediaGroupType[entry.attributes['GROUP-ID']]; // collect the rendition metadata\n\n rendition = {\n default: /yes/i.test(entry.attributes.DEFAULT)\n };\n\n if (rendition.default) {\n rendition.autoselect = true;\n } else {\n rendition.autoselect = /yes/i.test(entry.attributes.AUTOSELECT);\n }\n\n if (entry.attributes.LANGUAGE) {\n rendition.language = entry.attributes.LANGUAGE;\n }\n\n if (entry.attributes.URI) {\n rendition.uri = entry.attributes.URI;\n }\n\n if (entry.attributes['INSTREAM-ID']) {\n rendition.instreamId = entry.attributes['INSTREAM-ID'];\n }\n\n if (entry.attributes.CHARACTERISTICS) {\n rendition.characteristics = entry.attributes.CHARACTERISTICS;\n }\n\n if (entry.attributes.FORCED) {\n rendition.forced = /yes/i.test(entry.attributes.FORCED);\n } // insert the new rendition\n\n\n mediaGroup[entry.attributes.NAME] = rendition;\n },\n\n discontinuity() {\n currentTimeline += 1;\n currentUri.discontinuity = true;\n this.manifest.discontinuityStarts.push(uris.length);\n },\n\n 'program-date-time'() {\n if (typeof this.manifest.dateTimeString === 'undefined') {\n // PROGRAM-DATE-TIME is a media-segment tag, but for backwards\n // compatibility, we add the first occurence of the PROGRAM-DATE-TIME tag\n // to the manifest object\n // TODO: Consider removing this in future major version\n this.manifest.dateTimeString = entry.dateTimeString;\n this.manifest.dateTimeObject = entry.dateTimeObject;\n }\n\n currentUri.dateTimeString = entry.dateTimeString;\n currentUri.dateTimeObject = entry.dateTimeObject;\n },\n\n targetduration() {\n if (!isFinite(entry.duration) || entry.duration < 0) {\n this.trigger('warn', {\n message: 'ignoring invalid target duration: ' + entry.duration\n });\n return;\n }\n\n this.manifest.targetDuration = entry.duration;\n setHoldBack.call(this, this.manifest);\n },\n\n start() {\n if (!entry.attributes || isNaN(entry.attributes['TIME-OFFSET'])) {\n this.trigger('warn', {\n message: 'ignoring start declaration without appropriate attribute list'\n });\n return;\n }\n\n this.manifest.start = {\n timeOffset: entry.attributes['TIME-OFFSET'],\n precise: entry.attributes.PRECISE\n };\n },\n\n 'cue-out'() {\n currentUri.cueOut = entry.data;\n },\n\n 'cue-out-cont'() {\n currentUri.cueOutCont = entry.data;\n },\n\n 'cue-in'() {\n currentUri.cueIn = entry.data;\n },\n\n 'skip'() {\n this.manifest.skip = camelCaseKeys(entry.attributes);\n this.warnOnMissingAttributes_('#EXT-X-SKIP', entry.attributes, ['SKIPPED-SEGMENTS']);\n },\n\n 'part'() {\n hasParts = true; // parts are always specifed before a segment\n\n const segmentIndex = this.manifest.segments.length;\n const part = camelCaseKeys(entry.attributes);\n currentUri.parts = currentUri.parts || [];\n currentUri.parts.push(part);\n\n if (part.byterange) {\n if (!part.byterange.hasOwnProperty('offset')) {\n part.byterange.offset = lastPartByterangeEnd;\n }\n\n lastPartByterangeEnd = part.byterange.offset + part.byterange.length;\n }\n\n const partIndex = currentUri.parts.length - 1;\n this.warnOnMissingAttributes_(`#EXT-X-PART #${partIndex} for segment #${segmentIndex}`, entry.attributes, ['URI', 'DURATION']);\n\n if (this.manifest.renditionReports) {\n this.manifest.renditionReports.forEach((r, i) => {\n if (!r.hasOwnProperty('lastPart')) {\n this.trigger('warn', {\n message: `#EXT-X-RENDITION-REPORT #${i} lacks required attribute(s): LAST-PART`\n });\n }\n });\n }\n },\n\n 'server-control'() {\n const attrs = this.manifest.serverControl = camelCaseKeys(entry.attributes);\n\n if (!attrs.hasOwnProperty('canBlockReload')) {\n attrs.canBlockReload = false;\n this.trigger('info', {\n message: '#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false'\n });\n }\n\n setHoldBack.call(this, this.manifest);\n\n if (attrs.canSkipDateranges && !attrs.hasOwnProperty('canSkipUntil')) {\n this.trigger('warn', {\n message: '#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set'\n });\n }\n },\n\n 'preload-hint'() {\n // parts are always specifed before a segment\n const segmentIndex = this.manifest.segments.length;\n const hint = camelCaseKeys(entry.attributes);\n const isPart = hint.type && hint.type === 'PART';\n currentUri.preloadHints = currentUri.preloadHints || [];\n currentUri.preloadHints.push(hint);\n\n if (hint.byterange) {\n if (!hint.byterange.hasOwnProperty('offset')) {\n // use last part byterange end or zero if not a part.\n hint.byterange.offset = isPart ? lastPartByterangeEnd : 0;\n\n if (isPart) {\n lastPartByterangeEnd = hint.byterange.offset + hint.byterange.length;\n }\n }\n }\n\n const index = currentUri.preloadHints.length - 1;\n this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${index} for segment #${segmentIndex}`, entry.attributes, ['TYPE', 'URI']);\n\n if (!hint.type) {\n return;\n } // search through all preload hints except for the current one for\n // a duplicate type.\n\n\n for (let i = 0; i < currentUri.preloadHints.length - 1; i++) {\n const otherHint = currentUri.preloadHints[i];\n\n if (!otherHint.type) {\n continue;\n }\n\n if (otherHint.type === hint.type) {\n this.trigger('warn', {\n message: `#EXT-X-PRELOAD-HINT #${index} for segment #${segmentIndex} has the same TYPE ${hint.type} as preload hint #${i}`\n });\n }\n }\n },\n\n 'rendition-report'() {\n const report = camelCaseKeys(entry.attributes);\n this.manifest.renditionReports = this.manifest.renditionReports || [];\n this.manifest.renditionReports.push(report);\n const index = this.manifest.renditionReports.length - 1;\n const required = ['LAST-MSN', 'URI'];\n\n if (hasParts) {\n required.push('LAST-PART');\n }\n\n this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${index}`, entry.attributes, required);\n },\n\n 'part-inf'() {\n this.manifest.partInf = camelCaseKeys(entry.attributes);\n this.warnOnMissingAttributes_('#EXT-X-PART-INF', entry.attributes, ['PART-TARGET']);\n\n if (this.manifest.partInf.partTarget) {\n this.manifest.partTargetDuration = this.manifest.partInf.partTarget;\n }\n\n setHoldBack.call(this, this.manifest);\n },\n\n 'daterange'() {\n this.manifest.daterange = this.manifest.daterange || [];\n this.manifest.daterange.push(camelCaseKeys(entry.attributes));\n const index = this.manifest.daterange.length - 1;\n this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${index}`, entry.attributes, ['ID', 'START-DATE']);\n const daterange = this.manifest.daterange[index];\n\n if (daterange.endDate && daterange.startDate && new Date(daterange.endDate) < new Date(daterange.startDate)) {\n this.trigger('warn', {\n message: 'EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE'\n });\n }\n\n if (daterange.duration && daterange.duration < 0) {\n this.trigger('warn', {\n message: 'EXT-X-DATERANGE DURATION must not be negative'\n });\n }\n\n if (daterange.plannedDuration && daterange.plannedDuration < 0) {\n this.trigger('warn', {\n message: 'EXT-X-DATERANGE PLANNED-DURATION must not be negative'\n });\n }\n\n const endOnNextYes = !!daterange.endOnNext;\n\n if (endOnNextYes && !daterange.class) {\n this.trigger('warn', {\n message: 'EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute'\n });\n }\n\n if (endOnNextYes && (daterange.duration || daterange.endDate)) {\n this.trigger('warn', {\n message: 'EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes'\n });\n }\n\n if (daterange.duration && daterange.endDate) {\n const startDate = daterange.startDate;\n const newDateInSeconds = startDate.setSeconds(startDate.getSeconds() + daterange.duration);\n this.manifest.daterange[index].endDate = new Date(newDateInSeconds);\n }\n\n if (daterange && !this.manifest.dateTimeString) {\n this.trigger('warn', {\n message: 'A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag'\n });\n }\n\n if (!daterangeTags[daterange.id]) {\n daterangeTags[daterange.id] = daterange;\n } else {\n for (const attribute in daterangeTags[daterange.id]) {\n if (daterangeTags[daterange.id][attribute] !== daterange[attribute]) {\n this.trigger('warn', {\n message: 'EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes and same attribute values'\n });\n break;\n }\n }\n }\n },\n\n 'independent-segments'() {\n this.manifest.independentSegments = true;\n }\n\n })[entry.tagType] || noop).call(self);\n },\n\n uri() {\n currentUri.uri = entry.uri;\n uris.push(currentUri); // if no explicit duration was declared, use the target duration\n\n if (this.manifest.targetDuration && !('duration' in currentUri)) {\n this.trigger('warn', {\n message: 'defaulting segment duration to the target duration'\n });\n currentUri.duration = this.manifest.targetDuration;\n } // annotate with encryption information, if necessary\n\n\n if (key) {\n currentUri.key = key;\n }\n\n currentUri.timeline = currentTimeline; // annotate with initialization segment information, if necessary\n\n if (currentMap) {\n currentUri.map = currentMap;\n } // reset the last byterange end as it needs to be 0 between parts\n\n\n lastPartByterangeEnd = 0; // prepare for the next URI\n\n currentUri = {};\n },\n\n comment() {// comments are not important for playback\n },\n\n custom() {\n // if this is segment-level data attach the output to the segment\n if (entry.segment) {\n currentUri.custom = currentUri.custom || {};\n currentUri.custom[entry.customType] = entry.data; // if this is manifest-level data attach to the top level manifest object\n } else {\n this.manifest.custom = this.manifest.custom || {};\n this.manifest.custom[entry.customType] = entry.data;\n }\n }\n\n })[entry.type].call(self);\n });\n }\n\n warnOnMissingAttributes_(identifier, attributes, required) {\n const missing = [];\n required.forEach(function (key) {\n if (!attributes.hasOwnProperty(key)) {\n missing.push(key);\n }\n });\n\n if (missing.length) {\n this.trigger('warn', {\n message: `${identifier} lacks required attribute(s): ${missing.join(', ')}`\n });\n }\n }\n /**\n * Parse the input string and update the manifest object.\n *\n * @param {string} chunk a potentially incomplete portion of the manifest\n */\n\n\n push(chunk) {\n this.lineStream.push(chunk);\n }\n /**\n * Flush any remaining input. This can be handy if the last line of an M3U8\n * manifest did not contain a trailing newline but the file has been\n * completely received.\n */\n\n\n end() {\n // flush any buffered input\n this.lineStream.push('\\n');\n this.trigger('end');\n }\n /**\n * Add an additional parser for non-standard tags\n *\n * @param {Object} options a map of options for the added parser\n * @param {RegExp} options.expression a regular expression to match the custom header\n * @param {string} options.type the type to register to the output\n * @param {Function} [options.dataParser] function to parse the line into an object\n * @param {boolean} [options.segment] should tag data be attached to the segment object\n */\n\n\n addParser(options) {\n this.parseStream.addParser(options);\n }\n /**\n * Add a custom header mapper\n *\n * @param {Object} options\n * @param {RegExp} options.expression a regular expression to match the custom header\n * @param {Function} options.map function to translate tag into a different tag\n */\n\n\n addTagMapper(options) {\n this.parseStream.addTagMapper(options);\n }\n\n}\n\nexport { LineStream, ParseStream, Parser };\n","import window from 'global/window';\nvar regexs = {\n // to determine mime types\n mp4: /^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,\n webm: /^(vp0?[89]|av0?1|opus|vorbis)/,\n ogg: /^(vp0?[89]|theora|flac|opus|vorbis)/,\n // to determine if a codec is audio or video\n video: /^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,\n audio: /^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,\n text: /^(stpp.ttml.im1t)/,\n // mux.js support regex\n muxerVideo: /^(avc0?1)/,\n muxerAudio: /^(mp4a)/,\n // match nothing as muxer does not support text right now.\n // there cannot never be a character before the start of a string\n // so this matches nothing.\n muxerText: /a^/\n};\nvar mediaTypes = ['video', 'audio', 'text'];\nvar upperMediaTypes = ['Video', 'Audio', 'Text'];\n/**\n * Replace the old apple-style `avc1.<dd>.<dd>` codec string with the standard\n * `avc1.<hhhhhh>`\n *\n * @param {string} codec\n * Codec string to translate\n * @return {string}\n * The translated codec string\n */\n\nexport var translateLegacyCodec = function translateLegacyCodec(codec) {\n if (!codec) {\n return codec;\n }\n\n return codec.replace(/avc1\\.(\\d+)\\.(\\d+)/i, function (orig, profile, avcLevel) {\n var profileHex = ('00' + Number(profile).toString(16)).slice(-2);\n var avcLevelHex = ('00' + Number(avcLevel).toString(16)).slice(-2);\n return 'avc1.' + profileHex + '00' + avcLevelHex;\n });\n};\n/**\n * Replace the old apple-style `avc1.<dd>.<dd>` codec strings with the standard\n * `avc1.<hhhhhh>`\n *\n * @param {string[]} codecs\n * An array of codec strings to translate\n * @return {string[]}\n * The translated array of codec strings\n */\n\nexport var translateLegacyCodecs = function translateLegacyCodecs(codecs) {\n return codecs.map(translateLegacyCodec);\n};\n/**\n * Replace codecs in the codec string with the old apple-style `avc1.<dd>.<dd>` to the\n * standard `avc1.<hhhhhh>`.\n *\n * @param {string} codecString\n * The codec string\n * @return {string}\n * The codec string with old apple-style codecs replaced\n *\n * @private\n */\n\nexport var mapLegacyAvcCodecs = function mapLegacyAvcCodecs(codecString) {\n return codecString.replace(/avc1\\.(\\d+)\\.(\\d+)/i, function (match) {\n return translateLegacyCodecs([match])[0];\n });\n};\n/**\n * @typedef {Object} ParsedCodecInfo\n * @property {number} codecCount\n * Number of codecs parsed\n * @property {string} [videoCodec]\n * Parsed video codec (if found)\n * @property {string} [videoObjectTypeIndicator]\n * Video object type indicator (if found)\n * @property {string|null} audioProfile\n * Audio profile\n */\n\n/**\n * Parses a codec string to retrieve the number of codecs specified, the video codec and\n * object type indicator, and the audio profile.\n *\n * @param {string} [codecString]\n * The codec string to parse\n * @return {ParsedCodecInfo}\n * Parsed codec info\n */\n\nexport var parseCodecs = function parseCodecs(codecString) {\n if (codecString === void 0) {\n codecString = '';\n }\n\n var codecs = codecString.split(',');\n var result = [];\n codecs.forEach(function (codec) {\n codec = codec.trim();\n var codecType;\n mediaTypes.forEach(function (name) {\n var match = regexs[name].exec(codec.toLowerCase());\n\n if (!match || match.length <= 1) {\n return;\n }\n\n codecType = name; // maintain codec case\n\n var type = codec.substring(0, match[1].length);\n var details = codec.replace(type, '');\n result.push({\n type: type,\n details: details,\n mediaType: name\n });\n });\n\n if (!codecType) {\n result.push({\n type: codec,\n details: '',\n mediaType: 'unknown'\n });\n }\n });\n return result;\n};\n/**\n * Returns a ParsedCodecInfo object for the default alternate audio playlist if there is\n * a default alternate audio playlist for the provided audio group.\n *\n * @param {Object} master\n * The master playlist\n * @param {string} audioGroupId\n * ID of the audio group for which to find the default codec info\n * @return {ParsedCodecInfo}\n * Parsed codec info\n */\n\nexport var codecsFromDefault = function codecsFromDefault(master, audioGroupId) {\n if (!master.mediaGroups.AUDIO || !audioGroupId) {\n return null;\n }\n\n var audioGroup = master.mediaGroups.AUDIO[audioGroupId];\n\n if (!audioGroup) {\n return null;\n }\n\n for (var name in audioGroup) {\n var audioType = audioGroup[name];\n\n if (audioType.default && audioType.playlists) {\n // codec should be the same for all playlists within the audio type\n return parseCodecs(audioType.playlists[0].attributes.CODECS);\n }\n }\n\n return null;\n};\nexport var isVideoCodec = function isVideoCodec(codec) {\n if (codec === void 0) {\n codec = '';\n }\n\n return regexs.video.test(codec.trim().toLowerCase());\n};\nexport var isAudioCodec = function isAudioCodec(codec) {\n if (codec === void 0) {\n codec = '';\n }\n\n return regexs.audio.test(codec.trim().toLowerCase());\n};\nexport var isTextCodec = function isTextCodec(codec) {\n if (codec === void 0) {\n codec = '';\n }\n\n return regexs.text.test(codec.trim().toLowerCase());\n};\nexport var getMimeForCodec = function getMimeForCodec(codecString) {\n if (!codecString || typeof codecString !== 'string') {\n return;\n }\n\n var codecs = codecString.toLowerCase().split(',').map(function (c) {\n return translateLegacyCodec(c.trim());\n }); // default to video type\n\n var type = 'video'; // only change to audio type if the only codec we have is\n // audio\n\n if (codecs.length === 1 && isAudioCodec(codecs[0])) {\n type = 'audio';\n } else if (codecs.length === 1 && isTextCodec(codecs[0])) {\n // text uses application/<container> for now\n type = 'application';\n } // default the container to mp4\n\n\n var container = 'mp4'; // every codec must be able to go into the container\n // for that container to be the correct one\n\n if (codecs.every(function (c) {\n return regexs.mp4.test(c);\n })) {\n container = 'mp4';\n } else if (codecs.every(function (c) {\n return regexs.webm.test(c);\n })) {\n container = 'webm';\n } else if (codecs.every(function (c) {\n return regexs.ogg.test(c);\n })) {\n container = 'ogg';\n }\n\n return type + \"/\" + container + \";codecs=\\\"\" + codecString + \"\\\"\";\n};\nexport var browserSupportsCodec = function browserSupportsCodec(codecString) {\n if (codecString === void 0) {\n codecString = '';\n }\n\n return window.MediaSource && window.MediaSource.isTypeSupported && window.MediaSource.isTypeSupported(getMimeForCodec(codecString)) || false;\n};\nexport var muxerSupportsCodec = function muxerSupportsCodec(codecString) {\n if (codecString === void 0) {\n codecString = '';\n }\n\n return codecString.toLowerCase().split(',').every(function (codec) {\n codec = codec.trim(); // any match is supported.\n\n for (var i = 0; i < upperMediaTypes.length; i++) {\n var type = upperMediaTypes[i];\n\n if (regexs[\"muxer\" + type].test(codec)) {\n return true;\n }\n }\n\n return false;\n });\n};\nexport var DEFAULT_AUDIO_CODEC = 'mp4a.40.2';\nexport var DEFAULT_VIDEO_CODEC = 'avc1.4d400d';","var MPEGURL_REGEX = /^(audio|video|application)\\/(x-|vnd\\.apple\\.)?mpegurl/i;\nvar DASH_REGEX = /^application\\/dash\\+xml/i;\n/**\n * Returns a string that describes the type of source based on a video source object's\n * media type.\n *\n * @see {@link https://dev.w3.org/html5/pf-summary/video.html#dom-source-type|Source Type}\n *\n * @param {string} type\n * Video source object media type\n * @return {('hls'|'dash'|'vhs-json'|null)}\n * VHS source type string\n */\n\nexport var simpleTypeFromSourceType = function simpleTypeFromSourceType(type) {\n if (MPEGURL_REGEX.test(type)) {\n return 'hls';\n }\n\n if (DASH_REGEX.test(type)) {\n return 'dash';\n } // Denotes the special case of a manifest object passed to http-streaming instead of a\n // source URL.\n //\n // See https://en.wikipedia.org/wiki/Media_type for details on specifying media types.\n //\n // In this case, vnd stands for vendor, video.js for the organization, VHS for this\n // project, and the +json suffix identifies the structure of the media type.\n\n\n if (type === 'application/vnd.videojs.vhs+json') {\n return 'vhs-json';\n }\n\n return null;\n};","import window from 'global/window'; // const log2 = Math.log2 ? Math.log2 : (x) => (Math.log(x) / Math.log(2));\n\nvar repeat = function repeat(str, len) {\n var acc = '';\n\n while (len--) {\n acc += str;\n }\n\n return acc;\n}; // count the number of bits it would take to represent a number\n// we used to do this with log2 but BigInt does not support builtin math\n// Math.ceil(log2(x));\n\n\nexport var countBits = function countBits(x) {\n return x.toString(2).length;\n}; // count the number of whole bytes it would take to represent a number\n\nexport var countBytes = function countBytes(x) {\n return Math.ceil(countBits(x) / 8);\n};\nexport var padStart = function padStart(b, len, str) {\n if (str === void 0) {\n str = ' ';\n }\n\n return (repeat(str, len) + b.toString()).slice(-len);\n};\nexport var isArrayBufferView = function isArrayBufferView(obj) {\n if (ArrayBuffer.isView === 'function') {\n return ArrayBuffer.isView(obj);\n }\n\n return obj && obj.buffer instanceof ArrayBuffer;\n};\nexport var isTypedArray = function isTypedArray(obj) {\n return isArrayBufferView(obj);\n};\nexport var toUint8 = function toUint8(bytes) {\n if (bytes instanceof Uint8Array) {\n return bytes;\n }\n\n if (!Array.isArray(bytes) && !isTypedArray(bytes) && !(bytes instanceof ArrayBuffer)) {\n // any non-number or NaN leads to empty uint8array\n // eslint-disable-next-line\n if (typeof bytes !== 'number' || typeof bytes === 'number' && bytes !== bytes) {\n bytes = 0;\n } else {\n bytes = [bytes];\n }\n }\n\n return new Uint8Array(bytes && bytes.buffer || bytes, bytes && bytes.byteOffset || 0, bytes && bytes.byteLength || 0);\n};\nexport var toHexString = function toHexString(bytes) {\n bytes = toUint8(bytes);\n var str = '';\n\n for (var i = 0; i < bytes.length; i++) {\n str += padStart(bytes[i].toString(16), 2, '0');\n }\n\n return str;\n};\nexport var toBinaryString = function toBinaryString(bytes) {\n bytes = toUint8(bytes);\n var str = '';\n\n for (var i = 0; i < bytes.length; i++) {\n str += padStart(bytes[i].toString(2), 8, '0');\n }\n\n return str;\n};\nvar BigInt = window.BigInt || Number;\nvar BYTE_TABLE = [BigInt('0x1'), BigInt('0x100'), BigInt('0x10000'), BigInt('0x1000000'), BigInt('0x100000000'), BigInt('0x10000000000'), BigInt('0x1000000000000'), BigInt('0x100000000000000'), BigInt('0x10000000000000000')];\nexport var ENDIANNESS = function () {\n var a = new Uint16Array([0xFFCC]);\n var b = new Uint8Array(a.buffer, a.byteOffset, a.byteLength);\n\n if (b[0] === 0xFF) {\n return 'big';\n }\n\n if (b[0] === 0xCC) {\n return 'little';\n }\n\n return 'unknown';\n}();\nexport var IS_BIG_ENDIAN = ENDIANNESS === 'big';\nexport var IS_LITTLE_ENDIAN = ENDIANNESS === 'little';\nexport var bytesToNumber = function bytesToNumber(bytes, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$signed = _ref.signed,\n signed = _ref$signed === void 0 ? false : _ref$signed,\n _ref$le = _ref.le,\n le = _ref$le === void 0 ? false : _ref$le;\n\n bytes = toUint8(bytes);\n var fn = le ? 'reduce' : 'reduceRight';\n var obj = bytes[fn] ? bytes[fn] : Array.prototype[fn];\n var number = obj.call(bytes, function (total, byte, i) {\n var exponent = le ? i : Math.abs(i + 1 - bytes.length);\n return total + BigInt(byte) * BYTE_TABLE[exponent];\n }, BigInt(0));\n\n if (signed) {\n var max = BYTE_TABLE[bytes.length] / BigInt(2) - BigInt(1);\n number = BigInt(number);\n\n if (number > max) {\n number -= max;\n number -= max;\n number -= BigInt(2);\n }\n }\n\n return Number(number);\n};\nexport var numberToBytes = function numberToBytes(number, _temp2) {\n var _ref2 = _temp2 === void 0 ? {} : _temp2,\n _ref2$le = _ref2.le,\n le = _ref2$le === void 0 ? false : _ref2$le;\n\n // eslint-disable-next-line\n if (typeof number !== 'bigint' && typeof number !== 'number' || typeof number === 'number' && number !== number) {\n number = 0;\n }\n\n number = BigInt(number);\n var byteCount = countBytes(number);\n var bytes = new Uint8Array(new ArrayBuffer(byteCount));\n\n for (var i = 0; i < byteCount; i++) {\n var byteIndex = le ? i : Math.abs(i + 1 - bytes.length);\n bytes[byteIndex] = Number(number / BYTE_TABLE[i] & BigInt(0xFF));\n\n if (number < 0) {\n bytes[byteIndex] = Math.abs(~bytes[byteIndex]);\n bytes[byteIndex] -= i === 0 ? 1 : 2;\n }\n }\n\n return bytes;\n};\nexport var bytesToString = function bytesToString(bytes) {\n if (!bytes) {\n return '';\n } // TODO: should toUint8 handle cases where we only have 8 bytes\n // but report more since this is a Uint16+ Array?\n\n\n bytes = Array.prototype.slice.call(bytes);\n var string = String.fromCharCode.apply(null, toUint8(bytes));\n\n try {\n return decodeURIComponent(escape(string));\n } catch (e) {// if decodeURIComponent/escape fails, we are dealing with partial\n // or full non string data. Just return the potentially garbled string.\n }\n\n return string;\n};\nexport var stringToBytes = function stringToBytes(string, stringIsBytes) {\n if (typeof string !== 'string' && string && typeof string.toString === 'function') {\n string = string.toString();\n }\n\n if (typeof string !== 'string') {\n return new Uint8Array();\n } // If the string already is bytes, we don't have to do this\n // otherwise we do this so that we split multi length characters\n // into individual bytes\n\n\n if (!stringIsBytes) {\n string = unescape(encodeURIComponent(string));\n }\n\n var view = new Uint8Array(string.length);\n\n for (var i = 0; i < string.length; i++) {\n view[i] = string.charCodeAt(i);\n }\n\n return view;\n};\nexport var concatTypedArrays = function concatTypedArrays() {\n for (var _len = arguments.length, buffers = new Array(_len), _key = 0; _key < _len; _key++) {\n buffers[_key] = arguments[_key];\n }\n\n buffers = buffers.filter(function (b) {\n return b && (b.byteLength || b.length) && typeof b !== 'string';\n });\n\n if (buffers.length <= 1) {\n // for 0 length we will return empty uint8\n // for 1 length we return the first uint8\n return toUint8(buffers[0]);\n }\n\n var totalLen = buffers.reduce(function (total, buf, i) {\n return total + (buf.byteLength || buf.length);\n }, 0);\n var tempBuffer = new Uint8Array(totalLen);\n var offset = 0;\n buffers.forEach(function (buf) {\n buf = toUint8(buf);\n tempBuffer.set(buf, offset);\n offset += buf.byteLength;\n });\n return tempBuffer;\n};\n/**\n * Check if the bytes \"b\" are contained within bytes \"a\".\n *\n * @param {Uint8Array|Array} a\n * Bytes to check in\n *\n * @param {Uint8Array|Array} b\n * Bytes to check for\n *\n * @param {Object} options\n * options\n *\n * @param {Array|Uint8Array} [offset=0]\n * offset to use when looking at bytes in a\n *\n * @param {Array|Uint8Array} [mask=[]]\n * mask to use on bytes before comparison.\n *\n * @return {boolean}\n * If all bytes in b are inside of a, taking into account\n * bit masks.\n */\n\nexport var bytesMatch = function bytesMatch(a, b, _temp3) {\n var _ref3 = _temp3 === void 0 ? {} : _temp3,\n _ref3$offset = _ref3.offset,\n offset = _ref3$offset === void 0 ? 0 : _ref3$offset,\n _ref3$mask = _ref3.mask,\n mask = _ref3$mask === void 0 ? [] : _ref3$mask;\n\n a = toUint8(a);\n b = toUint8(b); // ie 11 does not support uint8 every\n\n var fn = b.every ? b.every : Array.prototype.every;\n return b.length && a.length - offset >= b.length && // ie 11 doesn't support every on uin8\n fn.call(b, function (bByte, i) {\n var aByte = mask[i] ? mask[i] & a[offset + i] : a[offset + i];\n return bByte === aByte;\n });\n};\nexport var sliceBytes = function sliceBytes(src, start, end) {\n if (Uint8Array.prototype.slice) {\n return Uint8Array.prototype.slice.call(src, start, end);\n }\n\n return new Uint8Array(Array.prototype.slice.call(src, start, end));\n};\nexport var reverseBytes = function reverseBytes(src) {\n if (src.reverse) {\n return src.reverse();\n }\n\n return Array.prototype.reverse.call(src);\n};","import URLToolkit from 'url-toolkit';\nimport window from 'global/window';\nvar DEFAULT_LOCATION = 'http://example.com';\n\nvar resolveUrl = function resolveUrl(baseUrl, relativeUrl) {\n // return early if we don't need to resolve\n if (/^[a-z]+:/i.test(relativeUrl)) {\n return relativeUrl;\n } // if baseUrl is a data URI, ignore it and resolve everything relative to window.location\n\n\n if (/^data:/.test(baseUrl)) {\n baseUrl = window.location && window.location.href || '';\n } // IE11 supports URL but not the URL constructor\n // feature detect the behavior we want\n\n\n var nativeURL = typeof window.URL === 'function';\n var protocolLess = /^\\/\\//.test(baseUrl); // remove location if window.location isn't available (i.e. we're in node)\n // and if baseUrl isn't an absolute url\n\n var removeLocation = !window.location && !/\\/\\//i.test(baseUrl); // if the base URL is relative then combine with the current location\n\n if (nativeURL) {\n baseUrl = new window.URL(baseUrl, window.location || DEFAULT_LOCATION);\n } else if (!/\\/\\//i.test(baseUrl)) {\n baseUrl = URLToolkit.buildAbsoluteURL(window.location && window.location.href || '', baseUrl);\n }\n\n if (nativeURL) {\n var newUrl = new URL(relativeUrl, baseUrl); // if we're a protocol-less url, remove the protocol\n // and if we're location-less, remove the location\n // otherwise, return the url unmodified\n\n if (removeLocation) {\n return newUrl.href.slice(DEFAULT_LOCATION.length);\n } else if (protocolLess) {\n return newUrl.href.slice(newUrl.protocol.length);\n }\n\n return newUrl.href;\n }\n\n return URLToolkit.buildAbsoluteURL(baseUrl, relativeUrl);\n};\n\nexport default resolveUrl;","/*! @name mpd-parser @version 1.2.2 @license Apache-2.0 */\nimport resolveUrl from '@videojs/vhs-utils/es/resolve-url';\nimport window from 'global/window';\nimport { forEachMediaGroup } from '@videojs/vhs-utils/es/media-groups';\nimport decodeB64ToUint8Array from '@videojs/vhs-utils/es/decode-b64-to-uint8-array';\nimport { DOMParser } from '@xmldom/xmldom';\n\nvar version = \"1.2.2\";\n\nconst isObject = obj => {\n return !!obj && typeof obj === 'object';\n};\n\nconst merge = (...objects) => {\n return objects.reduce((result, source) => {\n if (typeof source !== 'object') {\n return result;\n }\n\n Object.keys(source).forEach(key => {\n if (Array.isArray(result[key]) && Array.isArray(source[key])) {\n result[key] = result[key].concat(source[key]);\n } else if (isObject(result[key]) && isObject(source[key])) {\n result[key] = merge(result[key], source[key]);\n } else {\n result[key] = source[key];\n }\n });\n return result;\n }, {});\n};\nconst values = o => Object.keys(o).map(k => o[k]);\n\nconst range = (start, end) => {\n const result = [];\n\n for (let i = start; i < end; i++) {\n result.push(i);\n }\n\n return result;\n};\nconst flatten = lists => lists.reduce((x, y) => x.concat(y), []);\nconst from = list => {\n if (!list.length) {\n return [];\n }\n\n const result = [];\n\n for (let i = 0; i < list.length; i++) {\n result.push(list[i]);\n }\n\n return result;\n};\nconst findIndexes = (l, key) => l.reduce((a, e, i) => {\n if (e[key]) {\n a.push(i);\n }\n\n return a;\n}, []);\n/**\n * Returns a union of the included lists provided each element can be identified by a key.\n *\n * @param {Array} list - list of lists to get the union of\n * @param {Function} keyFunction - the function to use as a key for each element\n *\n * @return {Array} the union of the arrays\n */\n\nconst union = (lists, keyFunction) => {\n return values(lists.reduce((acc, list) => {\n list.forEach(el => {\n acc[keyFunction(el)] = el;\n });\n return acc;\n }, {}));\n};\n\nvar errors = {\n INVALID_NUMBER_OF_PERIOD: 'INVALID_NUMBER_OF_PERIOD',\n INVALID_NUMBER_OF_CONTENT_STEERING: 'INVALID_NUMBER_OF_CONTENT_STEERING',\n DASH_EMPTY_MANIFEST: 'DASH_EMPTY_MANIFEST',\n DASH_INVALID_XML: 'DASH_INVALID_XML',\n NO_BASE_URL: 'NO_BASE_URL',\n MISSING_SEGMENT_INFORMATION: 'MISSING_SEGMENT_INFORMATION',\n SEGMENT_TIME_UNSPECIFIED: 'SEGMENT_TIME_UNSPECIFIED',\n UNSUPPORTED_UTC_TIMING_SCHEME: 'UNSUPPORTED_UTC_TIMING_SCHEME'\n};\n\n/**\n * @typedef {Object} SingleUri\n * @property {string} uri - relative location of segment\n * @property {string} resolvedUri - resolved location of segment\n * @property {Object} byterange - Object containing information on how to make byte range\n * requests following byte-range-spec per RFC2616.\n * @property {String} byterange.length - length of range request\n * @property {String} byterange.offset - byte offset of range request\n *\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.1\n */\n\n/**\n * Converts a URLType node (5.3.9.2.3 Table 13) to a segment object\n * that conforms to how m3u8-parser is structured\n *\n * @see https://github.com/videojs/m3u8-parser\n *\n * @param {string} baseUrl - baseUrl provided by <BaseUrl> nodes\n * @param {string} source - source url for segment\n * @param {string} range - optional range used for range calls,\n * follows RFC 2616, Clause 14.35.1\n * @return {SingleUri} full segment information transformed into a format similar\n * to m3u8-parser\n */\n\nconst urlTypeToSegment = ({\n baseUrl = '',\n source = '',\n range = '',\n indexRange = ''\n}) => {\n const segment = {\n uri: source,\n resolvedUri: resolveUrl(baseUrl || '', source)\n };\n\n if (range || indexRange) {\n const rangeStr = range ? range : indexRange;\n const ranges = rangeStr.split('-'); // default to parsing this as a BigInt if possible\n\n let startRange = window.BigInt ? window.BigInt(ranges[0]) : parseInt(ranges[0], 10);\n let endRange = window.BigInt ? window.BigInt(ranges[1]) : parseInt(ranges[1], 10); // convert back to a number if less than MAX_SAFE_INTEGER\n\n if (startRange < Number.MAX_SAFE_INTEGER && typeof startRange === 'bigint') {\n startRange = Number(startRange);\n }\n\n if (endRange < Number.MAX_SAFE_INTEGER && typeof endRange === 'bigint') {\n endRange = Number(endRange);\n }\n\n let length;\n\n if (typeof endRange === 'bigint' || typeof startRange === 'bigint') {\n length = window.BigInt(endRange) - window.BigInt(startRange) + window.BigInt(1);\n } else {\n length = endRange - startRange + 1;\n }\n\n if (typeof length === 'bigint' && length < Number.MAX_SAFE_INTEGER) {\n length = Number(length);\n } // byterange should be inclusive according to\n // RFC 2616, Clause 14.35.1\n\n\n segment.byterange = {\n length,\n offset: startRange\n };\n }\n\n return segment;\n};\nconst byteRangeToString = byterange => {\n // `endRange` is one less than `offset + length` because the HTTP range\n // header uses inclusive ranges\n let endRange;\n\n if (typeof byterange.offset === 'bigint' || typeof byterange.length === 'bigint') {\n endRange = window.BigInt(byterange.offset) + window.BigInt(byterange.length) - window.BigInt(1);\n } else {\n endRange = byterange.offset + byterange.length - 1;\n }\n\n return `${byterange.offset}-${endRange}`;\n};\n\n/**\n * parse the end number attribue that can be a string\n * number, or undefined.\n *\n * @param {string|number|undefined} endNumber\n * The end number attribute.\n *\n * @return {number|null}\n * The result of parsing the end number.\n */\n\nconst parseEndNumber = endNumber => {\n if (endNumber && typeof endNumber !== 'number') {\n endNumber = parseInt(endNumber, 10);\n }\n\n if (isNaN(endNumber)) {\n return null;\n }\n\n return endNumber;\n};\n/**\n * Functions for calculating the range of available segments in static and dynamic\n * manifests.\n */\n\n\nconst segmentRange = {\n /**\n * Returns the entire range of available segments for a static MPD\n *\n * @param {Object} attributes\n * Inheritied MPD attributes\n * @return {{ start: number, end: number }}\n * The start and end numbers for available segments\n */\n static(attributes) {\n const {\n duration,\n timescale = 1,\n sourceDuration,\n periodDuration\n } = attributes;\n const endNumber = parseEndNumber(attributes.endNumber);\n const segmentDuration = duration / timescale;\n\n if (typeof endNumber === 'number') {\n return {\n start: 0,\n end: endNumber\n };\n }\n\n if (typeof periodDuration === 'number') {\n return {\n start: 0,\n end: periodDuration / segmentDuration\n };\n }\n\n return {\n start: 0,\n end: sourceDuration / segmentDuration\n };\n },\n\n /**\n * Returns the current live window range of available segments for a dynamic MPD\n *\n * @param {Object} attributes\n * Inheritied MPD attributes\n * @return {{ start: number, end: number }}\n * The start and end numbers for available segments\n */\n dynamic(attributes) {\n const {\n NOW,\n clientOffset,\n availabilityStartTime,\n timescale = 1,\n duration,\n periodStart = 0,\n minimumUpdatePeriod = 0,\n timeShiftBufferDepth = Infinity\n } = attributes;\n const endNumber = parseEndNumber(attributes.endNumber); // clientOffset is passed in at the top level of mpd-parser and is an offset calculated\n // after retrieving UTC server time.\n\n const now = (NOW + clientOffset) / 1000; // WC stands for Wall Clock.\n // Convert the period start time to EPOCH.\n\n const periodStartWC = availabilityStartTime + periodStart; // Period end in EPOCH is manifest's retrieval time + time until next update.\n\n const periodEndWC = now + minimumUpdatePeriod;\n const periodDuration = periodEndWC - periodStartWC;\n const segmentCount = Math.ceil(periodDuration * timescale / duration);\n const availableStart = Math.floor((now - periodStartWC - timeShiftBufferDepth) * timescale / duration);\n const availableEnd = Math.floor((now - periodStartWC) * timescale / duration);\n return {\n start: Math.max(0, availableStart),\n end: typeof endNumber === 'number' ? endNumber : Math.min(segmentCount, availableEnd)\n };\n }\n\n};\n/**\n * Maps a range of numbers to objects with information needed to build the corresponding\n * segment list\n *\n * @name toSegmentsCallback\n * @function\n * @param {number} number\n * Number of the segment\n * @param {number} index\n * Index of the number in the range list\n * @return {{ number: Number, duration: Number, timeline: Number, time: Number }}\n * Object with segment timing and duration info\n */\n\n/**\n * Returns a callback for Array.prototype.map for mapping a range of numbers to\n * information needed to build the segment list.\n *\n * @param {Object} attributes\n * Inherited MPD attributes\n * @return {toSegmentsCallback}\n * Callback map function\n */\n\nconst toSegments = attributes => number => {\n const {\n duration,\n timescale = 1,\n periodStart,\n startNumber = 1\n } = attributes;\n return {\n number: startNumber + number,\n duration: duration / timescale,\n timeline: periodStart,\n time: number * duration\n };\n};\n/**\n * Returns a list of objects containing segment timing and duration info used for\n * building the list of segments. This uses the @duration attribute specified\n * in the MPD manifest to derive the range of segments.\n *\n * @param {Object} attributes\n * Inherited MPD attributes\n * @return {{number: number, duration: number, time: number, timeline: number}[]}\n * List of Objects with segment timing and duration info\n */\n\nconst parseByDuration = attributes => {\n const {\n type,\n duration,\n timescale = 1,\n periodDuration,\n sourceDuration\n } = attributes;\n const {\n start,\n end\n } = segmentRange[type](attributes);\n const segments = range(start, end).map(toSegments(attributes));\n\n if (type === 'static') {\n const index = segments.length - 1; // section is either a period or the full source\n\n const sectionDuration = typeof periodDuration === 'number' ? periodDuration : sourceDuration; // final segment may be less than full segment duration\n\n segments[index].duration = sectionDuration - duration / timescale * index;\n }\n\n return segments;\n};\n\n/**\n * Translates SegmentBase into a set of segments.\n * (DASH SPEC Section 5.3.9.3.2) contains a set of <SegmentURL> nodes. Each\n * node should be translated into segment.\n *\n * @param {Object} attributes\n * Object containing all inherited attributes from parent elements with attribute\n * names as keys\n * @return {Object.<Array>} list of segments\n */\n\nconst segmentsFromBase = attributes => {\n const {\n baseUrl,\n initialization = {},\n sourceDuration,\n indexRange = '',\n periodStart,\n presentationTime,\n number = 0,\n duration\n } = attributes; // base url is required for SegmentBase to work, per spec (Section 5.3.9.2.1)\n\n if (!baseUrl) {\n throw new Error(errors.NO_BASE_URL);\n }\n\n const initSegment = urlTypeToSegment({\n baseUrl,\n source: initialization.sourceURL,\n range: initialization.range\n });\n const segment = urlTypeToSegment({\n baseUrl,\n source: baseUrl,\n indexRange\n });\n segment.map = initSegment; // If there is a duration, use it, otherwise use the given duration of the source\n // (since SegmentBase is only for one total segment)\n\n if (duration) {\n const segmentTimeInfo = parseByDuration(attributes);\n\n if (segmentTimeInfo.length) {\n segment.duration = segmentTimeInfo[0].duration;\n segment.timeline = segmentTimeInfo[0].timeline;\n }\n } else if (sourceDuration) {\n segment.duration = sourceDuration;\n segment.timeline = periodStart;\n } // If presentation time is provided, these segments are being generated by SIDX\n // references, and should use the time provided. For the general case of SegmentBase,\n // there should only be one segment in the period, so its presentation time is the same\n // as its period start.\n\n\n segment.presentationTime = presentationTime || periodStart;\n segment.number = number;\n return [segment];\n};\n/**\n * Given a playlist, a sidx box, and a baseUrl, update the segment list of the playlist\n * according to the sidx information given.\n *\n * playlist.sidx has metadadata about the sidx where-as the sidx param\n * is the parsed sidx box itself.\n *\n * @param {Object} playlist the playlist to update the sidx information for\n * @param {Object} sidx the parsed sidx box\n * @return {Object} the playlist object with the updated sidx information\n */\n\nconst addSidxSegmentsToPlaylist$1 = (playlist, sidx, baseUrl) => {\n // Retain init segment information\n const initSegment = playlist.sidx.map ? playlist.sidx.map : null; // Retain source duration from initial main manifest parsing\n\n const sourceDuration = playlist.sidx.duration; // Retain source timeline\n\n const timeline = playlist.timeline || 0;\n const sidxByteRange = playlist.sidx.byterange;\n const sidxEnd = sidxByteRange.offset + sidxByteRange.length; // Retain timescale of the parsed sidx\n\n const timescale = sidx.timescale; // referenceType 1 refers to other sidx boxes\n\n const mediaReferences = sidx.references.filter(r => r.referenceType !== 1);\n const segments = [];\n const type = playlist.endList ? 'static' : 'dynamic';\n const periodStart = playlist.sidx.timeline;\n let presentationTime = periodStart;\n let number = playlist.mediaSequence || 0; // firstOffset is the offset from the end of the sidx box\n\n let startIndex; // eslint-disable-next-line\n\n if (typeof sidx.firstOffset === 'bigint') {\n startIndex = window.BigInt(sidxEnd) + sidx.firstOffset;\n } else {\n startIndex = sidxEnd + sidx.firstOffset;\n }\n\n for (let i = 0; i < mediaReferences.length; i++) {\n const reference = sidx.references[i]; // size of the referenced (sub)segment\n\n const size = reference.referencedSize; // duration of the referenced (sub)segment, in the timescale\n // this will be converted to seconds when generating segments\n\n const duration = reference.subsegmentDuration; // should be an inclusive range\n\n let endIndex; // eslint-disable-next-line\n\n if (typeof startIndex === 'bigint') {\n endIndex = startIndex + window.BigInt(size) - window.BigInt(1);\n } else {\n endIndex = startIndex + size - 1;\n }\n\n const indexRange = `${startIndex}-${endIndex}`;\n const attributes = {\n baseUrl,\n timescale,\n timeline,\n periodStart,\n presentationTime,\n number,\n duration,\n sourceDuration,\n indexRange,\n type\n };\n const segment = segmentsFromBase(attributes)[0];\n\n if (initSegment) {\n segment.map = initSegment;\n }\n\n segments.push(segment);\n\n if (typeof startIndex === 'bigint') {\n startIndex += window.BigInt(size);\n } else {\n startIndex += size;\n }\n\n presentationTime += duration / timescale;\n number++;\n }\n\n playlist.segments = segments;\n return playlist;\n};\n\nconst SUPPORTED_MEDIA_TYPES = ['AUDIO', 'SUBTITLES']; // allow one 60fps frame as leniency (arbitrarily chosen)\n\nconst TIME_FUDGE = 1 / 60;\n/**\n * Given a list of timelineStarts, combines, dedupes, and sorts them.\n *\n * @param {TimelineStart[]} timelineStarts - list of timeline starts\n *\n * @return {TimelineStart[]} the combined and deduped timeline starts\n */\n\nconst getUniqueTimelineStarts = timelineStarts => {\n return union(timelineStarts, ({\n timeline\n }) => timeline).sort((a, b) => a.timeline > b.timeline ? 1 : -1);\n};\n/**\n * Finds the playlist with the matching NAME attribute.\n *\n * @param {Array} playlists - playlists to search through\n * @param {string} name - the NAME attribute to search for\n *\n * @return {Object|null} the matching playlist object, or null\n */\n\nconst findPlaylistWithName = (playlists, name) => {\n for (let i = 0; i < playlists.length; i++) {\n if (playlists[i].attributes.NAME === name) {\n return playlists[i];\n }\n }\n\n return null;\n};\n/**\n * Gets a flattened array of media group playlists.\n *\n * @param {Object} manifest - the main manifest object\n *\n * @return {Array} the media group playlists\n */\n\nconst getMediaGroupPlaylists = manifest => {\n let mediaGroupPlaylists = [];\n forEachMediaGroup(manifest, SUPPORTED_MEDIA_TYPES, (properties, type, group, label) => {\n mediaGroupPlaylists = mediaGroupPlaylists.concat(properties.playlists || []);\n });\n return mediaGroupPlaylists;\n};\n/**\n * Updates the playlist's media sequence numbers.\n *\n * @param {Object} config - options object\n * @param {Object} config.playlist - the playlist to update\n * @param {number} config.mediaSequence - the mediaSequence number to start with\n */\n\nconst updateMediaSequenceForPlaylist = ({\n playlist,\n mediaSequence\n}) => {\n playlist.mediaSequence = mediaSequence;\n playlist.segments.forEach((segment, index) => {\n segment.number = playlist.mediaSequence + index;\n });\n};\n/**\n * Updates the media and discontinuity sequence numbers of newPlaylists given oldPlaylists\n * and a complete list of timeline starts.\n *\n * If no matching playlist is found, only the discontinuity sequence number of the playlist\n * will be updated.\n *\n * Since early available timelines are not supported, at least one segment must be present.\n *\n * @param {Object} config - options object\n * @param {Object[]} oldPlaylists - the old playlists to use as a reference\n * @param {Object[]} newPlaylists - the new playlists to update\n * @param {Object} timelineStarts - all timelineStarts seen in the stream to this point\n */\n\nconst updateSequenceNumbers = ({\n oldPlaylists,\n newPlaylists,\n timelineStarts\n}) => {\n newPlaylists.forEach(playlist => {\n playlist.discontinuitySequence = timelineStarts.findIndex(function ({\n timeline\n }) {\n return timeline === playlist.timeline;\n }); // Playlists NAMEs come from DASH Representation IDs, which are mandatory\n // (see ISO_23009-1-2012 5.3.5.2).\n //\n // If the same Representation existed in a prior Period, it will retain the same NAME.\n\n const oldPlaylist = findPlaylistWithName(oldPlaylists, playlist.attributes.NAME);\n\n if (!oldPlaylist) {\n // Since this is a new playlist, the media sequence values can start from 0 without\n // consequence.\n return;\n } // TODO better support for live SIDX\n //\n // As of this writing, mpd-parser does not support multiperiod SIDX (in live or VOD).\n // This is evident by a playlist only having a single SIDX reference. In a multiperiod\n // playlist there would need to be multiple SIDX references. In addition, live SIDX is\n // not supported when the SIDX properties change on refreshes.\n //\n // In the future, if support needs to be added, the merging logic here can be called\n // after SIDX references are resolved. For now, exit early to prevent exceptions being\n // thrown due to undefined references.\n\n\n if (playlist.sidx) {\n return;\n } // Since we don't yet support early available timelines, we don't need to support\n // playlists with no segments.\n\n\n const firstNewSegment = playlist.segments[0];\n const oldMatchingSegmentIndex = oldPlaylist.segments.findIndex(function (oldSegment) {\n return Math.abs(oldSegment.presentationTime - firstNewSegment.presentationTime) < TIME_FUDGE;\n }); // No matching segment from the old playlist means the entire playlist was refreshed.\n // In this case the media sequence should account for this update, and the new segments\n // should be marked as discontinuous from the prior content, since the last prior\n // timeline was removed.\n\n if (oldMatchingSegmentIndex === -1) {\n updateMediaSequenceForPlaylist({\n playlist,\n mediaSequence: oldPlaylist.mediaSequence + oldPlaylist.segments.length\n });\n playlist.segments[0].discontinuity = true;\n playlist.discontinuityStarts.unshift(0); // No matching segment does not necessarily mean there's missing content.\n //\n // If the new playlist's timeline is the same as the last seen segment's timeline,\n // then a discontinuity can be added to identify that there's potentially missing\n // content. If there's no missing content, the discontinuity should still be rather\n // harmless. It's possible that if segment durations are accurate enough, that the\n // existence of a gap can be determined using the presentation times and durations,\n // but if the segment timing info is off, it may introduce more problems than simply\n // adding the discontinuity.\n //\n // If the new playlist's timeline is different from the last seen segment's timeline,\n // then a discontinuity can be added to identify that this is the first seen segment\n // of a new timeline. However, the logic at the start of this function that\n // determined the disconinuity sequence by timeline index is now off by one (the\n // discontinuity of the newest timeline hasn't yet fallen off the manifest...since\n // we added it), so the disconinuity sequence must be decremented.\n //\n // A period may also have a duration of zero, so the case of no segments is handled\n // here even though we don't yet support early available periods.\n\n if (!oldPlaylist.segments.length && playlist.timeline > oldPlaylist.timeline || oldPlaylist.segments.length && playlist.timeline > oldPlaylist.segments[oldPlaylist.segments.length - 1].timeline) {\n playlist.discontinuitySequence--;\n }\n\n return;\n } // If the first segment matched with a prior segment on a discontinuity (it's matching\n // on the first segment of a period), then the discontinuitySequence shouldn't be the\n // timeline's matching one, but instead should be the one prior, and the first segment\n // of the new manifest should be marked with a discontinuity.\n //\n // The reason for this special case is that discontinuity sequence shows how many\n // discontinuities have fallen off of the playlist, and discontinuities are marked on\n // the first segment of a new \"timeline.\" Because of this, while DASH will retain that\n // Period while the \"timeline\" exists, HLS keeps track of it via the discontinuity\n // sequence, and that first segment is an indicator, but can be removed before that\n // timeline is gone.\n\n\n const oldMatchingSegment = oldPlaylist.segments[oldMatchingSegmentIndex];\n\n if (oldMatchingSegment.discontinuity && !firstNewSegment.discontinuity) {\n firstNewSegment.discontinuity = true;\n playlist.discontinuityStarts.unshift(0);\n playlist.discontinuitySequence--;\n }\n\n updateMediaSequenceForPlaylist({\n playlist,\n mediaSequence: oldPlaylist.segments[oldMatchingSegmentIndex].number\n });\n });\n};\n/**\n * Given an old parsed manifest object and a new parsed manifest object, updates the\n * sequence and timing values within the new manifest to ensure that it lines up with the\n * old.\n *\n * @param {Array} oldManifest - the old main manifest object\n * @param {Array} newManifest - the new main manifest object\n *\n * @return {Object} the updated new manifest object\n */\n\nconst positionManifestOnTimeline = ({\n oldManifest,\n newManifest\n}) => {\n // Starting from v4.1.2 of the IOP, section 4.4.3.3 states:\n //\n // \"MPD@availabilityStartTime and Period@start shall not be changed over MPD updates.\"\n //\n // This was added from https://github.com/Dash-Industry-Forum/DASH-IF-IOP/issues/160\n //\n // Because of this change, and the difficulty of supporting periods with changing start\n // times, periods with changing start times are not supported. This makes the logic much\n // simpler, since periods with the same start time can be considerred the same period\n // across refreshes.\n //\n // To give an example as to the difficulty of handling periods where the start time may\n // change, if a single period manifest is refreshed with another manifest with a single\n // period, and both the start and end times are increased, then the only way to determine\n // if it's a new period or an old one that has changed is to look through the segments of\n // each playlist and determine the presentation time bounds to find a match. In addition,\n // if the period start changed to exceed the old period end, then there would be no\n // match, and it would not be possible to determine whether the refreshed period is a new\n // one or the old one.\n const oldPlaylists = oldManifest.playlists.concat(getMediaGroupPlaylists(oldManifest));\n const newPlaylists = newManifest.playlists.concat(getMediaGroupPlaylists(newManifest)); // Save all seen timelineStarts to the new manifest. Although this potentially means that\n // there's a \"memory leak\" in that it will never stop growing, in reality, only a couple\n // of properties are saved for each seen Period. Even long running live streams won't\n // generate too many Periods, unless the stream is watched for decades. In the future,\n // this can be optimized by mapping to discontinuity sequence numbers for each timeline,\n // but it may not become an issue, and the additional info can be useful for debugging.\n\n newManifest.timelineStarts = getUniqueTimelineStarts([oldManifest.timelineStarts, newManifest.timelineStarts]);\n updateSequenceNumbers({\n oldPlaylists,\n newPlaylists,\n timelineStarts: newManifest.timelineStarts\n });\n return newManifest;\n};\n\nconst generateSidxKey = sidx => sidx && sidx.uri + '-' + byteRangeToString(sidx.byterange);\n\nconst mergeDiscontiguousPlaylists = playlists => {\n // Break out playlists into groups based on their baseUrl\n const playlistsByBaseUrl = playlists.reduce(function (acc, cur) {\n if (!acc[cur.attributes.baseUrl]) {\n acc[cur.attributes.baseUrl] = [];\n }\n\n acc[cur.attributes.baseUrl].push(cur);\n return acc;\n }, {});\n let allPlaylists = [];\n Object.values(playlistsByBaseUrl).forEach(playlistGroup => {\n const mergedPlaylists = values(playlistGroup.reduce((acc, playlist) => {\n // assuming playlist IDs are the same across periods\n // TODO: handle multiperiod where representation sets are not the same\n // across periods\n const name = playlist.attributes.id + (playlist.attributes.lang || '');\n\n if (!acc[name]) {\n // First Period\n acc[name] = playlist;\n acc[name].attributes.timelineStarts = [];\n } else {\n // Subsequent Periods\n if (playlist.segments) {\n // first segment of subsequent periods signal a discontinuity\n if (playlist.segments[0]) {\n playlist.segments[0].discontinuity = true;\n }\n\n acc[name].segments.push(...playlist.segments);\n } // bubble up contentProtection, this assumes all DRM content\n // has the same contentProtection\n\n\n if (playlist.attributes.contentProtection) {\n acc[name].attributes.contentProtection = playlist.attributes.contentProtection;\n }\n }\n\n acc[name].attributes.timelineStarts.push({\n // Although they represent the same number, it's important to have both to make it\n // compatible with HLS potentially having a similar attribute.\n start: playlist.attributes.periodStart,\n timeline: playlist.attributes.periodStart\n });\n return acc;\n }, {}));\n allPlaylists = allPlaylists.concat(mergedPlaylists);\n });\n return allPlaylists.map(playlist => {\n playlist.discontinuityStarts = findIndexes(playlist.segments || [], 'discontinuity');\n return playlist;\n });\n};\n\nconst addSidxSegmentsToPlaylist = (playlist, sidxMapping) => {\n const sidxKey = generateSidxKey(playlist.sidx);\n const sidxMatch = sidxKey && sidxMapping[sidxKey] && sidxMapping[sidxKey].sidx;\n\n if (sidxMatch) {\n addSidxSegmentsToPlaylist$1(playlist, sidxMatch, playlist.sidx.resolvedUri);\n }\n\n return playlist;\n};\nconst addSidxSegmentsToPlaylists = (playlists, sidxMapping = {}) => {\n if (!Object.keys(sidxMapping).length) {\n return playlists;\n }\n\n for (const i in playlists) {\n playlists[i] = addSidxSegmentsToPlaylist(playlists[i], sidxMapping);\n }\n\n return playlists;\n};\nconst formatAudioPlaylist = ({\n attributes,\n segments,\n sidx,\n mediaSequence,\n discontinuitySequence,\n discontinuityStarts\n}, isAudioOnly) => {\n const playlist = {\n attributes: {\n NAME: attributes.id,\n BANDWIDTH: attributes.bandwidth,\n CODECS: attributes.codecs,\n ['PROGRAM-ID']: 1\n },\n uri: '',\n endList: attributes.type === 'static',\n timeline: attributes.periodStart,\n resolvedUri: attributes.baseUrl || '',\n targetDuration: attributes.duration,\n discontinuitySequence,\n discontinuityStarts,\n timelineStarts: attributes.timelineStarts,\n mediaSequence,\n segments\n };\n\n if (attributes.contentProtection) {\n playlist.contentProtection = attributes.contentProtection;\n }\n\n if (attributes.serviceLocation) {\n playlist.attributes.serviceLocation = attributes.serviceLocation;\n }\n\n if (sidx) {\n playlist.sidx = sidx;\n }\n\n if (isAudioOnly) {\n playlist.attributes.AUDIO = 'audio';\n playlist.attributes.SUBTITLES = 'subs';\n }\n\n return playlist;\n};\nconst formatVttPlaylist = ({\n attributes,\n segments,\n mediaSequence,\n discontinuityStarts,\n discontinuitySequence\n}) => {\n if (typeof segments === 'undefined') {\n // vtt tracks may use single file in BaseURL\n segments = [{\n uri: attributes.baseUrl,\n timeline: attributes.periodStart,\n resolvedUri: attributes.baseUrl || '',\n duration: attributes.sourceDuration,\n number: 0\n }]; // targetDuration should be the same duration as the only segment\n\n attributes.duration = attributes.sourceDuration;\n }\n\n const m3u8Attributes = {\n NAME: attributes.id,\n BANDWIDTH: attributes.bandwidth,\n ['PROGRAM-ID']: 1\n };\n\n if (attributes.codecs) {\n m3u8Attributes.CODECS = attributes.codecs;\n }\n\n const vttPlaylist = {\n attributes: m3u8Attributes,\n uri: '',\n endList: attributes.type === 'static',\n timeline: attributes.periodStart,\n resolvedUri: attributes.baseUrl || '',\n targetDuration: attributes.duration,\n timelineStarts: attributes.timelineStarts,\n discontinuityStarts,\n discontinuitySequence,\n mediaSequence,\n segments\n };\n\n if (attributes.serviceLocation) {\n vttPlaylist.attributes.serviceLocation = attributes.serviceLocation;\n }\n\n return vttPlaylist;\n};\nconst organizeAudioPlaylists = (playlists, sidxMapping = {}, isAudioOnly = false) => {\n let mainPlaylist;\n const formattedPlaylists = playlists.reduce((a, playlist) => {\n const role = playlist.attributes.role && playlist.attributes.role.value || '';\n const language = playlist.attributes.lang || '';\n let label = playlist.attributes.label || 'main';\n\n if (language && !playlist.attributes.label) {\n const roleLabel = role ? ` (${role})` : '';\n label = `${playlist.attributes.lang}${roleLabel}`;\n }\n\n if (!a[label]) {\n a[label] = {\n language,\n autoselect: true,\n default: role === 'main',\n playlists: [],\n uri: ''\n };\n }\n\n const formatted = addSidxSegmentsToPlaylist(formatAudioPlaylist(playlist, isAudioOnly), sidxMapping);\n a[label].playlists.push(formatted);\n\n if (typeof mainPlaylist === 'undefined' && role === 'main') {\n mainPlaylist = playlist;\n mainPlaylist.default = true;\n }\n\n return a;\n }, {}); // if no playlists have role \"main\", mark the first as main\n\n if (!mainPlaylist) {\n const firstLabel = Object.keys(formattedPlaylists)[0];\n formattedPlaylists[firstLabel].default = true;\n }\n\n return formattedPlaylists;\n};\nconst organizeVttPlaylists = (playlists, sidxMapping = {}) => {\n return playlists.reduce((a, playlist) => {\n const label = playlist.attributes.label || playlist.attributes.lang || 'text';\n\n if (!a[label]) {\n a[label] = {\n language: label,\n default: false,\n autoselect: false,\n playlists: [],\n uri: ''\n };\n }\n\n a[label].playlists.push(addSidxSegmentsToPlaylist(formatVttPlaylist(playlist), sidxMapping));\n return a;\n }, {});\n};\n\nconst organizeCaptionServices = captionServices => captionServices.reduce((svcObj, svc) => {\n if (!svc) {\n return svcObj;\n }\n\n svc.forEach(service => {\n const {\n channel,\n language\n } = service;\n svcObj[language] = {\n autoselect: false,\n default: false,\n instreamId: channel,\n language\n };\n\n if (service.hasOwnProperty('aspectRatio')) {\n svcObj[language].aspectRatio = service.aspectRatio;\n }\n\n if (service.hasOwnProperty('easyReader')) {\n svcObj[language].easyReader = service.easyReader;\n }\n\n if (service.hasOwnProperty('3D')) {\n svcObj[language]['3D'] = service['3D'];\n }\n });\n return svcObj;\n}, {});\n\nconst formatVideoPlaylist = ({\n attributes,\n segments,\n sidx,\n discontinuityStarts\n}) => {\n const playlist = {\n attributes: {\n NAME: attributes.id,\n AUDIO: 'audio',\n SUBTITLES: 'subs',\n RESOLUTION: {\n width: attributes.width,\n height: attributes.height\n },\n CODECS: attributes.codecs,\n BANDWIDTH: attributes.bandwidth,\n ['PROGRAM-ID']: 1\n },\n uri: '',\n endList: attributes.type === 'static',\n timeline: attributes.periodStart,\n resolvedUri: attributes.baseUrl || '',\n targetDuration: attributes.duration,\n discontinuityStarts,\n timelineStarts: attributes.timelineStarts,\n segments\n };\n\n if (attributes.frameRate) {\n playlist.attributes['FRAME-RATE'] = attributes.frameRate;\n }\n\n if (attributes.contentProtection) {\n playlist.contentProtection = attributes.contentProtection;\n }\n\n if (attributes.serviceLocation) {\n playlist.attributes.serviceLocation = attributes.serviceLocation;\n }\n\n if (sidx) {\n playlist.sidx = sidx;\n }\n\n return playlist;\n};\n\nconst videoOnly = ({\n attributes\n}) => attributes.mimeType === 'video/mp4' || attributes.mimeType === 'video/webm' || attributes.contentType === 'video';\n\nconst audioOnly = ({\n attributes\n}) => attributes.mimeType === 'audio/mp4' || attributes.mimeType === 'audio/webm' || attributes.contentType === 'audio';\n\nconst vttOnly = ({\n attributes\n}) => attributes.mimeType === 'text/vtt' || attributes.contentType === 'text';\n/**\n * Contains start and timeline properties denoting a timeline start. For DASH, these will\n * be the same number.\n *\n * @typedef {Object} TimelineStart\n * @property {number} start - the start time of the timeline\n * @property {number} timeline - the timeline number\n */\n\n/**\n * Adds appropriate media and discontinuity sequence values to the segments and playlists.\n *\n * Throughout mpd-parser, the `number` attribute is used in relation to `startNumber`, a\n * DASH specific attribute used in constructing segment URI's from templates. However, from\n * an HLS perspective, the `number` attribute on a segment would be its `mediaSequence`\n * value, which should start at the original media sequence value (or 0) and increment by 1\n * for each segment thereafter. Since DASH's `startNumber` values are independent per\n * period, it doesn't make sense to use it for `number`. Instead, assume everything starts\n * from a 0 mediaSequence value and increment from there.\n *\n * Note that VHS currently doesn't use the `number` property, but it can be helpful for\n * debugging and making sense of the manifest.\n *\n * For live playlists, to account for values increasing in manifests when periods are\n * removed on refreshes, merging logic should be used to update the numbers to their\n * appropriate values (to ensure they're sequential and increasing).\n *\n * @param {Object[]} playlists - the playlists to update\n * @param {TimelineStart[]} timelineStarts - the timeline starts for the manifest\n */\n\n\nconst addMediaSequenceValues = (playlists, timelineStarts) => {\n // increment all segments sequentially\n playlists.forEach(playlist => {\n playlist.mediaSequence = 0;\n playlist.discontinuitySequence = timelineStarts.findIndex(function ({\n timeline\n }) {\n return timeline === playlist.timeline;\n });\n\n if (!playlist.segments) {\n return;\n }\n\n playlist.segments.forEach((segment, index) => {\n segment.number = index;\n });\n });\n};\n/**\n * Given a media group object, flattens all playlists within the media group into a single\n * array.\n *\n * @param {Object} mediaGroupObject - the media group object\n *\n * @return {Object[]}\n * The media group playlists\n */\n\nconst flattenMediaGroupPlaylists = mediaGroupObject => {\n if (!mediaGroupObject) {\n return [];\n }\n\n return Object.keys(mediaGroupObject).reduce((acc, label) => {\n const labelContents = mediaGroupObject[label];\n return acc.concat(labelContents.playlists);\n }, []);\n};\nconst toM3u8 = ({\n dashPlaylists,\n locations,\n contentSteering,\n sidxMapping = {},\n previousManifest,\n eventStream\n}) => {\n if (!dashPlaylists.length) {\n return {};\n } // grab all main manifest attributes\n\n\n const {\n sourceDuration: duration,\n type,\n suggestedPresentationDelay,\n minimumUpdatePeriod\n } = dashPlaylists[0].attributes;\n const videoPlaylists = mergeDiscontiguousPlaylists(dashPlaylists.filter(videoOnly)).map(formatVideoPlaylist);\n const audioPlaylists = mergeDiscontiguousPlaylists(dashPlaylists.filter(audioOnly));\n const vttPlaylists = mergeDiscontiguousPlaylists(dashPlaylists.filter(vttOnly));\n const captions = dashPlaylists.map(playlist => playlist.attributes.captionServices).filter(Boolean);\n const manifest = {\n allowCache: true,\n discontinuityStarts: [],\n segments: [],\n endList: true,\n mediaGroups: {\n AUDIO: {},\n VIDEO: {},\n ['CLOSED-CAPTIONS']: {},\n SUBTITLES: {}\n },\n uri: '',\n duration,\n playlists: addSidxSegmentsToPlaylists(videoPlaylists, sidxMapping)\n };\n\n if (minimumUpdatePeriod >= 0) {\n manifest.minimumUpdatePeriod = minimumUpdatePeriod * 1000;\n }\n\n if (locations) {\n manifest.locations = locations;\n }\n\n if (contentSteering) {\n manifest.contentSteering = contentSteering;\n }\n\n if (type === 'dynamic') {\n manifest.suggestedPresentationDelay = suggestedPresentationDelay;\n }\n\n if (eventStream && eventStream.length > 0) {\n manifest.eventStream = eventStream;\n }\n\n const isAudioOnly = manifest.playlists.length === 0;\n const organizedAudioGroup = audioPlaylists.length ? organizeAudioPlaylists(audioPlaylists, sidxMapping, isAudioOnly) : null;\n const organizedVttGroup = vttPlaylists.length ? organizeVttPlaylists(vttPlaylists, sidxMapping) : null;\n const formattedPlaylists = videoPlaylists.concat(flattenMediaGroupPlaylists(organizedAudioGroup), flattenMediaGroupPlaylists(organizedVttGroup));\n const playlistTimelineStarts = formattedPlaylists.map(({\n timelineStarts\n }) => timelineStarts);\n manifest.timelineStarts = getUniqueTimelineStarts(playlistTimelineStarts);\n addMediaSequenceValues(formattedPlaylists, manifest.timelineStarts);\n\n if (organizedAudioGroup) {\n manifest.mediaGroups.AUDIO.audio = organizedAudioGroup;\n }\n\n if (organizedVttGroup) {\n manifest.mediaGroups.SUBTITLES.subs = organizedVttGroup;\n }\n\n if (captions.length) {\n manifest.mediaGroups['CLOSED-CAPTIONS'].cc = organizeCaptionServices(captions);\n }\n\n if (previousManifest) {\n return positionManifestOnTimeline({\n oldManifest: previousManifest,\n newManifest: manifest\n });\n }\n\n return manifest;\n};\n\n/**\n * Calculates the R (repetition) value for a live stream (for the final segment\n * in a manifest where the r value is negative 1)\n *\n * @param {Object} attributes\n * Object containing all inherited attributes from parent elements with attribute\n * names as keys\n * @param {number} time\n * current time (typically the total time up until the final segment)\n * @param {number} duration\n * duration property for the given <S />\n *\n * @return {number}\n * R value to reach the end of the given period\n */\nconst getLiveRValue = (attributes, time, duration) => {\n const {\n NOW,\n clientOffset,\n availabilityStartTime,\n timescale = 1,\n periodStart = 0,\n minimumUpdatePeriod = 0\n } = attributes;\n const now = (NOW + clientOffset) / 1000;\n const periodStartWC = availabilityStartTime + periodStart;\n const periodEndWC = now + minimumUpdatePeriod;\n const periodDuration = periodEndWC - periodStartWC;\n return Math.ceil((periodDuration * timescale - time) / duration);\n};\n/**\n * Uses information provided by SegmentTemplate.SegmentTimeline to determine segment\n * timing and duration\n *\n * @param {Object} attributes\n * Object containing all inherited attributes from parent elements with attribute\n * names as keys\n * @param {Object[]} segmentTimeline\n * List of objects representing the attributes of each S element contained within\n *\n * @return {{number: number, duration: number, time: number, timeline: number}[]}\n * List of Objects with segment timing and duration info\n */\n\n\nconst parseByTimeline = (attributes, segmentTimeline) => {\n const {\n type,\n minimumUpdatePeriod = 0,\n media = '',\n sourceDuration,\n timescale = 1,\n startNumber = 1,\n periodStart: timeline\n } = attributes;\n const segments = [];\n let time = -1;\n\n for (let sIndex = 0; sIndex < segmentTimeline.length; sIndex++) {\n const S = segmentTimeline[sIndex];\n const duration = S.d;\n const repeat = S.r || 0;\n const segmentTime = S.t || 0;\n\n if (time < 0) {\n // first segment\n time = segmentTime;\n }\n\n if (segmentTime && segmentTime > time) {\n // discontinuity\n // TODO: How to handle this type of discontinuity\n // timeline++ here would treat it like HLS discontuity and content would\n // get appended without gap\n // E.G.\n // <S t=\"0\" d=\"1\" />\n // <S d=\"1\" />\n // <S d=\"1\" />\n // <S t=\"5\" d=\"1\" />\n // would have $Time$ values of [0, 1, 2, 5]\n // should this be appened at time positions [0, 1, 2, 3],(#EXT-X-DISCONTINUITY)\n // or [0, 1, 2, gap, gap, 5]? (#EXT-X-GAP)\n // does the value of sourceDuration consider this when calculating arbitrary\n // negative @r repeat value?\n // E.G. Same elements as above with this added at the end\n // <S d=\"1\" r=\"-1\" />\n // with a sourceDuration of 10\n // Would the 2 gaps be included in the time duration calculations resulting in\n // 8 segments with $Time$ values of [0, 1, 2, 5, 6, 7, 8, 9] or 10 segments\n // with $Time$ values of [0, 1, 2, 5, 6, 7, 8, 9, 10, 11] ?\n time = segmentTime;\n }\n\n let count;\n\n if (repeat < 0) {\n const nextS = sIndex + 1;\n\n if (nextS === segmentTimeline.length) {\n // last segment\n if (type === 'dynamic' && minimumUpdatePeriod > 0 && media.indexOf('$Number$') > 0) {\n count = getLiveRValue(attributes, time, duration);\n } else {\n // TODO: This may be incorrect depending on conclusion of TODO above\n count = (sourceDuration * timescale - time) / duration;\n }\n } else {\n count = (segmentTimeline[nextS].t - time) / duration;\n }\n } else {\n count = repeat + 1;\n }\n\n const end = startNumber + segments.length + count;\n let number = startNumber + segments.length;\n\n while (number < end) {\n segments.push({\n number,\n duration: duration / timescale,\n time,\n timeline\n });\n time += duration;\n number++;\n }\n }\n\n return segments;\n};\n\nconst identifierPattern = /\\$([A-z]*)(?:(%0)([0-9]+)d)?\\$/g;\n/**\n * Replaces template identifiers with corresponding values. To be used as the callback\n * for String.prototype.replace\n *\n * @name replaceCallback\n * @function\n * @param {string} match\n * Entire match of identifier\n * @param {string} identifier\n * Name of matched identifier\n * @param {string} format\n * Format tag string. Its presence indicates that padding is expected\n * @param {string} width\n * Desired length of the replaced value. Values less than this width shall be left\n * zero padded\n * @return {string}\n * Replacement for the matched identifier\n */\n\n/**\n * Returns a function to be used as a callback for String.prototype.replace to replace\n * template identifiers\n *\n * @param {Obect} values\n * Object containing values that shall be used to replace known identifiers\n * @param {number} values.RepresentationID\n * Value of the Representation@id attribute\n * @param {number} values.Number\n * Number of the corresponding segment\n * @param {number} values.Bandwidth\n * Value of the Representation@bandwidth attribute.\n * @param {number} values.Time\n * Timestamp value of the corresponding segment\n * @return {replaceCallback}\n * Callback to be used with String.prototype.replace to replace identifiers\n */\n\nconst identifierReplacement = values => (match, identifier, format, width) => {\n if (match === '$$') {\n // escape sequence\n return '$';\n }\n\n if (typeof values[identifier] === 'undefined') {\n return match;\n }\n\n const value = '' + values[identifier];\n\n if (identifier === 'RepresentationID') {\n // Format tag shall not be present with RepresentationID\n return value;\n }\n\n if (!format) {\n width = 1;\n } else {\n width = parseInt(width, 10);\n }\n\n if (value.length >= width) {\n return value;\n }\n\n return `${new Array(width - value.length + 1).join('0')}${value}`;\n};\n/**\n * Constructs a segment url from a template string\n *\n * @param {string} url\n * Template string to construct url from\n * @param {Obect} values\n * Object containing values that shall be used to replace known identifiers\n * @param {number} values.RepresentationID\n * Value of the Representation@id attribute\n * @param {number} values.Number\n * Number of the corresponding segment\n * @param {number} values.Bandwidth\n * Value of the Representation@bandwidth attribute.\n * @param {number} values.Time\n * Timestamp value of the corresponding segment\n * @return {string}\n * Segment url with identifiers replaced\n */\n\nconst constructTemplateUrl = (url, values) => url.replace(identifierPattern, identifierReplacement(values));\n/**\n * Generates a list of objects containing timing and duration information about each\n * segment needed to generate segment uris and the complete segment object\n *\n * @param {Object} attributes\n * Object containing all inherited attributes from parent elements with attribute\n * names as keys\n * @param {Object[]|undefined} segmentTimeline\n * List of objects representing the attributes of each S element contained within\n * the SegmentTimeline element\n * @return {{number: number, duration: number, time: number, timeline: number}[]}\n * List of Objects with segment timing and duration info\n */\n\nconst parseTemplateInfo = (attributes, segmentTimeline) => {\n if (!attributes.duration && !segmentTimeline) {\n // if neither @duration or SegmentTimeline are present, then there shall be exactly\n // one media segment\n return [{\n number: attributes.startNumber || 1,\n duration: attributes.sourceDuration,\n time: 0,\n timeline: attributes.periodStart\n }];\n }\n\n if (attributes.duration) {\n return parseByDuration(attributes);\n }\n\n return parseByTimeline(attributes, segmentTimeline);\n};\n/**\n * Generates a list of segments using information provided by the SegmentTemplate element\n *\n * @param {Object} attributes\n * Object containing all inherited attributes from parent elements with attribute\n * names as keys\n * @param {Object[]|undefined} segmentTimeline\n * List of objects representing the attributes of each S element contained within\n * the SegmentTimeline element\n * @return {Object[]}\n * List of segment objects\n */\n\nconst segmentsFromTemplate = (attributes, segmentTimeline) => {\n const templateValues = {\n RepresentationID: attributes.id,\n Bandwidth: attributes.bandwidth || 0\n };\n const {\n initialization = {\n sourceURL: '',\n range: ''\n }\n } = attributes;\n const mapSegment = urlTypeToSegment({\n baseUrl: attributes.baseUrl,\n source: constructTemplateUrl(initialization.sourceURL, templateValues),\n range: initialization.range\n });\n const segments = parseTemplateInfo(attributes, segmentTimeline);\n return segments.map(segment => {\n templateValues.Number = segment.number;\n templateValues.Time = segment.time;\n const uri = constructTemplateUrl(attributes.media || '', templateValues); // See DASH spec section 5.3.9.2.2\n // - if timescale isn't present on any level, default to 1.\n\n const timescale = attributes.timescale || 1; // - if presentationTimeOffset isn't present on any level, default to 0\n\n const presentationTimeOffset = attributes.presentationTimeOffset || 0;\n const presentationTime = // Even if the @t attribute is not specified for the segment, segment.time is\n // calculated in mpd-parser prior to this, so it's assumed to be available.\n attributes.periodStart + (segment.time - presentationTimeOffset) / timescale;\n const map = {\n uri,\n timeline: segment.timeline,\n duration: segment.duration,\n resolvedUri: resolveUrl(attributes.baseUrl || '', uri),\n map: mapSegment,\n number: segment.number,\n presentationTime\n };\n return map;\n });\n};\n\n/**\n * Converts a <SegmentUrl> (of type URLType from the DASH spec 5.3.9.2 Table 14)\n * to an object that matches the output of a segment in videojs/mpd-parser\n *\n * @param {Object} attributes\n * Object containing all inherited attributes from parent elements with attribute\n * names as keys\n * @param {Object} segmentUrl\n * <SegmentURL> node to translate into a segment object\n * @return {Object} translated segment object\n */\n\nconst SegmentURLToSegmentObject = (attributes, segmentUrl) => {\n const {\n baseUrl,\n initialization = {}\n } = attributes;\n const initSegment = urlTypeToSegment({\n baseUrl,\n source: initialization.sourceURL,\n range: initialization.range\n });\n const segment = urlTypeToSegment({\n baseUrl,\n source: segmentUrl.media,\n range: segmentUrl.mediaRange\n });\n segment.map = initSegment;\n return segment;\n};\n/**\n * Generates a list of segments using information provided by the SegmentList element\n * SegmentList (DASH SPEC Section 5.3.9.3.2) contains a set of <SegmentURL> nodes. Each\n * node should be translated into segment.\n *\n * @param {Object} attributes\n * Object containing all inherited attributes from parent elements with attribute\n * names as keys\n * @param {Object[]|undefined} segmentTimeline\n * List of objects representing the attributes of each S element contained within\n * the SegmentTimeline element\n * @return {Object.<Array>} list of segments\n */\n\n\nconst segmentsFromList = (attributes, segmentTimeline) => {\n const {\n duration,\n segmentUrls = [],\n periodStart\n } = attributes; // Per spec (5.3.9.2.1) no way to determine segment duration OR\n // if both SegmentTimeline and @duration are defined, it is outside of spec.\n\n if (!duration && !segmentTimeline || duration && segmentTimeline) {\n throw new Error(errors.SEGMENT_TIME_UNSPECIFIED);\n }\n\n const segmentUrlMap = segmentUrls.map(segmentUrlObject => SegmentURLToSegmentObject(attributes, segmentUrlObject));\n let segmentTimeInfo;\n\n if (duration) {\n segmentTimeInfo = parseByDuration(attributes);\n }\n\n if (segmentTimeline) {\n segmentTimeInfo = parseByTimeline(attributes, segmentTimeline);\n }\n\n const segments = segmentTimeInfo.map((segmentTime, index) => {\n if (segmentUrlMap[index]) {\n const segment = segmentUrlMap[index]; // See DASH spec section 5.3.9.2.2\n // - if timescale isn't present on any level, default to 1.\n\n const timescale = attributes.timescale || 1; // - if presentationTimeOffset isn't present on any level, default to 0\n\n const presentationTimeOffset = attributes.presentationTimeOffset || 0;\n segment.timeline = segmentTime.timeline;\n segment.duration = segmentTime.duration;\n segment.number = segmentTime.number;\n segment.presentationTime = periodStart + (segmentTime.time - presentationTimeOffset) / timescale;\n return segment;\n } // Since we're mapping we should get rid of any blank segments (in case\n // the given SegmentTimeline is handling for more elements than we have\n // SegmentURLs for).\n\n }).filter(segment => segment);\n return segments;\n};\n\nconst generateSegments = ({\n attributes,\n segmentInfo\n}) => {\n let segmentAttributes;\n let segmentsFn;\n\n if (segmentInfo.template) {\n segmentsFn = segmentsFromTemplate;\n segmentAttributes = merge(attributes, segmentInfo.template);\n } else if (segmentInfo.base) {\n segmentsFn = segmentsFromBase;\n segmentAttributes = merge(attributes, segmentInfo.base);\n } else if (segmentInfo.list) {\n segmentsFn = segmentsFromList;\n segmentAttributes = merge(attributes, segmentInfo.list);\n }\n\n const segmentsInfo = {\n attributes\n };\n\n if (!segmentsFn) {\n return segmentsInfo;\n }\n\n const segments = segmentsFn(segmentAttributes, segmentInfo.segmentTimeline); // The @duration attribute will be used to determin the playlist's targetDuration which\n // must be in seconds. Since we've generated the segment list, we no longer need\n // @duration to be in @timescale units, so we can convert it here.\n\n if (segmentAttributes.duration) {\n const {\n duration,\n timescale = 1\n } = segmentAttributes;\n segmentAttributes.duration = duration / timescale;\n } else if (segments.length) {\n // if there is no @duration attribute, use the largest segment duration as\n // as target duration\n segmentAttributes.duration = segments.reduce((max, segment) => {\n return Math.max(max, Math.ceil(segment.duration));\n }, 0);\n } else {\n segmentAttributes.duration = 0;\n }\n\n segmentsInfo.attributes = segmentAttributes;\n segmentsInfo.segments = segments; // This is a sidx box without actual segment information\n\n if (segmentInfo.base && segmentAttributes.indexRange) {\n segmentsInfo.sidx = segments[0];\n segmentsInfo.segments = [];\n }\n\n return segmentsInfo;\n};\nconst toPlaylists = representations => representations.map(generateSegments);\n\nconst findChildren = (element, name) => from(element.childNodes).filter(({\n tagName\n}) => tagName === name);\nconst getContent = element => element.textContent.trim();\n\n/**\n * Converts the provided string that may contain a division operation to a number.\n *\n * @param {string} value - the provided string value\n *\n * @return {number} the parsed string value\n */\nconst parseDivisionValue = value => {\n return parseFloat(value.split('/').reduce((prev, current) => prev / current));\n};\n\nconst parseDuration = str => {\n const SECONDS_IN_YEAR = 365 * 24 * 60 * 60;\n const SECONDS_IN_MONTH = 30 * 24 * 60 * 60;\n const SECONDS_IN_DAY = 24 * 60 * 60;\n const SECONDS_IN_HOUR = 60 * 60;\n const SECONDS_IN_MIN = 60; // P10Y10M10DT10H10M10.1S\n\n const durationRegex = /P(?:(\\d*)Y)?(?:(\\d*)M)?(?:(\\d*)D)?(?:T(?:(\\d*)H)?(?:(\\d*)M)?(?:([\\d.]*)S)?)?/;\n const match = durationRegex.exec(str);\n\n if (!match) {\n return 0;\n }\n\n const [year, month, day, hour, minute, second] = match.slice(1);\n return parseFloat(year || 0) * SECONDS_IN_YEAR + parseFloat(month || 0) * SECONDS_IN_MONTH + parseFloat(day || 0) * SECONDS_IN_DAY + parseFloat(hour || 0) * SECONDS_IN_HOUR + parseFloat(minute || 0) * SECONDS_IN_MIN + parseFloat(second || 0);\n};\nconst parseDate = str => {\n // Date format without timezone according to ISO 8601\n // YYY-MM-DDThh:mm:ss.ssssss\n const dateRegex = /^\\d+-\\d+-\\d+T\\d+:\\d+:\\d+(\\.\\d+)?$/; // If the date string does not specifiy a timezone, we must specifiy UTC. This is\n // expressed by ending with 'Z'\n\n if (dateRegex.test(str)) {\n str += 'Z';\n }\n\n return Date.parse(str);\n};\n\nconst parsers = {\n /**\n * Specifies the duration of the entire Media Presentation. Format is a duration string\n * as specified in ISO 8601\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The duration in seconds\n */\n mediaPresentationDuration(value) {\n return parseDuration(value);\n },\n\n /**\n * Specifies the Segment availability start time for all Segments referred to in this\n * MPD. For a dynamic manifest, it specifies the anchor for the earliest availability\n * time. Format is a date string as specified in ISO 8601\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The date as seconds from unix epoch\n */\n availabilityStartTime(value) {\n return parseDate(value) / 1000;\n },\n\n /**\n * Specifies the smallest period between potential changes to the MPD. Format is a\n * duration string as specified in ISO 8601\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The duration in seconds\n */\n minimumUpdatePeriod(value) {\n return parseDuration(value);\n },\n\n /**\n * Specifies the suggested presentation delay. Format is a\n * duration string as specified in ISO 8601\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The duration in seconds\n */\n suggestedPresentationDelay(value) {\n return parseDuration(value);\n },\n\n /**\n * specifices the type of mpd. Can be either \"static\" or \"dynamic\"\n *\n * @param {string} value\n * value of attribute as a string\n *\n * @return {string}\n * The type as a string\n */\n type(value) {\n return value;\n },\n\n /**\n * Specifies the duration of the smallest time shifting buffer for any Representation\n * in the MPD. Format is a duration string as specified in ISO 8601\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The duration in seconds\n */\n timeShiftBufferDepth(value) {\n return parseDuration(value);\n },\n\n /**\n * Specifies the PeriodStart time of the Period relative to the availabilityStarttime.\n * Format is a duration string as specified in ISO 8601\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The duration in seconds\n */\n start(value) {\n return parseDuration(value);\n },\n\n /**\n * Specifies the width of the visual presentation\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed width\n */\n width(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the height of the visual presentation\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed height\n */\n height(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the bitrate of the representation\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed bandwidth\n */\n bandwidth(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the frame rate of the representation\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed frame rate\n */\n frameRate(value) {\n return parseDivisionValue(value);\n },\n\n /**\n * Specifies the number of the first Media Segment in this Representation in the Period\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed number\n */\n startNumber(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the timescale in units per seconds\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed timescale\n */\n timescale(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the presentationTimeOffset.\n *\n * @param {string} value\n * value of the attribute as a string\n *\n * @return {number}\n * The parsed presentationTimeOffset\n */\n presentationTimeOffset(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the constant approximate Segment duration\n * NOTE: The <Period> element also contains an @duration attribute. This duration\n * specifies the duration of the Period. This attribute is currently not\n * supported by the rest of the parser, however we still check for it to prevent\n * errors.\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed duration\n */\n duration(value) {\n const parsedValue = parseInt(value, 10);\n\n if (isNaN(parsedValue)) {\n return parseDuration(value);\n }\n\n return parsedValue;\n },\n\n /**\n * Specifies the Segment duration, in units of the value of the @timescale.\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed duration\n */\n d(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the MPD start time, in @timescale units, the first Segment in the series\n * starts relative to the beginning of the Period\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed time\n */\n t(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the repeat count of the number of following contiguous Segments with the\n * same duration expressed by the value of @d\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed number\n */\n r(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the presentationTime.\n *\n * @param {string} value\n * value of the attribute as a string\n *\n * @return {number}\n * The parsed presentationTime\n */\n presentationTime(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Default parser for all other attributes. Acts as a no-op and just returns the value\n * as a string\n *\n * @param {string} value\n * value of attribute as a string\n * @return {string}\n * Unparsed value\n */\n DEFAULT(value) {\n return value;\n }\n\n};\n/**\n * Gets all the attributes and values of the provided node, parses attributes with known\n * types, and returns an object with attribute names mapped to values.\n *\n * @param {Node} el\n * The node to parse attributes from\n * @return {Object}\n * Object with all attributes of el parsed\n */\n\nconst parseAttributes = el => {\n if (!(el && el.attributes)) {\n return {};\n }\n\n return from(el.attributes).reduce((a, e) => {\n const parseFn = parsers[e.name] || parsers.DEFAULT;\n a[e.name] = parseFn(e.value);\n return a;\n }, {});\n};\n\nconst keySystemsMap = {\n 'urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b': 'org.w3.clearkey',\n 'urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed': 'com.widevine.alpha',\n 'urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95': 'com.microsoft.playready',\n 'urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb': 'com.adobe.primetime'\n};\n/**\n * Builds a list of urls that is the product of the reference urls and BaseURL values\n *\n * @param {Object[]} references\n * List of objects containing the reference URL as well as its attributes\n * @param {Node[]} baseUrlElements\n * List of BaseURL nodes from the mpd\n * @return {Object[]}\n * List of objects with resolved urls and attributes\n */\n\nconst buildBaseUrls = (references, baseUrlElements) => {\n if (!baseUrlElements.length) {\n return references;\n }\n\n return flatten(references.map(function (reference) {\n return baseUrlElements.map(function (baseUrlElement) {\n const initialBaseUrl = getContent(baseUrlElement);\n const resolvedBaseUrl = resolveUrl(reference.baseUrl, initialBaseUrl);\n const finalBaseUrl = merge(parseAttributes(baseUrlElement), {\n baseUrl: resolvedBaseUrl\n }); // If the URL is resolved, we want to get the serviceLocation from the reference\n // assuming there is no serviceLocation on the initialBaseUrl\n\n if (resolvedBaseUrl !== initialBaseUrl && !finalBaseUrl.serviceLocation && reference.serviceLocation) {\n finalBaseUrl.serviceLocation = reference.serviceLocation;\n }\n\n return finalBaseUrl;\n });\n }));\n};\n/**\n * Contains all Segment information for its containing AdaptationSet\n *\n * @typedef {Object} SegmentInformation\n * @property {Object|undefined} template\n * Contains the attributes for the SegmentTemplate node\n * @property {Object[]|undefined} segmentTimeline\n * Contains a list of atrributes for each S node within the SegmentTimeline node\n * @property {Object|undefined} list\n * Contains the attributes for the SegmentList node\n * @property {Object|undefined} base\n * Contains the attributes for the SegmentBase node\n */\n\n/**\n * Returns all available Segment information contained within the AdaptationSet node\n *\n * @param {Node} adaptationSet\n * The AdaptationSet node to get Segment information from\n * @return {SegmentInformation}\n * The Segment information contained within the provided AdaptationSet\n */\n\nconst getSegmentInformation = adaptationSet => {\n const segmentTemplate = findChildren(adaptationSet, 'SegmentTemplate')[0];\n const segmentList = findChildren(adaptationSet, 'SegmentList')[0];\n const segmentUrls = segmentList && findChildren(segmentList, 'SegmentURL').map(s => merge({\n tag: 'SegmentURL'\n }, parseAttributes(s)));\n const segmentBase = findChildren(adaptationSet, 'SegmentBase')[0];\n const segmentTimelineParentNode = segmentList || segmentTemplate;\n const segmentTimeline = segmentTimelineParentNode && findChildren(segmentTimelineParentNode, 'SegmentTimeline')[0];\n const segmentInitializationParentNode = segmentList || segmentBase || segmentTemplate;\n const segmentInitialization = segmentInitializationParentNode && findChildren(segmentInitializationParentNode, 'Initialization')[0]; // SegmentTemplate is handled slightly differently, since it can have both\n // @initialization and an <Initialization> node. @initialization can be templated,\n // while the node can have a url and range specified. If the <SegmentTemplate> has\n // both @initialization and an <Initialization> subelement we opt to override with\n // the node, as this interaction is not defined in the spec.\n\n const template = segmentTemplate && parseAttributes(segmentTemplate);\n\n if (template && segmentInitialization) {\n template.initialization = segmentInitialization && parseAttributes(segmentInitialization);\n } else if (template && template.initialization) {\n // If it is @initialization we convert it to an object since this is the format that\n // later functions will rely on for the initialization segment. This is only valid\n // for <SegmentTemplate>\n template.initialization = {\n sourceURL: template.initialization\n };\n }\n\n const segmentInfo = {\n template,\n segmentTimeline: segmentTimeline && findChildren(segmentTimeline, 'S').map(s => parseAttributes(s)),\n list: segmentList && merge(parseAttributes(segmentList), {\n segmentUrls,\n initialization: parseAttributes(segmentInitialization)\n }),\n base: segmentBase && merge(parseAttributes(segmentBase), {\n initialization: parseAttributes(segmentInitialization)\n })\n };\n Object.keys(segmentInfo).forEach(key => {\n if (!segmentInfo[key]) {\n delete segmentInfo[key];\n }\n });\n return segmentInfo;\n};\n/**\n * Contains Segment information and attributes needed to construct a Playlist object\n * from a Representation\n *\n * @typedef {Object} RepresentationInformation\n * @property {SegmentInformation} segmentInfo\n * Segment information for this Representation\n * @property {Object} attributes\n * Inherited attributes for this Representation\n */\n\n/**\n * Maps a Representation node to an object containing Segment information and attributes\n *\n * @name inheritBaseUrlsCallback\n * @function\n * @param {Node} representation\n * Representation node from the mpd\n * @return {RepresentationInformation}\n * Representation information needed to construct a Playlist object\n */\n\n/**\n * Returns a callback for Array.prototype.map for mapping Representation nodes to\n * Segment information and attributes using inherited BaseURL nodes.\n *\n * @param {Object} adaptationSetAttributes\n * Contains attributes inherited by the AdaptationSet\n * @param {Object[]} adaptationSetBaseUrls\n * List of objects containing resolved base URLs and attributes\n * inherited by the AdaptationSet\n * @param {SegmentInformation} adaptationSetSegmentInfo\n * Contains Segment information for the AdaptationSet\n * @return {inheritBaseUrlsCallback}\n * Callback map function\n */\n\nconst inheritBaseUrls = (adaptationSetAttributes, adaptationSetBaseUrls, adaptationSetSegmentInfo) => representation => {\n const repBaseUrlElements = findChildren(representation, 'BaseURL');\n const repBaseUrls = buildBaseUrls(adaptationSetBaseUrls, repBaseUrlElements);\n const attributes = merge(adaptationSetAttributes, parseAttributes(representation));\n const representationSegmentInfo = getSegmentInformation(representation);\n return repBaseUrls.map(baseUrl => {\n return {\n segmentInfo: merge(adaptationSetSegmentInfo, representationSegmentInfo),\n attributes: merge(attributes, baseUrl)\n };\n });\n};\n/**\n * Tranforms a series of content protection nodes to\n * an object containing pssh data by key system\n *\n * @param {Node[]} contentProtectionNodes\n * Content protection nodes\n * @return {Object}\n * Object containing pssh data by key system\n */\n\nconst generateKeySystemInformation = contentProtectionNodes => {\n return contentProtectionNodes.reduce((acc, node) => {\n const attributes = parseAttributes(node); // Although it could be argued that according to the UUID RFC spec the UUID string (a-f chars) should be generated\n // as a lowercase string it also mentions it should be treated as case-insensitive on input. Since the key system\n // UUIDs in the keySystemsMap are hardcoded as lowercase in the codebase there isn't any reason not to do\n // .toLowerCase() on the input UUID string from the manifest (at least I could not think of one).\n\n if (attributes.schemeIdUri) {\n attributes.schemeIdUri = attributes.schemeIdUri.toLowerCase();\n }\n\n const keySystem = keySystemsMap[attributes.schemeIdUri];\n\n if (keySystem) {\n acc[keySystem] = {\n attributes\n };\n const psshNode = findChildren(node, 'cenc:pssh')[0];\n\n if (psshNode) {\n const pssh = getContent(psshNode);\n acc[keySystem].pssh = pssh && decodeB64ToUint8Array(pssh);\n }\n }\n\n return acc;\n }, {});\n}; // defined in ANSI_SCTE 214-1 2016\n\n\nconst parseCaptionServiceMetadata = service => {\n // 608 captions\n if (service.schemeIdUri === 'urn:scte:dash:cc:cea-608:2015') {\n const values = typeof service.value !== 'string' ? [] : service.value.split(';');\n return values.map(value => {\n let channel;\n let language; // default language to value\n\n language = value;\n\n if (/^CC\\d=/.test(value)) {\n [channel, language] = value.split('=');\n } else if (/^CC\\d$/.test(value)) {\n channel = value;\n }\n\n return {\n channel,\n language\n };\n });\n } else if (service.schemeIdUri === 'urn:scte:dash:cc:cea-708:2015') {\n const values = typeof service.value !== 'string' ? [] : service.value.split(';');\n return values.map(value => {\n const flags = {\n // service or channel number 1-63\n 'channel': undefined,\n // language is a 3ALPHA per ISO 639.2/B\n // field is required\n 'language': undefined,\n // BIT 1/0 or ?\n // default value is 1, meaning 16:9 aspect ratio, 0 is 4:3, ? is unknown\n 'aspectRatio': 1,\n // BIT 1/0\n // easy reader flag indicated the text is tailed to the needs of beginning readers\n // default 0, or off\n 'easyReader': 0,\n // BIT 1/0\n // If 3d metadata is present (CEA-708.1) then 1\n // default 0\n '3D': 0\n };\n\n if (/=/.test(value)) {\n const [channel, opts = ''] = value.split('=');\n flags.channel = channel;\n flags.language = value;\n opts.split(',').forEach(opt => {\n const [name, val] = opt.split(':');\n\n if (name === 'lang') {\n flags.language = val; // er for easyReadery\n } else if (name === 'er') {\n flags.easyReader = Number(val); // war for wide aspect ratio\n } else if (name === 'war') {\n flags.aspectRatio = Number(val);\n } else if (name === '3D') {\n flags['3D'] = Number(val);\n }\n });\n } else {\n flags.language = value;\n }\n\n if (flags.channel) {\n flags.channel = 'SERVICE' + flags.channel;\n }\n\n return flags;\n });\n }\n};\n/**\n * A map callback that will parse all event stream data for a collection of periods\n * DASH ISO_IEC_23009 5.10.2.2\n * https://dashif-documents.azurewebsites.net/Events/master/event.html#mpd-event-timing\n *\n * @param {PeriodInformation} period object containing necessary period information\n * @return a collection of parsed eventstream event objects\n */\n\nconst toEventStream = period => {\n // get and flatten all EventStreams tags and parse attributes and children\n return flatten(findChildren(period.node, 'EventStream').map(eventStream => {\n const eventStreamAttributes = parseAttributes(eventStream);\n const schemeIdUri = eventStreamAttributes.schemeIdUri; // find all Events per EventStream tag and map to return objects\n\n return findChildren(eventStream, 'Event').map(event => {\n const eventAttributes = parseAttributes(event);\n const presentationTime = eventAttributes.presentationTime || 0;\n const timescale = eventStreamAttributes.timescale || 1;\n const duration = eventAttributes.duration || 0;\n const start = presentationTime / timescale + period.attributes.start;\n return {\n schemeIdUri,\n value: eventStreamAttributes.value,\n id: eventAttributes.id,\n start,\n end: start + duration / timescale,\n messageData: getContent(event) || eventAttributes.messageData,\n contentEncoding: eventStreamAttributes.contentEncoding,\n presentationTimeOffset: eventStreamAttributes.presentationTimeOffset || 0\n };\n });\n }));\n};\n/**\n * Maps an AdaptationSet node to a list of Representation information objects\n *\n * @name toRepresentationsCallback\n * @function\n * @param {Node} adaptationSet\n * AdaptationSet node from the mpd\n * @return {RepresentationInformation[]}\n * List of objects containing Representaion information\n */\n\n/**\n * Returns a callback for Array.prototype.map for mapping AdaptationSet nodes to a list of\n * Representation information objects\n *\n * @param {Object} periodAttributes\n * Contains attributes inherited by the Period\n * @param {Object[]} periodBaseUrls\n * Contains list of objects with resolved base urls and attributes\n * inherited by the Period\n * @param {string[]} periodSegmentInfo\n * Contains Segment Information at the period level\n * @return {toRepresentationsCallback}\n * Callback map function\n */\n\nconst toRepresentations = (periodAttributes, periodBaseUrls, periodSegmentInfo) => adaptationSet => {\n const adaptationSetAttributes = parseAttributes(adaptationSet);\n const adaptationSetBaseUrls = buildBaseUrls(periodBaseUrls, findChildren(adaptationSet, 'BaseURL'));\n const role = findChildren(adaptationSet, 'Role')[0];\n const roleAttributes = {\n role: parseAttributes(role)\n };\n let attrs = merge(periodAttributes, adaptationSetAttributes, roleAttributes);\n const accessibility = findChildren(adaptationSet, 'Accessibility')[0];\n const captionServices = parseCaptionServiceMetadata(parseAttributes(accessibility));\n\n if (captionServices) {\n attrs = merge(attrs, {\n captionServices\n });\n }\n\n const label = findChildren(adaptationSet, 'Label')[0];\n\n if (label && label.childNodes.length) {\n const labelVal = label.childNodes[0].nodeValue.trim();\n attrs = merge(attrs, {\n label: labelVal\n });\n }\n\n const contentProtection = generateKeySystemInformation(findChildren(adaptationSet, 'ContentProtection'));\n\n if (Object.keys(contentProtection).length) {\n attrs = merge(attrs, {\n contentProtection\n });\n }\n\n const segmentInfo = getSegmentInformation(adaptationSet);\n const representations = findChildren(adaptationSet, 'Representation');\n const adaptationSetSegmentInfo = merge(periodSegmentInfo, segmentInfo);\n return flatten(representations.map(inheritBaseUrls(attrs, adaptationSetBaseUrls, adaptationSetSegmentInfo)));\n};\n/**\n * Contains all period information for mapping nodes onto adaptation sets.\n *\n * @typedef {Object} PeriodInformation\n * @property {Node} period.node\n * Period node from the mpd\n * @property {Object} period.attributes\n * Parsed period attributes from node plus any added\n */\n\n/**\n * Maps a PeriodInformation object to a list of Representation information objects for all\n * AdaptationSet nodes contained within the Period.\n *\n * @name toAdaptationSetsCallback\n * @function\n * @param {PeriodInformation} period\n * Period object containing necessary period information\n * @param {number} periodStart\n * Start time of the Period within the mpd\n * @return {RepresentationInformation[]}\n * List of objects containing Representaion information\n */\n\n/**\n * Returns a callback for Array.prototype.map for mapping Period nodes to a list of\n * Representation information objects\n *\n * @param {Object} mpdAttributes\n * Contains attributes inherited by the mpd\n * @param {Object[]} mpdBaseUrls\n * Contains list of objects with resolved base urls and attributes\n * inherited by the mpd\n * @return {toAdaptationSetsCallback}\n * Callback map function\n */\n\nconst toAdaptationSets = (mpdAttributes, mpdBaseUrls) => (period, index) => {\n const periodBaseUrls = buildBaseUrls(mpdBaseUrls, findChildren(period.node, 'BaseURL'));\n const periodAttributes = merge(mpdAttributes, {\n periodStart: period.attributes.start\n });\n\n if (typeof period.attributes.duration === 'number') {\n periodAttributes.periodDuration = period.attributes.duration;\n }\n\n const adaptationSets = findChildren(period.node, 'AdaptationSet');\n const periodSegmentInfo = getSegmentInformation(period.node);\n return flatten(adaptationSets.map(toRepresentations(periodAttributes, periodBaseUrls, periodSegmentInfo)));\n};\n/**\n * Tranforms an array of content steering nodes into an object\n * containing CDN content steering information from the MPD manifest.\n *\n * For more information on the DASH spec for Content Steering parsing, see:\n * https://dashif.org/docs/DASH-IF-CTS-00XX-Content-Steering-Community-Review.pdf\n *\n * @param {Node[]} contentSteeringNodes\n * Content steering nodes\n * @param {Function} eventHandler\n * The event handler passed into the parser options to handle warnings\n * @return {Object}\n * Object containing content steering data\n */\n\nconst generateContentSteeringInformation = (contentSteeringNodes, eventHandler) => {\n // If there are more than one ContentSteering tags, throw an error\n if (contentSteeringNodes.length > 1) {\n eventHandler({\n type: 'warn',\n message: 'The MPD manifest should contain no more than one ContentSteering tag'\n });\n } // Return a null value if there are no ContentSteering tags\n\n\n if (!contentSteeringNodes.length) {\n return null;\n }\n\n const infoFromContentSteeringTag = merge({\n serverURL: getContent(contentSteeringNodes[0])\n }, parseAttributes(contentSteeringNodes[0])); // Converts `queryBeforeStart` to a boolean, as well as setting the default value\n // to `false` if it doesn't exist\n\n infoFromContentSteeringTag.queryBeforeStart = infoFromContentSteeringTag.queryBeforeStart === 'true';\n return infoFromContentSteeringTag;\n};\n/**\n * Gets Period@start property for a given period.\n *\n * @param {Object} options\n * Options object\n * @param {Object} options.attributes\n * Period attributes\n * @param {Object} [options.priorPeriodAttributes]\n * Prior period attributes (if prior period is available)\n * @param {string} options.mpdType\n * The MPD@type these periods came from\n * @return {number|null}\n * The period start, or null if it's an early available period or error\n */\n\nconst getPeriodStart = ({\n attributes,\n priorPeriodAttributes,\n mpdType\n}) => {\n // Summary of period start time calculation from DASH spec section 5.3.2.1\n //\n // A period's start is the first period's start + time elapsed after playing all\n // prior periods to this one. Periods continue one after the other in time (without\n // gaps) until the end of the presentation.\n //\n // The value of Period@start should be:\n // 1. if Period@start is present: value of Period@start\n // 2. if previous period exists and it has @duration: previous Period@start +\n // previous Period@duration\n // 3. if this is first period and MPD@type is 'static': 0\n // 4. in all other cases, consider the period an \"early available period\" (note: not\n // currently supported)\n // (1)\n if (typeof attributes.start === 'number') {\n return attributes.start;\n } // (2)\n\n\n if (priorPeriodAttributes && typeof priorPeriodAttributes.start === 'number' && typeof priorPeriodAttributes.duration === 'number') {\n return priorPeriodAttributes.start + priorPeriodAttributes.duration;\n } // (3)\n\n\n if (!priorPeriodAttributes && mpdType === 'static') {\n return 0;\n } // (4)\n // There is currently no logic for calculating the Period@start value if there is\n // no Period@start or prior Period@start and Period@duration available. This is not made\n // explicit by the DASH interop guidelines or the DASH spec, however, since there's\n // nothing about any other resolution strategies, it's implied. Thus, this case should\n // be considered an early available period, or error, and null should suffice for both\n // of those cases.\n\n\n return null;\n};\n/**\n * Traverses the mpd xml tree to generate a list of Representation information objects\n * that have inherited attributes from parent nodes\n *\n * @param {Node} mpd\n * The root node of the mpd\n * @param {Object} options\n * Available options for inheritAttributes\n * @param {string} options.manifestUri\n * The uri source of the mpd\n * @param {number} options.NOW\n * Current time per DASH IOP. Default is current time in ms since epoch\n * @param {number} options.clientOffset\n * Client time difference from NOW (in milliseconds)\n * @return {RepresentationInformation[]}\n * List of objects containing Representation information\n */\n\nconst inheritAttributes = (mpd, options = {}) => {\n const {\n manifestUri = '',\n NOW = Date.now(),\n clientOffset = 0,\n // TODO: For now, we are expecting an eventHandler callback function\n // to be passed into the mpd parser as an option.\n // In the future, we should enable stream parsing by using the Stream class from vhs-utils.\n // This will support new features including a standardized event handler.\n // See the m3u8 parser for examples of how stream parsing is currently used for HLS parsing.\n // https://github.com/videojs/vhs-utils/blob/88d6e10c631e57a5af02c5a62bc7376cd456b4f5/src/stream.js#L9\n eventHandler = function () {}\n } = options;\n const periodNodes = findChildren(mpd, 'Period');\n\n if (!periodNodes.length) {\n throw new Error(errors.INVALID_NUMBER_OF_PERIOD);\n }\n\n const locations = findChildren(mpd, 'Location');\n const mpdAttributes = parseAttributes(mpd);\n const mpdBaseUrls = buildBaseUrls([{\n baseUrl: manifestUri\n }], findChildren(mpd, 'BaseURL'));\n const contentSteeringNodes = findChildren(mpd, 'ContentSteering'); // See DASH spec section 5.3.1.2, Semantics of MPD element. Default type to 'static'.\n\n mpdAttributes.type = mpdAttributes.type || 'static';\n mpdAttributes.sourceDuration = mpdAttributes.mediaPresentationDuration || 0;\n mpdAttributes.NOW = NOW;\n mpdAttributes.clientOffset = clientOffset;\n\n if (locations.length) {\n mpdAttributes.locations = locations.map(getContent);\n }\n\n const periods = []; // Since toAdaptationSets acts on individual periods right now, the simplest approach to\n // adding properties that require looking at prior periods is to parse attributes and add\n // missing ones before toAdaptationSets is called. If more such properties are added, it\n // may be better to refactor toAdaptationSets.\n\n periodNodes.forEach((node, index) => {\n const attributes = parseAttributes(node); // Use the last modified prior period, as it may contain added information necessary\n // for this period.\n\n const priorPeriod = periods[index - 1];\n attributes.start = getPeriodStart({\n attributes,\n priorPeriodAttributes: priorPeriod ? priorPeriod.attributes : null,\n mpdType: mpdAttributes.type\n });\n periods.push({\n node,\n attributes\n });\n });\n return {\n locations: mpdAttributes.locations,\n contentSteeringInfo: generateContentSteeringInformation(contentSteeringNodes, eventHandler),\n // TODO: There are occurences where this `representationInfo` array contains undesired\n // duplicates. This generally occurs when there are multiple BaseURL nodes that are\n // direct children of the MPD node. When we attempt to resolve URLs from a combination of the\n // parent BaseURL and a child BaseURL, and the value does not resolve,\n // we end up returning the child BaseURL multiple times.\n // We need to determine a way to remove these duplicates in a safe way.\n // See: https://github.com/videojs/mpd-parser/pull/17#discussion_r162750527\n representationInfo: flatten(periods.map(toAdaptationSets(mpdAttributes, mpdBaseUrls))),\n eventStream: flatten(periods.map(toEventStream))\n };\n};\n\nconst stringToMpdXml = manifestString => {\n if (manifestString === '') {\n throw new Error(errors.DASH_EMPTY_MANIFEST);\n }\n\n const parser = new DOMParser();\n let xml;\n let mpd;\n\n try {\n xml = parser.parseFromString(manifestString, 'application/xml');\n mpd = xml && xml.documentElement.tagName === 'MPD' ? xml.documentElement : null;\n } catch (e) {// ie 11 throws on invalid xml\n }\n\n if (!mpd || mpd && mpd.getElementsByTagName('parsererror').length > 0) {\n throw new Error(errors.DASH_INVALID_XML);\n }\n\n return mpd;\n};\n\n/**\n * Parses the manifest for a UTCTiming node, returning the nodes attributes if found\n *\n * @param {string} mpd\n * XML string of the MPD manifest\n * @return {Object|null}\n * Attributes of UTCTiming node specified in the manifest. Null if none found\n */\n\nconst parseUTCTimingScheme = mpd => {\n const UTCTimingNode = findChildren(mpd, 'UTCTiming')[0];\n\n if (!UTCTimingNode) {\n return null;\n }\n\n const attributes = parseAttributes(UTCTimingNode);\n\n switch (attributes.schemeIdUri) {\n case 'urn:mpeg:dash:utc:http-head:2014':\n case 'urn:mpeg:dash:utc:http-head:2012':\n attributes.method = 'HEAD';\n break;\n\n case 'urn:mpeg:dash:utc:http-xsdate:2014':\n case 'urn:mpeg:dash:utc:http-iso:2014':\n case 'urn:mpeg:dash:utc:http-xsdate:2012':\n case 'urn:mpeg:dash:utc:http-iso:2012':\n attributes.method = 'GET';\n break;\n\n case 'urn:mpeg:dash:utc:direct:2014':\n case 'urn:mpeg:dash:utc:direct:2012':\n attributes.method = 'DIRECT';\n attributes.value = Date.parse(attributes.value);\n break;\n\n case 'urn:mpeg:dash:utc:http-ntp:2014':\n case 'urn:mpeg:dash:utc:ntp:2014':\n case 'urn:mpeg:dash:utc:sntp:2014':\n default:\n throw new Error(errors.UNSUPPORTED_UTC_TIMING_SCHEME);\n }\n\n return attributes;\n};\n\nconst VERSION = version;\n/*\n * Given a DASH manifest string and options, parses the DASH manifest into an object in the\n * form outputed by m3u8-parser and accepted by videojs/http-streaming.\n *\n * For live DASH manifests, if `previousManifest` is provided in options, then the newly\n * parsed DASH manifest will have its media sequence and discontinuity sequence values\n * updated to reflect its position relative to the prior manifest.\n *\n * @param {string} manifestString - the DASH manifest as a string\n * @param {options} [options] - any options\n *\n * @return {Object} the manifest object\n */\n\nconst parse = (manifestString, options = {}) => {\n const parsedManifestInfo = inheritAttributes(stringToMpdXml(manifestString), options);\n const playlists = toPlaylists(parsedManifestInfo.representationInfo);\n return toM3u8({\n dashPlaylists: playlists,\n locations: parsedManifestInfo.locations,\n contentSteering: parsedManifestInfo.contentSteeringInfo,\n sidxMapping: options.sidxMapping,\n previousManifest: options.previousManifest,\n eventStream: parsedManifestInfo.eventStream\n });\n};\n/**\n * Parses the manifest for a UTCTiming node, returning the nodes attributes if found\n *\n * @param {string} manifestString\n * XML string of the MPD manifest\n * @return {Object|null}\n * Attributes of UTCTiming node specified in the manifest. Null if none found\n */\n\n\nconst parseUTCTiming = manifestString => parseUTCTimingScheme(stringToMpdXml(manifestString));\n\nexport { VERSION, addSidxSegmentsToPlaylist$1 as addSidxSegmentsToPlaylist, generateSidxKey, inheritAttributes, parse, parseUTCTiming, stringToMpdXml, toM3u8, toPlaylists };\n","/**\n * Loops through all supported media groups in master and calls the provided\n * callback for each group\n *\n * @param {Object} master\n * The parsed master manifest object\n * @param {string[]} groups\n * The media groups to call the callback for\n * @param {Function} callback\n * Callback to call for each media group\n */\nexport var forEachMediaGroup = function forEachMediaGroup(master, groups, callback) {\n groups.forEach(function (mediaType) {\n for (var groupKey in master.mediaGroups[mediaType]) {\n for (var labelKey in master.mediaGroups[mediaType][groupKey]) {\n var mediaProperties = master.mediaGroups[mediaType][groupKey][labelKey];\n callback(mediaProperties, mediaType, groupKey, labelKey);\n }\n }\n });\n};","import window from 'global/window';\n\nvar atob = function atob(s) {\n return window.atob ? window.atob(s) : Buffer.from(s, 'base64').toString('binary');\n};\n\nexport default function decodeB64ToUint8Array(b64Text) {\n var decodedString = atob(b64Text);\n var array = new Uint8Array(decodedString.length);\n\n for (var i = 0; i < decodedString.length; i++) {\n array[i] = decodedString.charCodeAt(i);\n }\n\n return array;\n}","import { stringToBytes, toUint8, bytesMatch, bytesToString, toHexString, padStart, bytesToNumber } from './byte-helpers.js';\nimport { getAvcCodec, getHvcCodec, getAv1Codec } from './codec-helpers.js';\nimport { parseOpusHead } from './opus-helpers.js';\n\nvar normalizePath = function normalizePath(path) {\n if (typeof path === 'string') {\n return stringToBytes(path);\n }\n\n if (typeof path === 'number') {\n return path;\n }\n\n return path;\n};\n\nvar normalizePaths = function normalizePaths(paths) {\n if (!Array.isArray(paths)) {\n return [normalizePath(paths)];\n }\n\n return paths.map(function (p) {\n return normalizePath(p);\n });\n};\n\nvar DESCRIPTORS;\nexport var parseDescriptors = function parseDescriptors(bytes) {\n bytes = toUint8(bytes);\n var results = [];\n var i = 0;\n\n while (bytes.length > i) {\n var tag = bytes[i];\n var size = 0;\n var headerSize = 0; // tag\n\n headerSize++;\n var byte = bytes[headerSize]; // first byte\n\n headerSize++;\n\n while (byte & 0x80) {\n size = (byte & 0x7F) << 7;\n byte = bytes[headerSize];\n headerSize++;\n }\n\n size += byte & 0x7F;\n\n for (var z = 0; z < DESCRIPTORS.length; z++) {\n var _DESCRIPTORS$z = DESCRIPTORS[z],\n id = _DESCRIPTORS$z.id,\n parser = _DESCRIPTORS$z.parser;\n\n if (tag === id) {\n results.push(parser(bytes.subarray(headerSize, headerSize + size)));\n break;\n }\n }\n\n i += size + headerSize;\n }\n\n return results;\n};\nDESCRIPTORS = [{\n id: 0x03,\n parser: function parser(bytes) {\n var desc = {\n tag: 0x03,\n id: bytes[0] << 8 | bytes[1],\n flags: bytes[2],\n size: 3,\n dependsOnEsId: 0,\n ocrEsId: 0,\n descriptors: [],\n url: ''\n }; // depends on es id\n\n if (desc.flags & 0x80) {\n desc.dependsOnEsId = bytes[desc.size] << 8 | bytes[desc.size + 1];\n desc.size += 2;\n } // url\n\n\n if (desc.flags & 0x40) {\n var len = bytes[desc.size];\n desc.url = bytesToString(bytes.subarray(desc.size + 1, desc.size + 1 + len));\n desc.size += len;\n } // ocr es id\n\n\n if (desc.flags & 0x20) {\n desc.ocrEsId = bytes[desc.size] << 8 | bytes[desc.size + 1];\n desc.size += 2;\n }\n\n desc.descriptors = parseDescriptors(bytes.subarray(desc.size)) || [];\n return desc;\n }\n}, {\n id: 0x04,\n parser: function parser(bytes) {\n // DecoderConfigDescriptor\n var desc = {\n tag: 0x04,\n oti: bytes[0],\n streamType: bytes[1],\n bufferSize: bytes[2] << 16 | bytes[3] << 8 | bytes[4],\n maxBitrate: bytes[5] << 24 | bytes[6] << 16 | bytes[7] << 8 | bytes[8],\n avgBitrate: bytes[9] << 24 | bytes[10] << 16 | bytes[11] << 8 | bytes[12],\n descriptors: parseDescriptors(bytes.subarray(13))\n };\n return desc;\n }\n}, {\n id: 0x05,\n parser: function parser(bytes) {\n // DecoderSpecificInfo\n return {\n tag: 0x05,\n bytes: bytes\n };\n }\n}, {\n id: 0x06,\n parser: function parser(bytes) {\n // SLConfigDescriptor\n return {\n tag: 0x06,\n bytes: bytes\n };\n }\n}];\n/**\n * find any number of boxes by name given a path to it in an iso bmff\n * such as mp4.\n *\n * @param {TypedArray} bytes\n * bytes for the iso bmff to search for boxes in\n *\n * @param {Uint8Array[]|string[]|string|Uint8Array} name\n * An array of paths or a single path representing the name\n * of boxes to search through in bytes. Paths may be\n * uint8 (character codes) or strings.\n *\n * @param {boolean} [complete=false]\n * Should we search only for complete boxes on the final path.\n * This is very useful when you do not want to get back partial boxes\n * in the case of streaming files.\n *\n * @return {Uint8Array[]}\n * An array of the end paths that we found.\n */\n\nexport var findBox = function findBox(bytes, paths, complete) {\n if (complete === void 0) {\n complete = false;\n }\n\n paths = normalizePaths(paths);\n bytes = toUint8(bytes);\n var results = [];\n\n if (!paths.length) {\n // short-circuit the search for empty paths\n return results;\n }\n\n var i = 0;\n\n while (i < bytes.length) {\n var size = (bytes[i] << 24 | bytes[i + 1] << 16 | bytes[i + 2] << 8 | bytes[i + 3]) >>> 0;\n var type = bytes.subarray(i + 4, i + 8); // invalid box format.\n\n if (size === 0) {\n break;\n }\n\n var end = i + size;\n\n if (end > bytes.length) {\n // this box is bigger than the number of bytes we have\n // and complete is set, we cannot find any more boxes.\n if (complete) {\n break;\n }\n\n end = bytes.length;\n }\n\n var data = bytes.subarray(i + 8, end);\n\n if (bytesMatch(type, paths[0])) {\n if (paths.length === 1) {\n // this is the end of the path and we've found the box we were\n // looking for\n results.push(data);\n } else {\n // recursively search for the next box along the path\n results.push.apply(results, findBox(data, paths.slice(1), complete));\n }\n }\n\n i = end;\n } // we've finished searching all of bytes\n\n\n return results;\n};\n/**\n * Search for a single matching box by name in an iso bmff format like\n * mp4. This function is useful for finding codec boxes which\n * can be placed arbitrarily in sample descriptions depending\n * on the version of the file or file type.\n *\n * @param {TypedArray} bytes\n * bytes for the iso bmff to search for boxes in\n *\n * @param {string|Uint8Array} name\n * The name of the box to find.\n *\n * @return {Uint8Array[]}\n * a subarray of bytes representing the name boxed we found.\n */\n\nexport var findNamedBox = function findNamedBox(bytes, name) {\n name = normalizePath(name);\n\n if (!name.length) {\n // short-circuit the search for empty paths\n return bytes.subarray(bytes.length);\n }\n\n var i = 0;\n\n while (i < bytes.length) {\n if (bytesMatch(bytes.subarray(i, i + name.length), name)) {\n var size = (bytes[i - 4] << 24 | bytes[i - 3] << 16 | bytes[i - 2] << 8 | bytes[i - 1]) >>> 0;\n var end = size > 1 ? i + size : bytes.byteLength;\n return bytes.subarray(i + 4, end);\n }\n\n i++;\n } // we've finished searching all of bytes\n\n\n return bytes.subarray(bytes.length);\n};\n\nvar parseSamples = function parseSamples(data, entrySize, parseEntry) {\n if (entrySize === void 0) {\n entrySize = 4;\n }\n\n if (parseEntry === void 0) {\n parseEntry = function parseEntry(d) {\n return bytesToNumber(d);\n };\n }\n\n var entries = [];\n\n if (!data || !data.length) {\n return entries;\n }\n\n var entryCount = bytesToNumber(data.subarray(4, 8));\n\n for (var i = 8; entryCount; i += entrySize, entryCount--) {\n entries.push(parseEntry(data.subarray(i, i + entrySize)));\n }\n\n return entries;\n};\n\nexport var buildFrameTable = function buildFrameTable(stbl, timescale) {\n var keySamples = parseSamples(findBox(stbl, ['stss'])[0]);\n var chunkOffsets = parseSamples(findBox(stbl, ['stco'])[0]);\n var timeToSamples = parseSamples(findBox(stbl, ['stts'])[0], 8, function (entry) {\n return {\n sampleCount: bytesToNumber(entry.subarray(0, 4)),\n sampleDelta: bytesToNumber(entry.subarray(4, 8))\n };\n });\n var samplesToChunks = parseSamples(findBox(stbl, ['stsc'])[0], 12, function (entry) {\n return {\n firstChunk: bytesToNumber(entry.subarray(0, 4)),\n samplesPerChunk: bytesToNumber(entry.subarray(4, 8)),\n sampleDescriptionIndex: bytesToNumber(entry.subarray(8, 12))\n };\n });\n var stsz = findBox(stbl, ['stsz'])[0]; // stsz starts with a 4 byte sampleSize which we don't need\n\n var sampleSizes = parseSamples(stsz && stsz.length && stsz.subarray(4) || null);\n var frames = [];\n\n for (var chunkIndex = 0; chunkIndex < chunkOffsets.length; chunkIndex++) {\n var samplesInChunk = void 0;\n\n for (var i = 0; i < samplesToChunks.length; i++) {\n var sampleToChunk = samplesToChunks[i];\n var isThisOne = chunkIndex + 1 >= sampleToChunk.firstChunk && (i + 1 >= samplesToChunks.length || chunkIndex + 1 < samplesToChunks[i + 1].firstChunk);\n\n if (isThisOne) {\n samplesInChunk = sampleToChunk.samplesPerChunk;\n break;\n }\n }\n\n var chunkOffset = chunkOffsets[chunkIndex];\n\n for (var _i = 0; _i < samplesInChunk; _i++) {\n var frameEnd = sampleSizes[frames.length]; // if we don't have key samples every frame is a keyframe\n\n var keyframe = !keySamples.length;\n\n if (keySamples.length && keySamples.indexOf(frames.length + 1) !== -1) {\n keyframe = true;\n }\n\n var frame = {\n keyframe: keyframe,\n start: chunkOffset,\n end: chunkOffset + frameEnd\n };\n\n for (var k = 0; k < timeToSamples.length; k++) {\n var _timeToSamples$k = timeToSamples[k],\n sampleCount = _timeToSamples$k.sampleCount,\n sampleDelta = _timeToSamples$k.sampleDelta;\n\n if (frames.length <= sampleCount) {\n // ms to ns\n var lastTimestamp = frames.length ? frames[frames.length - 1].timestamp : 0;\n frame.timestamp = lastTimestamp + sampleDelta / timescale * 1000;\n frame.duration = sampleDelta;\n break;\n }\n }\n\n frames.push(frame);\n chunkOffset += frameEnd;\n }\n }\n\n return frames;\n};\nexport var addSampleDescription = function addSampleDescription(track, bytes) {\n var codec = bytesToString(bytes.subarray(0, 4));\n\n if (track.type === 'video') {\n track.info = track.info || {};\n track.info.width = bytes[28] << 8 | bytes[29];\n track.info.height = bytes[30] << 8 | bytes[31];\n } else if (track.type === 'audio') {\n track.info = track.info || {};\n track.info.channels = bytes[20] << 8 | bytes[21];\n track.info.bitDepth = bytes[22] << 8 | bytes[23];\n track.info.sampleRate = bytes[28] << 8 | bytes[29];\n }\n\n if (codec === 'avc1') {\n var avcC = findNamedBox(bytes, 'avcC'); // AVCDecoderConfigurationRecord\n\n codec += \".\" + getAvcCodec(avcC);\n track.info.avcC = avcC; // TODO: do we need to parse all this?\n\n /* {\n configurationVersion: avcC[0],\n profile: avcC[1],\n profileCompatibility: avcC[2],\n level: avcC[3],\n lengthSizeMinusOne: avcC[4] & 0x3\n };\n let spsNalUnitCount = avcC[5] & 0x1F;\n const spsNalUnits = track.info.avc.spsNalUnits = [];\n // past spsNalUnitCount\n let offset = 6;\n while (spsNalUnitCount--) {\n const nalLen = avcC[offset] << 8 | avcC[offset + 1];\n spsNalUnits.push(avcC.subarray(offset + 2, offset + 2 + nalLen));\n offset += nalLen + 2;\n }\n let ppsNalUnitCount = avcC[offset];\n const ppsNalUnits = track.info.avc.ppsNalUnits = [];\n // past ppsNalUnitCount\n offset += 1;\n while (ppsNalUnitCount--) {\n const nalLen = avcC[offset] << 8 | avcC[offset + 1];\n ppsNalUnits.push(avcC.subarray(offset + 2, offset + 2 + nalLen));\n offset += nalLen + 2;\n }*/\n // HEVCDecoderConfigurationRecord\n } else if (codec === 'hvc1' || codec === 'hev1') {\n codec += \".\" + getHvcCodec(findNamedBox(bytes, 'hvcC'));\n } else if (codec === 'mp4a' || codec === 'mp4v') {\n var esds = findNamedBox(bytes, 'esds');\n var esDescriptor = parseDescriptors(esds.subarray(4))[0];\n var decoderConfig = esDescriptor && esDescriptor.descriptors.filter(function (_ref) {\n var tag = _ref.tag;\n return tag === 0x04;\n })[0];\n\n if (decoderConfig) {\n // most codecs do not have a further '.'\n // such as 0xa5 for ac-3 and 0xa6 for e-ac-3\n codec += '.' + toHexString(decoderConfig.oti);\n\n if (decoderConfig.oti === 0x40) {\n codec += '.' + (decoderConfig.descriptors[0].bytes[0] >> 3).toString();\n } else if (decoderConfig.oti === 0x20) {\n codec += '.' + decoderConfig.descriptors[0].bytes[4].toString();\n } else if (decoderConfig.oti === 0xdd) {\n codec = 'vorbis';\n }\n } else if (track.type === 'audio') {\n codec += '.40.2';\n } else {\n codec += '.20.9';\n }\n } else if (codec === 'av01') {\n // AV1DecoderConfigurationRecord\n codec += \".\" + getAv1Codec(findNamedBox(bytes, 'av1C'));\n } else if (codec === 'vp09') {\n // VPCodecConfigurationRecord\n var vpcC = findNamedBox(bytes, 'vpcC'); // https://www.webmproject.org/vp9/mp4/\n\n var profile = vpcC[0];\n var level = vpcC[1];\n var bitDepth = vpcC[2] >> 4;\n var chromaSubsampling = (vpcC[2] & 0x0F) >> 1;\n var videoFullRangeFlag = (vpcC[2] & 0x0F) >> 3;\n var colourPrimaries = vpcC[3];\n var transferCharacteristics = vpcC[4];\n var matrixCoefficients = vpcC[5];\n codec += \".\" + padStart(profile, 2, '0');\n codec += \".\" + padStart(level, 2, '0');\n codec += \".\" + padStart(bitDepth, 2, '0');\n codec += \".\" + padStart(chromaSubsampling, 2, '0');\n codec += \".\" + padStart(colourPrimaries, 2, '0');\n codec += \".\" + padStart(transferCharacteristics, 2, '0');\n codec += \".\" + padStart(matrixCoefficients, 2, '0');\n codec += \".\" + padStart(videoFullRangeFlag, 2, '0');\n } else if (codec === 'theo') {\n codec = 'theora';\n } else if (codec === 'spex') {\n codec = 'speex';\n } else if (codec === '.mp3') {\n codec = 'mp4a.40.34';\n } else if (codec === 'msVo') {\n codec = 'vorbis';\n } else if (codec === 'Opus') {\n codec = 'opus';\n var dOps = findNamedBox(bytes, 'dOps');\n track.info.opus = parseOpusHead(dOps); // TODO: should this go into the webm code??\n // Firefox requires a codecDelay for opus playback\n // see https://bugzilla.mozilla.org/show_bug.cgi?id=1276238\n\n track.info.codecDelay = 6500000;\n } else {\n codec = codec.toLowerCase();\n }\n /* eslint-enable */\n // flac, ac-3, ec-3, opus\n\n\n track.codec = codec;\n};\nexport var parseTracks = function parseTracks(bytes, frameTable) {\n if (frameTable === void 0) {\n frameTable = true;\n }\n\n bytes = toUint8(bytes);\n var traks = findBox(bytes, ['moov', 'trak'], true);\n var tracks = [];\n traks.forEach(function (trak) {\n var track = {\n bytes: trak\n };\n var mdia = findBox(trak, ['mdia'])[0];\n var hdlr = findBox(mdia, ['hdlr'])[0];\n var trakType = bytesToString(hdlr.subarray(8, 12));\n\n if (trakType === 'soun') {\n track.type = 'audio';\n } else if (trakType === 'vide') {\n track.type = 'video';\n } else {\n track.type = trakType;\n }\n\n var tkhd = findBox(trak, ['tkhd'])[0];\n\n if (tkhd) {\n var view = new DataView(tkhd.buffer, tkhd.byteOffset, tkhd.byteLength);\n var tkhdVersion = view.getUint8(0);\n track.number = tkhdVersion === 0 ? view.getUint32(12) : view.getUint32(20);\n }\n\n var mdhd = findBox(mdia, ['mdhd'])[0];\n\n if (mdhd) {\n // mdhd is a FullBox, meaning it will have its own version as the first byte\n var version = mdhd[0];\n var index = version === 0 ? 12 : 20;\n track.timescale = (mdhd[index] << 24 | mdhd[index + 1] << 16 | mdhd[index + 2] << 8 | mdhd[index + 3]) >>> 0;\n }\n\n var stbl = findBox(mdia, ['minf', 'stbl'])[0];\n var stsd = findBox(stbl, ['stsd'])[0];\n var descriptionCount = bytesToNumber(stsd.subarray(4, 8));\n var offset = 8; // add codec and codec info\n\n while (descriptionCount--) {\n var len = bytesToNumber(stsd.subarray(offset, offset + 4));\n var sampleDescriptor = stsd.subarray(offset + 4, offset + 4 + len);\n addSampleDescription(track, sampleDescriptor);\n offset += 4 + len;\n }\n\n if (frameTable) {\n track.frameTable = buildFrameTable(stbl, track.timescale);\n } // codec has no sub parameters\n\n\n tracks.push(track);\n });\n return tracks;\n};\nexport var parseMediaInfo = function parseMediaInfo(bytes) {\n var mvhd = findBox(bytes, ['moov', 'mvhd'], true)[0];\n\n if (!mvhd || !mvhd.length) {\n return;\n }\n\n var info = {}; // ms to ns\n // mvhd v1 has 8 byte duration and other fields too\n\n if (mvhd[0] === 1) {\n info.timestampScale = bytesToNumber(mvhd.subarray(20, 24));\n info.duration = bytesToNumber(mvhd.subarray(24, 32));\n } else {\n info.timestampScale = bytesToNumber(mvhd.subarray(12, 16));\n info.duration = bytesToNumber(mvhd.subarray(16, 20));\n }\n\n info.bytes = mvhd;\n return info;\n};","import { toUint8, bytesMatch } from './byte-helpers.js';\nvar ID3 = toUint8([0x49, 0x44, 0x33]);\nexport var getId3Size = function getId3Size(bytes, offset) {\n if (offset === void 0) {\n offset = 0;\n }\n\n bytes = toUint8(bytes);\n var flags = bytes[offset + 5];\n var returnSize = bytes[offset + 6] << 21 | bytes[offset + 7] << 14 | bytes[offset + 8] << 7 | bytes[offset + 9];\n var footerPresent = (flags & 16) >> 4;\n\n if (footerPresent) {\n return returnSize + 20;\n }\n\n return returnSize + 10;\n};\nexport var getId3Offset = function getId3Offset(bytes, offset) {\n if (offset === void 0) {\n offset = 0;\n }\n\n bytes = toUint8(bytes);\n\n if (bytes.length - offset < 10 || !bytesMatch(bytes, ID3, {\n offset: offset\n })) {\n return offset;\n }\n\n offset += getId3Size(bytes, offset); // recursive check for id3 tags as some files\n // have multiple ID3 tag sections even though\n // they should not.\n\n return getId3Offset(bytes, offset);\n};","export var OPUS_HEAD = new Uint8Array([// O, p, u, s\n0x4f, 0x70, 0x75, 0x73, // H, e, a, d\n0x48, 0x65, 0x61, 0x64]); // https://wiki.xiph.org/OggOpus\n// https://vfrmaniac.fushizen.eu/contents/opus_in_isobmff.html\n// https://opus-codec.org/docs/opusfile_api-0.7/structOpusHead.html\n\nexport var parseOpusHead = function parseOpusHead(bytes) {\n var view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n var version = view.getUint8(0); // version 0, from mp4, does not use littleEndian.\n\n var littleEndian = version !== 0;\n var config = {\n version: version,\n channels: view.getUint8(1),\n preSkip: view.getUint16(2, littleEndian),\n sampleRate: view.getUint32(4, littleEndian),\n outputGain: view.getUint16(8, littleEndian),\n channelMappingFamily: view.getUint8(10)\n };\n\n if (config.channelMappingFamily > 0 && bytes.length > 10) {\n config.streamCount = view.getUint8(11);\n config.twoChannelStreamCount = view.getUint8(12);\n config.channelMapping = [];\n\n for (var c = 0; c < config.channels; c++) {\n config.channelMapping.push(view.getUint8(13 + c));\n }\n }\n\n return config;\n};\nexport var setOpusHead = function setOpusHead(config) {\n var size = config.channelMappingFamily <= 0 ? 11 : 12 + config.channels;\n var view = new DataView(new ArrayBuffer(size));\n var littleEndian = config.version !== 0;\n view.setUint8(0, config.version);\n view.setUint8(1, config.channels);\n view.setUint16(2, config.preSkip, littleEndian);\n view.setUint32(4, config.sampleRate, littleEndian);\n view.setUint16(8, config.outputGain, littleEndian);\n view.setUint8(10, config.channelMappingFamily);\n\n if (config.channelMappingFamily > 0) {\n view.setUint8(11, config.streamCount);\n config.channelMapping.foreach(function (cm, i) {\n view.setUint8(12 + i, cm);\n });\n }\n\n return new Uint8Array(view.buffer);\n};","import { toUint8, bytesToNumber, bytesMatch, bytesToString, numberToBytes, padStart } from './byte-helpers';\nimport { getAvcCodec, getHvcCodec, getAv1Codec } from './codec-helpers.js'; // relevant specs for this parser:\n// https://matroska-org.github.io/libebml/specs.html\n// https://www.matroska.org/technical/elements.html\n// https://www.webmproject.org/docs/container/\n\nexport var EBML_TAGS = {\n EBML: toUint8([0x1A, 0x45, 0xDF, 0xA3]),\n DocType: toUint8([0x42, 0x82]),\n Segment: toUint8([0x18, 0x53, 0x80, 0x67]),\n SegmentInfo: toUint8([0x15, 0x49, 0xA9, 0x66]),\n Tracks: toUint8([0x16, 0x54, 0xAE, 0x6B]),\n Track: toUint8([0xAE]),\n TrackNumber: toUint8([0xd7]),\n DefaultDuration: toUint8([0x23, 0xe3, 0x83]),\n TrackEntry: toUint8([0xAE]),\n TrackType: toUint8([0x83]),\n FlagDefault: toUint8([0x88]),\n CodecID: toUint8([0x86]),\n CodecPrivate: toUint8([0x63, 0xA2]),\n VideoTrack: toUint8([0xe0]),\n AudioTrack: toUint8([0xe1]),\n // Not used yet, but will be used for live webm/mkv\n // see https://www.matroska.org/technical/basics.html#block-structure\n // see https://www.matroska.org/technical/basics.html#simpleblock-structure\n Cluster: toUint8([0x1F, 0x43, 0xB6, 0x75]),\n Timestamp: toUint8([0xE7]),\n TimestampScale: toUint8([0x2A, 0xD7, 0xB1]),\n BlockGroup: toUint8([0xA0]),\n BlockDuration: toUint8([0x9B]),\n Block: toUint8([0xA1]),\n SimpleBlock: toUint8([0xA3])\n};\n/**\n * This is a simple table to determine the length\n * of things in ebml. The length is one based (starts at 1,\n * rather than zero) and for every zero bit before a one bit\n * we add one to length. We also need this table because in some\n * case we have to xor all the length bits from another value.\n */\n\nvar LENGTH_TABLE = [128, 64, 32, 16, 8, 4, 2, 1];\n\nvar getLength = function getLength(byte) {\n var len = 1;\n\n for (var i = 0; i < LENGTH_TABLE.length; i++) {\n if (byte & LENGTH_TABLE[i]) {\n break;\n }\n\n len++;\n }\n\n return len;\n}; // length in ebml is stored in the first 4 to 8 bits\n// of the first byte. 4 for the id length and 8 for the\n// data size length. Length is measured by converting the number to binary\n// then 1 + the number of zeros before a 1 is encountered starting\n// from the left.\n\n\nvar getvint = function getvint(bytes, offset, removeLength, signed) {\n if (removeLength === void 0) {\n removeLength = true;\n }\n\n if (signed === void 0) {\n signed = false;\n }\n\n var length = getLength(bytes[offset]);\n var valueBytes = bytes.subarray(offset, offset + length); // NOTE that we do **not** subarray here because we need to copy these bytes\n // as they will be modified below to remove the dataSizeLen bits and we do not\n // want to modify the original data. normally we could just call slice on\n // uint8array but ie 11 does not support that...\n\n if (removeLength) {\n valueBytes = Array.prototype.slice.call(bytes, offset, offset + length);\n valueBytes[0] ^= LENGTH_TABLE[length - 1];\n }\n\n return {\n length: length,\n value: bytesToNumber(valueBytes, {\n signed: signed\n }),\n bytes: valueBytes\n };\n};\n\nvar normalizePath = function normalizePath(path) {\n if (typeof path === 'string') {\n return path.match(/.{1,2}/g).map(function (p) {\n return normalizePath(p);\n });\n }\n\n if (typeof path === 'number') {\n return numberToBytes(path);\n }\n\n return path;\n};\n\nvar normalizePaths = function normalizePaths(paths) {\n if (!Array.isArray(paths)) {\n return [normalizePath(paths)];\n }\n\n return paths.map(function (p) {\n return normalizePath(p);\n });\n};\n\nvar getInfinityDataSize = function getInfinityDataSize(id, bytes, offset) {\n if (offset >= bytes.length) {\n return bytes.length;\n }\n\n var innerid = getvint(bytes, offset, false);\n\n if (bytesMatch(id.bytes, innerid.bytes)) {\n return offset;\n }\n\n var dataHeader = getvint(bytes, offset + innerid.length);\n return getInfinityDataSize(id, bytes, offset + dataHeader.length + dataHeader.value + innerid.length);\n};\n/**\n * Notes on the EBLM format.\n *\n * EBLM uses \"vints\" tags. Every vint tag contains\n * two parts\n *\n * 1. The length from the first byte. You get this by\n * converting the byte to binary and counting the zeros\n * before a 1. Then you add 1 to that. Examples\n * 00011111 = length 4 because there are 3 zeros before a 1.\n * 00100000 = length 3 because there are 2 zeros before a 1.\n * 00000011 = length 7 because there are 6 zeros before a 1.\n *\n * 2. The bits used for length are removed from the first byte\n * Then all the bytes are merged into a value. NOTE: this\n * is not the case for id ebml tags as there id includes\n * length bits.\n *\n */\n\n\nexport var findEbml = function findEbml(bytes, paths) {\n paths = normalizePaths(paths);\n bytes = toUint8(bytes);\n var results = [];\n\n if (!paths.length) {\n return results;\n }\n\n var i = 0;\n\n while (i < bytes.length) {\n var id = getvint(bytes, i, false);\n var dataHeader = getvint(bytes, i + id.length);\n var dataStart = i + id.length + dataHeader.length; // dataSize is unknown or this is a live stream\n\n if (dataHeader.value === 0x7f) {\n dataHeader.value = getInfinityDataSize(id, bytes, dataStart);\n\n if (dataHeader.value !== bytes.length) {\n dataHeader.value -= dataStart;\n }\n }\n\n var dataEnd = dataStart + dataHeader.value > bytes.length ? bytes.length : dataStart + dataHeader.value;\n var data = bytes.subarray(dataStart, dataEnd);\n\n if (bytesMatch(paths[0], id.bytes)) {\n if (paths.length === 1) {\n // this is the end of the paths and we've found the tag we were\n // looking for\n results.push(data);\n } else {\n // recursively search for the next tag inside of the data\n // of this one\n results = results.concat(findEbml(data, paths.slice(1)));\n }\n }\n\n var totalLength = id.length + dataHeader.length + data.length; // move past this tag entirely, we are not looking for it\n\n i += totalLength;\n }\n\n return results;\n}; // see https://www.matroska.org/technical/basics.html#block-structure\n\nexport var decodeBlock = function decodeBlock(block, type, timestampScale, clusterTimestamp) {\n var duration;\n\n if (type === 'group') {\n duration = findEbml(block, [EBML_TAGS.BlockDuration])[0];\n\n if (duration) {\n duration = bytesToNumber(duration);\n duration = 1 / timestampScale * duration * timestampScale / 1000;\n }\n\n block = findEbml(block, [EBML_TAGS.Block])[0];\n type = 'block'; // treat data as a block after this point\n }\n\n var dv = new DataView(block.buffer, block.byteOffset, block.byteLength);\n var trackNumber = getvint(block, 0);\n var timestamp = dv.getInt16(trackNumber.length, false);\n var flags = block[trackNumber.length + 2];\n var data = block.subarray(trackNumber.length + 3); // pts/dts in seconds\n\n var ptsdts = 1 / timestampScale * (clusterTimestamp + timestamp) * timestampScale / 1000; // return the frame\n\n var parsed = {\n duration: duration,\n trackNumber: trackNumber.value,\n keyframe: type === 'simple' && flags >> 7 === 1,\n invisible: (flags & 0x08) >> 3 === 1,\n lacing: (flags & 0x06) >> 1,\n discardable: type === 'simple' && (flags & 0x01) === 1,\n frames: [],\n pts: ptsdts,\n dts: ptsdts,\n timestamp: timestamp\n };\n\n if (!parsed.lacing) {\n parsed.frames.push(data);\n return parsed;\n }\n\n var numberOfFrames = data[0] + 1;\n var frameSizes = [];\n var offset = 1; // Fixed\n\n if (parsed.lacing === 2) {\n var sizeOfFrame = (data.length - offset) / numberOfFrames;\n\n for (var i = 0; i < numberOfFrames; i++) {\n frameSizes.push(sizeOfFrame);\n }\n } // xiph\n\n\n if (parsed.lacing === 1) {\n for (var _i = 0; _i < numberOfFrames - 1; _i++) {\n var size = 0;\n\n do {\n size += data[offset];\n offset++;\n } while (data[offset - 1] === 0xFF);\n\n frameSizes.push(size);\n }\n } // ebml\n\n\n if (parsed.lacing === 3) {\n // first vint is unsinged\n // after that vints are singed and\n // based on a compounding size\n var _size = 0;\n\n for (var _i2 = 0; _i2 < numberOfFrames - 1; _i2++) {\n var vint = _i2 === 0 ? getvint(data, offset) : getvint(data, offset, true, true);\n _size += vint.value;\n frameSizes.push(_size);\n offset += vint.length;\n }\n }\n\n frameSizes.forEach(function (size) {\n parsed.frames.push(data.subarray(offset, offset + size));\n offset += size;\n });\n return parsed;\n}; // VP9 Codec Feature Metadata (CodecPrivate)\n// https://www.webmproject.org/docs/container/\n\nvar parseVp9Private = function parseVp9Private(bytes) {\n var i = 0;\n var params = {};\n\n while (i < bytes.length) {\n var id = bytes[i] & 0x7f;\n var len = bytes[i + 1];\n var val = void 0;\n\n if (len === 1) {\n val = bytes[i + 2];\n } else {\n val = bytes.subarray(i + 2, i + 2 + len);\n }\n\n if (id === 1) {\n params.profile = val;\n } else if (id === 2) {\n params.level = val;\n } else if (id === 3) {\n params.bitDepth = val;\n } else if (id === 4) {\n params.chromaSubsampling = val;\n } else {\n params[id] = val;\n }\n\n i += 2 + len;\n }\n\n return params;\n};\n\nexport var parseTracks = function parseTracks(bytes) {\n bytes = toUint8(bytes);\n var decodedTracks = [];\n var tracks = findEbml(bytes, [EBML_TAGS.Segment, EBML_TAGS.Tracks, EBML_TAGS.Track]);\n\n if (!tracks.length) {\n tracks = findEbml(bytes, [EBML_TAGS.Tracks, EBML_TAGS.Track]);\n }\n\n if (!tracks.length) {\n tracks = findEbml(bytes, [EBML_TAGS.Track]);\n }\n\n if (!tracks.length) {\n return decodedTracks;\n }\n\n tracks.forEach(function (track) {\n var trackType = findEbml(track, EBML_TAGS.TrackType)[0];\n\n if (!trackType || !trackType.length) {\n return;\n } // 1 is video, 2 is audio, 17 is subtitle\n // other values are unimportant in this context\n\n\n if (trackType[0] === 1) {\n trackType = 'video';\n } else if (trackType[0] === 2) {\n trackType = 'audio';\n } else if (trackType[0] === 17) {\n trackType = 'subtitle';\n } else {\n return;\n } // todo parse language\n\n\n var decodedTrack = {\n rawCodec: bytesToString(findEbml(track, [EBML_TAGS.CodecID])[0]),\n type: trackType,\n codecPrivate: findEbml(track, [EBML_TAGS.CodecPrivate])[0],\n number: bytesToNumber(findEbml(track, [EBML_TAGS.TrackNumber])[0]),\n defaultDuration: bytesToNumber(findEbml(track, [EBML_TAGS.DefaultDuration])[0]),\n default: findEbml(track, [EBML_TAGS.FlagDefault])[0],\n rawData: track\n };\n var codec = '';\n\n if (/V_MPEG4\\/ISO\\/AVC/.test(decodedTrack.rawCodec)) {\n codec = \"avc1.\" + getAvcCodec(decodedTrack.codecPrivate);\n } else if (/V_MPEGH\\/ISO\\/HEVC/.test(decodedTrack.rawCodec)) {\n codec = \"hev1.\" + getHvcCodec(decodedTrack.codecPrivate);\n } else if (/V_MPEG4\\/ISO\\/ASP/.test(decodedTrack.rawCodec)) {\n if (decodedTrack.codecPrivate) {\n codec = 'mp4v.20.' + decodedTrack.codecPrivate[4].toString();\n } else {\n codec = 'mp4v.20.9';\n }\n } else if (/^V_THEORA/.test(decodedTrack.rawCodec)) {\n codec = 'theora';\n } else if (/^V_VP8/.test(decodedTrack.rawCodec)) {\n codec = 'vp8';\n } else if (/^V_VP9/.test(decodedTrack.rawCodec)) {\n if (decodedTrack.codecPrivate) {\n var _parseVp9Private = parseVp9Private(decodedTrack.codecPrivate),\n profile = _parseVp9Private.profile,\n level = _parseVp9Private.level,\n bitDepth = _parseVp9Private.bitDepth,\n chromaSubsampling = _parseVp9Private.chromaSubsampling;\n\n codec = 'vp09.';\n codec += padStart(profile, 2, '0') + \".\";\n codec += padStart(level, 2, '0') + \".\";\n codec += padStart(bitDepth, 2, '0') + \".\";\n codec += \"\" + padStart(chromaSubsampling, 2, '0'); // Video -> Colour -> Ebml name\n\n var matrixCoefficients = findEbml(track, [0xE0, [0x55, 0xB0], [0x55, 0xB1]])[0] || [];\n var videoFullRangeFlag = findEbml(track, [0xE0, [0x55, 0xB0], [0x55, 0xB9]])[0] || [];\n var transferCharacteristics = findEbml(track, [0xE0, [0x55, 0xB0], [0x55, 0xBA]])[0] || [];\n var colourPrimaries = findEbml(track, [0xE0, [0x55, 0xB0], [0x55, 0xBB]])[0] || []; // if we find any optional codec parameter specify them all.\n\n if (matrixCoefficients.length || videoFullRangeFlag.length || transferCharacteristics.length || colourPrimaries.length) {\n codec += \".\" + padStart(colourPrimaries[0], 2, '0');\n codec += \".\" + padStart(transferCharacteristics[0], 2, '0');\n codec += \".\" + padStart(matrixCoefficients[0], 2, '0');\n codec += \".\" + padStart(videoFullRangeFlag[0], 2, '0');\n }\n } else {\n codec = 'vp9';\n }\n } else if (/^V_AV1/.test(decodedTrack.rawCodec)) {\n codec = \"av01.\" + getAv1Codec(decodedTrack.codecPrivate);\n } else if (/A_ALAC/.test(decodedTrack.rawCodec)) {\n codec = 'alac';\n } else if (/A_MPEG\\/L2/.test(decodedTrack.rawCodec)) {\n codec = 'mp2';\n } else if (/A_MPEG\\/L3/.test(decodedTrack.rawCodec)) {\n codec = 'mp3';\n } else if (/^A_AAC/.test(decodedTrack.rawCodec)) {\n if (decodedTrack.codecPrivate) {\n codec = 'mp4a.40.' + (decodedTrack.codecPrivate[0] >>> 3).toString();\n } else {\n codec = 'mp4a.40.2';\n }\n } else if (/^A_AC3/.test(decodedTrack.rawCodec)) {\n codec = 'ac-3';\n } else if (/^A_PCM/.test(decodedTrack.rawCodec)) {\n codec = 'pcm';\n } else if (/^A_MS\\/ACM/.test(decodedTrack.rawCodec)) {\n codec = 'speex';\n } else if (/^A_EAC3/.test(decodedTrack.rawCodec)) {\n codec = 'ec-3';\n } else if (/^A_VORBIS/.test(decodedTrack.rawCodec)) {\n codec = 'vorbis';\n } else if (/^A_FLAC/.test(decodedTrack.rawCodec)) {\n codec = 'flac';\n } else if (/^A_OPUS/.test(decodedTrack.rawCodec)) {\n codec = 'opus';\n }\n\n decodedTrack.codec = codec;\n decodedTracks.push(decodedTrack);\n });\n return decodedTracks.sort(function (a, b) {\n return a.number - b.number;\n });\n};\nexport var parseData = function parseData(data, tracks) {\n var allBlocks = [];\n var segment = findEbml(data, [EBML_TAGS.Segment])[0];\n var timestampScale = findEbml(segment, [EBML_TAGS.SegmentInfo, EBML_TAGS.TimestampScale])[0]; // in nanoseconds, defaults to 1ms\n\n if (timestampScale && timestampScale.length) {\n timestampScale = bytesToNumber(timestampScale);\n } else {\n timestampScale = 1000000;\n }\n\n var clusters = findEbml(segment, [EBML_TAGS.Cluster]);\n\n if (!tracks) {\n tracks = parseTracks(segment);\n }\n\n clusters.forEach(function (cluster, ci) {\n var simpleBlocks = findEbml(cluster, [EBML_TAGS.SimpleBlock]).map(function (b) {\n return {\n type: 'simple',\n data: b\n };\n });\n var blockGroups = findEbml(cluster, [EBML_TAGS.BlockGroup]).map(function (b) {\n return {\n type: 'group',\n data: b\n };\n });\n var timestamp = findEbml(cluster, [EBML_TAGS.Timestamp])[0] || 0;\n\n if (timestamp && timestamp.length) {\n timestamp = bytesToNumber(timestamp);\n } // get all blocks then sort them into the correct order\n\n\n var blocks = simpleBlocks.concat(blockGroups).sort(function (a, b) {\n return a.data.byteOffset - b.data.byteOffset;\n });\n blocks.forEach(function (block, bi) {\n var decoded = decodeBlock(block.data, block.type, timestampScale, timestamp);\n allBlocks.push(decoded);\n });\n });\n return {\n tracks: tracks,\n blocks: allBlocks\n };\n};","import { bytesMatch, toUint8 } from './byte-helpers.js';\nexport var NAL_TYPE_ONE = toUint8([0x00, 0x00, 0x00, 0x01]);\nexport var NAL_TYPE_TWO = toUint8([0x00, 0x00, 0x01]);\nexport var EMULATION_PREVENTION = toUint8([0x00, 0x00, 0x03]);\n/**\n * Expunge any \"Emulation Prevention\" bytes from a \"Raw Byte\n * Sequence Payload\"\n *\n * @param data {Uint8Array} the bytes of a RBSP from a NAL\n * unit\n * @return {Uint8Array} the RBSP without any Emulation\n * Prevention Bytes\n */\n\nexport var discardEmulationPreventionBytes = function discardEmulationPreventionBytes(bytes) {\n var positions = [];\n var i = 1; // Find all `Emulation Prevention Bytes`\n\n while (i < bytes.length - 2) {\n if (bytesMatch(bytes.subarray(i, i + 3), EMULATION_PREVENTION)) {\n positions.push(i + 2);\n i++;\n }\n\n i++;\n } // If no Emulation Prevention Bytes were found just return the original\n // array\n\n\n if (positions.length === 0) {\n return bytes;\n } // Create a new array to hold the NAL unit data\n\n\n var newLength = bytes.length - positions.length;\n var newData = new Uint8Array(newLength);\n var sourceIndex = 0;\n\n for (i = 0; i < newLength; sourceIndex++, i++) {\n if (sourceIndex === positions[0]) {\n // Skip this byte\n sourceIndex++; // Remove this position index\n\n positions.shift();\n }\n\n newData[i] = bytes[sourceIndex];\n }\n\n return newData;\n};\nexport var findNal = function findNal(bytes, dataType, types, nalLimit) {\n if (nalLimit === void 0) {\n nalLimit = Infinity;\n }\n\n bytes = toUint8(bytes);\n types = [].concat(types);\n var i = 0;\n var nalStart;\n var nalsFound = 0; // keep searching until:\n // we reach the end of bytes\n // we reach the maximum number of nals they want to seach\n // NOTE: that we disregard nalLimit when we have found the start\n // of the nal we want so that we can find the end of the nal we want.\n\n while (i < bytes.length && (nalsFound < nalLimit || nalStart)) {\n var nalOffset = void 0;\n\n if (bytesMatch(bytes.subarray(i), NAL_TYPE_ONE)) {\n nalOffset = 4;\n } else if (bytesMatch(bytes.subarray(i), NAL_TYPE_TWO)) {\n nalOffset = 3;\n } // we are unsynced,\n // find the next nal unit\n\n\n if (!nalOffset) {\n i++;\n continue;\n }\n\n nalsFound++;\n\n if (nalStart) {\n return discardEmulationPreventionBytes(bytes.subarray(nalStart, i));\n }\n\n var nalType = void 0;\n\n if (dataType === 'h264') {\n nalType = bytes[i + nalOffset] & 0x1f;\n } else if (dataType === 'h265') {\n nalType = bytes[i + nalOffset] >> 1 & 0x3f;\n }\n\n if (types.indexOf(nalType) !== -1) {\n nalStart = i + nalOffset;\n } // nal header is 1 length for h264, and 2 for h265\n\n\n i += nalOffset + (dataType === 'h264' ? 1 : 2);\n }\n\n return bytes.subarray(0, 0);\n};\nexport var findH264Nal = function findH264Nal(bytes, type, nalLimit) {\n return findNal(bytes, 'h264', type, nalLimit);\n};\nexport var findH265Nal = function findH265Nal(bytes, type, nalLimit) {\n return findNal(bytes, 'h265', type, nalLimit);\n};","import { toUint8, bytesMatch } from './byte-helpers.js';\nimport { findBox } from './mp4-helpers.js';\nimport { findEbml, EBML_TAGS } from './ebml-helpers.js';\nimport { getId3Offset } from './id3-helpers.js';\nimport { findH264Nal, findH265Nal } from './nal-helpers.js';\nvar CONSTANTS = {\n // \"webm\" string literal in hex\n 'webm': toUint8([0x77, 0x65, 0x62, 0x6d]),\n // \"matroska\" string literal in hex\n 'matroska': toUint8([0x6d, 0x61, 0x74, 0x72, 0x6f, 0x73, 0x6b, 0x61]),\n // \"fLaC\" string literal in hex\n 'flac': toUint8([0x66, 0x4c, 0x61, 0x43]),\n // \"OggS\" string literal in hex\n 'ogg': toUint8([0x4f, 0x67, 0x67, 0x53]),\n // ac-3 sync byte, also works for ec-3 as that is simply a codec\n // of ac-3\n 'ac3': toUint8([0x0b, 0x77]),\n // \"RIFF\" string literal in hex used for wav and avi\n 'riff': toUint8([0x52, 0x49, 0x46, 0x46]),\n // \"AVI\" string literal in hex\n 'avi': toUint8([0x41, 0x56, 0x49]),\n // \"WAVE\" string literal in hex\n 'wav': toUint8([0x57, 0x41, 0x56, 0x45]),\n // \"ftyp3g\" string literal in hex\n '3gp': toUint8([0x66, 0x74, 0x79, 0x70, 0x33, 0x67]),\n // \"ftyp\" string literal in hex\n 'mp4': toUint8([0x66, 0x74, 0x79, 0x70]),\n // \"styp\" string literal in hex\n 'fmp4': toUint8([0x73, 0x74, 0x79, 0x70]),\n // \"ftypqt\" string literal in hex\n 'mov': toUint8([0x66, 0x74, 0x79, 0x70, 0x71, 0x74]),\n // moov string literal in hex\n 'moov': toUint8([0x6D, 0x6F, 0x6F, 0x76]),\n // moof string literal in hex\n 'moof': toUint8([0x6D, 0x6F, 0x6F, 0x66])\n};\nvar _isLikely = {\n aac: function aac(bytes) {\n var offset = getId3Offset(bytes);\n return bytesMatch(bytes, [0xFF, 0x10], {\n offset: offset,\n mask: [0xFF, 0x16]\n });\n },\n mp3: function mp3(bytes) {\n var offset = getId3Offset(bytes);\n return bytesMatch(bytes, [0xFF, 0x02], {\n offset: offset,\n mask: [0xFF, 0x06]\n });\n },\n webm: function webm(bytes) {\n var docType = findEbml(bytes, [EBML_TAGS.EBML, EBML_TAGS.DocType])[0]; // check if DocType EBML tag is webm\n\n return bytesMatch(docType, CONSTANTS.webm);\n },\n mkv: function mkv(bytes) {\n var docType = findEbml(bytes, [EBML_TAGS.EBML, EBML_TAGS.DocType])[0]; // check if DocType EBML tag is matroska\n\n return bytesMatch(docType, CONSTANTS.matroska);\n },\n mp4: function mp4(bytes) {\n // if this file is another base media file format, it is not mp4\n if (_isLikely['3gp'](bytes) || _isLikely.mov(bytes)) {\n return false;\n } // if this file starts with a ftyp or styp box its mp4\n\n\n if (bytesMatch(bytes, CONSTANTS.mp4, {\n offset: 4\n }) || bytesMatch(bytes, CONSTANTS.fmp4, {\n offset: 4\n })) {\n return true;\n } // if this file starts with a moof/moov box its mp4\n\n\n if (bytesMatch(bytes, CONSTANTS.moof, {\n offset: 4\n }) || bytesMatch(bytes, CONSTANTS.moov, {\n offset: 4\n })) {\n return true;\n }\n },\n mov: function mov(bytes) {\n return bytesMatch(bytes, CONSTANTS.mov, {\n offset: 4\n });\n },\n '3gp': function gp(bytes) {\n return bytesMatch(bytes, CONSTANTS['3gp'], {\n offset: 4\n });\n },\n ac3: function ac3(bytes) {\n var offset = getId3Offset(bytes);\n return bytesMatch(bytes, CONSTANTS.ac3, {\n offset: offset\n });\n },\n ts: function ts(bytes) {\n if (bytes.length < 189 && bytes.length >= 1) {\n return bytes[0] === 0x47;\n }\n\n var i = 0; // check the first 376 bytes for two matching sync bytes\n\n while (i + 188 < bytes.length && i < 188) {\n if (bytes[i] === 0x47 && bytes[i + 188] === 0x47) {\n return true;\n }\n\n i += 1;\n }\n\n return false;\n },\n flac: function flac(bytes) {\n var offset = getId3Offset(bytes);\n return bytesMatch(bytes, CONSTANTS.flac, {\n offset: offset\n });\n },\n ogg: function ogg(bytes) {\n return bytesMatch(bytes, CONSTANTS.ogg);\n },\n avi: function avi(bytes) {\n return bytesMatch(bytes, CONSTANTS.riff) && bytesMatch(bytes, CONSTANTS.avi, {\n offset: 8\n });\n },\n wav: function wav(bytes) {\n return bytesMatch(bytes, CONSTANTS.riff) && bytesMatch(bytes, CONSTANTS.wav, {\n offset: 8\n });\n },\n 'h264': function h264(bytes) {\n // find seq_parameter_set_rbsp\n return findH264Nal(bytes, 7, 3).length;\n },\n 'h265': function h265(bytes) {\n // find video_parameter_set_rbsp or seq_parameter_set_rbsp\n return findH265Nal(bytes, [32, 33], 3).length;\n }\n}; // get all the isLikely functions\n// but make sure 'ts' is above h264 and h265\n// but below everything else as it is the least specific\n\nvar isLikelyTypes = Object.keys(_isLikely) // remove ts, h264, h265\n.filter(function (t) {\n return t !== 'ts' && t !== 'h264' && t !== 'h265';\n}) // add it back to the bottom\n.concat(['ts', 'h264', 'h265']); // make sure we are dealing with uint8 data.\n\nisLikelyTypes.forEach(function (type) {\n var isLikelyFn = _isLikely[type];\n\n _isLikely[type] = function (bytes) {\n return isLikelyFn(toUint8(bytes));\n };\n}); // export after wrapping\n\nexport var isLikely = _isLikely; // A useful list of file signatures can be found here\n// https://en.wikipedia.org/wiki/List_of_file_signatures\n\nexport var detectContainerForBytes = function detectContainerForBytes(bytes) {\n bytes = toUint8(bytes);\n\n for (var i = 0; i < isLikelyTypes.length; i++) {\n var type = isLikelyTypes[i];\n\n if (isLikely[type](bytes)) {\n return type;\n }\n }\n\n return '';\n}; // fmp4 is not a container\n\nexport var isLikelyFmp4MediaSegment = function isLikelyFmp4MediaSegment(bytes) {\n return findBox(bytes, ['moof']).length > 0;\n};","/**\n * @license\n * Video.js 8.6.1 <http://videojs.com/>\n * Copyright Brightcove, Inc. <https://www.brightcove.com/>\n * Available under Apache License Version 2.0\n * <https://github.com/videojs/video.js/blob/main/LICENSE>\n *\n * Includes vtt.js <https://github.com/mozilla/vtt.js>\n * Available under Apache License Version 2.0\n * <https://github.com/mozilla/vtt.js/blob/main/LICENSE>\n */\n\nimport window$1 from 'global/window';\nimport document from 'global/document';\nimport keycode from 'keycode';\nimport safeParseTuple from 'safe-json-parse/tuple';\nimport XHR from '@videojs/xhr';\nimport vtt from 'videojs-vtt.js';\nimport _resolveUrl from '@videojs/vhs-utils/es/resolve-url.js';\nimport _extends from '@babel/runtime/helpers/extends';\nimport { Parser } from 'm3u8-parser';\nimport { DEFAULT_VIDEO_CODEC, DEFAULT_AUDIO_CODEC, parseCodecs, muxerSupportsCodec, browserSupportsCodec, translateLegacyCodec, codecsFromDefault, isAudioCodec, getMimeForCodec } from '@videojs/vhs-utils/es/codecs.js';\nimport { simpleTypeFromSourceType } from '@videojs/vhs-utils/es/media-types.js';\nimport { isArrayBufferView, concatTypedArrays, stringToBytes, toUint8 } from '@videojs/vhs-utils/es/byte-helpers';\nimport { generateSidxKey, parseUTCTiming, parse, addSidxSegmentsToPlaylist } from 'mpd-parser';\nimport parseSidx from 'mux.js/lib/tools/parse-sidx';\nimport { getId3Offset } from '@videojs/vhs-utils/es/id3-helpers';\nimport { detectContainerForBytes, isLikelyFmp4MediaSegment } from '@videojs/vhs-utils/es/containers';\nimport { ONE_SECOND_IN_TS } from 'mux.js/lib/utils/clock';\n\nvar version$6 = \"8.6.1\";\n\n/**\n * An Object that contains lifecycle hooks as keys which point to an array\n * of functions that are run when a lifecycle is triggered\n *\n * @private\n */\nconst hooks_ = {};\n\n/**\n * Get a list of hooks for a specific lifecycle\n *\n * @param {string} type\n * the lifecycle to get hooks from\n *\n * @param {Function|Function[]} [fn]\n * Optionally add a hook (or hooks) to the lifecycle that your are getting.\n *\n * @return {Array}\n * an array of hooks, or an empty array if there are none.\n */\nconst hooks = function (type, fn) {\n hooks_[type] = hooks_[type] || [];\n if (fn) {\n hooks_[type] = hooks_[type].concat(fn);\n }\n return hooks_[type];\n};\n\n/**\n * Add a function hook to a specific videojs lifecycle.\n *\n * @param {string} type\n * the lifecycle to hook the function to.\n *\n * @param {Function|Function[]}\n * The function or array of functions to attach.\n */\nconst hook = function (type, fn) {\n hooks(type, fn);\n};\n\n/**\n * Remove a hook from a specific videojs lifecycle.\n *\n * @param {string} type\n * the lifecycle that the function hooked to\n *\n * @param {Function} fn\n * The hooked function to remove\n *\n * @return {boolean}\n * The function that was removed or undef\n */\nconst removeHook = function (type, fn) {\n const index = hooks(type).indexOf(fn);\n if (index <= -1) {\n return false;\n }\n hooks_[type] = hooks_[type].slice();\n hooks_[type].splice(index, 1);\n return true;\n};\n\n/**\n * Add a function hook that will only run once to a specific videojs lifecycle.\n *\n * @param {string} type\n * the lifecycle to hook the function to.\n *\n * @param {Function|Function[]}\n * The function or array of functions to attach.\n */\nconst hookOnce = function (type, fn) {\n hooks(type, [].concat(fn).map(original => {\n const wrapper = (...args) => {\n removeHook(type, wrapper);\n return original(...args);\n };\n return wrapper;\n }));\n};\n\n/**\n * @file fullscreen-api.js\n * @module fullscreen-api\n */\n\n/**\n * Store the browser-specific methods for the fullscreen API.\n *\n * @type {Object}\n * @see [Specification]{@link https://fullscreen.spec.whatwg.org}\n * @see [Map Approach From Screenfull.js]{@link https://github.com/sindresorhus/screenfull.js}\n */\nconst FullscreenApi = {\n prefixed: true\n};\n\n// browser API methods\nconst apiMap = [['requestFullscreen', 'exitFullscreen', 'fullscreenElement', 'fullscreenEnabled', 'fullscreenchange', 'fullscreenerror', 'fullscreen'],\n// WebKit\n['webkitRequestFullscreen', 'webkitExitFullscreen', 'webkitFullscreenElement', 'webkitFullscreenEnabled', 'webkitfullscreenchange', 'webkitfullscreenerror', '-webkit-full-screen']];\nconst specApi = apiMap[0];\nlet browserApi;\n\n// determine the supported set of functions\nfor (let i = 0; i < apiMap.length; i++) {\n // check for exitFullscreen function\n if (apiMap[i][1] in document) {\n browserApi = apiMap[i];\n break;\n }\n}\n\n// map the browser API names to the spec API names\nif (browserApi) {\n for (let i = 0; i < browserApi.length; i++) {\n FullscreenApi[specApi[i]] = browserApi[i];\n }\n FullscreenApi.prefixed = browserApi[0] !== specApi[0];\n}\n\n/**\n * @file create-logger.js\n * @module create-logger\n */\n\n// This is the private tracking variable for the logging history.\nlet history = [];\n\n/**\n * Log messages to the console and history based on the type of message\n *\n * @private\n * @param {string} name\n * The name of the console method to use.\n *\n * @param {Object} log\n * The arguments to be passed to the matching console method.\n *\n * @param {string} [styles]\n * styles for name\n */\nconst LogByTypeFactory = (name, log, styles) => (type, level, args) => {\n const lvl = log.levels[level];\n const lvlRegExp = new RegExp(`^(${lvl})$`);\n let resultName = name;\n if (type !== 'log') {\n // Add the type to the front of the message when it's not \"log\".\n args.unshift(type.toUpperCase() + ':');\n }\n if (styles) {\n resultName = `%c${name}`;\n args.unshift(styles);\n }\n\n // Add console prefix after adding to history.\n args.unshift(resultName + ':');\n\n // Add a clone of the args at this point to history.\n if (history) {\n history.push([].concat(args));\n\n // only store 1000 history entries\n const splice = history.length - 1000;\n history.splice(0, splice > 0 ? splice : 0);\n }\n\n // If there's no console then don't try to output messages, but they will\n // still be stored in history.\n if (!window$1.console) {\n return;\n }\n\n // Was setting these once outside of this function, but containing them\n // in the function makes it easier to test cases where console doesn't exist\n // when the module is executed.\n let fn = window$1.console[type];\n if (!fn && type === 'debug') {\n // Certain browsers don't have support for console.debug. For those, we\n // should default to the closest comparable log.\n fn = window$1.console.info || window$1.console.log;\n }\n\n // Bail out if there's no console or if this type is not allowed by the\n // current logging level.\n if (!fn || !lvl || !lvlRegExp.test(type)) {\n return;\n }\n fn[Array.isArray(args) ? 'apply' : 'call'](window$1.console, args);\n};\nfunction createLogger$1(name, delimiter = ':', styles = '') {\n // This is the private tracking variable for logging level.\n let level = 'info';\n\n // the curried logByType bound to the specific log and history\n let logByType;\n\n /**\n * Logs plain debug messages. Similar to `console.log`.\n *\n * Due to [limitations](https://github.com/jsdoc3/jsdoc/issues/955#issuecomment-313829149)\n * of our JSDoc template, we cannot properly document this as both a function\n * and a namespace, so its function signature is documented here.\n *\n * #### Arguments\n * ##### *args\n * *[]\n *\n * Any combination of values that could be passed to `console.log()`.\n *\n * #### Return Value\n *\n * `undefined`\n *\n * @namespace\n * @param {...*} args\n * One or more messages or objects that should be logged.\n */\n const log = function (...args) {\n logByType('log', level, args);\n };\n\n // This is the logByType helper that the logging methods below use\n logByType = LogByTypeFactory(name, log, styles);\n\n /**\n * Create a new subLogger which chains the old name to the new name.\n *\n * For example, doing `videojs.log.createLogger('player')` and then using that logger will log the following:\n * ```js\n * mylogger('foo');\n * // > VIDEOJS: player: foo\n * ```\n *\n * @param {string} subName\n * The name to add call the new logger\n * @param {string} [subDelimiter]\n * Optional delimiter\n * @param {string} [subStyles]\n * Optional styles\n * @return {Object}\n */\n log.createLogger = (subName, subDelimiter, subStyles) => {\n const resultDelimiter = subDelimiter !== undefined ? subDelimiter : delimiter;\n const resultStyles = subStyles !== undefined ? subStyles : styles;\n const resultName = `${name} ${resultDelimiter} ${subName}`;\n return createLogger$1(resultName, resultDelimiter, resultStyles);\n };\n\n /**\n * Create a new logger.\n *\n * @param {string} newName\n * The name for the new logger\n * @param {string} [newDelimiter]\n * Optional delimiter\n * @param {string} [newStyles]\n * Optional styles\n * @return {Object}\n */\n log.createNewLogger = (newName, newDelimiter, newStyles) => {\n return createLogger$1(newName, newDelimiter, newStyles);\n };\n\n /**\n * Enumeration of available logging levels, where the keys are the level names\n * and the values are `|`-separated strings containing logging methods allowed\n * in that logging level. These strings are used to create a regular expression\n * matching the function name being called.\n *\n * Levels provided by Video.js are:\n *\n * - `off`: Matches no calls. Any value that can be cast to `false` will have\n * this effect. The most restrictive.\n * - `all`: Matches only Video.js-provided functions (`debug`, `log`,\n * `log.warn`, and `log.error`).\n * - `debug`: Matches `log.debug`, `log`, `log.warn`, and `log.error` calls.\n * - `info` (default): Matches `log`, `log.warn`, and `log.error` calls.\n * - `warn`: Matches `log.warn` and `log.error` calls.\n * - `error`: Matches only `log.error` calls.\n *\n * @type {Object}\n */\n log.levels = {\n all: 'debug|log|warn|error',\n off: '',\n debug: 'debug|log|warn|error',\n info: 'log|warn|error',\n warn: 'warn|error',\n error: 'error',\n DEFAULT: level\n };\n\n /**\n * Get or set the current logging level.\n *\n * If a string matching a key from {@link module:log.levels} is provided, acts\n * as a setter.\n *\n * @param {'all'|'debug'|'info'|'warn'|'error'|'off'} [lvl]\n * Pass a valid level to set a new logging level.\n *\n * @return {string}\n * The current logging level.\n */\n log.level = lvl => {\n if (typeof lvl === 'string') {\n if (!log.levels.hasOwnProperty(lvl)) {\n throw new Error(`\"${lvl}\" in not a valid log level`);\n }\n level = lvl;\n }\n return level;\n };\n\n /**\n * Returns an array containing everything that has been logged to the history.\n *\n * This array is a shallow clone of the internal history record. However, its\n * contents are _not_ cloned; so, mutating objects inside this array will\n * mutate them in history.\n *\n * @return {Array}\n */\n log.history = () => history ? [].concat(history) : [];\n\n /**\n * Allows you to filter the history by the given logger name\n *\n * @param {string} fname\n * The name to filter by\n *\n * @return {Array}\n * The filtered list to return\n */\n log.history.filter = fname => {\n return (history || []).filter(historyItem => {\n // if the first item in each historyItem includes `fname`, then it's a match\n return new RegExp(`.*${fname}.*`).test(historyItem[0]);\n });\n };\n\n /**\n * Clears the internal history tracking, but does not prevent further history\n * tracking.\n */\n log.history.clear = () => {\n if (history) {\n history.length = 0;\n }\n };\n\n /**\n * Disable history tracking if it is currently enabled.\n */\n log.history.disable = () => {\n if (history !== null) {\n history.length = 0;\n history = null;\n }\n };\n\n /**\n * Enable history tracking if it is currently disabled.\n */\n log.history.enable = () => {\n if (history === null) {\n history = [];\n }\n };\n\n /**\n * Logs error messages. Similar to `console.error`.\n *\n * @param {...*} args\n * One or more messages or objects that should be logged as an error\n */\n log.error = (...args) => logByType('error', level, args);\n\n /**\n * Logs warning messages. Similar to `console.warn`.\n *\n * @param {...*} args\n * One or more messages or objects that should be logged as a warning.\n */\n log.warn = (...args) => logByType('warn', level, args);\n\n /**\n * Logs debug messages. Similar to `console.debug`, but may also act as a comparable\n * log if `console.debug` is not available\n *\n * @param {...*} args\n * One or more messages or objects that should be logged as debug.\n */\n log.debug = (...args) => logByType('debug', level, args);\n return log;\n}\n\n/**\n * @file log.js\n * @module log\n */\nconst log$1 = createLogger$1('VIDEOJS');\nconst createLogger = log$1.createLogger;\n\n/**\n * @file obj.js\n * @module obj\n */\n\n/**\n * @callback obj:EachCallback\n *\n * @param {*} value\n * The current key for the object that is being iterated over.\n *\n * @param {string} key\n * The current key-value for object that is being iterated over\n */\n\n/**\n * @callback obj:ReduceCallback\n *\n * @param {*} accum\n * The value that is accumulating over the reduce loop.\n *\n * @param {*} value\n * The current key for the object that is being iterated over.\n *\n * @param {string} key\n * The current key-value for object that is being iterated over\n *\n * @return {*}\n * The new accumulated value.\n */\nconst toString = Object.prototype.toString;\n\n/**\n * Get the keys of an Object\n *\n * @param {Object}\n * The Object to get the keys from\n *\n * @return {string[]}\n * An array of the keys from the object. Returns an empty array if the\n * object passed in was invalid or had no keys.\n *\n * @private\n */\nconst keys = function (object) {\n return isObject(object) ? Object.keys(object) : [];\n};\n\n/**\n * Array-like iteration for objects.\n *\n * @param {Object} object\n * The object to iterate over\n *\n * @param {obj:EachCallback} fn\n * The callback function which is called for each key in the object.\n */\nfunction each(object, fn) {\n keys(object).forEach(key => fn(object[key], key));\n}\n\n/**\n * Array-like reduce for objects.\n *\n * @param {Object} object\n * The Object that you want to reduce.\n *\n * @param {Function} fn\n * A callback function which is called for each key in the object. It\n * receives the accumulated value and the per-iteration value and key\n * as arguments.\n *\n * @param {*} [initial = 0]\n * Starting value\n *\n * @return {*}\n * The final accumulated value.\n */\nfunction reduce(object, fn, initial = 0) {\n return keys(object).reduce((accum, key) => fn(accum, object[key], key), initial);\n}\n\n/**\n * Returns whether a value is an object of any kind - including DOM nodes,\n * arrays, regular expressions, etc. Not functions, though.\n *\n * This avoids the gotcha where using `typeof` on a `null` value\n * results in `'object'`.\n *\n * @param {Object} value\n * @return {boolean}\n */\nfunction isObject(value) {\n return !!value && typeof value === 'object';\n}\n\n/**\n * Returns whether an object appears to be a \"plain\" object - that is, a\n * direct instance of `Object`.\n *\n * @param {Object} value\n * @return {boolean}\n */\nfunction isPlain(value) {\n return isObject(value) && toString.call(value) === '[object Object]' && value.constructor === Object;\n}\n\n/**\n * Merge two objects recursively.\n *\n * Performs a deep merge like\n * {@link https://lodash.com/docs/4.17.10#merge|lodash.merge}, but only merges\n * plain objects (not arrays, elements, or anything else).\n *\n * Non-plain object values will be copied directly from the right-most\n * argument.\n *\n * @param {Object[]} sources\n * One or more objects to merge into a new object.\n *\n * @return {Object}\n * A new object that is the merged result of all sources.\n */\nfunction merge$1(...sources) {\n const result = {};\n sources.forEach(source => {\n if (!source) {\n return;\n }\n each(source, (value, key) => {\n if (!isPlain(value)) {\n result[key] = value;\n return;\n }\n if (!isPlain(result[key])) {\n result[key] = {};\n }\n result[key] = merge$1(result[key], value);\n });\n });\n return result;\n}\n\n/**\n * Returns an array of values for a given object\n *\n * @param {Object} source - target object\n * @return {Array<unknown>} - object values\n */\nfunction values(source = {}) {\n const result = [];\n for (const key in source) {\n if (source.hasOwnProperty(key)) {\n const value = source[key];\n result.push(value);\n }\n }\n return result;\n}\n\n/**\n * Object.defineProperty but \"lazy\", which means that the value is only set after\n * it is retrieved the first time, rather than being set right away.\n *\n * @param {Object} obj the object to set the property on\n * @param {string} key the key for the property to set\n * @param {Function} getValue the function used to get the value when it is needed.\n * @param {boolean} setter whether a setter should be allowed or not\n */\nfunction defineLazyProperty(obj, key, getValue, setter = true) {\n const set = value => Object.defineProperty(obj, key, {\n value,\n enumerable: true,\n writable: true\n });\n const options = {\n configurable: true,\n enumerable: true,\n get() {\n const value = getValue();\n set(value);\n return value;\n }\n };\n if (setter) {\n options.set = set;\n }\n return Object.defineProperty(obj, key, options);\n}\n\nvar Obj = /*#__PURE__*/Object.freeze({\n __proto__: null,\n each: each,\n reduce: reduce,\n isObject: isObject,\n isPlain: isPlain,\n merge: merge$1,\n values: values,\n defineLazyProperty: defineLazyProperty\n});\n\n/**\n * @file browser.js\n * @module browser\n */\n\n/**\n * Whether or not this device is an iPod.\n *\n * @static\n * @type {Boolean}\n */\nlet IS_IPOD = false;\n\n/**\n * The detected iOS version - or `null`.\n *\n * @static\n * @type {string|null}\n */\nlet IOS_VERSION = null;\n\n/**\n * Whether or not this is an Android device.\n *\n * @static\n * @type {Boolean}\n */\nlet IS_ANDROID = false;\n\n/**\n * The detected Android version - or `null` if not Android or indeterminable.\n *\n * @static\n * @type {number|string|null}\n */\nlet ANDROID_VERSION;\n\n/**\n * Whether or not this is Mozilla Firefox.\n *\n * @static\n * @type {Boolean}\n */\nlet IS_FIREFOX = false;\n\n/**\n * Whether or not this is Microsoft Edge.\n *\n * @static\n * @type {Boolean}\n */\nlet IS_EDGE = false;\n\n/**\n * Whether or not this is any Chromium Browser\n *\n * @static\n * @type {Boolean}\n */\nlet IS_CHROMIUM = false;\n\n/**\n * Whether or not this is any Chromium browser that is not Edge.\n *\n * This will also be `true` for Chrome on iOS, which will have different support\n * as it is actually Safari under the hood.\n *\n * Deprecated, as the behaviour to not match Edge was to prevent Legacy Edge's UA matching.\n * IS_CHROMIUM should be used instead.\n * \"Chromium but not Edge\" could be explicitly tested with IS_CHROMIUM && !IS_EDGE\n *\n * @static\n * @deprecated\n * @type {Boolean}\n */\nlet IS_CHROME = false;\n\n/**\n * The detected Chromium version - or `null`.\n *\n * @static\n * @type {number|null}\n */\nlet CHROMIUM_VERSION = null;\n\n/**\n * The detected Google Chrome version - or `null`.\n * This has always been the _Chromium_ version, i.e. would return on Chromium Edge.\n * Deprecated, use CHROMIUM_VERSION instead.\n *\n * @static\n * @deprecated\n * @type {number|null}\n */\nlet CHROME_VERSION = null;\n\n/**\n * The detected Internet Explorer version - or `null`.\n *\n * @static\n * @deprecated\n * @type {number|null}\n */\nlet IE_VERSION = null;\n\n/**\n * Whether or not this is desktop Safari.\n *\n * @static\n * @type {Boolean}\n */\nlet IS_SAFARI = false;\n\n/**\n * Whether or not this is a Windows machine.\n *\n * @static\n * @type {Boolean}\n */\nlet IS_WINDOWS = false;\n\n/**\n * Whether or not this device is an iPad.\n *\n * @static\n * @type {Boolean}\n */\nlet IS_IPAD = false;\n\n/**\n * Whether or not this device is an iPhone.\n *\n * @static\n * @type {Boolean}\n */\n// The Facebook app's UIWebView identifies as both an iPhone and iPad, so\n// to identify iPhones, we need to exclude iPads.\n// http://artsy.github.io/blog/2012/10/18/the-perils-of-ios-user-agent-sniffing/\nlet IS_IPHONE = false;\n\n/**\n * Whether or not this device is touch-enabled.\n *\n * @static\n * @const\n * @type {Boolean}\n */\nconst TOUCH_ENABLED = Boolean(isReal() && ('ontouchstart' in window$1 || window$1.navigator.maxTouchPoints || window$1.DocumentTouch && window$1.document instanceof window$1.DocumentTouch));\nconst UAD = window$1.navigator && window$1.navigator.userAgentData;\nif (UAD) {\n // If userAgentData is present, use it instead of userAgent to avoid warnings\n // Currently only implemented on Chromium\n // userAgentData does not expose Android version, so ANDROID_VERSION remains `null`\n\n IS_ANDROID = UAD.platform === 'Android';\n IS_EDGE = Boolean(UAD.brands.find(b => b.brand === 'Microsoft Edge'));\n IS_CHROMIUM = Boolean(UAD.brands.find(b => b.brand === 'Chromium'));\n IS_CHROME = !IS_EDGE && IS_CHROMIUM;\n CHROMIUM_VERSION = CHROME_VERSION = (UAD.brands.find(b => b.brand === 'Chromium') || {}).version || null;\n IS_WINDOWS = UAD.platform === 'Windows';\n}\n\n// If the browser is not Chromium, either userAgentData is not present which could be an old Chromium browser,\n// or it's a browser that has added userAgentData since that we don't have tests for yet. In either case,\n// the checks need to be made agiainst the regular userAgent string.\nif (!IS_CHROMIUM) {\n const USER_AGENT = window$1.navigator && window$1.navigator.userAgent || '';\n IS_IPOD = /iPod/i.test(USER_AGENT);\n IOS_VERSION = function () {\n const match = USER_AGENT.match(/OS (\\d+)_/i);\n if (match && match[1]) {\n return match[1];\n }\n return null;\n }();\n IS_ANDROID = /Android/i.test(USER_AGENT);\n ANDROID_VERSION = function () {\n // This matches Android Major.Minor.Patch versions\n // ANDROID_VERSION is Major.Minor as a Number, if Minor isn't available, then only Major is returned\n const match = USER_AGENT.match(/Android (\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))*/i);\n if (!match) {\n return null;\n }\n const major = match[1] && parseFloat(match[1]);\n const minor = match[2] && parseFloat(match[2]);\n if (major && minor) {\n return parseFloat(match[1] + '.' + match[2]);\n } else if (major) {\n return major;\n }\n return null;\n }();\n IS_FIREFOX = /Firefox/i.test(USER_AGENT);\n IS_EDGE = /Edg/i.test(USER_AGENT);\n IS_CHROMIUM = /Chrome/i.test(USER_AGENT) || /CriOS/i.test(USER_AGENT);\n IS_CHROME = !IS_EDGE && IS_CHROMIUM;\n CHROMIUM_VERSION = CHROME_VERSION = function () {\n const match = USER_AGENT.match(/(Chrome|CriOS)\\/(\\d+)/);\n if (match && match[2]) {\n return parseFloat(match[2]);\n }\n return null;\n }();\n IE_VERSION = function () {\n const result = /MSIE\\s(\\d+)\\.\\d/.exec(USER_AGENT);\n let version = result && parseFloat(result[1]);\n if (!version && /Trident\\/7.0/i.test(USER_AGENT) && /rv:11.0/.test(USER_AGENT)) {\n // IE 11 has a different user agent string than other IE versions\n version = 11.0;\n }\n return version;\n }();\n IS_SAFARI = /Safari/i.test(USER_AGENT) && !IS_CHROME && !IS_ANDROID && !IS_EDGE;\n IS_WINDOWS = /Windows/i.test(USER_AGENT);\n IS_IPAD = /iPad/i.test(USER_AGENT) || IS_SAFARI && TOUCH_ENABLED && !/iPhone/i.test(USER_AGENT);\n IS_IPHONE = /iPhone/i.test(USER_AGENT) && !IS_IPAD;\n}\n\n/**\n * Whether or not this is an iOS device.\n *\n * @static\n * @const\n * @type {Boolean}\n */\nconst IS_IOS = IS_IPHONE || IS_IPAD || IS_IPOD;\n\n/**\n * Whether or not this is any flavor of Safari - including iOS.\n *\n * @static\n * @const\n * @type {Boolean}\n */\nconst IS_ANY_SAFARI = (IS_SAFARI || IS_IOS) && !IS_CHROME;\n\nvar browser = /*#__PURE__*/Object.freeze({\n __proto__: null,\n get IS_IPOD () { return IS_IPOD; },\n get IOS_VERSION () { return IOS_VERSION; },\n get IS_ANDROID () { return IS_ANDROID; },\n get ANDROID_VERSION () { return ANDROID_VERSION; },\n get IS_FIREFOX () { return IS_FIREFOX; },\n get IS_EDGE () { return IS_EDGE; },\n get IS_CHROMIUM () { return IS_CHROMIUM; },\n get IS_CHROME () { return IS_CHROME; },\n get CHROMIUM_VERSION () { return CHROMIUM_VERSION; },\n get CHROME_VERSION () { return CHROME_VERSION; },\n get IE_VERSION () { return IE_VERSION; },\n get IS_SAFARI () { return IS_SAFARI; },\n get IS_WINDOWS () { return IS_WINDOWS; },\n get IS_IPAD () { return IS_IPAD; },\n get IS_IPHONE () { return IS_IPHONE; },\n TOUCH_ENABLED: TOUCH_ENABLED,\n IS_IOS: IS_IOS,\n IS_ANY_SAFARI: IS_ANY_SAFARI\n});\n\n/**\n * @file dom.js\n * @module dom\n */\n\n/**\n * Detect if a value is a string with any non-whitespace characters.\n *\n * @private\n * @param {string} str\n * The string to check\n *\n * @return {boolean}\n * Will be `true` if the string is non-blank, `false` otherwise.\n *\n */\nfunction isNonBlankString(str) {\n // we use str.trim as it will trim any whitespace characters\n // from the front or back of non-whitespace characters. aka\n // Any string that contains non-whitespace characters will\n // still contain them after `trim` but whitespace only strings\n // will have a length of 0, failing this check.\n return typeof str === 'string' && Boolean(str.trim());\n}\n\n/**\n * Throws an error if the passed string has whitespace. This is used by\n * class methods to be relatively consistent with the classList API.\n *\n * @private\n * @param {string} str\n * The string to check for whitespace.\n *\n * @throws {Error}\n * Throws an error if there is whitespace in the string.\n */\nfunction throwIfWhitespace(str) {\n // str.indexOf instead of regex because str.indexOf is faster performance wise.\n if (str.indexOf(' ') >= 0) {\n throw new Error('class has illegal whitespace characters');\n }\n}\n\n/**\n * Whether the current DOM interface appears to be real (i.e. not simulated).\n *\n * @return {boolean}\n * Will be `true` if the DOM appears to be real, `false` otherwise.\n */\nfunction isReal() {\n // Both document and window will never be undefined thanks to `global`.\n return document === window$1.document;\n}\n\n/**\n * Determines, via duck typing, whether or not a value is a DOM element.\n *\n * @param {*} value\n * The value to check.\n *\n * @return {boolean}\n * Will be `true` if the value is a DOM element, `false` otherwise.\n */\nfunction isEl(value) {\n return isObject(value) && value.nodeType === 1;\n}\n\n/**\n * Determines if the current DOM is embedded in an iframe.\n *\n * @return {boolean}\n * Will be `true` if the DOM is embedded in an iframe, `false`\n * otherwise.\n */\nfunction isInFrame() {\n // We need a try/catch here because Safari will throw errors when attempting\n // to get either `parent` or `self`\n try {\n return window$1.parent !== window$1.self;\n } catch (x) {\n return true;\n }\n}\n\n/**\n * Creates functions to query the DOM using a given method.\n *\n * @private\n * @param {string} method\n * The method to create the query with.\n *\n * @return {Function}\n * The query method\n */\nfunction createQuerier(method) {\n return function (selector, context) {\n if (!isNonBlankString(selector)) {\n return document[method](null);\n }\n if (isNonBlankString(context)) {\n context = document.querySelector(context);\n }\n const ctx = isEl(context) ? context : document;\n return ctx[method] && ctx[method](selector);\n };\n}\n\n/**\n * Creates an element and applies properties, attributes, and inserts content.\n *\n * @param {string} [tagName='div']\n * Name of tag to be created.\n *\n * @param {Object} [properties={}]\n * Element properties to be applied.\n *\n * @param {Object} [attributes={}]\n * Element attributes to be applied.\n *\n * @param {ContentDescriptor} [content]\n * A content descriptor object.\n *\n * @return {Element}\n * The element that was created.\n */\nfunction createEl(tagName = 'div', properties = {}, attributes = {}, content) {\n const el = document.createElement(tagName);\n Object.getOwnPropertyNames(properties).forEach(function (propName) {\n const val = properties[propName];\n\n // Handle textContent since it's not supported everywhere and we have a\n // method for it.\n if (propName === 'textContent') {\n textContent(el, val);\n } else if (el[propName] !== val || propName === 'tabIndex') {\n el[propName] = val;\n }\n });\n Object.getOwnPropertyNames(attributes).forEach(function (attrName) {\n el.setAttribute(attrName, attributes[attrName]);\n });\n if (content) {\n appendContent(el, content);\n }\n return el;\n}\n\n/**\n * Injects text into an element, replacing any existing contents entirely.\n *\n * @param {HTMLElement} el\n * The element to add text content into\n *\n * @param {string} text\n * The text content to add.\n *\n * @return {Element}\n * The element with added text content.\n */\nfunction textContent(el, text) {\n if (typeof el.textContent === 'undefined') {\n el.innerText = text;\n } else {\n el.textContent = text;\n }\n return el;\n}\n\n/**\n * Insert an element as the first child node of another\n *\n * @param {Element} child\n * Element to insert\n *\n * @param {Element} parent\n * Element to insert child into\n */\nfunction prependTo(child, parent) {\n if (parent.firstChild) {\n parent.insertBefore(child, parent.firstChild);\n } else {\n parent.appendChild(child);\n }\n}\n\n/**\n * Check if an element has a class name.\n *\n * @param {Element} element\n * Element to check\n *\n * @param {string} classToCheck\n * Class name to check for\n *\n * @return {boolean}\n * Will be `true` if the element has a class, `false` otherwise.\n *\n * @throws {Error}\n * Throws an error if `classToCheck` has white space.\n */\nfunction hasClass(element, classToCheck) {\n throwIfWhitespace(classToCheck);\n return element.classList.contains(classToCheck);\n}\n\n/**\n * Add a class name to an element.\n *\n * @param {Element} element\n * Element to add class name to.\n *\n * @param {...string} classesToAdd\n * One or more class name to add.\n *\n * @return {Element}\n * The DOM element with the added class name.\n */\nfunction addClass(element, ...classesToAdd) {\n element.classList.add(...classesToAdd.reduce((prev, current) => prev.concat(current.split(/\\s+/)), []));\n return element;\n}\n\n/**\n * Remove a class name from an element.\n *\n * @param {Element} element\n * Element to remove a class name from.\n *\n * @param {...string} classesToRemove\n * One or more class name to remove.\n *\n * @return {Element}\n * The DOM element with class name removed.\n */\nfunction removeClass(element, ...classesToRemove) {\n // Protect in case the player gets disposed\n if (!element) {\n log$1.warn(\"removeClass was called with an element that doesn't exist\");\n return null;\n }\n element.classList.remove(...classesToRemove.reduce((prev, current) => prev.concat(current.split(/\\s+/)), []));\n return element;\n}\n\n/**\n * The callback definition for toggleClass.\n *\n * @callback module:dom~PredicateCallback\n * @param {Element} element\n * The DOM element of the Component.\n *\n * @param {string} classToToggle\n * The `className` that wants to be toggled\n *\n * @return {boolean|undefined}\n * If `true` is returned, the `classToToggle` will be added to the\n * `element`. If `false`, the `classToToggle` will be removed from\n * the `element`. If `undefined`, the callback will be ignored.\n */\n\n/**\n * Adds or removes a class name to/from an element depending on an optional\n * condition or the presence/absence of the class name.\n *\n * @param {Element} element\n * The element to toggle a class name on.\n *\n * @param {string} classToToggle\n * The class that should be toggled.\n *\n * @param {boolean|module:dom~PredicateCallback} [predicate]\n * See the return value for {@link module:dom~PredicateCallback}\n *\n * @return {Element}\n * The element with a class that has been toggled.\n */\nfunction toggleClass(element, classToToggle, predicate) {\n if (typeof predicate === 'function') {\n predicate = predicate(element, classToToggle);\n }\n if (typeof predicate !== 'boolean') {\n predicate = undefined;\n }\n classToToggle.split(/\\s+/).forEach(className => element.classList.toggle(className, predicate));\n return element;\n}\n\n/**\n * Apply attributes to an HTML element.\n *\n * @param {Element} el\n * Element to add attributes to.\n *\n * @param {Object} [attributes]\n * Attributes to be applied.\n */\nfunction setAttributes(el, attributes) {\n Object.getOwnPropertyNames(attributes).forEach(function (attrName) {\n const attrValue = attributes[attrName];\n if (attrValue === null || typeof attrValue === 'undefined' || attrValue === false) {\n el.removeAttribute(attrName);\n } else {\n el.setAttribute(attrName, attrValue === true ? '' : attrValue);\n }\n });\n}\n\n/**\n * Get an element's attribute values, as defined on the HTML tag.\n *\n * Attributes are not the same as properties. They're defined on the tag\n * or with setAttribute.\n *\n * @param {Element} tag\n * Element from which to get tag attributes.\n *\n * @return {Object}\n * All attributes of the element. Boolean attributes will be `true` or\n * `false`, others will be strings.\n */\nfunction getAttributes(tag) {\n const obj = {};\n\n // known boolean attributes\n // we can check for matching boolean properties, but not all browsers\n // and not all tags know about these attributes, so, we still want to check them manually\n const knownBooleans = ['autoplay', 'controls', 'playsinline', 'loop', 'muted', 'default', 'defaultMuted'];\n if (tag && tag.attributes && tag.attributes.length > 0) {\n const attrs = tag.attributes;\n for (let i = attrs.length - 1; i >= 0; i--) {\n const attrName = attrs[i].name;\n /** @type {boolean|string} */\n let attrVal = attrs[i].value;\n\n // check for known booleans\n // the matching element property will return a value for typeof\n if (knownBooleans.includes(attrName)) {\n // the value of an included boolean attribute is typically an empty\n // string ('') which would equal false if we just check for a false value.\n // we also don't want support bad code like autoplay='false'\n attrVal = attrVal !== null ? true : false;\n }\n obj[attrName] = attrVal;\n }\n }\n return obj;\n}\n\n/**\n * Get the value of an element's attribute.\n *\n * @param {Element} el\n * A DOM element.\n *\n * @param {string} attribute\n * Attribute to get the value of.\n *\n * @return {string}\n * The value of the attribute.\n */\nfunction getAttribute(el, attribute) {\n return el.getAttribute(attribute);\n}\n\n/**\n * Set the value of an element's attribute.\n *\n * @param {Element} el\n * A DOM element.\n *\n * @param {string} attribute\n * Attribute to set.\n *\n * @param {string} value\n * Value to set the attribute to.\n */\nfunction setAttribute(el, attribute, value) {\n el.setAttribute(attribute, value);\n}\n\n/**\n * Remove an element's attribute.\n *\n * @param {Element} el\n * A DOM element.\n *\n * @param {string} attribute\n * Attribute to remove.\n */\nfunction removeAttribute(el, attribute) {\n el.removeAttribute(attribute);\n}\n\n/**\n * Attempt to block the ability to select text.\n */\nfunction blockTextSelection() {\n document.body.focus();\n document.onselectstart = function () {\n return false;\n };\n}\n\n/**\n * Turn off text selection blocking.\n */\nfunction unblockTextSelection() {\n document.onselectstart = function () {\n return true;\n };\n}\n\n/**\n * Identical to the native `getBoundingClientRect` function, but ensures that\n * the method is supported at all (it is in all browsers we claim to support)\n * and that the element is in the DOM before continuing.\n *\n * This wrapper function also shims properties which are not provided by some\n * older browsers (namely, IE8).\n *\n * Additionally, some browsers do not support adding properties to a\n * `ClientRect`/`DOMRect` object; so, we shallow-copy it with the standard\n * properties (except `x` and `y` which are not widely supported). This helps\n * avoid implementations where keys are non-enumerable.\n *\n * @param {Element} el\n * Element whose `ClientRect` we want to calculate.\n *\n * @return {Object|undefined}\n * Always returns a plain object - or `undefined` if it cannot.\n */\nfunction getBoundingClientRect(el) {\n if (el && el.getBoundingClientRect && el.parentNode) {\n const rect = el.getBoundingClientRect();\n const result = {};\n ['bottom', 'height', 'left', 'right', 'top', 'width'].forEach(k => {\n if (rect[k] !== undefined) {\n result[k] = rect[k];\n }\n });\n if (!result.height) {\n result.height = parseFloat(computedStyle(el, 'height'));\n }\n if (!result.width) {\n result.width = parseFloat(computedStyle(el, 'width'));\n }\n return result;\n }\n}\n\n/**\n * Represents the position of a DOM element on the page.\n *\n * @typedef {Object} module:dom~Position\n *\n * @property {number} left\n * Pixels to the left.\n *\n * @property {number} top\n * Pixels from the top.\n */\n\n/**\n * Get the position of an element in the DOM.\n *\n * Uses `getBoundingClientRect` technique from John Resig.\n *\n * @see http://ejohn.org/blog/getboundingclientrect-is-awesome/\n *\n * @param {Element} el\n * Element from which to get offset.\n *\n * @return {module:dom~Position}\n * The position of the element that was passed in.\n */\nfunction findPosition(el) {\n if (!el || el && !el.offsetParent) {\n return {\n left: 0,\n top: 0,\n width: 0,\n height: 0\n };\n }\n const width = el.offsetWidth;\n const height = el.offsetHeight;\n let left = 0;\n let top = 0;\n while (el.offsetParent && el !== document[FullscreenApi.fullscreenElement]) {\n left += el.offsetLeft;\n top += el.offsetTop;\n el = el.offsetParent;\n }\n return {\n left,\n top,\n width,\n height\n };\n}\n\n/**\n * Represents x and y coordinates for a DOM element or mouse pointer.\n *\n * @typedef {Object} module:dom~Coordinates\n *\n * @property {number} x\n * x coordinate in pixels\n *\n * @property {number} y\n * y coordinate in pixels\n */\n\n/**\n * Get the pointer position within an element.\n *\n * The base on the coordinates are the bottom left of the element.\n *\n * @param {Element} el\n * Element on which to get the pointer position on.\n *\n * @param {Event} event\n * Event object.\n *\n * @return {module:dom~Coordinates}\n * A coordinates object corresponding to the mouse position.\n *\n */\nfunction getPointerPosition(el, event) {\n const translated = {\n x: 0,\n y: 0\n };\n if (IS_IOS) {\n let item = el;\n while (item && item.nodeName.toLowerCase() !== 'html') {\n const transform = computedStyle(item, 'transform');\n if (/^matrix/.test(transform)) {\n const values = transform.slice(7, -1).split(/,\\s/).map(Number);\n translated.x += values[4];\n translated.y += values[5];\n } else if (/^matrix3d/.test(transform)) {\n const values = transform.slice(9, -1).split(/,\\s/).map(Number);\n translated.x += values[12];\n translated.y += values[13];\n }\n item = item.parentNode;\n }\n }\n const position = {};\n const boxTarget = findPosition(event.target);\n const box = findPosition(el);\n const boxW = box.width;\n const boxH = box.height;\n let offsetY = event.offsetY - (box.top - boxTarget.top);\n let offsetX = event.offsetX - (box.left - boxTarget.left);\n if (event.changedTouches) {\n offsetX = event.changedTouches[0].pageX - box.left;\n offsetY = event.changedTouches[0].pageY + box.top;\n if (IS_IOS) {\n offsetX -= translated.x;\n offsetY -= translated.y;\n }\n }\n position.y = 1 - Math.max(0, Math.min(1, offsetY / boxH));\n position.x = Math.max(0, Math.min(1, offsetX / boxW));\n return position;\n}\n\n/**\n * Determines, via duck typing, whether or not a value is a text node.\n *\n * @param {*} value\n * Check if this value is a text node.\n *\n * @return {boolean}\n * Will be `true` if the value is a text node, `false` otherwise.\n */\nfunction isTextNode(value) {\n return isObject(value) && value.nodeType === 3;\n}\n\n/**\n * Empties the contents of an element.\n *\n * @param {Element} el\n * The element to empty children from\n *\n * @return {Element}\n * The element with no children\n */\nfunction emptyEl(el) {\n while (el.firstChild) {\n el.removeChild(el.firstChild);\n }\n return el;\n}\n\n/**\n * This is a mixed value that describes content to be injected into the DOM\n * via some method. It can be of the following types:\n *\n * Type | Description\n * -----------|-------------\n * `string` | The value will be normalized into a text node.\n * `Element` | The value will be accepted as-is.\n * `Text` | A TextNode. The value will be accepted as-is.\n * `Array` | A one-dimensional array of strings, elements, text nodes, or functions. These functions should return a string, element, or text node (any other return value, like an array, will be ignored).\n * `Function` | A function, which is expected to return a string, element, text node, or array - any of the other possible values described above. This means that a content descriptor could be a function that returns an array of functions, but those second-level functions must return strings, elements, or text nodes.\n *\n * @typedef {string|Element|Text|Array|Function} ContentDescriptor\n */\n\n/**\n * Normalizes content for eventual insertion into the DOM.\n *\n * This allows a wide range of content definition methods, but helps protect\n * from falling into the trap of simply writing to `innerHTML`, which could\n * be an XSS concern.\n *\n * The content for an element can be passed in multiple types and\n * combinations, whose behavior is as follows:\n *\n * @param {ContentDescriptor} content\n * A content descriptor value.\n *\n * @return {Array}\n * All of the content that was passed in, normalized to an array of\n * elements or text nodes.\n */\nfunction normalizeContent(content) {\n // First, invoke content if it is a function. If it produces an array,\n // that needs to happen before normalization.\n if (typeof content === 'function') {\n content = content();\n }\n\n // Next up, normalize to an array, so one or many items can be normalized,\n // filtered, and returned.\n return (Array.isArray(content) ? content : [content]).map(value => {\n // First, invoke value if it is a function to produce a new value,\n // which will be subsequently normalized to a Node of some kind.\n if (typeof value === 'function') {\n value = value();\n }\n if (isEl(value) || isTextNode(value)) {\n return value;\n }\n if (typeof value === 'string' && /\\S/.test(value)) {\n return document.createTextNode(value);\n }\n }).filter(value => value);\n}\n\n/**\n * Normalizes and appends content to an element.\n *\n * @param {Element} el\n * Element to append normalized content to.\n *\n * @param {ContentDescriptor} content\n * A content descriptor value.\n *\n * @return {Element}\n * The element with appended normalized content.\n */\nfunction appendContent(el, content) {\n normalizeContent(content).forEach(node => el.appendChild(node));\n return el;\n}\n\n/**\n * Normalizes and inserts content into an element; this is identical to\n * `appendContent()`, except it empties the element first.\n *\n * @param {Element} el\n * Element to insert normalized content into.\n *\n * @param {ContentDescriptor} content\n * A content descriptor value.\n *\n * @return {Element}\n * The element with inserted normalized content.\n */\nfunction insertContent(el, content) {\n return appendContent(emptyEl(el), content);\n}\n\n/**\n * Check if an event was a single left click.\n *\n * @param {MouseEvent} event\n * Event object.\n *\n * @return {boolean}\n * Will be `true` if a single left click, `false` otherwise.\n */\nfunction isSingleLeftClick(event) {\n // Note: if you create something draggable, be sure to\n // call it on both `mousedown` and `mousemove` event,\n // otherwise `mousedown` should be enough for a button\n\n if (event.button === undefined && event.buttons === undefined) {\n // Why do we need `buttons` ?\n // Because, middle mouse sometimes have this:\n // e.button === 0 and e.buttons === 4\n // Furthermore, we want to prevent combination click, something like\n // HOLD middlemouse then left click, that would be\n // e.button === 0, e.buttons === 5\n // just `button` is not gonna work\n\n // Alright, then what this block does ?\n // this is for chrome `simulate mobile devices`\n // I want to support this as well\n\n return true;\n }\n if (event.button === 0 && event.buttons === undefined) {\n // Touch screen, sometimes on some specific device, `buttons`\n // doesn't have anything (safari on ios, blackberry...)\n\n return true;\n }\n\n // `mouseup` event on a single left click has\n // `button` and `buttons` equal to 0\n if (event.type === 'mouseup' && event.button === 0 && event.buttons === 0) {\n return true;\n }\n if (event.button !== 0 || event.buttons !== 1) {\n // This is the reason we have those if else block above\n // if any special case we can catch and let it slide\n // we do it above, when get to here, this definitely\n // is-not-left-click\n\n return false;\n }\n return true;\n}\n\n/**\n * Finds a single DOM element matching `selector` within the optional\n * `context` of another DOM element (defaulting to `document`).\n *\n * @param {string} selector\n * A valid CSS selector, which will be passed to `querySelector`.\n *\n * @param {Element|String} [context=document]\n * A DOM element within which to query. Can also be a selector\n * string in which case the first matching element will be used\n * as context. If missing (or no element matches selector), falls\n * back to `document`.\n *\n * @return {Element|null}\n * The element that was found or null.\n */\nconst $ = createQuerier('querySelector');\n\n/**\n * Finds a all DOM elements matching `selector` within the optional\n * `context` of another DOM element (defaulting to `document`).\n *\n * @param {string} selector\n * A valid CSS selector, which will be passed to `querySelectorAll`.\n *\n * @param {Element|String} [context=document]\n * A DOM element within which to query. Can also be a selector\n * string in which case the first matching element will be used\n * as context. If missing (or no element matches selector), falls\n * back to `document`.\n *\n * @return {NodeList}\n * A element list of elements that were found. Will be empty if none\n * were found.\n *\n */\nconst $$ = createQuerier('querySelectorAll');\n\n/**\n * A safe getComputedStyle.\n *\n * This is needed because in Firefox, if the player is loaded in an iframe with\n * `display:none`, then `getComputedStyle` returns `null`, so, we do a\n * null-check to make sure that the player doesn't break in these cases.\n *\n * @param {Element} el\n * The element you want the computed style of\n *\n * @param {string} prop\n * The property name you want\n *\n * @see https://bugzilla.mozilla.org/show_bug.cgi?id=548397\n */\nfunction computedStyle(el, prop) {\n if (!el || !prop) {\n return '';\n }\n if (typeof window$1.getComputedStyle === 'function') {\n let computedStyleValue;\n try {\n computedStyleValue = window$1.getComputedStyle(el);\n } catch (e) {\n return '';\n }\n return computedStyleValue ? computedStyleValue.getPropertyValue(prop) || computedStyleValue[prop] : '';\n }\n return '';\n}\n\n/**\n * Copy document style sheets to another window.\n *\n * @param {Window} win\n * The window element you want to copy the document style sheets to.\n *\n */\nfunction copyStyleSheetsToWindow(win) {\n [...document.styleSheets].forEach(styleSheet => {\n try {\n const cssRules = [...styleSheet.cssRules].map(rule => rule.cssText).join('');\n const style = document.createElement('style');\n style.textContent = cssRules;\n win.document.head.appendChild(style);\n } catch (e) {\n const link = document.createElement('link');\n link.rel = 'stylesheet';\n link.type = styleSheet.type;\n // For older Safari this has to be the string; on other browsers setting the MediaList works\n link.media = styleSheet.media.mediaText;\n link.href = styleSheet.href;\n win.document.head.appendChild(link);\n }\n });\n}\n\nvar Dom = /*#__PURE__*/Object.freeze({\n __proto__: null,\n isReal: isReal,\n isEl: isEl,\n isInFrame: isInFrame,\n createEl: createEl,\n textContent: textContent,\n prependTo: prependTo,\n hasClass: hasClass,\n addClass: addClass,\n removeClass: removeClass,\n toggleClass: toggleClass,\n setAttributes: setAttributes,\n getAttributes: getAttributes,\n getAttribute: getAttribute,\n setAttribute: setAttribute,\n removeAttribute: removeAttribute,\n blockTextSelection: blockTextSelection,\n unblockTextSelection: unblockTextSelection,\n getBoundingClientRect: getBoundingClientRect,\n findPosition: findPosition,\n getPointerPosition: getPointerPosition,\n isTextNode: isTextNode,\n emptyEl: emptyEl,\n normalizeContent: normalizeContent,\n appendContent: appendContent,\n insertContent: insertContent,\n isSingleLeftClick: isSingleLeftClick,\n $: $,\n $$: $$,\n computedStyle: computedStyle,\n copyStyleSheetsToWindow: copyStyleSheetsToWindow\n});\n\n/**\n * @file setup.js - Functions for setting up a player without\n * user interaction based on the data-setup `attribute` of the video tag.\n *\n * @module setup\n */\nlet _windowLoaded = false;\nlet videojs$1;\n\n/**\n * Set up any tags that have a data-setup `attribute` when the player is started.\n */\nconst autoSetup = function () {\n if (videojs$1.options.autoSetup === false) {\n return;\n }\n const vids = Array.prototype.slice.call(document.getElementsByTagName('video'));\n const audios = Array.prototype.slice.call(document.getElementsByTagName('audio'));\n const divs = Array.prototype.slice.call(document.getElementsByTagName('video-js'));\n const mediaEls = vids.concat(audios, divs);\n\n // Check if any media elements exist\n if (mediaEls && mediaEls.length > 0) {\n for (let i = 0, e = mediaEls.length; i < e; i++) {\n const mediaEl = mediaEls[i];\n\n // Check if element exists, has getAttribute func.\n if (mediaEl && mediaEl.getAttribute) {\n // Make sure this player hasn't already been set up.\n if (mediaEl.player === undefined) {\n const options = mediaEl.getAttribute('data-setup');\n\n // Check if data-setup attr exists.\n // We only auto-setup if they've added the data-setup attr.\n if (options !== null) {\n // Create new video.js instance.\n videojs$1(mediaEl);\n }\n }\n\n // If getAttribute isn't defined, we need to wait for the DOM.\n } else {\n autoSetupTimeout(1);\n break;\n }\n }\n\n // No videos were found, so keep looping unless page is finished loading.\n } else if (!_windowLoaded) {\n autoSetupTimeout(1);\n }\n};\n\n/**\n * Wait until the page is loaded before running autoSetup. This will be called in\n * autoSetup if `hasLoaded` returns false.\n *\n * @param {number} wait\n * How long to wait in ms\n *\n * @param {module:videojs} [vjs]\n * The videojs library function\n */\nfunction autoSetupTimeout(wait, vjs) {\n // Protect against breakage in non-browser environments\n if (!isReal()) {\n return;\n }\n if (vjs) {\n videojs$1 = vjs;\n }\n window$1.setTimeout(autoSetup, wait);\n}\n\n/**\n * Used to set the internal tracking of window loaded state to true.\n *\n * @private\n */\nfunction setWindowLoaded() {\n _windowLoaded = true;\n window$1.removeEventListener('load', setWindowLoaded);\n}\nif (isReal()) {\n if (document.readyState === 'complete') {\n setWindowLoaded();\n } else {\n /**\n * Listen for the load event on window, and set _windowLoaded to true.\n *\n * We use a standard event listener here to avoid incrementing the GUID\n * before any players are created.\n *\n * @listens load\n */\n window$1.addEventListener('load', setWindowLoaded);\n }\n}\n\n/**\n * @file stylesheet.js\n * @module stylesheet\n */\n\n/**\n * Create a DOM style element given a className for it.\n *\n * @param {string} className\n * The className to add to the created style element.\n *\n * @return {Element}\n * The element that was created.\n */\nconst createStyleElement = function (className) {\n const style = document.createElement('style');\n style.className = className;\n return style;\n};\n\n/**\n * Add text to a DOM element.\n *\n * @param {Element} el\n * The Element to add text content to.\n *\n * @param {string} content\n * The text to add to the element.\n */\nconst setTextContent = function (el, content) {\n if (el.styleSheet) {\n el.styleSheet.cssText = content;\n } else {\n el.textContent = content;\n }\n};\n\n/**\n * @file dom-data.js\n * @module dom-data\n */\n\n/**\n * Element Data Store.\n *\n * Allows for binding data to an element without putting it directly on the\n * element. Ex. Event listeners are stored here.\n * (also from jsninja.com, slightly modified and updated for closure compiler)\n *\n * @type {Object}\n * @private\n */\nvar DomData = new WeakMap();\n\n/**\n * @file guid.js\n * @module guid\n */\n\n// Default value for GUIDs. This allows us to reset the GUID counter in tests.\n//\n// The initial GUID is 3 because some users have come to rely on the first\n// default player ID ending up as `vjs_video_3`.\n//\n// See: https://github.com/videojs/video.js/pull/6216\nconst _initialGuid = 3;\n\n/**\n * Unique ID for an element or function\n *\n * @type {Number}\n */\nlet _guid = _initialGuid;\n\n/**\n * Get a unique auto-incrementing ID by number that has not been returned before.\n *\n * @return {number}\n * A new unique ID.\n */\nfunction newGUID() {\n return _guid++;\n}\n\n/**\n * @file events.js. An Event System (John Resig - Secrets of a JS Ninja http://jsninja.com/)\n * (Original book version wasn't completely usable, so fixed some things and made Closure Compiler compatible)\n * This should work very similarly to jQuery's events, however it's based off the book version which isn't as\n * robust as jquery's, so there's probably some differences.\n *\n * @file events.js\n * @module events\n */\n\n/**\n * Clean up the listener cache and dispatchers\n *\n * @param {Element|Object} elem\n * Element to clean up\n *\n * @param {string} type\n * Type of event to clean up\n */\nfunction _cleanUpEvents(elem, type) {\n if (!DomData.has(elem)) {\n return;\n }\n const data = DomData.get(elem);\n\n // Remove the events of a particular type if there are none left\n if (data.handlers[type].length === 0) {\n delete data.handlers[type];\n // data.handlers[type] = null;\n // Setting to null was causing an error with data.handlers\n\n // Remove the meta-handler from the element\n if (elem.removeEventListener) {\n elem.removeEventListener(type, data.dispatcher, false);\n } else if (elem.detachEvent) {\n elem.detachEvent('on' + type, data.dispatcher);\n }\n }\n\n // Remove the events object if there are no types left\n if (Object.getOwnPropertyNames(data.handlers).length <= 0) {\n delete data.handlers;\n delete data.dispatcher;\n delete data.disabled;\n }\n\n // Finally remove the element data if there is no data left\n if (Object.getOwnPropertyNames(data).length === 0) {\n DomData.delete(elem);\n }\n}\n\n/**\n * Loops through an array of event types and calls the requested method for each type.\n *\n * @param {Function} fn\n * The event method we want to use.\n *\n * @param {Element|Object} elem\n * Element or object to bind listeners to\n *\n * @param {string[]} types\n * Type of event to bind to.\n *\n * @param {Function} callback\n * Event listener.\n */\nfunction _handleMultipleEvents(fn, elem, types, callback) {\n types.forEach(function (type) {\n // Call the event method for each one of the types\n fn(elem, type, callback);\n });\n}\n\n/**\n * Fix a native event to have standard property values\n *\n * @param {Object} event\n * Event object to fix.\n *\n * @return {Object}\n * Fixed event object.\n */\nfunction fixEvent(event) {\n if (event.fixed_) {\n return event;\n }\n function returnTrue() {\n return true;\n }\n function returnFalse() {\n return false;\n }\n\n // Test if fixing up is needed\n // Used to check if !event.stopPropagation instead of isPropagationStopped\n // But native events return true for stopPropagation, but don't have\n // other expected methods like isPropagationStopped. Seems to be a problem\n // with the Javascript Ninja code. So we're just overriding all events now.\n if (!event || !event.isPropagationStopped || !event.isImmediatePropagationStopped) {\n const old = event || window$1.event;\n event = {};\n // Clone the old object so that we can modify the values event = {};\n // IE8 Doesn't like when you mess with native event properties\n // Firefox returns false for event.hasOwnProperty('type') and other props\n // which makes copying more difficult.\n // TODO: Probably best to create a whitelist of event props\n for (const key in old) {\n // Safari 6.0.3 warns you if you try to copy deprecated layerX/Y\n // Chrome warns you if you try to copy deprecated keyboardEvent.keyLocation\n // and webkitMovementX/Y\n // Lighthouse complains if Event.path is copied\n if (key !== 'layerX' && key !== 'layerY' && key !== 'keyLocation' && key !== 'webkitMovementX' && key !== 'webkitMovementY' && key !== 'path') {\n // Chrome 32+ warns if you try to copy deprecated returnValue, but\n // we still want to if preventDefault isn't supported (IE8).\n if (!(key === 'returnValue' && old.preventDefault)) {\n event[key] = old[key];\n }\n }\n }\n\n // The event occurred on this element\n if (!event.target) {\n event.target = event.srcElement || document;\n }\n\n // Handle which other element the event is related to\n if (!event.relatedTarget) {\n event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;\n }\n\n // Stop the default browser action\n event.preventDefault = function () {\n if (old.preventDefault) {\n old.preventDefault();\n }\n event.returnValue = false;\n old.returnValue = false;\n event.defaultPrevented = true;\n };\n event.defaultPrevented = false;\n\n // Stop the event from bubbling\n event.stopPropagation = function () {\n if (old.stopPropagation) {\n old.stopPropagation();\n }\n event.cancelBubble = true;\n old.cancelBubble = true;\n event.isPropagationStopped = returnTrue;\n };\n event.isPropagationStopped = returnFalse;\n\n // Stop the event from bubbling and executing other handlers\n event.stopImmediatePropagation = function () {\n if (old.stopImmediatePropagation) {\n old.stopImmediatePropagation();\n }\n event.isImmediatePropagationStopped = returnTrue;\n event.stopPropagation();\n };\n event.isImmediatePropagationStopped = returnFalse;\n\n // Handle mouse position\n if (event.clientX !== null && event.clientX !== undefined) {\n const doc = document.documentElement;\n const body = document.body;\n event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);\n event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);\n }\n\n // Handle key presses\n event.which = event.charCode || event.keyCode;\n\n // Fix button for mouse clicks:\n // 0 == left; 1 == middle; 2 == right\n if (event.button !== null && event.button !== undefined) {\n // The following is disabled because it does not pass videojs-standard\n // and... yikes.\n /* eslint-disable */\n event.button = event.button & 1 ? 0 : event.button & 4 ? 1 : event.button & 2 ? 2 : 0;\n /* eslint-enable */\n }\n }\n\n event.fixed_ = true;\n // Returns fixed-up instance\n return event;\n}\n\n/**\n * Whether passive event listeners are supported\n */\nlet _supportsPassive;\nconst supportsPassive = function () {\n if (typeof _supportsPassive !== 'boolean') {\n _supportsPassive = false;\n try {\n const opts = Object.defineProperty({}, 'passive', {\n get() {\n _supportsPassive = true;\n }\n });\n window$1.addEventListener('test', null, opts);\n window$1.removeEventListener('test', null, opts);\n } catch (e) {\n // disregard\n }\n }\n return _supportsPassive;\n};\n\n/**\n * Touch events Chrome expects to be passive\n */\nconst passiveEvents = ['touchstart', 'touchmove'];\n\n/**\n * Add an event listener to element\n * It stores the handler function in a separate cache object\n * and adds a generic handler to the element's event,\n * along with a unique id (guid) to the element.\n *\n * @param {Element|Object} elem\n * Element or object to bind listeners to\n *\n * @param {string|string[]} type\n * Type of event to bind to.\n *\n * @param {Function} fn\n * Event listener.\n */\nfunction on(elem, type, fn) {\n if (Array.isArray(type)) {\n return _handleMultipleEvents(on, elem, type, fn);\n }\n if (!DomData.has(elem)) {\n DomData.set(elem, {});\n }\n const data = DomData.get(elem);\n\n // We need a place to store all our handler data\n if (!data.handlers) {\n data.handlers = {};\n }\n if (!data.handlers[type]) {\n data.handlers[type] = [];\n }\n if (!fn.guid) {\n fn.guid = newGUID();\n }\n data.handlers[type].push(fn);\n if (!data.dispatcher) {\n data.disabled = false;\n data.dispatcher = function (event, hash) {\n if (data.disabled) {\n return;\n }\n event = fixEvent(event);\n const handlers = data.handlers[event.type];\n if (handlers) {\n // Copy handlers so if handlers are added/removed during the process it doesn't throw everything off.\n const handlersCopy = handlers.slice(0);\n for (let m = 0, n = handlersCopy.length; m < n; m++) {\n if (event.isImmediatePropagationStopped()) {\n break;\n } else {\n try {\n handlersCopy[m].call(elem, event, hash);\n } catch (e) {\n log$1.error(e);\n }\n }\n }\n }\n };\n }\n if (data.handlers[type].length === 1) {\n if (elem.addEventListener) {\n let options = false;\n if (supportsPassive() && passiveEvents.indexOf(type) > -1) {\n options = {\n passive: true\n };\n }\n elem.addEventListener(type, data.dispatcher, options);\n } else if (elem.attachEvent) {\n elem.attachEvent('on' + type, data.dispatcher);\n }\n }\n}\n\n/**\n * Removes event listeners from an element\n *\n * @param {Element|Object} elem\n * Object to remove listeners from.\n *\n * @param {string|string[]} [type]\n * Type of listener to remove. Don't include to remove all events from element.\n *\n * @param {Function} [fn]\n * Specific listener to remove. Don't include to remove listeners for an event\n * type.\n */\nfunction off(elem, type, fn) {\n // Don't want to add a cache object through getElData if not needed\n if (!DomData.has(elem)) {\n return;\n }\n const data = DomData.get(elem);\n\n // If no events exist, nothing to unbind\n if (!data.handlers) {\n return;\n }\n if (Array.isArray(type)) {\n return _handleMultipleEvents(off, elem, type, fn);\n }\n\n // Utility function\n const removeType = function (el, t) {\n data.handlers[t] = [];\n _cleanUpEvents(el, t);\n };\n\n // Are we removing all bound events?\n if (type === undefined) {\n for (const t in data.handlers) {\n if (Object.prototype.hasOwnProperty.call(data.handlers || {}, t)) {\n removeType(elem, t);\n }\n }\n return;\n }\n const handlers = data.handlers[type];\n\n // If no handlers exist, nothing to unbind\n if (!handlers) {\n return;\n }\n\n // If no listener was provided, remove all listeners for type\n if (!fn) {\n removeType(elem, type);\n return;\n }\n\n // We're only removing a single handler\n if (fn.guid) {\n for (let n = 0; n < handlers.length; n++) {\n if (handlers[n].guid === fn.guid) {\n handlers.splice(n--, 1);\n }\n }\n }\n _cleanUpEvents(elem, type);\n}\n\n/**\n * Trigger an event for an element\n *\n * @param {Element|Object} elem\n * Element to trigger an event on\n *\n * @param {EventTarget~Event|string} event\n * A string (the type) or an event object with a type attribute\n *\n * @param {Object} [hash]\n * data hash to pass along with the event\n *\n * @return {boolean|undefined}\n * Returns the opposite of `defaultPrevented` if default was\n * prevented. Otherwise, returns `undefined`\n */\nfunction trigger(elem, event, hash) {\n // Fetches element data and a reference to the parent (for bubbling).\n // Don't want to add a data object to cache for every parent,\n // so checking hasElData first.\n const elemData = DomData.has(elem) ? DomData.get(elem) : {};\n const parent = elem.parentNode || elem.ownerDocument;\n // type = event.type || event,\n // handler;\n\n // If an event name was passed as a string, creates an event out of it\n if (typeof event === 'string') {\n event = {\n type: event,\n target: elem\n };\n } else if (!event.target) {\n event.target = elem;\n }\n\n // Normalizes the event properties.\n event = fixEvent(event);\n\n // If the passed element has a dispatcher, executes the established handlers.\n if (elemData.dispatcher) {\n elemData.dispatcher.call(elem, event, hash);\n }\n\n // Unless explicitly stopped or the event does not bubble (e.g. media events)\n // recursively calls this function to bubble the event up the DOM.\n if (parent && !event.isPropagationStopped() && event.bubbles === true) {\n trigger.call(null, parent, event, hash);\n\n // If at the top of the DOM, triggers the default action unless disabled.\n } else if (!parent && !event.defaultPrevented && event.target && event.target[event.type]) {\n if (!DomData.has(event.target)) {\n DomData.set(event.target, {});\n }\n const targetData = DomData.get(event.target);\n\n // Checks if the target has a default action for this event.\n if (event.target[event.type]) {\n // Temporarily disables event dispatching on the target as we have already executed the handler.\n targetData.disabled = true;\n // Executes the default action.\n if (typeof event.target[event.type] === 'function') {\n event.target[event.type]();\n }\n // Re-enables event dispatching.\n targetData.disabled = false;\n }\n }\n\n // Inform the triggerer if the default was prevented by returning false\n return !event.defaultPrevented;\n}\n\n/**\n * Trigger a listener only once for an event.\n *\n * @param {Element|Object} elem\n * Element or object to bind to.\n *\n * @param {string|string[]} type\n * Name/type of event\n *\n * @param {Event~EventListener} fn\n * Event listener function\n */\nfunction one(elem, type, fn) {\n if (Array.isArray(type)) {\n return _handleMultipleEvents(one, elem, type, fn);\n }\n const func = function () {\n off(elem, type, func);\n fn.apply(this, arguments);\n };\n\n // copy the guid to the new function so it can removed using the original function's ID\n func.guid = fn.guid = fn.guid || newGUID();\n on(elem, type, func);\n}\n\n/**\n * Trigger a listener only once and then turn if off for all\n * configured events\n *\n * @param {Element|Object} elem\n * Element or object to bind to.\n *\n * @param {string|string[]} type\n * Name/type of event\n *\n * @param {Event~EventListener} fn\n * Event listener function\n */\nfunction any(elem, type, fn) {\n const func = function () {\n off(elem, type, func);\n fn.apply(this, arguments);\n };\n\n // copy the guid to the new function so it can removed using the original function's ID\n func.guid = fn.guid = fn.guid || newGUID();\n\n // multiple ons, but one off for everything\n on(elem, type, func);\n}\n\nvar Events = /*#__PURE__*/Object.freeze({\n __proto__: null,\n fixEvent: fixEvent,\n on: on,\n off: off,\n trigger: trigger,\n one: one,\n any: any\n});\n\n/**\n * @file fn.js\n * @module fn\n */\nconst UPDATE_REFRESH_INTERVAL = 30;\n\n/**\n * A private, internal-only function for changing the context of a function.\n *\n * It also stores a unique id on the function so it can be easily removed from\n * events.\n *\n * @private\n * @function\n * @param {*} context\n * The object to bind as scope.\n *\n * @param {Function} fn\n * The function to be bound to a scope.\n *\n * @param {number} [uid]\n * An optional unique ID for the function to be set\n *\n * @return {Function}\n * The new function that will be bound into the context given\n */\nconst bind_ = function (context, fn, uid) {\n // Make sure the function has a unique ID\n if (!fn.guid) {\n fn.guid = newGUID();\n }\n\n // Create the new function that changes the context\n const bound = fn.bind(context);\n\n // Allow for the ability to individualize this function\n // Needed in the case where multiple objects might share the same prototype\n // IF both items add an event listener with the same function, then you try to remove just one\n // it will remove both because they both have the same guid.\n // when using this, you need to use the bind method when you remove the listener as well.\n // currently used in text tracks\n bound.guid = uid ? uid + '_' + fn.guid : fn.guid;\n return bound;\n};\n\n/**\n * Wraps the given function, `fn`, with a new function that only invokes `fn`\n * at most once per every `wait` milliseconds.\n *\n * @function\n * @param {Function} fn\n * The function to be throttled.\n *\n * @param {number} wait\n * The number of milliseconds by which to throttle.\n *\n * @return {Function}\n */\nconst throttle = function (fn, wait) {\n let last = window$1.performance.now();\n const throttled = function (...args) {\n const now = window$1.performance.now();\n if (now - last >= wait) {\n fn(...args);\n last = now;\n }\n };\n return throttled;\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked.\n *\n * Inspired by lodash and underscore implementations.\n *\n * @function\n * @param {Function} func\n * The function to wrap with debounce behavior.\n *\n * @param {number} wait\n * The number of milliseconds to wait after the last invocation.\n *\n * @param {boolean} [immediate]\n * Whether or not to invoke the function immediately upon creation.\n *\n * @param {Object} [context=window]\n * The \"context\" in which the debounced function should debounce. For\n * example, if this function should be tied to a Video.js player,\n * the player can be passed here. Alternatively, defaults to the\n * global `window` object.\n *\n * @return {Function}\n * A debounced function.\n */\nconst debounce = function (func, wait, immediate, context = window$1) {\n let timeout;\n const cancel = () => {\n context.clearTimeout(timeout);\n timeout = null;\n };\n\n /* eslint-disable consistent-this */\n const debounced = function () {\n const self = this;\n const args = arguments;\n let later = function () {\n timeout = null;\n later = null;\n if (!immediate) {\n func.apply(self, args);\n }\n };\n if (!timeout && immediate) {\n func.apply(self, args);\n }\n context.clearTimeout(timeout);\n timeout = context.setTimeout(later, wait);\n };\n /* eslint-enable consistent-this */\n\n debounced.cancel = cancel;\n return debounced;\n};\n\nvar Fn = /*#__PURE__*/Object.freeze({\n __proto__: null,\n UPDATE_REFRESH_INTERVAL: UPDATE_REFRESH_INTERVAL,\n bind_: bind_,\n throttle: throttle,\n debounce: debounce\n});\n\n/**\n * @file src/js/event-target.js\n */\nlet EVENT_MAP;\n\n/**\n * `EventTarget` is a class that can have the same API as the DOM `EventTarget`. It\n * adds shorthand functions that wrap around lengthy functions. For example:\n * the `on` function is a wrapper around `addEventListener`.\n *\n * @see [EventTarget Spec]{@link https://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventTarget}\n * @class EventTarget\n */\nclass EventTarget$2 {\n /**\n * Adds an `event listener` to an instance of an `EventTarget`. An `event listener` is a\n * function that will get called when an event with a certain name gets triggered.\n *\n * @param {string|string[]} type\n * An event name or an array of event names.\n *\n * @param {Function} fn\n * The function to call with `EventTarget`s\n */\n on(type, fn) {\n // Remove the addEventListener alias before calling Events.on\n // so we don't get into an infinite type loop\n const ael = this.addEventListener;\n this.addEventListener = () => {};\n on(this, type, fn);\n this.addEventListener = ael;\n }\n /**\n * Removes an `event listener` for a specific event from an instance of `EventTarget`.\n * This makes it so that the `event listener` will no longer get called when the\n * named event happens.\n *\n * @param {string|string[]} type\n * An event name or an array of event names.\n *\n * @param {Function} fn\n * The function to remove.\n */\n off(type, fn) {\n off(this, type, fn);\n }\n /**\n * This function will add an `event listener` that gets triggered only once. After the\n * first trigger it will get removed. This is like adding an `event listener`\n * with {@link EventTarget#on} that calls {@link EventTarget#off} on itself.\n *\n * @param {string|string[]} type\n * An event name or an array of event names.\n *\n * @param {Function} fn\n * The function to be called once for each event name.\n */\n one(type, fn) {\n // Remove the addEventListener aliasing Events.on\n // so we don't get into an infinite type loop\n const ael = this.addEventListener;\n this.addEventListener = () => {};\n one(this, type, fn);\n this.addEventListener = ael;\n }\n /**\n * This function will add an `event listener` that gets triggered only once and is\n * removed from all events. This is like adding an array of `event listener`s\n * with {@link EventTarget#on} that calls {@link EventTarget#off} on all events the\n * first time it is triggered.\n *\n * @param {string|string[]} type\n * An event name or an array of event names.\n *\n * @param {Function} fn\n * The function to be called once for each event name.\n */\n any(type, fn) {\n // Remove the addEventListener aliasing Events.on\n // so we don't get into an infinite type loop\n const ael = this.addEventListener;\n this.addEventListener = () => {};\n any(this, type, fn);\n this.addEventListener = ael;\n }\n /**\n * This function causes an event to happen. This will then cause any `event listeners`\n * that are waiting for that event, to get called. If there are no `event listeners`\n * for an event then nothing will happen.\n *\n * If the name of the `Event` that is being triggered is in `EventTarget.allowedEvents_`.\n * Trigger will also call the `on` + `uppercaseEventName` function.\n *\n * Example:\n * 'click' is in `EventTarget.allowedEvents_`, so, trigger will attempt to call\n * `onClick` if it exists.\n *\n * @param {string|EventTarget~Event|Object} event\n * The name of the event, an `Event`, or an object with a key of type set to\n * an event name.\n */\n trigger(event) {\n const type = event.type || event;\n\n // deprecation\n // In a future version we should default target to `this`\n // similar to how we default the target to `elem` in\n // `Events.trigger`. Right now the default `target` will be\n // `document` due to the `Event.fixEvent` call.\n if (typeof event === 'string') {\n event = {\n type\n };\n }\n event = fixEvent(event);\n if (this.allowedEvents_[type] && this['on' + type]) {\n this['on' + type](event);\n }\n trigger(this, event);\n }\n queueTrigger(event) {\n // only set up EVENT_MAP if it'll be used\n if (!EVENT_MAP) {\n EVENT_MAP = new Map();\n }\n const type = event.type || event;\n let map = EVENT_MAP.get(this);\n if (!map) {\n map = new Map();\n EVENT_MAP.set(this, map);\n }\n const oldTimeout = map.get(type);\n map.delete(type);\n window$1.clearTimeout(oldTimeout);\n const timeout = window$1.setTimeout(() => {\n map.delete(type);\n // if we cleared out all timeouts for the current target, delete its map\n if (map.size === 0) {\n map = null;\n EVENT_MAP.delete(this);\n }\n this.trigger(event);\n }, 0);\n map.set(type, timeout);\n }\n}\n\n/**\n * A Custom DOM event.\n *\n * @typedef {CustomEvent} Event\n * @see [Properties]{@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent}\n */\n\n/**\n * All event listeners should follow the following format.\n *\n * @callback EventListener\n * @this {EventTarget}\n *\n * @param {Event} event\n * the event that triggered this function\n *\n * @param {Object} [hash]\n * hash of data sent during the event\n */\n\n/**\n * An object containing event names as keys and booleans as values.\n *\n * > NOTE: If an event name is set to a true value here {@link EventTarget#trigger}\n * will have extra functionality. See that function for more information.\n *\n * @property EventTarget.prototype.allowedEvents_\n * @protected\n */\nEventTarget$2.prototype.allowedEvents_ = {};\n\n/**\n * An alias of {@link EventTarget#on}. Allows `EventTarget` to mimic\n * the standard DOM API.\n *\n * @function\n * @see {@link EventTarget#on}\n */\nEventTarget$2.prototype.addEventListener = EventTarget$2.prototype.on;\n\n/**\n * An alias of {@link EventTarget#off}. Allows `EventTarget` to mimic\n * the standard DOM API.\n *\n * @function\n * @see {@link EventTarget#off}\n */\nEventTarget$2.prototype.removeEventListener = EventTarget$2.prototype.off;\n\n/**\n * An alias of {@link EventTarget#trigger}. Allows `EventTarget` to mimic\n * the standard DOM API.\n *\n * @function\n * @see {@link EventTarget#trigger}\n */\nEventTarget$2.prototype.dispatchEvent = EventTarget$2.prototype.trigger;\n\n/**\n * @file mixins/evented.js\n * @module evented\n */\nconst objName = obj => {\n if (typeof obj.name === 'function') {\n return obj.name();\n }\n if (typeof obj.name === 'string') {\n return obj.name;\n }\n if (obj.name_) {\n return obj.name_;\n }\n if (obj.constructor && obj.constructor.name) {\n return obj.constructor.name;\n }\n return typeof obj;\n};\n\n/**\n * Returns whether or not an object has had the evented mixin applied.\n *\n * @param {Object} object\n * An object to test.\n *\n * @return {boolean}\n * Whether or not the object appears to be evented.\n */\nconst isEvented = object => object instanceof EventTarget$2 || !!object.eventBusEl_ && ['on', 'one', 'off', 'trigger'].every(k => typeof object[k] === 'function');\n\n/**\n * Adds a callback to run after the evented mixin applied.\n *\n * @param {Object} target\n * An object to Add\n * @param {Function} callback\n * The callback to run.\n */\nconst addEventedCallback = (target, callback) => {\n if (isEvented(target)) {\n callback();\n } else {\n if (!target.eventedCallbacks) {\n target.eventedCallbacks = [];\n }\n target.eventedCallbacks.push(callback);\n }\n};\n\n/**\n * Whether a value is a valid event type - non-empty string or array.\n *\n * @private\n * @param {string|Array} type\n * The type value to test.\n *\n * @return {boolean}\n * Whether or not the type is a valid event type.\n */\nconst isValidEventType = type =>\n// The regex here verifies that the `type` contains at least one non-\n// whitespace character.\ntypeof type === 'string' && /\\S/.test(type) || Array.isArray(type) && !!type.length;\n\n/**\n * Validates a value to determine if it is a valid event target. Throws if not.\n *\n * @private\n * @throws {Error}\n * If the target does not appear to be a valid event target.\n *\n * @param {Object} target\n * The object to test.\n *\n * @param {Object} obj\n * The evented object we are validating for\n *\n * @param {string} fnName\n * The name of the evented mixin function that called this.\n */\nconst validateTarget = (target, obj, fnName) => {\n if (!target || !target.nodeName && !isEvented(target)) {\n throw new Error(`Invalid target for ${objName(obj)}#${fnName}; must be a DOM node or evented object.`);\n }\n};\n\n/**\n * Validates a value to determine if it is a valid event target. Throws if not.\n *\n * @private\n * @throws {Error}\n * If the type does not appear to be a valid event type.\n *\n * @param {string|Array} type\n * The type to test.\n *\n * @param {Object} obj\n* The evented object we are validating for\n *\n * @param {string} fnName\n * The name of the evented mixin function that called this.\n */\nconst validateEventType = (type, obj, fnName) => {\n if (!isValidEventType(type)) {\n throw new Error(`Invalid event type for ${objName(obj)}#${fnName}; must be a non-empty string or array.`);\n }\n};\n\n/**\n * Validates a value to determine if it is a valid listener. Throws if not.\n *\n * @private\n * @throws {Error}\n * If the listener is not a function.\n *\n * @param {Function} listener\n * The listener to test.\n *\n * @param {Object} obj\n * The evented object we are validating for\n *\n * @param {string} fnName\n * The name of the evented mixin function that called this.\n */\nconst validateListener = (listener, obj, fnName) => {\n if (typeof listener !== 'function') {\n throw new Error(`Invalid listener for ${objName(obj)}#${fnName}; must be a function.`);\n }\n};\n\n/**\n * Takes an array of arguments given to `on()` or `one()`, validates them, and\n * normalizes them into an object.\n *\n * @private\n * @param {Object} self\n * The evented object on which `on()` or `one()` was called. This\n * object will be bound as the `this` value for the listener.\n *\n * @param {Array} args\n * An array of arguments passed to `on()` or `one()`.\n *\n * @param {string} fnName\n * The name of the evented mixin function that called this.\n *\n * @return {Object}\n * An object containing useful values for `on()` or `one()` calls.\n */\nconst normalizeListenArgs = (self, args, fnName) => {\n // If the number of arguments is less than 3, the target is always the\n // evented object itself.\n const isTargetingSelf = args.length < 3 || args[0] === self || args[0] === self.eventBusEl_;\n let target;\n let type;\n let listener;\n if (isTargetingSelf) {\n target = self.eventBusEl_;\n\n // Deal with cases where we got 3 arguments, but we are still listening to\n // the evented object itself.\n if (args.length >= 3) {\n args.shift();\n }\n [type, listener] = args;\n } else {\n [target, type, listener] = args;\n }\n validateTarget(target, self, fnName);\n validateEventType(type, self, fnName);\n validateListener(listener, self, fnName);\n listener = bind_(self, listener);\n return {\n isTargetingSelf,\n target,\n type,\n listener\n };\n};\n\n/**\n * Adds the listener to the event type(s) on the target, normalizing for\n * the type of target.\n *\n * @private\n * @param {Element|Object} target\n * A DOM node or evented object.\n *\n * @param {string} method\n * The event binding method to use (\"on\" or \"one\").\n *\n * @param {string|Array} type\n * One or more event type(s).\n *\n * @param {Function} listener\n * A listener function.\n */\nconst listen = (target, method, type, listener) => {\n validateTarget(target, target, method);\n if (target.nodeName) {\n Events[method](target, type, listener);\n } else {\n target[method](type, listener);\n }\n};\n\n/**\n * Contains methods that provide event capabilities to an object which is passed\n * to {@link module:evented|evented}.\n *\n * @mixin EventedMixin\n */\nconst EventedMixin = {\n /**\n * Add a listener to an event (or events) on this object or another evented\n * object.\n *\n * @param {string|Array|Element|Object} targetOrType\n * If this is a string or array, it represents the event type(s)\n * that will trigger the listener.\n *\n * Another evented object can be passed here instead, which will\n * cause the listener to listen for events on _that_ object.\n *\n * In either case, the listener's `this` value will be bound to\n * this object.\n *\n * @param {string|Array|Function} typeOrListener\n * If the first argument was a string or array, this should be the\n * listener function. Otherwise, this is a string or array of event\n * type(s).\n *\n * @param {Function} [listener]\n * If the first argument was another evented object, this will be\n * the listener function.\n */\n on(...args) {\n const {\n isTargetingSelf,\n target,\n type,\n listener\n } = normalizeListenArgs(this, args, 'on');\n listen(target, 'on', type, listener);\n\n // If this object is listening to another evented object.\n if (!isTargetingSelf) {\n // If this object is disposed, remove the listener.\n const removeListenerOnDispose = () => this.off(target, type, listener);\n\n // Use the same function ID as the listener so we can remove it later it\n // using the ID of the original listener.\n removeListenerOnDispose.guid = listener.guid;\n\n // Add a listener to the target's dispose event as well. This ensures\n // that if the target is disposed BEFORE this object, we remove the\n // removal listener that was just added. Otherwise, we create a memory leak.\n const removeRemoverOnTargetDispose = () => this.off('dispose', removeListenerOnDispose);\n\n // Use the same function ID as the listener so we can remove it later\n // it using the ID of the original listener.\n removeRemoverOnTargetDispose.guid = listener.guid;\n listen(this, 'on', 'dispose', removeListenerOnDispose);\n listen(target, 'on', 'dispose', removeRemoverOnTargetDispose);\n }\n },\n /**\n * Add a listener to an event (or events) on this object or another evented\n * object. The listener will be called once per event and then removed.\n *\n * @param {string|Array|Element|Object} targetOrType\n * If this is a string or array, it represents the event type(s)\n * that will trigger the listener.\n *\n * Another evented object can be passed here instead, which will\n * cause the listener to listen for events on _that_ object.\n *\n * In either case, the listener's `this` value will be bound to\n * this object.\n *\n * @param {string|Array|Function} typeOrListener\n * If the first argument was a string or array, this should be the\n * listener function. Otherwise, this is a string or array of event\n * type(s).\n *\n * @param {Function} [listener]\n * If the first argument was another evented object, this will be\n * the listener function.\n */\n one(...args) {\n const {\n isTargetingSelf,\n target,\n type,\n listener\n } = normalizeListenArgs(this, args, 'one');\n\n // Targeting this evented object.\n if (isTargetingSelf) {\n listen(target, 'one', type, listener);\n\n // Targeting another evented object.\n } else {\n // TODO: This wrapper is incorrect! It should only\n // remove the wrapper for the event type that called it.\n // Instead all listeners are removed on the first trigger!\n // see https://github.com/videojs/video.js/issues/5962\n const wrapper = (...largs) => {\n this.off(target, type, wrapper);\n listener.apply(null, largs);\n };\n\n // Use the same function ID as the listener so we can remove it later\n // it using the ID of the original listener.\n wrapper.guid = listener.guid;\n listen(target, 'one', type, wrapper);\n }\n },\n /**\n * Add a listener to an event (or events) on this object or another evented\n * object. The listener will only be called once for the first event that is triggered\n * then removed.\n *\n * @param {string|Array|Element|Object} targetOrType\n * If this is a string or array, it represents the event type(s)\n * that will trigger the listener.\n *\n * Another evented object can be passed here instead, which will\n * cause the listener to listen for events on _that_ object.\n *\n * In either case, the listener's `this` value will be bound to\n * this object.\n *\n * @param {string|Array|Function} typeOrListener\n * If the first argument was a string or array, this should be the\n * listener function. Otherwise, this is a string or array of event\n * type(s).\n *\n * @param {Function} [listener]\n * If the first argument was another evented object, this will be\n * the listener function.\n */\n any(...args) {\n const {\n isTargetingSelf,\n target,\n type,\n listener\n } = normalizeListenArgs(this, args, 'any');\n\n // Targeting this evented object.\n if (isTargetingSelf) {\n listen(target, 'any', type, listener);\n\n // Targeting another evented object.\n } else {\n const wrapper = (...largs) => {\n this.off(target, type, wrapper);\n listener.apply(null, largs);\n };\n\n // Use the same function ID as the listener so we can remove it later\n // it using the ID of the original listener.\n wrapper.guid = listener.guid;\n listen(target, 'any', type, wrapper);\n }\n },\n /**\n * Removes listener(s) from event(s) on an evented object.\n *\n * @param {string|Array|Element|Object} [targetOrType]\n * If this is a string or array, it represents the event type(s).\n *\n * Another evented object can be passed here instead, in which case\n * ALL 3 arguments are _required_.\n *\n * @param {string|Array|Function} [typeOrListener]\n * If the first argument was a string or array, this may be the\n * listener function. Otherwise, this is a string or array of event\n * type(s).\n *\n * @param {Function} [listener]\n * If the first argument was another evented object, this will be\n * the listener function; otherwise, _all_ listeners bound to the\n * event type(s) will be removed.\n */\n off(targetOrType, typeOrListener, listener) {\n // Targeting this evented object.\n if (!targetOrType || isValidEventType(targetOrType)) {\n off(this.eventBusEl_, targetOrType, typeOrListener);\n\n // Targeting another evented object.\n } else {\n const target = targetOrType;\n const type = typeOrListener;\n\n // Fail fast and in a meaningful way!\n validateTarget(target, this, 'off');\n validateEventType(type, this, 'off');\n validateListener(listener, this, 'off');\n\n // Ensure there's at least a guid, even if the function hasn't been used\n listener = bind_(this, listener);\n\n // Remove the dispose listener on this evented object, which was given\n // the same guid as the event listener in on().\n this.off('dispose', listener);\n if (target.nodeName) {\n off(target, type, listener);\n off(target, 'dispose', listener);\n } else if (isEvented(target)) {\n target.off(type, listener);\n target.off('dispose', listener);\n }\n }\n },\n /**\n * Fire an event on this evented object, causing its listeners to be called.\n *\n * @param {string|Object} event\n * An event type or an object with a type property.\n *\n * @param {Object} [hash]\n * An additional object to pass along to listeners.\n *\n * @return {boolean}\n * Whether or not the default behavior was prevented.\n */\n trigger(event, hash) {\n validateTarget(this.eventBusEl_, this, 'trigger');\n const type = event && typeof event !== 'string' ? event.type : event;\n if (!isValidEventType(type)) {\n throw new Error(`Invalid event type for ${objName(this)}#trigger; ` + 'must be a non-empty string or object with a type key that has a non-empty value.');\n }\n return trigger(this.eventBusEl_, event, hash);\n }\n};\n\n/**\n * Applies {@link module:evented~EventedMixin|EventedMixin} to a target object.\n *\n * @param {Object} target\n * The object to which to add event methods.\n *\n * @param {Object} [options={}]\n * Options for customizing the mixin behavior.\n *\n * @param {string} [options.eventBusKey]\n * By default, adds a `eventBusEl_` DOM element to the target object,\n * which is used as an event bus. If the target object already has a\n * DOM element that should be used, pass its key here.\n *\n * @return {Object}\n * The target object.\n */\nfunction evented(target, options = {}) {\n const {\n eventBusKey\n } = options;\n\n // Set or create the eventBusEl_.\n if (eventBusKey) {\n if (!target[eventBusKey].nodeName) {\n throw new Error(`The eventBusKey \"${eventBusKey}\" does not refer to an element.`);\n }\n target.eventBusEl_ = target[eventBusKey];\n } else {\n target.eventBusEl_ = createEl('span', {\n className: 'vjs-event-bus'\n });\n }\n Object.assign(target, EventedMixin);\n if (target.eventedCallbacks) {\n target.eventedCallbacks.forEach(callback => {\n callback();\n });\n }\n\n // When any evented object is disposed, it removes all its listeners.\n target.on('dispose', () => {\n target.off();\n [target, target.el_, target.eventBusEl_].forEach(function (val) {\n if (val && DomData.has(val)) {\n DomData.delete(val);\n }\n });\n window$1.setTimeout(() => {\n target.eventBusEl_ = null;\n }, 0);\n });\n return target;\n}\n\n/**\n * @file mixins/stateful.js\n * @module stateful\n */\n\n/**\n * Contains methods that provide statefulness to an object which is passed\n * to {@link module:stateful}.\n *\n * @mixin StatefulMixin\n */\nconst StatefulMixin = {\n /**\n * A hash containing arbitrary keys and values representing the state of\n * the object.\n *\n * @type {Object}\n */\n state: {},\n /**\n * Set the state of an object by mutating its\n * {@link module:stateful~StatefulMixin.state|state} object in place.\n *\n * @fires module:stateful~StatefulMixin#statechanged\n * @param {Object|Function} stateUpdates\n * A new set of properties to shallow-merge into the plugin state.\n * Can be a plain object or a function returning a plain object.\n *\n * @return {Object|undefined}\n * An object containing changes that occurred. If no changes\n * occurred, returns `undefined`.\n */\n setState(stateUpdates) {\n // Support providing the `stateUpdates` state as a function.\n if (typeof stateUpdates === 'function') {\n stateUpdates = stateUpdates();\n }\n let changes;\n each(stateUpdates, (value, key) => {\n // Record the change if the value is different from what's in the\n // current state.\n if (this.state[key] !== value) {\n changes = changes || {};\n changes[key] = {\n from: this.state[key],\n to: value\n };\n }\n this.state[key] = value;\n });\n\n // Only trigger \"statechange\" if there were changes AND we have a trigger\n // function. This allows us to not require that the target object be an\n // evented object.\n if (changes && isEvented(this)) {\n /**\n * An event triggered on an object that is both\n * {@link module:stateful|stateful} and {@link module:evented|evented}\n * indicating that its state has changed.\n *\n * @event module:stateful~StatefulMixin#statechanged\n * @type {Object}\n * @property {Object} changes\n * A hash containing the properties that were changed and\n * the values they were changed `from` and `to`.\n */\n this.trigger({\n changes,\n type: 'statechanged'\n });\n }\n return changes;\n }\n};\n\n/**\n * Applies {@link module:stateful~StatefulMixin|StatefulMixin} to a target\n * object.\n *\n * If the target object is {@link module:evented|evented} and has a\n * `handleStateChanged` method, that method will be automatically bound to the\n * `statechanged` event on itself.\n *\n * @param {Object} target\n * The object to be made stateful.\n *\n * @param {Object} [defaultState]\n * A default set of properties to populate the newly-stateful object's\n * `state` property.\n *\n * @return {Object}\n * Returns the `target`.\n */\nfunction stateful(target, defaultState) {\n Object.assign(target, StatefulMixin);\n\n // This happens after the mixing-in because we need to replace the `state`\n // added in that step.\n target.state = Object.assign({}, target.state, defaultState);\n\n // Auto-bind the `handleStateChanged` method of the target object if it exists.\n if (typeof target.handleStateChanged === 'function' && isEvented(target)) {\n target.on('statechanged', target.handleStateChanged);\n }\n return target;\n}\n\n/**\n * @file str.js\n * @module to-lower-case\n */\n\n/**\n * Lowercase the first letter of a string.\n *\n * @param {string} string\n * String to be lowercased\n *\n * @return {string}\n * The string with a lowercased first letter\n */\nconst toLowerCase = function (string) {\n if (typeof string !== 'string') {\n return string;\n }\n return string.replace(/./, w => w.toLowerCase());\n};\n\n/**\n * Uppercase the first letter of a string.\n *\n * @param {string} string\n * String to be uppercased\n *\n * @return {string}\n * The string with an uppercased first letter\n */\nconst toTitleCase$1 = function (string) {\n if (typeof string !== 'string') {\n return string;\n }\n return string.replace(/./, w => w.toUpperCase());\n};\n\n/**\n * Compares the TitleCase versions of the two strings for equality.\n *\n * @param {string} str1\n * The first string to compare\n *\n * @param {string} str2\n * The second string to compare\n *\n * @return {boolean}\n * Whether the TitleCase versions of the strings are equal\n */\nconst titleCaseEquals = function (str1, str2) {\n return toTitleCase$1(str1) === toTitleCase$1(str2);\n};\n\nvar Str = /*#__PURE__*/Object.freeze({\n __proto__: null,\n toLowerCase: toLowerCase,\n toTitleCase: toTitleCase$1,\n titleCaseEquals: titleCaseEquals\n});\n\n/**\n * Player Component - Base class for all UI objects\n *\n * @file component.js\n */\n\n/**\n * Base class for all UI Components.\n * Components are UI objects which represent both a javascript object and an element\n * in the DOM. They can be children of other components, and can have\n * children themselves.\n *\n * Components can also use methods from {@link EventTarget}\n */\nclass Component$1 {\n /**\n * A callback that is called when a component is ready. Does not have any\n * parameters and any callback value will be ignored.\n *\n * @callback ReadyCallback\n * @this Component\n */\n\n /**\n * Creates an instance of this class.\n *\n * @param { import('./player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of component options.\n *\n * @param {Object[]} [options.children]\n * An array of children objects to initialize this component with. Children objects have\n * a name property that will be used if more than one component of the same type needs to be\n * added.\n *\n * @param {string} [options.className]\n * A class or space separated list of classes to add the component\n *\n * @param {ReadyCallback} [ready]\n * Function that gets called when the `Component` is ready.\n */\n constructor(player, options, ready) {\n // The component might be the player itself and we can't pass `this` to super\n if (!player && this.play) {\n this.player_ = player = this; // eslint-disable-line\n } else {\n this.player_ = player;\n }\n this.isDisposed_ = false;\n\n // Hold the reference to the parent component via `addChild` method\n this.parentComponent_ = null;\n\n // Make a copy of prototype.options_ to protect against overriding defaults\n this.options_ = merge$1({}, this.options_);\n\n // Updated options with supplied options\n options = this.options_ = merge$1(this.options_, options);\n\n // Get ID from options or options element if one is supplied\n this.id_ = options.id || options.el && options.el.id;\n\n // If there was no ID from the options, generate one\n if (!this.id_) {\n // Don't require the player ID function in the case of mock players\n const id = player && player.id && player.id() || 'no_player';\n this.id_ = `${id}_component_${newGUID()}`;\n }\n this.name_ = options.name || null;\n\n // Create element if one wasn't provided in options\n if (options.el) {\n this.el_ = options.el;\n } else if (options.createEl !== false) {\n this.el_ = this.createEl();\n }\n if (options.className && this.el_) {\n options.className.split(' ').forEach(c => this.addClass(c));\n }\n\n // Remove the placeholder event methods. If the component is evented, the\n // real methods are added next\n ['on', 'off', 'one', 'any', 'trigger'].forEach(fn => {\n this[fn] = undefined;\n });\n\n // if evented is anything except false, we want to mixin in evented\n if (options.evented !== false) {\n // Make this an evented object and use `el_`, if available, as its event bus\n evented(this, {\n eventBusKey: this.el_ ? 'el_' : null\n });\n this.handleLanguagechange = this.handleLanguagechange.bind(this);\n this.on(this.player_, 'languagechange', this.handleLanguagechange);\n }\n stateful(this, this.constructor.defaultState);\n this.children_ = [];\n this.childIndex_ = {};\n this.childNameIndex_ = {};\n this.setTimeoutIds_ = new Set();\n this.setIntervalIds_ = new Set();\n this.rafIds_ = new Set();\n this.namedRafs_ = new Map();\n this.clearingTimersOnDispose_ = false;\n\n // Add any child components in options\n if (options.initChildren !== false) {\n this.initChildren();\n }\n\n // Don't want to trigger ready here or it will go before init is actually\n // finished for all children that run this constructor\n this.ready(ready);\n if (options.reportTouchActivity !== false) {\n this.enableTouchActivity();\n }\n }\n\n // `on`, `off`, `one`, `any` and `trigger` are here so tsc includes them in definitions.\n // They are replaced or removed in the constructor\n\n /**\n * Adds an `event listener` to an instance of an `EventTarget`. An `event listener` is a\n * function that will get called when an event with a certain name gets triggered.\n *\n * @param {string|string[]} type\n * An event name or an array of event names.\n *\n * @param {Function} fn\n * The function to call with `EventTarget`s\n */\n on(type, fn) {}\n\n /**\n * Removes an `event listener` for a specific event from an instance of `EventTarget`.\n * This makes it so that the `event listener` will no longer get called when the\n * named event happens.\n *\n * @param {string|string[]} type\n * An event name or an array of event names.\n *\n * @param {Function} fn\n * The function to remove.\n */\n off(type, fn) {}\n\n /**\n * This function will add an `event listener` that gets triggered only once. After the\n * first trigger it will get removed. This is like adding an `event listener`\n * with {@link EventTarget#on} that calls {@link EventTarget#off} on itself.\n *\n * @param {string|string[]} type\n * An event name or an array of event names.\n *\n * @param {Function} fn\n * The function to be called once for each event name.\n */\n one(type, fn) {}\n\n /**\n * This function will add an `event listener` that gets triggered only once and is\n * removed from all events. This is like adding an array of `event listener`s\n * with {@link EventTarget#on} that calls {@link EventTarget#off} on all events the\n * first time it is triggered.\n *\n * @param {string|string[]} type\n * An event name or an array of event names.\n *\n * @param {Function} fn\n * The function to be called once for each event name.\n */\n any(type, fn) {}\n\n /**\n * This function causes an event to happen. This will then cause any `event listeners`\n * that are waiting for that event, to get called. If there are no `event listeners`\n * for an event then nothing will happen.\n *\n * If the name of the `Event` that is being triggered is in `EventTarget.allowedEvents_`.\n * Trigger will also call the `on` + `uppercaseEventName` function.\n *\n * Example:\n * 'click' is in `EventTarget.allowedEvents_`, so, trigger will attempt to call\n * `onClick` if it exists.\n *\n * @param {string|Event|Object} event\n * The name of the event, an `Event`, or an object with a key of type set to\n * an event name.\n *\n * @param {Object} [hash]\n * Optionally extra argument to pass through to an event listener\n */\n trigger(event, hash) {}\n\n /**\n * Dispose of the `Component` and all child components.\n *\n * @fires Component#dispose\n *\n * @param {Object} options\n * @param {Element} options.originalEl element with which to replace player element\n */\n dispose(options = {}) {\n // Bail out if the component has already been disposed.\n if (this.isDisposed_) {\n return;\n }\n if (this.readyQueue_) {\n this.readyQueue_.length = 0;\n }\n\n /**\n * Triggered when a `Component` is disposed.\n *\n * @event Component#dispose\n * @type {Event}\n *\n * @property {boolean} [bubbles=false]\n * set to false so that the dispose event does not\n * bubble up\n */\n this.trigger({\n type: 'dispose',\n bubbles: false\n });\n this.isDisposed_ = true;\n\n // Dispose all children.\n if (this.children_) {\n for (let i = this.children_.length - 1; i >= 0; i--) {\n if (this.children_[i].dispose) {\n this.children_[i].dispose();\n }\n }\n }\n\n // Delete child references\n this.children_ = null;\n this.childIndex_ = null;\n this.childNameIndex_ = null;\n this.parentComponent_ = null;\n if (this.el_) {\n // Remove element from DOM\n if (this.el_.parentNode) {\n if (options.restoreEl) {\n this.el_.parentNode.replaceChild(options.restoreEl, this.el_);\n } else {\n this.el_.parentNode.removeChild(this.el_);\n }\n }\n this.el_ = null;\n }\n\n // remove reference to the player after disposing of the element\n this.player_ = null;\n }\n\n /**\n * Determine whether or not this component has been disposed.\n *\n * @return {boolean}\n * If the component has been disposed, will be `true`. Otherwise, `false`.\n */\n isDisposed() {\n return Boolean(this.isDisposed_);\n }\n\n /**\n * Return the {@link Player} that the `Component` has attached to.\n *\n * @return { import('./player').default }\n * The player that this `Component` has attached to.\n */\n player() {\n return this.player_;\n }\n\n /**\n * Deep merge of options objects with new options.\n * > Note: When both `obj` and `options` contain properties whose values are objects.\n * The two properties get merged using {@link module:obj.merge}\n *\n * @param {Object} obj\n * The object that contains new options.\n *\n * @return {Object}\n * A new object of `this.options_` and `obj` merged together.\n */\n options(obj) {\n if (!obj) {\n return this.options_;\n }\n this.options_ = merge$1(this.options_, obj);\n return this.options_;\n }\n\n /**\n * Get the `Component`s DOM element\n *\n * @return {Element}\n * The DOM element for this `Component`.\n */\n el() {\n return this.el_;\n }\n\n /**\n * Create the `Component`s DOM element.\n *\n * @param {string} [tagName]\n * Element's DOM node type. e.g. 'div'\n *\n * @param {Object} [properties]\n * An object of properties that should be set.\n *\n * @param {Object} [attributes]\n * An object of attributes that should be set.\n *\n * @return {Element}\n * The element that gets created.\n */\n createEl(tagName, properties, attributes) {\n return createEl(tagName, properties, attributes);\n }\n\n /**\n * Localize a string given the string in english.\n *\n * If tokens are provided, it'll try and run a simple token replacement on the provided string.\n * The tokens it looks for look like `{1}` with the index being 1-indexed into the tokens array.\n *\n * If a `defaultValue` is provided, it'll use that over `string`,\n * if a value isn't found in provided language files.\n * This is useful if you want to have a descriptive key for token replacement\n * but have a succinct localized string and not require `en.json` to be included.\n *\n * Currently, it is used for the progress bar timing.\n * ```js\n * {\n * \"progress bar timing: currentTime={1} duration={2}\": \"{1} of {2}\"\n * }\n * ```\n * It is then used like so:\n * ```js\n * this.localize('progress bar timing: currentTime={1} duration{2}',\n * [this.player_.currentTime(), this.player_.duration()],\n * '{1} of {2}');\n * ```\n *\n * Which outputs something like: `01:23 of 24:56`.\n *\n *\n * @param {string} string\n * The string to localize and the key to lookup in the language files.\n * @param {string[]} [tokens]\n * If the current item has token replacements, provide the tokens here.\n * @param {string} [defaultValue]\n * Defaults to `string`. Can be a default value to use for token replacement\n * if the lookup key is needed to be separate.\n *\n * @return {string}\n * The localized string or if no localization exists the english string.\n */\n localize(string, tokens, defaultValue = string) {\n const code = this.player_.language && this.player_.language();\n const languages = this.player_.languages && this.player_.languages();\n const language = languages && languages[code];\n const primaryCode = code && code.split('-')[0];\n const primaryLang = languages && languages[primaryCode];\n let localizedString = defaultValue;\n if (language && language[string]) {\n localizedString = language[string];\n } else if (primaryLang && primaryLang[string]) {\n localizedString = primaryLang[string];\n }\n if (tokens) {\n localizedString = localizedString.replace(/\\{(\\d+)\\}/g, function (match, index) {\n const value = tokens[index - 1];\n let ret = value;\n if (typeof value === 'undefined') {\n ret = match;\n }\n return ret;\n });\n }\n return localizedString;\n }\n\n /**\n * Handles language change for the player in components. Should be overridden by sub-components.\n *\n * @abstract\n */\n handleLanguagechange() {}\n\n /**\n * Return the `Component`s DOM element. This is where children get inserted.\n * This will usually be the the same as the element returned in {@link Component#el}.\n *\n * @return {Element}\n * The content element for this `Component`.\n */\n contentEl() {\n return this.contentEl_ || this.el_;\n }\n\n /**\n * Get this `Component`s ID\n *\n * @return {string}\n * The id of this `Component`\n */\n id() {\n return this.id_;\n }\n\n /**\n * Get the `Component`s name. The name gets used to reference the `Component`\n * and is set during registration.\n *\n * @return {string}\n * The name of this `Component`.\n */\n name() {\n return this.name_;\n }\n\n /**\n * Get an array of all child components\n *\n * @return {Array}\n * The children\n */\n children() {\n return this.children_;\n }\n\n /**\n * Returns the child `Component` with the given `id`.\n *\n * @param {string} id\n * The id of the child `Component` to get.\n *\n * @return {Component|undefined}\n * The child `Component` with the given `id` or undefined.\n */\n getChildById(id) {\n return this.childIndex_[id];\n }\n\n /**\n * Returns the child `Component` with the given `name`.\n *\n * @param {string} name\n * The name of the child `Component` to get.\n *\n * @return {Component|undefined}\n * The child `Component` with the given `name` or undefined.\n */\n getChild(name) {\n if (!name) {\n return;\n }\n return this.childNameIndex_[name];\n }\n\n /**\n * Returns the descendant `Component` following the givent\n * descendant `names`. For instance ['foo', 'bar', 'baz'] would\n * try to get 'foo' on the current component, 'bar' on the 'foo'\n * component and 'baz' on the 'bar' component and return undefined\n * if any of those don't exist.\n *\n * @param {...string[]|...string} names\n * The name of the child `Component` to get.\n *\n * @return {Component|undefined}\n * The descendant `Component` following the given descendant\n * `names` or undefined.\n */\n getDescendant(...names) {\n // flatten array argument into the main array\n names = names.reduce((acc, n) => acc.concat(n), []);\n let currentChild = this;\n for (let i = 0; i < names.length; i++) {\n currentChild = currentChild.getChild(names[i]);\n if (!currentChild || !currentChild.getChild) {\n return;\n }\n }\n return currentChild;\n }\n\n /**\n * Adds an SVG icon element to another element or component.\n *\n * @param {string} iconName\n * The name of icon. A list of all the icon names can be found at 'sandbox/svg-icons.html'\n *\n * @param {Element} [el=this.el()]\n * Element to set the title on. Defaults to the current Component's element.\n *\n * @return {Element}\n * The newly created icon element.\n */\n setIcon(iconName, el = this.el()) {\n // TODO: In v9 of video.js, we will want to remove font icons entirely.\n // This means this check, as well as the others throughout the code, and\n // the unecessary CSS for font icons, will need to be removed.\n // See https://github.com/videojs/video.js/pull/8260 as to which components\n // need updating.\n if (!this.player_.options_.experimentalSvgIcons) {\n return;\n }\n const xmlnsURL = 'http://www.w3.org/2000/svg';\n\n // The below creates an element in the format of:\n // <span><svg><use>....</use></svg></span>\n const iconContainer = createEl('span', {\n className: 'vjs-icon-placeholder vjs-svg-icon'\n }, {\n 'aria-hidden': 'true'\n });\n const svgEl = document.createElementNS(xmlnsURL, 'svg');\n svgEl.setAttributeNS(null, 'viewBox', '0 0 512 512');\n const useEl = document.createElementNS(xmlnsURL, 'use');\n svgEl.appendChild(useEl);\n useEl.setAttributeNS(null, 'href', `#vjs-icon-${iconName}`);\n iconContainer.appendChild(svgEl);\n\n // Replace a pre-existing icon if one exists.\n if (this.iconIsSet_) {\n el.replaceChild(iconContainer, el.querySelector('.vjs-icon-placeholder'));\n } else {\n el.appendChild(iconContainer);\n }\n this.iconIsSet_ = true;\n return iconContainer;\n }\n\n /**\n * Add a child `Component` inside the current `Component`.\n *\n * @param {string|Component} child\n * The name or instance of a child to add.\n *\n * @param {Object} [options={}]\n * The key/value store of options that will get passed to children of\n * the child.\n *\n * @param {number} [index=this.children_.length]\n * The index to attempt to add a child into.\n *\n *\n * @return {Component}\n * The `Component` that gets added as a child. When using a string the\n * `Component` will get created by this process.\n */\n addChild(child, options = {}, index = this.children_.length) {\n let component;\n let componentName;\n\n // If child is a string, create component with options\n if (typeof child === 'string') {\n componentName = toTitleCase$1(child);\n const componentClassName = options.componentClass || componentName;\n\n // Set name through options\n options.name = componentName;\n\n // Create a new object & element for this controls set\n // If there's no .player_, this is a player\n const ComponentClass = Component$1.getComponent(componentClassName);\n if (!ComponentClass) {\n throw new Error(`Component ${componentClassName} does not exist`);\n }\n\n // data stored directly on the videojs object may be\n // misidentified as a component to retain\n // backwards-compatibility with 4.x. check to make sure the\n // component class can be instantiated.\n if (typeof ComponentClass !== 'function') {\n return null;\n }\n component = new ComponentClass(this.player_ || this, options);\n\n // child is a component instance\n } else {\n component = child;\n }\n if (component.parentComponent_) {\n component.parentComponent_.removeChild(component);\n }\n this.children_.splice(index, 0, component);\n component.parentComponent_ = this;\n if (typeof component.id === 'function') {\n this.childIndex_[component.id()] = component;\n }\n\n // If a name wasn't used to create the component, check if we can use the\n // name function of the component\n componentName = componentName || component.name && toTitleCase$1(component.name());\n if (componentName) {\n this.childNameIndex_[componentName] = component;\n this.childNameIndex_[toLowerCase(componentName)] = component;\n }\n\n // Add the UI object's element to the container div (box)\n // Having an element is not required\n if (typeof component.el === 'function' && component.el()) {\n // If inserting before a component, insert before that component's element\n let refNode = null;\n if (this.children_[index + 1]) {\n // Most children are components, but the video tech is an HTML element\n if (this.children_[index + 1].el_) {\n refNode = this.children_[index + 1].el_;\n } else if (isEl(this.children_[index + 1])) {\n refNode = this.children_[index + 1];\n }\n }\n this.contentEl().insertBefore(component.el(), refNode);\n }\n\n // Return so it can stored on parent object if desired.\n return component;\n }\n\n /**\n * Remove a child `Component` from this `Component`s list of children. Also removes\n * the child `Component`s element from this `Component`s element.\n *\n * @param {Component} component\n * The child `Component` to remove.\n */\n removeChild(component) {\n if (typeof component === 'string') {\n component = this.getChild(component);\n }\n if (!component || !this.children_) {\n return;\n }\n let childFound = false;\n for (let i = this.children_.length - 1; i >= 0; i--) {\n if (this.children_[i] === component) {\n childFound = true;\n this.children_.splice(i, 1);\n break;\n }\n }\n if (!childFound) {\n return;\n }\n component.parentComponent_ = null;\n this.childIndex_[component.id()] = null;\n this.childNameIndex_[toTitleCase$1(component.name())] = null;\n this.childNameIndex_[toLowerCase(component.name())] = null;\n const compEl = component.el();\n if (compEl && compEl.parentNode === this.contentEl()) {\n this.contentEl().removeChild(component.el());\n }\n }\n\n /**\n * Add and initialize default child `Component`s based upon options.\n */\n initChildren() {\n const children = this.options_.children;\n if (children) {\n // `this` is `parent`\n const parentOptions = this.options_;\n const handleAdd = child => {\n const name = child.name;\n let opts = child.opts;\n\n // Allow options for children to be set at the parent options\n // e.g. videojs(id, { controlBar: false });\n // instead of videojs(id, { children: { controlBar: false });\n if (parentOptions[name] !== undefined) {\n opts = parentOptions[name];\n }\n\n // Allow for disabling default components\n // e.g. options['children']['posterImage'] = false\n if (opts === false) {\n return;\n }\n\n // Allow options to be passed as a simple boolean if no configuration\n // is necessary.\n if (opts === true) {\n opts = {};\n }\n\n // We also want to pass the original player options\n // to each component as well so they don't need to\n // reach back into the player for options later.\n opts.playerOptions = this.options_.playerOptions;\n\n // Create and add the child component.\n // Add a direct reference to the child by name on the parent instance.\n // If two of the same component are used, different names should be supplied\n // for each\n const newChild = this.addChild(name, opts);\n if (newChild) {\n this[name] = newChild;\n }\n };\n\n // Allow for an array of children details to passed in the options\n let workingChildren;\n const Tech = Component$1.getComponent('Tech');\n if (Array.isArray(children)) {\n workingChildren = children;\n } else {\n workingChildren = Object.keys(children);\n }\n workingChildren\n // children that are in this.options_ but also in workingChildren would\n // give us extra children we do not want. So, we want to filter them out.\n .concat(Object.keys(this.options_).filter(function (child) {\n return !workingChildren.some(function (wchild) {\n if (typeof wchild === 'string') {\n return child === wchild;\n }\n return child === wchild.name;\n });\n })).map(child => {\n let name;\n let opts;\n if (typeof child === 'string') {\n name = child;\n opts = children[name] || this.options_[name] || {};\n } else {\n name = child.name;\n opts = child;\n }\n return {\n name,\n opts\n };\n }).filter(child => {\n // we have to make sure that child.name isn't in the techOrder since\n // techs are registered as Components but can't aren't compatible\n // See https://github.com/videojs/video.js/issues/2772\n const c = Component$1.getComponent(child.opts.componentClass || toTitleCase$1(child.name));\n return c && !Tech.isTech(c);\n }).forEach(handleAdd);\n }\n }\n\n /**\n * Builds the default DOM class name. Should be overridden by sub-components.\n *\n * @return {string}\n * The DOM class name for this object.\n *\n * @abstract\n */\n buildCSSClass() {\n // Child classes can include a function that does:\n // return 'CLASS NAME' + this._super();\n return '';\n }\n\n /**\n * Bind a listener to the component's ready state.\n * Different from event listeners in that if the ready event has already happened\n * it will trigger the function immediately.\n *\n * @param {ReadyCallback} fn\n * Function that gets called when the `Component` is ready.\n *\n * @return {Component}\n * Returns itself; method can be chained.\n */\n ready(fn, sync = false) {\n if (!fn) {\n return;\n }\n if (!this.isReady_) {\n this.readyQueue_ = this.readyQueue_ || [];\n this.readyQueue_.push(fn);\n return;\n }\n if (sync) {\n fn.call(this);\n } else {\n // Call the function asynchronously by default for consistency\n this.setTimeout(fn, 1);\n }\n }\n\n /**\n * Trigger all the ready listeners for this `Component`.\n *\n * @fires Component#ready\n */\n triggerReady() {\n this.isReady_ = true;\n\n // Ensure ready is triggered asynchronously\n this.setTimeout(function () {\n const readyQueue = this.readyQueue_;\n\n // Reset Ready Queue\n this.readyQueue_ = [];\n if (readyQueue && readyQueue.length > 0) {\n readyQueue.forEach(function (fn) {\n fn.call(this);\n }, this);\n }\n\n // Allow for using event listeners also\n /**\n * Triggered when a `Component` is ready.\n *\n * @event Component#ready\n * @type {Event}\n */\n this.trigger('ready');\n }, 1);\n }\n\n /**\n * Find a single DOM element matching a `selector`. This can be within the `Component`s\n * `contentEl()` or another custom context.\n *\n * @param {string} selector\n * A valid CSS selector, which will be passed to `querySelector`.\n *\n * @param {Element|string} [context=this.contentEl()]\n * A DOM element within which to query. Can also be a selector string in\n * which case the first matching element will get used as context. If\n * missing `this.contentEl()` gets used. If `this.contentEl()` returns\n * nothing it falls back to `document`.\n *\n * @return {Element|null}\n * the dom element that was found, or null\n *\n * @see [Information on CSS Selectors](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_Started/Selectors)\n */\n $(selector, context) {\n return $(selector, context || this.contentEl());\n }\n\n /**\n * Finds all DOM element matching a `selector`. This can be within the `Component`s\n * `contentEl()` or another custom context.\n *\n * @param {string} selector\n * A valid CSS selector, which will be passed to `querySelectorAll`.\n *\n * @param {Element|string} [context=this.contentEl()]\n * A DOM element within which to query. Can also be a selector string in\n * which case the first matching element will get used as context. If\n * missing `this.contentEl()` gets used. If `this.contentEl()` returns\n * nothing it falls back to `document`.\n *\n * @return {NodeList}\n * a list of dom elements that were found\n *\n * @see [Information on CSS Selectors](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_Started/Selectors)\n */\n $$(selector, context) {\n return $$(selector, context || this.contentEl());\n }\n\n /**\n * Check if a component's element has a CSS class name.\n *\n * @param {string} classToCheck\n * CSS class name to check.\n *\n * @return {boolean}\n * - True if the `Component` has the class.\n * - False if the `Component` does not have the class`\n */\n hasClass(classToCheck) {\n return hasClass(this.el_, classToCheck);\n }\n\n /**\n * Add a CSS class name to the `Component`s element.\n *\n * @param {...string} classesToAdd\n * One or more CSS class name to add.\n */\n addClass(...classesToAdd) {\n addClass(this.el_, ...classesToAdd);\n }\n\n /**\n * Remove a CSS class name from the `Component`s element.\n *\n * @param {...string} classesToRemove\n * One or more CSS class name to remove.\n */\n removeClass(...classesToRemove) {\n removeClass(this.el_, ...classesToRemove);\n }\n\n /**\n * Add or remove a CSS class name from the component's element.\n * - `classToToggle` gets added when {@link Component#hasClass} would return false.\n * - `classToToggle` gets removed when {@link Component#hasClass} would return true.\n *\n * @param {string} classToToggle\n * The class to add or remove based on (@link Component#hasClass}\n *\n * @param {boolean|Dom~predicate} [predicate]\n * An {@link Dom~predicate} function or a boolean\n */\n toggleClass(classToToggle, predicate) {\n toggleClass(this.el_, classToToggle, predicate);\n }\n\n /**\n * Show the `Component`s element if it is hidden by removing the\n * 'vjs-hidden' class name from it.\n */\n show() {\n this.removeClass('vjs-hidden');\n }\n\n /**\n * Hide the `Component`s element if it is currently showing by adding the\n * 'vjs-hidden` class name to it.\n */\n hide() {\n this.addClass('vjs-hidden');\n }\n\n /**\n * Lock a `Component`s element in its visible state by adding the 'vjs-lock-showing'\n * class name to it. Used during fadeIn/fadeOut.\n *\n * @private\n */\n lockShowing() {\n this.addClass('vjs-lock-showing');\n }\n\n /**\n * Unlock a `Component`s element from its visible state by removing the 'vjs-lock-showing'\n * class name from it. Used during fadeIn/fadeOut.\n *\n * @private\n */\n unlockShowing() {\n this.removeClass('vjs-lock-showing');\n }\n\n /**\n * Get the value of an attribute on the `Component`s element.\n *\n * @param {string} attribute\n * Name of the attribute to get the value from.\n *\n * @return {string|null}\n * - The value of the attribute that was asked for.\n * - Can be an empty string on some browsers if the attribute does not exist\n * or has no value\n * - Most browsers will return null if the attribute does not exist or has\n * no value.\n *\n * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttribute}\n */\n getAttribute(attribute) {\n return getAttribute(this.el_, attribute);\n }\n\n /**\n * Set the value of an attribute on the `Component`'s element\n *\n * @param {string} attribute\n * Name of the attribute to set.\n *\n * @param {string} value\n * Value to set the attribute to.\n *\n * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute}\n */\n setAttribute(attribute, value) {\n setAttribute(this.el_, attribute, value);\n }\n\n /**\n * Remove an attribute from the `Component`s element.\n *\n * @param {string} attribute\n * Name of the attribute to remove.\n *\n * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/removeAttribute}\n */\n removeAttribute(attribute) {\n removeAttribute(this.el_, attribute);\n }\n\n /**\n * Get or set the width of the component based upon the CSS styles.\n * See {@link Component#dimension} for more detailed information.\n *\n * @param {number|string} [num]\n * The width that you want to set postfixed with '%', 'px' or nothing.\n *\n * @param {boolean} [skipListeners]\n * Skip the componentresize event trigger\n *\n * @return {number|undefined}\n * The width when getting, zero if there is no width\n */\n width(num, skipListeners) {\n return this.dimension('width', num, skipListeners);\n }\n\n /**\n * Get or set the height of the component based upon the CSS styles.\n * See {@link Component#dimension} for more detailed information.\n *\n * @param {number|string} [num]\n * The height that you want to set postfixed with '%', 'px' or nothing.\n *\n * @param {boolean} [skipListeners]\n * Skip the componentresize event trigger\n *\n * @return {number|undefined}\n * The height when getting, zero if there is no height\n */\n height(num, skipListeners) {\n return this.dimension('height', num, skipListeners);\n }\n\n /**\n * Set both the width and height of the `Component` element at the same time.\n *\n * @param {number|string} width\n * Width to set the `Component`s element to.\n *\n * @param {number|string} height\n * Height to set the `Component`s element to.\n */\n dimensions(width, height) {\n // Skip componentresize listeners on width for optimization\n this.width(width, true);\n this.height(height);\n }\n\n /**\n * Get or set width or height of the `Component` element. This is the shared code\n * for the {@link Component#width} and {@link Component#height}.\n *\n * Things to know:\n * - If the width or height in an number this will return the number postfixed with 'px'.\n * - If the width/height is a percent this will return the percent postfixed with '%'\n * - Hidden elements have a width of 0 with `window.getComputedStyle`. This function\n * defaults to the `Component`s `style.width` and falls back to `window.getComputedStyle`.\n * See [this]{@link http://www.foliotek.com/devblog/getting-the-width-of-a-hidden-element-with-jquery-using-width/}\n * for more information\n * - If you want the computed style of the component, use {@link Component#currentWidth}\n * and {@link {Component#currentHeight}\n *\n * @fires Component#componentresize\n *\n * @param {string} widthOrHeight\n 8 'width' or 'height'\n *\n * @param {number|string} [num]\n 8 New dimension\n *\n * @param {boolean} [skipListeners]\n * Skip componentresize event trigger\n *\n * @return {number|undefined}\n * The dimension when getting or 0 if unset\n */\n dimension(widthOrHeight, num, skipListeners) {\n if (num !== undefined) {\n // Set to zero if null or literally NaN (NaN !== NaN)\n if (num === null || num !== num) {\n num = 0;\n }\n\n // Check if using css width/height (% or px) and adjust\n if (('' + num).indexOf('%') !== -1 || ('' + num).indexOf('px') !== -1) {\n this.el_.style[widthOrHeight] = num;\n } else if (num === 'auto') {\n this.el_.style[widthOrHeight] = '';\n } else {\n this.el_.style[widthOrHeight] = num + 'px';\n }\n\n // skipListeners allows us to avoid triggering the resize event when setting both width and height\n if (!skipListeners) {\n /**\n * Triggered when a component is resized.\n *\n * @event Component#componentresize\n * @type {Event}\n */\n this.trigger('componentresize');\n }\n return;\n }\n\n // Not setting a value, so getting it\n // Make sure element exists\n if (!this.el_) {\n return 0;\n }\n\n // Get dimension value from style\n const val = this.el_.style[widthOrHeight];\n const pxIndex = val.indexOf('px');\n if (pxIndex !== -1) {\n // Return the pixel value with no 'px'\n return parseInt(val.slice(0, pxIndex), 10);\n }\n\n // No px so using % or no style was set, so falling back to offsetWidth/height\n // If component has display:none, offset will return 0\n // TODO: handle display:none and no dimension style using px\n return parseInt(this.el_['offset' + toTitleCase$1(widthOrHeight)], 10);\n }\n\n /**\n * Get the computed width or the height of the component's element.\n *\n * Uses `window.getComputedStyle`.\n *\n * @param {string} widthOrHeight\n * A string containing 'width' or 'height'. Whichever one you want to get.\n *\n * @return {number}\n * The dimension that gets asked for or 0 if nothing was set\n * for that dimension.\n */\n currentDimension(widthOrHeight) {\n let computedWidthOrHeight = 0;\n if (widthOrHeight !== 'width' && widthOrHeight !== 'height') {\n throw new Error('currentDimension only accepts width or height value');\n }\n computedWidthOrHeight = computedStyle(this.el_, widthOrHeight);\n\n // remove 'px' from variable and parse as integer\n computedWidthOrHeight = parseFloat(computedWidthOrHeight);\n\n // if the computed value is still 0, it's possible that the browser is lying\n // and we want to check the offset values.\n // This code also runs wherever getComputedStyle doesn't exist.\n if (computedWidthOrHeight === 0 || isNaN(computedWidthOrHeight)) {\n const rule = `offset${toTitleCase$1(widthOrHeight)}`;\n computedWidthOrHeight = this.el_[rule];\n }\n return computedWidthOrHeight;\n }\n\n /**\n * An object that contains width and height values of the `Component`s\n * computed style. Uses `window.getComputedStyle`.\n *\n * @typedef {Object} Component~DimensionObject\n *\n * @property {number} width\n * The width of the `Component`s computed style.\n *\n * @property {number} height\n * The height of the `Component`s computed style.\n */\n\n /**\n * Get an object that contains computed width and height values of the\n * component's element.\n *\n * Uses `window.getComputedStyle`.\n *\n * @return {Component~DimensionObject}\n * The computed dimensions of the component's element.\n */\n currentDimensions() {\n return {\n width: this.currentDimension('width'),\n height: this.currentDimension('height')\n };\n }\n\n /**\n * Get the computed width of the component's element.\n *\n * Uses `window.getComputedStyle`.\n *\n * @return {number}\n * The computed width of the component's element.\n */\n currentWidth() {\n return this.currentDimension('width');\n }\n\n /**\n * Get the computed height of the component's element.\n *\n * Uses `window.getComputedStyle`.\n *\n * @return {number}\n * The computed height of the component's element.\n */\n currentHeight() {\n return this.currentDimension('height');\n }\n\n /**\n * Set the focus to this component\n */\n focus() {\n this.el_.focus();\n }\n\n /**\n * Remove the focus from this component\n */\n blur() {\n this.el_.blur();\n }\n\n /**\n * When this Component receives a `keydown` event which it does not process,\n * it passes the event to the Player for handling.\n *\n * @param {KeyboardEvent} event\n * The `keydown` event that caused this function to be called.\n */\n handleKeyDown(event) {\n if (this.player_) {\n // We only stop propagation here because we want unhandled events to fall\n // back to the browser. Exclude Tab for focus trapping.\n if (!keycode.isEventKey(event, 'Tab')) {\n event.stopPropagation();\n }\n this.player_.handleKeyDown(event);\n }\n }\n\n /**\n * Many components used to have a `handleKeyPress` method, which was poorly\n * named because it listened to a `keydown` event. This method name now\n * delegates to `handleKeyDown`. This means anyone calling `handleKeyPress`\n * will not see their method calls stop working.\n *\n * @param {KeyboardEvent} event\n * The event that caused this function to be called.\n */\n handleKeyPress(event) {\n this.handleKeyDown(event);\n }\n\n /**\n * Emit a 'tap' events when touch event support gets detected. This gets used to\n * support toggling the controls through a tap on the video. They get enabled\n * because every sub-component would have extra overhead otherwise.\n *\n * @protected\n * @fires Component#tap\n * @listens Component#touchstart\n * @listens Component#touchmove\n * @listens Component#touchleave\n * @listens Component#touchcancel\n * @listens Component#touchend\n */\n emitTapEvents() {\n // Track the start time so we can determine how long the touch lasted\n let touchStart = 0;\n let firstTouch = null;\n\n // Maximum movement allowed during a touch event to still be considered a tap\n // Other popular libs use anywhere from 2 (hammer.js) to 15,\n // so 10 seems like a nice, round number.\n const tapMovementThreshold = 10;\n\n // The maximum length a touch can be while still being considered a tap\n const touchTimeThreshold = 200;\n let couldBeTap;\n this.on('touchstart', function (event) {\n // If more than one finger, don't consider treating this as a click\n if (event.touches.length === 1) {\n // Copy pageX/pageY from the object\n firstTouch = {\n pageX: event.touches[0].pageX,\n pageY: event.touches[0].pageY\n };\n // Record start time so we can detect a tap vs. \"touch and hold\"\n touchStart = window$1.performance.now();\n // Reset couldBeTap tracking\n couldBeTap = true;\n }\n });\n this.on('touchmove', function (event) {\n // If more than one finger, don't consider treating this as a click\n if (event.touches.length > 1) {\n couldBeTap = false;\n } else if (firstTouch) {\n // Some devices will throw touchmoves for all but the slightest of taps.\n // So, if we moved only a small distance, this could still be a tap\n const xdiff = event.touches[0].pageX - firstTouch.pageX;\n const ydiff = event.touches[0].pageY - firstTouch.pageY;\n const touchDistance = Math.sqrt(xdiff * xdiff + ydiff * ydiff);\n if (touchDistance > tapMovementThreshold) {\n couldBeTap = false;\n }\n }\n });\n const noTap = function () {\n couldBeTap = false;\n };\n\n // TODO: Listen to the original target. http://youtu.be/DujfpXOKUp8?t=13m8s\n this.on('touchleave', noTap);\n this.on('touchcancel', noTap);\n\n // When the touch ends, measure how long it took and trigger the appropriate\n // event\n this.on('touchend', function (event) {\n firstTouch = null;\n // Proceed only if the touchmove/leave/cancel event didn't happen\n if (couldBeTap === true) {\n // Measure how long the touch lasted\n const touchTime = window$1.performance.now() - touchStart;\n\n // Make sure the touch was less than the threshold to be considered a tap\n if (touchTime < touchTimeThreshold) {\n // Don't let browser turn this into a click\n event.preventDefault();\n /**\n * Triggered when a `Component` is tapped.\n *\n * @event Component#tap\n * @type {MouseEvent}\n */\n this.trigger('tap');\n // It may be good to copy the touchend event object and change the\n // type to tap, if the other event properties aren't exact after\n // Events.fixEvent runs (e.g. event.target)\n }\n }\n });\n }\n\n /**\n * This function reports user activity whenever touch events happen. This can get\n * turned off by any sub-components that wants touch events to act another way.\n *\n * Report user touch activity when touch events occur. User activity gets used to\n * determine when controls should show/hide. It is simple when it comes to mouse\n * events, because any mouse event should show the controls. So we capture mouse\n * events that bubble up to the player and report activity when that happens.\n * With touch events it isn't as easy as `touchstart` and `touchend` toggle player\n * controls. So touch events can't help us at the player level either.\n *\n * User activity gets checked asynchronously. So what could happen is a tap event\n * on the video turns the controls off. Then the `touchend` event bubbles up to\n * the player. Which, if it reported user activity, would turn the controls right\n * back on. We also don't want to completely block touch events from bubbling up.\n * Furthermore a `touchmove` event and anything other than a tap, should not turn\n * controls back on.\n *\n * @listens Component#touchstart\n * @listens Component#touchmove\n * @listens Component#touchend\n * @listens Component#touchcancel\n */\n enableTouchActivity() {\n // Don't continue if the root player doesn't support reporting user activity\n if (!this.player() || !this.player().reportUserActivity) {\n return;\n }\n\n // listener for reporting that the user is active\n const report = bind_(this.player(), this.player().reportUserActivity);\n let touchHolding;\n this.on('touchstart', function () {\n report();\n // For as long as the they are touching the device or have their mouse down,\n // we consider them active even if they're not moving their finger or mouse.\n // So we want to continue to update that they are active\n this.clearInterval(touchHolding);\n // report at the same interval as activityCheck\n touchHolding = this.setInterval(report, 250);\n });\n const touchEnd = function (event) {\n report();\n // stop the interval that maintains activity if the touch is holding\n this.clearInterval(touchHolding);\n };\n this.on('touchmove', report);\n this.on('touchend', touchEnd);\n this.on('touchcancel', touchEnd);\n }\n\n /**\n * A callback that has no parameters and is bound into `Component`s context.\n *\n * @callback Component~GenericCallback\n * @this Component\n */\n\n /**\n * Creates a function that runs after an `x` millisecond timeout. This function is a\n * wrapper around `window.setTimeout`. There are a few reasons to use this one\n * instead though:\n * 1. It gets cleared via {@link Component#clearTimeout} when\n * {@link Component#dispose} gets called.\n * 2. The function callback will gets turned into a {@link Component~GenericCallback}\n *\n * > Note: You can't use `window.clearTimeout` on the id returned by this function. This\n * will cause its dispose listener not to get cleaned up! Please use\n * {@link Component#clearTimeout} or {@link Component#dispose} instead.\n *\n * @param {Component~GenericCallback} fn\n * The function that will be run after `timeout`.\n *\n * @param {number} timeout\n * Timeout in milliseconds to delay before executing the specified function.\n *\n * @return {number}\n * Returns a timeout ID that gets used to identify the timeout. It can also\n * get used in {@link Component#clearTimeout} to clear the timeout that\n * was set.\n *\n * @listens Component#dispose\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setTimeout}\n */\n setTimeout(fn, timeout) {\n // declare as variables so they are properly available in timeout function\n // eslint-disable-next-line\n var timeoutId;\n fn = bind_(this, fn);\n this.clearTimersOnDispose_();\n timeoutId = window$1.setTimeout(() => {\n if (this.setTimeoutIds_.has(timeoutId)) {\n this.setTimeoutIds_.delete(timeoutId);\n }\n fn();\n }, timeout);\n this.setTimeoutIds_.add(timeoutId);\n return timeoutId;\n }\n\n /**\n * Clears a timeout that gets created via `window.setTimeout` or\n * {@link Component#setTimeout}. If you set a timeout via {@link Component#setTimeout}\n * use this function instead of `window.clearTimout`. If you don't your dispose\n * listener will not get cleaned up until {@link Component#dispose}!\n *\n * @param {number} timeoutId\n * The id of the timeout to clear. The return value of\n * {@link Component#setTimeout} or `window.setTimeout`.\n *\n * @return {number}\n * Returns the timeout id that was cleared.\n *\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/clearTimeout}\n */\n clearTimeout(timeoutId) {\n if (this.setTimeoutIds_.has(timeoutId)) {\n this.setTimeoutIds_.delete(timeoutId);\n window$1.clearTimeout(timeoutId);\n }\n return timeoutId;\n }\n\n /**\n * Creates a function that gets run every `x` milliseconds. This function is a wrapper\n * around `window.setInterval`. There are a few reasons to use this one instead though.\n * 1. It gets cleared via {@link Component#clearInterval} when\n * {@link Component#dispose} gets called.\n * 2. The function callback will be a {@link Component~GenericCallback}\n *\n * @param {Component~GenericCallback} fn\n * The function to run every `x` seconds.\n *\n * @param {number} interval\n * Execute the specified function every `x` milliseconds.\n *\n * @return {number}\n * Returns an id that can be used to identify the interval. It can also be be used in\n * {@link Component#clearInterval} to clear the interval.\n *\n * @listens Component#dispose\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setInterval}\n */\n setInterval(fn, interval) {\n fn = bind_(this, fn);\n this.clearTimersOnDispose_();\n const intervalId = window$1.setInterval(fn, interval);\n this.setIntervalIds_.add(intervalId);\n return intervalId;\n }\n\n /**\n * Clears an interval that gets created via `window.setInterval` or\n * {@link Component#setInterval}. If you set an interval via {@link Component#setInterval}\n * use this function instead of `window.clearInterval`. If you don't your dispose\n * listener will not get cleaned up until {@link Component#dispose}!\n *\n * @param {number} intervalId\n * The id of the interval to clear. The return value of\n * {@link Component#setInterval} or `window.setInterval`.\n *\n * @return {number}\n * Returns the interval id that was cleared.\n *\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/clearInterval}\n */\n clearInterval(intervalId) {\n if (this.setIntervalIds_.has(intervalId)) {\n this.setIntervalIds_.delete(intervalId);\n window$1.clearInterval(intervalId);\n }\n return intervalId;\n }\n\n /**\n * Queues up a callback to be passed to requestAnimationFrame (rAF), but\n * with a few extra bonuses:\n *\n * - Supports browsers that do not support rAF by falling back to\n * {@link Component#setTimeout}.\n *\n * - The callback is turned into a {@link Component~GenericCallback} (i.e.\n * bound to the component).\n *\n * - Automatic cancellation of the rAF callback is handled if the component\n * is disposed before it is called.\n *\n * @param {Component~GenericCallback} fn\n * A function that will be bound to this component and executed just\n * before the browser's next repaint.\n *\n * @return {number}\n * Returns an rAF ID that gets used to identify the timeout. It can\n * also be used in {@link Component#cancelAnimationFrame} to cancel\n * the animation frame callback.\n *\n * @listens Component#dispose\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame}\n */\n requestAnimationFrame(fn) {\n this.clearTimersOnDispose_();\n\n // declare as variables so they are properly available in rAF function\n // eslint-disable-next-line\n var id;\n fn = bind_(this, fn);\n id = window$1.requestAnimationFrame(() => {\n if (this.rafIds_.has(id)) {\n this.rafIds_.delete(id);\n }\n fn();\n });\n this.rafIds_.add(id);\n return id;\n }\n\n /**\n * Request an animation frame, but only one named animation\n * frame will be queued. Another will never be added until\n * the previous one finishes.\n *\n * @param {string} name\n * The name to give this requestAnimationFrame\n *\n * @param {Component~GenericCallback} fn\n * A function that will be bound to this component and executed just\n * before the browser's next repaint.\n */\n requestNamedAnimationFrame(name, fn) {\n if (this.namedRafs_.has(name)) {\n return;\n }\n this.clearTimersOnDispose_();\n fn = bind_(this, fn);\n const id = this.requestAnimationFrame(() => {\n fn();\n if (this.namedRafs_.has(name)) {\n this.namedRafs_.delete(name);\n }\n });\n this.namedRafs_.set(name, id);\n return name;\n }\n\n /**\n * Cancels a current named animation frame if it exists.\n *\n * @param {string} name\n * The name of the requestAnimationFrame to cancel.\n */\n cancelNamedAnimationFrame(name) {\n if (!this.namedRafs_.has(name)) {\n return;\n }\n this.cancelAnimationFrame(this.namedRafs_.get(name));\n this.namedRafs_.delete(name);\n }\n\n /**\n * Cancels a queued callback passed to {@link Component#requestAnimationFrame}\n * (rAF).\n *\n * If you queue an rAF callback via {@link Component#requestAnimationFrame},\n * use this function instead of `window.cancelAnimationFrame`. If you don't,\n * your dispose listener will not get cleaned up until {@link Component#dispose}!\n *\n * @param {number} id\n * The rAF ID to clear. The return value of {@link Component#requestAnimationFrame}.\n *\n * @return {number}\n * Returns the rAF ID that was cleared.\n *\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/window/cancelAnimationFrame}\n */\n cancelAnimationFrame(id) {\n if (this.rafIds_.has(id)) {\n this.rafIds_.delete(id);\n window$1.cancelAnimationFrame(id);\n }\n return id;\n }\n\n /**\n * A function to setup `requestAnimationFrame`, `setTimeout`,\n * and `setInterval`, clearing on dispose.\n *\n * > Previously each timer added and removed dispose listeners on it's own.\n * For better performance it was decided to batch them all, and use `Set`s\n * to track outstanding timer ids.\n *\n * @private\n */\n clearTimersOnDispose_() {\n if (this.clearingTimersOnDispose_) {\n return;\n }\n this.clearingTimersOnDispose_ = true;\n this.one('dispose', () => {\n [['namedRafs_', 'cancelNamedAnimationFrame'], ['rafIds_', 'cancelAnimationFrame'], ['setTimeoutIds_', 'clearTimeout'], ['setIntervalIds_', 'clearInterval']].forEach(([idName, cancelName]) => {\n // for a `Set` key will actually be the value again\n // so forEach((val, val) =>` but for maps we want to use\n // the key.\n this[idName].forEach((val, key) => this[cancelName](key));\n });\n this.clearingTimersOnDispose_ = false;\n });\n }\n\n /**\n * Register a `Component` with `videojs` given the name and the component.\n *\n * > NOTE: {@link Tech}s should not be registered as a `Component`. {@link Tech}s\n * should be registered using {@link Tech.registerTech} or\n * {@link videojs:videojs.registerTech}.\n *\n * > NOTE: This function can also be seen on videojs as\n * {@link videojs:videojs.registerComponent}.\n *\n * @param {string} name\n * The name of the `Component` to register.\n *\n * @param {Component} ComponentToRegister\n * The `Component` class to register.\n *\n * @return {Component}\n * The `Component` that was registered.\n */\n static registerComponent(name, ComponentToRegister) {\n if (typeof name !== 'string' || !name) {\n throw new Error(`Illegal component name, \"${name}\"; must be a non-empty string.`);\n }\n const Tech = Component$1.getComponent('Tech');\n\n // We need to make sure this check is only done if Tech has been registered.\n const isTech = Tech && Tech.isTech(ComponentToRegister);\n const isComp = Component$1 === ComponentToRegister || Component$1.prototype.isPrototypeOf(ComponentToRegister.prototype);\n if (isTech || !isComp) {\n let reason;\n if (isTech) {\n reason = 'techs must be registered using Tech.registerTech()';\n } else {\n reason = 'must be a Component subclass';\n }\n throw new Error(`Illegal component, \"${name}\"; ${reason}.`);\n }\n name = toTitleCase$1(name);\n if (!Component$1.components_) {\n Component$1.components_ = {};\n }\n const Player = Component$1.getComponent('Player');\n if (name === 'Player' && Player && Player.players) {\n const players = Player.players;\n const playerNames = Object.keys(players);\n\n // If we have players that were disposed, then their name will still be\n // in Players.players. So, we must loop through and verify that the value\n // for each item is not null. This allows registration of the Player component\n // after all players have been disposed or before any were created.\n if (players && playerNames.length > 0 && playerNames.map(pname => players[pname]).every(Boolean)) {\n throw new Error('Can not register Player component after player has been created.');\n }\n }\n Component$1.components_[name] = ComponentToRegister;\n Component$1.components_[toLowerCase(name)] = ComponentToRegister;\n return ComponentToRegister;\n }\n\n /**\n * Get a `Component` based on the name it was registered with.\n *\n * @param {string} name\n * The Name of the component to get.\n *\n * @return {Component}\n * The `Component` that got registered under the given name.\n */\n static getComponent(name) {\n if (!name || !Component$1.components_) {\n return;\n }\n return Component$1.components_[name];\n }\n}\nComponent$1.registerComponent('Component', Component$1);\n\n/**\n * @file time.js\n * @module time\n */\n\n/**\n * Returns the time for the specified index at the start or end\n * of a TimeRange object.\n *\n * @typedef {Function} TimeRangeIndex\n *\n * @param {number} [index=0]\n * The range number to return the time for.\n *\n * @return {number}\n * The time offset at the specified index.\n *\n * @deprecated The index argument must be provided.\n * In the future, leaving it out will throw an error.\n */\n\n/**\n * An object that contains ranges of time, which mimics {@link TimeRanges}.\n *\n * @typedef {Object} TimeRange\n *\n * @property {number} length\n * The number of time ranges represented by this object.\n *\n * @property {module:time~TimeRangeIndex} start\n * Returns the time offset at which a specified time range begins.\n *\n * @property {module:time~TimeRangeIndex} end\n * Returns the time offset at which a specified time range ends.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/TimeRanges\n */\n\n/**\n * Check if any of the time ranges are over the maximum index.\n *\n * @private\n * @param {string} fnName\n * The function name to use for logging\n *\n * @param {number} index\n * The index to check\n *\n * @param {number} maxIndex\n * The maximum possible index\n *\n * @throws {Error} if the timeRanges provided are over the maxIndex\n */\nfunction rangeCheck(fnName, index, maxIndex) {\n if (typeof index !== 'number' || index < 0 || index > maxIndex) {\n throw new Error(`Failed to execute '${fnName}' on 'TimeRanges': The index provided (${index}) is non-numeric or out of bounds (0-${maxIndex}).`);\n }\n}\n\n/**\n * Get the time for the specified index at the start or end\n * of a TimeRange object.\n *\n * @private\n * @param {string} fnName\n * The function name to use for logging\n *\n * @param {string} valueIndex\n * The property that should be used to get the time. should be\n * 'start' or 'end'\n *\n * @param {Array} ranges\n * An array of time ranges\n *\n * @param {Array} [rangeIndex=0]\n * The index to start the search at\n *\n * @return {number}\n * The time that offset at the specified index.\n *\n * @deprecated rangeIndex must be set to a value, in the future this will throw an error.\n * @throws {Error} if rangeIndex is more than the length of ranges\n */\nfunction getRange(fnName, valueIndex, ranges, rangeIndex) {\n rangeCheck(fnName, rangeIndex, ranges.length - 1);\n return ranges[rangeIndex][valueIndex];\n}\n\n/**\n * Create a time range object given ranges of time.\n *\n * @private\n * @param {Array} [ranges]\n * An array of time ranges.\n *\n * @return {TimeRange}\n */\nfunction createTimeRangesObj(ranges) {\n let timeRangesObj;\n if (ranges === undefined || ranges.length === 0) {\n timeRangesObj = {\n length: 0,\n start() {\n throw new Error('This TimeRanges object is empty');\n },\n end() {\n throw new Error('This TimeRanges object is empty');\n }\n };\n } else {\n timeRangesObj = {\n length: ranges.length,\n start: getRange.bind(null, 'start', 0, ranges),\n end: getRange.bind(null, 'end', 1, ranges)\n };\n }\n if (window$1.Symbol && window$1.Symbol.iterator) {\n timeRangesObj[window$1.Symbol.iterator] = () => (ranges || []).values();\n }\n return timeRangesObj;\n}\n\n/**\n * Create a `TimeRange` object which mimics an\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/TimeRanges|HTML5 TimeRanges instance}.\n *\n * @param {number|Array[]} start\n * The start of a single range (a number) or an array of ranges (an\n * array of arrays of two numbers each).\n *\n * @param {number} end\n * The end of a single range. Cannot be used with the array form of\n * the `start` argument.\n *\n * @return {TimeRange}\n */\nfunction createTimeRanges$1(start, end) {\n if (Array.isArray(start)) {\n return createTimeRangesObj(start);\n } else if (start === undefined || end === undefined) {\n return createTimeRangesObj();\n }\n return createTimeRangesObj([[start, end]]);\n}\n\n/**\n * Format seconds as a time string, H:MM:SS or M:SS. Supplying a guide (in\n * seconds) will force a number of leading zeros to cover the length of the\n * guide.\n *\n * @private\n * @param {number} seconds\n * Number of seconds to be turned into a string\n *\n * @param {number} guide\n * Number (in seconds) to model the string after\n *\n * @return {string}\n * Time formatted as H:MM:SS or M:SS\n */\nconst defaultImplementation = function (seconds, guide) {\n seconds = seconds < 0 ? 0 : seconds;\n let s = Math.floor(seconds % 60);\n let m = Math.floor(seconds / 60 % 60);\n let h = Math.floor(seconds / 3600);\n const gm = Math.floor(guide / 60 % 60);\n const gh = Math.floor(guide / 3600);\n\n // handle invalid times\n if (isNaN(seconds) || seconds === Infinity) {\n // '-' is false for all relational operators (e.g. <, >=) so this setting\n // will add the minimum number of fields specified by the guide\n h = m = s = '-';\n }\n\n // Check if we need to show hours\n h = h > 0 || gh > 0 ? h + ':' : '';\n\n // If hours are showing, we may need to add a leading zero.\n // Always show at least one digit of minutes.\n m = ((h || gm >= 10) && m < 10 ? '0' + m : m) + ':';\n\n // Check if leading zero is need for seconds\n s = s < 10 ? '0' + s : s;\n return h + m + s;\n};\n\n// Internal pointer to the current implementation.\nlet implementation = defaultImplementation;\n\n/**\n * Replaces the default formatTime implementation with a custom implementation.\n *\n * @param {Function} customImplementation\n * A function which will be used in place of the default formatTime\n * implementation. Will receive the current time in seconds and the\n * guide (in seconds) as arguments.\n */\nfunction setFormatTime(customImplementation) {\n implementation = customImplementation;\n}\n\n/**\n * Resets formatTime to the default implementation.\n */\nfunction resetFormatTime() {\n implementation = defaultImplementation;\n}\n\n/**\n * Delegates to either the default time formatting function or a custom\n * function supplied via `setFormatTime`.\n *\n * Formats seconds as a time string (H:MM:SS or M:SS). Supplying a\n * guide (in seconds) will force a number of leading zeros to cover the\n * length of the guide.\n *\n * @example formatTime(125, 600) === \"02:05\"\n * @param {number} seconds\n * Number of seconds to be turned into a string\n *\n * @param {number} guide\n * Number (in seconds) to model the string after\n *\n * @return {string}\n * Time formatted as H:MM:SS or M:SS\n */\nfunction formatTime(seconds, guide = seconds) {\n return implementation(seconds, guide);\n}\n\nvar Time = /*#__PURE__*/Object.freeze({\n __proto__: null,\n createTimeRanges: createTimeRanges$1,\n createTimeRange: createTimeRanges$1,\n setFormatTime: setFormatTime,\n resetFormatTime: resetFormatTime,\n formatTime: formatTime\n});\n\n/**\n * @file buffer.js\n * @module buffer\n */\n\n/**\n * Compute the percentage of the media that has been buffered.\n *\n * @param { import('./time').TimeRange } buffered\n * The current `TimeRanges` object representing buffered time ranges\n *\n * @param {number} duration\n * Total duration of the media\n *\n * @return {number}\n * Percent buffered of the total duration in decimal form.\n */\nfunction bufferedPercent(buffered, duration) {\n let bufferedDuration = 0;\n let start;\n let end;\n if (!duration) {\n return 0;\n }\n if (!buffered || !buffered.length) {\n buffered = createTimeRanges$1(0, 0);\n }\n for (let i = 0; i < buffered.length; i++) {\n start = buffered.start(i);\n end = buffered.end(i);\n\n // buffered end can be bigger than duration by a very small fraction\n if (end > duration) {\n end = duration;\n }\n bufferedDuration += end - start;\n }\n return bufferedDuration / duration;\n}\n\n/**\n * @file media-error.js\n */\n\n/**\n * A Custom `MediaError` class which mimics the standard HTML5 `MediaError` class.\n *\n * @param {number|string|Object|MediaError} value\n * This can be of multiple types:\n * - number: should be a standard error code\n * - string: an error message (the code will be 0)\n * - Object: arbitrary properties\n * - `MediaError` (native): used to populate a video.js `MediaError` object\n * - `MediaError` (video.js): will return itself if it's already a\n * video.js `MediaError` object.\n *\n * @see [MediaError Spec]{@link https://dev.w3.org/html5/spec-author-view/video.html#mediaerror}\n * @see [Encrypted MediaError Spec]{@link https://www.w3.org/TR/2013/WD-encrypted-media-20130510/#error-codes}\n *\n * @class MediaError\n */\nfunction MediaError(value) {\n // Allow redundant calls to this constructor to avoid having `instanceof`\n // checks peppered around the code.\n if (value instanceof MediaError) {\n return value;\n }\n if (typeof value === 'number') {\n this.code = value;\n } else if (typeof value === 'string') {\n // default code is zero, so this is a custom error\n this.message = value;\n } else if (isObject(value)) {\n // We assign the `code` property manually because native `MediaError` objects\n // do not expose it as an own/enumerable property of the object.\n if (typeof value.code === 'number') {\n this.code = value.code;\n }\n Object.assign(this, value);\n }\n if (!this.message) {\n this.message = MediaError.defaultMessages[this.code] || '';\n }\n}\n\n/**\n * The error code that refers two one of the defined `MediaError` types\n *\n * @type {Number}\n */\nMediaError.prototype.code = 0;\n\n/**\n * An optional message that to show with the error. Message is not part of the HTML5\n * video spec but allows for more informative custom errors.\n *\n * @type {String}\n */\nMediaError.prototype.message = '';\n\n/**\n * An optional status code that can be set by plugins to allow even more detail about\n * the error. For example a plugin might provide a specific HTTP status code and an\n * error message for that code. Then when the plugin gets that error this class will\n * know how to display an error message for it. This allows a custom message to show\n * up on the `Player` error overlay.\n *\n * @type {Array}\n */\nMediaError.prototype.status = null;\n\n/**\n * Errors indexed by the W3C standard. The order **CANNOT CHANGE**! See the\n * specification listed under {@link MediaError} for more information.\n *\n * @enum {array}\n * @readonly\n * @property {string} 0 - MEDIA_ERR_CUSTOM\n * @property {string} 1 - MEDIA_ERR_ABORTED\n * @property {string} 2 - MEDIA_ERR_NETWORK\n * @property {string} 3 - MEDIA_ERR_DECODE\n * @property {string} 4 - MEDIA_ERR_SRC_NOT_SUPPORTED\n * @property {string} 5 - MEDIA_ERR_ENCRYPTED\n */\nMediaError.errorTypes = ['MEDIA_ERR_CUSTOM', 'MEDIA_ERR_ABORTED', 'MEDIA_ERR_NETWORK', 'MEDIA_ERR_DECODE', 'MEDIA_ERR_SRC_NOT_SUPPORTED', 'MEDIA_ERR_ENCRYPTED'];\n\n/**\n * The default `MediaError` messages based on the {@link MediaError.errorTypes}.\n *\n * @type {Array}\n * @constant\n */\nMediaError.defaultMessages = {\n 1: 'You aborted the media playback',\n 2: 'A network error caused the media download to fail part-way.',\n 3: 'The media playback was aborted due to a corruption problem or because the media used features your browser did not support.',\n 4: 'The media could not be loaded, either because the server or network failed or because the format is not supported.',\n 5: 'The media is encrypted and we do not have the keys to decrypt it.'\n};\n\n// Add types as properties on MediaError\n// e.g. MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED = 4;\nfor (let errNum = 0; errNum < MediaError.errorTypes.length; errNum++) {\n MediaError[MediaError.errorTypes[errNum]] = errNum;\n // values should be accessible on both the class and instance\n MediaError.prototype[MediaError.errorTypes[errNum]] = errNum;\n}\n\n/**\n * Returns whether an object is `Promise`-like (i.e. has a `then` method).\n *\n * @param {Object} value\n * An object that may or may not be `Promise`-like.\n *\n * @return {boolean}\n * Whether or not the object is `Promise`-like.\n */\nfunction isPromise(value) {\n return value !== undefined && value !== null && typeof value.then === 'function';\n}\n\n/**\n * Silence a Promise-like object.\n *\n * This is useful for avoiding non-harmful, but potentially confusing \"uncaught\n * play promise\" rejection error messages.\n *\n * @param {Object} value\n * An object that may or may not be `Promise`-like.\n */\nfunction silencePromise(value) {\n if (isPromise(value)) {\n value.then(null, e => {});\n }\n}\n\n/**\n * @file text-track-list-converter.js Utilities for capturing text track state and\n * re-creating tracks based on a capture.\n *\n * @module text-track-list-converter\n */\n\n/**\n * Examine a single {@link TextTrack} and return a JSON-compatible javascript object that\n * represents the {@link TextTrack}'s state.\n *\n * @param {TextTrack} track\n * The text track to query.\n *\n * @return {Object}\n * A serializable javascript representation of the TextTrack.\n * @private\n */\nconst trackToJson_ = function (track) {\n const ret = ['kind', 'label', 'language', 'id', 'inBandMetadataTrackDispatchType', 'mode', 'src'].reduce((acc, prop, i) => {\n if (track[prop]) {\n acc[prop] = track[prop];\n }\n return acc;\n }, {\n cues: track.cues && Array.prototype.map.call(track.cues, function (cue) {\n return {\n startTime: cue.startTime,\n endTime: cue.endTime,\n text: cue.text,\n id: cue.id\n };\n })\n });\n return ret;\n};\n\n/**\n * Examine a {@link Tech} and return a JSON-compatible javascript array that represents the\n * state of all {@link TextTrack}s currently configured. The return array is compatible with\n * {@link text-track-list-converter:jsonToTextTracks}.\n *\n * @param { import('../tech/tech').default } tech\n * The tech object to query\n *\n * @return {Array}\n * A serializable javascript representation of the {@link Tech}s\n * {@link TextTrackList}.\n */\nconst textTracksToJson = function (tech) {\n const trackEls = tech.$$('track');\n const trackObjs = Array.prototype.map.call(trackEls, t => t.track);\n const tracks = Array.prototype.map.call(trackEls, function (trackEl) {\n const json = trackToJson_(trackEl.track);\n if (trackEl.src) {\n json.src = trackEl.src;\n }\n return json;\n });\n return tracks.concat(Array.prototype.filter.call(tech.textTracks(), function (track) {\n return trackObjs.indexOf(track) === -1;\n }).map(trackToJson_));\n};\n\n/**\n * Create a set of remote {@link TextTrack}s on a {@link Tech} based on an array of javascript\n * object {@link TextTrack} representations.\n *\n * @param {Array} json\n * An array of `TextTrack` representation objects, like those that would be\n * produced by `textTracksToJson`.\n *\n * @param {Tech} tech\n * The `Tech` to create the `TextTrack`s on.\n */\nconst jsonToTextTracks = function (json, tech) {\n json.forEach(function (track) {\n const addedTrack = tech.addRemoteTextTrack(track).track;\n if (!track.src && track.cues) {\n track.cues.forEach(cue => addedTrack.addCue(cue));\n }\n });\n return tech.textTracks();\n};\nvar textTrackConverter = {\n textTracksToJson,\n jsonToTextTracks,\n trackToJson_\n};\n\n/**\n * @file modal-dialog.js\n */\nconst MODAL_CLASS_NAME = 'vjs-modal-dialog';\n\n/**\n * The `ModalDialog` displays over the video and its controls, which blocks\n * interaction with the player until it is closed.\n *\n * Modal dialogs include a \"Close\" button and will close when that button\n * is activated - or when ESC is pressed anywhere.\n *\n * @extends Component\n */\nclass ModalDialog extends Component$1 {\n /**\n * Create an instance of this class.\n *\n * @param { import('./player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param { import('./utils/dom').ContentDescriptor} [options.content=undefined]\n * Provide customized content for this modal.\n *\n * @param {string} [options.description]\n * A text description for the modal, primarily for accessibility.\n *\n * @param {boolean} [options.fillAlways=false]\n * Normally, modals are automatically filled only the first time\n * they open. This tells the modal to refresh its content\n * every time it opens.\n *\n * @param {string} [options.label]\n * A text label for the modal, primarily for accessibility.\n *\n * @param {boolean} [options.pauseOnOpen=true]\n * If `true`, playback will will be paused if playing when\n * the modal opens, and resumed when it closes.\n *\n * @param {boolean} [options.temporary=true]\n * If `true`, the modal can only be opened once; it will be\n * disposed as soon as it's closed.\n *\n * @param {boolean} [options.uncloseable=false]\n * If `true`, the user will not be able to close the modal\n * through the UI in the normal ways. Programmatic closing is\n * still possible.\n */\n constructor(player, options) {\n super(player, options);\n this.handleKeyDown_ = e => this.handleKeyDown(e);\n this.close_ = e => this.close(e);\n this.opened_ = this.hasBeenOpened_ = this.hasBeenFilled_ = false;\n this.closeable(!this.options_.uncloseable);\n this.content(this.options_.content);\n\n // Make sure the contentEl is defined AFTER any children are initialized\n // because we only want the contents of the modal in the contentEl\n // (not the UI elements like the close button).\n this.contentEl_ = createEl('div', {\n className: `${MODAL_CLASS_NAME}-content`\n }, {\n role: 'document'\n });\n this.descEl_ = createEl('p', {\n className: `${MODAL_CLASS_NAME}-description vjs-control-text`,\n id: this.el().getAttribute('aria-describedby')\n });\n textContent(this.descEl_, this.description());\n this.el_.appendChild(this.descEl_);\n this.el_.appendChild(this.contentEl_);\n }\n\n /**\n * Create the `ModalDialog`'s DOM element\n *\n * @return {Element}\n * The DOM element that gets created.\n */\n createEl() {\n return super.createEl('div', {\n className: this.buildCSSClass(),\n tabIndex: -1\n }, {\n 'aria-describedby': `${this.id()}_description`,\n 'aria-hidden': 'true',\n 'aria-label': this.label(),\n 'role': 'dialog'\n });\n }\n dispose() {\n this.contentEl_ = null;\n this.descEl_ = null;\n this.previouslyActiveEl_ = null;\n super.dispose();\n }\n\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n buildCSSClass() {\n return `${MODAL_CLASS_NAME} vjs-hidden ${super.buildCSSClass()}`;\n }\n\n /**\n * Returns the label string for this modal. Primarily used for accessibility.\n *\n * @return {string}\n * the localized or raw label of this modal.\n */\n label() {\n return this.localize(this.options_.label || 'Modal Window');\n }\n\n /**\n * Returns the description string for this modal. Primarily used for\n * accessibility.\n *\n * @return {string}\n * The localized or raw description of this modal.\n */\n description() {\n let desc = this.options_.description || this.localize('This is a modal window.');\n\n // Append a universal closeability message if the modal is closeable.\n if (this.closeable()) {\n desc += ' ' + this.localize('This modal can be closed by pressing the Escape key or activating the close button.');\n }\n return desc;\n }\n\n /**\n * Opens the modal.\n *\n * @fires ModalDialog#beforemodalopen\n * @fires ModalDialog#modalopen\n */\n open() {\n if (!this.opened_) {\n const player = this.player();\n\n /**\n * Fired just before a `ModalDialog` is opened.\n *\n * @event ModalDialog#beforemodalopen\n * @type {Event}\n */\n this.trigger('beforemodalopen');\n this.opened_ = true;\n\n // Fill content if the modal has never opened before and\n // never been filled.\n if (this.options_.fillAlways || !this.hasBeenOpened_ && !this.hasBeenFilled_) {\n this.fill();\n }\n\n // If the player was playing, pause it and take note of its previously\n // playing state.\n this.wasPlaying_ = !player.paused();\n if (this.options_.pauseOnOpen && this.wasPlaying_) {\n player.pause();\n }\n this.on('keydown', this.handleKeyDown_);\n\n // Hide controls and note if they were enabled.\n this.hadControls_ = player.controls();\n player.controls(false);\n this.show();\n this.conditionalFocus_();\n this.el().setAttribute('aria-hidden', 'false');\n\n /**\n * Fired just after a `ModalDialog` is opened.\n *\n * @event ModalDialog#modalopen\n * @type {Event}\n */\n this.trigger('modalopen');\n this.hasBeenOpened_ = true;\n }\n }\n\n /**\n * If the `ModalDialog` is currently open or closed.\n *\n * @param {boolean} [value]\n * If given, it will open (`true`) or close (`false`) the modal.\n *\n * @return {boolean}\n * the current open state of the modaldialog\n */\n opened(value) {\n if (typeof value === 'boolean') {\n this[value ? 'open' : 'close']();\n }\n return this.opened_;\n }\n\n /**\n * Closes the modal, does nothing if the `ModalDialog` is\n * not open.\n *\n * @fires ModalDialog#beforemodalclose\n * @fires ModalDialog#modalclose\n */\n close() {\n if (!this.opened_) {\n return;\n }\n const player = this.player();\n\n /**\n * Fired just before a `ModalDialog` is closed.\n *\n * @event ModalDialog#beforemodalclose\n * @type {Event}\n */\n this.trigger('beforemodalclose');\n this.opened_ = false;\n if (this.wasPlaying_ && this.options_.pauseOnOpen) {\n player.play();\n }\n this.off('keydown', this.handleKeyDown_);\n if (this.hadControls_) {\n player.controls(true);\n }\n this.hide();\n this.el().setAttribute('aria-hidden', 'true');\n\n /**\n * Fired just after a `ModalDialog` is closed.\n *\n * @event ModalDialog#modalclose\n * @type {Event}\n */\n this.trigger('modalclose');\n this.conditionalBlur_();\n if (this.options_.temporary) {\n this.dispose();\n }\n }\n\n /**\n * Check to see if the `ModalDialog` is closeable via the UI.\n *\n * @param {boolean} [value]\n * If given as a boolean, it will set the `closeable` option.\n *\n * @return {boolean}\n * Returns the final value of the closable option.\n */\n closeable(value) {\n if (typeof value === 'boolean') {\n const closeable = this.closeable_ = !!value;\n let close = this.getChild('closeButton');\n\n // If this is being made closeable and has no close button, add one.\n if (closeable && !close) {\n // The close button should be a child of the modal - not its\n // content element, so temporarily change the content element.\n const temp = this.contentEl_;\n this.contentEl_ = this.el_;\n close = this.addChild('closeButton', {\n controlText: 'Close Modal Dialog'\n });\n this.contentEl_ = temp;\n this.on(close, 'close', this.close_);\n }\n\n // If this is being made uncloseable and has a close button, remove it.\n if (!closeable && close) {\n this.off(close, 'close', this.close_);\n this.removeChild(close);\n close.dispose();\n }\n }\n return this.closeable_;\n }\n\n /**\n * Fill the modal's content element with the modal's \"content\" option.\n * The content element will be emptied before this change takes place.\n */\n fill() {\n this.fillWith(this.content());\n }\n\n /**\n * Fill the modal's content element with arbitrary content.\n * The content element will be emptied before this change takes place.\n *\n * @fires ModalDialog#beforemodalfill\n * @fires ModalDialog#modalfill\n *\n * @param { import('./utils/dom').ContentDescriptor} [content]\n * The same rules apply to this as apply to the `content` option.\n */\n fillWith(content) {\n const contentEl = this.contentEl();\n const parentEl = contentEl.parentNode;\n const nextSiblingEl = contentEl.nextSibling;\n\n /**\n * Fired just before a `ModalDialog` is filled with content.\n *\n * @event ModalDialog#beforemodalfill\n * @type {Event}\n */\n this.trigger('beforemodalfill');\n this.hasBeenFilled_ = true;\n\n // Detach the content element from the DOM before performing\n // manipulation to avoid modifying the live DOM multiple times.\n parentEl.removeChild(contentEl);\n this.empty();\n insertContent(contentEl, content);\n /**\n * Fired just after a `ModalDialog` is filled with content.\n *\n * @event ModalDialog#modalfill\n * @type {Event}\n */\n this.trigger('modalfill');\n\n // Re-inject the re-filled content element.\n if (nextSiblingEl) {\n parentEl.insertBefore(contentEl, nextSiblingEl);\n } else {\n parentEl.appendChild(contentEl);\n }\n\n // make sure that the close button is last in the dialog DOM\n const closeButton = this.getChild('closeButton');\n if (closeButton) {\n parentEl.appendChild(closeButton.el_);\n }\n }\n\n /**\n * Empties the content element. This happens anytime the modal is filled.\n *\n * @fires ModalDialog#beforemodalempty\n * @fires ModalDialog#modalempty\n */\n empty() {\n /**\n * Fired just before a `ModalDialog` is emptied.\n *\n * @event ModalDialog#beforemodalempty\n * @type {Event}\n */\n this.trigger('beforemodalempty');\n emptyEl(this.contentEl());\n\n /**\n * Fired just after a `ModalDialog` is emptied.\n *\n * @event ModalDialog#modalempty\n * @type {Event}\n */\n this.trigger('modalempty');\n }\n\n /**\n * Gets or sets the modal content, which gets normalized before being\n * rendered into the DOM.\n *\n * This does not update the DOM or fill the modal, but it is called during\n * that process.\n *\n * @param { import('./utils/dom').ContentDescriptor} [value]\n * If defined, sets the internal content value to be used on the\n * next call(s) to `fill`. This value is normalized before being\n * inserted. To \"clear\" the internal content value, pass `null`.\n *\n * @return { import('./utils/dom').ContentDescriptor}\n * The current content of the modal dialog\n */\n content(value) {\n if (typeof value !== 'undefined') {\n this.content_ = value;\n }\n return this.content_;\n }\n\n /**\n * conditionally focus the modal dialog if focus was previously on the player.\n *\n * @private\n */\n conditionalFocus_() {\n const activeEl = document.activeElement;\n const playerEl = this.player_.el_;\n this.previouslyActiveEl_ = null;\n if (playerEl.contains(activeEl) || playerEl === activeEl) {\n this.previouslyActiveEl_ = activeEl;\n this.focus();\n }\n }\n\n /**\n * conditionally blur the element and refocus the last focused element\n *\n * @private\n */\n conditionalBlur_() {\n if (this.previouslyActiveEl_) {\n this.previouslyActiveEl_.focus();\n this.previouslyActiveEl_ = null;\n }\n }\n\n /**\n * Keydown handler. Attached when modal is focused.\n *\n * @listens keydown\n */\n handleKeyDown(event) {\n // Do not allow keydowns to reach out of the modal dialog.\n event.stopPropagation();\n if (keycode.isEventKey(event, 'Escape') && this.closeable()) {\n event.preventDefault();\n this.close();\n return;\n }\n\n // exit early if it isn't a tab key\n if (!keycode.isEventKey(event, 'Tab')) {\n return;\n }\n const focusableEls = this.focusableEls_();\n const activeEl = this.el_.querySelector(':focus');\n let focusIndex;\n for (let i = 0; i < focusableEls.length; i++) {\n if (activeEl === focusableEls[i]) {\n focusIndex = i;\n break;\n }\n }\n if (document.activeElement === this.el_) {\n focusIndex = 0;\n }\n if (event.shiftKey && focusIndex === 0) {\n focusableEls[focusableEls.length - 1].focus();\n event.preventDefault();\n } else if (!event.shiftKey && focusIndex === focusableEls.length - 1) {\n focusableEls[0].focus();\n event.preventDefault();\n }\n }\n\n /**\n * get all focusable elements\n *\n * @private\n */\n focusableEls_() {\n const allChildren = this.el_.querySelectorAll('*');\n return Array.prototype.filter.call(allChildren, child => {\n return (child instanceof window$1.HTMLAnchorElement || child instanceof window$1.HTMLAreaElement) && child.hasAttribute('href') || (child instanceof window$1.HTMLInputElement || child instanceof window$1.HTMLSelectElement || child instanceof window$1.HTMLTextAreaElement || child instanceof window$1.HTMLButtonElement) && !child.hasAttribute('disabled') || child instanceof window$1.HTMLIFrameElement || child instanceof window$1.HTMLObjectElement || child instanceof window$1.HTMLEmbedElement || child.hasAttribute('tabindex') && child.getAttribute('tabindex') !== -1 || child.hasAttribute('contenteditable');\n });\n }\n}\n\n/**\n * Default options for `ModalDialog` default options.\n *\n * @type {Object}\n * @private\n */\nModalDialog.prototype.options_ = {\n pauseOnOpen: true,\n temporary: true\n};\nComponent$1.registerComponent('ModalDialog', ModalDialog);\n\n/**\n * @file track-list.js\n */\n\n/**\n * Common functionaliy between {@link TextTrackList}, {@link AudioTrackList}, and\n * {@link VideoTrackList}\n *\n * @extends EventTarget\n */\nclass TrackList extends EventTarget$2 {\n /**\n * Create an instance of this class\n *\n * @param { import('./track').default[] } tracks\n * A list of tracks to initialize the list with.\n *\n * @abstract\n */\n constructor(tracks = []) {\n super();\n this.tracks_ = [];\n\n /**\n * @memberof TrackList\n * @member {number} length\n * The current number of `Track`s in the this Trackist.\n * @instance\n */\n Object.defineProperty(this, 'length', {\n get() {\n return this.tracks_.length;\n }\n });\n for (let i = 0; i < tracks.length; i++) {\n this.addTrack(tracks[i]);\n }\n }\n\n /**\n * Add a {@link Track} to the `TrackList`\n *\n * @param { import('./track').default } track\n * The audio, video, or text track to add to the list.\n *\n * @fires TrackList#addtrack\n */\n addTrack(track) {\n const index = this.tracks_.length;\n if (!('' + index in this)) {\n Object.defineProperty(this, index, {\n get() {\n return this.tracks_[index];\n }\n });\n }\n\n // Do not add duplicate tracks\n if (this.tracks_.indexOf(track) === -1) {\n this.tracks_.push(track);\n /**\n * Triggered when a track is added to a track list.\n *\n * @event TrackList#addtrack\n * @type {Event}\n * @property {Track} track\n * A reference to track that was added.\n */\n this.trigger({\n track,\n type: 'addtrack',\n target: this\n });\n }\n\n /**\n * Triggered when a track label is changed.\n *\n * @event TrackList#addtrack\n * @type {Event}\n * @property {Track} track\n * A reference to track that was added.\n */\n track.labelchange_ = () => {\n this.trigger({\n track,\n type: 'labelchange',\n target: this\n });\n };\n if (isEvented(track)) {\n track.addEventListener('labelchange', track.labelchange_);\n }\n }\n\n /**\n * Remove a {@link Track} from the `TrackList`\n *\n * @param { import('./track').default } rtrack\n * The audio, video, or text track to remove from the list.\n *\n * @fires TrackList#removetrack\n */\n removeTrack(rtrack) {\n let track;\n for (let i = 0, l = this.length; i < l; i++) {\n if (this[i] === rtrack) {\n track = this[i];\n if (track.off) {\n track.off();\n }\n this.tracks_.splice(i, 1);\n break;\n }\n }\n if (!track) {\n return;\n }\n\n /**\n * Triggered when a track is removed from track list.\n *\n * @event TrackList#removetrack\n * @type {Event}\n * @property {Track} track\n * A reference to track that was removed.\n */\n this.trigger({\n track,\n type: 'removetrack',\n target: this\n });\n }\n\n /**\n * Get a Track from the TrackList by a tracks id\n *\n * @param {string} id - the id of the track to get\n * @method getTrackById\n * @return { import('./track').default }\n * @private\n */\n getTrackById(id) {\n let result = null;\n for (let i = 0, l = this.length; i < l; i++) {\n const track = this[i];\n if (track.id === id) {\n result = track;\n break;\n }\n }\n return result;\n }\n}\n\n/**\n * Triggered when a different track is selected/enabled.\n *\n * @event TrackList#change\n * @type {Event}\n */\n\n/**\n * Events that can be called with on + eventName. See {@link EventHandler}.\n *\n * @property {Object} TrackList#allowedEvents_\n * @protected\n */\nTrackList.prototype.allowedEvents_ = {\n change: 'change',\n addtrack: 'addtrack',\n removetrack: 'removetrack',\n labelchange: 'labelchange'\n};\n\n// emulate attribute EventHandler support to allow for feature detection\nfor (const event in TrackList.prototype.allowedEvents_) {\n TrackList.prototype['on' + event] = null;\n}\n\n/**\n * @file audio-track-list.js\n */\n\n/**\n * Anywhere we call this function we diverge from the spec\n * as we only support one enabled audiotrack at a time\n *\n * @param {AudioTrackList} list\n * list to work on\n *\n * @param { import('./audio-track').default } track\n * The track to skip\n *\n * @private\n */\nconst disableOthers$1 = function (list, track) {\n for (let i = 0; i < list.length; i++) {\n if (!Object.keys(list[i]).length || track.id === list[i].id) {\n continue;\n }\n // another audio track is enabled, disable it\n list[i].enabled = false;\n }\n};\n\n/**\n * The current list of {@link AudioTrack} for a media file.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotracklist}\n * @extends TrackList\n */\nclass AudioTrackList extends TrackList {\n /**\n * Create an instance of this class.\n *\n * @param { import('./audio-track').default[] } [tracks=[]]\n * A list of `AudioTrack` to instantiate the list with.\n */\n constructor(tracks = []) {\n // make sure only 1 track is enabled\n // sorted from last index to first index\n for (let i = tracks.length - 1; i >= 0; i--) {\n if (tracks[i].enabled) {\n disableOthers$1(tracks, tracks[i]);\n break;\n }\n }\n super(tracks);\n this.changing_ = false;\n }\n\n /**\n * Add an {@link AudioTrack} to the `AudioTrackList`.\n *\n * @param { import('./audio-track').default } track\n * The AudioTrack to add to the list\n *\n * @fires TrackList#addtrack\n */\n addTrack(track) {\n if (track.enabled) {\n disableOthers$1(this, track);\n }\n super.addTrack(track);\n // native tracks don't have this\n if (!track.addEventListener) {\n return;\n }\n track.enabledChange_ = () => {\n // when we are disabling other tracks (since we don't support\n // more than one track at a time) we will set changing_\n // to true so that we don't trigger additional change events\n if (this.changing_) {\n return;\n }\n this.changing_ = true;\n disableOthers$1(this, track);\n this.changing_ = false;\n this.trigger('change');\n };\n\n /**\n * @listens AudioTrack#enabledchange\n * @fires TrackList#change\n */\n track.addEventListener('enabledchange', track.enabledChange_);\n }\n removeTrack(rtrack) {\n super.removeTrack(rtrack);\n if (rtrack.removeEventListener && rtrack.enabledChange_) {\n rtrack.removeEventListener('enabledchange', rtrack.enabledChange_);\n rtrack.enabledChange_ = null;\n }\n }\n}\n\n/**\n * @file video-track-list.js\n */\n\n/**\n * Un-select all other {@link VideoTrack}s that are selected.\n *\n * @param {VideoTrackList} list\n * list to work on\n *\n * @param { import('./video-track').default } track\n * The track to skip\n *\n * @private\n */\nconst disableOthers = function (list, track) {\n for (let i = 0; i < list.length; i++) {\n if (!Object.keys(list[i]).length || track.id === list[i].id) {\n continue;\n }\n // another video track is enabled, disable it\n list[i].selected = false;\n }\n};\n\n/**\n * The current list of {@link VideoTrack} for a video.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#videotracklist}\n * @extends TrackList\n */\nclass VideoTrackList extends TrackList {\n /**\n * Create an instance of this class.\n *\n * @param {VideoTrack[]} [tracks=[]]\n * A list of `VideoTrack` to instantiate the list with.\n */\n constructor(tracks = []) {\n // make sure only 1 track is enabled\n // sorted from last index to first index\n for (let i = tracks.length - 1; i >= 0; i--) {\n if (tracks[i].selected) {\n disableOthers(tracks, tracks[i]);\n break;\n }\n }\n super(tracks);\n this.changing_ = false;\n\n /**\n * @member {number} VideoTrackList#selectedIndex\n * The current index of the selected {@link VideoTrack`}.\n */\n Object.defineProperty(this, 'selectedIndex', {\n get() {\n for (let i = 0; i < this.length; i++) {\n if (this[i].selected) {\n return i;\n }\n }\n return -1;\n },\n set() {}\n });\n }\n\n /**\n * Add a {@link VideoTrack} to the `VideoTrackList`.\n *\n * @param { import('./video-track').default } track\n * The VideoTrack to add to the list\n *\n * @fires TrackList#addtrack\n */\n addTrack(track) {\n if (track.selected) {\n disableOthers(this, track);\n }\n super.addTrack(track);\n // native tracks don't have this\n if (!track.addEventListener) {\n return;\n }\n track.selectedChange_ = () => {\n if (this.changing_) {\n return;\n }\n this.changing_ = true;\n disableOthers(this, track);\n this.changing_ = false;\n this.trigger('change');\n };\n\n /**\n * @listens VideoTrack#selectedchange\n * @fires TrackList#change\n */\n track.addEventListener('selectedchange', track.selectedChange_);\n }\n removeTrack(rtrack) {\n super.removeTrack(rtrack);\n if (rtrack.removeEventListener && rtrack.selectedChange_) {\n rtrack.removeEventListener('selectedchange', rtrack.selectedChange_);\n rtrack.selectedChange_ = null;\n }\n }\n}\n\n/**\n * @file text-track-list.js\n */\n\n/**\n * The current list of {@link TextTrack} for a media file.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttracklist}\n * @extends TrackList\n */\nclass TextTrackList extends TrackList {\n /**\n * Add a {@link TextTrack} to the `TextTrackList`\n *\n * @param { import('./text-track').default } track\n * The text track to add to the list.\n *\n * @fires TrackList#addtrack\n */\n addTrack(track) {\n super.addTrack(track);\n if (!this.queueChange_) {\n this.queueChange_ = () => this.queueTrigger('change');\n }\n if (!this.triggerSelectedlanguagechange) {\n this.triggerSelectedlanguagechange_ = () => this.trigger('selectedlanguagechange');\n }\n\n /**\n * @listens TextTrack#modechange\n * @fires TrackList#change\n */\n track.addEventListener('modechange', this.queueChange_);\n const nonLanguageTextTrackKind = ['metadata', 'chapters'];\n if (nonLanguageTextTrackKind.indexOf(track.kind) === -1) {\n track.addEventListener('modechange', this.triggerSelectedlanguagechange_);\n }\n }\n removeTrack(rtrack) {\n super.removeTrack(rtrack);\n\n // manually remove the event handlers we added\n if (rtrack.removeEventListener) {\n if (this.queueChange_) {\n rtrack.removeEventListener('modechange', this.queueChange_);\n }\n if (this.selectedlanguagechange_) {\n rtrack.removeEventListener('modechange', this.triggerSelectedlanguagechange_);\n }\n }\n }\n}\n\n/**\n * @file html-track-element-list.js\n */\n\n/**\n * The current list of {@link HtmlTrackElement}s.\n */\nclass HtmlTrackElementList {\n /**\n * Create an instance of this class.\n *\n * @param {HtmlTrackElement[]} [tracks=[]]\n * A list of `HtmlTrackElement` to instantiate the list with.\n */\n constructor(trackElements = []) {\n this.trackElements_ = [];\n\n /**\n * @memberof HtmlTrackElementList\n * @member {number} length\n * The current number of `Track`s in the this Trackist.\n * @instance\n */\n Object.defineProperty(this, 'length', {\n get() {\n return this.trackElements_.length;\n }\n });\n for (let i = 0, length = trackElements.length; i < length; i++) {\n this.addTrackElement_(trackElements[i]);\n }\n }\n\n /**\n * Add an {@link HtmlTrackElement} to the `HtmlTrackElementList`\n *\n * @param {HtmlTrackElement} trackElement\n * The track element to add to the list.\n *\n * @private\n */\n addTrackElement_(trackElement) {\n const index = this.trackElements_.length;\n if (!('' + index in this)) {\n Object.defineProperty(this, index, {\n get() {\n return this.trackElements_[index];\n }\n });\n }\n\n // Do not add duplicate elements\n if (this.trackElements_.indexOf(trackElement) === -1) {\n this.trackElements_.push(trackElement);\n }\n }\n\n /**\n * Get an {@link HtmlTrackElement} from the `HtmlTrackElementList` given an\n * {@link TextTrack}.\n *\n * @param {TextTrack} track\n * The track associated with a track element.\n *\n * @return {HtmlTrackElement|undefined}\n * The track element that was found or undefined.\n *\n * @private\n */\n getTrackElementByTrack_(track) {\n let trackElement_;\n for (let i = 0, length = this.trackElements_.length; i < length; i++) {\n if (track === this.trackElements_[i].track) {\n trackElement_ = this.trackElements_[i];\n break;\n }\n }\n return trackElement_;\n }\n\n /**\n * Remove a {@link HtmlTrackElement} from the `HtmlTrackElementList`\n *\n * @param {HtmlTrackElement} trackElement\n * The track element to remove from the list.\n *\n * @private\n */\n removeTrackElement_(trackElement) {\n for (let i = 0, length = this.trackElements_.length; i < length; i++) {\n if (trackElement === this.trackElements_[i]) {\n if (this.trackElements_[i].track && typeof this.trackElements_[i].track.off === 'function') {\n this.trackElements_[i].track.off();\n }\n if (typeof this.trackElements_[i].off === 'function') {\n this.trackElements_[i].off();\n }\n this.trackElements_.splice(i, 1);\n break;\n }\n }\n }\n}\n\n/**\n * @file text-track-cue-list.js\n */\n\n/**\n * @typedef {Object} TextTrackCueList~TextTrackCue\n *\n * @property {string} id\n * The unique id for this text track cue\n *\n * @property {number} startTime\n * The start time for this text track cue\n *\n * @property {number} endTime\n * The end time for this text track cue\n *\n * @property {boolean} pauseOnExit\n * Pause when the end time is reached if true.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackcue}\n */\n\n/**\n * A List of TextTrackCues.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackcuelist}\n */\nclass TextTrackCueList {\n /**\n * Create an instance of this class..\n *\n * @param {Array} cues\n * A list of cues to be initialized with\n */\n constructor(cues) {\n TextTrackCueList.prototype.setCues_.call(this, cues);\n\n /**\n * @memberof TextTrackCueList\n * @member {number} length\n * The current number of `TextTrackCue`s in the TextTrackCueList.\n * @instance\n */\n Object.defineProperty(this, 'length', {\n get() {\n return this.length_;\n }\n });\n }\n\n /**\n * A setter for cues in this list. Creates getters\n * an an index for the cues.\n *\n * @param {Array} cues\n * An array of cues to set\n *\n * @private\n */\n setCues_(cues) {\n const oldLength = this.length || 0;\n let i = 0;\n const l = cues.length;\n this.cues_ = cues;\n this.length_ = cues.length;\n const defineProp = function (index) {\n if (!('' + index in this)) {\n Object.defineProperty(this, '' + index, {\n get() {\n return this.cues_[index];\n }\n });\n }\n };\n if (oldLength < l) {\n i = oldLength;\n for (; i < l; i++) {\n defineProp.call(this, i);\n }\n }\n }\n\n /**\n * Get a `TextTrackCue` that is currently in the `TextTrackCueList` by id.\n *\n * @param {string} id\n * The id of the cue that should be searched for.\n *\n * @return {TextTrackCueList~TextTrackCue|null}\n * A single cue or null if none was found.\n */\n getCueById(id) {\n let result = null;\n for (let i = 0, l = this.length; i < l; i++) {\n const cue = this[i];\n if (cue.id === id) {\n result = cue;\n break;\n }\n }\n return result;\n }\n}\n\n/**\n * @file track-kinds.js\n */\n\n/**\n * All possible `VideoTrackKind`s\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-videotrack-kind\n * @typedef VideoTrack~Kind\n * @enum\n */\nconst VideoTrackKind = {\n alternative: 'alternative',\n captions: 'captions',\n main: 'main',\n sign: 'sign',\n subtitles: 'subtitles',\n commentary: 'commentary'\n};\n\n/**\n * All possible `AudioTrackKind`s\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-audiotrack-kind\n * @typedef AudioTrack~Kind\n * @enum\n */\nconst AudioTrackKind = {\n 'alternative': 'alternative',\n 'descriptions': 'descriptions',\n 'main': 'main',\n 'main-desc': 'main-desc',\n 'translation': 'translation',\n 'commentary': 'commentary'\n};\n\n/**\n * All possible `TextTrackKind`s\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-texttrack-kind\n * @typedef TextTrack~Kind\n * @enum\n */\nconst TextTrackKind = {\n subtitles: 'subtitles',\n captions: 'captions',\n descriptions: 'descriptions',\n chapters: 'chapters',\n metadata: 'metadata'\n};\n\n/**\n * All possible `TextTrackMode`s\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackmode\n * @typedef TextTrack~Mode\n * @enum\n */\nconst TextTrackMode = {\n disabled: 'disabled',\n hidden: 'hidden',\n showing: 'showing'\n};\n\n/**\n * @file track.js\n */\n\n/**\n * A Track class that contains all of the common functionality for {@link AudioTrack},\n * {@link VideoTrack}, and {@link TextTrack}.\n *\n * > Note: This class should not be used directly\n *\n * @see {@link https://html.spec.whatwg.org/multipage/embedded-content.html}\n * @extends EventTarget\n * @abstract\n */\nclass Track extends EventTarget$2 {\n /**\n * Create an instance of this class.\n *\n * @param {Object} [options={}]\n * Object of option names and values\n *\n * @param {string} [options.kind='']\n * A valid kind for the track type you are creating.\n *\n * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n * A unique id for this AudioTrack.\n *\n * @param {string} [options.label='']\n * The menu label for this track.\n *\n * @param {string} [options.language='']\n * A valid two character language code.\n *\n * @abstract\n */\n constructor(options = {}) {\n super();\n const trackProps = {\n id: options.id || 'vjs_track_' + newGUID(),\n kind: options.kind || '',\n language: options.language || ''\n };\n let label = options.label || '';\n\n /**\n * @memberof Track\n * @member {string} id\n * The id of this track. Cannot be changed after creation.\n * @instance\n *\n * @readonly\n */\n\n /**\n * @memberof Track\n * @member {string} kind\n * The kind of track that this is. Cannot be changed after creation.\n * @instance\n *\n * @readonly\n */\n\n /**\n * @memberof Track\n * @member {string} language\n * The two letter language code for this track. Cannot be changed after\n * creation.\n * @instance\n *\n * @readonly\n */\n\n for (const key in trackProps) {\n Object.defineProperty(this, key, {\n get() {\n return trackProps[key];\n },\n set() {}\n });\n }\n\n /**\n * @memberof Track\n * @member {string} label\n * The label of this track. Cannot be changed after creation.\n * @instance\n *\n * @fires Track#labelchange\n */\n Object.defineProperty(this, 'label', {\n get() {\n return label;\n },\n set(newLabel) {\n if (newLabel !== label) {\n label = newLabel;\n\n /**\n * An event that fires when label changes on this track.\n *\n * > Note: This is not part of the spec!\n *\n * @event Track#labelchange\n * @type {Event}\n */\n this.trigger('labelchange');\n }\n }\n });\n }\n}\n\n/**\n * @file url.js\n * @module url\n */\n\n/**\n * @typedef {Object} url:URLObject\n *\n * @property {string} protocol\n * The protocol of the url that was parsed.\n *\n * @property {string} hostname\n * The hostname of the url that was parsed.\n *\n * @property {string} port\n * The port of the url that was parsed.\n *\n * @property {string} pathname\n * The pathname of the url that was parsed.\n *\n * @property {string} search\n * The search query of the url that was parsed.\n *\n * @property {string} hash\n * The hash of the url that was parsed.\n *\n * @property {string} host\n * The host of the url that was parsed.\n */\n\n/**\n * Resolve and parse the elements of a URL.\n *\n * @function\n * @param {String} url\n * The url to parse\n *\n * @return {url:URLObject}\n * An object of url details\n */\nconst parseUrl = function (url) {\n // This entire method can be replace with URL once we are able to drop IE11\n\n const props = ['protocol', 'hostname', 'port', 'pathname', 'search', 'hash', 'host'];\n\n // add the url to an anchor and let the browser parse the URL\n const a = document.createElement('a');\n a.href = url;\n\n // Copy the specific URL properties to a new object\n // This is also needed for IE because the anchor loses its\n // properties when it's removed from the dom\n const details = {};\n for (let i = 0; i < props.length; i++) {\n details[props[i]] = a[props[i]];\n }\n\n // IE adds the port to the host property unlike everyone else. If\n // a port identifier is added for standard ports, strip it.\n if (details.protocol === 'http:') {\n details.host = details.host.replace(/:80$/, '');\n }\n if (details.protocol === 'https:') {\n details.host = details.host.replace(/:443$/, '');\n }\n if (!details.protocol) {\n details.protocol = window$1.location.protocol;\n }\n\n /* istanbul ignore if */\n if (!details.host) {\n details.host = window$1.location.host;\n }\n return details;\n};\n\n/**\n * Get absolute version of relative URL.\n *\n * @function\n * @param {string} url\n * URL to make absolute\n *\n * @return {string}\n * Absolute URL\n *\n * @see http://stackoverflow.com/questions/470832/getting-an-absolute-url-from-a-relative-one-ie6-issue\n */\nconst getAbsoluteURL = function (url) {\n // Check if absolute URL\n if (!url.match(/^https?:\\/\\//)) {\n // Add the url to an anchor and let the browser parse it to convert to an absolute url\n const a = document.createElement('a');\n a.href = url;\n url = a.href;\n }\n return url;\n};\n\n/**\n * Returns the extension of the passed file name. It will return an empty string\n * if passed an invalid path.\n *\n * @function\n * @param {string} path\n * The fileName path like '/path/to/file.mp4'\n *\n * @return {string}\n * The extension in lower case or an empty string if no\n * extension could be found.\n */\nconst getFileExtension = function (path) {\n if (typeof path === 'string') {\n const splitPathRe = /^(\\/?)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?)(\\.([^\\.\\/\\?]+)))(?:[\\/]*|[\\?].*)$/;\n const pathParts = splitPathRe.exec(path);\n if (pathParts) {\n return pathParts.pop().toLowerCase();\n }\n }\n return '';\n};\n\n/**\n * Returns whether the url passed is a cross domain request or not.\n *\n * @function\n * @param {string} url\n * The url to check.\n *\n * @param {Object} [winLoc]\n * the domain to check the url against, defaults to window.location\n *\n * @param {string} [winLoc.protocol]\n * The window location protocol defaults to window.location.protocol\n *\n * @param {string} [winLoc.host]\n * The window location host defaults to window.location.host\n *\n * @return {boolean}\n * Whether it is a cross domain request or not.\n */\nconst isCrossOrigin = function (url, winLoc = window$1.location) {\n const urlInfo = parseUrl(url);\n\n // IE8 protocol relative urls will return ':' for protocol\n const srcProtocol = urlInfo.protocol === ':' ? winLoc.protocol : urlInfo.protocol;\n\n // Check if url is for another domain/origin\n // IE8 doesn't know location.origin, so we won't rely on it here\n const crossOrigin = srcProtocol + urlInfo.host !== winLoc.protocol + winLoc.host;\n return crossOrigin;\n};\n\nvar Url = /*#__PURE__*/Object.freeze({\n __proto__: null,\n parseUrl: parseUrl,\n getAbsoluteURL: getAbsoluteURL,\n getFileExtension: getFileExtension,\n isCrossOrigin: isCrossOrigin\n});\n\n/**\n * @file text-track.js\n */\n\n/**\n * Takes a webvtt file contents and parses it into cues\n *\n * @param {string} srcContent\n * webVTT file contents\n *\n * @param {TextTrack} track\n * TextTrack to add cues to. Cues come from the srcContent.\n *\n * @private\n */\nconst parseCues = function (srcContent, track) {\n const parser = new window$1.WebVTT.Parser(window$1, window$1.vttjs, window$1.WebVTT.StringDecoder());\n const errors = [];\n parser.oncue = function (cue) {\n track.addCue(cue);\n };\n parser.onparsingerror = function (error) {\n errors.push(error);\n };\n parser.onflush = function () {\n track.trigger({\n type: 'loadeddata',\n target: track\n });\n };\n parser.parse(srcContent);\n if (errors.length > 0) {\n if (window$1.console && window$1.console.groupCollapsed) {\n window$1.console.groupCollapsed(`Text Track parsing errors for ${track.src}`);\n }\n errors.forEach(error => log$1.error(error));\n if (window$1.console && window$1.console.groupEnd) {\n window$1.console.groupEnd();\n }\n }\n parser.flush();\n};\n\n/**\n * Load a `TextTrack` from a specified url.\n *\n * @param {string} src\n * Url to load track from.\n *\n * @param {TextTrack} track\n * Track to add cues to. Comes from the content at the end of `url`.\n *\n * @private\n */\nconst loadTrack = function (src, track) {\n const opts = {\n uri: src\n };\n const crossOrigin = isCrossOrigin(src);\n if (crossOrigin) {\n opts.cors = crossOrigin;\n }\n const withCredentials = track.tech_.crossOrigin() === 'use-credentials';\n if (withCredentials) {\n opts.withCredentials = withCredentials;\n }\n XHR(opts, bind_(this, function (err, response, responseBody) {\n if (err) {\n return log$1.error(err, response);\n }\n track.loaded_ = true;\n\n // Make sure that vttjs has loaded, otherwise, wait till it finished loading\n // NOTE: this is only used for the alt/video.novtt.js build\n if (typeof window$1.WebVTT !== 'function') {\n if (track.tech_) {\n // to prevent use before define eslint error, we define loadHandler\n // as a let here\n track.tech_.any(['vttjsloaded', 'vttjserror'], event => {\n if (event.type === 'vttjserror') {\n log$1.error(`vttjs failed to load, stopping trying to process ${track.src}`);\n return;\n }\n return parseCues(responseBody, track);\n });\n }\n } else {\n parseCues(responseBody, track);\n }\n }));\n};\n\n/**\n * A representation of a single `TextTrack`.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttrack}\n * @extends Track\n */\nclass TextTrack extends Track {\n /**\n * Create an instance of this class.\n *\n * @param {Object} options={}\n * Object of option names and values\n *\n * @param { import('../tech/tech').default } options.tech\n * A reference to the tech that owns this TextTrack.\n *\n * @param {TextTrack~Kind} [options.kind='subtitles']\n * A valid text track kind.\n *\n * @param {TextTrack~Mode} [options.mode='disabled']\n * A valid text track mode.\n *\n * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n * A unique id for this TextTrack.\n *\n * @param {string} [options.label='']\n * The menu label for this track.\n *\n * @param {string} [options.language='']\n * A valid two character language code.\n *\n * @param {string} [options.srclang='']\n * A valid two character language code. An alternative, but deprioritized\n * version of `options.language`\n *\n * @param {string} [options.src]\n * A url to TextTrack cues.\n *\n * @param {boolean} [options.default]\n * If this track should default to on or off.\n */\n constructor(options = {}) {\n if (!options.tech) {\n throw new Error('A tech was not provided.');\n }\n const settings = merge$1(options, {\n kind: TextTrackKind[options.kind] || 'subtitles',\n language: options.language || options.srclang || ''\n });\n let mode = TextTrackMode[settings.mode] || 'disabled';\n const default_ = settings.default;\n if (settings.kind === 'metadata' || settings.kind === 'chapters') {\n mode = 'hidden';\n }\n super(settings);\n this.tech_ = settings.tech;\n this.cues_ = [];\n this.activeCues_ = [];\n this.preload_ = this.tech_.preloadTextTracks !== false;\n const cues = new TextTrackCueList(this.cues_);\n const activeCues = new TextTrackCueList(this.activeCues_);\n let changed = false;\n this.timeupdateHandler = bind_(this, function (event = {}) {\n if (this.tech_.isDisposed()) {\n return;\n }\n if (!this.tech_.isReady_) {\n if (event.type !== 'timeupdate') {\n this.rvf_ = this.tech_.requestVideoFrameCallback(this.timeupdateHandler);\n }\n return;\n }\n\n // Accessing this.activeCues for the side-effects of updating itself\n // due to its nature as a getter function. Do not remove or cues will\n // stop updating!\n // Use the setter to prevent deletion from uglify (pure_getters rule)\n this.activeCues = this.activeCues;\n if (changed) {\n this.trigger('cuechange');\n changed = false;\n }\n if (event.type !== 'timeupdate') {\n this.rvf_ = this.tech_.requestVideoFrameCallback(this.timeupdateHandler);\n }\n });\n const disposeHandler = () => {\n this.stopTracking();\n };\n this.tech_.one('dispose', disposeHandler);\n if (mode !== 'disabled') {\n this.startTracking();\n }\n Object.defineProperties(this, {\n /**\n * @memberof TextTrack\n * @member {boolean} default\n * If this track was set to be on or off by default. Cannot be changed after\n * creation.\n * @instance\n *\n * @readonly\n */\n default: {\n get() {\n return default_;\n },\n set() {}\n },\n /**\n * @memberof TextTrack\n * @member {string} mode\n * Set the mode of this TextTrack to a valid {@link TextTrack~Mode}. Will\n * not be set if setting to an invalid mode.\n * @instance\n *\n * @fires TextTrack#modechange\n */\n mode: {\n get() {\n return mode;\n },\n set(newMode) {\n if (!TextTrackMode[newMode]) {\n return;\n }\n if (mode === newMode) {\n return;\n }\n mode = newMode;\n if (!this.preload_ && mode !== 'disabled' && this.cues.length === 0) {\n // On-demand load.\n loadTrack(this.src, this);\n }\n this.stopTracking();\n if (mode !== 'disabled') {\n this.startTracking();\n }\n /**\n * An event that fires when mode changes on this track. This allows\n * the TextTrackList that holds this track to act accordingly.\n *\n * > Note: This is not part of the spec!\n *\n * @event TextTrack#modechange\n * @type {Event}\n */\n this.trigger('modechange');\n }\n },\n /**\n * @memberof TextTrack\n * @member {TextTrackCueList} cues\n * The text track cue list for this TextTrack.\n * @instance\n */\n cues: {\n get() {\n if (!this.loaded_) {\n return null;\n }\n return cues;\n },\n set() {}\n },\n /**\n * @memberof TextTrack\n * @member {TextTrackCueList} activeCues\n * The list text track cues that are currently active for this TextTrack.\n * @instance\n */\n activeCues: {\n get() {\n if (!this.loaded_) {\n return null;\n }\n\n // nothing to do\n if (this.cues.length === 0) {\n return activeCues;\n }\n const ct = this.tech_.currentTime();\n const active = [];\n for (let i = 0, l = this.cues.length; i < l; i++) {\n const cue = this.cues[i];\n if (cue.startTime <= ct && cue.endTime >= ct) {\n active.push(cue);\n }\n }\n changed = false;\n if (active.length !== this.activeCues_.length) {\n changed = true;\n } else {\n for (let i = 0; i < active.length; i++) {\n if (this.activeCues_.indexOf(active[i]) === -1) {\n changed = true;\n }\n }\n }\n this.activeCues_ = active;\n activeCues.setCues_(this.activeCues_);\n return activeCues;\n },\n // /!\\ Keep this setter empty (see the timeupdate handler above)\n set() {}\n }\n });\n if (settings.src) {\n this.src = settings.src;\n if (!this.preload_) {\n // Tracks will load on-demand.\n // Act like we're loaded for other purposes.\n this.loaded_ = true;\n }\n if (this.preload_ || settings.kind !== 'subtitles' && settings.kind !== 'captions') {\n loadTrack(this.src, this);\n }\n } else {\n this.loaded_ = true;\n }\n }\n startTracking() {\n // More precise cues based on requestVideoFrameCallback with a requestAnimationFram fallback\n this.rvf_ = this.tech_.requestVideoFrameCallback(this.timeupdateHandler);\n // Also listen to timeupdate in case rVFC/rAF stops (window in background, audio in video el)\n this.tech_.on('timeupdate', this.timeupdateHandler);\n }\n stopTracking() {\n if (this.rvf_) {\n this.tech_.cancelVideoFrameCallback(this.rvf_);\n this.rvf_ = undefined;\n }\n this.tech_.off('timeupdate', this.timeupdateHandler);\n }\n\n /**\n * Add a cue to the internal list of cues.\n *\n * @param {TextTrack~Cue} cue\n * The cue to add to our internal list\n */\n addCue(originalCue) {\n let cue = originalCue;\n\n // Testing if the cue is a VTTCue in a way that survives minification\n if (!('getCueAsHTML' in cue)) {\n cue = new window$1.vttjs.VTTCue(originalCue.startTime, originalCue.endTime, originalCue.text);\n for (const prop in originalCue) {\n if (!(prop in cue)) {\n cue[prop] = originalCue[prop];\n }\n }\n\n // make sure that `id` is copied over\n cue.id = originalCue.id;\n cue.originalCue_ = originalCue;\n }\n const tracks = this.tech_.textTracks();\n for (let i = 0; i < tracks.length; i++) {\n if (tracks[i] !== this) {\n tracks[i].removeCue(cue);\n }\n }\n this.cues_.push(cue);\n this.cues.setCues_(this.cues_);\n }\n\n /**\n * Remove a cue from our internal list\n *\n * @param {TextTrack~Cue} removeCue\n * The cue to remove from our internal list\n */\n removeCue(removeCue) {\n let i = this.cues_.length;\n while (i--) {\n const cue = this.cues_[i];\n if (cue === removeCue || cue.originalCue_ && cue.originalCue_ === removeCue) {\n this.cues_.splice(i, 1);\n this.cues.setCues_(this.cues_);\n break;\n }\n }\n }\n}\n\n/**\n * cuechange - One or more cues in the track have become active or stopped being active.\n * @protected\n */\nTextTrack.prototype.allowedEvents_ = {\n cuechange: 'cuechange'\n};\n\n/**\n * A representation of a single `AudioTrack`. If it is part of an {@link AudioTrackList}\n * only one `AudioTrack` in the list will be enabled at a time.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotrack}\n * @extends Track\n */\nclass AudioTrack extends Track {\n /**\n * Create an instance of this class.\n *\n * @param {Object} [options={}]\n * Object of option names and values\n *\n * @param {AudioTrack~Kind} [options.kind='']\n * A valid audio track kind\n *\n * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n * A unique id for this AudioTrack.\n *\n * @param {string} [options.label='']\n * The menu label for this track.\n *\n * @param {string} [options.language='']\n * A valid two character language code.\n *\n * @param {boolean} [options.enabled]\n * If this track is the one that is currently playing. If this track is part of\n * an {@link AudioTrackList}, only one {@link AudioTrack} will be enabled.\n */\n constructor(options = {}) {\n const settings = merge$1(options, {\n kind: AudioTrackKind[options.kind] || ''\n });\n super(settings);\n let enabled = false;\n\n /**\n * @memberof AudioTrack\n * @member {boolean} enabled\n * If this `AudioTrack` is enabled or not. When setting this will\n * fire {@link AudioTrack#enabledchange} if the state of enabled is changed.\n * @instance\n *\n * @fires VideoTrack#selectedchange\n */\n Object.defineProperty(this, 'enabled', {\n get() {\n return enabled;\n },\n set(newEnabled) {\n // an invalid or unchanged value\n if (typeof newEnabled !== 'boolean' || newEnabled === enabled) {\n return;\n }\n enabled = newEnabled;\n\n /**\n * An event that fires when enabled changes on this track. This allows\n * the AudioTrackList that holds this track to act accordingly.\n *\n * > Note: This is not part of the spec! Native tracks will do\n * this internally without an event.\n *\n * @event AudioTrack#enabledchange\n * @type {Event}\n */\n this.trigger('enabledchange');\n }\n });\n\n // if the user sets this track to selected then\n // set selected to that true value otherwise\n // we keep it false\n if (settings.enabled) {\n this.enabled = settings.enabled;\n }\n this.loaded_ = true;\n }\n}\n\n/**\n * A representation of a single `VideoTrack`.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#videotrack}\n * @extends Track\n */\nclass VideoTrack extends Track {\n /**\n * Create an instance of this class.\n *\n * @param {Object} [options={}]\n * Object of option names and values\n *\n * @param {string} [options.kind='']\n * A valid {@link VideoTrack~Kind}\n *\n * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n * A unique id for this AudioTrack.\n *\n * @param {string} [options.label='']\n * The menu label for this track.\n *\n * @param {string} [options.language='']\n * A valid two character language code.\n *\n * @param {boolean} [options.selected]\n * If this track is the one that is currently playing.\n */\n constructor(options = {}) {\n const settings = merge$1(options, {\n kind: VideoTrackKind[options.kind] || ''\n });\n super(settings);\n let selected = false;\n\n /**\n * @memberof VideoTrack\n * @member {boolean} selected\n * If this `VideoTrack` is selected or not. When setting this will\n * fire {@link VideoTrack#selectedchange} if the state of selected changed.\n * @instance\n *\n * @fires VideoTrack#selectedchange\n */\n Object.defineProperty(this, 'selected', {\n get() {\n return selected;\n },\n set(newSelected) {\n // an invalid or unchanged value\n if (typeof newSelected !== 'boolean' || newSelected === selected) {\n return;\n }\n selected = newSelected;\n\n /**\n * An event that fires when selected changes on this track. This allows\n * the VideoTrackList that holds this track to act accordingly.\n *\n * > Note: This is not part of the spec! Native tracks will do\n * this internally without an event.\n *\n * @event VideoTrack#selectedchange\n * @type {Event}\n */\n this.trigger('selectedchange');\n }\n });\n\n // if the user sets this track to selected then\n // set selected to that true value otherwise\n // we keep it false\n if (settings.selected) {\n this.selected = settings.selected;\n }\n }\n}\n\n/**\n * @file html-track-element.js\n */\n\n/**\n * A single track represented in the DOM.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#htmltrackelement}\n * @extends EventTarget\n */\nclass HTMLTrackElement extends EventTarget$2 {\n /**\n * Create an instance of this class.\n *\n * @param {Object} options={}\n * Object of option names and values\n *\n * @param { import('../tech/tech').default } options.tech\n * A reference to the tech that owns this HTMLTrackElement.\n *\n * @param {TextTrack~Kind} [options.kind='subtitles']\n * A valid text track kind.\n *\n * @param {TextTrack~Mode} [options.mode='disabled']\n * A valid text track mode.\n *\n * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n * A unique id for this TextTrack.\n *\n * @param {string} [options.label='']\n * The menu label for this track.\n *\n * @param {string} [options.language='']\n * A valid two character language code.\n *\n * @param {string} [options.srclang='']\n * A valid two character language code. An alternative, but deprioritized\n * version of `options.language`\n *\n * @param {string} [options.src]\n * A url to TextTrack cues.\n *\n * @param {boolean} [options.default]\n * If this track should default to on or off.\n */\n constructor(options = {}) {\n super();\n let readyState;\n const track = new TextTrack(options);\n this.kind = track.kind;\n this.src = track.src;\n this.srclang = track.language;\n this.label = track.label;\n this.default = track.default;\n Object.defineProperties(this, {\n /**\n * @memberof HTMLTrackElement\n * @member {HTMLTrackElement~ReadyState} readyState\n * The current ready state of the track element.\n * @instance\n */\n readyState: {\n get() {\n return readyState;\n }\n },\n /**\n * @memberof HTMLTrackElement\n * @member {TextTrack} track\n * The underlying TextTrack object.\n * @instance\n *\n */\n track: {\n get() {\n return track;\n }\n }\n });\n readyState = HTMLTrackElement.NONE;\n\n /**\n * @listens TextTrack#loadeddata\n * @fires HTMLTrackElement#load\n */\n track.addEventListener('loadeddata', () => {\n readyState = HTMLTrackElement.LOADED;\n this.trigger({\n type: 'load',\n target: this\n });\n });\n }\n}\n\n/**\n * @protected\n */\nHTMLTrackElement.prototype.allowedEvents_ = {\n load: 'load'\n};\n\n/**\n * The text track not loaded state.\n *\n * @type {number}\n * @static\n */\nHTMLTrackElement.NONE = 0;\n\n/**\n * The text track loading state.\n *\n * @type {number}\n * @static\n */\nHTMLTrackElement.LOADING = 1;\n\n/**\n * The text track loaded state.\n *\n * @type {number}\n * @static\n */\nHTMLTrackElement.LOADED = 2;\n\n/**\n * The text track failed to load state.\n *\n * @type {number}\n * @static\n */\nHTMLTrackElement.ERROR = 3;\n\n/*\n * This file contains all track properties that are used in\n * player.js, tech.js, html5.js and possibly other techs in the future.\n */\n\nconst NORMAL = {\n audio: {\n ListClass: AudioTrackList,\n TrackClass: AudioTrack,\n capitalName: 'Audio'\n },\n video: {\n ListClass: VideoTrackList,\n TrackClass: VideoTrack,\n capitalName: 'Video'\n },\n text: {\n ListClass: TextTrackList,\n TrackClass: TextTrack,\n capitalName: 'Text'\n }\n};\nObject.keys(NORMAL).forEach(function (type) {\n NORMAL[type].getterName = `${type}Tracks`;\n NORMAL[type].privateName = `${type}Tracks_`;\n});\nconst REMOTE = {\n remoteText: {\n ListClass: TextTrackList,\n TrackClass: TextTrack,\n capitalName: 'RemoteText',\n getterName: 'remoteTextTracks',\n privateName: 'remoteTextTracks_'\n },\n remoteTextEl: {\n ListClass: HtmlTrackElementList,\n TrackClass: HTMLTrackElement,\n capitalName: 'RemoteTextTrackEls',\n getterName: 'remoteTextTrackEls',\n privateName: 'remoteTextTrackEls_'\n }\n};\nconst ALL = Object.assign({}, NORMAL, REMOTE);\nREMOTE.names = Object.keys(REMOTE);\nNORMAL.names = Object.keys(NORMAL);\nALL.names = [].concat(REMOTE.names).concat(NORMAL.names);\n\n/**\n * @file tech.js\n */\n\n/**\n * An Object containing a structure like: `{src: 'url', type: 'mimetype'}` or string\n * that just contains the src url alone.\n * * `var SourceObject = {src: 'http://ex.com/video.mp4', type: 'video/mp4'};`\n * `var SourceString = 'http://example.com/some-video.mp4';`\n *\n * @typedef {Object|string} SourceObject\n *\n * @property {string} src\n * The url to the source\n *\n * @property {string} type\n * The mime type of the source\n */\n\n/**\n * A function used by {@link Tech} to create a new {@link TextTrack}.\n *\n * @private\n *\n * @param {Tech} self\n * An instance of the Tech class.\n *\n * @param {string} kind\n * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata)\n *\n * @param {string} [label]\n * Label to identify the text track\n *\n * @param {string} [language]\n * Two letter language abbreviation\n *\n * @param {Object} [options={}]\n * An object with additional text track options\n *\n * @return {TextTrack}\n * The text track that was created.\n */\nfunction createTrackHelper(self, kind, label, language, options = {}) {\n const tracks = self.textTracks();\n options.kind = kind;\n if (label) {\n options.label = label;\n }\n if (language) {\n options.language = language;\n }\n options.tech = self;\n const track = new ALL.text.TrackClass(options);\n tracks.addTrack(track);\n return track;\n}\n\n/**\n * This is the base class for media playback technology controllers, such as\n * {@link HTML5}\n *\n * @extends Component\n */\nclass Tech extends Component$1 {\n /**\n * Create an instance of this Tech.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Function} [ready]\n * Callback function to call when the `HTML5` Tech is ready.\n */\n constructor(options = {}, ready = function () {}) {\n // we don't want the tech to report user activity automatically.\n // This is done manually in addControlsListeners\n options.reportTouchActivity = false;\n super(null, options, ready);\n this.onDurationChange_ = e => this.onDurationChange(e);\n this.trackProgress_ = e => this.trackProgress(e);\n this.trackCurrentTime_ = e => this.trackCurrentTime(e);\n this.stopTrackingCurrentTime_ = e => this.stopTrackingCurrentTime(e);\n this.disposeSourceHandler_ = e => this.disposeSourceHandler(e);\n this.queuedHanders_ = new Set();\n\n // keep track of whether the current source has played at all to\n // implement a very limited played()\n this.hasStarted_ = false;\n this.on('playing', function () {\n this.hasStarted_ = true;\n });\n this.on('loadstart', function () {\n this.hasStarted_ = false;\n });\n ALL.names.forEach(name => {\n const props = ALL[name];\n if (options && options[props.getterName]) {\n this[props.privateName] = options[props.getterName];\n }\n });\n\n // Manually track progress in cases where the browser/tech doesn't report it.\n if (!this.featuresProgressEvents) {\n this.manualProgressOn();\n }\n\n // Manually track timeupdates in cases where the browser/tech doesn't report it.\n if (!this.featuresTimeupdateEvents) {\n this.manualTimeUpdatesOn();\n }\n ['Text', 'Audio', 'Video'].forEach(track => {\n if (options[`native${track}Tracks`] === false) {\n this[`featuresNative${track}Tracks`] = false;\n }\n });\n if (options.nativeCaptions === false || options.nativeTextTracks === false) {\n this.featuresNativeTextTracks = false;\n } else if (options.nativeCaptions === true || options.nativeTextTracks === true) {\n this.featuresNativeTextTracks = true;\n }\n if (!this.featuresNativeTextTracks) {\n this.emulateTextTracks();\n }\n this.preloadTextTracks = options.preloadTextTracks !== false;\n this.autoRemoteTextTracks_ = new ALL.text.ListClass();\n this.initTrackListeners();\n\n // Turn on component tap events only if not using native controls\n if (!options.nativeControlsForTouch) {\n this.emitTapEvents();\n }\n if (this.constructor) {\n this.name_ = this.constructor.name || 'Unknown Tech';\n }\n }\n\n /**\n * A special function to trigger source set in a way that will allow player\n * to re-trigger if the player or tech are not ready yet.\n *\n * @fires Tech#sourceset\n * @param {string} src The source string at the time of the source changing.\n */\n triggerSourceset(src) {\n if (!this.isReady_) {\n // on initial ready we have to trigger source set\n // 1ms after ready so that player can watch for it.\n this.one('ready', () => this.setTimeout(() => this.triggerSourceset(src), 1));\n }\n\n /**\n * Fired when the source is set on the tech causing the media element\n * to reload.\n *\n * @see {@link Player#event:sourceset}\n * @event Tech#sourceset\n * @type {Event}\n */\n this.trigger({\n src,\n type: 'sourceset'\n });\n }\n\n /* Fallbacks for unsupported event types\n ================================================================================ */\n\n /**\n * Polyfill the `progress` event for browsers that don't support it natively.\n *\n * @see {@link Tech#trackProgress}\n */\n manualProgressOn() {\n this.on('durationchange', this.onDurationChange_);\n this.manualProgress = true;\n\n // Trigger progress watching when a source begins loading\n this.one('ready', this.trackProgress_);\n }\n\n /**\n * Turn off the polyfill for `progress` events that was created in\n * {@link Tech#manualProgressOn}\n */\n manualProgressOff() {\n this.manualProgress = false;\n this.stopTrackingProgress();\n this.off('durationchange', this.onDurationChange_);\n }\n\n /**\n * This is used to trigger a `progress` event when the buffered percent changes. It\n * sets an interval function that will be called every 500 milliseconds to check if the\n * buffer end percent has changed.\n *\n * > This function is called by {@link Tech#manualProgressOn}\n *\n * @param {Event} event\n * The `ready` event that caused this to run.\n *\n * @listens Tech#ready\n * @fires Tech#progress\n */\n trackProgress(event) {\n this.stopTrackingProgress();\n this.progressInterval = this.setInterval(bind_(this, function () {\n // Don't trigger unless buffered amount is greater than last time\n\n const numBufferedPercent = this.bufferedPercent();\n if (this.bufferedPercent_ !== numBufferedPercent) {\n /**\n * See {@link Player#progress}\n *\n * @event Tech#progress\n * @type {Event}\n */\n this.trigger('progress');\n }\n this.bufferedPercent_ = numBufferedPercent;\n if (numBufferedPercent === 1) {\n this.stopTrackingProgress();\n }\n }), 500);\n }\n\n /**\n * Update our internal duration on a `durationchange` event by calling\n * {@link Tech#duration}.\n *\n * @param {Event} event\n * The `durationchange` event that caused this to run.\n *\n * @listens Tech#durationchange\n */\n onDurationChange(event) {\n this.duration_ = this.duration();\n }\n\n /**\n * Get and create a `TimeRange` object for buffering.\n *\n * @return { import('../utils/time').TimeRange }\n * The time range object that was created.\n */\n buffered() {\n return createTimeRanges$1(0, 0);\n }\n\n /**\n * Get the percentage of the current video that is currently buffered.\n *\n * @return {number}\n * A number from 0 to 1 that represents the decimal percentage of the\n * video that is buffered.\n *\n */\n bufferedPercent() {\n return bufferedPercent(this.buffered(), this.duration_);\n }\n\n /**\n * Turn off the polyfill for `progress` events that was created in\n * {@link Tech#manualProgressOn}\n * Stop manually tracking progress events by clearing the interval that was set in\n * {@link Tech#trackProgress}.\n */\n stopTrackingProgress() {\n this.clearInterval(this.progressInterval);\n }\n\n /**\n * Polyfill the `timeupdate` event for browsers that don't support it.\n *\n * @see {@link Tech#trackCurrentTime}\n */\n manualTimeUpdatesOn() {\n this.manualTimeUpdates = true;\n this.on('play', this.trackCurrentTime_);\n this.on('pause', this.stopTrackingCurrentTime_);\n }\n\n /**\n * Turn off the polyfill for `timeupdate` events that was created in\n * {@link Tech#manualTimeUpdatesOn}\n */\n manualTimeUpdatesOff() {\n this.manualTimeUpdates = false;\n this.stopTrackingCurrentTime();\n this.off('play', this.trackCurrentTime_);\n this.off('pause', this.stopTrackingCurrentTime_);\n }\n\n /**\n * Sets up an interval function to track current time and trigger `timeupdate` every\n * 250 milliseconds.\n *\n * @listens Tech#play\n * @triggers Tech#timeupdate\n */\n trackCurrentTime() {\n if (this.currentTimeInterval) {\n this.stopTrackingCurrentTime();\n }\n this.currentTimeInterval = this.setInterval(function () {\n /**\n * Triggered at an interval of 250ms to indicated that time is passing in the video.\n *\n * @event Tech#timeupdate\n * @type {Event}\n */\n this.trigger({\n type: 'timeupdate',\n target: this,\n manuallyTriggered: true\n });\n\n // 42 = 24 fps // 250 is what Webkit uses // FF uses 15\n }, 250);\n }\n\n /**\n * Stop the interval function created in {@link Tech#trackCurrentTime} so that the\n * `timeupdate` event is no longer triggered.\n *\n * @listens {Tech#pause}\n */\n stopTrackingCurrentTime() {\n this.clearInterval(this.currentTimeInterval);\n\n // #1002 - if the video ends right before the next timeupdate would happen,\n // the progress bar won't make it all the way to the end\n this.trigger({\n type: 'timeupdate',\n target: this,\n manuallyTriggered: true\n });\n }\n\n /**\n * Turn off all event polyfills, clear the `Tech`s {@link AudioTrackList},\n * {@link VideoTrackList}, and {@link TextTrackList}, and dispose of this Tech.\n *\n * @fires Component#dispose\n */\n dispose() {\n // clear out all tracks because we can't reuse them between techs\n this.clearTracks(NORMAL.names);\n\n // Turn off any manual progress or timeupdate tracking\n if (this.manualProgress) {\n this.manualProgressOff();\n }\n if (this.manualTimeUpdates) {\n this.manualTimeUpdatesOff();\n }\n super.dispose();\n }\n\n /**\n * Clear out a single `TrackList` or an array of `TrackLists` given their names.\n *\n * > Note: Techs without source handlers should call this between sources for `video`\n * & `audio` tracks. You don't want to use them between tracks!\n *\n * @param {string[]|string} types\n * TrackList names to clear, valid names are `video`, `audio`, and\n * `text`.\n */\n clearTracks(types) {\n types = [].concat(types);\n // clear out all tracks because we can't reuse them between techs\n types.forEach(type => {\n const list = this[`${type}Tracks`]() || [];\n let i = list.length;\n while (i--) {\n const track = list[i];\n if (type === 'text') {\n this.removeRemoteTextTrack(track);\n }\n list.removeTrack(track);\n }\n });\n }\n\n /**\n * Remove any TextTracks added via addRemoteTextTrack that are\n * flagged for automatic garbage collection\n */\n cleanupAutoTextTracks() {\n const list = this.autoRemoteTextTracks_ || [];\n let i = list.length;\n while (i--) {\n const track = list[i];\n this.removeRemoteTextTrack(track);\n }\n }\n\n /**\n * Reset the tech, which will removes all sources and reset the internal readyState.\n *\n * @abstract\n */\n reset() {}\n\n /**\n * Get the value of `crossOrigin` from the tech.\n *\n * @abstract\n *\n * @see {Html5#crossOrigin}\n */\n crossOrigin() {}\n\n /**\n * Set the value of `crossOrigin` on the tech.\n *\n * @abstract\n *\n * @param {string} crossOrigin the crossOrigin value\n * @see {Html5#setCrossOrigin}\n */\n setCrossOrigin() {}\n\n /**\n * Get or set an error on the Tech.\n *\n * @param {MediaError} [err]\n * Error to set on the Tech\n *\n * @return {MediaError|null}\n * The current error object on the tech, or null if there isn't one.\n */\n error(err) {\n if (err !== undefined) {\n this.error_ = new MediaError(err);\n this.trigger('error');\n }\n return this.error_;\n }\n\n /**\n * Returns the `TimeRange`s that have been played through for the current source.\n *\n * > NOTE: This implementation is incomplete. It does not track the played `TimeRange`.\n * It only checks whether the source has played at all or not.\n *\n * @return { import('../utils/time').TimeRange }\n * - A single time range if this video has played\n * - An empty set of ranges if not.\n */\n played() {\n if (this.hasStarted_) {\n return createTimeRanges$1(0, 0);\n }\n return createTimeRanges$1();\n }\n\n /**\n * Start playback\n *\n * @abstract\n *\n * @see {Html5#play}\n */\n play() {}\n\n /**\n * Set whether we are scrubbing or not\n *\n * @abstract\n * @param {boolean} _isScrubbing\n * - true for we are currently scrubbing\n * - false for we are no longer scrubbing\n *\n * @see {Html5#setScrubbing}\n */\n setScrubbing(_isScrubbing) {}\n\n /**\n * Get whether we are scrubbing or not\n *\n * @abstract\n *\n * @see {Html5#scrubbing}\n */\n scrubbing() {}\n\n /**\n * Causes a manual time update to occur if {@link Tech#manualTimeUpdatesOn} was\n * previously called.\n *\n * @param {number} _seconds\n * Set the current time of the media to this.\n * @fires Tech#timeupdate\n */\n setCurrentTime(_seconds) {\n // improve the accuracy of manual timeupdates\n if (this.manualTimeUpdates) {\n /**\n * A manual `timeupdate` event.\n *\n * @event Tech#timeupdate\n * @type {Event}\n */\n this.trigger({\n type: 'timeupdate',\n target: this,\n manuallyTriggered: true\n });\n }\n }\n\n /**\n * Turn on listeners for {@link VideoTrackList}, {@link {AudioTrackList}, and\n * {@link TextTrackList} events.\n *\n * This adds {@link EventTarget~EventListeners} for `addtrack`, and `removetrack`.\n *\n * @fires Tech#audiotrackchange\n * @fires Tech#videotrackchange\n * @fires Tech#texttrackchange\n */\n initTrackListeners() {\n /**\n * Triggered when tracks are added or removed on the Tech {@link AudioTrackList}\n *\n * @event Tech#audiotrackchange\n * @type {Event}\n */\n\n /**\n * Triggered when tracks are added or removed on the Tech {@link VideoTrackList}\n *\n * @event Tech#videotrackchange\n * @type {Event}\n */\n\n /**\n * Triggered when tracks are added or removed on the Tech {@link TextTrackList}\n *\n * @event Tech#texttrackchange\n * @type {Event}\n */\n NORMAL.names.forEach(name => {\n const props = NORMAL[name];\n const trackListChanges = () => {\n this.trigger(`${name}trackchange`);\n };\n const tracks = this[props.getterName]();\n tracks.addEventListener('removetrack', trackListChanges);\n tracks.addEventListener('addtrack', trackListChanges);\n this.on('dispose', () => {\n tracks.removeEventListener('removetrack', trackListChanges);\n tracks.removeEventListener('addtrack', trackListChanges);\n });\n });\n }\n\n /**\n * Emulate TextTracks using vtt.js if necessary\n *\n * @fires Tech#vttjsloaded\n * @fires Tech#vttjserror\n */\n addWebVttScript_() {\n if (window$1.WebVTT) {\n return;\n }\n\n // Initially, Tech.el_ is a child of a dummy-div wait until the Component system\n // signals that the Tech is ready at which point Tech.el_ is part of the DOM\n // before inserting the WebVTT script\n if (document.body.contains(this.el())) {\n // load via require if available and vtt.js script location was not passed in\n // as an option. novtt builds will turn the above require call into an empty object\n // which will cause this if check to always fail.\n if (!this.options_['vtt.js'] && isPlain(vtt) && Object.keys(vtt).length > 0) {\n this.trigger('vttjsloaded');\n return;\n }\n\n // load vtt.js via the script location option or the cdn of no location was\n // passed in\n const script = document.createElement('script');\n script.src = this.options_['vtt.js'] || 'https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js';\n script.onload = () => {\n /**\n * Fired when vtt.js is loaded.\n *\n * @event Tech#vttjsloaded\n * @type {Event}\n */\n this.trigger('vttjsloaded');\n };\n script.onerror = () => {\n /**\n * Fired when vtt.js was not loaded due to an error\n *\n * @event Tech#vttjsloaded\n * @type {Event}\n */\n this.trigger('vttjserror');\n };\n this.on('dispose', () => {\n script.onload = null;\n script.onerror = null;\n });\n // but have not loaded yet and we set it to true before the inject so that\n // we don't overwrite the injected window.WebVTT if it loads right away\n window$1.WebVTT = true;\n this.el().parentNode.appendChild(script);\n } else {\n this.ready(this.addWebVttScript_);\n }\n }\n\n /**\n * Emulate texttracks\n *\n */\n emulateTextTracks() {\n const tracks = this.textTracks();\n const remoteTracks = this.remoteTextTracks();\n const handleAddTrack = e => tracks.addTrack(e.track);\n const handleRemoveTrack = e => tracks.removeTrack(e.track);\n remoteTracks.on('addtrack', handleAddTrack);\n remoteTracks.on('removetrack', handleRemoveTrack);\n this.addWebVttScript_();\n const updateDisplay = () => this.trigger('texttrackchange');\n const textTracksChanges = () => {\n updateDisplay();\n for (let i = 0; i < tracks.length; i++) {\n const track = tracks[i];\n track.removeEventListener('cuechange', updateDisplay);\n if (track.mode === 'showing') {\n track.addEventListener('cuechange', updateDisplay);\n }\n }\n };\n textTracksChanges();\n tracks.addEventListener('change', textTracksChanges);\n tracks.addEventListener('addtrack', textTracksChanges);\n tracks.addEventListener('removetrack', textTracksChanges);\n this.on('dispose', function () {\n remoteTracks.off('addtrack', handleAddTrack);\n remoteTracks.off('removetrack', handleRemoveTrack);\n tracks.removeEventListener('change', textTracksChanges);\n tracks.removeEventListener('addtrack', textTracksChanges);\n tracks.removeEventListener('removetrack', textTracksChanges);\n for (let i = 0; i < tracks.length; i++) {\n const track = tracks[i];\n track.removeEventListener('cuechange', updateDisplay);\n }\n });\n }\n\n /**\n * Create and returns a remote {@link TextTrack} object.\n *\n * @param {string} kind\n * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata)\n *\n * @param {string} [label]\n * Label to identify the text track\n *\n * @param {string} [language]\n * Two letter language abbreviation\n *\n * @return {TextTrack}\n * The TextTrack that gets created.\n */\n addTextTrack(kind, label, language) {\n if (!kind) {\n throw new Error('TextTrack kind is required but was not provided');\n }\n return createTrackHelper(this, kind, label, language);\n }\n\n /**\n * Create an emulated TextTrack for use by addRemoteTextTrack\n *\n * This is intended to be overridden by classes that inherit from\n * Tech in order to create native or custom TextTracks.\n *\n * @param {Object} options\n * The object should contain the options to initialize the TextTrack with.\n *\n * @param {string} [options.kind]\n * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata).\n *\n * @param {string} [options.label].\n * Label to identify the text track\n *\n * @param {string} [options.language]\n * Two letter language abbreviation.\n *\n * @return {HTMLTrackElement}\n * The track element that gets created.\n */\n createRemoteTextTrack(options) {\n const track = merge$1(options, {\n tech: this\n });\n return new REMOTE.remoteTextEl.TrackClass(track);\n }\n\n /**\n * Creates a remote text track object and returns an html track element.\n *\n * > Note: This can be an emulated {@link HTMLTrackElement} or a native one.\n *\n * @param {Object} options\n * See {@link Tech#createRemoteTextTrack} for more detailed properties.\n *\n * @param {boolean} [manualCleanup=false]\n * - When false: the TextTrack will be automatically removed from the video\n * element whenever the source changes\n * - When True: The TextTrack will have to be cleaned up manually\n *\n * @return {HTMLTrackElement}\n * An Html Track Element.\n *\n */\n addRemoteTextTrack(options = {}, manualCleanup) {\n const htmlTrackElement = this.createRemoteTextTrack(options);\n if (typeof manualCleanup !== 'boolean') {\n manualCleanup = false;\n }\n\n // store HTMLTrackElement and TextTrack to remote list\n this.remoteTextTrackEls().addTrackElement_(htmlTrackElement);\n this.remoteTextTracks().addTrack(htmlTrackElement.track);\n if (manualCleanup === false) {\n // create the TextTrackList if it doesn't exist\n this.ready(() => this.autoRemoteTextTracks_.addTrack(htmlTrackElement.track));\n }\n return htmlTrackElement;\n }\n\n /**\n * Remove a remote text track from the remote `TextTrackList`.\n *\n * @param {TextTrack} track\n * `TextTrack` to remove from the `TextTrackList`\n */\n removeRemoteTextTrack(track) {\n const trackElement = this.remoteTextTrackEls().getTrackElementByTrack_(track);\n\n // remove HTMLTrackElement and TextTrack from remote list\n this.remoteTextTrackEls().removeTrackElement_(trackElement);\n this.remoteTextTracks().removeTrack(track);\n this.autoRemoteTextTracks_.removeTrack(track);\n }\n\n /**\n * Gets available media playback quality metrics as specified by the W3C's Media\n * Playback Quality API.\n *\n * @see [Spec]{@link https://wicg.github.io/media-playback-quality}\n *\n * @return {Object}\n * An object with supported media playback quality metrics\n *\n * @abstract\n */\n getVideoPlaybackQuality() {\n return {};\n }\n\n /**\n * Attempt to create a floating video window always on top of other windows\n * so that users may continue consuming media while they interact with other\n * content sites, or applications on their device.\n *\n * @see [Spec]{@link https://wicg.github.io/picture-in-picture}\n *\n * @return {Promise|undefined}\n * A promise with a Picture-in-Picture window if the browser supports\n * Promises (or one was passed in as an option). It returns undefined\n * otherwise.\n *\n * @abstract\n */\n requestPictureInPicture() {\n return Promise.reject();\n }\n\n /**\n * A method to check for the value of the 'disablePictureInPicture' <video> property.\n * Defaults to true, as it should be considered disabled if the tech does not support pip\n *\n * @abstract\n */\n disablePictureInPicture() {\n return true;\n }\n\n /**\n * A method to set or unset the 'disablePictureInPicture' <video> property.\n *\n * @abstract\n */\n setDisablePictureInPicture() {}\n\n /**\n * A fallback implementation of requestVideoFrameCallback using requestAnimationFrame\n *\n * @param {function} cb\n * @return {number} request id\n */\n requestVideoFrameCallback(cb) {\n const id = newGUID();\n if (!this.isReady_ || this.paused()) {\n this.queuedHanders_.add(id);\n this.one('playing', () => {\n if (this.queuedHanders_.has(id)) {\n this.queuedHanders_.delete(id);\n cb();\n }\n });\n } else {\n this.requestNamedAnimationFrame(id, cb);\n }\n return id;\n }\n\n /**\n * A fallback implementation of cancelVideoFrameCallback\n *\n * @param {number} id id of callback to be cancelled\n */\n cancelVideoFrameCallback(id) {\n if (this.queuedHanders_.has(id)) {\n this.queuedHanders_.delete(id);\n } else {\n this.cancelNamedAnimationFrame(id);\n }\n }\n\n /**\n * A method to set a poster from a `Tech`.\n *\n * @abstract\n */\n setPoster() {}\n\n /**\n * A method to check for the presence of the 'playsinline' <video> attribute.\n *\n * @abstract\n */\n playsinline() {}\n\n /**\n * A method to set or unset the 'playsinline' <video> attribute.\n *\n * @abstract\n */\n setPlaysinline() {}\n\n /**\n * Attempt to force override of native audio tracks.\n *\n * @param {boolean} override - If set to true native audio will be overridden,\n * otherwise native audio will potentially be used.\n *\n * @abstract\n */\n overrideNativeAudioTracks(override) {}\n\n /**\n * Attempt to force override of native video tracks.\n *\n * @param {boolean} override - If set to true native video will be overridden,\n * otherwise native video will potentially be used.\n *\n * @abstract\n */\n overrideNativeVideoTracks(override) {}\n\n /**\n * Check if the tech can support the given mime-type.\n *\n * The base tech does not support any type, but source handlers might\n * overwrite this.\n *\n * @param {string} _type\n * The mimetype to check for support\n *\n * @return {string}\n * 'probably', 'maybe', or empty string\n *\n * @see [Spec]{@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/canPlayType}\n *\n * @abstract\n */\n canPlayType(_type) {\n return '';\n }\n\n /**\n * Check if the type is supported by this tech.\n *\n * The base tech does not support any type, but source handlers might\n * overwrite this.\n *\n * @param {string} _type\n * The media type to check\n * @return {string} Returns the native video element's response\n */\n static canPlayType(_type) {\n return '';\n }\n\n /**\n * Check if the tech can support the given source\n *\n * @param {Object} srcObj\n * The source object\n * @param {Object} options\n * The options passed to the tech\n * @return {string} 'probably', 'maybe', or '' (empty string)\n */\n static canPlaySource(srcObj, options) {\n return Tech.canPlayType(srcObj.type);\n }\n\n /*\n * Return whether the argument is a Tech or not.\n * Can be passed either a Class like `Html5` or a instance like `player.tech_`\n *\n * @param {Object} component\n * The item to check\n *\n * @return {boolean}\n * Whether it is a tech or not\n * - True if it is a tech\n * - False if it is not\n */\n static isTech(component) {\n return component.prototype instanceof Tech || component instanceof Tech || component === Tech;\n }\n\n /**\n * Registers a `Tech` into a shared list for videojs.\n *\n * @param {string} name\n * Name of the `Tech` to register.\n *\n * @param {Object} tech\n * The `Tech` class to register.\n */\n static registerTech(name, tech) {\n if (!Tech.techs_) {\n Tech.techs_ = {};\n }\n if (!Tech.isTech(tech)) {\n throw new Error(`Tech ${name} must be a Tech`);\n }\n if (!Tech.canPlayType) {\n throw new Error('Techs must have a static canPlayType method on them');\n }\n if (!Tech.canPlaySource) {\n throw new Error('Techs must have a static canPlaySource method on them');\n }\n name = toTitleCase$1(name);\n Tech.techs_[name] = tech;\n Tech.techs_[toLowerCase(name)] = tech;\n if (name !== 'Tech') {\n // camel case the techName for use in techOrder\n Tech.defaultTechOrder_.push(name);\n }\n return tech;\n }\n\n /**\n * Get a `Tech` from the shared list by name.\n *\n * @param {string} name\n * `camelCase` or `TitleCase` name of the Tech to get\n *\n * @return {Tech|undefined}\n * The `Tech` or undefined if there was no tech with the name requested.\n */\n static getTech(name) {\n if (!name) {\n return;\n }\n if (Tech.techs_ && Tech.techs_[name]) {\n return Tech.techs_[name];\n }\n name = toTitleCase$1(name);\n if (window$1 && window$1.videojs && window$1.videojs[name]) {\n log$1.warn(`The ${name} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`);\n return window$1.videojs[name];\n }\n }\n}\n\n/**\n * Get the {@link VideoTrackList}\n *\n * @returns {VideoTrackList}\n * @method Tech.prototype.videoTracks\n */\n\n/**\n * Get the {@link AudioTrackList}\n *\n * @returns {AudioTrackList}\n * @method Tech.prototype.audioTracks\n */\n\n/**\n * Get the {@link TextTrackList}\n *\n * @returns {TextTrackList}\n * @method Tech.prototype.textTracks\n */\n\n/**\n * Get the remote element {@link TextTrackList}\n *\n * @returns {TextTrackList}\n * @method Tech.prototype.remoteTextTracks\n */\n\n/**\n * Get the remote element {@link HtmlTrackElementList}\n *\n * @returns {HtmlTrackElementList}\n * @method Tech.prototype.remoteTextTrackEls\n */\n\nALL.names.forEach(function (name) {\n const props = ALL[name];\n Tech.prototype[props.getterName] = function () {\n this[props.privateName] = this[props.privateName] || new props.ListClass();\n return this[props.privateName];\n };\n});\n\n/**\n * List of associated text tracks\n *\n * @type {TextTrackList}\n * @private\n * @property Tech#textTracks_\n */\n\n/**\n * List of associated audio tracks.\n *\n * @type {AudioTrackList}\n * @private\n * @property Tech#audioTracks_\n */\n\n/**\n * List of associated video tracks.\n *\n * @type {VideoTrackList}\n * @private\n * @property Tech#videoTracks_\n */\n\n/**\n * Boolean indicating whether the `Tech` supports volume control.\n *\n * @type {boolean}\n * @default\n */\nTech.prototype.featuresVolumeControl = true;\n\n/**\n * Boolean indicating whether the `Tech` supports muting volume.\n *\n * @type {boolean}\n * @default\n */\nTech.prototype.featuresMuteControl = true;\n\n/**\n * Boolean indicating whether the `Tech` supports fullscreen resize control.\n * Resizing plugins using request fullscreen reloads the plugin\n *\n * @type {boolean}\n * @default\n */\nTech.prototype.featuresFullscreenResize = false;\n\n/**\n * Boolean indicating whether the `Tech` supports changing the speed at which the video\n * plays. Examples:\n * - Set player to play 2x (twice) as fast\n * - Set player to play 0.5x (half) as fast\n *\n * @type {boolean}\n * @default\n */\nTech.prototype.featuresPlaybackRate = false;\n\n/**\n * Boolean indicating whether the `Tech` supports the `progress` event.\n * This will be used to determine if {@link Tech#manualProgressOn} should be called.\n *\n * @type {boolean}\n * @default\n */\nTech.prototype.featuresProgressEvents = false;\n\n/**\n * Boolean indicating whether the `Tech` supports the `sourceset` event.\n *\n * A tech should set this to `true` and then use {@link Tech#triggerSourceset}\n * to trigger a {@link Tech#event:sourceset} at the earliest time after getting\n * a new source.\n *\n * @type {boolean}\n * @default\n */\nTech.prototype.featuresSourceset = false;\n\n/**\n * Boolean indicating whether the `Tech` supports the `timeupdate` event.\n * This will be used to determine if {@link Tech#manualTimeUpdates} should be called.\n *\n * @type {boolean}\n * @default\n */\nTech.prototype.featuresTimeupdateEvents = false;\n\n/**\n * Boolean indicating whether the `Tech` supports the native `TextTrack`s.\n * This will help us integrate with native `TextTrack`s if the browser supports them.\n *\n * @type {boolean}\n * @default\n */\nTech.prototype.featuresNativeTextTracks = false;\n\n/**\n * Boolean indicating whether the `Tech` supports `requestVideoFrameCallback`.\n *\n * @type {boolean}\n * @default\n */\nTech.prototype.featuresVideoFrameCallback = false;\n\n/**\n * A functional mixin for techs that want to use the Source Handler pattern.\n * Source handlers are scripts for handling specific formats.\n * The source handler pattern is used for adaptive formats (HLS, DASH) that\n * manually load video data and feed it into a Source Buffer (Media Source Extensions)\n * Example: `Tech.withSourceHandlers.call(MyTech);`\n *\n * @param {Tech} _Tech\n * The tech to add source handler functions to.\n *\n * @mixes Tech~SourceHandlerAdditions\n */\nTech.withSourceHandlers = function (_Tech) {\n /**\n * Register a source handler\n *\n * @param {Function} handler\n * The source handler class\n *\n * @param {number} [index]\n * Register it at the following index\n */\n _Tech.registerSourceHandler = function (handler, index) {\n let handlers = _Tech.sourceHandlers;\n if (!handlers) {\n handlers = _Tech.sourceHandlers = [];\n }\n if (index === undefined) {\n // add to the end of the list\n index = handlers.length;\n }\n handlers.splice(index, 0, handler);\n };\n\n /**\n * Check if the tech can support the given type. Also checks the\n * Techs sourceHandlers.\n *\n * @param {string} type\n * The mimetype to check.\n *\n * @return {string}\n * 'probably', 'maybe', or '' (empty string)\n */\n _Tech.canPlayType = function (type) {\n const handlers = _Tech.sourceHandlers || [];\n let can;\n for (let i = 0; i < handlers.length; i++) {\n can = handlers[i].canPlayType(type);\n if (can) {\n return can;\n }\n }\n return '';\n };\n\n /**\n * Returns the first source handler that supports the source.\n *\n * TODO: Answer question: should 'probably' be prioritized over 'maybe'\n *\n * @param {SourceObject} source\n * The source object\n *\n * @param {Object} options\n * The options passed to the tech\n *\n * @return {SourceHandler|null}\n * The first source handler that supports the source or null if\n * no SourceHandler supports the source\n */\n _Tech.selectSourceHandler = function (source, options) {\n const handlers = _Tech.sourceHandlers || [];\n let can;\n for (let i = 0; i < handlers.length; i++) {\n can = handlers[i].canHandleSource(source, options);\n if (can) {\n return handlers[i];\n }\n }\n return null;\n };\n\n /**\n * Check if the tech can support the given source.\n *\n * @param {SourceObject} srcObj\n * The source object\n *\n * @param {Object} options\n * The options passed to the tech\n *\n * @return {string}\n * 'probably', 'maybe', or '' (empty string)\n */\n _Tech.canPlaySource = function (srcObj, options) {\n const sh = _Tech.selectSourceHandler(srcObj, options);\n if (sh) {\n return sh.canHandleSource(srcObj, options);\n }\n return '';\n };\n\n /**\n * When using a source handler, prefer its implementation of\n * any function normally provided by the tech.\n */\n const deferrable = ['seekable', 'seeking', 'duration'];\n\n /**\n * A wrapper around {@link Tech#seekable} that will call a `SourceHandler`s seekable\n * function if it exists, with a fallback to the Techs seekable function.\n *\n * @method _Tech.seekable\n */\n\n /**\n * A wrapper around {@link Tech#duration} that will call a `SourceHandler`s duration\n * function if it exists, otherwise it will fallback to the techs duration function.\n *\n * @method _Tech.duration\n */\n\n deferrable.forEach(function (fnName) {\n const originalFn = this[fnName];\n if (typeof originalFn !== 'function') {\n return;\n }\n this[fnName] = function () {\n if (this.sourceHandler_ && this.sourceHandler_[fnName]) {\n return this.sourceHandler_[fnName].apply(this.sourceHandler_, arguments);\n }\n return originalFn.apply(this, arguments);\n };\n }, _Tech.prototype);\n\n /**\n * Create a function for setting the source using a source object\n * and source handlers.\n * Should never be called unless a source handler was found.\n *\n * @param {SourceObject} source\n * A source object with src and type keys\n */\n _Tech.prototype.setSource = function (source) {\n let sh = _Tech.selectSourceHandler(source, this.options_);\n if (!sh) {\n // Fall back to a native source handler when unsupported sources are\n // deliberately set\n if (_Tech.nativeSourceHandler) {\n sh = _Tech.nativeSourceHandler;\n } else {\n log$1.error('No source handler found for the current source.');\n }\n }\n\n // Dispose any existing source handler\n this.disposeSourceHandler();\n this.off('dispose', this.disposeSourceHandler_);\n if (sh !== _Tech.nativeSourceHandler) {\n this.currentSource_ = source;\n }\n this.sourceHandler_ = sh.handleSource(source, this, this.options_);\n this.one('dispose', this.disposeSourceHandler_);\n };\n\n /**\n * Clean up any existing SourceHandlers and listeners when the Tech is disposed.\n *\n * @listens Tech#dispose\n */\n _Tech.prototype.disposeSourceHandler = function () {\n // if we have a source and get another one\n // then we are loading something new\n // than clear all of our current tracks\n if (this.currentSource_) {\n this.clearTracks(['audio', 'video']);\n this.currentSource_ = null;\n }\n\n // always clean up auto-text tracks\n this.cleanupAutoTextTracks();\n if (this.sourceHandler_) {\n if (this.sourceHandler_.dispose) {\n this.sourceHandler_.dispose();\n }\n this.sourceHandler_ = null;\n }\n };\n};\n\n// The base Tech class needs to be registered as a Component. It is the only\n// Tech that can be registered as a Component.\nComponent$1.registerComponent('Tech', Tech);\nTech.registerTech('Tech', Tech);\n\n/**\n * A list of techs that should be added to techOrder on Players\n *\n * @private\n */\nTech.defaultTechOrder_ = [];\n\n/**\n * @file middleware.js\n * @module middleware\n */\nconst middlewares = {};\nconst middlewareInstances = {};\nconst TERMINATOR = {};\n\n/**\n * A middleware object is a plain JavaScript object that has methods that\n * match the {@link Tech} methods found in the lists of allowed\n * {@link module:middleware.allowedGetters|getters},\n * {@link module:middleware.allowedSetters|setters}, and\n * {@link module:middleware.allowedMediators|mediators}.\n *\n * @typedef {Object} MiddlewareObject\n */\n\n/**\n * A middleware factory function that should return a\n * {@link module:middleware~MiddlewareObject|MiddlewareObject}.\n *\n * This factory will be called for each player when needed, with the player\n * passed in as an argument.\n *\n * @callback MiddlewareFactory\n * @param { import('../player').default } player\n * A Video.js player.\n */\n\n/**\n * Define a middleware that the player should use by way of a factory function\n * that returns a middleware object.\n *\n * @param {string} type\n * The MIME type to match or `\"*\"` for all MIME types.\n *\n * @param {MiddlewareFactory} middleware\n * A middleware factory function that will be executed for\n * matching types.\n */\nfunction use(type, middleware) {\n middlewares[type] = middlewares[type] || [];\n middlewares[type].push(middleware);\n}\n\n/**\n * Asynchronously sets a source using middleware by recursing through any\n * matching middlewares and calling `setSource` on each, passing along the\n * previous returned value each time.\n *\n * @param { import('../player').default } player\n * A {@link Player} instance.\n *\n * @param {Tech~SourceObject} src\n * A source object.\n *\n * @param {Function}\n * The next middleware to run.\n */\nfunction setSource(player, src, next) {\n player.setTimeout(() => setSourceHelper(src, middlewares[src.type], next, player), 1);\n}\n\n/**\n * When the tech is set, passes the tech to each middleware's `setTech` method.\n *\n * @param {Object[]} middleware\n * An array of middleware instances.\n *\n * @param { import('../tech/tech').default } tech\n * A Video.js tech.\n */\nfunction setTech(middleware, tech) {\n middleware.forEach(mw => mw.setTech && mw.setTech(tech));\n}\n\n/**\n * Calls a getter on the tech first, through each middleware\n * from right to left to the player.\n *\n * @param {Object[]} middleware\n * An array of middleware instances.\n *\n * @param { import('../tech/tech').default } tech\n * The current tech.\n *\n * @param {string} method\n * A method name.\n *\n * @return {*}\n * The final value from the tech after middleware has intercepted it.\n */\nfunction get(middleware, tech, method) {\n return middleware.reduceRight(middlewareIterator(method), tech[method]());\n}\n\n/**\n * Takes the argument given to the player and calls the setter method on each\n * middleware from left to right to the tech.\n *\n * @param {Object[]} middleware\n * An array of middleware instances.\n *\n * @param { import('../tech/tech').default } tech\n * The current tech.\n *\n * @param {string} method\n * A method name.\n *\n * @param {*} arg\n * The value to set on the tech.\n *\n * @return {*}\n * The return value of the `method` of the `tech`.\n */\nfunction set(middleware, tech, method, arg) {\n return tech[method](middleware.reduce(middlewareIterator(method), arg));\n}\n\n/**\n * Takes the argument given to the player and calls the `call` version of the\n * method on each middleware from left to right.\n *\n * Then, call the passed in method on the tech and return the result unchanged\n * back to the player, through middleware, this time from right to left.\n *\n * @param {Object[]} middleware\n * An array of middleware instances.\n *\n * @param { import('../tech/tech').default } tech\n * The current tech.\n *\n * @param {string} method\n * A method name.\n *\n * @param {*} arg\n * The value to set on the tech.\n *\n * @return {*}\n * The return value of the `method` of the `tech`, regardless of the\n * return values of middlewares.\n */\nfunction mediate(middleware, tech, method, arg = null) {\n const callMethod = 'call' + toTitleCase$1(method);\n const middlewareValue = middleware.reduce(middlewareIterator(callMethod), arg);\n const terminated = middlewareValue === TERMINATOR;\n // deprecated. The `null` return value should instead return TERMINATOR to\n // prevent confusion if a techs method actually returns null.\n const returnValue = terminated ? null : tech[method](middlewareValue);\n executeRight(middleware, method, returnValue, terminated);\n return returnValue;\n}\n\n/**\n * Enumeration of allowed getters where the keys are method names.\n *\n * @type {Object}\n */\nconst allowedGetters = {\n buffered: 1,\n currentTime: 1,\n duration: 1,\n muted: 1,\n played: 1,\n paused: 1,\n seekable: 1,\n volume: 1,\n ended: 1\n};\n\n/**\n * Enumeration of allowed setters where the keys are method names.\n *\n * @type {Object}\n */\nconst allowedSetters = {\n setCurrentTime: 1,\n setMuted: 1,\n setVolume: 1\n};\n\n/**\n * Enumeration of allowed mediators where the keys are method names.\n *\n * @type {Object}\n */\nconst allowedMediators = {\n play: 1,\n pause: 1\n};\nfunction middlewareIterator(method) {\n return (value, mw) => {\n // if the previous middleware terminated, pass along the termination\n if (value === TERMINATOR) {\n return TERMINATOR;\n }\n if (mw[method]) {\n return mw[method](value);\n }\n return value;\n };\n}\nfunction executeRight(mws, method, value, terminated) {\n for (let i = mws.length - 1; i >= 0; i--) {\n const mw = mws[i];\n if (mw[method]) {\n mw[method](terminated, value);\n }\n }\n}\n\n/**\n * Clear the middleware cache for a player.\n *\n * @param { import('../player').default } player\n * A {@link Player} instance.\n */\nfunction clearCacheForPlayer(player) {\n middlewareInstances[player.id()] = null;\n}\n\n/**\n * {\n * [playerId]: [[mwFactory, mwInstance], ...]\n * }\n *\n * @private\n */\nfunction getOrCreateFactory(player, mwFactory) {\n const mws = middlewareInstances[player.id()];\n let mw = null;\n if (mws === undefined || mws === null) {\n mw = mwFactory(player);\n middlewareInstances[player.id()] = [[mwFactory, mw]];\n return mw;\n }\n for (let i = 0; i < mws.length; i++) {\n const [mwf, mwi] = mws[i];\n if (mwf !== mwFactory) {\n continue;\n }\n mw = mwi;\n }\n if (mw === null) {\n mw = mwFactory(player);\n mws.push([mwFactory, mw]);\n }\n return mw;\n}\nfunction setSourceHelper(src = {}, middleware = [], next, player, acc = [], lastRun = false) {\n const [mwFactory, ...mwrest] = middleware;\n\n // if mwFactory is a string, then we're at a fork in the road\n if (typeof mwFactory === 'string') {\n setSourceHelper(src, middlewares[mwFactory], next, player, acc, lastRun);\n\n // if we have an mwFactory, call it with the player to get the mw,\n // then call the mw's setSource method\n } else if (mwFactory) {\n const mw = getOrCreateFactory(player, mwFactory);\n\n // if setSource isn't present, implicitly select this middleware\n if (!mw.setSource) {\n acc.push(mw);\n return setSourceHelper(src, mwrest, next, player, acc, lastRun);\n }\n mw.setSource(Object.assign({}, src), function (err, _src) {\n // something happened, try the next middleware on the current level\n // make sure to use the old src\n if (err) {\n return setSourceHelper(src, mwrest, next, player, acc, lastRun);\n }\n\n // we've succeeded, now we need to go deeper\n acc.push(mw);\n\n // if it's the same type, continue down the current chain\n // otherwise, we want to go down the new chain\n setSourceHelper(_src, src.type === _src.type ? mwrest : middlewares[_src.type], next, player, acc, lastRun);\n });\n } else if (mwrest.length) {\n setSourceHelper(src, mwrest, next, player, acc, lastRun);\n } else if (lastRun) {\n next(src, acc);\n } else {\n setSourceHelper(src, middlewares['*'], next, player, acc, true);\n }\n}\n\n/**\n * Mimetypes\n *\n * @see https://www.iana.org/assignments/media-types/media-types.xhtml\n * @typedef Mimetypes~Kind\n * @enum\n */\nconst MimetypesKind = {\n opus: 'video/ogg',\n ogv: 'video/ogg',\n mp4: 'video/mp4',\n mov: 'video/mp4',\n m4v: 'video/mp4',\n mkv: 'video/x-matroska',\n m4a: 'audio/mp4',\n mp3: 'audio/mpeg',\n aac: 'audio/aac',\n caf: 'audio/x-caf',\n flac: 'audio/flac',\n oga: 'audio/ogg',\n wav: 'audio/wav',\n m3u8: 'application/x-mpegURL',\n mpd: 'application/dash+xml',\n jpg: 'image/jpeg',\n jpeg: 'image/jpeg',\n gif: 'image/gif',\n png: 'image/png',\n svg: 'image/svg+xml',\n webp: 'image/webp'\n};\n\n/**\n * Get the mimetype of a given src url if possible\n *\n * @param {string} src\n * The url to the src\n *\n * @return {string}\n * return the mimetype if it was known or empty string otherwise\n */\nconst getMimetype = function (src = '') {\n const ext = getFileExtension(src);\n const mimetype = MimetypesKind[ext.toLowerCase()];\n return mimetype || '';\n};\n\n/**\n * Find the mime type of a given source string if possible. Uses the player\n * source cache.\n *\n * @param { import('../player').default } player\n * The player object\n *\n * @param {string} src\n * The source string\n *\n * @return {string}\n * The type that was found\n */\nconst findMimetype = (player, src) => {\n if (!src) {\n return '';\n }\n\n // 1. check for the type in the `source` cache\n if (player.cache_.source.src === src && player.cache_.source.type) {\n return player.cache_.source.type;\n }\n\n // 2. see if we have this source in our `currentSources` cache\n const matchingSources = player.cache_.sources.filter(s => s.src === src);\n if (matchingSources.length) {\n return matchingSources[0].type;\n }\n\n // 3. look for the src url in source elements and use the type there\n const sources = player.$$('source');\n for (let i = 0; i < sources.length; i++) {\n const s = sources[i];\n if (s.type && s.src && s.src === src) {\n return s.type;\n }\n }\n\n // 4. finally fallback to our list of mime types based on src url extension\n return getMimetype(src);\n};\n\n/**\n * @module filter-source\n */\n\n/**\n * Filter out single bad source objects or multiple source objects in an\n * array. Also flattens nested source object arrays into a 1 dimensional\n * array of source objects.\n *\n * @param {Tech~SourceObject|Tech~SourceObject[]} src\n * The src object to filter\n *\n * @return {Tech~SourceObject[]}\n * An array of sourceobjects containing only valid sources\n *\n * @private\n */\nconst filterSource = function (src) {\n // traverse array\n if (Array.isArray(src)) {\n let newsrc = [];\n src.forEach(function (srcobj) {\n srcobj = filterSource(srcobj);\n if (Array.isArray(srcobj)) {\n newsrc = newsrc.concat(srcobj);\n } else if (isObject(srcobj)) {\n newsrc.push(srcobj);\n }\n });\n src = newsrc;\n } else if (typeof src === 'string' && src.trim()) {\n // convert string into object\n src = [fixSource({\n src\n })];\n } else if (isObject(src) && typeof src.src === 'string' && src.src && src.src.trim()) {\n // src is already valid\n src = [fixSource(src)];\n } else {\n // invalid source, turn it into an empty array\n src = [];\n }\n return src;\n};\n\n/**\n * Checks src mimetype, adding it when possible\n *\n * @param {Tech~SourceObject} src\n * The src object to check\n * @return {Tech~SourceObject}\n * src Object with known type\n */\nfunction fixSource(src) {\n if (!src.type) {\n const mimetype = getMimetype(src.src);\n if (mimetype) {\n src.type = mimetype;\n }\n }\n return src;\n}\n\nvar icons = \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\">\\n <defs>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-play\\\">\\n <path d=\\\"M16 10v28l22-14z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-pause\\\">\\n <path d=\\\"M12 38h8V10h-8v28zm16-28v28h8V10h-8z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-audio\\\">\\n <path d=\\\"M24 2C14.06 2 6 10.06 6 20v14c0 3.31 2.69 6 6 6h6V24h-8v-4c0-7.73 6.27-14 14-14s14 6.27 14 14v4h-8v16h6c3.31 0 6-2.69 6-6V20c0-9.94-8.06-18-18-18z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-captions\\\">\\n <path d=\\\"M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM22 22h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2zm14 0h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-subtitles\\\">\\n <path d=\\\"M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-fullscreen-enter\\\">\\n <path d=\\\"M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-fullscreen-exit\\\">\\n <path d=\\\"M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-play-circle\\\">\\n <path d=\\\"M20 33l12-9-12-9v18zm4-29C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-volume-mute\\\">\\n <path d=\\\"M33 24c0-3.53-2.04-6.58-5-8.05v4.42l4.91 4.91c.06-.42.09-.85.09-1.28zm5 0c0 1.88-.41 3.65-1.08 5.28l3.03 3.03C41.25 29.82 42 27 42 24c0-8.56-5.99-15.72-14-17.54v4.13c5.78 1.72 10 7.07 10 13.41zM8.55 6L6 8.55 15.45 18H6v12h8l10 10V26.55l8.51 8.51c-1.34 1.03-2.85 1.86-4.51 2.36v4.13a17.94 17.94 0 0 0 7.37-3.62L39.45 42 42 39.45l-18-18L8.55 6zM24 8l-4.18 4.18L24 16.36V8z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-volume-low\\\">\\n <path d=\\\"M14 18v12h8l10 10V8L22 18h-8z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-volume-medium\\\">\\n <path d=\\\"M37 24c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zm-27-6v12h8l10 10V8L18 18h-8z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-volume-high\\\">\\n <path d=\\\"M6 18v12h8l10 10V8L14 18H6zm27 6c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zM28 6.46v4.13c5.78 1.72 10 7.07 10 13.41s-4.22 11.69-10 13.41v4.13c8.01-1.82 14-8.97 14-17.54S36.01 8.28 28 6.46z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-spinner\\\">\\n <path d=\\\"M18.8 21l9.53-16.51C26.94 4.18 25.49 4 24 4c-4.8 0-9.19 1.69-12.64 4.51l7.33 12.69.11-.2zm24.28-3c-1.84-5.85-6.3-10.52-11.99-12.68L23.77 18h19.31zm.52 2H28.62l.58 1 9.53 16.5C41.99 33.94 44 29.21 44 24c0-1.37-.14-2.71-.4-4zm-26.53 4l-7.8-13.5C6.01 14.06 4 18.79 4 24c0 1.37.14 2.71.4 4h14.98l-2.31-4zM4.92 30c1.84 5.85 6.3 10.52 11.99 12.68L24.23 30H4.92zm22.54 0l-7.8 13.51c1.4.31 2.85.49 4.34.49 4.8 0 9.19-1.69 12.64-4.51L29.31 26.8 27.46 30z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 24 24\\\" id=\\\"vjs-icon-hd\\\">\\n <path d=\\\"M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-chapters\\\">\\n <path d=\\\"M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 40 40\\\" id=\\\"vjs-icon-downloading\\\">\\n <path d=\\\"M18.208 36.875q-3.208-.292-5.979-1.729-2.771-1.438-4.812-3.729-2.042-2.292-3.188-5.229-1.146-2.938-1.146-6.23 0-6.583 4.334-11.416 4.333-4.834 10.833-5.5v3.166q-5.167.75-8.583 4.646Q6.25 14.75 6.25 19.958q0 5.209 3.396 9.104 3.396 3.896 8.562 4.646zM20 28.417L11.542 20l2.083-2.083 4.917 4.916v-11.25h2.916v11.25l4.875-4.916L28.417 20zm1.792 8.458v-3.167q1.833-.25 3.541-.958 1.709-.708 3.167-1.875l2.333 2.292q-1.958 1.583-4.25 2.541-2.291.959-4.791 1.167zm6.791-27.792q-1.541-1.125-3.25-1.854-1.708-.729-3.541-1.021V3.042q2.5.25 4.77 1.208 2.271.958 4.271 2.5zm4.584 21.584l-2.25-2.25q1.166-1.5 1.854-3.209.687-1.708.937-3.541h3.209q-.292 2.5-1.229 4.791-.938 2.292-2.521 4.209zm.541-12.417q-.291-1.833-.958-3.562-.667-1.73-1.833-3.188l2.375-2.208q1.541 1.916 2.458 4.208.917 2.292 1.167 4.75z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-file-download\\\">\\n <path d=\\\"M10.8 40.55q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h26.35v-7.7h3.4v7.7q0 1.4-1 2.4t-2.4 1zM24 32.1L13.9 22.05l2.45-2.45 5.95 5.95V7.15h3.4v18.4l5.95-5.95 2.45 2.45z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-file-download-done\\\">\\n <path d=\\\"M9.8 40.5v-3.45h28.4v3.45zm9.2-9.05L7.4 19.85l2.45-2.35L19 26.65l19.2-19.2 2.4 2.4z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-file-download-off\\\">\\n <path d=\\\"M4.9 4.75L43.25 43.1 41 45.3l-4.75-4.75q-.05.05-.075.025-.025-.025-.075-.025H10.8q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h22.05l-7-7-1.85 1.8L13.9 21.9l1.85-1.85L2.7 7zm26.75 14.7l2.45 2.45-3.75 3.8-2.45-2.5zM25.7 7.15V21.1l-3.4-3.45V7.15z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-share\\\">\\n <path d=\\\"M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31A5.83 5.83 0 1 0 36 32.17z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-cog\\\">\\n <path d=\\\"M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3a14.8 14.8 0 0 0-3.38 1.97L9.9 10.1a1 1 0 0 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3a14.8 14.8 0 0 0 3.38-1.97l4.98 2.01a1 1 0 0 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-square\\\">\\n <path d=\\\"M36 8H12c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 28H12V12h24v24z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-circle\\\">\\n <circle cx=\\\"24\\\" cy=\\\"24\\\" r=\\\"20\\\"></circle>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-circle-outline\\\">\\n <path d=\\\"M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-circle-inner-circle\\\">\\n <path d=\\\"M24 4C12.97 4 4 12.97 4 24s8.97 20 20 20 20-8.97 20-20S35.03 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm6-16c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6 6 2.69 6 6z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-cancel\\\">\\n <path d=\\\"M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm10 27.17L31.17 34 24 26.83 16.83 34 14 31.17 21.17 24 14 16.83 16.83 14 24 21.17 31.17 14 34 16.83 26.83 24 34 31.17z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-replay\\\">\\n <path d=\\\"M24 10V2L14 12l10 10v-8c6.63 0 12 5.37 12 12s-5.37 12-12 12-12-5.37-12-12H8c0 8.84 7.16 16 16 16s16-7.16 16-16-7.16-16-16-16z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-repeat\\\">\\n <path d=\\\"M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 96 48 48\\\" id=\\\"vjs-icon-replay-5\\\">\\n <path d=\\\"M17.689 98l-8.697 8.696 8.697 8.697 2.486-2.485-4.32-4.319h1.302c4.93 0 9.071 1.722 12.424 5.165 3.352 3.443 5.029 7.638 5.029 12.584h3.55c0-2.958-.553-5.73-1.658-8.313-1.104-2.583-2.622-4.841-4.555-6.774-1.932-1.932-4.19-3.45-6.773-4.555-2.584-1.104-5.355-1.657-8.313-1.657H15.5l4.615-4.615zm-8.08 21.659v13.861h11.357v5.008H9.609V143h12.7c.834 0 1.55-.298 2.146-.894.596-.597.895-1.31.895-2.145v-7.781c0-.835-.299-1.55-.895-2.147a2.929 2.929 0 0 0-2.147-.894h-8.227v-5.096H25.35v-4.384z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 96 48 48\\\" id=\\\"vjs-icon-replay-10\\\">\\n <path d=\\\"M42.315 125.63c0-4.997-1.694-9.235-5.08-12.713-3.388-3.479-7.571-5.218-12.552-5.218h-1.315l4.363 4.363-2.51 2.51-8.787-8.786L25.221 97l2.45 2.45-4.662 4.663h1.375c2.988 0 5.788.557 8.397 1.673 2.61 1.116 4.892 2.65 6.844 4.602 1.953 1.953 3.487 4.234 4.602 6.844 1.116 2.61 1.674 5.41 1.674 8.398zM8.183 142v-19.657H3.176V117.8h9.643V142zm13.63 0c-1.156 0-2.127-.393-2.912-1.178-.778-.778-1.168-1.746-1.168-2.902v-16.04c0-1.156.393-2.127 1.178-2.912.779-.779 1.746-1.168 2.902-1.168h7.696c1.156 0 2.126.392 2.911 1.177.779.78 1.168 1.747 1.168 2.903v16.04c0 1.156-.392 2.127-1.177 2.912-.779.779-1.746 1.168-2.902 1.168zm.556-4.636h6.583v-15.02H22.37z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 96 48 48\\\" id=\\\"vjs-icon-replay-30\\\">\\n <path d=\\\"M26.047 97l-8.733 8.732 8.733 8.733 2.496-2.494-4.336-4.338h1.307c4.95 0 9.108 1.73 12.474 5.187 3.367 3.458 5.051 7.668 5.051 12.635h3.565c0-2.97-.556-5.751-1.665-8.346-1.109-2.594-2.633-4.862-4.574-6.802-1.94-1.941-4.208-3.466-6.803-4.575-2.594-1.109-5.375-1.664-8.345-1.664H23.85l4.634-4.634zM2.555 117.531v4.688h10.297v5.25H5.873v4.687h6.979v5.156H2.555V142H13.36c1.061 0 1.95-.395 2.668-1.186.718-.79 1.076-1.772 1.076-2.94v-16.218c0-1.168-.358-2.149-1.076-2.94-.717-.79-1.607-1.185-2.668-1.185zm22.482.14c-1.149 0-2.11.39-2.885 1.165-.78.78-1.172 1.744-1.172 2.893v15.943c0 1.149.388 2.11 1.163 2.885.78.78 1.745 1.172 2.894 1.172h7.649c1.148 0 2.11-.388 2.884-1.163.78-.78 1.17-1.745 1.17-2.894v-15.943c0-1.15-.386-2.111-1.16-2.885-.78-.78-1.746-1.172-2.894-1.172zm.553 4.518h6.545v14.93H25.59z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 96 48 48\\\" id=\\\"vjs-icon-forward-5\\\">\\n <path d=\\\"M29.508 97l-2.431 2.43 4.625 4.625h-1.364c-2.965 0-5.742.554-8.332 1.66-2.589 1.107-4.851 2.629-6.788 4.566-1.937 1.937-3.458 4.2-4.565 6.788-1.107 2.59-1.66 5.367-1.66 8.331h3.557c0-4.957 1.68-9.16 5.04-12.611 3.36-3.45 7.51-5.177 12.451-5.177h1.304l-4.326 4.33 2.49 2.49 8.715-8.716zm-9.783 21.61v13.89h11.382v5.018H19.725V142h12.727a2.93 2.93 0 0 0 2.15-.896 2.93 2.93 0 0 0 .896-2.15v-7.798c0-.837-.299-1.554-.896-2.152a2.93 2.93 0 0 0-2.15-.896h-8.245V123h11.29v-4.392z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 96 48 48\\\" id=\\\"vjs-icon-forward-10\\\">\\n <path d=\\\"M23.119 97l-2.386 2.383 4.538 4.538h-1.339c-2.908 0-5.633.543-8.173 1.63-2.54 1.085-4.76 2.577-6.66 4.478-1.9 1.9-3.392 4.12-4.478 6.66-1.085 2.54-1.629 5.264-1.629 8.172h3.49c0-4.863 1.648-8.986 4.944-12.372 3.297-3.385 7.368-5.078 12.216-5.078h1.279l-4.245 4.247 2.443 2.442 8.55-8.55zm-9.52 21.45v4.42h4.871V142h4.513v-23.55zm18.136 0c-1.125 0-2.066.377-2.824 1.135-.764.764-1.148 1.709-1.148 2.834v15.612c0 1.124.38 2.066 1.139 2.824.764.764 1.708 1.145 2.833 1.145h7.489c1.125 0 2.066-.378 2.824-1.136.764-.764 1.145-1.709 1.145-2.833v-15.612c0-1.125-.378-2.067-1.136-2.825-.764-.764-1.708-1.145-2.833-1.145zm.54 4.42h6.408v14.617h-6.407z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 96 48 48\\\" id=\\\"vjs-icon-forward-30\\\">\\n <path d=\\\"M25.549 97l-2.437 2.434 4.634 4.635H26.38c-2.97 0-5.753.555-8.347 1.664-2.594 1.109-4.861 2.633-6.802 4.574-1.94 1.94-3.465 4.207-4.574 6.802-1.109 2.594-1.664 5.377-1.664 8.347h3.565c0-4.967 1.683-9.178 5.05-12.636 3.366-3.458 7.525-5.187 12.475-5.187h1.307l-4.335 4.338 2.495 2.494 8.732-8.732zm-11.553 20.53v4.689h10.297v5.249h-6.978v4.688h6.978v5.156H13.996V142h10.808c1.06 0 1.948-.395 2.666-1.186.718-.79 1.077-1.771 1.077-2.94v-16.217c0-1.169-.36-2.15-1.077-2.94-.718-.79-1.605-1.186-2.666-1.186zm21.174.168c-1.149 0-2.11.389-2.884 1.163-.78.78-1.172 1.745-1.172 2.894v15.942c0 1.15.388 2.11 1.162 2.885.78.78 1.745 1.17 2.894 1.17h7.649c1.149 0 2.11-.386 2.885-1.16.78-.78 1.17-1.746 1.17-2.895v-15.942c0-1.15-.387-2.11-1.161-2.885-.78-.78-1.745-1.172-2.894-1.172zm.552 4.516h6.542v14.931h-6.542z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 512 512\\\" id=\\\"vjs-icon-audio-description\\\">\\n <g fill-rule=\\\"evenodd\\\"><path d=\\\"M227.29 381.351V162.993c50.38-1.017 89.108-3.028 117.631 17.126 27.374 19.342 48.734 56.965 44.89 105.325-4.067 51.155-41.335 94.139-89.776 98.475-24.085 2.155-71.972 0-71.972 0s-.84-1.352-.773-2.568m48.755-54.804c31.43 1.26 53.208-16.633 56.495-45.386 4.403-38.51-21.188-63.552-58.041-60.796v103.612c-.036 1.466.575 2.22 1.546 2.57\\\"></path><path d=\\\"M383.78 381.328c13.336 3.71 17.387-11.06 23.215-21.408 12.722-22.571 22.294-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.226 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894\\\"></path><path d=\\\"M425.154 381.328c13.336 3.71 17.384-11.061 23.215-21.408 12.721-22.571 22.291-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.511c-.586 3.874 2.226 7.315 3.866 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894\\\"></path><path d=\\\"M466.26 381.328c13.337 3.71 17.385-11.061 23.216-21.408 12.722-22.571 22.292-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.225 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894M4.477 383.005H72.58l18.573-28.484 64.169-.135s.065 19.413.065 28.62h48.756V160.307h-58.816c-5.653 9.537-140.85 222.697-140.85 222.697zm152.667-145.282v71.158l-40.453-.27 40.453-70.888z\\\"></path></g>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-next-item\\\">\\n <path d=\\\"M12 36l17-12-17-12v24zm20-24v24h4V12h-4z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-previous-item\\\">\\n <path d=\\\"M12 12h4v24h-4zm7 12l17 12V12z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-shuffle\\\">\\n <path d=\\\"M21.17 18.34L10.83 8 8 10.83l10.34 10.34 2.83-2.83zM29 8l4.09 4.09L8 37.17 10.83 40l25.09-25.09L40 19V8H29zm.66 18.83l-2.83 2.83 6.26 6.26L29 40h11V29l-4.09 4.09-6.25-6.26z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-cast\\\">\\n <path d=\\\"M42 6H6c-2.21 0-4 1.79-4 4v6h4v-6h36v28H28v4h14c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4zM2 36v6h6c0-3.31-2.69-6-6-6zm0-8v4c5.52 0 10 4.48 10 10h4c0-7.73-6.27-14-14-14zm0-8v4c9.94 0 18 8.06 18 18h4c0-12.15-9.85-22-22-22z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 48 48\\\" id=\\\"vjs-icon-picture-in-picture-enter\\\">\\n <path d=\\\"M38 22H22v11.99h16V22zm8 16V9.96C46 7.76 44.2 6 42 6H6C3.8 6 2 7.76 2 9.96V38c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4zm-4 .04H6V9.94h36v28.1z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 22 18\\\" id=\\\"vjs-icon-picture-in-picture-exit\\\">\\n <path d=\\\"M18 4H4v10h14V4zm4 12V1.98C22 .88 21.1 0 20 0H2C.9 0 0 .88 0 1.98V16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H2V1.97h18v14.05z\\\"></path>\\n <path fill=\\\"none\\\" d=\\\"M-1-3h24v24H-1z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 1792 1792\\\" id=\\\"vjs-icon-facebook\\\">\\n <path d=\\\"M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 1792 1792\\\" id=\\\"vjs-icon-linkedin\\\">\\n <path d=\\\"M477 625v991H147V625h330zm21-306q1 73-50.5 122T312 490h-2q-82 0-132-49t-50-122q0-74 51.5-122.5T314 148t133 48.5T498 319zm1166 729v568h-329v-530q0-105-40.5-164.5T1168 862q-63 0-105.5 34.5T999 982q-11 30-11 81v553H659q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5T1285 602q171 0 275 113.5t104 332.5z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 1792 1792\\\" id=\\\"vjs-icon-twitter\\\">\\n <path d=\\\"M1684 408q-67 98-162 167 1 14 1 42 0 130-38 259.5T1369.5 1125 1185 1335.5t-258 146-323 54.5q-271 0-496-145 35 4 78 4 225 0 401-138-105-2-188-64.5T285 1033q33 5 61 5 43 0 85-11-112-23-185.5-111.5T172 710v-4q68 38 146 41-66-44-105-115t-39-154q0-88 44-163 121 149 294.5 238.5T884 653q-8-38-8-74 0-134 94.5-228.5T1199 256q140 0 236 102 109-21 205-78-37 115-142 178 93-10 186-50z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 1792 1792\\\" id=\\\"vjs-icon-tumblr\\\">\\n <path d=\\\"M1328 1329l80 237q-23 35-111 66t-177 32q-104 2-190.5-26T787 1564t-95-106-55.5-120-16.5-118V676H452V461q72-26 129-69.5t91-90 58-102 34-99T779 12q1-5 4.5-8.5T791 0h244v424h333v252h-334v518q0 30 6.5 56t22.5 52.5 49.5 41.5 81.5 14q78-2 134-29z\\\"></path>\\n </symbol>\\n <symbol viewBox=\\\"0 0 1792 1792\\\" id=\\\"vjs-icon-pinterest\\\">\\n <path d=\\\"M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z\\\"></path>\\n </symbol>\\n </defs>\\n</svg>\";\n\n/**\n * @file loader.js\n */\n\n/**\n * The `MediaLoader` is the `Component` that decides which playback technology to load\n * when a player is initialized.\n *\n * @extends Component\n */\nclass MediaLoader extends Component$1 {\n /**\n * Create an instance of this class.\n *\n * @param { import('../player').default } player\n * The `Player` that this class should attach to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Function} [ready]\n * The function that is run when this component is ready.\n */\n constructor(player, options, ready) {\n // MediaLoader has no element\n const options_ = merge$1({\n createEl: false\n }, options);\n super(player, options_, ready);\n\n // If there are no sources when the player is initialized,\n // load the first supported playback technology.\n\n if (!options.playerOptions.sources || options.playerOptions.sources.length === 0) {\n for (let i = 0, j = options.playerOptions.techOrder; i < j.length; i++) {\n const techName = toTitleCase$1(j[i]);\n let tech = Tech.getTech(techName);\n\n // Support old behavior of techs being registered as components.\n // Remove once that deprecated behavior is removed.\n if (!techName) {\n tech = Component$1.getComponent(techName);\n }\n\n // Check if the browser supports this technology\n if (tech && tech.isSupported()) {\n player.loadTech_(techName);\n break;\n }\n }\n } else {\n // Loop through playback technologies (e.g. HTML5) and check for support.\n // Then load the best source.\n // A few assumptions here:\n // All playback technologies respect preload false.\n player.src(options.playerOptions.sources);\n }\n }\n}\nComponent$1.registerComponent('MediaLoader', MediaLoader);\n\n/**\n * @file clickable-component.js\n */\n\n/**\n * Component which is clickable or keyboard actionable, but is not a\n * native HTML button.\n *\n * @extends Component\n */\nclass ClickableComponent extends Component$1 {\n /**\n * Creates an instance of this class.\n *\n * @param { import('./player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of component options.\n *\n * @param {function} [options.clickHandler]\n * The function to call when the button is clicked / activated\n *\n * @param {string} [options.controlText]\n * The text to set on the button\n *\n * @param {string} [options.className]\n * A class or space separated list of classes to add the component\n *\n */\n constructor(player, options) {\n super(player, options);\n if (this.options_.controlText) {\n this.controlText(this.options_.controlText);\n }\n this.handleMouseOver_ = e => this.handleMouseOver(e);\n this.handleMouseOut_ = e => this.handleMouseOut(e);\n this.handleClick_ = e => this.handleClick(e);\n this.handleKeyDown_ = e => this.handleKeyDown(e);\n this.emitTapEvents();\n this.enable();\n }\n\n /**\n * Create the `ClickableComponent`s DOM element.\n *\n * @param {string} [tag=div]\n * The element's node type.\n *\n * @param {Object} [props={}]\n * An object of properties that should be set on the element.\n *\n * @param {Object} [attributes={}]\n * An object of attributes that should be set on the element.\n *\n * @return {Element}\n * The element that gets created.\n */\n createEl(tag = 'div', props = {}, attributes = {}) {\n props = Object.assign({\n className: this.buildCSSClass(),\n tabIndex: 0\n }, props);\n if (tag === 'button') {\n log$1.error(`Creating a ClickableComponent with an HTML element of ${tag} is not supported; use a Button instead.`);\n }\n\n // Add ARIA attributes for clickable element which is not a native HTML button\n attributes = Object.assign({\n role: 'button'\n }, attributes);\n this.tabIndex_ = props.tabIndex;\n const el = createEl(tag, props, attributes);\n if (!this.player_.options_.experimentalSvgIcons) {\n el.appendChild(createEl('span', {\n className: 'vjs-icon-placeholder'\n }, {\n 'aria-hidden': true\n }));\n }\n this.createControlTextEl(el);\n return el;\n }\n dispose() {\n // remove controlTextEl_ on dispose\n this.controlTextEl_ = null;\n super.dispose();\n }\n\n /**\n * Create a control text element on this `ClickableComponent`\n *\n * @param {Element} [el]\n * Parent element for the control text.\n *\n * @return {Element}\n * The control text element that gets created.\n */\n createControlTextEl(el) {\n this.controlTextEl_ = createEl('span', {\n className: 'vjs-control-text'\n }, {\n // let the screen reader user know that the text of the element may change\n 'aria-live': 'polite'\n });\n if (el) {\n el.appendChild(this.controlTextEl_);\n }\n this.controlText(this.controlText_, el);\n return this.controlTextEl_;\n }\n\n /**\n * Get or set the localize text to use for the controls on the `ClickableComponent`.\n *\n * @param {string} [text]\n * Control text for element.\n *\n * @param {Element} [el=this.el()]\n * Element to set the title on.\n *\n * @return {string}\n * - The control text when getting\n */\n controlText(text, el = this.el()) {\n if (text === undefined) {\n return this.controlText_ || 'Need Text';\n }\n const localizedText = this.localize(text);\n\n /** @protected */\n this.controlText_ = text;\n textContent(this.controlTextEl_, localizedText);\n if (!this.nonIconControl && !this.player_.options_.noUITitleAttributes) {\n // Set title attribute if only an icon is shown\n el.setAttribute('title', localizedText);\n }\n }\n\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n buildCSSClass() {\n return `vjs-control vjs-button ${super.buildCSSClass()}`;\n }\n\n /**\n * Enable this `ClickableComponent`\n */\n enable() {\n if (!this.enabled_) {\n this.enabled_ = true;\n this.removeClass('vjs-disabled');\n this.el_.setAttribute('aria-disabled', 'false');\n if (typeof this.tabIndex_ !== 'undefined') {\n this.el_.setAttribute('tabIndex', this.tabIndex_);\n }\n this.on(['tap', 'click'], this.handleClick_);\n this.on('keydown', this.handleKeyDown_);\n }\n }\n\n /**\n * Disable this `ClickableComponent`\n */\n disable() {\n this.enabled_ = false;\n this.addClass('vjs-disabled');\n this.el_.setAttribute('aria-disabled', 'true');\n if (typeof this.tabIndex_ !== 'undefined') {\n this.el_.removeAttribute('tabIndex');\n }\n this.off('mouseover', this.handleMouseOver_);\n this.off('mouseout', this.handleMouseOut_);\n this.off(['tap', 'click'], this.handleClick_);\n this.off('keydown', this.handleKeyDown_);\n }\n\n /**\n * Handles language change in ClickableComponent for the player in components\n *\n *\n */\n handleLanguagechange() {\n this.controlText(this.controlText_);\n }\n\n /**\n * Event handler that is called when a `ClickableComponent` receives a\n * `click` or `tap` event.\n *\n * @param {Event} event\n * The `tap` or `click` event that caused this function to be called.\n *\n * @listens tap\n * @listens click\n * @abstract\n */\n handleClick(event) {\n if (this.options_.clickHandler) {\n this.options_.clickHandler.call(this, arguments);\n }\n }\n\n /**\n * Event handler that is called when a `ClickableComponent` receives a\n * `keydown` event.\n *\n * By default, if the key is Space or Enter, it will trigger a `click` event.\n *\n * @param {KeyboardEvent} event\n * The `keydown` event that caused this function to be called.\n *\n * @listens keydown\n */\n handleKeyDown(event) {\n // Support Space or Enter key operation to fire a click event. Also,\n // prevent the event from propagating through the DOM and triggering\n // Player hotkeys.\n if (keycode.isEventKey(event, 'Space') || keycode.isEventKey(event, 'Enter')) {\n event.preventDefault();\n event.stopPropagation();\n this.trigger('click');\n } else {\n // Pass keypress handling up for unsupported keys\n super.handleKeyDown(event);\n }\n }\n}\nComponent$1.registerComponent('ClickableComponent', ClickableComponent);\n\n/**\n * @file poster-image.js\n */\n\n/**\n * A `ClickableComponent` that handles showing the poster image for the player.\n *\n * @extends ClickableComponent\n */\nclass PosterImage extends ClickableComponent {\n /**\n * Create an instance of this class.\n *\n * @param { import('./player').default } player\n * The `Player` that this class should attach to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n super(player, options);\n this.update();\n this.update_ = e => this.update(e);\n player.on('posterchange', this.update_);\n }\n\n /**\n * Clean up and dispose of the `PosterImage`.\n */\n dispose() {\n this.player().off('posterchange', this.update_);\n super.dispose();\n }\n\n /**\n * Create the `PosterImage`s DOM element.\n *\n * @return {Element}\n * The element that gets created.\n */\n createEl() {\n // The el is an empty div to keep position in the DOM\n // A picture and img el will be inserted when a source is set\n return createEl('div', {\n className: 'vjs-poster'\n });\n }\n\n /**\n * Get or set the `PosterImage`'s crossOrigin option.\n *\n * @param {string|null} [value]\n * The value to set the crossOrigin to. If an argument is\n * given, must be one of `'anonymous'` or `'use-credentials'`, or 'null'.\n *\n * @return {string|null}\n * - The current crossOrigin value of the `Player` when getting.\n * - undefined when setting\n */\n crossOrigin(value) {\n // `null` can be set to unset a value\n if (typeof value === 'undefined') {\n if (this.$('img')) {\n // If the poster's element exists, give its value\n return this.$('img').crossOrigin;\n } else if (this.player_.tech_ && this.player_.tech_.isReady_) {\n // If not but the tech is ready, query the tech\n return this.player_.crossOrigin();\n }\n // Otherwise check options as the poster is usually set before the state of crossorigin\n // can be retrieved by the getter\n return this.player_.options_.crossOrigin || this.player_.options_.crossorigin || null;\n }\n if (value !== null && value !== 'anonymous' && value !== 'use-credentials') {\n this.player_.log.warn(`crossOrigin must be null, \"anonymous\" or \"use-credentials\", given \"${value}\"`);\n return;\n }\n if (this.$('img')) {\n this.$('img').crossOrigin = value;\n }\n return;\n }\n\n /**\n * An {@link EventTarget~EventListener} for {@link Player#posterchange} events.\n *\n * @listens Player#posterchange\n *\n * @param {Event} [event]\n * The `Player#posterchange` event that triggered this function.\n */\n update(event) {\n const url = this.player().poster();\n this.setSrc(url);\n\n // If there's no poster source we should display:none on this component\n // so it's not still clickable or right-clickable\n if (url) {\n this.show();\n } else {\n this.hide();\n }\n }\n\n /**\n * Set the source of the `PosterImage` depending on the display method. (Re)creates\n * the inner picture and img elementss when needed.\n *\n * @param {string} [url]\n * The URL to the source for the `PosterImage`. If not specified or falsy,\n * any source and ant inner picture/img are removed.\n */\n setSrc(url) {\n if (!url) {\n this.el_.textContent = '';\n return;\n }\n if (!this.$('img')) {\n this.el_.appendChild(createEl('picture', {\n className: 'vjs-poster',\n // Don't want poster to be tabbable.\n tabIndex: -1\n }, {}, createEl('img', {\n loading: 'lazy',\n crossOrigin: this.crossOrigin()\n }, {\n alt: ''\n })));\n }\n this.$('img').src = url;\n }\n\n /**\n * An {@link EventTarget~EventListener} for clicks on the `PosterImage`. See\n * {@link ClickableComponent#handleClick} for instances where this will be triggered.\n *\n * @listens tap\n * @listens click\n * @listens keydown\n *\n * @param {Event} event\n + The `click`, `tap` or `keydown` event that caused this function to be called.\n */\n handleClick(event) {\n // We don't want a click to trigger playback when controls are disabled\n if (!this.player_.controls()) {\n return;\n }\n if (this.player_.tech(true)) {\n this.player_.tech(true).focus();\n }\n if (this.player_.paused()) {\n silencePromise(this.player_.play());\n } else {\n this.player_.pause();\n }\n }\n}\n\n/**\n * Get or set the `PosterImage`'s crossorigin option. For the HTML5 player, this\n * sets the `crossOrigin` property on the `<img>` tag to control the CORS\n * behavior.\n *\n * @param {string|null} [value]\n * The value to set the `PosterImages`'s crossorigin to. If an argument is\n * given, must be one of `anonymous` or `use-credentials`.\n *\n * @return {string|null|undefined}\n * - The current crossorigin value of the `Player` when getting.\n * - undefined when setting\n */\nPosterImage.prototype.crossorigin = PosterImage.prototype.crossOrigin;\nComponent$1.registerComponent('PosterImage', PosterImage);\n\n/**\n * @file text-track-display.js\n */\nconst darkGray = '#222';\nconst lightGray = '#ccc';\nconst fontMap = {\n monospace: 'monospace',\n sansSerif: 'sans-serif',\n serif: 'serif',\n monospaceSansSerif: '\"Andale Mono\", \"Lucida Console\", monospace',\n monospaceSerif: '\"Courier New\", monospace',\n proportionalSansSerif: 'sans-serif',\n proportionalSerif: 'serif',\n casual: '\"Comic Sans MS\", Impact, fantasy',\n script: '\"Monotype Corsiva\", cursive',\n smallcaps: '\"Andale Mono\", \"Lucida Console\", monospace, sans-serif'\n};\n\n/**\n * Construct an rgba color from a given hex color code.\n *\n * @param {number} color\n * Hex number for color, like #f0e or #f604e2.\n *\n * @param {number} opacity\n * Value for opacity, 0.0 - 1.0.\n *\n * @return {string}\n * The rgba color that was created, like 'rgba(255, 0, 0, 0.3)'.\n */\nfunction constructColor(color, opacity) {\n let hex;\n if (color.length === 4) {\n // color looks like \"#f0e\"\n hex = color[1] + color[1] + color[2] + color[2] + color[3] + color[3];\n } else if (color.length === 7) {\n // color looks like \"#f604e2\"\n hex = color.slice(1);\n } else {\n throw new Error('Invalid color code provided, ' + color + '; must be formatted as e.g. #f0e or #f604e2.');\n }\n return 'rgba(' + parseInt(hex.slice(0, 2), 16) + ',' + parseInt(hex.slice(2, 4), 16) + ',' + parseInt(hex.slice(4, 6), 16) + ',' + opacity + ')';\n}\n\n/**\n * Try to update the style of a DOM element. Some style changes will throw an error,\n * particularly in IE8. Those should be noops.\n *\n * @param {Element} el\n * The DOM element to be styled.\n *\n * @param {string} style\n * The CSS property on the element that should be styled.\n *\n * @param {string} rule\n * The style rule that should be applied to the property.\n *\n * @private\n */\nfunction tryUpdateStyle(el, style, rule) {\n try {\n el.style[style] = rule;\n } catch (e) {\n // Satisfies linter.\n return;\n }\n}\n\n/**\n * Converts the CSS top/right/bottom/left property numeric value to string in pixels.\n *\n * @param {number} position\n * The CSS top/right/bottom/left property value.\n *\n * @return {string}\n * The CSS property value that was created, like '10px'.\n *\n * @private\n */\nfunction getCSSPositionValue(position) {\n return position ? `${position}px` : '';\n}\n\n/**\n * The component for displaying text track cues.\n *\n * @extends Component\n */\nclass TextTrackDisplay extends Component$1 {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Function} [ready]\n * The function to call when `TextTrackDisplay` is ready.\n */\n constructor(player, options, ready) {\n super(player, options, ready);\n const updateDisplayTextHandler = e => this.updateDisplay(e);\n const updateDisplayHandler = e => {\n this.updateDisplayOverlay();\n this.updateDisplay(e);\n };\n player.on('loadstart', e => this.toggleDisplay(e));\n player.on('texttrackchange', updateDisplayTextHandler);\n player.on('loadedmetadata', e => {\n this.updateDisplayOverlay();\n this.preselectTrack(e);\n });\n\n // This used to be called during player init, but was causing an error\n // if a track should show by default and the display hadn't loaded yet.\n // Should probably be moved to an external track loader when we support\n // tracks that don't need a display.\n player.ready(bind_(this, function () {\n if (player.tech_ && player.tech_.featuresNativeTextTracks) {\n this.hide();\n return;\n }\n player.on('fullscreenchange', updateDisplayHandler);\n player.on('playerresize', updateDisplayHandler);\n const screenOrientation = window$1.screen.orientation || window$1;\n const changeOrientationEvent = window$1.screen.orientation ? 'change' : 'orientationchange';\n screenOrientation.addEventListener(changeOrientationEvent, updateDisplayHandler);\n player.on('dispose', () => screenOrientation.removeEventListener(changeOrientationEvent, updateDisplayHandler));\n const tracks = this.options_.playerOptions.tracks || [];\n for (let i = 0; i < tracks.length; i++) {\n this.player_.addRemoteTextTrack(tracks[i], true);\n }\n this.preselectTrack();\n }));\n }\n\n /**\n * Preselect a track following this precedence:\n * - matches the previously selected {@link TextTrack}'s language and kind\n * - matches the previously selected {@link TextTrack}'s language only\n * - is the first default captions track\n * - is the first default descriptions track\n *\n * @listens Player#loadstart\n */\n preselectTrack() {\n const modes = {\n captions: 1,\n subtitles: 1\n };\n const trackList = this.player_.textTracks();\n const userPref = this.player_.cache_.selectedLanguage;\n let firstDesc;\n let firstCaptions;\n let preferredTrack;\n for (let i = 0; i < trackList.length; i++) {\n const track = trackList[i];\n if (userPref && userPref.enabled && userPref.language && userPref.language === track.language && track.kind in modes) {\n // Always choose the track that matches both language and kind\n if (track.kind === userPref.kind) {\n preferredTrack = track;\n // or choose the first track that matches language\n } else if (!preferredTrack) {\n preferredTrack = track;\n }\n\n // clear everything if offTextTrackMenuItem was clicked\n } else if (userPref && !userPref.enabled) {\n preferredTrack = null;\n firstDesc = null;\n firstCaptions = null;\n } else if (track.default) {\n if (track.kind === 'descriptions' && !firstDesc) {\n firstDesc = track;\n } else if (track.kind in modes && !firstCaptions) {\n firstCaptions = track;\n }\n }\n }\n\n // The preferredTrack matches the user preference and takes\n // precedence over all the other tracks.\n // So, display the preferredTrack before the first default track\n // and the subtitles/captions track before the descriptions track\n if (preferredTrack) {\n preferredTrack.mode = 'showing';\n } else if (firstCaptions) {\n firstCaptions.mode = 'showing';\n } else if (firstDesc) {\n firstDesc.mode = 'showing';\n }\n }\n\n /**\n * Turn display of {@link TextTrack}'s from the current state into the other state.\n * There are only two states:\n * - 'shown'\n * - 'hidden'\n *\n * @listens Player#loadstart\n */\n toggleDisplay() {\n if (this.player_.tech_ && this.player_.tech_.featuresNativeTextTracks) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n /**\n * Create the {@link Component}'s DOM element.\n *\n * @return {Element}\n * The element that was created.\n */\n createEl() {\n return super.createEl('div', {\n className: 'vjs-text-track-display'\n }, {\n 'translate': 'yes',\n 'aria-live': 'off',\n 'aria-atomic': 'true'\n });\n }\n\n /**\n * Clear all displayed {@link TextTrack}s.\n */\n clearDisplay() {\n if (typeof window$1.WebVTT === 'function') {\n window$1.WebVTT.processCues(window$1, [], this.el_);\n }\n }\n\n /**\n * Update the displayed TextTrack when a either a {@link Player#texttrackchange} or\n * a {@link Player#fullscreenchange} is fired.\n *\n * @listens Player#texttrackchange\n * @listens Player#fullscreenchange\n */\n updateDisplay() {\n const tracks = this.player_.textTracks();\n const allowMultipleShowingTracks = this.options_.allowMultipleShowingTracks;\n this.clearDisplay();\n if (allowMultipleShowingTracks) {\n const showingTracks = [];\n for (let i = 0; i < tracks.length; ++i) {\n const track = tracks[i];\n if (track.mode !== 'showing') {\n continue;\n }\n showingTracks.push(track);\n }\n this.updateForTrack(showingTracks);\n return;\n }\n\n // Track display prioritization model: if multiple tracks are 'showing',\n // display the first 'subtitles' or 'captions' track which is 'showing',\n // otherwise display the first 'descriptions' track which is 'showing'\n\n let descriptionsTrack = null;\n let captionsSubtitlesTrack = null;\n let i = tracks.length;\n while (i--) {\n const track = tracks[i];\n if (track.mode === 'showing') {\n if (track.kind === 'descriptions') {\n descriptionsTrack = track;\n } else {\n captionsSubtitlesTrack = track;\n }\n }\n }\n if (captionsSubtitlesTrack) {\n if (this.getAttribute('aria-live') !== 'off') {\n this.setAttribute('aria-live', 'off');\n }\n this.updateForTrack(captionsSubtitlesTrack);\n } else if (descriptionsTrack) {\n if (this.getAttribute('aria-live') !== 'assertive') {\n this.setAttribute('aria-live', 'assertive');\n }\n this.updateForTrack(descriptionsTrack);\n }\n }\n\n /**\n * Updates the displayed TextTrack to be sure it overlays the video when a either\n * a {@link Player#texttrackchange} or a {@link Player#fullscreenchange} is fired.\n */\n updateDisplayOverlay() {\n // inset-inline and inset-block are not supprted on old chrome, but these are\n // only likely to be used on TV devices\n if (!this.player_.videoHeight() || !window$1.CSS.supports('inset-inline: 10px')) {\n return;\n }\n const playerWidth = this.player_.currentWidth();\n const playerHeight = this.player_.currentHeight();\n const playerAspectRatio = playerWidth / playerHeight;\n const videoAspectRatio = this.player_.videoWidth() / this.player_.videoHeight();\n let insetInlineMatch = 0;\n let insetBlockMatch = 0;\n if (Math.abs(playerAspectRatio - videoAspectRatio) > 0.1) {\n if (playerAspectRatio > videoAspectRatio) {\n insetInlineMatch = Math.round((playerWidth - playerHeight * videoAspectRatio) / 2);\n } else {\n insetBlockMatch = Math.round((playerHeight - playerWidth / videoAspectRatio) / 2);\n }\n }\n tryUpdateStyle(this.el_, 'insetInline', getCSSPositionValue(insetInlineMatch));\n tryUpdateStyle(this.el_, 'insetBlock', getCSSPositionValue(insetBlockMatch));\n }\n\n /**\n * Style {@Link TextTrack} activeCues according to {@Link TextTrackSettings}.\n *\n * @param {TextTrack} track\n * Text track object containing active cues to style.\n */\n updateDisplayState(track) {\n const overrides = this.player_.textTrackSettings.getValues();\n const cues = track.activeCues;\n let i = cues.length;\n while (i--) {\n const cue = cues[i];\n if (!cue) {\n continue;\n }\n const cueDiv = cue.displayState;\n if (overrides.color) {\n cueDiv.firstChild.style.color = overrides.color;\n }\n if (overrides.textOpacity) {\n tryUpdateStyle(cueDiv.firstChild, 'color', constructColor(overrides.color || '#fff', overrides.textOpacity));\n }\n if (overrides.backgroundColor) {\n cueDiv.firstChild.style.backgroundColor = overrides.backgroundColor;\n }\n if (overrides.backgroundOpacity) {\n tryUpdateStyle(cueDiv.firstChild, 'backgroundColor', constructColor(overrides.backgroundColor || '#000', overrides.backgroundOpacity));\n }\n if (overrides.windowColor) {\n if (overrides.windowOpacity) {\n tryUpdateStyle(cueDiv, 'backgroundColor', constructColor(overrides.windowColor, overrides.windowOpacity));\n } else {\n cueDiv.style.backgroundColor = overrides.windowColor;\n }\n }\n if (overrides.edgeStyle) {\n if (overrides.edgeStyle === 'dropshadow') {\n cueDiv.firstChild.style.textShadow = `2px 2px 3px ${darkGray}, 2px 2px 4px ${darkGray}, 2px 2px 5px ${darkGray}`;\n } else if (overrides.edgeStyle === 'raised') {\n cueDiv.firstChild.style.textShadow = `1px 1px ${darkGray}, 2px 2px ${darkGray}, 3px 3px ${darkGray}`;\n } else if (overrides.edgeStyle === 'depressed') {\n cueDiv.firstChild.style.textShadow = `1px 1px ${lightGray}, 0 1px ${lightGray}, -1px -1px ${darkGray}, 0 -1px ${darkGray}`;\n } else if (overrides.edgeStyle === 'uniform') {\n cueDiv.firstChild.style.textShadow = `0 0 4px ${darkGray}, 0 0 4px ${darkGray}, 0 0 4px ${darkGray}, 0 0 4px ${darkGray}`;\n }\n }\n if (overrides.fontPercent && overrides.fontPercent !== 1) {\n const fontSize = window$1.parseFloat(cueDiv.style.fontSize);\n cueDiv.style.fontSize = fontSize * overrides.fontPercent + 'px';\n cueDiv.style.height = 'auto';\n cueDiv.style.top = 'auto';\n }\n if (overrides.fontFamily && overrides.fontFamily !== 'default') {\n if (overrides.fontFamily === 'small-caps') {\n cueDiv.firstChild.style.fontVariant = 'small-caps';\n } else {\n cueDiv.firstChild.style.fontFamily = fontMap[overrides.fontFamily];\n }\n }\n }\n }\n\n /**\n * Add an {@link TextTrack} to to the {@link Tech}s {@link TextTrackList}.\n *\n * @param {TextTrack|TextTrack[]} tracks\n * Text track object or text track array to be added to the list.\n */\n updateForTrack(tracks) {\n if (!Array.isArray(tracks)) {\n tracks = [tracks];\n }\n if (typeof window$1.WebVTT !== 'function' || tracks.every(track => {\n return !track.activeCues;\n })) {\n return;\n }\n const cues = [];\n\n // push all active track cues\n for (let i = 0; i < tracks.length; ++i) {\n const track = tracks[i];\n for (let j = 0; j < track.activeCues.length; ++j) {\n cues.push(track.activeCues[j]);\n }\n }\n\n // removes all cues before it processes new ones\n window$1.WebVTT.processCues(window$1, cues, this.el_);\n\n // add unique class to each language text track & add settings styling if necessary\n for (let i = 0; i < tracks.length; ++i) {\n const track = tracks[i];\n for (let j = 0; j < track.activeCues.length; ++j) {\n const cueEl = track.activeCues[j].displayState;\n addClass(cueEl, 'vjs-text-track-cue', 'vjs-text-track-cue-' + (track.language ? track.language : i));\n if (track.language) {\n setAttribute(cueEl, 'lang', track.language);\n }\n }\n if (this.player_.textTrackSettings) {\n this.updateDisplayState(track);\n }\n }\n }\n}\nComponent$1.registerComponent('TextTrackDisplay', TextTrackDisplay);\n\n/**\n * @file loading-spinner.js\n */\n\n/**\n * A loading spinner for use during waiting/loading events.\n *\n * @extends Component\n */\nclass LoadingSpinner extends Component$1 {\n /**\n * Create the `LoadingSpinner`s DOM element.\n *\n * @return {Element}\n * The dom element that gets created.\n */\n createEl() {\n const isAudio = this.player_.isAudio();\n const playerType = this.localize(isAudio ? 'Audio Player' : 'Video Player');\n const controlText = createEl('span', {\n className: 'vjs-control-text',\n textContent: this.localize('{1} is loading.', [playerType])\n });\n const el = super.createEl('div', {\n className: 'vjs-loading-spinner',\n dir: 'ltr'\n });\n el.appendChild(controlText);\n return el;\n }\n\n /**\n * Update control text on languagechange\n */\n handleLanguagechange() {\n this.$('.vjs-control-text').textContent = this.localize('{1} is loading.', [this.player_.isAudio() ? 'Audio Player' : 'Video Player']);\n }\n}\nComponent$1.registerComponent('LoadingSpinner', LoadingSpinner);\n\n/**\n * @file button.js\n */\n\n/**\n * Base class for all buttons.\n *\n * @extends ClickableComponent\n */\nclass Button extends ClickableComponent {\n /**\n * Create the `Button`s DOM element.\n *\n * @param {string} [tag=\"button\"]\n * The element's node type. This argument is IGNORED: no matter what\n * is passed, it will always create a `button` element.\n *\n * @param {Object} [props={}]\n * An object of properties that should be set on the element.\n *\n * @param {Object} [attributes={}]\n * An object of attributes that should be set on the element.\n *\n * @return {Element}\n * The element that gets created.\n */\n createEl(tag, props = {}, attributes = {}) {\n tag = 'button';\n props = Object.assign({\n className: this.buildCSSClass()\n }, props);\n\n // Add attributes for button element\n attributes = Object.assign({\n // Necessary since the default button type is \"submit\"\n type: 'button'\n }, attributes);\n const el = createEl(tag, props, attributes);\n if (!this.player_.options_.experimentalSvgIcons) {\n el.appendChild(createEl('span', {\n className: 'vjs-icon-placeholder'\n }, {\n 'aria-hidden': true\n }));\n }\n this.createControlTextEl(el);\n return el;\n }\n\n /**\n * Add a child `Component` inside of this `Button`.\n *\n * @param {string|Component} child\n * The name or instance of a child to add.\n *\n * @param {Object} [options={}]\n * The key/value store of options that will get passed to children of\n * the child.\n *\n * @return {Component}\n * The `Component` that gets added as a child. When using a string the\n * `Component` will get created by this process.\n *\n * @deprecated since version 5\n */\n addChild(child, options = {}) {\n const className = this.constructor.name;\n log$1.warn(`Adding an actionable (user controllable) child to a Button (${className}) is not supported; use a ClickableComponent instead.`);\n\n // Avoid the error message generated by ClickableComponent's addChild method\n return Component$1.prototype.addChild.call(this, child, options);\n }\n\n /**\n * Enable the `Button` element so that it can be activated or clicked. Use this with\n * {@link Button#disable}.\n */\n enable() {\n super.enable();\n this.el_.removeAttribute('disabled');\n }\n\n /**\n * Disable the `Button` element so that it cannot be activated or clicked. Use this with\n * {@link Button#enable}.\n */\n disable() {\n super.disable();\n this.el_.setAttribute('disabled', 'disabled');\n }\n\n /**\n * This gets called when a `Button` has focus and `keydown` is triggered via a key\n * press.\n *\n * @param {KeyboardEvent} event\n * The event that caused this function to get called.\n *\n * @listens keydown\n */\n handleKeyDown(event) {\n // Ignore Space or Enter key operation, which is handled by the browser for\n // a button - though not for its super class, ClickableComponent. Also,\n // prevent the event from propagating through the DOM and triggering Player\n // hotkeys. We do not preventDefault here because we _want_ the browser to\n // handle it.\n if (keycode.isEventKey(event, 'Space') || keycode.isEventKey(event, 'Enter')) {\n event.stopPropagation();\n return;\n }\n\n // Pass keypress handling up for unsupported keys\n super.handleKeyDown(event);\n }\n}\nComponent$1.registerComponent('Button', Button);\n\n/**\n * @file big-play-button.js\n */\n\n/**\n * The initial play button that shows before the video has played. The hiding of the\n * `BigPlayButton` get done via CSS and `Player` states.\n *\n * @extends Button\n */\nclass BigPlayButton extends Button {\n constructor(player, options) {\n super(player, options);\n this.mouseused_ = false;\n this.setIcon('play');\n this.on('mousedown', e => this.handleMouseDown(e));\n }\n\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object. Always returns 'vjs-big-play-button'.\n */\n buildCSSClass() {\n return 'vjs-big-play-button';\n }\n\n /**\n * This gets called when a `BigPlayButton` \"clicked\". See {@link ClickableComponent}\n * for more detailed information on what a click can be.\n *\n * @param {KeyboardEvent|MouseEvent|TouchEvent} event\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n handleClick(event) {\n const playPromise = this.player_.play();\n\n // exit early if clicked via the mouse\n if (this.mouseused_ && 'clientX' in event && 'clientY' in event) {\n silencePromise(playPromise);\n if (this.player_.tech(true)) {\n this.player_.tech(true).focus();\n }\n return;\n }\n const cb = this.player_.getChild('controlBar');\n const playToggle = cb && cb.getChild('playToggle');\n if (!playToggle) {\n this.player_.tech(true).focus();\n return;\n }\n const playFocus = () => playToggle.focus();\n if (isPromise(playPromise)) {\n playPromise.then(playFocus, () => {});\n } else {\n this.setTimeout(playFocus, 1);\n }\n }\n\n /**\n * Event handler that is called when a `BigPlayButton` receives a\n * `keydown` event.\n *\n * @param {KeyboardEvent} event\n * The `keydown` event that caused this function to be called.\n *\n * @listens keydown\n */\n handleKeyDown(event) {\n this.mouseused_ = false;\n super.handleKeyDown(event);\n }\n\n /**\n * Handle `mousedown` events on the `BigPlayButton`.\n *\n * @param {MouseEvent} event\n * `mousedown` or `touchstart` event that triggered this function\n *\n * @listens mousedown\n */\n handleMouseDown(event) {\n this.mouseused_ = true;\n }\n}\n\n/**\n * The text that should display over the `BigPlayButton`s controls. Added to for localization.\n *\n * @type {string}\n * @protected\n */\nBigPlayButton.prototype.controlText_ = 'Play Video';\nComponent$1.registerComponent('BigPlayButton', BigPlayButton);\n\n/**\n * @file close-button.js\n */\n\n/**\n * The `CloseButton` is a `{@link Button}` that fires a `close` event when\n * it gets clicked.\n *\n * @extends Button\n */\nclass CloseButton extends Button {\n /**\n * Creates an instance of the this class.\n *\n * @param { import('./player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n super(player, options);\n this.setIcon('cancel');\n this.controlText(options && options.controlText || this.localize('Close'));\n }\n\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n buildCSSClass() {\n return `vjs-close-button ${super.buildCSSClass()}`;\n }\n\n /**\n * This gets called when a `CloseButton` gets clicked. See\n * {@link ClickableComponent#handleClick} for more information on when\n * this will be triggered\n *\n * @param {Event} event\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n * @fires CloseButton#close\n */\n handleClick(event) {\n /**\n * Triggered when the a `CloseButton` is clicked.\n *\n * @event CloseButton#close\n * @type {Event}\n *\n * @property {boolean} [bubbles=false]\n * set to false so that the close event does not\n * bubble up to parents if there is no listener\n */\n this.trigger({\n type: 'close',\n bubbles: false\n });\n }\n /**\n * Event handler that is called when a `CloseButton` receives a\n * `keydown` event.\n *\n * By default, if the key is Esc, it will trigger a `click` event.\n *\n * @param {KeyboardEvent} event\n * The `keydown` event that caused this function to be called.\n *\n * @listens keydown\n */\n handleKeyDown(event) {\n // Esc button will trigger `click` event\n if (keycode.isEventKey(event, 'Esc')) {\n event.preventDefault();\n event.stopPropagation();\n this.trigger('click');\n } else {\n // Pass keypress handling up for unsupported keys\n super.handleKeyDown(event);\n }\n }\n}\nComponent$1.registerComponent('CloseButton', CloseButton);\n\n/**\n * @file play-toggle.js\n */\n\n/**\n * Button to toggle between play and pause.\n *\n * @extends Button\n */\nclass PlayToggle extends Button {\n /**\n * Creates an instance of this class.\n *\n * @param { import('./player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options={}]\n * The key/value store of player options.\n */\n constructor(player, options = {}) {\n super(player, options);\n\n // show or hide replay icon\n options.replay = options.replay === undefined || options.replay;\n this.setIcon('play');\n this.on(player, 'play', e => this.handlePlay(e));\n this.on(player, 'pause', e => this.handlePause(e));\n if (options.replay) {\n this.on(player, 'ended', e => this.handleEnded(e));\n }\n }\n\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n buildCSSClass() {\n return `vjs-play-control ${super.buildCSSClass()}`;\n }\n\n /**\n * This gets called when an `PlayToggle` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n handleClick(event) {\n if (this.player_.paused()) {\n silencePromise(this.player_.play());\n } else {\n this.player_.pause();\n }\n }\n\n /**\n * This gets called once after the video has ended and the user seeks so that\n * we can change the replay button back to a play button.\n *\n * @param {Event} [event]\n * The event that caused this function to run.\n *\n * @listens Player#seeked\n */\n handleSeeked(event) {\n this.removeClass('vjs-ended');\n if (this.player_.paused()) {\n this.handlePause(event);\n } else {\n this.handlePlay(event);\n }\n }\n\n /**\n * Add the vjs-playing class to the element so it can change appearance.\n *\n * @param {Event} [event]\n * The event that caused this function to run.\n *\n * @listens Player#play\n */\n handlePlay(event) {\n this.removeClass('vjs-ended', 'vjs-paused');\n this.addClass('vjs-playing');\n // change the button text to \"Pause\"\n this.setIcon('pause');\n this.controlText('Pause');\n }\n\n /**\n * Add the vjs-paused class to the element so it can change appearance.\n *\n * @param {Event} [event]\n * The event that caused this function to run.\n *\n * @listens Player#pause\n */\n handlePause(event) {\n this.removeClass('vjs-playing');\n this.addClass('vjs-paused');\n // change the button text to \"Play\"\n this.setIcon('play');\n this.controlText('Play');\n }\n\n /**\n * Add the vjs-ended class to the element so it can change appearance\n *\n * @param {Event} [event]\n * The event that caused this function to run.\n *\n * @listens Player#ended\n */\n handleEnded(event) {\n this.removeClass('vjs-playing');\n this.addClass('vjs-ended');\n // change the button text to \"Replay\"\n this.setIcon('replay');\n this.controlText('Replay');\n\n // on the next seek remove the replay button\n this.one(this.player_, 'seeked', e => this.handleSeeked(e));\n }\n}\n\n/**\n * The text that should display over the `PlayToggle`s controls. Added for localization.\n *\n * @type {string}\n * @protected\n */\nPlayToggle.prototype.controlText_ = 'Play';\nComponent$1.registerComponent('PlayToggle', PlayToggle);\n\n/**\n * @file time-display.js\n */\n\n/**\n * Displays time information about the video\n *\n * @extends Component\n */\nclass TimeDisplay extends Component$1 {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../../player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n super(player, options);\n this.on(player, ['timeupdate', 'ended'], e => this.updateContent(e));\n this.updateTextNode_();\n }\n\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n createEl() {\n const className = this.buildCSSClass();\n const el = super.createEl('div', {\n className: `${className} vjs-time-control vjs-control`\n });\n const span = createEl('span', {\n className: 'vjs-control-text',\n textContent: `${this.localize(this.labelText_)}\\u00a0`\n }, {\n role: 'presentation'\n });\n el.appendChild(span);\n this.contentEl_ = createEl('span', {\n className: `${className}-display`\n }, {\n // span elements have no implicit role, but some screen readers (notably VoiceOver)\n // treat them as a break between items in the DOM when using arrow keys\n // (or left-to-right swipes on iOS) to read contents of a page. Using\n // role='presentation' causes VoiceOver to NOT treat this span as a break.\n role: 'presentation'\n });\n el.appendChild(this.contentEl_);\n return el;\n }\n dispose() {\n this.contentEl_ = null;\n this.textNode_ = null;\n super.dispose();\n }\n\n /**\n * Updates the time display text node with a new time\n *\n * @param {number} [time=0] the time to update to\n *\n * @private\n */\n updateTextNode_(time = 0) {\n time = formatTime(time);\n if (this.formattedTime_ === time) {\n return;\n }\n this.formattedTime_ = time;\n this.requestNamedAnimationFrame('TimeDisplay#updateTextNode_', () => {\n if (!this.contentEl_) {\n return;\n }\n let oldNode = this.textNode_;\n if (oldNode && this.contentEl_.firstChild !== oldNode) {\n oldNode = null;\n log$1.warn('TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.');\n }\n this.textNode_ = document.createTextNode(this.formattedTime_);\n if (!this.textNode_) {\n return;\n }\n if (oldNode) {\n this.contentEl_.replaceChild(this.textNode_, oldNode);\n } else {\n this.contentEl_.appendChild(this.textNode_);\n }\n });\n }\n\n /**\n * To be filled out in the child class, should update the displayed time\n * in accordance with the fact that the current time has changed.\n *\n * @param {Event} [event]\n * The `timeupdate` event that caused this to run.\n *\n * @listens Player#timeupdate\n */\n updateContent(event) {}\n}\n\n/**\n * The text that is added to the `TimeDisplay` for screen reader users.\n *\n * @type {string}\n * @private\n */\nTimeDisplay.prototype.labelText_ = 'Time';\n\n/**\n * The text that should display over the `TimeDisplay`s controls. Added to for localization.\n *\n * @type {string}\n * @protected\n *\n * @deprecated in v7; controlText_ is not used in non-active display Components\n */\nTimeDisplay.prototype.controlText_ = 'Time';\nComponent$1.registerComponent('TimeDisplay', TimeDisplay);\n\n/**\n * @file current-time-display.js\n */\n\n/**\n * Displays the current time\n *\n * @extends Component\n */\nclass CurrentTimeDisplay extends TimeDisplay {\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n buildCSSClass() {\n return 'vjs-current-time';\n }\n\n /**\n * Update current time display\n *\n * @param {Event} [event]\n * The `timeupdate` event that caused this function to run.\n *\n * @listens Player#timeupdate\n */\n updateContent(event) {\n // Allows for smooth scrubbing, when player can't keep up.\n let time;\n if (this.player_.ended()) {\n time = this.player_.duration();\n } else {\n time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();\n }\n this.updateTextNode_(time);\n }\n}\n\n/**\n * The text that is added to the `CurrentTimeDisplay` for screen reader users.\n *\n * @type {string}\n * @private\n */\nCurrentTimeDisplay.prototype.labelText_ = 'Current Time';\n\n/**\n * The text that should display over the `CurrentTimeDisplay`s controls. Added to for localization.\n *\n * @type {string}\n * @protected\n *\n * @deprecated in v7; controlText_ is not used in non-active display Components\n */\nCurrentTimeDisplay.prototype.controlText_ = 'Current Time';\nComponent$1.registerComponent('CurrentTimeDisplay', CurrentTimeDisplay);\n\n/**\n * @file duration-display.js\n */\n\n/**\n * Displays the duration\n *\n * @extends Component\n */\nclass DurationDisplay extends TimeDisplay {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../../player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n super(player, options);\n const updateContent = e => this.updateContent(e);\n\n // we do not want to/need to throttle duration changes,\n // as they should always display the changed duration as\n // it has changed\n this.on(player, 'durationchange', updateContent);\n\n // Listen to loadstart because the player duration is reset when a new media element is loaded,\n // but the durationchange on the user agent will not fire.\n // @see [Spec]{@link https://www.w3.org/TR/2011/WD-html5-20110113/video.html#media-element-load-algorithm}\n this.on(player, 'loadstart', updateContent);\n\n // Also listen for timeupdate (in the parent) and loadedmetadata because removing those\n // listeners could have broken dependent applications/libraries. These\n // can likely be removed for 7.0.\n this.on(player, 'loadedmetadata', updateContent);\n }\n\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n buildCSSClass() {\n return 'vjs-duration';\n }\n\n /**\n * Update duration time display.\n *\n * @param {Event} [event]\n * The `durationchange`, `timeupdate`, or `loadedmetadata` event that caused\n * this function to be called.\n *\n * @listens Player#durationchange\n * @listens Player#timeupdate\n * @listens Player#loadedmetadata\n */\n updateContent(event) {\n const duration = this.player_.duration();\n this.updateTextNode_(duration);\n }\n}\n\n/**\n * The text that is added to the `DurationDisplay` for screen reader users.\n *\n * @type {string}\n * @private\n */\nDurationDisplay.prototype.labelText_ = 'Duration';\n\n/**\n * The text that should display over the `DurationDisplay`s controls. Added to for localization.\n *\n * @type {string}\n * @protected\n *\n * @deprecated in v7; controlText_ is not used in non-active display Components\n */\nDurationDisplay.prototype.controlText_ = 'Duration';\nComponent$1.registerComponent('DurationDisplay', DurationDisplay);\n\n/**\n * @file time-divider.js\n */\n\n/**\n * The separator between the current time and duration.\n * Can be hidden if it's not needed in the design.\n *\n * @extends Component\n */\nclass TimeDivider extends Component$1 {\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n createEl() {\n const el = super.createEl('div', {\n className: 'vjs-time-control vjs-time-divider'\n }, {\n // this element and its contents can be hidden from assistive techs since\n // it is made extraneous by the announcement of the control text\n // for the current time and duration displays\n 'aria-hidden': true\n });\n const div = super.createEl('div');\n const span = super.createEl('span', {\n textContent: '/'\n });\n div.appendChild(span);\n el.appendChild(div);\n return el;\n }\n}\nComponent$1.registerComponent('TimeDivider', TimeDivider);\n\n/**\n * @file remaining-time-display.js\n */\n\n/**\n * Displays the time left in the video\n *\n * @extends Component\n */\nclass RemainingTimeDisplay extends TimeDisplay {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../../player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n super(player, options);\n this.on(player, 'durationchange', e => this.updateContent(e));\n }\n\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n buildCSSClass() {\n return 'vjs-remaining-time';\n }\n\n /**\n * Create the `Component`'s DOM element with the \"minus\" character prepend to the time\n *\n * @return {Element}\n * The element that was created.\n */\n createEl() {\n const el = super.createEl();\n if (this.options_.displayNegative !== false) {\n el.insertBefore(createEl('span', {}, {\n 'aria-hidden': true\n }, '-'), this.contentEl_);\n }\n return el;\n }\n\n /**\n * Update remaining time display.\n *\n * @param {Event} [event]\n * The `timeupdate` or `durationchange` event that caused this to run.\n *\n * @listens Player#timeupdate\n * @listens Player#durationchange\n */\n updateContent(event) {\n if (typeof this.player_.duration() !== 'number') {\n return;\n }\n let time;\n\n // @deprecated We should only use remainingTimeDisplay\n // as of video.js 7\n if (this.player_.ended()) {\n time = 0;\n } else if (this.player_.remainingTimeDisplay) {\n time = this.player_.remainingTimeDisplay();\n } else {\n time = this.player_.remainingTime();\n }\n this.updateTextNode_(time);\n }\n}\n\n/**\n * The text that is added to the `RemainingTimeDisplay` for screen reader users.\n *\n * @type {string}\n * @private\n */\nRemainingTimeDisplay.prototype.labelText_ = 'Remaining Time';\n\n/**\n * The text that should display over the `RemainingTimeDisplay`s controls. Added to for localization.\n *\n * @type {string}\n * @protected\n *\n * @deprecated in v7; controlText_ is not used in non-active display Components\n */\nRemainingTimeDisplay.prototype.controlText_ = 'Remaining Time';\nComponent$1.registerComponent('RemainingTimeDisplay', RemainingTimeDisplay);\n\n/**\n * @file live-display.js\n */\n\n// TODO - Future make it click to snap to live\n\n/**\n * Displays the live indicator when duration is Infinity.\n *\n * @extends Component\n */\nclass LiveDisplay extends Component$1 {\n /**\n * Creates an instance of this class.\n *\n * @param { import('./player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n super(player, options);\n this.updateShowing();\n this.on(this.player(), 'durationchange', e => this.updateShowing(e));\n }\n\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n createEl() {\n const el = super.createEl('div', {\n className: 'vjs-live-control vjs-control'\n });\n this.contentEl_ = createEl('div', {\n className: 'vjs-live-display'\n }, {\n 'aria-live': 'off'\n });\n this.contentEl_.appendChild(createEl('span', {\n className: 'vjs-control-text',\n textContent: `${this.localize('Stream Type')}\\u00a0`\n }));\n this.contentEl_.appendChild(document.createTextNode(this.localize('LIVE')));\n el.appendChild(this.contentEl_);\n return el;\n }\n dispose() {\n this.contentEl_ = null;\n super.dispose();\n }\n\n /**\n * Check the duration to see if the LiveDisplay should be showing or not. Then show/hide\n * it accordingly\n *\n * @param {Event} [event]\n * The {@link Player#durationchange} event that caused this function to run.\n *\n * @listens Player#durationchange\n */\n updateShowing(event) {\n if (this.player().duration() === Infinity) {\n this.show();\n } else {\n this.hide();\n }\n }\n}\nComponent$1.registerComponent('LiveDisplay', LiveDisplay);\n\n/**\n * @file seek-to-live.js\n */\n\n/**\n * Displays the live indicator when duration is Infinity.\n *\n * @extends Component\n */\nclass SeekToLive extends Button {\n /**\n * Creates an instance of this class.\n *\n * @param { import('./player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n super(player, options);\n this.updateLiveEdgeStatus();\n if (this.player_.liveTracker) {\n this.updateLiveEdgeStatusHandler_ = e => this.updateLiveEdgeStatus(e);\n this.on(this.player_.liveTracker, 'liveedgechange', this.updateLiveEdgeStatusHandler_);\n }\n }\n\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n createEl() {\n const el = super.createEl('button', {\n className: 'vjs-seek-to-live-control vjs-control'\n });\n this.setIcon('circle', el);\n this.textEl_ = createEl('span', {\n className: 'vjs-seek-to-live-text',\n textContent: this.localize('LIVE')\n }, {\n 'aria-hidden': 'true'\n });\n el.appendChild(this.textEl_);\n return el;\n }\n\n /**\n * Update the state of this button if we are at the live edge\n * or not\n */\n updateLiveEdgeStatus() {\n // default to live edge\n if (!this.player_.liveTracker || this.player_.liveTracker.atLiveEdge()) {\n this.setAttribute('aria-disabled', true);\n this.addClass('vjs-at-live-edge');\n this.controlText('Seek to live, currently playing live');\n } else {\n this.setAttribute('aria-disabled', false);\n this.removeClass('vjs-at-live-edge');\n this.controlText('Seek to live, currently behind live');\n }\n }\n\n /**\n * On click bring us as near to the live point as possible.\n * This requires that we wait for the next `live-seekable-change`\n * event which will happen every segment length seconds.\n */\n handleClick() {\n this.player_.liveTracker.seekToLiveEdge();\n }\n\n /**\n * Dispose of the element and stop tracking\n */\n dispose() {\n if (this.player_.liveTracker) {\n this.off(this.player_.liveTracker, 'liveedgechange', this.updateLiveEdgeStatusHandler_);\n }\n this.textEl_ = null;\n super.dispose();\n }\n}\n/**\n * The text that should display over the `SeekToLive`s control. Added for localization.\n *\n * @type {string}\n * @protected\n */\nSeekToLive.prototype.controlText_ = 'Seek to live, currently playing live';\nComponent$1.registerComponent('SeekToLive', SeekToLive);\n\n/**\n * @file num.js\n * @module num\n */\n\n/**\n * Keep a number between a min and a max value\n *\n * @param {number} number\n * The number to clamp\n *\n * @param {number} min\n * The minimum value\n * @param {number} max\n * The maximum value\n *\n * @return {number}\n * the clamped number\n */\nfunction clamp(number, min, max) {\n number = Number(number);\n return Math.min(max, Math.max(min, isNaN(number) ? min : number));\n}\n\nvar Num = /*#__PURE__*/Object.freeze({\n __proto__: null,\n clamp: clamp\n});\n\n/**\n * @file slider.js\n */\n\n/**\n * The base functionality for a slider. Can be vertical or horizontal.\n * For instance the volume bar or the seek bar on a video is a slider.\n *\n * @extends Component\n */\nclass Slider extends Component$1 {\n /**\n * Create an instance of this class\n *\n * @param { import('../player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n super(player, options);\n this.handleMouseDown_ = e => this.handleMouseDown(e);\n this.handleMouseUp_ = e => this.handleMouseUp(e);\n this.handleKeyDown_ = e => this.handleKeyDown(e);\n this.handleClick_ = e => this.handleClick(e);\n this.handleMouseMove_ = e => this.handleMouseMove(e);\n this.update_ = e => this.update(e);\n\n // Set property names to bar to match with the child Slider class is looking for\n this.bar = this.getChild(this.options_.barName);\n\n // Set a horizontal or vertical class on the slider depending on the slider type\n this.vertical(!!this.options_.vertical);\n this.enable();\n }\n\n /**\n * Are controls are currently enabled for this slider or not.\n *\n * @return {boolean}\n * true if controls are enabled, false otherwise\n */\n enabled() {\n return this.enabled_;\n }\n\n /**\n * Enable controls for this slider if they are disabled\n */\n enable() {\n if (this.enabled()) {\n return;\n }\n this.on('mousedown', this.handleMouseDown_);\n this.on('touchstart', this.handleMouseDown_);\n this.on('keydown', this.handleKeyDown_);\n this.on('click', this.handleClick_);\n\n // TODO: deprecated, controlsvisible does not seem to be fired\n this.on(this.player_, 'controlsvisible', this.update);\n if (this.playerEvent) {\n this.on(this.player_, this.playerEvent, this.update);\n }\n this.removeClass('disabled');\n this.setAttribute('tabindex', 0);\n this.enabled_ = true;\n }\n\n /**\n * Disable controls for this slider if they are enabled\n */\n disable() {\n if (!this.enabled()) {\n return;\n }\n const doc = this.bar.el_.ownerDocument;\n this.off('mousedown', this.handleMouseDown_);\n this.off('touchstart', this.handleMouseDown_);\n this.off('keydown', this.handleKeyDown_);\n this.off('click', this.handleClick_);\n this.off(this.player_, 'controlsvisible', this.update_);\n this.off(doc, 'mousemove', this.handleMouseMove_);\n this.off(doc, 'mouseup', this.handleMouseUp_);\n this.off(doc, 'touchmove', this.handleMouseMove_);\n this.off(doc, 'touchend', this.handleMouseUp_);\n this.removeAttribute('tabindex');\n this.addClass('disabled');\n if (this.playerEvent) {\n this.off(this.player_, this.playerEvent, this.update);\n }\n this.enabled_ = false;\n }\n\n /**\n * Create the `Slider`s DOM element.\n *\n * @param {string} type\n * Type of element to create.\n *\n * @param {Object} [props={}]\n * List of properties in Object form.\n *\n * @param {Object} [attributes={}]\n * list of attributes in Object form.\n *\n * @return {Element}\n * The element that gets created.\n */\n createEl(type, props = {}, attributes = {}) {\n // Add the slider element class to all sub classes\n props.className = props.className + ' vjs-slider';\n props = Object.assign({\n tabIndex: 0\n }, props);\n attributes = Object.assign({\n 'role': 'slider',\n 'aria-valuenow': 0,\n 'aria-valuemin': 0,\n 'aria-valuemax': 100\n }, attributes);\n return super.createEl(type, props, attributes);\n }\n\n /**\n * Handle `mousedown` or `touchstart` events on the `Slider`.\n *\n * @param {MouseEvent} event\n * `mousedown` or `touchstart` event that triggered this function\n *\n * @listens mousedown\n * @listens touchstart\n * @fires Slider#slideractive\n */\n handleMouseDown(event) {\n const doc = this.bar.el_.ownerDocument;\n if (event.type === 'mousedown') {\n event.preventDefault();\n }\n // Do not call preventDefault() on touchstart in Chrome\n // to avoid console warnings. Use a 'touch-action: none' style\n // instead to prevent unintended scrolling.\n // https://developers.google.com/web/updates/2017/01/scrolling-intervention\n if (event.type === 'touchstart' && !IS_CHROME) {\n event.preventDefault();\n }\n blockTextSelection();\n this.addClass('vjs-sliding');\n /**\n * Triggered when the slider is in an active state\n *\n * @event Slider#slideractive\n * @type {MouseEvent}\n */\n this.trigger('slideractive');\n this.on(doc, 'mousemove', this.handleMouseMove_);\n this.on(doc, 'mouseup', this.handleMouseUp_);\n this.on(doc, 'touchmove', this.handleMouseMove_);\n this.on(doc, 'touchend', this.handleMouseUp_);\n this.handleMouseMove(event, true);\n }\n\n /**\n * Handle the `mousemove`, `touchmove`, and `mousedown` events on this `Slider`.\n * The `mousemove` and `touchmove` events will only only trigger this function during\n * `mousedown` and `touchstart`. This is due to {@link Slider#handleMouseDown} and\n * {@link Slider#handleMouseUp}.\n *\n * @param {MouseEvent} event\n * `mousedown`, `mousemove`, `touchstart`, or `touchmove` event that triggered\n * this function\n * @param {boolean} mouseDown this is a flag that should be set to true if `handleMouseMove` is called directly. It allows us to skip things that should not happen if coming from mouse down but should happen on regular mouse move handler. Defaults to false.\n *\n * @listens mousemove\n * @listens touchmove\n */\n handleMouseMove(event) {}\n\n /**\n * Handle `mouseup` or `touchend` events on the `Slider`.\n *\n * @param {MouseEvent} event\n * `mouseup` or `touchend` event that triggered this function.\n *\n * @listens touchend\n * @listens mouseup\n * @fires Slider#sliderinactive\n */\n handleMouseUp(event) {\n const doc = this.bar.el_.ownerDocument;\n unblockTextSelection();\n this.removeClass('vjs-sliding');\n /**\n * Triggered when the slider is no longer in an active state.\n *\n * @event Slider#sliderinactive\n * @type {Event}\n */\n this.trigger('sliderinactive');\n this.off(doc, 'mousemove', this.handleMouseMove_);\n this.off(doc, 'mouseup', this.handleMouseUp_);\n this.off(doc, 'touchmove', this.handleMouseMove_);\n this.off(doc, 'touchend', this.handleMouseUp_);\n this.update();\n }\n\n /**\n * Update the progress bar of the `Slider`.\n *\n * @return {number}\n * The percentage of progress the progress bar represents as a\n * number from 0 to 1.\n */\n update() {\n // In VolumeBar init we have a setTimeout for update that pops and update\n // to the end of the execution stack. The player is destroyed before then\n // update will cause an error\n // If there's no bar...\n if (!this.el_ || !this.bar) {\n return;\n }\n\n // clamp progress between 0 and 1\n // and only round to four decimal places, as we round to two below\n const progress = this.getProgress();\n if (progress === this.progress_) {\n return progress;\n }\n this.progress_ = progress;\n this.requestNamedAnimationFrame('Slider#update', () => {\n // Set the new bar width or height\n const sizeKey = this.vertical() ? 'height' : 'width';\n\n // Convert to a percentage for css value\n this.bar.el().style[sizeKey] = (progress * 100).toFixed(2) + '%';\n });\n return progress;\n }\n\n /**\n * Get the percentage of the bar that should be filled\n * but clamped and rounded.\n *\n * @return {number}\n * percentage filled that the slider is\n */\n getProgress() {\n return Number(clamp(this.getPercent(), 0, 1).toFixed(4));\n }\n\n /**\n * Calculate distance for slider\n *\n * @param {Event} event\n * The event that caused this function to run.\n *\n * @return {number}\n * The current position of the Slider.\n * - position.x for vertical `Slider`s\n * - position.y for horizontal `Slider`s\n */\n calculateDistance(event) {\n const position = getPointerPosition(this.el_, event);\n if (this.vertical()) {\n return position.y;\n }\n return position.x;\n }\n\n /**\n * Handle a `keydown` event on the `Slider`. Watches for left, right, up, and down\n * arrow keys. This function will only be called when the slider has focus. See\n * {@link Slider#handleFocus} and {@link Slider#handleBlur}.\n *\n * @param {KeyboardEvent} event\n * the `keydown` event that caused this function to run.\n *\n * @listens keydown\n */\n handleKeyDown(event) {\n // Left and Down Arrows\n if (keycode.isEventKey(event, 'Left') || keycode.isEventKey(event, 'Down')) {\n event.preventDefault();\n event.stopPropagation();\n this.stepBack();\n\n // Up and Right Arrows\n } else if (keycode.isEventKey(event, 'Right') || keycode.isEventKey(event, 'Up')) {\n event.preventDefault();\n event.stopPropagation();\n this.stepForward();\n } else {\n // Pass keydown handling up for unsupported keys\n super.handleKeyDown(event);\n }\n }\n\n /**\n * Listener for click events on slider, used to prevent clicks\n * from bubbling up to parent elements like button menus.\n *\n * @param {Object} event\n * Event that caused this object to run\n */\n handleClick(event) {\n event.stopPropagation();\n event.preventDefault();\n }\n\n /**\n * Get/set if slider is horizontal for vertical\n *\n * @param {boolean} [bool]\n * - true if slider is vertical,\n * - false is horizontal\n *\n * @return {boolean}\n * - true if slider is vertical, and getting\n * - false if the slider is horizontal, and getting\n */\n vertical(bool) {\n if (bool === undefined) {\n return this.vertical_ || false;\n }\n this.vertical_ = !!bool;\n if (this.vertical_) {\n this.addClass('vjs-slider-vertical');\n } else {\n this.addClass('vjs-slider-horizontal');\n }\n }\n}\nComponent$1.registerComponent('Slider', Slider);\n\n/**\n * @file load-progress-bar.js\n */\n\n// get the percent width of a time compared to the total end\nconst percentify = (time, end) => clamp(time / end * 100, 0, 100).toFixed(2) + '%';\n\n/**\n * Shows loading progress\n *\n * @extends Component\n */\nclass LoadProgressBar extends Component$1 {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../../player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n super(player, options);\n this.partEls_ = [];\n this.on(player, 'progress', e => this.update(e));\n }\n\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n createEl() {\n const el = super.createEl('div', {\n className: 'vjs-load-progress'\n });\n const wrapper = createEl('span', {\n className: 'vjs-control-text'\n });\n const loadedText = createEl('span', {\n textContent: this.localize('Loaded')\n });\n const separator = document.createTextNode(': ');\n this.percentageEl_ = createEl('span', {\n className: 'vjs-control-text-loaded-percentage',\n textContent: '0%'\n });\n el.appendChild(wrapper);\n wrapper.appendChild(loadedText);\n wrapper.appendChild(separator);\n wrapper.appendChild(this.percentageEl_);\n return el;\n }\n dispose() {\n this.partEls_ = null;\n this.percentageEl_ = null;\n super.dispose();\n }\n\n /**\n * Update progress bar\n *\n * @param {Event} [event]\n * The `progress` event that caused this function to run.\n *\n * @listens Player#progress\n */\n update(event) {\n this.requestNamedAnimationFrame('LoadProgressBar#update', () => {\n const liveTracker = this.player_.liveTracker;\n const buffered = this.player_.buffered();\n const duration = liveTracker && liveTracker.isLive() ? liveTracker.seekableEnd() : this.player_.duration();\n const bufferedEnd = this.player_.bufferedEnd();\n const children = this.partEls_;\n const percent = percentify(bufferedEnd, duration);\n if (this.percent_ !== percent) {\n // update the width of the progress bar\n this.el_.style.width = percent;\n // update the control-text\n textContent(this.percentageEl_, percent);\n this.percent_ = percent;\n }\n\n // add child elements to represent the individual buffered time ranges\n for (let i = 0; i < buffered.length; i++) {\n const start = buffered.start(i);\n const end = buffered.end(i);\n let part = children[i];\n if (!part) {\n part = this.el_.appendChild(createEl());\n children[i] = part;\n }\n\n // only update if changed\n if (part.dataset.start === start && part.dataset.end === end) {\n continue;\n }\n part.dataset.start = start;\n part.dataset.end = end;\n\n // set the percent based on the width of the progress bar (bufferedEnd)\n part.style.left = percentify(start, bufferedEnd);\n part.style.width = percentify(end - start, bufferedEnd);\n }\n\n // remove unused buffered range elements\n for (let i = children.length; i > buffered.length; i--) {\n this.el_.removeChild(children[i - 1]);\n }\n children.length = buffered.length;\n });\n }\n}\nComponent$1.registerComponent('LoadProgressBar', LoadProgressBar);\n\n/**\n * @file time-tooltip.js\n */\n\n/**\n * Time tooltips display a time above the progress bar.\n *\n * @extends Component\n */\nclass TimeTooltip extends Component$1 {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../../player').default } player\n * The {@link Player} that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n super(player, options);\n this.update = throttle(bind_(this, this.update), UPDATE_REFRESH_INTERVAL);\n }\n\n /**\n * Create the time tooltip DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n createEl() {\n return super.createEl('div', {\n className: 'vjs-time-tooltip'\n }, {\n 'aria-hidden': 'true'\n });\n }\n\n /**\n * Updates the position of the time tooltip relative to the `SeekBar`.\n *\n * @param {Object} seekBarRect\n * The `ClientRect` for the {@link SeekBar} element.\n *\n * @param {number} seekBarPoint\n * A number from 0 to 1, representing a horizontal reference point\n * from the left edge of the {@link SeekBar}\n */\n update(seekBarRect, seekBarPoint, content) {\n const tooltipRect = findPosition(this.el_);\n const playerRect = getBoundingClientRect(this.player_.el());\n const seekBarPointPx = seekBarRect.width * seekBarPoint;\n\n // do nothing if either rect isn't available\n // for example, if the player isn't in the DOM for testing\n if (!playerRect || !tooltipRect) {\n return;\n }\n\n // This is the space left of the `seekBarPoint` available within the bounds\n // of the player. We calculate any gap between the left edge of the player\n // and the left edge of the `SeekBar` and add the number of pixels in the\n // `SeekBar` before hitting the `seekBarPoint`\n const spaceLeftOfPoint = seekBarRect.left - playerRect.left + seekBarPointPx;\n\n // This is the space right of the `seekBarPoint` available within the bounds\n // of the player. We calculate the number of pixels from the `seekBarPoint`\n // to the right edge of the `SeekBar` and add to that any gap between the\n // right edge of the `SeekBar` and the player.\n const spaceRightOfPoint = seekBarRect.width - seekBarPointPx + (playerRect.right - seekBarRect.right);\n\n // This is the number of pixels by which the tooltip will need to be pulled\n // further to the right to center it over the `seekBarPoint`.\n let pullTooltipBy = tooltipRect.width / 2;\n\n // Adjust the `pullTooltipBy` distance to the left or right depending on\n // the results of the space calculations above.\n if (spaceLeftOfPoint < pullTooltipBy) {\n pullTooltipBy += pullTooltipBy - spaceLeftOfPoint;\n } else if (spaceRightOfPoint < pullTooltipBy) {\n pullTooltipBy = spaceRightOfPoint;\n }\n\n // Due to the imprecision of decimal/ratio based calculations and varying\n // rounding behaviors, there are cases where the spacing adjustment is off\n // by a pixel or two. This adds insurance to these calculations.\n if (pullTooltipBy < 0) {\n pullTooltipBy = 0;\n } else if (pullTooltipBy > tooltipRect.width) {\n pullTooltipBy = tooltipRect.width;\n }\n\n // prevent small width fluctuations within 0.4px from\n // changing the value below.\n // This really helps for live to prevent the play\n // progress time tooltip from jittering\n pullTooltipBy = Math.round(pullTooltipBy);\n this.el_.style.right = `-${pullTooltipBy}px`;\n this.write(content);\n }\n\n /**\n * Write the time to the tooltip DOM element.\n *\n * @param {string} content\n * The formatted time for the tooltip.\n */\n write(content) {\n textContent(this.el_, content);\n }\n\n /**\n * Updates the position of the time tooltip relative to the `SeekBar`.\n *\n * @param {Object} seekBarRect\n * The `ClientRect` for the {@link SeekBar} element.\n *\n * @param {number} seekBarPoint\n * A number from 0 to 1, representing a horizontal reference point\n * from the left edge of the {@link SeekBar}\n *\n * @param {number} time\n * The time to update the tooltip to, not used during live playback\n *\n * @param {Function} cb\n * A function that will be called during the request animation frame\n * for tooltips that need to do additional animations from the default\n */\n updateTime(seekBarRect, seekBarPoint, time, cb) {\n this.requestNamedAnimationFrame('TimeTooltip#updateTime', () => {\n let content;\n const duration = this.player_.duration();\n if (this.player_.liveTracker && this.player_.liveTracker.isLive()) {\n const liveWindow = this.player_.liveTracker.liveWindow();\n const secondsBehind = liveWindow - seekBarPoint * liveWindow;\n content = (secondsBehind < 1 ? '' : '-') + formatTime(secondsBehind, liveWindow);\n } else {\n content = formatTime(time, duration);\n }\n this.update(seekBarRect, seekBarPoint, content);\n if (cb) {\n cb();\n }\n });\n }\n}\nComponent$1.registerComponent('TimeTooltip', TimeTooltip);\n\n/**\n * @file play-progress-bar.js\n */\n\n/**\n * Used by {@link SeekBar} to display media playback progress as part of the\n * {@link ProgressControl}.\n *\n * @extends Component\n */\nclass PlayProgressBar extends Component$1 {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../../player').default } player\n * The {@link Player} that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n super(player, options);\n this.setIcon('circle');\n this.update = throttle(bind_(this, this.update), UPDATE_REFRESH_INTERVAL);\n }\n\n /**\n * Create the the DOM element for this class.\n *\n * @return {Element}\n * The element that was created.\n */\n createEl() {\n return super.createEl('div', {\n className: 'vjs-play-progress vjs-slider-bar'\n }, {\n 'aria-hidden': 'true'\n });\n }\n\n /**\n * Enqueues updates to its own DOM as well as the DOM of its\n * {@link TimeTooltip} child.\n *\n * @param {Object} seekBarRect\n * The `ClientRect` for the {@link SeekBar} element.\n *\n * @param {number} seekBarPoint\n * A number from 0 to 1, representing a horizontal reference point\n * from the left edge of the {@link SeekBar}\n */\n update(seekBarRect, seekBarPoint) {\n const timeTooltip = this.getChild('timeTooltip');\n if (!timeTooltip) {\n return;\n }\n const time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();\n timeTooltip.updateTime(seekBarRect, seekBarPoint, time);\n }\n}\n\n/**\n * Default options for {@link PlayProgressBar}.\n *\n * @type {Object}\n * @private\n */\nPlayProgressBar.prototype.options_ = {\n children: []\n};\n\n// Time tooltips should not be added to a player on mobile devices\nif (!IS_IOS && !IS_ANDROID) {\n PlayProgressBar.prototype.options_.children.push('timeTooltip');\n}\nComponent$1.registerComponent('PlayProgressBar', PlayProgressBar);\n\n/**\n * @file mouse-time-display.js\n */\n\n/**\n * The {@link MouseTimeDisplay} component tracks mouse movement over the\n * {@link ProgressControl}. It displays an indicator and a {@link TimeTooltip}\n * indicating the time which is represented by a given point in the\n * {@link ProgressControl}.\n *\n * @extends Component\n */\nclass MouseTimeDisplay extends Component$1 {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../../player').default } player\n * The {@link Player} that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n super(player, options);\n this.update = throttle(bind_(this, this.update), UPDATE_REFRESH_INTERVAL);\n }\n\n /**\n * Create the DOM element for this class.\n *\n * @return {Element}\n * The element that was created.\n */\n createEl() {\n return super.createEl('div', {\n className: 'vjs-mouse-display'\n });\n }\n\n /**\n * Enqueues updates to its own DOM as well as the DOM of its\n * {@link TimeTooltip} child.\n *\n * @param {Object} seekBarRect\n * The `ClientRect` for the {@link SeekBar} element.\n *\n * @param {number} seekBarPoint\n * A number from 0 to 1, representing a horizontal reference point\n * from the left edge of the {@link SeekBar}\n */\n update(seekBarRect, seekBarPoint) {\n const time = seekBarPoint * this.player_.duration();\n this.getChild('timeTooltip').updateTime(seekBarRect, seekBarPoint, time, () => {\n this.el_.style.left = `${seekBarRect.width * seekBarPoint}px`;\n });\n }\n}\n\n/**\n * Default options for `MouseTimeDisplay`\n *\n * @type {Object}\n * @private\n */\nMouseTimeDisplay.prototype.options_ = {\n children: ['timeTooltip']\n};\nComponent$1.registerComponent('MouseTimeDisplay', MouseTimeDisplay);\n\n/**\n * @file seek-bar.js\n */\n\n// The number of seconds the `step*` functions move the timeline.\nconst STEP_SECONDS = 5;\n\n// The multiplier of STEP_SECONDS that PgUp/PgDown move the timeline.\nconst PAGE_KEY_MULTIPLIER = 12;\n\n/**\n * Seek bar and container for the progress bars. Uses {@link PlayProgressBar}\n * as its `bar`.\n *\n * @extends Slider\n */\nclass SeekBar extends Slider {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../../player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n super(player, options);\n this.setEventHandlers_();\n }\n\n /**\n * Sets the event handlers\n *\n * @private\n */\n setEventHandlers_() {\n this.update_ = bind_(this, this.update);\n this.update = throttle(this.update_, UPDATE_REFRESH_INTERVAL);\n this.on(this.player_, ['ended', 'durationchange', 'timeupdate'], this.update);\n if (this.player_.liveTracker) {\n this.on(this.player_.liveTracker, 'liveedgechange', this.update);\n }\n\n // when playing, let's ensure we smoothly update the play progress bar\n // via an interval\n this.updateInterval = null;\n this.enableIntervalHandler_ = e => this.enableInterval_(e);\n this.disableIntervalHandler_ = e => this.disableInterval_(e);\n this.on(this.player_, ['playing'], this.enableIntervalHandler_);\n this.on(this.player_, ['ended', 'pause', 'waiting'], this.disableIntervalHandler_);\n\n // we don't need to update the play progress if the document is hidden,\n // also, this causes the CPU to spike and eventually crash the page on IE11.\n if ('hidden' in document && 'visibilityState' in document) {\n this.on(document, 'visibilitychange', this.toggleVisibility_);\n }\n }\n toggleVisibility_(e) {\n if (document.visibilityState === 'hidden') {\n this.cancelNamedAnimationFrame('SeekBar#update');\n this.cancelNamedAnimationFrame('Slider#update');\n this.disableInterval_(e);\n } else {\n if (!this.player_.ended() && !this.player_.paused()) {\n this.enableInterval_();\n }\n\n // we just switched back to the page and someone may be looking, so, update ASAP\n this.update();\n }\n }\n enableInterval_() {\n if (this.updateInterval) {\n return;\n }\n this.updateInterval = this.setInterval(this.update, UPDATE_REFRESH_INTERVAL);\n }\n disableInterval_(e) {\n if (this.player_.liveTracker && this.player_.liveTracker.isLive() && e && e.type !== 'ended') {\n return;\n }\n if (!this.updateInterval) {\n return;\n }\n this.clearInterval(this.updateInterval);\n this.updateInterval = null;\n }\n\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n createEl() {\n return super.createEl('div', {\n className: 'vjs-progress-holder'\n }, {\n 'aria-label': this.localize('Progress Bar')\n });\n }\n\n /**\n * This function updates the play progress bar and accessibility\n * attributes to whatever is passed in.\n *\n * @param {Event} [event]\n * The `timeupdate` or `ended` event that caused this to run.\n *\n * @listens Player#timeupdate\n *\n * @return {number}\n * The current percent at a number from 0-1\n */\n update(event) {\n // ignore updates while the tab is hidden\n if (document.visibilityState === 'hidden') {\n return;\n }\n const percent = super.update();\n this.requestNamedAnimationFrame('SeekBar#update', () => {\n const currentTime = this.player_.ended() ? this.player_.duration() : this.getCurrentTime_();\n const liveTracker = this.player_.liveTracker;\n let duration = this.player_.duration();\n if (liveTracker && liveTracker.isLive()) {\n duration = this.player_.liveTracker.liveCurrentTime();\n }\n if (this.percent_ !== percent) {\n // machine readable value of progress bar (percentage complete)\n this.el_.setAttribute('aria-valuenow', (percent * 100).toFixed(2));\n this.percent_ = percent;\n }\n if (this.currentTime_ !== currentTime || this.duration_ !== duration) {\n // human readable value of progress bar (time complete)\n this.el_.setAttribute('aria-valuetext', this.localize('progress bar timing: currentTime={1} duration={2}', [formatTime(currentTime, duration), formatTime(duration, duration)], '{1} of {2}'));\n this.currentTime_ = currentTime;\n this.duration_ = duration;\n }\n\n // update the progress bar time tooltip with the current time\n if (this.bar) {\n this.bar.update(getBoundingClientRect(this.el()), this.getProgress());\n }\n });\n return percent;\n }\n\n /**\n * Prevent liveThreshold from causing seeks to seem like they\n * are not happening from a user perspective.\n *\n * @param {number} ct\n * current time to seek to\n */\n userSeek_(ct) {\n if (this.player_.liveTracker && this.player_.liveTracker.isLive()) {\n this.player_.liveTracker.nextSeekedFromUser();\n }\n this.player_.currentTime(ct);\n }\n\n /**\n * Get the value of current time but allows for smooth scrubbing,\n * when player can't keep up.\n *\n * @return {number}\n * The current time value to display\n *\n * @private\n */\n getCurrentTime_() {\n return this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();\n }\n\n /**\n * Get the percentage of media played so far.\n *\n * @return {number}\n * The percentage of media played so far (0 to 1).\n */\n getPercent() {\n const currentTime = this.getCurrentTime_();\n let percent;\n const liveTracker = this.player_.liveTracker;\n if (liveTracker && liveTracker.isLive()) {\n percent = (currentTime - liveTracker.seekableStart()) / liveTracker.liveWindow();\n\n // prevent the percent from changing at the live edge\n if (liveTracker.atLiveEdge()) {\n percent = 1;\n }\n } else {\n percent = currentTime / this.player_.duration();\n }\n return percent;\n }\n\n /**\n * Handle mouse down on seek bar\n *\n * @param {MouseEvent} event\n * The `mousedown` event that caused this to run.\n *\n * @listens mousedown\n */\n handleMouseDown(event) {\n if (!isSingleLeftClick(event)) {\n return;\n }\n\n // Stop event propagation to prevent double fire in progress-control.js\n event.stopPropagation();\n this.videoWasPlaying = !this.player_.paused();\n this.player_.pause();\n super.handleMouseDown(event);\n }\n\n /**\n * Handle mouse move on seek bar\n *\n * @param {MouseEvent} event\n * The `mousemove` event that caused this to run.\n * @param {boolean} mouseDown this is a flag that should be set to true if `handleMouseMove` is called directly. It allows us to skip things that should not happen if coming from mouse down but should happen on regular mouse move handler. Defaults to false\n *\n * @listens mousemove\n */\n handleMouseMove(event, mouseDown = false) {\n if (!isSingleLeftClick(event) || isNaN(this.player_.duration())) {\n return;\n }\n if (!mouseDown && !this.player_.scrubbing()) {\n this.player_.scrubbing(true);\n }\n let newTime;\n const distance = this.calculateDistance(event);\n const liveTracker = this.player_.liveTracker;\n if (!liveTracker || !liveTracker.isLive()) {\n newTime = distance * this.player_.duration();\n\n // Don't let video end while scrubbing.\n if (newTime === this.player_.duration()) {\n newTime = newTime - 0.1;\n }\n } else {\n if (distance >= 0.99) {\n liveTracker.seekToLiveEdge();\n return;\n }\n const seekableStart = liveTracker.seekableStart();\n const seekableEnd = liveTracker.liveCurrentTime();\n newTime = seekableStart + distance * liveTracker.liveWindow();\n\n // Don't let video end while scrubbing.\n if (newTime >= seekableEnd) {\n newTime = seekableEnd;\n }\n\n // Compensate for precision differences so that currentTime is not less\n // than seekable start\n if (newTime <= seekableStart) {\n newTime = seekableStart + 0.1;\n }\n\n // On android seekableEnd can be Infinity sometimes,\n // this will cause newTime to be Infinity, which is\n // not a valid currentTime.\n if (newTime === Infinity) {\n return;\n }\n }\n\n // Set new time (tell player to seek to new time)\n this.userSeek_(newTime);\n }\n enable() {\n super.enable();\n const mouseTimeDisplay = this.getChild('mouseTimeDisplay');\n if (!mouseTimeDisplay) {\n return;\n }\n mouseTimeDisplay.show();\n }\n disable() {\n super.disable();\n const mouseTimeDisplay = this.getChild('mouseTimeDisplay');\n if (!mouseTimeDisplay) {\n return;\n }\n mouseTimeDisplay.hide();\n }\n\n /**\n * Handle mouse up on seek bar\n *\n * @param {MouseEvent} event\n * The `mouseup` event that caused this to run.\n *\n * @listens mouseup\n */\n handleMouseUp(event) {\n super.handleMouseUp(event);\n\n // Stop event propagation to prevent double fire in progress-control.js\n if (event) {\n event.stopPropagation();\n }\n this.player_.scrubbing(false);\n\n /**\n * Trigger timeupdate because we're done seeking and the time has changed.\n * This is particularly useful for if the player is paused to time the time displays.\n *\n * @event Tech#timeupdate\n * @type {Event}\n */\n this.player_.trigger({\n type: 'timeupdate',\n target: this,\n manuallyTriggered: true\n });\n if (this.videoWasPlaying) {\n silencePromise(this.player_.play());\n } else {\n // We're done seeking and the time has changed.\n // If the player is paused, make sure we display the correct time on the seek bar.\n this.update_();\n }\n }\n\n /**\n * Move more quickly fast forward for keyboard-only users\n */\n stepForward() {\n this.userSeek_(this.player_.currentTime() + STEP_SECONDS);\n }\n\n /**\n * Move more quickly rewind for keyboard-only users\n */\n stepBack() {\n this.userSeek_(this.player_.currentTime() - STEP_SECONDS);\n }\n\n /**\n * Toggles the playback state of the player\n * This gets called when enter or space is used on the seekbar\n *\n * @param {KeyboardEvent} event\n * The `keydown` event that caused this function to be called\n *\n */\n handleAction(event) {\n if (this.player_.paused()) {\n this.player_.play();\n } else {\n this.player_.pause();\n }\n }\n\n /**\n * Called when this SeekBar has focus and a key gets pressed down.\n * Supports the following keys:\n *\n * Space or Enter key fire a click event\n * Home key moves to start of the timeline\n * End key moves to end of the timeline\n * Digit \"0\" through \"9\" keys move to 0%, 10% ... 80%, 90% of the timeline\n * PageDown key moves back a larger step than ArrowDown\n * PageUp key moves forward a large step\n *\n * @param {KeyboardEvent} event\n * The `keydown` event that caused this function to be called.\n *\n * @listens keydown\n */\n handleKeyDown(event) {\n const liveTracker = this.player_.liveTracker;\n if (keycode.isEventKey(event, 'Space') || keycode.isEventKey(event, 'Enter')) {\n event.preventDefault();\n event.stopPropagation();\n this.handleAction(event);\n } else if (keycode.isEventKey(event, 'Home')) {\n event.preventDefault();\n event.stopPropagation();\n this.userSeek_(0);\n } else if (keycode.isEventKey(event, 'End')) {\n event.preventDefault();\n event.stopPropagation();\n if (liveTracker && liveTracker.isLive()) {\n this.userSeek_(liveTracker.liveCurrentTime());\n } else {\n this.userSeek_(this.player_.duration());\n }\n } else if (/^[0-9]$/.test(keycode(event))) {\n event.preventDefault();\n event.stopPropagation();\n const gotoFraction = (keycode.codes[keycode(event)] - keycode.codes['0']) * 10.0 / 100.0;\n if (liveTracker && liveTracker.isLive()) {\n this.userSeek_(liveTracker.seekableStart() + liveTracker.liveWindow() * gotoFraction);\n } else {\n this.userSeek_(this.player_.duration() * gotoFraction);\n }\n } else if (keycode.isEventKey(event, 'PgDn')) {\n event.preventDefault();\n event.stopPropagation();\n this.userSeek_(this.player_.currentTime() - STEP_SECONDS * PAGE_KEY_MULTIPLIER);\n } else if (keycode.isEventKey(event, 'PgUp')) {\n event.preventDefault();\n event.stopPropagation();\n this.userSeek_(this.player_.currentTime() + STEP_SECONDS * PAGE_KEY_MULTIPLIER);\n } else {\n // Pass keydown handling up for unsupported keys\n super.handleKeyDown(event);\n }\n }\n dispose() {\n this.disableInterval_();\n this.off(this.player_, ['ended', 'durationchange', 'timeupdate'], this.update);\n if (this.player_.liveTracker) {\n this.off(this.player_.liveTracker, 'liveedgechange', this.update);\n }\n this.off(this.player_, ['playing'], this.enableIntervalHandler_);\n this.off(this.player_, ['ended', 'pause', 'waiting'], this.disableIntervalHandler_);\n\n // we don't need to update the play progress if the document is hidden,\n // also, this causes the CPU to spike and eventually crash the page on IE11.\n if ('hidden' in document && 'visibilityState' in document) {\n this.off(document, 'visibilitychange', this.toggleVisibility_);\n }\n super.dispose();\n }\n}\n\n/**\n * Default options for the `SeekBar`\n *\n * @type {Object}\n * @private\n */\nSeekBar.prototype.options_ = {\n children: ['loadProgressBar', 'playProgressBar'],\n barName: 'playProgressBar'\n};\n\n// MouseTimeDisplay tooltips should not be added to a player on mobile devices\nif (!IS_IOS && !IS_ANDROID) {\n SeekBar.prototype.options_.children.splice(1, 0, 'mouseTimeDisplay');\n}\nComponent$1.registerComponent('SeekBar', SeekBar);\n\n/**\n * @file progress-control.js\n */\n\n/**\n * The Progress Control component contains the seek bar, load progress,\n * and play progress.\n *\n * @extends Component\n */\nclass ProgressControl extends Component$1 {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../../player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n super(player, options);\n this.handleMouseMove = throttle(bind_(this, this.handleMouseMove), UPDATE_REFRESH_INTERVAL);\n this.throttledHandleMouseSeek = throttle(bind_(this, this.handleMouseSeek), UPDATE_REFRESH_INTERVAL);\n this.handleMouseUpHandler_ = e => this.handleMouseUp(e);\n this.handleMouseDownHandler_ = e => this.handleMouseDown(e);\n this.enable();\n }\n\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n createEl() {\n return super.createEl('div', {\n className: 'vjs-progress-control vjs-control'\n });\n }\n\n /**\n * When the mouse moves over the `ProgressControl`, the pointer position\n * gets passed down to the `MouseTimeDisplay` component.\n *\n * @param {Event} event\n * The `mousemove` event that caused this function to run.\n *\n * @listen mousemove\n */\n handleMouseMove(event) {\n const seekBar = this.getChild('seekBar');\n if (!seekBar) {\n return;\n }\n const playProgressBar = seekBar.getChild('playProgressBar');\n const mouseTimeDisplay = seekBar.getChild('mouseTimeDisplay');\n if (!playProgressBar && !mouseTimeDisplay) {\n return;\n }\n const seekBarEl = seekBar.el();\n const seekBarRect = findPosition(seekBarEl);\n let seekBarPoint = getPointerPosition(seekBarEl, event).x;\n\n // The default skin has a gap on either side of the `SeekBar`. This means\n // that it's possible to trigger this behavior outside the boundaries of\n // the `SeekBar`. This ensures we stay within it at all times.\n seekBarPoint = clamp(seekBarPoint, 0, 1);\n if (mouseTimeDisplay) {\n mouseTimeDisplay.update(seekBarRect, seekBarPoint);\n }\n if (playProgressBar) {\n playProgressBar.update(seekBarRect, seekBar.getProgress());\n }\n }\n\n /**\n * A throttled version of the {@link ProgressControl#handleMouseSeek} listener.\n *\n * @method ProgressControl#throttledHandleMouseSeek\n * @param {Event} event\n * The `mousemove` event that caused this function to run.\n *\n * @listen mousemove\n * @listen touchmove\n */\n\n /**\n * Handle `mousemove` or `touchmove` events on the `ProgressControl`.\n *\n * @param {Event} event\n * `mousedown` or `touchstart` event that triggered this function\n *\n * @listens mousemove\n * @listens touchmove\n */\n handleMouseSeek(event) {\n const seekBar = this.getChild('seekBar');\n if (seekBar) {\n seekBar.handleMouseMove(event);\n }\n }\n\n /**\n * Are controls are currently enabled for this progress control.\n *\n * @return {boolean}\n * true if controls are enabled, false otherwise\n */\n enabled() {\n return this.enabled_;\n }\n\n /**\n * Disable all controls on the progress control and its children\n */\n disable() {\n this.children().forEach(child => child.disable && child.disable());\n if (!this.enabled()) {\n return;\n }\n this.off(['mousedown', 'touchstart'], this.handleMouseDownHandler_);\n this.off(this.el_, 'mousemove', this.handleMouseMove);\n this.removeListenersAddedOnMousedownAndTouchstart();\n this.addClass('disabled');\n this.enabled_ = false;\n\n // Restore normal playback state if controls are disabled while scrubbing\n if (this.player_.scrubbing()) {\n const seekBar = this.getChild('seekBar');\n this.player_.scrubbing(false);\n if (seekBar.videoWasPlaying) {\n silencePromise(this.player_.play());\n }\n }\n }\n\n /**\n * Enable all controls on the progress control and its children\n */\n enable() {\n this.children().forEach(child => child.enable && child.enable());\n if (this.enabled()) {\n return;\n }\n this.on(['mousedown', 'touchstart'], this.handleMouseDownHandler_);\n this.on(this.el_, 'mousemove', this.handleMouseMove);\n this.removeClass('disabled');\n this.enabled_ = true;\n }\n\n /**\n * Cleanup listeners after the user finishes interacting with the progress controls\n */\n removeListenersAddedOnMousedownAndTouchstart() {\n const doc = this.el_.ownerDocument;\n this.off(doc, 'mousemove', this.throttledHandleMouseSeek);\n this.off(doc, 'touchmove', this.throttledHandleMouseSeek);\n this.off(doc, 'mouseup', this.handleMouseUpHandler_);\n this.off(doc, 'touchend', this.handleMouseUpHandler_);\n }\n\n /**\n * Handle `mousedown` or `touchstart` events on the `ProgressControl`.\n *\n * @param {Event} event\n * `mousedown` or `touchstart` event that triggered this function\n *\n * @listens mousedown\n * @listens touchstart\n */\n handleMouseDown(event) {\n const doc = this.el_.ownerDocument;\n const seekBar = this.getChild('seekBar');\n if (seekBar) {\n seekBar.handleMouseDown(event);\n }\n this.on(doc, 'mousemove', this.throttledHandleMouseSeek);\n this.on(doc, 'touchmove', this.throttledHandleMouseSeek);\n this.on(doc, 'mouseup', this.handleMouseUpHandler_);\n this.on(doc, 'touchend', this.handleMouseUpHandler_);\n }\n\n /**\n * Handle `mouseup` or `touchend` events on the `ProgressControl`.\n *\n * @param {Event} event\n * `mouseup` or `touchend` event that triggered this function.\n *\n * @listens touchend\n * @listens mouseup\n */\n handleMouseUp(event) {\n const seekBar = this.getChild('seekBar');\n if (seekBar) {\n seekBar.handleMouseUp(event);\n }\n this.removeListenersAddedOnMousedownAndTouchstart();\n }\n}\n\n/**\n * Default options for `ProgressControl`\n *\n * @type {Object}\n * @private\n */\nProgressControl.prototype.options_ = {\n children: ['seekBar']\n};\nComponent$1.registerComponent('ProgressControl', ProgressControl);\n\n/**\n * @file picture-in-picture-toggle.js\n */\n\n/**\n * Toggle Picture-in-Picture mode\n *\n * @extends Button\n */\nclass PictureInPictureToggle extends Button {\n /**\n * Creates an instance of this class.\n *\n * @param { import('./player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @listens Player#enterpictureinpicture\n * @listens Player#leavepictureinpicture\n */\n constructor(player, options) {\n super(player, options);\n this.setIcon('picture-in-picture-enter');\n this.on(player, ['enterpictureinpicture', 'leavepictureinpicture'], e => this.handlePictureInPictureChange(e));\n this.on(player, ['disablepictureinpicturechanged', 'loadedmetadata'], e => this.handlePictureInPictureEnabledChange(e));\n this.on(player, ['loadedmetadata', 'audioonlymodechange', 'audiopostermodechange'], () => this.handlePictureInPictureAudioModeChange());\n\n // TODO: Deactivate button on player emptied event.\n this.disable();\n }\n\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n buildCSSClass() {\n return `vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`;\n }\n\n /**\n * Displays or hides the button depending on the audio mode detection.\n * Exits picture-in-picture if it is enabled when switching to audio mode.\n */\n handlePictureInPictureAudioModeChange() {\n // This audio detection will not detect HLS or DASH audio-only streams because there was no reliable way to detect them at the time\n const isSourceAudio = this.player_.currentType().substring(0, 5) === 'audio';\n const isAudioMode = isSourceAudio || this.player_.audioPosterMode() || this.player_.audioOnlyMode();\n if (!isAudioMode) {\n this.show();\n return;\n }\n if (this.player_.isInPictureInPicture()) {\n this.player_.exitPictureInPicture();\n }\n this.hide();\n }\n\n /**\n * Enables or disables button based on availability of a Picture-In-Picture mode.\n *\n * Enabled if\n * - `player.options().enableDocumentPictureInPicture` is true and\n * window.documentPictureInPicture is available; or\n * - `player.disablePictureInPicture()` is false and\n * element.requestPictureInPicture is available\n */\n handlePictureInPictureEnabledChange() {\n if (document.pictureInPictureEnabled && this.player_.disablePictureInPicture() === false || this.player_.options_.enableDocumentPictureInPicture && 'documentPictureInPicture' in window$1) {\n this.enable();\n } else {\n this.disable();\n }\n }\n\n /**\n * Handles enterpictureinpicture and leavepictureinpicture on the player and change control text accordingly.\n *\n * @param {Event} [event]\n * The {@link Player#enterpictureinpicture} or {@link Player#leavepictureinpicture} event that caused this function to be\n * called.\n *\n * @listens Player#enterpictureinpicture\n * @listens Player#leavepictureinpicture\n */\n handlePictureInPictureChange(event) {\n if (this.player_.isInPictureInPicture()) {\n this.setIcon('picture-in-picture-exit');\n this.controlText('Exit Picture-in-Picture');\n } else {\n this.setIcon('picture-in-picture-enter');\n this.controlText('Picture-in-Picture');\n }\n this.handlePictureInPictureEnabledChange();\n }\n\n /**\n * This gets called when an `PictureInPictureToggle` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n handleClick(event) {\n if (!this.player_.isInPictureInPicture()) {\n this.player_.requestPictureInPicture();\n } else {\n this.player_.exitPictureInPicture();\n }\n }\n\n /**\n * Show the `Component`s element if it is hidden by removing the\n * 'vjs-hidden' class name from it only in browsers that support the Picture-in-Picture API.\n */\n show() {\n // Does not allow to display the pictureInPictureToggle in browsers that do not support the Picture-in-Picture API, e.g. Firefox.\n if (typeof document.exitPictureInPicture !== 'function') {\n return;\n }\n super.show();\n }\n}\n\n/**\n * The text that should display over the `PictureInPictureToggle`s controls. Added for localization.\n *\n * @type {string}\n * @protected\n */\nPictureInPictureToggle.prototype.controlText_ = 'Picture-in-Picture';\nComponent$1.registerComponent('PictureInPictureToggle', PictureInPictureToggle);\n\n/**\n * @file fullscreen-toggle.js\n */\n\n/**\n * Toggle fullscreen video\n *\n * @extends Button\n */\nclass FullscreenToggle extends Button {\n /**\n * Creates an instance of this class.\n *\n * @param { import('./player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n super(player, options);\n this.setIcon('fullscreen-enter');\n this.on(player, 'fullscreenchange', e => this.handleFullscreenChange(e));\n if (document[player.fsApi_.fullscreenEnabled] === false) {\n this.disable();\n }\n }\n\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n buildCSSClass() {\n return `vjs-fullscreen-control ${super.buildCSSClass()}`;\n }\n\n /**\n * Handles fullscreenchange on the player and change control text accordingly.\n *\n * @param {Event} [event]\n * The {@link Player#fullscreenchange} event that caused this function to be\n * called.\n *\n * @listens Player#fullscreenchange\n */\n handleFullscreenChange(event) {\n if (this.player_.isFullscreen()) {\n this.controlText('Exit Fullscreen');\n this.setIcon('fullscreen-exit');\n } else {\n this.controlText('Fullscreen');\n this.setIcon('fullscreen-enter');\n }\n }\n\n /**\n * This gets called when an `FullscreenToggle` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n handleClick(event) {\n if (!this.player_.isFullscreen()) {\n this.player_.requestFullscreen();\n } else {\n this.player_.exitFullscreen();\n }\n }\n}\n\n/**\n * The text that should display over the `FullscreenToggle`s controls. Added for localization.\n *\n * @type {string}\n * @protected\n */\nFullscreenToggle.prototype.controlText_ = 'Fullscreen';\nComponent$1.registerComponent('FullscreenToggle', FullscreenToggle);\n\n/**\n * Check if volume control is supported and if it isn't hide the\n * `Component` that was passed using the `vjs-hidden` class.\n *\n * @param { import('../../component').default } self\n * The component that should be hidden if volume is unsupported\n *\n * @param { import('../../player').default } player\n * A reference to the player\n *\n * @private\n */\nconst checkVolumeSupport = function (self, player) {\n // hide volume controls when they're not supported by the current tech\n if (player.tech_ && !player.tech_.featuresVolumeControl) {\n self.addClass('vjs-hidden');\n }\n self.on(player, 'loadstart', function () {\n if (!player.tech_.featuresVolumeControl) {\n self.addClass('vjs-hidden');\n } else {\n self.removeClass('vjs-hidden');\n }\n });\n};\n\n/**\n * @file volume-level.js\n */\n\n/**\n * Shows volume level\n *\n * @extends Component\n */\nclass VolumeLevel extends Component$1 {\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n createEl() {\n const el = super.createEl('div', {\n className: 'vjs-volume-level'\n });\n this.setIcon('circle', el);\n el.appendChild(super.createEl('span', {\n className: 'vjs-control-text'\n }));\n return el;\n }\n}\nComponent$1.registerComponent('VolumeLevel', VolumeLevel);\n\n/**\n * @file volume-level-tooltip.js\n */\n\n/**\n * Volume level tooltips display a volume above or side by side the volume bar.\n *\n * @extends Component\n */\nclass VolumeLevelTooltip extends Component$1 {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../../player').default } player\n * The {@link Player} that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n super(player, options);\n this.update = throttle(bind_(this, this.update), UPDATE_REFRESH_INTERVAL);\n }\n\n /**\n * Create the volume tooltip DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n createEl() {\n return super.createEl('div', {\n className: 'vjs-volume-tooltip'\n }, {\n 'aria-hidden': 'true'\n });\n }\n\n /**\n * Updates the position of the tooltip relative to the `VolumeBar` and\n * its content text.\n *\n * @param {Object} rangeBarRect\n * The `ClientRect` for the {@link VolumeBar} element.\n *\n * @param {number} rangeBarPoint\n * A number from 0 to 1, representing a horizontal/vertical reference point\n * from the left edge of the {@link VolumeBar}\n *\n * @param {boolean} vertical\n * Referees to the Volume control position\n * in the control bar{@link VolumeControl}\n *\n */\n update(rangeBarRect, rangeBarPoint, vertical, content) {\n if (!vertical) {\n const tooltipRect = getBoundingClientRect(this.el_);\n const playerRect = getBoundingClientRect(this.player_.el());\n const volumeBarPointPx = rangeBarRect.width * rangeBarPoint;\n if (!playerRect || !tooltipRect) {\n return;\n }\n const spaceLeftOfPoint = rangeBarRect.left - playerRect.left + volumeBarPointPx;\n const spaceRightOfPoint = rangeBarRect.width - volumeBarPointPx + (playerRect.right - rangeBarRect.right);\n let pullTooltipBy = tooltipRect.width / 2;\n if (spaceLeftOfPoint < pullTooltipBy) {\n pullTooltipBy += pullTooltipBy - spaceLeftOfPoint;\n } else if (spaceRightOfPoint < pullTooltipBy) {\n pullTooltipBy = spaceRightOfPoint;\n }\n if (pullTooltipBy < 0) {\n pullTooltipBy = 0;\n } else if (pullTooltipBy > tooltipRect.width) {\n pullTooltipBy = tooltipRect.width;\n }\n this.el_.style.right = `-${pullTooltipBy}px`;\n }\n this.write(`${content}%`);\n }\n\n /**\n * Write the volume to the tooltip DOM element.\n *\n * @param {string} content\n * The formatted volume for the tooltip.\n */\n write(content) {\n textContent(this.el_, content);\n }\n\n /**\n * Updates the position of the volume tooltip relative to the `VolumeBar`.\n *\n * @param {Object} rangeBarRect\n * The `ClientRect` for the {@link VolumeBar} element.\n *\n * @param {number} rangeBarPoint\n * A number from 0 to 1, representing a horizontal/vertical reference point\n * from the left edge of the {@link VolumeBar}\n *\n * @param {boolean} vertical\n * Referees to the Volume control position\n * in the control bar{@link VolumeControl}\n *\n * @param {number} volume\n * The volume level to update the tooltip to\n *\n * @param {Function} cb\n * A function that will be called during the request animation frame\n * for tooltips that need to do additional animations from the default\n */\n updateVolume(rangeBarRect, rangeBarPoint, vertical, volume, cb) {\n this.requestNamedAnimationFrame('VolumeLevelTooltip#updateVolume', () => {\n this.update(rangeBarRect, rangeBarPoint, vertical, volume.toFixed(0));\n if (cb) {\n cb();\n }\n });\n }\n}\nComponent$1.registerComponent('VolumeLevelTooltip', VolumeLevelTooltip);\n\n/**\n * @file mouse-volume-level-display.js\n */\n\n/**\n * The {@link MouseVolumeLevelDisplay} component tracks mouse movement over the\n * {@link VolumeControl}. It displays an indicator and a {@link VolumeLevelTooltip}\n * indicating the volume level which is represented by a given point in the\n * {@link VolumeBar}.\n *\n * @extends Component\n */\nclass MouseVolumeLevelDisplay extends Component$1 {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../../player').default } player\n * The {@link Player} that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n super(player, options);\n this.update = throttle(bind_(this, this.update), UPDATE_REFRESH_INTERVAL);\n }\n\n /**\n * Create the DOM element for this class.\n *\n * @return {Element}\n * The element that was created.\n */\n createEl() {\n return super.createEl('div', {\n className: 'vjs-mouse-display'\n });\n }\n\n /**\n * Enquires updates to its own DOM as well as the DOM of its\n * {@link VolumeLevelTooltip} child.\n *\n * @param {Object} rangeBarRect\n * The `ClientRect` for the {@link VolumeBar} element.\n *\n * @param {number} rangeBarPoint\n * A number from 0 to 1, representing a horizontal/vertical reference point\n * from the left edge of the {@link VolumeBar}\n *\n * @param {boolean} vertical\n * Referees to the Volume control position\n * in the control bar{@link VolumeControl}\n *\n */\n update(rangeBarRect, rangeBarPoint, vertical) {\n const volume = 100 * rangeBarPoint;\n this.getChild('volumeLevelTooltip').updateVolume(rangeBarRect, rangeBarPoint, vertical, volume, () => {\n if (vertical) {\n this.el_.style.bottom = `${rangeBarRect.height * rangeBarPoint}px`;\n } else {\n this.el_.style.left = `${rangeBarRect.width * rangeBarPoint}px`;\n }\n });\n }\n}\n\n/**\n * Default options for `MouseVolumeLevelDisplay`\n *\n * @type {Object}\n * @private\n */\nMouseVolumeLevelDisplay.prototype.options_ = {\n children: ['volumeLevelTooltip']\n};\nComponent$1.registerComponent('MouseVolumeLevelDisplay', MouseVolumeLevelDisplay);\n\n/**\n * @file volume-bar.js\n */\n\n/**\n * The bar that contains the volume level and can be clicked on to adjust the level\n *\n * @extends Slider\n */\nclass VolumeBar extends Slider {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../../player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n super(player, options);\n this.on('slideractive', e => this.updateLastVolume_(e));\n this.on(player, 'volumechange', e => this.updateARIAAttributes(e));\n player.ready(() => this.updateARIAAttributes());\n }\n\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n createEl() {\n return super.createEl('div', {\n className: 'vjs-volume-bar vjs-slider-bar'\n }, {\n 'aria-label': this.localize('Volume Level'),\n 'aria-live': 'polite'\n });\n }\n\n /**\n * Handle mouse down on volume bar\n *\n * @param {Event} event\n * The `mousedown` event that caused this to run.\n *\n * @listens mousedown\n */\n handleMouseDown(event) {\n if (!isSingleLeftClick(event)) {\n return;\n }\n super.handleMouseDown(event);\n }\n\n /**\n * Handle movement events on the {@link VolumeMenuButton}.\n *\n * @param {Event} event\n * The event that caused this function to run.\n *\n * @listens mousemove\n */\n handleMouseMove(event) {\n const mouseVolumeLevelDisplay = this.getChild('mouseVolumeLevelDisplay');\n if (mouseVolumeLevelDisplay) {\n const volumeBarEl = this.el();\n const volumeBarRect = getBoundingClientRect(volumeBarEl);\n const vertical = this.vertical();\n let volumeBarPoint = getPointerPosition(volumeBarEl, event);\n volumeBarPoint = vertical ? volumeBarPoint.y : volumeBarPoint.x;\n // The default skin has a gap on either side of the `VolumeBar`. This means\n // that it's possible to trigger this behavior outside the boundaries of\n // the `VolumeBar`. This ensures we stay within it at all times.\n volumeBarPoint = clamp(volumeBarPoint, 0, 1);\n mouseVolumeLevelDisplay.update(volumeBarRect, volumeBarPoint, vertical);\n }\n if (!isSingleLeftClick(event)) {\n return;\n }\n this.checkMuted();\n this.player_.volume(this.calculateDistance(event));\n }\n\n /**\n * If the player is muted unmute it.\n */\n checkMuted() {\n if (this.player_.muted()) {\n this.player_.muted(false);\n }\n }\n\n /**\n * Get percent of volume level\n *\n * @return {number}\n * Volume level percent as a decimal number.\n */\n getPercent() {\n if (this.player_.muted()) {\n return 0;\n }\n return this.player_.volume();\n }\n\n /**\n * Increase volume level for keyboard users\n */\n stepForward() {\n this.checkMuted();\n this.player_.volume(this.player_.volume() + 0.1);\n }\n\n /**\n * Decrease volume level for keyboard users\n */\n stepBack() {\n this.checkMuted();\n this.player_.volume(this.player_.volume() - 0.1);\n }\n\n /**\n * Update ARIA accessibility attributes\n *\n * @param {Event} [event]\n * The `volumechange` event that caused this function to run.\n *\n * @listens Player#volumechange\n */\n updateARIAAttributes(event) {\n const ariaValue = this.player_.muted() ? 0 : this.volumeAsPercentage_();\n this.el_.setAttribute('aria-valuenow', ariaValue);\n this.el_.setAttribute('aria-valuetext', ariaValue + '%');\n }\n\n /**\n * Returns the current value of the player volume as a percentage\n *\n * @private\n */\n volumeAsPercentage_() {\n return Math.round(this.player_.volume() * 100);\n }\n\n /**\n * When user starts dragging the VolumeBar, store the volume and listen for\n * the end of the drag. When the drag ends, if the volume was set to zero,\n * set lastVolume to the stored volume.\n *\n * @listens slideractive\n * @private\n */\n updateLastVolume_() {\n const volumeBeforeDrag = this.player_.volume();\n this.one('sliderinactive', () => {\n if (this.player_.volume() === 0) {\n this.player_.lastVolume_(volumeBeforeDrag);\n }\n });\n }\n}\n\n/**\n * Default options for the `VolumeBar`\n *\n * @type {Object}\n * @private\n */\nVolumeBar.prototype.options_ = {\n children: ['volumeLevel'],\n barName: 'volumeLevel'\n};\n\n// MouseVolumeLevelDisplay tooltip should not be added to a player on mobile devices\nif (!IS_IOS && !IS_ANDROID) {\n VolumeBar.prototype.options_.children.splice(0, 0, 'mouseVolumeLevelDisplay');\n}\n\n/**\n * Call the update event for this Slider when this event happens on the player.\n *\n * @type {string}\n */\nVolumeBar.prototype.playerEvent = 'volumechange';\nComponent$1.registerComponent('VolumeBar', VolumeBar);\n\n/**\n * @file volume-control.js\n */\n\n/**\n * The component for controlling the volume level\n *\n * @extends Component\n */\nclass VolumeControl extends Component$1 {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../../player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options={}]\n * The key/value store of player options.\n */\n constructor(player, options = {}) {\n options.vertical = options.vertical || false;\n\n // Pass the vertical option down to the VolumeBar if\n // the VolumeBar is turned on.\n if (typeof options.volumeBar === 'undefined' || isPlain(options.volumeBar)) {\n options.volumeBar = options.volumeBar || {};\n options.volumeBar.vertical = options.vertical;\n }\n super(player, options);\n\n // hide this control if volume support is missing\n checkVolumeSupport(this, player);\n this.throttledHandleMouseMove = throttle(bind_(this, this.handleMouseMove), UPDATE_REFRESH_INTERVAL);\n this.handleMouseUpHandler_ = e => this.handleMouseUp(e);\n this.on('mousedown', e => this.handleMouseDown(e));\n this.on('touchstart', e => this.handleMouseDown(e));\n this.on('mousemove', e => this.handleMouseMove(e));\n\n // while the slider is active (the mouse has been pressed down and\n // is dragging) or in focus we do not want to hide the VolumeBar\n this.on(this.volumeBar, ['focus', 'slideractive'], () => {\n this.volumeBar.addClass('vjs-slider-active');\n this.addClass('vjs-slider-active');\n this.trigger('slideractive');\n });\n this.on(this.volumeBar, ['blur', 'sliderinactive'], () => {\n this.volumeBar.removeClass('vjs-slider-active');\n this.removeClass('vjs-slider-active');\n this.trigger('sliderinactive');\n });\n }\n\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n createEl() {\n let orientationClass = 'vjs-volume-horizontal';\n if (this.options_.vertical) {\n orientationClass = 'vjs-volume-vertical';\n }\n return super.createEl('div', {\n className: `vjs-volume-control vjs-control ${orientationClass}`\n });\n }\n\n /**\n * Handle `mousedown` or `touchstart` events on the `VolumeControl`.\n *\n * @param {Event} event\n * `mousedown` or `touchstart` event that triggered this function\n *\n * @listens mousedown\n * @listens touchstart\n */\n handleMouseDown(event) {\n const doc = this.el_.ownerDocument;\n this.on(doc, 'mousemove', this.throttledHandleMouseMove);\n this.on(doc, 'touchmove', this.throttledHandleMouseMove);\n this.on(doc, 'mouseup', this.handleMouseUpHandler_);\n this.on(doc, 'touchend', this.handleMouseUpHandler_);\n }\n\n /**\n * Handle `mouseup` or `touchend` events on the `VolumeControl`.\n *\n * @param {Event} event\n * `mouseup` or `touchend` event that triggered this function.\n *\n * @listens touchend\n * @listens mouseup\n */\n handleMouseUp(event) {\n const doc = this.el_.ownerDocument;\n this.off(doc, 'mousemove', this.throttledHandleMouseMove);\n this.off(doc, 'touchmove', this.throttledHandleMouseMove);\n this.off(doc, 'mouseup', this.handleMouseUpHandler_);\n this.off(doc, 'touchend', this.handleMouseUpHandler_);\n }\n\n /**\n * Handle `mousedown` or `touchstart` events on the `VolumeControl`.\n *\n * @param {Event} event\n * `mousedown` or `touchstart` event that triggered this function\n *\n * @listens mousedown\n * @listens touchstart\n */\n handleMouseMove(event) {\n this.volumeBar.handleMouseMove(event);\n }\n}\n\n/**\n * Default options for the `VolumeControl`\n *\n * @type {Object}\n * @private\n */\nVolumeControl.prototype.options_ = {\n children: ['volumeBar']\n};\nComponent$1.registerComponent('VolumeControl', VolumeControl);\n\n/**\n * Check if muting volume is supported and if it isn't hide the mute toggle\n * button.\n *\n * @param { import('../../component').default } self\n * A reference to the mute toggle button\n *\n * @param { import('../../player').default } player\n * A reference to the player\n *\n * @private\n */\nconst checkMuteSupport = function (self, player) {\n // hide mute toggle button if it's not supported by the current tech\n if (player.tech_ && !player.tech_.featuresMuteControl) {\n self.addClass('vjs-hidden');\n }\n self.on(player, 'loadstart', function () {\n if (!player.tech_.featuresMuteControl) {\n self.addClass('vjs-hidden');\n } else {\n self.removeClass('vjs-hidden');\n }\n });\n};\n\n/**\n * @file mute-toggle.js\n */\n\n/**\n * A button component for muting the audio.\n *\n * @extends Button\n */\nclass MuteToggle extends Button {\n /**\n * Creates an instance of this class.\n *\n * @param { import('./player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n super(player, options);\n\n // hide this control if volume support is missing\n checkMuteSupport(this, player);\n this.on(player, ['loadstart', 'volumechange'], e => this.update(e));\n }\n\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n buildCSSClass() {\n return `vjs-mute-control ${super.buildCSSClass()}`;\n }\n\n /**\n * This gets called when an `MuteToggle` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n handleClick(event) {\n const vol = this.player_.volume();\n const lastVolume = this.player_.lastVolume_();\n if (vol === 0) {\n const volumeToSet = lastVolume < 0.1 ? 0.1 : lastVolume;\n this.player_.volume(volumeToSet);\n this.player_.muted(false);\n } else {\n this.player_.muted(this.player_.muted() ? false : true);\n }\n }\n\n /**\n * Update the `MuteToggle` button based on the state of `volume` and `muted`\n * on the player.\n *\n * @param {Event} [event]\n * The {@link Player#loadstart} event if this function was called\n * through an event.\n *\n * @listens Player#loadstart\n * @listens Player#volumechange\n */\n update(event) {\n this.updateIcon_();\n this.updateControlText_();\n }\n\n /**\n * Update the appearance of the `MuteToggle` icon.\n *\n * Possible states (given `level` variable below):\n * - 0: crossed out\n * - 1: zero bars of volume\n * - 2: one bar of volume\n * - 3: two bars of volume\n *\n * @private\n */\n updateIcon_() {\n const vol = this.player_.volume();\n let level = 3;\n this.setIcon('volume-high');\n\n // in iOS when a player is loaded with muted attribute\n // and volume is changed with a native mute button\n // we want to make sure muted state is updated\n if (IS_IOS && this.player_.tech_ && this.player_.tech_.el_) {\n this.player_.muted(this.player_.tech_.el_.muted);\n }\n if (vol === 0 || this.player_.muted()) {\n this.setIcon('volume-mute');\n level = 0;\n } else if (vol < 0.33) {\n this.setIcon('volume-low');\n level = 1;\n } else if (vol < 0.67) {\n this.setIcon('volume-medium');\n level = 2;\n }\n removeClass(this.el_, [0, 1, 2, 3].reduce((str, i) => str + `${i ? ' ' : ''}vjs-vol-${i}`, ''));\n addClass(this.el_, `vjs-vol-${level}`);\n }\n\n /**\n * If `muted` has changed on the player, update the control text\n * (`title` attribute on `vjs-mute-control` element and content of\n * `vjs-control-text` element).\n *\n * @private\n */\n updateControlText_() {\n const soundOff = this.player_.muted() || this.player_.volume() === 0;\n const text = soundOff ? 'Unmute' : 'Mute';\n if (this.controlText() !== text) {\n this.controlText(text);\n }\n }\n}\n\n/**\n * The text that should display over the `MuteToggle`s controls. Added for localization.\n *\n * @type {string}\n * @protected\n */\nMuteToggle.prototype.controlText_ = 'Mute';\nComponent$1.registerComponent('MuteToggle', MuteToggle);\n\n/**\n * @file volume-control.js\n */\n\n/**\n * A Component to contain the MuteToggle and VolumeControl so that\n * they can work together.\n *\n * @extends Component\n */\nclass VolumePanel extends Component$1 {\n /**\n * Creates an instance of this class.\n *\n * @param { import('./player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options={}]\n * The key/value store of player options.\n */\n constructor(player, options = {}) {\n if (typeof options.inline !== 'undefined') {\n options.inline = options.inline;\n } else {\n options.inline = true;\n }\n\n // pass the inline option down to the VolumeControl as vertical if\n // the VolumeControl is on.\n if (typeof options.volumeControl === 'undefined' || isPlain(options.volumeControl)) {\n options.volumeControl = options.volumeControl || {};\n options.volumeControl.vertical = !options.inline;\n }\n super(player, options);\n\n // this handler is used by mouse handler methods below\n this.handleKeyPressHandler_ = e => this.handleKeyPress(e);\n this.on(player, ['loadstart'], e => this.volumePanelState_(e));\n this.on(this.muteToggle, 'keyup', e => this.handleKeyPress(e));\n this.on(this.volumeControl, 'keyup', e => this.handleVolumeControlKeyUp(e));\n this.on('keydown', e => this.handleKeyPress(e));\n this.on('mouseover', e => this.handleMouseOver(e));\n this.on('mouseout', e => this.handleMouseOut(e));\n\n // while the slider is active (the mouse has been pressed down and\n // is dragging) we do not want to hide the VolumeBar\n this.on(this.volumeControl, ['slideractive'], this.sliderActive_);\n this.on(this.volumeControl, ['sliderinactive'], this.sliderInactive_);\n }\n\n /**\n * Add vjs-slider-active class to the VolumePanel\n *\n * @listens VolumeControl#slideractive\n * @private\n */\n sliderActive_() {\n this.addClass('vjs-slider-active');\n }\n\n /**\n * Removes vjs-slider-active class to the VolumePanel\n *\n * @listens VolumeControl#sliderinactive\n * @private\n */\n sliderInactive_() {\n this.removeClass('vjs-slider-active');\n }\n\n /**\n * Adds vjs-hidden or vjs-mute-toggle-only to the VolumePanel\n * depending on MuteToggle and VolumeControl state\n *\n * @listens Player#loadstart\n * @private\n */\n volumePanelState_() {\n // hide volume panel if neither volume control or mute toggle\n // are displayed\n if (this.volumeControl.hasClass('vjs-hidden') && this.muteToggle.hasClass('vjs-hidden')) {\n this.addClass('vjs-hidden');\n }\n\n // if only mute toggle is visible we don't want\n // volume panel expanding when hovered or active\n if (this.volumeControl.hasClass('vjs-hidden') && !this.muteToggle.hasClass('vjs-hidden')) {\n this.addClass('vjs-mute-toggle-only');\n }\n }\n\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n createEl() {\n let orientationClass = 'vjs-volume-panel-horizontal';\n if (!this.options_.inline) {\n orientationClass = 'vjs-volume-panel-vertical';\n }\n return super.createEl('div', {\n className: `vjs-volume-panel vjs-control ${orientationClass}`\n });\n }\n\n /**\n * Dispose of the `volume-panel` and all child components.\n */\n dispose() {\n this.handleMouseOut();\n super.dispose();\n }\n\n /**\n * Handles `keyup` events on the `VolumeControl`, looking for ESC, which closes\n * the volume panel and sets focus on `MuteToggle`.\n *\n * @param {Event} event\n * The `keyup` event that caused this function to be called.\n *\n * @listens keyup\n */\n handleVolumeControlKeyUp(event) {\n if (keycode.isEventKey(event, 'Esc')) {\n this.muteToggle.focus();\n }\n }\n\n /**\n * This gets called when a `VolumePanel` gains hover via a `mouseover` event.\n * Turns on listening for `mouseover` event. When they happen it\n * calls `this.handleMouseOver`.\n *\n * @param {Event} event\n * The `mouseover` event that caused this function to be called.\n *\n * @listens mouseover\n */\n handleMouseOver(event) {\n this.addClass('vjs-hover');\n on(document, 'keyup', this.handleKeyPressHandler_);\n }\n\n /**\n * This gets called when a `VolumePanel` gains hover via a `mouseout` event.\n * Turns on listening for `mouseout` event. When they happen it\n * calls `this.handleMouseOut`.\n *\n * @param {Event} event\n * The `mouseout` event that caused this function to be called.\n *\n * @listens mouseout\n */\n handleMouseOut(event) {\n this.removeClass('vjs-hover');\n off(document, 'keyup', this.handleKeyPressHandler_);\n }\n\n /**\n * Handles `keyup` event on the document or `keydown` event on the `VolumePanel`,\n * looking for ESC, which hides the `VolumeControl`.\n *\n * @param {Event} event\n * The keypress that triggered this event.\n *\n * @listens keydown | keyup\n */\n handleKeyPress(event) {\n if (keycode.isEventKey(event, 'Esc')) {\n this.handleMouseOut();\n }\n }\n}\n\n/**\n * Default options for the `VolumeControl`\n *\n * @type {Object}\n * @private\n */\nVolumePanel.prototype.options_ = {\n children: ['muteToggle', 'volumeControl']\n};\nComponent$1.registerComponent('VolumePanel', VolumePanel);\n\n/**\n * Button to skip forward a configurable amount of time\n * through a video. Renders in the control bar.\n *\n * e.g. options: {controlBar: {skipButtons: forward: 5}}\n *\n * @extends Button\n */\nclass SkipForward extends Button {\n constructor(player, options) {\n super(player, options);\n this.validOptions = [5, 10, 30];\n this.skipTime = this.getSkipForwardTime();\n if (this.skipTime && this.validOptions.includes(this.skipTime)) {\n this.setIcon(`forward-${this.skipTime}`);\n this.controlText(this.localize('Skip forward {1} seconds', [this.skipTime]));\n this.show();\n } else {\n this.hide();\n }\n }\n getSkipForwardTime() {\n const playerOptions = this.options_.playerOptions;\n return playerOptions.controlBar && playerOptions.controlBar.skipButtons && playerOptions.controlBar.skipButtons.forward;\n }\n buildCSSClass() {\n return `vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`;\n }\n\n /**\n * On click, skips forward in the duration/seekable range by a configurable amount of seconds.\n * If the time left in the duration/seekable range is less than the configured 'skip forward' time,\n * skips to end of duration/seekable range.\n *\n * Handle a click on a `SkipForward` button\n *\n * @param {EventTarget~Event} event\n * The `click` event that caused this function\n * to be called\n */\n handleClick(event) {\n if (isNaN(this.player_.duration())) {\n return;\n }\n const currentVideoTime = this.player_.currentTime();\n const liveTracker = this.player_.liveTracker;\n const duration = liveTracker && liveTracker.isLive() ? liveTracker.seekableEnd() : this.player_.duration();\n let newTime;\n if (currentVideoTime + this.skipTime <= duration) {\n newTime = currentVideoTime + this.skipTime;\n } else {\n newTime = duration;\n }\n this.player_.currentTime(newTime);\n }\n\n /**\n * Update control text on languagechange\n */\n handleLanguagechange() {\n this.controlText(this.localize('Skip forward {1} seconds', [this.skipTime]));\n }\n}\nComponent$1.registerComponent('SkipForward', SkipForward);\n\n/**\n * Button to skip backward a configurable amount of time\n * through a video. Renders in the control bar.\n *\n * * e.g. options: {controlBar: {skipButtons: backward: 5}}\n *\n * @extends Button\n */\nclass SkipBackward extends Button {\n constructor(player, options) {\n super(player, options);\n this.validOptions = [5, 10, 30];\n this.skipTime = this.getSkipBackwardTime();\n if (this.skipTime && this.validOptions.includes(this.skipTime)) {\n this.setIcon(`replay-${this.skipTime}`);\n this.controlText(this.localize('Skip backward {1} seconds', [this.skipTime]));\n this.show();\n } else {\n this.hide();\n }\n }\n getSkipBackwardTime() {\n const playerOptions = this.options_.playerOptions;\n return playerOptions.controlBar && playerOptions.controlBar.skipButtons && playerOptions.controlBar.skipButtons.backward;\n }\n buildCSSClass() {\n return `vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`;\n }\n\n /**\n * On click, skips backward in the video by a configurable amount of seconds.\n * If the current time in the video is less than the configured 'skip backward' time,\n * skips to beginning of video or seekable range.\n *\n * Handle a click on a `SkipBackward` button\n *\n * @param {EventTarget~Event} event\n * The `click` event that caused this function\n * to be called\n */\n handleClick(event) {\n const currentVideoTime = this.player_.currentTime();\n const liveTracker = this.player_.liveTracker;\n const seekableStart = liveTracker && liveTracker.isLive() && liveTracker.seekableStart();\n let newTime;\n if (seekableStart && currentVideoTime - this.skipTime <= seekableStart) {\n newTime = seekableStart;\n } else if (currentVideoTime >= this.skipTime) {\n newTime = currentVideoTime - this.skipTime;\n } else {\n newTime = 0;\n }\n this.player_.currentTime(newTime);\n }\n\n /**\n * Update control text on languagechange\n */\n handleLanguagechange() {\n this.controlText(this.localize('Skip backward {1} seconds', [this.skipTime]));\n }\n}\nSkipBackward.prototype.controlText_ = 'Skip Backward';\nComponent$1.registerComponent('SkipBackward', SkipBackward);\n\n/**\n * @file menu.js\n */\n\n/**\n * The Menu component is used to build popup menus, including subtitle and\n * captions selection menus.\n *\n * @extends Component\n */\nclass Menu extends Component$1 {\n /**\n * Create an instance of this class.\n *\n * @param { import('../player').default } player\n * the player that this component should attach to\n *\n * @param {Object} [options]\n * Object of option names and values\n *\n */\n constructor(player, options) {\n super(player, options);\n if (options) {\n this.menuButton_ = options.menuButton;\n }\n this.focusedChild_ = -1;\n this.on('keydown', e => this.handleKeyDown(e));\n\n // All the menu item instances share the same blur handler provided by the menu container.\n this.boundHandleBlur_ = e => this.handleBlur(e);\n this.boundHandleTapClick_ = e => this.handleTapClick(e);\n }\n\n /**\n * Add event listeners to the {@link MenuItem}.\n *\n * @param {Object} component\n * The instance of the `MenuItem` to add listeners to.\n *\n */\n addEventListenerForItem(component) {\n if (!(component instanceof Component$1)) {\n return;\n }\n this.on(component, 'blur', this.boundHandleBlur_);\n this.on(component, ['tap', 'click'], this.boundHandleTapClick_);\n }\n\n /**\n * Remove event listeners from the {@link MenuItem}.\n *\n * @param {Object} component\n * The instance of the `MenuItem` to remove listeners.\n *\n */\n removeEventListenerForItem(component) {\n if (!(component instanceof Component$1)) {\n return;\n }\n this.off(component, 'blur', this.boundHandleBlur_);\n this.off(component, ['tap', 'click'], this.boundHandleTapClick_);\n }\n\n /**\n * This method will be called indirectly when the component has been added\n * before the component adds to the new menu instance by `addItem`.\n * In this case, the original menu instance will remove the component\n * by calling `removeChild`.\n *\n * @param {Object} component\n * The instance of the `MenuItem`\n */\n removeChild(component) {\n if (typeof component === 'string') {\n component = this.getChild(component);\n }\n this.removeEventListenerForItem(component);\n super.removeChild(component);\n }\n\n /**\n * Add a {@link MenuItem} to the menu.\n *\n * @param {Object|string} component\n * The name or instance of the `MenuItem` to add.\n *\n */\n addItem(component) {\n const childComponent = this.addChild(component);\n if (childComponent) {\n this.addEventListenerForItem(childComponent);\n }\n }\n\n /**\n * Create the `Menu`s DOM element.\n *\n * @return {Element}\n * the element that was created\n */\n createEl() {\n const contentElType = this.options_.contentElType || 'ul';\n this.contentEl_ = createEl(contentElType, {\n className: 'vjs-menu-content'\n });\n this.contentEl_.setAttribute('role', 'menu');\n const el = super.createEl('div', {\n append: this.contentEl_,\n className: 'vjs-menu'\n });\n el.appendChild(this.contentEl_);\n\n // Prevent clicks from bubbling up. Needed for Menu Buttons,\n // where a click on the parent is significant\n on(el, 'click', function (event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n });\n return el;\n }\n dispose() {\n this.contentEl_ = null;\n this.boundHandleBlur_ = null;\n this.boundHandleTapClick_ = null;\n super.dispose();\n }\n\n /**\n * Called when a `MenuItem` loses focus.\n *\n * @param {Event} event\n * The `blur` event that caused this function to be called.\n *\n * @listens blur\n */\n handleBlur(event) {\n const relatedTarget = event.relatedTarget || document.activeElement;\n\n // Close menu popup when a user clicks outside the menu\n if (!this.children().some(element => {\n return element.el() === relatedTarget;\n })) {\n const btn = this.menuButton_;\n if (btn && btn.buttonPressed_ && relatedTarget !== btn.el().firstChild) {\n btn.unpressButton();\n }\n }\n }\n\n /**\n * Called when a `MenuItem` gets clicked or tapped.\n *\n * @param {Event} event\n * The `click` or `tap` event that caused this function to be called.\n *\n * @listens click,tap\n */\n handleTapClick(event) {\n // Unpress the associated MenuButton, and move focus back to it\n if (this.menuButton_) {\n this.menuButton_.unpressButton();\n const childComponents = this.children();\n if (!Array.isArray(childComponents)) {\n return;\n }\n const foundComponent = childComponents.filter(component => component.el() === event.target)[0];\n if (!foundComponent) {\n return;\n }\n\n // don't focus menu button if item is a caption settings item\n // because focus will move elsewhere\n if (foundComponent.name() !== 'CaptionSettingsMenuItem') {\n this.menuButton_.focus();\n }\n }\n }\n\n /**\n * Handle a `keydown` event on this menu. This listener is added in the constructor.\n *\n * @param {KeyboardEvent} event\n * A `keydown` event that happened on the menu.\n *\n * @listens keydown\n */\n handleKeyDown(event) {\n // Left and Down Arrows\n if (keycode.isEventKey(event, 'Left') || keycode.isEventKey(event, 'Down')) {\n event.preventDefault();\n event.stopPropagation();\n this.stepForward();\n\n // Up and Right Arrows\n } else if (keycode.isEventKey(event, 'Right') || keycode.isEventKey(event, 'Up')) {\n event.preventDefault();\n event.stopPropagation();\n this.stepBack();\n }\n }\n\n /**\n * Move to next (lower) menu item for keyboard users.\n */\n stepForward() {\n let stepChild = 0;\n if (this.focusedChild_ !== undefined) {\n stepChild = this.focusedChild_ + 1;\n }\n this.focus(stepChild);\n }\n\n /**\n * Move to previous (higher) menu item for keyboard users.\n */\n stepBack() {\n let stepChild = 0;\n if (this.focusedChild_ !== undefined) {\n stepChild = this.focusedChild_ - 1;\n }\n this.focus(stepChild);\n }\n\n /**\n * Set focus on a {@link MenuItem} in the `Menu`.\n *\n * @param {Object|string} [item=0]\n * Index of child item set focus on.\n */\n focus(item = 0) {\n const children = this.children().slice();\n const haveTitle = children.length && children[0].hasClass('vjs-menu-title');\n if (haveTitle) {\n children.shift();\n }\n if (children.length > 0) {\n if (item < 0) {\n item = 0;\n } else if (item >= children.length) {\n item = children.length - 1;\n }\n this.focusedChild_ = item;\n children[item].el_.focus();\n }\n }\n}\nComponent$1.registerComponent('Menu', Menu);\n\n/**\n * @file menu-button.js\n */\n\n/**\n * A `MenuButton` class for any popup {@link Menu}.\n *\n * @extends Component\n */\nclass MenuButton extends Component$1 {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options={}]\n * The key/value store of player options.\n */\n constructor(player, options = {}) {\n super(player, options);\n this.menuButton_ = new Button(player, options);\n this.menuButton_.controlText(this.controlText_);\n this.menuButton_.el_.setAttribute('aria-haspopup', 'true');\n\n // Add buildCSSClass values to the button, not the wrapper\n const buttonClass = Button.prototype.buildCSSClass();\n this.menuButton_.el_.className = this.buildCSSClass() + ' ' + buttonClass;\n this.menuButton_.removeClass('vjs-control');\n this.addChild(this.menuButton_);\n this.update();\n this.enabled_ = true;\n const handleClick = e => this.handleClick(e);\n this.handleMenuKeyUp_ = e => this.handleMenuKeyUp(e);\n this.on(this.menuButton_, 'tap', handleClick);\n this.on(this.menuButton_, 'click', handleClick);\n this.on(this.menuButton_, 'keydown', e => this.handleKeyDown(e));\n this.on(this.menuButton_, 'mouseenter', () => {\n this.addClass('vjs-hover');\n this.menu.show();\n on(document, 'keyup', this.handleMenuKeyUp_);\n });\n this.on('mouseleave', e => this.handleMouseLeave(e));\n this.on('keydown', e => this.handleSubmenuKeyDown(e));\n }\n\n /**\n * Update the menu based on the current state of its items.\n */\n update() {\n const menu = this.createMenu();\n if (this.menu) {\n this.menu.dispose();\n this.removeChild(this.menu);\n }\n this.menu = menu;\n this.addChild(menu);\n\n /**\n * Track the state of the menu button\n *\n * @type {Boolean}\n * @private\n */\n this.buttonPressed_ = false;\n this.menuButton_.el_.setAttribute('aria-expanded', 'false');\n if (this.items && this.items.length <= this.hideThreshold_) {\n this.hide();\n this.menu.contentEl_.removeAttribute('role');\n } else {\n this.show();\n this.menu.contentEl_.setAttribute('role', 'menu');\n }\n }\n\n /**\n * Create the menu and add all items to it.\n *\n * @return {Menu}\n * The constructed menu\n */\n createMenu() {\n const menu = new Menu(this.player_, {\n menuButton: this\n });\n\n /**\n * Hide the menu if the number of items is less than or equal to this threshold. This defaults\n * to 0 and whenever we add items which can be hidden to the menu we'll increment it. We list\n * it here because every time we run `createMenu` we need to reset the value.\n *\n * @protected\n * @type {Number}\n */\n this.hideThreshold_ = 0;\n\n // Add a title list item to the top\n if (this.options_.title) {\n const titleEl = createEl('li', {\n className: 'vjs-menu-title',\n textContent: toTitleCase$1(this.options_.title),\n tabIndex: -1\n });\n const titleComponent = new Component$1(this.player_, {\n el: titleEl\n });\n menu.addItem(titleComponent);\n }\n this.items = this.createItems();\n if (this.items) {\n // Add menu items to the menu\n for (let i = 0; i < this.items.length; i++) {\n menu.addItem(this.items[i]);\n }\n }\n return menu;\n }\n\n /**\n * Create the list of menu items. Specific to each subclass.\n *\n * @abstract\n */\n createItems() {}\n\n /**\n * Create the `MenuButtons`s DOM element.\n *\n * @return {Element}\n * The element that gets created.\n */\n createEl() {\n return super.createEl('div', {\n className: this.buildWrapperCSSClass()\n }, {});\n }\n\n /**\n * Overwrites the `setIcon` method from `Component`.\n * In this case, we want the icon to be appended to the menuButton.\n *\n * @param {string} name\n * The icon name to be added.\n */\n setIcon(name) {\n super.setIcon(name, this.menuButton_.el_);\n }\n\n /**\n * Allow sub components to stack CSS class names for the wrapper element\n *\n * @return {string}\n * The constructed wrapper DOM `className`\n */\n buildWrapperCSSClass() {\n let menuButtonClass = 'vjs-menu-button';\n\n // If the inline option is passed, we want to use different styles altogether.\n if (this.options_.inline === true) {\n menuButtonClass += '-inline';\n } else {\n menuButtonClass += '-popup';\n }\n\n // TODO: Fix the CSS so that this isn't necessary\n const buttonClass = Button.prototype.buildCSSClass();\n return `vjs-menu-button ${menuButtonClass} ${buttonClass} ${super.buildCSSClass()}`;\n }\n\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n buildCSSClass() {\n let menuButtonClass = 'vjs-menu-button';\n\n // If the inline option is passed, we want to use different styles altogether.\n if (this.options_.inline === true) {\n menuButtonClass += '-inline';\n } else {\n menuButtonClass += '-popup';\n }\n return `vjs-menu-button ${menuButtonClass} ${super.buildCSSClass()}`;\n }\n\n /**\n * Get or set the localized control text that will be used for accessibility.\n *\n * > NOTE: This will come from the internal `menuButton_` element.\n *\n * @param {string} [text]\n * Control text for element.\n *\n * @param {Element} [el=this.menuButton_.el()]\n * Element to set the title on.\n *\n * @return {string}\n * - The control text when getting\n */\n controlText(text, el = this.menuButton_.el()) {\n return this.menuButton_.controlText(text, el);\n }\n\n /**\n * Dispose of the `menu-button` and all child components.\n */\n dispose() {\n this.handleMouseLeave();\n super.dispose();\n }\n\n /**\n * Handle a click on a `MenuButton`.\n * See {@link ClickableComponent#handleClick} for instances where this is called.\n *\n * @param {Event} event\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n handleClick(event) {\n if (this.buttonPressed_) {\n this.unpressButton();\n } else {\n this.pressButton();\n }\n }\n\n /**\n * Handle `mouseleave` for `MenuButton`.\n *\n * @param {Event} event\n * The `mouseleave` event that caused this function to be called.\n *\n * @listens mouseleave\n */\n handleMouseLeave(event) {\n this.removeClass('vjs-hover');\n off(document, 'keyup', this.handleMenuKeyUp_);\n }\n\n /**\n * Set the focus to the actual button, not to this element\n */\n focus() {\n this.menuButton_.focus();\n }\n\n /**\n * Remove the focus from the actual button, not this element\n */\n blur() {\n this.menuButton_.blur();\n }\n\n /**\n * Handle tab, escape, down arrow, and up arrow keys for `MenuButton`. See\n * {@link ClickableComponent#handleKeyDown} for instances where this is called.\n *\n * @param {Event} event\n * The `keydown` event that caused this function to be called.\n *\n * @listens keydown\n */\n handleKeyDown(event) {\n // Escape or Tab unpress the 'button'\n if (keycode.isEventKey(event, 'Esc') || keycode.isEventKey(event, 'Tab')) {\n if (this.buttonPressed_) {\n this.unpressButton();\n }\n\n // Don't preventDefault for Tab key - we still want to lose focus\n if (!keycode.isEventKey(event, 'Tab')) {\n event.preventDefault();\n // Set focus back to the menu button's button\n this.menuButton_.focus();\n }\n // Up Arrow or Down Arrow also 'press' the button to open the menu\n } else if (keycode.isEventKey(event, 'Up') || keycode.isEventKey(event, 'Down')) {\n if (!this.buttonPressed_) {\n event.preventDefault();\n this.pressButton();\n }\n }\n }\n\n /**\n * Handle a `keyup` event on a `MenuButton`. The listener for this is added in\n * the constructor.\n *\n * @param {Event} event\n * Key press event\n *\n * @listens keyup\n */\n handleMenuKeyUp(event) {\n // Escape hides popup menu\n if (keycode.isEventKey(event, 'Esc') || keycode.isEventKey(event, 'Tab')) {\n this.removeClass('vjs-hover');\n }\n }\n\n /**\n * This method name now delegates to `handleSubmenuKeyDown`. This means\n * anyone calling `handleSubmenuKeyPress` will not see their method calls\n * stop working.\n *\n * @param {Event} event\n * The event that caused this function to be called.\n */\n handleSubmenuKeyPress(event) {\n this.handleSubmenuKeyDown(event);\n }\n\n /**\n * Handle a `keydown` event on a sub-menu. The listener for this is added in\n * the constructor.\n *\n * @param {Event} event\n * Key press event\n *\n * @listens keydown\n */\n handleSubmenuKeyDown(event) {\n // Escape or Tab unpress the 'button'\n if (keycode.isEventKey(event, 'Esc') || keycode.isEventKey(event, 'Tab')) {\n if (this.buttonPressed_) {\n this.unpressButton();\n }\n // Don't preventDefault for Tab key - we still want to lose focus\n if (!keycode.isEventKey(event, 'Tab')) {\n event.preventDefault();\n // Set focus back to the menu button's button\n this.menuButton_.focus();\n }\n }\n }\n\n /**\n * Put the current `MenuButton` into a pressed state.\n */\n pressButton() {\n if (this.enabled_) {\n this.buttonPressed_ = true;\n this.menu.show();\n this.menu.lockShowing();\n this.menuButton_.el_.setAttribute('aria-expanded', 'true');\n\n // set the focus into the submenu, except on iOS where it is resulting in\n // undesired scrolling behavior when the player is in an iframe\n if (IS_IOS && isInFrame()) {\n // Return early so that the menu isn't focused\n return;\n }\n this.menu.focus();\n }\n }\n\n /**\n * Take the current `MenuButton` out of a pressed state.\n */\n unpressButton() {\n if (this.enabled_) {\n this.buttonPressed_ = false;\n this.menu.unlockShowing();\n this.menu.hide();\n this.menuButton_.el_.setAttribute('aria-expanded', 'false');\n }\n }\n\n /**\n * Disable the `MenuButton`. Don't allow it to be clicked.\n */\n disable() {\n this.unpressButton();\n this.enabled_ = false;\n this.addClass('vjs-disabled');\n this.menuButton_.disable();\n }\n\n /**\n * Enable the `MenuButton`. Allow it to be clicked.\n */\n enable() {\n this.enabled_ = true;\n this.removeClass('vjs-disabled');\n this.menuButton_.enable();\n }\n}\nComponent$1.registerComponent('MenuButton', MenuButton);\n\n/**\n * @file track-button.js\n */\n\n/**\n * The base class for buttons that toggle specific track types (e.g. subtitles).\n *\n * @extends MenuButton\n */\nclass TrackButton extends MenuButton {\n /**\n * Creates an instance of this class.\n *\n * @param { import('./player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n const tracks = options.tracks;\n super(player, options);\n if (this.items.length <= 1) {\n this.hide();\n }\n if (!tracks) {\n return;\n }\n const updateHandler = bind_(this, this.update);\n tracks.addEventListener('removetrack', updateHandler);\n tracks.addEventListener('addtrack', updateHandler);\n tracks.addEventListener('labelchange', updateHandler);\n this.player_.on('ready', updateHandler);\n this.player_.on('dispose', function () {\n tracks.removeEventListener('removetrack', updateHandler);\n tracks.removeEventListener('addtrack', updateHandler);\n tracks.removeEventListener('labelchange', updateHandler);\n });\n }\n}\nComponent$1.registerComponent('TrackButton', TrackButton);\n\n/**\n * @file menu-keys.js\n */\n\n/**\n * All keys used for operation of a menu (`MenuButton`, `Menu`, and `MenuItem`)\n * Note that 'Enter' and 'Space' are not included here (otherwise they would\n * prevent the `MenuButton` and `MenuItem` from being keyboard-clickable)\n *\n * @typedef MenuKeys\n * @array\n */\nconst MenuKeys = ['Tab', 'Esc', 'Up', 'Down', 'Right', 'Left'];\n\n/**\n * @file menu-item.js\n */\n\n/**\n * The component for a menu item. `<li>`\n *\n * @extends ClickableComponent\n */\nclass MenuItem extends ClickableComponent {\n /**\n * Creates an instance of the this class.\n *\n * @param { import('../player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options={}]\n * The key/value store of player options.\n *\n */\n constructor(player, options) {\n super(player, options);\n this.selectable = options.selectable;\n this.isSelected_ = options.selected || false;\n this.multiSelectable = options.multiSelectable;\n this.selected(this.isSelected_);\n if (this.selectable) {\n if (this.multiSelectable) {\n this.el_.setAttribute('role', 'menuitemcheckbox');\n } else {\n this.el_.setAttribute('role', 'menuitemradio');\n }\n } else {\n this.el_.setAttribute('role', 'menuitem');\n }\n }\n\n /**\n * Create the `MenuItem's DOM element\n *\n * @param {string} [type=li]\n * Element's node type, not actually used, always set to `li`.\n *\n * @param {Object} [props={}]\n * An object of properties that should be set on the element\n *\n * @param {Object} [attrs={}]\n * An object of attributes that should be set on the element\n *\n * @return {Element}\n * The element that gets created.\n */\n createEl(type, props, attrs) {\n // The control is textual, not just an icon\n this.nonIconControl = true;\n const el = super.createEl('li', Object.assign({\n className: 'vjs-menu-item',\n tabIndex: -1\n }, props), attrs);\n\n // swap icon with menu item text.\n const menuItemEl = createEl('span', {\n className: 'vjs-menu-item-text',\n textContent: this.localize(this.options_.label)\n });\n\n // If using SVG icons, the element with vjs-icon-placeholder will be added separately.\n if (this.player_.options_.experimentalSvgIcons) {\n el.appendChild(menuItemEl);\n } else {\n el.replaceChild(menuItemEl, el.querySelector('.vjs-icon-placeholder'));\n }\n return el;\n }\n\n /**\n * Ignore keys which are used by the menu, but pass any other ones up. See\n * {@link ClickableComponent#handleKeyDown} for instances where this is called.\n *\n * @param {KeyboardEvent} event\n * The `keydown` event that caused this function to be called.\n *\n * @listens keydown\n */\n handleKeyDown(event) {\n if (!MenuKeys.some(key => keycode.isEventKey(event, key))) {\n // Pass keydown handling up for unused keys\n super.handleKeyDown(event);\n }\n }\n\n /**\n * Any click on a `MenuItem` puts it into the selected state.\n * See {@link ClickableComponent#handleClick} for instances where this is called.\n *\n * @param {Event} event\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n handleClick(event) {\n this.selected(true);\n }\n\n /**\n * Set the state for this menu item as selected or not.\n *\n * @param {boolean} selected\n * if the menu item is selected or not\n */\n selected(selected) {\n if (this.selectable) {\n if (selected) {\n this.addClass('vjs-selected');\n this.el_.setAttribute('aria-checked', 'true');\n // aria-checked isn't fully supported by browsers/screen readers,\n // so indicate selected state to screen reader in the control text.\n this.controlText(', selected');\n this.isSelected_ = true;\n } else {\n this.removeClass('vjs-selected');\n this.el_.setAttribute('aria-checked', 'false');\n // Indicate un-selected state to screen reader\n this.controlText('');\n this.isSelected_ = false;\n }\n }\n }\n}\nComponent$1.registerComponent('MenuItem', MenuItem);\n\n/**\n * @file text-track-menu-item.js\n */\n\n/**\n * The specific menu item type for selecting a language within a text track kind\n *\n * @extends MenuItem\n */\nclass TextTrackMenuItem extends MenuItem {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../../player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n const track = options.track;\n const tracks = player.textTracks();\n\n // Modify options for parent MenuItem class's init.\n options.label = track.label || track.language || 'Unknown';\n options.selected = track.mode === 'showing';\n super(player, options);\n this.track = track;\n // Determine the relevant kind(s) of tracks for this component and filter\n // out empty kinds.\n this.kinds = (options.kinds || [options.kind || this.track.kind]).filter(Boolean);\n const changeHandler = (...args) => {\n this.handleTracksChange.apply(this, args);\n };\n const selectedLanguageChangeHandler = (...args) => {\n this.handleSelectedLanguageChange.apply(this, args);\n };\n player.on(['loadstart', 'texttrackchange'], changeHandler);\n tracks.addEventListener('change', changeHandler);\n tracks.addEventListener('selectedlanguagechange', selectedLanguageChangeHandler);\n this.on('dispose', function () {\n player.off(['loadstart', 'texttrackchange'], changeHandler);\n tracks.removeEventListener('change', changeHandler);\n tracks.removeEventListener('selectedlanguagechange', selectedLanguageChangeHandler);\n });\n\n // iOS7 doesn't dispatch change events to TextTrackLists when an\n // associated track's mode changes. Without something like\n // Object.observe() (also not present on iOS7), it's not\n // possible to detect changes to the mode attribute and polyfill\n // the change event. As a poor substitute, we manually dispatch\n // change events whenever the controls modify the mode.\n if (tracks.onchange === undefined) {\n let event;\n this.on(['tap', 'click'], function () {\n if (typeof window$1.Event !== 'object') {\n // Android 2.3 throws an Illegal Constructor error for window.Event\n try {\n event = new window$1.Event('change');\n } catch (err) {\n // continue regardless of error\n }\n }\n if (!event) {\n event = document.createEvent('Event');\n event.initEvent('change', true, true);\n }\n tracks.dispatchEvent(event);\n });\n }\n\n // set the default state based on current tracks\n this.handleTracksChange();\n }\n\n /**\n * This gets called when an `TextTrackMenuItem` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {Event} event\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n handleClick(event) {\n const referenceTrack = this.track;\n const tracks = this.player_.textTracks();\n super.handleClick(event);\n if (!tracks) {\n return;\n }\n for (let i = 0; i < tracks.length; i++) {\n const track = tracks[i];\n\n // If the track from the text tracks list is not of the right kind,\n // skip it. We do not want to affect tracks of incompatible kind(s).\n if (this.kinds.indexOf(track.kind) === -1) {\n continue;\n }\n\n // If this text track is the component's track and it is not showing,\n // set it to showing.\n if (track === referenceTrack) {\n if (track.mode !== 'showing') {\n track.mode = 'showing';\n }\n\n // If this text track is not the component's track and it is not\n // disabled, set it to disabled.\n } else if (track.mode !== 'disabled') {\n track.mode = 'disabled';\n }\n }\n }\n\n /**\n * Handle text track list change\n *\n * @param {Event} event\n * The `change` event that caused this function to be called.\n *\n * @listens TextTrackList#change\n */\n handleTracksChange(event) {\n const shouldBeSelected = this.track.mode === 'showing';\n\n // Prevent redundant selected() calls because they may cause\n // screen readers to read the appended control text unnecessarily\n if (shouldBeSelected !== this.isSelected_) {\n this.selected(shouldBeSelected);\n }\n }\n handleSelectedLanguageChange(event) {\n if (this.track.mode === 'showing') {\n const selectedLanguage = this.player_.cache_.selectedLanguage;\n\n // Don't replace the kind of track across the same language\n if (selectedLanguage && selectedLanguage.enabled && selectedLanguage.language === this.track.language && selectedLanguage.kind !== this.track.kind) {\n return;\n }\n this.player_.cache_.selectedLanguage = {\n enabled: true,\n language: this.track.language,\n kind: this.track.kind\n };\n }\n }\n dispose() {\n // remove reference to track object on dispose\n this.track = null;\n super.dispose();\n }\n}\nComponent$1.registerComponent('TextTrackMenuItem', TextTrackMenuItem);\n\n/**\n * @file off-text-track-menu-item.js\n */\n\n/**\n * A special menu item for turning off a specific type of text track\n *\n * @extends TextTrackMenuItem\n */\nclass OffTextTrackMenuItem extends TextTrackMenuItem {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../../player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n // Create pseudo track info\n // Requires options['kind']\n options.track = {\n player,\n // it is no longer necessary to store `kind` or `kinds` on the track itself\n // since they are now stored in the `kinds` property of all instances of\n // TextTrackMenuItem, but this will remain for backwards compatibility\n kind: options.kind,\n kinds: options.kinds,\n default: false,\n mode: 'disabled'\n };\n if (!options.kinds) {\n options.kinds = [options.kind];\n }\n if (options.label) {\n options.track.label = options.label;\n } else {\n options.track.label = options.kinds.join(' and ') + ' off';\n }\n\n // MenuItem is selectable\n options.selectable = true;\n // MenuItem is NOT multiSelectable (i.e. only one can be marked \"selected\" at a time)\n options.multiSelectable = false;\n super(player, options);\n }\n\n /**\n * Handle text track change\n *\n * @param {Event} event\n * The event that caused this function to run\n */\n handleTracksChange(event) {\n const tracks = this.player().textTracks();\n let shouldBeSelected = true;\n for (let i = 0, l = tracks.length; i < l; i++) {\n const track = tracks[i];\n if (this.options_.kinds.indexOf(track.kind) > -1 && track.mode === 'showing') {\n shouldBeSelected = false;\n break;\n }\n }\n\n // Prevent redundant selected() calls because they may cause\n // screen readers to read the appended control text unnecessarily\n if (shouldBeSelected !== this.isSelected_) {\n this.selected(shouldBeSelected);\n }\n }\n handleSelectedLanguageChange(event) {\n const tracks = this.player().textTracks();\n let allHidden = true;\n for (let i = 0, l = tracks.length; i < l; i++) {\n const track = tracks[i];\n if (['captions', 'descriptions', 'subtitles'].indexOf(track.kind) > -1 && track.mode === 'showing') {\n allHidden = false;\n break;\n }\n }\n if (allHidden) {\n this.player_.cache_.selectedLanguage = {\n enabled: false\n };\n }\n }\n\n /**\n * Update control text and label on languagechange\n */\n handleLanguagechange() {\n this.$('.vjs-menu-item-text').textContent = this.player_.localize(this.options_.label);\n super.handleLanguagechange();\n }\n}\nComponent$1.registerComponent('OffTextTrackMenuItem', OffTextTrackMenuItem);\n\n/**\n * @file text-track-button.js\n */\n\n/**\n * The base class for buttons that toggle specific text track types (e.g. subtitles)\n *\n * @extends MenuButton\n */\nclass TextTrackButton extends TrackButton {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../../player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options={}]\n * The key/value store of player options.\n */\n constructor(player, options = {}) {\n options.tracks = player.textTracks();\n super(player, options);\n }\n\n /**\n * Create a menu item for each text track\n *\n * @param {TextTrackMenuItem[]} [items=[]]\n * Existing array of items to use during creation\n *\n * @return {TextTrackMenuItem[]}\n * Array of menu items that were created\n */\n createItems(items = [], TrackMenuItem = TextTrackMenuItem) {\n // Label is an override for the [track] off label\n // USed to localise captions/subtitles\n let label;\n if (this.label_) {\n label = `${this.label_} off`;\n }\n // Add an OFF menu item to turn all tracks off\n items.push(new OffTextTrackMenuItem(this.player_, {\n kinds: this.kinds_,\n kind: this.kind_,\n label\n }));\n this.hideThreshold_ += 1;\n const tracks = this.player_.textTracks();\n if (!Array.isArray(this.kinds_)) {\n this.kinds_ = [this.kind_];\n }\n for (let i = 0; i < tracks.length; i++) {\n const track = tracks[i];\n\n // only add tracks that are of an appropriate kind and have a label\n if (this.kinds_.indexOf(track.kind) > -1) {\n const item = new TrackMenuItem(this.player_, {\n track,\n kinds: this.kinds_,\n kind: this.kind_,\n // MenuItem is selectable\n selectable: true,\n // MenuItem is NOT multiSelectable (i.e. only one can be marked \"selected\" at a time)\n multiSelectable: false\n });\n item.addClass(`vjs-${track.kind}-menu-item`);\n items.push(item);\n }\n }\n return items;\n }\n}\nComponent$1.registerComponent('TextTrackButton', TextTrackButton);\n\n/**\n * @file chapters-track-menu-item.js\n */\n\n/**\n * The chapter track menu item\n *\n * @extends MenuItem\n */\nclass ChaptersTrackMenuItem extends MenuItem {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../../player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n const track = options.track;\n const cue = options.cue;\n const currentTime = player.currentTime();\n\n // Modify options for parent MenuItem class's init.\n options.selectable = true;\n options.multiSelectable = false;\n options.label = cue.text;\n options.selected = cue.startTime <= currentTime && currentTime < cue.endTime;\n super(player, options);\n this.track = track;\n this.cue = cue;\n }\n\n /**\n * This gets called when an `ChaptersTrackMenuItem` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n handleClick(event) {\n super.handleClick();\n this.player_.currentTime(this.cue.startTime);\n }\n}\nComponent$1.registerComponent('ChaptersTrackMenuItem', ChaptersTrackMenuItem);\n\n/**\n * @file chapters-button.js\n */\n\n/**\n * The button component for toggling and selecting chapters\n * Chapters act much differently than other text tracks\n * Cues are navigation vs. other tracks of alternative languages\n *\n * @extends TextTrackButton\n */\nclass ChaptersButton extends TextTrackButton {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../../player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Function} [ready]\n * The function to call when this function is ready.\n */\n constructor(player, options, ready) {\n super(player, options, ready);\n this.setIcon('chapters');\n this.selectCurrentItem_ = () => {\n this.items.forEach(item => {\n item.selected(this.track_.activeCues[0] === item.cue);\n });\n };\n }\n\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n buildCSSClass() {\n return `vjs-chapters-button ${super.buildCSSClass()}`;\n }\n buildWrapperCSSClass() {\n return `vjs-chapters-button ${super.buildWrapperCSSClass()}`;\n }\n\n /**\n * Update the menu based on the current state of its items.\n *\n * @param {Event} [event]\n * An event that triggered this function to run.\n *\n * @listens TextTrackList#addtrack\n * @listens TextTrackList#removetrack\n * @listens TextTrackList#change\n */\n update(event) {\n if (event && event.track && event.track.kind !== 'chapters') {\n return;\n }\n const track = this.findChaptersTrack();\n if (track !== this.track_) {\n this.setTrack(track);\n super.update();\n } else if (!this.items || track && track.cues && track.cues.length !== this.items.length) {\n // Update the menu initially or if the number of cues has changed since set\n super.update();\n }\n }\n\n /**\n * Set the currently selected track for the chapters button.\n *\n * @param {TextTrack} track\n * The new track to select. Nothing will change if this is the currently selected\n * track.\n */\n setTrack(track) {\n if (this.track_ === track) {\n return;\n }\n if (!this.updateHandler_) {\n this.updateHandler_ = this.update.bind(this);\n }\n\n // here this.track_ refers to the old track instance\n if (this.track_) {\n const remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);\n if (remoteTextTrackEl) {\n remoteTextTrackEl.removeEventListener('load', this.updateHandler_);\n }\n this.track_.removeEventListener('cuechange', this.selectCurrentItem_);\n this.track_ = null;\n }\n this.track_ = track;\n\n // here this.track_ refers to the new track instance\n if (this.track_) {\n this.track_.mode = 'hidden';\n const remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);\n if (remoteTextTrackEl) {\n remoteTextTrackEl.addEventListener('load', this.updateHandler_);\n }\n this.track_.addEventListener('cuechange', this.selectCurrentItem_);\n }\n }\n\n /**\n * Find the track object that is currently in use by this ChaptersButton\n *\n * @return {TextTrack|undefined}\n * The current track or undefined if none was found.\n */\n findChaptersTrack() {\n const tracks = this.player_.textTracks() || [];\n for (let i = tracks.length - 1; i >= 0; i--) {\n // We will always choose the last track as our chaptersTrack\n const track = tracks[i];\n if (track.kind === this.kind_) {\n return track;\n }\n }\n }\n\n /**\n * Get the caption for the ChaptersButton based on the track label. This will also\n * use the current tracks localized kind as a fallback if a label does not exist.\n *\n * @return {string}\n * The tracks current label or the localized track kind.\n */\n getMenuCaption() {\n if (this.track_ && this.track_.label) {\n return this.track_.label;\n }\n return this.localize(toTitleCase$1(this.kind_));\n }\n\n /**\n * Create menu from chapter track\n *\n * @return { import('../../menu/menu').default }\n * New menu for the chapter buttons\n */\n createMenu() {\n this.options_.title = this.getMenuCaption();\n return super.createMenu();\n }\n\n /**\n * Create a menu item for each text track\n *\n * @return { import('./text-track-menu-item').default[] }\n * Array of menu items\n */\n createItems() {\n const items = [];\n if (!this.track_) {\n return items;\n }\n const cues = this.track_.cues;\n if (!cues) {\n return items;\n }\n for (let i = 0, l = cues.length; i < l; i++) {\n const cue = cues[i];\n const mi = new ChaptersTrackMenuItem(this.player_, {\n track: this.track_,\n cue\n });\n items.push(mi);\n }\n return items;\n }\n}\n\n/**\n * `kind` of TextTrack to look for to associate it with this menu.\n *\n * @type {string}\n * @private\n */\nChaptersButton.prototype.kind_ = 'chapters';\n\n/**\n * The text that should display over the `ChaptersButton`s controls. Added for localization.\n *\n * @type {string}\n * @protected\n */\nChaptersButton.prototype.controlText_ = 'Chapters';\nComponent$1.registerComponent('ChaptersButton', ChaptersButton);\n\n/**\n * @file descriptions-button.js\n */\n\n/**\n * The button component for toggling and selecting descriptions\n *\n * @extends TextTrackButton\n */\nclass DescriptionsButton extends TextTrackButton {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../../player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Function} [ready]\n * The function to call when this component is ready.\n */\n constructor(player, options, ready) {\n super(player, options, ready);\n this.setIcon('audio-description');\n const tracks = player.textTracks();\n const changeHandler = bind_(this, this.handleTracksChange);\n tracks.addEventListener('change', changeHandler);\n this.on('dispose', function () {\n tracks.removeEventListener('change', changeHandler);\n });\n }\n\n /**\n * Handle text track change\n *\n * @param {Event} event\n * The event that caused this function to run\n *\n * @listens TextTrackList#change\n */\n handleTracksChange(event) {\n const tracks = this.player().textTracks();\n let disabled = false;\n\n // Check whether a track of a different kind is showing\n for (let i = 0, l = tracks.length; i < l; i++) {\n const track = tracks[i];\n if (track.kind !== this.kind_ && track.mode === 'showing') {\n disabled = true;\n break;\n }\n }\n\n // If another track is showing, disable this menu button\n if (disabled) {\n this.disable();\n } else {\n this.enable();\n }\n }\n\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n buildCSSClass() {\n return `vjs-descriptions-button ${super.buildCSSClass()}`;\n }\n buildWrapperCSSClass() {\n return `vjs-descriptions-button ${super.buildWrapperCSSClass()}`;\n }\n}\n\n/**\n * `kind` of TextTrack to look for to associate it with this menu.\n *\n * @type {string}\n * @private\n */\nDescriptionsButton.prototype.kind_ = 'descriptions';\n\n/**\n * The text that should display over the `DescriptionsButton`s controls. Added for localization.\n *\n * @type {string}\n * @protected\n */\nDescriptionsButton.prototype.controlText_ = 'Descriptions';\nComponent$1.registerComponent('DescriptionsButton', DescriptionsButton);\n\n/**\n * @file subtitles-button.js\n */\n\n/**\n * The button component for toggling and selecting subtitles\n *\n * @extends TextTrackButton\n */\nclass SubtitlesButton extends TextTrackButton {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../../player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Function} [ready]\n * The function to call when this component is ready.\n */\n constructor(player, options, ready) {\n super(player, options, ready);\n this.setIcon('subtitles');\n }\n\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n buildCSSClass() {\n return `vjs-subtitles-button ${super.buildCSSClass()}`;\n }\n buildWrapperCSSClass() {\n return `vjs-subtitles-button ${super.buildWrapperCSSClass()}`;\n }\n}\n\n/**\n * `kind` of TextTrack to look for to associate it with this menu.\n *\n * @type {string}\n * @private\n */\nSubtitlesButton.prototype.kind_ = 'subtitles';\n\n/**\n * The text that should display over the `SubtitlesButton`s controls. Added for localization.\n *\n * @type {string}\n * @protected\n */\nSubtitlesButton.prototype.controlText_ = 'Subtitles';\nComponent$1.registerComponent('SubtitlesButton', SubtitlesButton);\n\n/**\n * @file caption-settings-menu-item.js\n */\n\n/**\n * The menu item for caption track settings menu\n *\n * @extends TextTrackMenuItem\n */\nclass CaptionSettingsMenuItem extends TextTrackMenuItem {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../../player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n options.track = {\n player,\n kind: options.kind,\n label: options.kind + ' settings',\n selectable: false,\n default: false,\n mode: 'disabled'\n };\n\n // CaptionSettingsMenuItem has no concept of 'selected'\n options.selectable = false;\n options.name = 'CaptionSettingsMenuItem';\n super(player, options);\n this.addClass('vjs-texttrack-settings');\n this.controlText(', opens ' + options.kind + ' settings dialog');\n }\n\n /**\n * This gets called when an `CaptionSettingsMenuItem` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n handleClick(event) {\n this.player().getChild('textTrackSettings').open();\n }\n\n /**\n * Update control text and label on languagechange\n */\n handleLanguagechange() {\n this.$('.vjs-menu-item-text').textContent = this.player_.localize(this.options_.kind + ' settings');\n super.handleLanguagechange();\n }\n}\nComponent$1.registerComponent('CaptionSettingsMenuItem', CaptionSettingsMenuItem);\n\n/**\n * @file captions-button.js\n */\n\n/**\n * The button component for toggling and selecting captions\n *\n * @extends TextTrackButton\n */\nclass CaptionsButton extends TextTrackButton {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../../player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Function} [ready]\n * The function to call when this component is ready.\n */\n constructor(player, options, ready) {\n super(player, options, ready);\n this.setIcon('captions');\n }\n\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n buildCSSClass() {\n return `vjs-captions-button ${super.buildCSSClass()}`;\n }\n buildWrapperCSSClass() {\n return `vjs-captions-button ${super.buildWrapperCSSClass()}`;\n }\n\n /**\n * Create caption menu items\n *\n * @return {CaptionSettingsMenuItem[]}\n * The array of current menu items.\n */\n createItems() {\n const items = [];\n if (!(this.player().tech_ && this.player().tech_.featuresNativeTextTracks) && this.player().getChild('textTrackSettings')) {\n items.push(new CaptionSettingsMenuItem(this.player_, {\n kind: this.kind_\n }));\n this.hideThreshold_ += 1;\n }\n return super.createItems(items);\n }\n}\n\n/**\n * `kind` of TextTrack to look for to associate it with this menu.\n *\n * @type {string}\n * @private\n */\nCaptionsButton.prototype.kind_ = 'captions';\n\n/**\n * The text that should display over the `CaptionsButton`s controls. Added for localization.\n *\n * @type {string}\n * @protected\n */\nCaptionsButton.prototype.controlText_ = 'Captions';\nComponent$1.registerComponent('CaptionsButton', CaptionsButton);\n\n/**\n * @file subs-caps-menu-item.js\n */\n\n/**\n * SubsCapsMenuItem has an [cc] icon to distinguish captions from subtitles\n * in the SubsCapsMenu.\n *\n * @extends TextTrackMenuItem\n */\nclass SubsCapsMenuItem extends TextTrackMenuItem {\n createEl(type, props, attrs) {\n const el = super.createEl(type, props, attrs);\n const parentSpan = el.querySelector('.vjs-menu-item-text');\n if (this.options_.track.kind === 'captions') {\n if (this.player_.options_.experimentalSvgIcons) {\n this.setIcon('captions', el);\n } else {\n parentSpan.appendChild(createEl('span', {\n className: 'vjs-icon-placeholder'\n }, {\n 'aria-hidden': true\n }));\n }\n parentSpan.appendChild(createEl('span', {\n className: 'vjs-control-text',\n // space added as the text will visually flow with the\n // label\n textContent: ` ${this.localize('Captions')}`\n }));\n }\n return el;\n }\n}\nComponent$1.registerComponent('SubsCapsMenuItem', SubsCapsMenuItem);\n\n/**\n * @file sub-caps-button.js\n */\n\n/**\n * The button component for toggling and selecting captions and/or subtitles\n *\n * @extends TextTrackButton\n */\nclass SubsCapsButton extends TextTrackButton {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../../player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Function} [ready]\n * The function to call when this component is ready.\n */\n constructor(player, options = {}) {\n super(player, options);\n\n // Although North America uses \"captions\" in most cases for\n // \"captions and subtitles\" other locales use \"subtitles\"\n this.label_ = 'subtitles';\n this.setIcon('subtitles');\n if (['en', 'en-us', 'en-ca', 'fr-ca'].indexOf(this.player_.language_) > -1) {\n this.label_ = 'captions';\n this.setIcon('captions');\n }\n this.menuButton_.controlText(toTitleCase$1(this.label_));\n }\n\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n buildCSSClass() {\n return `vjs-subs-caps-button ${super.buildCSSClass()}`;\n }\n buildWrapperCSSClass() {\n return `vjs-subs-caps-button ${super.buildWrapperCSSClass()}`;\n }\n\n /**\n * Create caption/subtitles menu items\n *\n * @return {CaptionSettingsMenuItem[]}\n * The array of current menu items.\n */\n createItems() {\n let items = [];\n if (!(this.player().tech_ && this.player().tech_.featuresNativeTextTracks) && this.player().getChild('textTrackSettings')) {\n items.push(new CaptionSettingsMenuItem(this.player_, {\n kind: this.label_\n }));\n this.hideThreshold_ += 1;\n }\n items = super.createItems(items, SubsCapsMenuItem);\n return items;\n }\n}\n\n/**\n * `kind`s of TextTrack to look for to associate it with this menu.\n *\n * @type {array}\n * @private\n */\nSubsCapsButton.prototype.kinds_ = ['captions', 'subtitles'];\n\n/**\n * The text that should display over the `SubsCapsButton`s controls.\n *\n *\n * @type {string}\n * @protected\n */\nSubsCapsButton.prototype.controlText_ = 'Subtitles';\nComponent$1.registerComponent('SubsCapsButton', SubsCapsButton);\n\n/**\n * @file audio-track-menu-item.js\n */\n\n/**\n * An {@link AudioTrack} {@link MenuItem}\n *\n * @extends MenuItem\n */\nclass AudioTrackMenuItem extends MenuItem {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../../player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n const track = options.track;\n const tracks = player.audioTracks();\n\n // Modify options for parent MenuItem class's init.\n options.label = track.label || track.language || 'Unknown';\n options.selected = track.enabled;\n super(player, options);\n this.track = track;\n this.addClass(`vjs-${track.kind}-menu-item`);\n const changeHandler = (...args) => {\n this.handleTracksChange.apply(this, args);\n };\n tracks.addEventListener('change', changeHandler);\n this.on('dispose', () => {\n tracks.removeEventListener('change', changeHandler);\n });\n }\n createEl(type, props, attrs) {\n const el = super.createEl(type, props, attrs);\n const parentSpan = el.querySelector('.vjs-menu-item-text');\n if (['main-desc', 'description'].indexOf(this.options_.track.kind) >= 0) {\n parentSpan.appendChild(createEl('span', {\n className: 'vjs-icon-placeholder'\n }, {\n 'aria-hidden': true\n }));\n parentSpan.appendChild(createEl('span', {\n className: 'vjs-control-text',\n textContent: ' ' + this.localize('Descriptions')\n }));\n }\n return el;\n }\n\n /**\n * This gets called when an `AudioTrackMenuItem is \"clicked\". See {@link ClickableComponent}\n * for more detailed information on what a click can be.\n *\n * @param {Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n handleClick(event) {\n super.handleClick(event);\n\n // the audio track list will automatically toggle other tracks\n // off for us.\n this.track.enabled = true;\n\n // when native audio tracks are used, we want to make sure that other tracks are turned off\n if (this.player_.tech_.featuresNativeAudioTracks) {\n const tracks = this.player_.audioTracks();\n for (let i = 0; i < tracks.length; i++) {\n const track = tracks[i];\n\n // skip the current track since we enabled it above\n if (track === this.track) {\n continue;\n }\n track.enabled = track === this.track;\n }\n }\n }\n\n /**\n * Handle any {@link AudioTrack} change.\n *\n * @param {Event} [event]\n * The {@link AudioTrackList#change} event that caused this to run.\n *\n * @listens AudioTrackList#change\n */\n handleTracksChange(event) {\n this.selected(this.track.enabled);\n }\n}\nComponent$1.registerComponent('AudioTrackMenuItem', AudioTrackMenuItem);\n\n/**\n * @file audio-track-button.js\n */\n\n/**\n * The base class for buttons that toggle specific {@link AudioTrack} types.\n *\n * @extends TrackButton\n */\nclass AudioTrackButton extends TrackButton {\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options={}]\n * The key/value store of player options.\n */\n constructor(player, options = {}) {\n options.tracks = player.audioTracks();\n super(player, options);\n this.setIcon('audio');\n }\n\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n buildCSSClass() {\n return `vjs-audio-button ${super.buildCSSClass()}`;\n }\n buildWrapperCSSClass() {\n return `vjs-audio-button ${super.buildWrapperCSSClass()}`;\n }\n\n /**\n * Create a menu item for each audio track\n *\n * @param {AudioTrackMenuItem[]} [items=[]]\n * An array of existing menu items to use.\n *\n * @return {AudioTrackMenuItem[]}\n * An array of menu items\n */\n createItems(items = []) {\n // if there's only one audio track, there no point in showing it\n this.hideThreshold_ = 1;\n const tracks = this.player_.audioTracks();\n for (let i = 0; i < tracks.length; i++) {\n const track = tracks[i];\n items.push(new AudioTrackMenuItem(this.player_, {\n track,\n // MenuItem is selectable\n selectable: true,\n // MenuItem is NOT multiSelectable (i.e. only one can be marked \"selected\" at a time)\n multiSelectable: false\n }));\n }\n return items;\n }\n}\n\n/**\n * The text that should display over the `AudioTrackButton`s controls. Added for localization.\n *\n * @type {string}\n * @protected\n */\nAudioTrackButton.prototype.controlText_ = 'Audio Track';\nComponent$1.registerComponent('AudioTrackButton', AudioTrackButton);\n\n/**\n * @file playback-rate-menu-item.js\n */\n\n/**\n * The specific menu item type for selecting a playback rate.\n *\n * @extends MenuItem\n */\nclass PlaybackRateMenuItem extends MenuItem {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../../player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n const label = options.rate;\n const rate = parseFloat(label, 10);\n\n // Modify options for parent MenuItem class's init.\n options.label = label;\n options.selected = rate === player.playbackRate();\n options.selectable = true;\n options.multiSelectable = false;\n super(player, options);\n this.label = label;\n this.rate = rate;\n this.on(player, 'ratechange', e => this.update(e));\n }\n\n /**\n * This gets called when an `PlaybackRateMenuItem` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n handleClick(event) {\n super.handleClick();\n this.player().playbackRate(this.rate);\n }\n\n /**\n * Update the PlaybackRateMenuItem when the playbackrate changes.\n *\n * @param {Event} [event]\n * The `ratechange` event that caused this function to run.\n *\n * @listens Player#ratechange\n */\n update(event) {\n this.selected(this.player().playbackRate() === this.rate);\n }\n}\n\n/**\n * The text that should display over the `PlaybackRateMenuItem`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\nPlaybackRateMenuItem.prototype.contentElType = 'button';\nComponent$1.registerComponent('PlaybackRateMenuItem', PlaybackRateMenuItem);\n\n/**\n * @file playback-rate-menu-button.js\n */\n\n/**\n * The component for controlling the playback rate.\n *\n * @extends MenuButton\n */\nclass PlaybackRateMenuButton extends MenuButton {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../../player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n super(player, options);\n this.menuButton_.el_.setAttribute('aria-describedby', this.labelElId_);\n this.updateVisibility();\n this.updateLabel();\n this.on(player, 'loadstart', e => this.updateVisibility(e));\n this.on(player, 'ratechange', e => this.updateLabel(e));\n this.on(player, 'playbackrateschange', e => this.handlePlaybackRateschange(e));\n }\n\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n createEl() {\n const el = super.createEl();\n this.labelElId_ = 'vjs-playback-rate-value-label-' + this.id_;\n this.labelEl_ = createEl('div', {\n className: 'vjs-playback-rate-value',\n id: this.labelElId_,\n textContent: '1x'\n });\n el.appendChild(this.labelEl_);\n return el;\n }\n dispose() {\n this.labelEl_ = null;\n super.dispose();\n }\n\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n buildCSSClass() {\n return `vjs-playback-rate ${super.buildCSSClass()}`;\n }\n buildWrapperCSSClass() {\n return `vjs-playback-rate ${super.buildWrapperCSSClass()}`;\n }\n\n /**\n * Create the list of menu items. Specific to each subclass.\n *\n */\n createItems() {\n const rates = this.playbackRates();\n const items = [];\n for (let i = rates.length - 1; i >= 0; i--) {\n items.push(new PlaybackRateMenuItem(this.player(), {\n rate: rates[i] + 'x'\n }));\n }\n return items;\n }\n\n /**\n * On playbackrateschange, update the menu to account for the new items.\n *\n * @listens Player#playbackrateschange\n */\n handlePlaybackRateschange(event) {\n this.update();\n }\n\n /**\n * Get possible playback rates\n *\n * @return {Array}\n * All possible playback rates\n */\n playbackRates() {\n const player = this.player();\n return player.playbackRates && player.playbackRates() || [];\n }\n\n /**\n * Get whether playback rates is supported by the tech\n * and an array of playback rates exists\n *\n * @return {boolean}\n * Whether changing playback rate is supported\n */\n playbackRateSupported() {\n return this.player().tech_ && this.player().tech_.featuresPlaybackRate && this.playbackRates() && this.playbackRates().length > 0;\n }\n\n /**\n * Hide playback rate controls when they're no playback rate options to select\n *\n * @param {Event} [event]\n * The event that caused this function to run.\n *\n * @listens Player#loadstart\n */\n updateVisibility(event) {\n if (this.playbackRateSupported()) {\n this.removeClass('vjs-hidden');\n } else {\n this.addClass('vjs-hidden');\n }\n }\n\n /**\n * Update button label when rate changed\n *\n * @param {Event} [event]\n * The event that caused this function to run.\n *\n * @listens Player#ratechange\n */\n updateLabel(event) {\n if (this.playbackRateSupported()) {\n this.labelEl_.textContent = this.player().playbackRate() + 'x';\n }\n }\n}\n\n/**\n * The text that should display over the `PlaybackRateMenuButton`s controls.\n *\n * Added for localization.\n *\n * @type {string}\n * @protected\n */\nPlaybackRateMenuButton.prototype.controlText_ = 'Playback Rate';\nComponent$1.registerComponent('PlaybackRateMenuButton', PlaybackRateMenuButton);\n\n/**\n * @file spacer.js\n */\n\n/**\n * Just an empty spacer element that can be used as an append point for plugins, etc.\n * Also can be used to create space between elements when necessary.\n *\n * @extends Component\n */\nclass Spacer extends Component$1 {\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n buildCSSClass() {\n return `vjs-spacer ${super.buildCSSClass()}`;\n }\n\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n createEl(tag = 'div', props = {}, attributes = {}) {\n if (!props.className) {\n props.className = this.buildCSSClass();\n }\n return super.createEl(tag, props, attributes);\n }\n}\nComponent$1.registerComponent('Spacer', Spacer);\n\n/**\n * @file custom-control-spacer.js\n */\n\n/**\n * Spacer specifically meant to be used as an insertion point for new plugins, etc.\n *\n * @extends Spacer\n */\nclass CustomControlSpacer extends Spacer {\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n buildCSSClass() {\n return `vjs-custom-control-spacer ${super.buildCSSClass()}`;\n }\n\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n createEl() {\n return super.createEl('div', {\n className: this.buildCSSClass(),\n // No-flex/table-cell mode requires there be some content\n // in the cell to fill the remaining space of the table.\n textContent: '\\u00a0'\n });\n }\n}\nComponent$1.registerComponent('CustomControlSpacer', CustomControlSpacer);\n\n/**\n * @file control-bar.js\n */\n\n/**\n * Container of main controls.\n *\n * @extends Component\n */\nclass ControlBar extends Component$1 {\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n createEl() {\n return super.createEl('div', {\n className: 'vjs-control-bar',\n dir: 'ltr'\n });\n }\n}\n\n/**\n * Default options for `ControlBar`\n *\n * @type {Object}\n * @private\n */\nControlBar.prototype.options_ = {\n children: ['playToggle', 'skipBackward', 'skipForward', 'volumePanel', 'currentTimeDisplay', 'timeDivider', 'durationDisplay', 'progressControl', 'liveDisplay', 'seekToLive', 'remainingTimeDisplay', 'customControlSpacer', 'playbackRateMenuButton', 'chaptersButton', 'descriptionsButton', 'subsCapsButton', 'audioTrackButton', 'pictureInPictureToggle', 'fullscreenToggle']\n};\nComponent$1.registerComponent('ControlBar', ControlBar);\n\n/**\n * @file error-display.js\n */\n\n/**\n * A display that indicates an error has occurred. This means that the video\n * is unplayable.\n *\n * @extends ModalDialog\n */\nclass ErrorDisplay extends ModalDialog {\n /**\n * Creates an instance of this class.\n *\n * @param { import('./player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n super(player, options);\n this.on(player, 'error', e => this.open(e));\n }\n\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n *\n * @deprecated Since version 5.\n */\n buildCSSClass() {\n return `vjs-error-display ${super.buildCSSClass()}`;\n }\n\n /**\n * Gets the localized error message based on the `Player`s error.\n *\n * @return {string}\n * The `Player`s error message localized or an empty string.\n */\n content() {\n const error = this.player().error();\n return error ? this.localize(error.message) : '';\n }\n}\n\n/**\n * The default options for an `ErrorDisplay`.\n *\n * @private\n */\nErrorDisplay.prototype.options_ = Object.assign({}, ModalDialog.prototype.options_, {\n pauseOnOpen: false,\n fillAlways: true,\n temporary: false,\n uncloseable: true\n});\nComponent$1.registerComponent('ErrorDisplay', ErrorDisplay);\n\n/**\n * @file text-track-settings.js\n */\nconst LOCAL_STORAGE_KEY$1 = 'vjs-text-track-settings';\nconst COLOR_BLACK = ['#000', 'Black'];\nconst COLOR_BLUE = ['#00F', 'Blue'];\nconst COLOR_CYAN = ['#0FF', 'Cyan'];\nconst COLOR_GREEN = ['#0F0', 'Green'];\nconst COLOR_MAGENTA = ['#F0F', 'Magenta'];\nconst COLOR_RED = ['#F00', 'Red'];\nconst COLOR_WHITE = ['#FFF', 'White'];\nconst COLOR_YELLOW = ['#FF0', 'Yellow'];\nconst OPACITY_OPAQUE = ['1', 'Opaque'];\nconst OPACITY_SEMI = ['0.5', 'Semi-Transparent'];\nconst OPACITY_TRANS = ['0', 'Transparent'];\n\n// Configuration for the various <select> elements in the DOM of this component.\n//\n// Possible keys include:\n//\n// `default`:\n// The default option index. Only needs to be provided if not zero.\n// `parser`:\n// A function which is used to parse the value from the selected option in\n// a customized way.\n// `selector`:\n// The selector used to find the associated <select> element.\nconst selectConfigs = {\n backgroundColor: {\n selector: '.vjs-bg-color > select',\n id: 'captions-background-color-%s',\n label: 'Color',\n options: [COLOR_BLACK, COLOR_WHITE, COLOR_RED, COLOR_GREEN, COLOR_BLUE, COLOR_YELLOW, COLOR_MAGENTA, COLOR_CYAN]\n },\n backgroundOpacity: {\n selector: '.vjs-bg-opacity > select',\n id: 'captions-background-opacity-%s',\n label: 'Opacity',\n options: [OPACITY_OPAQUE, OPACITY_SEMI, OPACITY_TRANS]\n },\n color: {\n selector: '.vjs-text-color > select',\n id: 'captions-foreground-color-%s',\n label: 'Color',\n options: [COLOR_WHITE, COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_BLUE, COLOR_YELLOW, COLOR_MAGENTA, COLOR_CYAN]\n },\n edgeStyle: {\n selector: '.vjs-edge-style > select',\n id: '%s',\n label: 'Text Edge Style',\n options: [['none', 'None'], ['raised', 'Raised'], ['depressed', 'Depressed'], ['uniform', 'Uniform'], ['dropshadow', 'Drop shadow']]\n },\n fontFamily: {\n selector: '.vjs-font-family > select',\n id: 'captions-font-family-%s',\n label: 'Font Family',\n options: [['proportionalSansSerif', 'Proportional Sans-Serif'], ['monospaceSansSerif', 'Monospace Sans-Serif'], ['proportionalSerif', 'Proportional Serif'], ['monospaceSerif', 'Monospace Serif'], ['casual', 'Casual'], ['script', 'Script'], ['small-caps', 'Small Caps']]\n },\n fontPercent: {\n selector: '.vjs-font-percent > select',\n id: 'captions-font-size-%s',\n label: 'Font Size',\n options: [['0.50', '50%'], ['0.75', '75%'], ['1.00', '100%'], ['1.25', '125%'], ['1.50', '150%'], ['1.75', '175%'], ['2.00', '200%'], ['3.00', '300%'], ['4.00', '400%']],\n default: 2,\n parser: v => v === '1.00' ? null : Number(v)\n },\n textOpacity: {\n selector: '.vjs-text-opacity > select',\n id: 'captions-foreground-opacity-%s',\n label: 'Opacity',\n options: [OPACITY_OPAQUE, OPACITY_SEMI]\n },\n // Options for this object are defined below.\n windowColor: {\n selector: '.vjs-window-color > select',\n id: 'captions-window-color-%s',\n label: 'Color'\n },\n // Options for this object are defined below.\n windowOpacity: {\n selector: '.vjs-window-opacity > select',\n id: 'captions-window-opacity-%s',\n label: 'Opacity',\n options: [OPACITY_TRANS, OPACITY_SEMI, OPACITY_OPAQUE]\n }\n};\nselectConfigs.windowColor.options = selectConfigs.backgroundColor.options;\n\n/**\n * Get the actual value of an option.\n *\n * @param {string} value\n * The value to get\n *\n * @param {Function} [parser]\n * Optional function to adjust the value.\n *\n * @return {*}\n * - Will be `undefined` if no value exists\n * - Will be `undefined` if the given value is \"none\".\n * - Will be the actual value otherwise.\n *\n * @private\n */\nfunction parseOptionValue(value, parser) {\n if (parser) {\n value = parser(value);\n }\n if (value && value !== 'none') {\n return value;\n }\n}\n\n/**\n * Gets the value of the selected <option> element within a <select> element.\n *\n * @param {Element} el\n * the element to look in\n *\n * @param {Function} [parser]\n * Optional function to adjust the value.\n *\n * @return {*}\n * - Will be `undefined` if no value exists\n * - Will be `undefined` if the given value is \"none\".\n * - Will be the actual value otherwise.\n *\n * @private\n */\nfunction getSelectedOptionValue(el, parser) {\n const value = el.options[el.options.selectedIndex].value;\n return parseOptionValue(value, parser);\n}\n\n/**\n * Sets the selected <option> element within a <select> element based on a\n * given value.\n *\n * @param {Element} el\n * The element to look in.\n *\n * @param {string} value\n * the property to look on.\n *\n * @param {Function} [parser]\n * Optional function to adjust the value before comparing.\n *\n * @private\n */\nfunction setSelectedOption(el, value, parser) {\n if (!value) {\n return;\n }\n for (let i = 0; i < el.options.length; i++) {\n if (parseOptionValue(el.options[i].value, parser) === value) {\n el.selectedIndex = i;\n break;\n }\n }\n}\n\n/**\n * Manipulate Text Tracks settings.\n *\n * @extends ModalDialog\n */\nclass TextTrackSettings extends ModalDialog {\n /**\n * Creates an instance of this class.\n *\n * @param { import('../player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n constructor(player, options) {\n options.temporary = false;\n super(player, options);\n this.updateDisplay = this.updateDisplay.bind(this);\n\n // fill the modal and pretend we have opened it\n this.fill();\n this.hasBeenOpened_ = this.hasBeenFilled_ = true;\n this.endDialog = createEl('p', {\n className: 'vjs-control-text',\n textContent: this.localize('End of dialog window.')\n });\n this.el().appendChild(this.endDialog);\n this.setDefaults();\n\n // Grab `persistTextTrackSettings` from the player options if not passed in child options\n if (options.persistTextTrackSettings === undefined) {\n this.options_.persistTextTrackSettings = this.options_.playerOptions.persistTextTrackSettings;\n }\n this.on(this.$('.vjs-done-button'), 'click', () => {\n this.saveSettings();\n this.close();\n });\n this.on(this.$('.vjs-default-button'), 'click', () => {\n this.setDefaults();\n this.updateDisplay();\n });\n each(selectConfigs, config => {\n this.on(this.$(config.selector), 'change', this.updateDisplay);\n });\n if (this.options_.persistTextTrackSettings) {\n this.restoreSettings();\n }\n }\n dispose() {\n this.endDialog = null;\n super.dispose();\n }\n\n /**\n * Create a <select> element with configured options.\n *\n * @param {string} key\n * Configuration key to use during creation.\n *\n * @return {string}\n * An HTML string.\n *\n * @private\n */\n createElSelect_(key, legendId = '', type = 'label') {\n const config = selectConfigs[key];\n const id = config.id.replace('%s', this.id_);\n const selectLabelledbyIds = [legendId, id].join(' ').trim();\n return [`<${type} id=\"${id}\" class=\"${type === 'label' ? 'vjs-label' : ''}\">`, this.localize(config.label), `</${type}>`, `<select aria-labelledby=\"${selectLabelledbyIds}\">`].concat(config.options.map(o => {\n const optionId = id + '-' + o[1].replace(/\\W+/g, '');\n return [`<option id=\"${optionId}\" value=\"${o[0]}\" `, `aria-labelledby=\"${selectLabelledbyIds} ${optionId}\">`, this.localize(o[1]), '</option>'].join('');\n })).concat('</select>').join('');\n }\n\n /**\n * Create foreground color element for the component\n *\n * @return {string}\n * An HTML string.\n *\n * @private\n */\n createElFgColor_() {\n const legendId = `captions-text-legend-${this.id_}`;\n return ['<fieldset class=\"vjs-fg vjs-track-setting\">', `<legend id=\"${legendId}\">`, this.localize('Text'), '</legend>', '<span class=\"vjs-text-color\">', this.createElSelect_('color', legendId), '</span>', '<span class=\"vjs-text-opacity vjs-opacity\">', this.createElSelect_('textOpacity', legendId), '</span>', '</fieldset>'].join('');\n }\n\n /**\n * Create background color element for the component\n *\n * @return {string}\n * An HTML string.\n *\n * @private\n */\n createElBgColor_() {\n const legendId = `captions-background-${this.id_}`;\n return ['<fieldset class=\"vjs-bg vjs-track-setting\">', `<legend id=\"${legendId}\">`, this.localize('Text Background'), '</legend>', '<span class=\"vjs-bg-color\">', this.createElSelect_('backgroundColor', legendId), '</span>', '<span class=\"vjs-bg-opacity vjs-opacity\">', this.createElSelect_('backgroundOpacity', legendId), '</span>', '</fieldset>'].join('');\n }\n\n /**\n * Create window color element for the component\n *\n * @return {string}\n * An HTML string.\n *\n * @private\n */\n createElWinColor_() {\n const legendId = `captions-window-${this.id_}`;\n return ['<fieldset class=\"vjs-window vjs-track-setting\">', `<legend id=\"${legendId}\">`, this.localize('Caption Area Background'), '</legend>', '<span class=\"vjs-window-color\">', this.createElSelect_('windowColor', legendId), '</span>', '<span class=\"vjs-window-opacity vjs-opacity\">', this.createElSelect_('windowOpacity', legendId), '</span>', '</fieldset>'].join('');\n }\n\n /**\n * Create color elements for the component\n *\n * @return {Element}\n * The element that was created\n *\n * @private\n */\n createElColors_() {\n return createEl('div', {\n className: 'vjs-track-settings-colors',\n innerHTML: [this.createElFgColor_(), this.createElBgColor_(), this.createElWinColor_()].join('')\n });\n }\n\n /**\n * Create font elements for the component\n *\n * @return {Element}\n * The element that was created.\n *\n * @private\n */\n createElFont_() {\n return createEl('div', {\n className: 'vjs-track-settings-font',\n innerHTML: ['<fieldset class=\"vjs-font-percent vjs-track-setting\">', this.createElSelect_('fontPercent', '', 'legend'), '</fieldset>', '<fieldset class=\"vjs-edge-style vjs-track-setting\">', this.createElSelect_('edgeStyle', '', 'legend'), '</fieldset>', '<fieldset class=\"vjs-font-family vjs-track-setting\">', this.createElSelect_('fontFamily', '', 'legend'), '</fieldset>'].join('')\n });\n }\n\n /**\n * Create controls for the component\n *\n * @return {Element}\n * The element that was created.\n *\n * @private\n */\n createElControls_() {\n const defaultsDescription = this.localize('restore all settings to the default values');\n return createEl('div', {\n className: 'vjs-track-settings-controls',\n innerHTML: [`<button type=\"button\" class=\"vjs-default-button\" title=\"${defaultsDescription}\">`, this.localize('Reset'), `<span class=\"vjs-control-text\"> ${defaultsDescription}</span>`, '</button>', `<button type=\"button\" class=\"vjs-done-button\">${this.localize('Done')}</button>`].join('')\n });\n }\n content() {\n return [this.createElColors_(), this.createElFont_(), this.createElControls_()];\n }\n label() {\n return this.localize('Caption Settings Dialog');\n }\n description() {\n return this.localize('Beginning of dialog window. Escape will cancel and close the window.');\n }\n buildCSSClass() {\n return super.buildCSSClass() + ' vjs-text-track-settings';\n }\n\n /**\n * Gets an object of text track settings (or null).\n *\n * @return {Object}\n * An object with config values parsed from the DOM or localStorage.\n */\n getValues() {\n return reduce(selectConfigs, (accum, config, key) => {\n const value = getSelectedOptionValue(this.$(config.selector), config.parser);\n if (value !== undefined) {\n accum[key] = value;\n }\n return accum;\n }, {});\n }\n\n /**\n * Sets text track settings from an object of values.\n *\n * @param {Object} values\n * An object with config values parsed from the DOM or localStorage.\n */\n setValues(values) {\n each(selectConfigs, (config, key) => {\n setSelectedOption(this.$(config.selector), values[key], config.parser);\n });\n }\n\n /**\n * Sets all `<select>` elements to their default values.\n */\n setDefaults() {\n each(selectConfigs, config => {\n const index = config.hasOwnProperty('default') ? config.default : 0;\n this.$(config.selector).selectedIndex = index;\n });\n }\n\n /**\n * Restore texttrack settings from localStorage\n */\n restoreSettings() {\n let values;\n try {\n values = JSON.parse(window$1.localStorage.getItem(LOCAL_STORAGE_KEY$1));\n } catch (err) {\n log$1.warn(err);\n }\n if (values) {\n this.setValues(values);\n }\n }\n\n /**\n * Save text track settings to localStorage\n */\n saveSettings() {\n if (!this.options_.persistTextTrackSettings) {\n return;\n }\n const values = this.getValues();\n try {\n if (Object.keys(values).length) {\n window$1.localStorage.setItem(LOCAL_STORAGE_KEY$1, JSON.stringify(values));\n } else {\n window$1.localStorage.removeItem(LOCAL_STORAGE_KEY$1);\n }\n } catch (err) {\n log$1.warn(err);\n }\n }\n\n /**\n * Update display of text track settings\n */\n updateDisplay() {\n const ttDisplay = this.player_.getChild('textTrackDisplay');\n if (ttDisplay) {\n ttDisplay.updateDisplay();\n }\n }\n\n /**\n * conditionally blur the element and refocus the captions button\n *\n * @private\n */\n conditionalBlur_() {\n this.previouslyActiveEl_ = null;\n const cb = this.player_.controlBar;\n const subsCapsBtn = cb && cb.subsCapsButton;\n const ccBtn = cb && cb.captionsButton;\n if (subsCapsBtn) {\n subsCapsBtn.focus();\n } else if (ccBtn) {\n ccBtn.focus();\n }\n }\n\n /**\n * Repopulate dialog with new localizations on languagechange\n */\n handleLanguagechange() {\n this.fill();\n }\n}\nComponent$1.registerComponent('TextTrackSettings', TextTrackSettings);\n\n/**\n * @file resize-manager.js\n */\n\n/**\n * A Resize Manager. It is in charge of triggering `playerresize` on the player in the right conditions.\n *\n * It'll either create an iframe and use a debounced resize handler on it or use the new {@link https://wicg.github.io/ResizeObserver/|ResizeObserver}.\n *\n * If the ResizeObserver is available natively, it will be used. A polyfill can be passed in as an option.\n * If a `playerresize` event is not needed, the ResizeManager component can be removed from the player, see the example below.\n *\n * @example <caption>How to disable the resize manager</caption>\n * const player = videojs('#vid', {\n * resizeManager: false\n * });\n *\n * @see {@link https://wicg.github.io/ResizeObserver/|ResizeObserver specification}\n *\n * @extends Component\n */\nclass ResizeManager extends Component$1 {\n /**\n * Create the ResizeManager.\n *\n * @param {Object} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of ResizeManager options.\n *\n * @param {Object} [options.ResizeObserver]\n * A polyfill for ResizeObserver can be passed in here.\n * If this is set to null it will ignore the native ResizeObserver and fall back to the iframe fallback.\n */\n constructor(player, options) {\n let RESIZE_OBSERVER_AVAILABLE = options.ResizeObserver || window$1.ResizeObserver;\n\n // if `null` was passed, we want to disable the ResizeObserver\n if (options.ResizeObserver === null) {\n RESIZE_OBSERVER_AVAILABLE = false;\n }\n\n // Only create an element when ResizeObserver isn't available\n const options_ = merge$1({\n createEl: !RESIZE_OBSERVER_AVAILABLE,\n reportTouchActivity: false\n }, options);\n super(player, options_);\n this.ResizeObserver = options.ResizeObserver || window$1.ResizeObserver;\n this.loadListener_ = null;\n this.resizeObserver_ = null;\n this.debouncedHandler_ = debounce(() => {\n this.resizeHandler();\n }, 100, false, this);\n if (RESIZE_OBSERVER_AVAILABLE) {\n this.resizeObserver_ = new this.ResizeObserver(this.debouncedHandler_);\n this.resizeObserver_.observe(player.el());\n } else {\n this.loadListener_ = () => {\n if (!this.el_ || !this.el_.contentWindow) {\n return;\n }\n const debouncedHandler_ = this.debouncedHandler_;\n let unloadListener_ = this.unloadListener_ = function () {\n off(this, 'resize', debouncedHandler_);\n off(this, 'unload', unloadListener_);\n unloadListener_ = null;\n };\n\n // safari and edge can unload the iframe before resizemanager dispose\n // we have to dispose of event handlers correctly before that happens\n on(this.el_.contentWindow, 'unload', unloadListener_);\n on(this.el_.contentWindow, 'resize', debouncedHandler_);\n };\n this.one('load', this.loadListener_);\n }\n }\n createEl() {\n return super.createEl('iframe', {\n className: 'vjs-resize-manager',\n tabIndex: -1,\n title: this.localize('No content')\n }, {\n 'aria-hidden': 'true'\n });\n }\n\n /**\n * Called when a resize is triggered on the iframe or a resize is observed via the ResizeObserver\n *\n * @fires Player#playerresize\n */\n resizeHandler() {\n /**\n * Called when the player size has changed\n *\n * @event Player#playerresize\n * @type {Event}\n */\n // make sure player is still around to trigger\n // prevents this from causing an error after dispose\n if (!this.player_ || !this.player_.trigger) {\n return;\n }\n this.player_.trigger('playerresize');\n }\n dispose() {\n if (this.debouncedHandler_) {\n this.debouncedHandler_.cancel();\n }\n if (this.resizeObserver_) {\n if (this.player_.el()) {\n this.resizeObserver_.unobserve(this.player_.el());\n }\n this.resizeObserver_.disconnect();\n }\n if (this.loadListener_) {\n this.off('load', this.loadListener_);\n }\n if (this.el_ && this.el_.contentWindow && this.unloadListener_) {\n this.unloadListener_.call(this.el_.contentWindow);\n }\n this.ResizeObserver = null;\n this.resizeObserver = null;\n this.debouncedHandler_ = null;\n this.loadListener_ = null;\n super.dispose();\n }\n}\nComponent$1.registerComponent('ResizeManager', ResizeManager);\n\nconst defaults = {\n trackingThreshold: 20,\n liveTolerance: 15\n};\n\n/*\n track when we are at the live edge, and other helpers for live playback */\n\n/**\n * A class for checking live current time and determining when the player\n * is at or behind the live edge.\n */\nclass LiveTracker extends Component$1 {\n /**\n * Creates an instance of this class.\n *\n * @param { import('./player').default } player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {number} [options.trackingThreshold=20]\n * Number of seconds of live window (seekableEnd - seekableStart) that\n * media needs to have before the liveui will be shown.\n *\n * @param {number} [options.liveTolerance=15]\n * Number of seconds behind live that we have to be\n * before we will be considered non-live. Note that this will only\n * be used when playing at the live edge. This allows large seekable end\n * changes to not effect whether we are live or not.\n */\n constructor(player, options) {\n // LiveTracker does not need an element\n const options_ = merge$1(defaults, options, {\n createEl: false\n });\n super(player, options_);\n this.trackLiveHandler_ = () => this.trackLive_();\n this.handlePlay_ = e => this.handlePlay(e);\n this.handleFirstTimeupdate_ = e => this.handleFirstTimeupdate(e);\n this.handleSeeked_ = e => this.handleSeeked(e);\n this.seekToLiveEdge_ = e => this.seekToLiveEdge(e);\n this.reset_();\n this.on(this.player_, 'durationchange', e => this.handleDurationchange(e));\n // we should try to toggle tracking on canplay as native playback engines, like Safari\n // may not have the proper values for things like seekableEnd until then\n this.on(this.player_, 'canplay', () => this.toggleTracking());\n }\n\n /**\n * all the functionality for tracking when seek end changes\n * and for tracking how far past seek end we should be\n */\n trackLive_() {\n const seekable = this.player_.seekable();\n\n // skip undefined seekable\n if (!seekable || !seekable.length) {\n return;\n }\n const newTime = Number(window$1.performance.now().toFixed(4));\n const deltaTime = this.lastTime_ === -1 ? 0 : (newTime - this.lastTime_) / 1000;\n this.lastTime_ = newTime;\n this.pastSeekEnd_ = this.pastSeekEnd() + deltaTime;\n const liveCurrentTime = this.liveCurrentTime();\n const currentTime = this.player_.currentTime();\n\n // we are behind live if any are true\n // 1. the player is paused\n // 2. the user seeked to a location 2 seconds away from live\n // 3. the difference between live and current time is greater\n // liveTolerance which defaults to 15s\n let isBehind = this.player_.paused() || this.seekedBehindLive_ || Math.abs(liveCurrentTime - currentTime) > this.options_.liveTolerance;\n\n // we cannot be behind if\n // 1. until we have not seen a timeupdate yet\n // 2. liveCurrentTime is Infinity, which happens on Android and Native Safari\n if (!this.timeupdateSeen_ || liveCurrentTime === Infinity) {\n isBehind = false;\n }\n if (isBehind !== this.behindLiveEdge_) {\n this.behindLiveEdge_ = isBehind;\n this.trigger('liveedgechange');\n }\n }\n\n /**\n * handle a durationchange event on the player\n * and start/stop tracking accordingly.\n */\n handleDurationchange() {\n this.toggleTracking();\n }\n\n /**\n * start/stop tracking\n */\n toggleTracking() {\n if (this.player_.duration() === Infinity && this.liveWindow() >= this.options_.trackingThreshold) {\n if (this.player_.options_.liveui) {\n this.player_.addClass('vjs-liveui');\n }\n this.startTracking();\n } else {\n this.player_.removeClass('vjs-liveui');\n this.stopTracking();\n }\n }\n\n /**\n * start tracking live playback\n */\n startTracking() {\n if (this.isTracking()) {\n return;\n }\n\n // If we haven't seen a timeupdate, we need to check whether playback\n // began before this component started tracking. This can happen commonly\n // when using autoplay.\n if (!this.timeupdateSeen_) {\n this.timeupdateSeen_ = this.player_.hasStarted();\n }\n this.trackingInterval_ = this.setInterval(this.trackLiveHandler_, UPDATE_REFRESH_INTERVAL);\n this.trackLive_();\n this.on(this.player_, ['play', 'pause'], this.trackLiveHandler_);\n if (!this.timeupdateSeen_) {\n this.one(this.player_, 'play', this.handlePlay_);\n this.one(this.player_, 'timeupdate', this.handleFirstTimeupdate_);\n } else {\n this.on(this.player_, 'seeked', this.handleSeeked_);\n }\n }\n\n /**\n * handle the first timeupdate on the player if it wasn't already playing\n * when live tracker started tracking.\n */\n handleFirstTimeupdate() {\n this.timeupdateSeen_ = true;\n this.on(this.player_, 'seeked', this.handleSeeked_);\n }\n\n /**\n * Keep track of what time a seek starts, and listen for seeked\n * to find where a seek ends.\n */\n handleSeeked() {\n const timeDiff = Math.abs(this.liveCurrentTime() - this.player_.currentTime());\n this.seekedBehindLive_ = this.nextSeekedFromUser_ && timeDiff > 2;\n this.nextSeekedFromUser_ = false;\n this.trackLive_();\n }\n\n /**\n * handle the first play on the player, and make sure that we seek\n * right to the live edge.\n */\n handlePlay() {\n this.one(this.player_, 'timeupdate', this.seekToLiveEdge_);\n }\n\n /**\n * Stop tracking, and set all internal variables to\n * their initial value.\n */\n reset_() {\n this.lastTime_ = -1;\n this.pastSeekEnd_ = 0;\n this.lastSeekEnd_ = -1;\n this.behindLiveEdge_ = true;\n this.timeupdateSeen_ = false;\n this.seekedBehindLive_ = false;\n this.nextSeekedFromUser_ = false;\n this.clearInterval(this.trackingInterval_);\n this.trackingInterval_ = null;\n this.off(this.player_, ['play', 'pause'], this.trackLiveHandler_);\n this.off(this.player_, 'seeked', this.handleSeeked_);\n this.off(this.player_, 'play', this.handlePlay_);\n this.off(this.player_, 'timeupdate', this.handleFirstTimeupdate_);\n this.off(this.player_, 'timeupdate', this.seekToLiveEdge_);\n }\n\n /**\n * The next seeked event is from the user. Meaning that any seek\n * > 2s behind live will be considered behind live for real and\n * liveTolerance will be ignored.\n */\n nextSeekedFromUser() {\n this.nextSeekedFromUser_ = true;\n }\n\n /**\n * stop tracking live playback\n */\n stopTracking() {\n if (!this.isTracking()) {\n return;\n }\n this.reset_();\n this.trigger('liveedgechange');\n }\n\n /**\n * A helper to get the player seekable end\n * so that we don't have to null check everywhere\n *\n * @return {number}\n * The furthest seekable end or Infinity.\n */\n seekableEnd() {\n const seekable = this.player_.seekable();\n const seekableEnds = [];\n let i = seekable ? seekable.length : 0;\n while (i--) {\n seekableEnds.push(seekable.end(i));\n }\n\n // grab the furthest seekable end after sorting, or if there are none\n // default to Infinity\n return seekableEnds.length ? seekableEnds.sort()[seekableEnds.length - 1] : Infinity;\n }\n\n /**\n * A helper to get the player seekable start\n * so that we don't have to null check everywhere\n *\n * @return {number}\n * The earliest seekable start or 0.\n */\n seekableStart() {\n const seekable = this.player_.seekable();\n const seekableStarts = [];\n let i = seekable ? seekable.length : 0;\n while (i--) {\n seekableStarts.push(seekable.start(i));\n }\n\n // grab the first seekable start after sorting, or if there are none\n // default to 0\n return seekableStarts.length ? seekableStarts.sort()[0] : 0;\n }\n\n /**\n * Get the live time window aka\n * the amount of time between seekable start and\n * live current time.\n *\n * @return {number}\n * The amount of seconds that are seekable in\n * the live video.\n */\n liveWindow() {\n const liveCurrentTime = this.liveCurrentTime();\n\n // if liveCurrenTime is Infinity then we don't have a liveWindow at all\n if (liveCurrentTime === Infinity) {\n return 0;\n }\n return liveCurrentTime - this.seekableStart();\n }\n\n /**\n * Determines if the player is live, only checks if this component\n * is tracking live playback or not\n *\n * @return {boolean}\n * Whether liveTracker is tracking\n */\n isLive() {\n return this.isTracking();\n }\n\n /**\n * Determines if currentTime is at the live edge and won't fall behind\n * on each seekableendchange\n *\n * @return {boolean}\n * Whether playback is at the live edge\n */\n atLiveEdge() {\n return !this.behindLiveEdge();\n }\n\n /**\n * get what we expect the live current time to be\n *\n * @return {number}\n * The expected live current time\n */\n liveCurrentTime() {\n return this.pastSeekEnd() + this.seekableEnd();\n }\n\n /**\n * The number of seconds that have occurred after seekable end\n * changed. This will be reset to 0 once seekable end changes.\n *\n * @return {number}\n * Seconds past the current seekable end\n */\n pastSeekEnd() {\n const seekableEnd = this.seekableEnd();\n if (this.lastSeekEnd_ !== -1 && seekableEnd !== this.lastSeekEnd_) {\n this.pastSeekEnd_ = 0;\n }\n this.lastSeekEnd_ = seekableEnd;\n return this.pastSeekEnd_;\n }\n\n /**\n * If we are currently behind the live edge, aka currentTime will be\n * behind on a seekableendchange\n *\n * @return {boolean}\n * If we are behind the live edge\n */\n behindLiveEdge() {\n return this.behindLiveEdge_;\n }\n\n /**\n * Whether live tracker is currently tracking or not.\n */\n isTracking() {\n return typeof this.trackingInterval_ === 'number';\n }\n\n /**\n * Seek to the live edge if we are behind the live edge\n */\n seekToLiveEdge() {\n this.seekedBehindLive_ = false;\n if (this.atLiveEdge()) {\n return;\n }\n this.nextSeekedFromUser_ = false;\n this.player_.currentTime(this.liveCurrentTime());\n }\n\n /**\n * Dispose of liveTracker\n */\n dispose() {\n this.stopTracking();\n super.dispose();\n }\n}\nComponent$1.registerComponent('LiveTracker', LiveTracker);\n\n/**\n * Displays an element over the player which contains an optional title and\n * description for the current content.\n *\n * Much of the code for this component originated in the now obsolete\n * videojs-dock plugin: https://github.com/brightcove/videojs-dock/\n *\n * @extends Component\n */\nclass TitleBar extends Component$1 {\n constructor(player, options) {\n super(player, options);\n this.on('statechanged', e => this.updateDom_());\n this.updateDom_();\n }\n\n /**\n * Create the `TitleBar`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n createEl() {\n this.els = {\n title: createEl('div', {\n className: 'vjs-title-bar-title',\n id: `vjs-title-bar-title-${newGUID()}`\n }),\n description: createEl('div', {\n className: 'vjs-title-bar-description',\n id: `vjs-title-bar-description-${newGUID()}`\n })\n };\n return createEl('div', {\n className: 'vjs-title-bar'\n }, {}, values(this.els));\n }\n\n /**\n * Updates the DOM based on the component's state object.\n */\n updateDom_() {\n const tech = this.player_.tech_;\n const techEl = tech && tech.el_;\n const techAriaAttrs = {\n title: 'aria-labelledby',\n description: 'aria-describedby'\n };\n ['title', 'description'].forEach(k => {\n const value = this.state[k];\n const el = this.els[k];\n const techAriaAttr = techAriaAttrs[k];\n emptyEl(el);\n if (value) {\n textContent(el, value);\n }\n\n // If there is a tech element available, update its ARIA attributes\n // according to whether a title and/or description have been provided.\n if (techEl) {\n techEl.removeAttribute(techAriaAttr);\n if (value) {\n techEl.setAttribute(techAriaAttr, el.id);\n }\n }\n });\n if (this.state.title || this.state.description) {\n this.show();\n } else {\n this.hide();\n }\n }\n\n /**\n * Update the contents of the title bar component with new title and\n * description text.\n *\n * If both title and description are missing, the title bar will be hidden.\n *\n * If either title or description are present, the title bar will be visible.\n *\n * NOTE: Any previously set value will be preserved. To unset a previously\n * set value, you must pass an empty string or null.\n *\n * For example:\n *\n * ```\n * update({title: 'foo', description: 'bar'}) // title: 'foo', description: 'bar'\n * update({description: 'bar2'}) // title: 'foo', description: 'bar2'\n * update({title: ''}) // title: '', description: 'bar2'\n * update({title: 'foo', description: null}) // title: 'foo', description: null\n * ```\n *\n * @param {Object} [options={}]\n * An options object. When empty, the title bar will be hidden.\n *\n * @param {string} [options.title]\n * A title to display in the title bar.\n *\n * @param {string} [options.description]\n * A description to display in the title bar.\n */\n update(options) {\n this.setState(options);\n }\n\n /**\n * Dispose the component.\n */\n dispose() {\n const tech = this.player_.tech_;\n const techEl = tech && tech.el_;\n if (techEl) {\n techEl.removeAttribute('aria-labelledby');\n techEl.removeAttribute('aria-describedby');\n }\n super.dispose();\n this.els = null;\n }\n}\nComponent$1.registerComponent('TitleBar', TitleBar);\n\n/**\n * This function is used to fire a sourceset when there is something\n * similar to `mediaEl.load()` being called. It will try to find the source via\n * the `src` attribute and then the `<source>` elements. It will then fire `sourceset`\n * with the source that was found or empty string if we cannot know. If it cannot\n * find a source then `sourceset` will not be fired.\n *\n * @param { import('./html5').default } tech\n * The tech object that sourceset was setup on\n *\n * @return {boolean}\n * returns false if the sourceset was not fired and true otherwise.\n */\nconst sourcesetLoad = tech => {\n const el = tech.el();\n\n // if `el.src` is set, that source will be loaded.\n if (el.hasAttribute('src')) {\n tech.triggerSourceset(el.src);\n return true;\n }\n\n /**\n * Since there isn't a src property on the media element, source elements will be used for\n * implementing the source selection algorithm. This happens asynchronously and\n * for most cases were there is more than one source we cannot tell what source will\n * be loaded, without re-implementing the source selection algorithm. At this time we are not\n * going to do that. There are three special cases that we do handle here though:\n *\n * 1. If there are no sources, do not fire `sourceset`.\n * 2. If there is only one `<source>` with a `src` property/attribute that is our `src`\n * 3. If there is more than one `<source>` but all of them have the same `src` url.\n * That will be our src.\n */\n const sources = tech.$$('source');\n const srcUrls = [];\n let src = '';\n\n // if there are no sources, do not fire sourceset\n if (!sources.length) {\n return false;\n }\n\n // only count valid/non-duplicate source elements\n for (let i = 0; i < sources.length; i++) {\n const url = sources[i].src;\n if (url && srcUrls.indexOf(url) === -1) {\n srcUrls.push(url);\n }\n }\n\n // there were no valid sources\n if (!srcUrls.length) {\n return false;\n }\n\n // there is only one valid source element url\n // use that\n if (srcUrls.length === 1) {\n src = srcUrls[0];\n }\n tech.triggerSourceset(src);\n return true;\n};\n\n/**\n * our implementation of an `innerHTML` descriptor for browsers\n * that do not have one.\n */\nconst innerHTMLDescriptorPolyfill = Object.defineProperty({}, 'innerHTML', {\n get() {\n return this.cloneNode(true).innerHTML;\n },\n set(v) {\n // make a dummy node to use innerHTML on\n const dummy = document.createElement(this.nodeName.toLowerCase());\n\n // set innerHTML to the value provided\n dummy.innerHTML = v;\n\n // make a document fragment to hold the nodes from dummy\n const docFrag = document.createDocumentFragment();\n\n // copy all of the nodes created by the innerHTML on dummy\n // to the document fragment\n while (dummy.childNodes.length) {\n docFrag.appendChild(dummy.childNodes[0]);\n }\n\n // remove content\n this.innerText = '';\n\n // now we add all of that html in one by appending the\n // document fragment. This is how innerHTML does it.\n window$1.Element.prototype.appendChild.call(this, docFrag);\n\n // then return the result that innerHTML's setter would\n return this.innerHTML;\n }\n});\n\n/**\n * Get a property descriptor given a list of priorities and the\n * property to get.\n */\nconst getDescriptor = (priority, prop) => {\n let descriptor = {};\n for (let i = 0; i < priority.length; i++) {\n descriptor = Object.getOwnPropertyDescriptor(priority[i], prop);\n if (descriptor && descriptor.set && descriptor.get) {\n break;\n }\n }\n descriptor.enumerable = true;\n descriptor.configurable = true;\n return descriptor;\n};\nconst getInnerHTMLDescriptor = tech => getDescriptor([tech.el(), window$1.HTMLMediaElement.prototype, window$1.Element.prototype, innerHTMLDescriptorPolyfill], 'innerHTML');\n\n/**\n * Patches browser internal functions so that we can tell synchronously\n * if a `<source>` was appended to the media element. For some reason this\n * causes a `sourceset` if the the media element is ready and has no source.\n * This happens when:\n * - The page has just loaded and the media element does not have a source.\n * - The media element was emptied of all sources, then `load()` was called.\n *\n * It does this by patching the following functions/properties when they are supported:\n *\n * - `append()` - can be used to add a `<source>` element to the media element\n * - `appendChild()` - can be used to add a `<source>` element to the media element\n * - `insertAdjacentHTML()` - can be used to add a `<source>` element to the media element\n * - `innerHTML` - can be used to add a `<source>` element to the media element\n *\n * @param {Html5} tech\n * The tech object that sourceset is being setup on.\n */\nconst firstSourceWatch = function (tech) {\n const el = tech.el();\n\n // make sure firstSourceWatch isn't setup twice.\n if (el.resetSourceWatch_) {\n return;\n }\n const old = {};\n const innerDescriptor = getInnerHTMLDescriptor(tech);\n const appendWrapper = appendFn => (...args) => {\n const retval = appendFn.apply(el, args);\n sourcesetLoad(tech);\n return retval;\n };\n ['append', 'appendChild', 'insertAdjacentHTML'].forEach(k => {\n if (!el[k]) {\n return;\n }\n\n // store the old function\n old[k] = el[k];\n\n // call the old function with a sourceset if a source\n // was loaded\n el[k] = appendWrapper(old[k]);\n });\n Object.defineProperty(el, 'innerHTML', merge$1(innerDescriptor, {\n set: appendWrapper(innerDescriptor.set)\n }));\n el.resetSourceWatch_ = () => {\n el.resetSourceWatch_ = null;\n Object.keys(old).forEach(k => {\n el[k] = old[k];\n });\n Object.defineProperty(el, 'innerHTML', innerDescriptor);\n };\n\n // on the first sourceset, we need to revert our changes\n tech.one('sourceset', el.resetSourceWatch_);\n};\n\n/**\n * our implementation of a `src` descriptor for browsers\n * that do not have one\n */\nconst srcDescriptorPolyfill = Object.defineProperty({}, 'src', {\n get() {\n if (this.hasAttribute('src')) {\n return getAbsoluteURL(window$1.Element.prototype.getAttribute.call(this, 'src'));\n }\n return '';\n },\n set(v) {\n window$1.Element.prototype.setAttribute.call(this, 'src', v);\n return v;\n }\n});\nconst getSrcDescriptor = tech => getDescriptor([tech.el(), window$1.HTMLMediaElement.prototype, srcDescriptorPolyfill], 'src');\n\n/**\n * setup `sourceset` handling on the `Html5` tech. This function\n * patches the following element properties/functions:\n *\n * - `src` - to determine when `src` is set\n * - `setAttribute()` - to determine when `src` is set\n * - `load()` - this re-triggers the source selection algorithm, and can\n * cause a sourceset.\n *\n * If there is no source when we are adding `sourceset` support or during a `load()`\n * we also patch the functions listed in `firstSourceWatch`.\n *\n * @param {Html5} tech\n * The tech to patch\n */\nconst setupSourceset = function (tech) {\n if (!tech.featuresSourceset) {\n return;\n }\n const el = tech.el();\n\n // make sure sourceset isn't setup twice.\n if (el.resetSourceset_) {\n return;\n }\n const srcDescriptor = getSrcDescriptor(tech);\n const oldSetAttribute = el.setAttribute;\n const oldLoad = el.load;\n Object.defineProperty(el, 'src', merge$1(srcDescriptor, {\n set: v => {\n const retval = srcDescriptor.set.call(el, v);\n\n // we use the getter here to get the actual value set on src\n tech.triggerSourceset(el.src);\n return retval;\n }\n }));\n el.setAttribute = (n, v) => {\n const retval = oldSetAttribute.call(el, n, v);\n if (/src/i.test(n)) {\n tech.triggerSourceset(el.src);\n }\n return retval;\n };\n el.load = () => {\n const retval = oldLoad.call(el);\n\n // if load was called, but there was no source to fire\n // sourceset on. We have to watch for a source append\n // as that can trigger a `sourceset` when the media element\n // has no source\n if (!sourcesetLoad(tech)) {\n tech.triggerSourceset('');\n firstSourceWatch(tech);\n }\n return retval;\n };\n if (el.currentSrc) {\n tech.triggerSourceset(el.currentSrc);\n } else if (!sourcesetLoad(tech)) {\n firstSourceWatch(tech);\n }\n el.resetSourceset_ = () => {\n el.resetSourceset_ = null;\n el.load = oldLoad;\n el.setAttribute = oldSetAttribute;\n Object.defineProperty(el, 'src', srcDescriptor);\n if (el.resetSourceWatch_) {\n el.resetSourceWatch_();\n }\n };\n};\n\n/**\n * @file html5.js\n */\n\n/**\n * HTML5 Media Controller - Wrapper for HTML5 Media API\n *\n * @mixes Tech~SourceHandlerAdditions\n * @extends Tech\n */\nclass Html5 extends Tech {\n /**\n * Create an instance of this Tech.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Function} [ready]\n * Callback function to call when the `HTML5` Tech is ready.\n */\n constructor(options, ready) {\n super(options, ready);\n const source = options.source;\n let crossoriginTracks = false;\n this.featuresVideoFrameCallback = this.featuresVideoFrameCallback && this.el_.tagName === 'VIDEO';\n\n // Set the source if one is provided\n // 1) Check if the source is new (if not, we want to keep the original so playback isn't interrupted)\n // 2) Check to see if the network state of the tag was failed at init, and if so, reset the source\n // anyway so the error gets fired.\n if (source && (this.el_.currentSrc !== source.src || options.tag && options.tag.initNetworkState_ === 3)) {\n this.setSource(source);\n } else {\n this.handleLateInit_(this.el_);\n }\n\n // setup sourceset after late sourceset/init\n if (options.enableSourceset) {\n this.setupSourcesetHandling_();\n }\n this.isScrubbing_ = false;\n if (this.el_.hasChildNodes()) {\n const nodes = this.el_.childNodes;\n let nodesLength = nodes.length;\n const removeNodes = [];\n while (nodesLength--) {\n const node = nodes[nodesLength];\n const nodeName = node.nodeName.toLowerCase();\n if (nodeName === 'track') {\n if (!this.featuresNativeTextTracks) {\n // Empty video tag tracks so the built-in player doesn't use them also.\n // This may not be fast enough to stop HTML5 browsers from reading the tags\n // so we'll need to turn off any default tracks if we're manually doing\n // captions and subtitles. videoElement.textTracks\n removeNodes.push(node);\n } else {\n // store HTMLTrackElement and TextTrack to remote list\n this.remoteTextTrackEls().addTrackElement_(node);\n this.remoteTextTracks().addTrack(node.track);\n this.textTracks().addTrack(node.track);\n if (!crossoriginTracks && !this.el_.hasAttribute('crossorigin') && isCrossOrigin(node.src)) {\n crossoriginTracks = true;\n }\n }\n }\n }\n for (let i = 0; i < removeNodes.length; i++) {\n this.el_.removeChild(removeNodes[i]);\n }\n }\n this.proxyNativeTracks_();\n if (this.featuresNativeTextTracks && crossoriginTracks) {\n log$1.warn('Text Tracks are being loaded from another origin but the crossorigin attribute isn\\'t used.\\n' + 'This may prevent text tracks from loading.');\n }\n\n // prevent iOS Safari from disabling metadata text tracks during native playback\n this.restoreMetadataTracksInIOSNativePlayer_();\n\n // Determine if native controls should be used\n // Our goal should be to get the custom controls on mobile solid everywhere\n // so we can remove this all together. Right now this will block custom\n // controls on touch enabled laptops like the Chrome Pixel\n if ((TOUCH_ENABLED || IS_IPHONE) && options.nativeControlsForTouch === true) {\n this.setControls(true);\n }\n\n // on iOS, we want to proxy `webkitbeginfullscreen` and `webkitendfullscreen`\n // into a `fullscreenchange` event\n this.proxyWebkitFullscreen_();\n this.triggerReady();\n }\n\n /**\n * Dispose of `HTML5` media element and remove all tracks.\n */\n dispose() {\n if (this.el_ && this.el_.resetSourceset_) {\n this.el_.resetSourceset_();\n }\n Html5.disposeMediaElement(this.el_);\n this.options_ = null;\n\n // tech will handle clearing of the emulated track list\n super.dispose();\n }\n\n /**\n * Modify the media element so that we can detect when\n * the source is changed. Fires `sourceset` just after the source has changed\n */\n setupSourcesetHandling_() {\n setupSourceset(this);\n }\n\n /**\n * When a captions track is enabled in the iOS Safari native player, all other\n * tracks are disabled (including metadata tracks), which nulls all of their\n * associated cue points. This will restore metadata tracks to their pre-fullscreen\n * state in those cases so that cue points are not needlessly lost.\n *\n * @private\n */\n restoreMetadataTracksInIOSNativePlayer_() {\n const textTracks = this.textTracks();\n let metadataTracksPreFullscreenState;\n\n // captures a snapshot of every metadata track's current state\n const takeMetadataTrackSnapshot = () => {\n metadataTracksPreFullscreenState = [];\n for (let i = 0; i < textTracks.length; i++) {\n const track = textTracks[i];\n if (track.kind === 'metadata') {\n metadataTracksPreFullscreenState.push({\n track,\n storedMode: track.mode\n });\n }\n }\n };\n\n // snapshot each metadata track's initial state, and update the snapshot\n // each time there is a track 'change' event\n takeMetadataTrackSnapshot();\n textTracks.addEventListener('change', takeMetadataTrackSnapshot);\n this.on('dispose', () => textTracks.removeEventListener('change', takeMetadataTrackSnapshot));\n const restoreTrackMode = () => {\n for (let i = 0; i < metadataTracksPreFullscreenState.length; i++) {\n const storedTrack = metadataTracksPreFullscreenState[i];\n if (storedTrack.track.mode === 'disabled' && storedTrack.track.mode !== storedTrack.storedMode) {\n storedTrack.track.mode = storedTrack.storedMode;\n }\n }\n // we only want this handler to be executed on the first 'change' event\n textTracks.removeEventListener('change', restoreTrackMode);\n };\n\n // when we enter fullscreen playback, stop updating the snapshot and\n // restore all track modes to their pre-fullscreen state\n this.on('webkitbeginfullscreen', () => {\n textTracks.removeEventListener('change', takeMetadataTrackSnapshot);\n\n // remove the listener before adding it just in case it wasn't previously removed\n textTracks.removeEventListener('change', restoreTrackMode);\n textTracks.addEventListener('change', restoreTrackMode);\n });\n\n // start updating the snapshot again after leaving fullscreen\n this.on('webkitendfullscreen', () => {\n // remove the listener before adding it just in case it wasn't previously removed\n textTracks.removeEventListener('change', takeMetadataTrackSnapshot);\n textTracks.addEventListener('change', takeMetadataTrackSnapshot);\n\n // remove the restoreTrackMode handler in case it wasn't triggered during fullscreen playback\n textTracks.removeEventListener('change', restoreTrackMode);\n });\n }\n\n /**\n * Attempt to force override of tracks for the given type\n *\n * @param {string} type - Track type to override, possible values include 'Audio',\n * 'Video', and 'Text'.\n * @param {boolean} override - If set to true native audio/video will be overridden,\n * otherwise native audio/video will potentially be used.\n * @private\n */\n overrideNative_(type, override) {\n // If there is no behavioral change don't add/remove listeners\n if (override !== this[`featuresNative${type}Tracks`]) {\n return;\n }\n const lowerCaseType = type.toLowerCase();\n if (this[`${lowerCaseType}TracksListeners_`]) {\n Object.keys(this[`${lowerCaseType}TracksListeners_`]).forEach(eventName => {\n const elTracks = this.el()[`${lowerCaseType}Tracks`];\n elTracks.removeEventListener(eventName, this[`${lowerCaseType}TracksListeners_`][eventName]);\n });\n }\n this[`featuresNative${type}Tracks`] = !override;\n this[`${lowerCaseType}TracksListeners_`] = null;\n this.proxyNativeTracksForType_(lowerCaseType);\n }\n\n /**\n * Attempt to force override of native audio tracks.\n *\n * @param {boolean} override - If set to true native audio will be overridden,\n * otherwise native audio will potentially be used.\n */\n overrideNativeAudioTracks(override) {\n this.overrideNative_('Audio', override);\n }\n\n /**\n * Attempt to force override of native video tracks.\n *\n * @param {boolean} override - If set to true native video will be overridden,\n * otherwise native video will potentially be used.\n */\n overrideNativeVideoTracks(override) {\n this.overrideNative_('Video', override);\n }\n\n /**\n * Proxy native track list events for the given type to our track\n * lists if the browser we are playing in supports that type of track list.\n *\n * @param {string} name - Track type; values include 'audio', 'video', and 'text'\n * @private\n */\n proxyNativeTracksForType_(name) {\n const props = NORMAL[name];\n const elTracks = this.el()[props.getterName];\n const techTracks = this[props.getterName]();\n if (!this[`featuresNative${props.capitalName}Tracks`] || !elTracks || !elTracks.addEventListener) {\n return;\n }\n const listeners = {\n change: e => {\n const event = {\n type: 'change',\n target: techTracks,\n currentTarget: techTracks,\n srcElement: techTracks\n };\n techTracks.trigger(event);\n\n // if we are a text track change event, we should also notify the\n // remote text track list. This can potentially cause a false positive\n // if we were to get a change event on a non-remote track and\n // we triggered the event on the remote text track list which doesn't\n // contain that track. However, best practices mean looping through the\n // list of tracks and searching for the appropriate mode value, so,\n // this shouldn't pose an issue\n if (name === 'text') {\n this[REMOTE.remoteText.getterName]().trigger(event);\n }\n },\n addtrack(e) {\n techTracks.addTrack(e.track);\n },\n removetrack(e) {\n techTracks.removeTrack(e.track);\n }\n };\n const removeOldTracks = function () {\n const removeTracks = [];\n for (let i = 0; i < techTracks.length; i++) {\n let found = false;\n for (let j = 0; j < elTracks.length; j++) {\n if (elTracks[j] === techTracks[i]) {\n found = true;\n break;\n }\n }\n if (!found) {\n removeTracks.push(techTracks[i]);\n }\n }\n while (removeTracks.length) {\n techTracks.removeTrack(removeTracks.shift());\n }\n };\n this[props.getterName + 'Listeners_'] = listeners;\n Object.keys(listeners).forEach(eventName => {\n const listener = listeners[eventName];\n elTracks.addEventListener(eventName, listener);\n this.on('dispose', e => elTracks.removeEventListener(eventName, listener));\n });\n\n // Remove (native) tracks that are not used anymore\n this.on('loadstart', removeOldTracks);\n this.on('dispose', e => this.off('loadstart', removeOldTracks));\n }\n\n /**\n * Proxy all native track list events to our track lists if the browser we are playing\n * in supports that type of track list.\n *\n * @private\n */\n proxyNativeTracks_() {\n NORMAL.names.forEach(name => {\n this.proxyNativeTracksForType_(name);\n });\n }\n\n /**\n * Create the `Html5` Tech's DOM element.\n *\n * @return {Element}\n * The element that gets created.\n */\n createEl() {\n let el = this.options_.tag;\n\n // Check if this browser supports moving the element into the box.\n // On the iPhone video will break if you move the element,\n // So we have to create a brand new element.\n // If we ingested the player div, we do not need to move the media element.\n if (!el || !(this.options_.playerElIngest || this.movingMediaElementInDOM)) {\n // If the original tag is still there, clone and remove it.\n if (el) {\n const clone = el.cloneNode(true);\n if (el.parentNode) {\n el.parentNode.insertBefore(clone, el);\n }\n Html5.disposeMediaElement(el);\n el = clone;\n } else {\n el = document.createElement('video');\n\n // determine if native controls should be used\n const tagAttributes = this.options_.tag && getAttributes(this.options_.tag);\n const attributes = merge$1({}, tagAttributes);\n if (!TOUCH_ENABLED || this.options_.nativeControlsForTouch !== true) {\n delete attributes.controls;\n }\n setAttributes(el, Object.assign(attributes, {\n id: this.options_.techId,\n class: 'vjs-tech'\n }));\n }\n el.playerId = this.options_.playerId;\n }\n if (typeof this.options_.preload !== 'undefined') {\n setAttribute(el, 'preload', this.options_.preload);\n }\n if (this.options_.disablePictureInPicture !== undefined) {\n el.disablePictureInPicture = this.options_.disablePictureInPicture;\n }\n\n // Update specific tag settings, in case they were overridden\n // `autoplay` has to be *last* so that `muted` and `playsinline` are present\n // when iOS/Safari or other browsers attempt to autoplay.\n const settingsAttrs = ['loop', 'muted', 'playsinline', 'autoplay'];\n for (let i = 0; i < settingsAttrs.length; i++) {\n const attr = settingsAttrs[i];\n const value = this.options_[attr];\n if (typeof value !== 'undefined') {\n if (value) {\n setAttribute(el, attr, attr);\n } else {\n removeAttribute(el, attr);\n }\n el[attr] = value;\n }\n }\n return el;\n }\n\n /**\n * This will be triggered if the loadstart event has already fired, before videojs was\n * ready. Two known examples of when this can happen are:\n * 1. If we're loading the playback object after it has started loading\n * 2. The media is already playing the (often with autoplay on) then\n *\n * This function will fire another loadstart so that videojs can catchup.\n *\n * @fires Tech#loadstart\n *\n * @return {undefined}\n * returns nothing.\n */\n handleLateInit_(el) {\n if (el.networkState === 0 || el.networkState === 3) {\n // The video element hasn't started loading the source yet\n // or didn't find a source\n return;\n }\n if (el.readyState === 0) {\n // NetworkState is set synchronously BUT loadstart is fired at the\n // end of the current stack, usually before setInterval(fn, 0).\n // So at this point we know loadstart may have already fired or is\n // about to fire, and either way the player hasn't seen it yet.\n // We don't want to fire loadstart prematurely here and cause a\n // double loadstart so we'll wait and see if it happens between now\n // and the next loop, and fire it if not.\n // HOWEVER, we also want to make sure it fires before loadedmetadata\n // which could also happen between now and the next loop, so we'll\n // watch for that also.\n let loadstartFired = false;\n const setLoadstartFired = function () {\n loadstartFired = true;\n };\n this.on('loadstart', setLoadstartFired);\n const triggerLoadstart = function () {\n // We did miss the original loadstart. Make sure the player\n // sees loadstart before loadedmetadata\n if (!loadstartFired) {\n this.trigger('loadstart');\n }\n };\n this.on('loadedmetadata', triggerLoadstart);\n this.ready(function () {\n this.off('loadstart', setLoadstartFired);\n this.off('loadedmetadata', triggerLoadstart);\n if (!loadstartFired) {\n // We did miss the original native loadstart. Fire it now.\n this.trigger('loadstart');\n }\n });\n return;\n }\n\n // From here on we know that loadstart already fired and we missed it.\n // The other readyState events aren't as much of a problem if we double\n // them, so not going to go to as much trouble as loadstart to prevent\n // that unless we find reason to.\n const eventsToTrigger = ['loadstart'];\n\n // loadedmetadata: newly equal to HAVE_METADATA (1) or greater\n eventsToTrigger.push('loadedmetadata');\n\n // loadeddata: newly increased to HAVE_CURRENT_DATA (2) or greater\n if (el.readyState >= 2) {\n eventsToTrigger.push('loadeddata');\n }\n\n // canplay: newly increased to HAVE_FUTURE_DATA (3) or greater\n if (el.readyState >= 3) {\n eventsToTrigger.push('canplay');\n }\n\n // canplaythrough: newly equal to HAVE_ENOUGH_DATA (4)\n if (el.readyState >= 4) {\n eventsToTrigger.push('canplaythrough');\n }\n\n // We still need to give the player time to add event listeners\n this.ready(function () {\n eventsToTrigger.forEach(function (type) {\n this.trigger(type);\n }, this);\n });\n }\n\n /**\n * Set whether we are scrubbing or not.\n * This is used to decide whether we should use `fastSeek` or not.\n * `fastSeek` is used to provide trick play on Safari browsers.\n *\n * @param {boolean} isScrubbing\n * - true for we are currently scrubbing\n * - false for we are no longer scrubbing\n */\n setScrubbing(isScrubbing) {\n this.isScrubbing_ = isScrubbing;\n }\n\n /**\n * Get whether we are scrubbing or not.\n *\n * @return {boolean} isScrubbing\n * - true for we are currently scrubbing\n * - false for we are no longer scrubbing\n */\n scrubbing() {\n return this.isScrubbing_;\n }\n\n /**\n * Set current time for the `HTML5` tech.\n *\n * @param {number} seconds\n * Set the current time of the media to this.\n */\n setCurrentTime(seconds) {\n try {\n if (this.isScrubbing_ && this.el_.fastSeek && IS_ANY_SAFARI) {\n this.el_.fastSeek(seconds);\n } else {\n this.el_.currentTime = seconds;\n }\n } catch (e) {\n log$1(e, 'Video is not ready. (Video.js)');\n // this.warning(VideoJS.warnings.videoNotReady);\n }\n }\n\n /**\n * Get the current duration of the HTML5 media element.\n *\n * @return {number}\n * The duration of the media or 0 if there is no duration.\n */\n duration() {\n // Android Chrome will report duration as Infinity for VOD HLS until after\n // playback has started, which triggers the live display erroneously.\n // Return NaN if playback has not started and trigger a durationupdate once\n // the duration can be reliably known.\n if (this.el_.duration === Infinity && IS_ANDROID && IS_CHROME && this.el_.currentTime === 0) {\n // Wait for the first `timeupdate` with currentTime > 0 - there may be\n // several with 0\n const checkProgress = () => {\n if (this.el_.currentTime > 0) {\n // Trigger durationchange for genuinely live video\n if (this.el_.duration === Infinity) {\n this.trigger('durationchange');\n }\n this.off('timeupdate', checkProgress);\n }\n };\n this.on('timeupdate', checkProgress);\n return NaN;\n }\n return this.el_.duration || NaN;\n }\n\n /**\n * Get the current width of the HTML5 media element.\n *\n * @return {number}\n * The width of the HTML5 media element.\n */\n width() {\n return this.el_.offsetWidth;\n }\n\n /**\n * Get the current height of the HTML5 media element.\n *\n * @return {number}\n * The height of the HTML5 media element.\n */\n height() {\n return this.el_.offsetHeight;\n }\n\n /**\n * Proxy iOS `webkitbeginfullscreen` and `webkitendfullscreen` into\n * `fullscreenchange` event.\n *\n * @private\n * @fires fullscreenchange\n * @listens webkitendfullscreen\n * @listens webkitbeginfullscreen\n * @listens webkitbeginfullscreen\n */\n proxyWebkitFullscreen_() {\n if (!('webkitDisplayingFullscreen' in this.el_)) {\n return;\n }\n const endFn = function () {\n this.trigger('fullscreenchange', {\n isFullscreen: false\n });\n // Safari will sometimes set controls on the videoelement when existing fullscreen.\n if (this.el_.controls && !this.options_.nativeControlsForTouch && this.controls()) {\n this.el_.controls = false;\n }\n };\n const beginFn = function () {\n if ('webkitPresentationMode' in this.el_ && this.el_.webkitPresentationMode !== 'picture-in-picture') {\n this.one('webkitendfullscreen', endFn);\n this.trigger('fullscreenchange', {\n isFullscreen: true,\n // set a flag in case another tech triggers fullscreenchange\n nativeIOSFullscreen: true\n });\n }\n };\n this.on('webkitbeginfullscreen', beginFn);\n this.on('dispose', () => {\n this.off('webkitbeginfullscreen', beginFn);\n this.off('webkitendfullscreen', endFn);\n });\n }\n\n /**\n * Check if fullscreen is supported on the video el.\n *\n * @return {boolean}\n * - True if fullscreen is supported.\n * - False if fullscreen is not supported.\n */\n supportsFullScreen() {\n return typeof this.el_.webkitEnterFullScreen === 'function';\n }\n\n /**\n * Request that the `HTML5` Tech enter fullscreen.\n */\n enterFullScreen() {\n const video = this.el_;\n if (video.paused && video.networkState <= video.HAVE_METADATA) {\n // attempt to prime the video element for programmatic access\n // this isn't necessary on the desktop but shouldn't hurt\n silencePromise(this.el_.play());\n\n // playing and pausing synchronously during the transition to fullscreen\n // can get iOS ~6.1 devices into a play/pause loop\n this.setTimeout(function () {\n video.pause();\n try {\n video.webkitEnterFullScreen();\n } catch (e) {\n this.trigger('fullscreenerror', e);\n }\n }, 0);\n } else {\n try {\n video.webkitEnterFullScreen();\n } catch (e) {\n this.trigger('fullscreenerror', e);\n }\n }\n }\n\n /**\n * Request that the `HTML5` Tech exit fullscreen.\n */\n exitFullScreen() {\n if (!this.el_.webkitDisplayingFullscreen) {\n this.trigger('fullscreenerror', new Error('The video is not fullscreen'));\n return;\n }\n this.el_.webkitExitFullScreen();\n }\n\n /**\n * Create a floating video window always on top of other windows so that users may\n * continue consuming media while they interact with other content sites, or\n * applications on their device.\n *\n * @see [Spec]{@link https://wicg.github.io/picture-in-picture}\n *\n * @return {Promise}\n * A promise with a Picture-in-Picture window.\n */\n requestPictureInPicture() {\n return this.el_.requestPictureInPicture();\n }\n\n /**\n * Native requestVideoFrameCallback if supported by browser/tech, or fallback\n * Don't use rVCF on Safari when DRM is playing, as it doesn't fire\n * Needs to be checked later than the constructor\n * This will be a false positive for clear sources loaded after a Fairplay source\n *\n * @param {function} cb function to call\n * @return {number} id of request\n */\n requestVideoFrameCallback(cb) {\n if (this.featuresVideoFrameCallback && !this.el_.webkitKeys) {\n return this.el_.requestVideoFrameCallback(cb);\n }\n return super.requestVideoFrameCallback(cb);\n }\n\n /**\n * Native or fallback requestVideoFrameCallback\n *\n * @param {number} id request id to cancel\n */\n cancelVideoFrameCallback(id) {\n if (this.featuresVideoFrameCallback && !this.el_.webkitKeys) {\n this.el_.cancelVideoFrameCallback(id);\n } else {\n super.cancelVideoFrameCallback(id);\n }\n }\n\n /**\n * A getter/setter for the `Html5` Tech's source object.\n * > Note: Please use {@link Html5#setSource}\n *\n * @param {Tech~SourceObject} [src]\n * The source object you want to set on the `HTML5` techs element.\n *\n * @return {Tech~SourceObject|undefined}\n * - The current source object when a source is not passed in.\n * - undefined when setting\n *\n * @deprecated Since version 5.\n */\n src(src) {\n if (src === undefined) {\n return this.el_.src;\n }\n\n // Setting src through `src` instead of `setSrc` will be deprecated\n this.setSrc(src);\n }\n\n /**\n * Reset the tech by removing all sources and then calling\n * {@link Html5.resetMediaElement}.\n */\n reset() {\n Html5.resetMediaElement(this.el_);\n }\n\n /**\n * Get the current source on the `HTML5` Tech. Falls back to returning the source from\n * the HTML5 media element.\n *\n * @return {Tech~SourceObject}\n * The current source object from the HTML5 tech. With a fallback to the\n * elements source.\n */\n currentSrc() {\n if (this.currentSource_) {\n return this.currentSource_.src;\n }\n return this.el_.currentSrc;\n }\n\n /**\n * Set controls attribute for the HTML5 media Element.\n *\n * @param {string} val\n * Value to set the controls attribute to\n */\n setControls(val) {\n this.el_.controls = !!val;\n }\n\n /**\n * Create and returns a remote {@link TextTrack} object.\n *\n * @param {string} kind\n * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata)\n *\n * @param {string} [label]\n * Label to identify the text track\n *\n * @param {string} [language]\n * Two letter language abbreviation\n *\n * @return {TextTrack}\n * The TextTrack that gets created.\n */\n addTextTrack(kind, label, language) {\n if (!this.featuresNativeTextTracks) {\n return super.addTextTrack(kind, label, language);\n }\n return this.el_.addTextTrack(kind, label, language);\n }\n\n /**\n * Creates either native TextTrack or an emulated TextTrack depending\n * on the value of `featuresNativeTextTracks`\n *\n * @param {Object} options\n * The object should contain the options to initialize the TextTrack with.\n *\n * @param {string} [options.kind]\n * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata).\n *\n * @param {string} [options.label]\n * Label to identify the text track\n *\n * @param {string} [options.language]\n * Two letter language abbreviation.\n *\n * @param {boolean} [options.default]\n * Default this track to on.\n *\n * @param {string} [options.id]\n * The internal id to assign this track.\n *\n * @param {string} [options.src]\n * A source url for the track.\n *\n * @return {HTMLTrackElement}\n * The track element that gets created.\n */\n createRemoteTextTrack(options) {\n if (!this.featuresNativeTextTracks) {\n return super.createRemoteTextTrack(options);\n }\n const htmlTrackElement = document.createElement('track');\n if (options.kind) {\n htmlTrackElement.kind = options.kind;\n }\n if (options.label) {\n htmlTrackElement.label = options.label;\n }\n if (options.language || options.srclang) {\n htmlTrackElement.srclang = options.language || options.srclang;\n }\n if (options.default) {\n htmlTrackElement.default = options.default;\n }\n if (options.id) {\n htmlTrackElement.id = options.id;\n }\n if (options.src) {\n htmlTrackElement.src = options.src;\n }\n return htmlTrackElement;\n }\n\n /**\n * Creates a remote text track object and returns an html track element.\n *\n * @param {Object} options The object should contain values for\n * kind, language, label, and src (location of the WebVTT file)\n * @param {boolean} [manualCleanup=false] if set to true, the TextTrack\n * will not be removed from the TextTrackList and HtmlTrackElementList\n * after a source change\n * @return {HTMLTrackElement} An Html Track Element.\n * This can be an emulated {@link HTMLTrackElement} or a native one.\n *\n */\n addRemoteTextTrack(options, manualCleanup) {\n const htmlTrackElement = super.addRemoteTextTrack(options, manualCleanup);\n if (this.featuresNativeTextTracks) {\n this.el().appendChild(htmlTrackElement);\n }\n return htmlTrackElement;\n }\n\n /**\n * Remove remote `TextTrack` from `TextTrackList` object\n *\n * @param {TextTrack} track\n * `TextTrack` object to remove\n */\n removeRemoteTextTrack(track) {\n super.removeRemoteTextTrack(track);\n if (this.featuresNativeTextTracks) {\n const tracks = this.$$('track');\n let i = tracks.length;\n while (i--) {\n if (track === tracks[i] || track === tracks[i].track) {\n this.el().removeChild(tracks[i]);\n }\n }\n }\n }\n\n /**\n * Gets available media playback quality metrics as specified by the W3C's Media\n * Playback Quality API.\n *\n * @see [Spec]{@link https://wicg.github.io/media-playback-quality}\n *\n * @return {Object}\n * An object with supported media playback quality metrics\n */\n getVideoPlaybackQuality() {\n if (typeof this.el().getVideoPlaybackQuality === 'function') {\n return this.el().getVideoPlaybackQuality();\n }\n const videoPlaybackQuality = {};\n if (typeof this.el().webkitDroppedFrameCount !== 'undefined' && typeof this.el().webkitDecodedFrameCount !== 'undefined') {\n videoPlaybackQuality.droppedVideoFrames = this.el().webkitDroppedFrameCount;\n videoPlaybackQuality.totalVideoFrames = this.el().webkitDecodedFrameCount;\n }\n if (window$1.performance) {\n videoPlaybackQuality.creationTime = window$1.performance.now();\n }\n return videoPlaybackQuality;\n }\n}\n\n/* HTML5 Support Testing ---------------------------------------------------- */\n\n/**\n * Element for testing browser HTML5 media capabilities\n *\n * @type {Element}\n * @constant\n * @private\n */\ndefineLazyProperty(Html5, 'TEST_VID', function () {\n if (!isReal()) {\n return;\n }\n const video = document.createElement('video');\n const track = document.createElement('track');\n track.kind = 'captions';\n track.srclang = 'en';\n track.label = 'English';\n video.appendChild(track);\n return video;\n});\n\n/**\n * Check if HTML5 media is supported by this browser/device.\n *\n * @return {boolean}\n * - True if HTML5 media is supported.\n * - False if HTML5 media is not supported.\n */\nHtml5.isSupported = function () {\n // IE with no Media Player is a LIAR! (#984)\n try {\n Html5.TEST_VID.volume = 0.5;\n } catch (e) {\n return false;\n }\n return !!(Html5.TEST_VID && Html5.TEST_VID.canPlayType);\n};\n\n/**\n * Check if the tech can support the given type\n *\n * @param {string} type\n * The mimetype to check\n * @return {string} 'probably', 'maybe', or '' (empty string)\n */\nHtml5.canPlayType = function (type) {\n return Html5.TEST_VID.canPlayType(type);\n};\n\n/**\n * Check if the tech can support the given source\n *\n * @param {Object} srcObj\n * The source object\n * @param {Object} options\n * The options passed to the tech\n * @return {string} 'probably', 'maybe', or '' (empty string)\n */\nHtml5.canPlaySource = function (srcObj, options) {\n return Html5.canPlayType(srcObj.type);\n};\n\n/**\n * Check if the volume can be changed in this browser/device.\n * Volume cannot be changed in a lot of mobile devices.\n * Specifically, it can't be changed from 1 on iOS.\n *\n * @return {boolean}\n * - True if volume can be controlled\n * - False otherwise\n */\nHtml5.canControlVolume = function () {\n // IE will error if Windows Media Player not installed #3315\n try {\n const volume = Html5.TEST_VID.volume;\n Html5.TEST_VID.volume = volume / 2 + 0.1;\n const canControl = volume !== Html5.TEST_VID.volume;\n\n // With the introduction of iOS 15, there are cases where the volume is read as\n // changed but reverts back to its original state at the start of the next tick.\n // To determine whether volume can be controlled on iOS,\n // a timeout is set and the volume is checked asynchronously.\n // Since `features` doesn't currently work asynchronously, the value is manually set.\n if (canControl && IS_IOS) {\n window$1.setTimeout(() => {\n if (Html5 && Html5.prototype) {\n Html5.prototype.featuresVolumeControl = volume !== Html5.TEST_VID.volume;\n }\n });\n\n // default iOS to false, which will be updated in the timeout above.\n return false;\n }\n return canControl;\n } catch (e) {\n return false;\n }\n};\n\n/**\n * Check if the volume can be muted in this browser/device.\n * Some devices, e.g. iOS, don't allow changing volume\n * but permits muting/unmuting.\n *\n * @return {boolean}\n * - True if volume can be muted\n * - False otherwise\n */\nHtml5.canMuteVolume = function () {\n try {\n const muted = Html5.TEST_VID.muted;\n\n // in some versions of iOS muted property doesn't always\n // work, so we want to set both property and attribute\n Html5.TEST_VID.muted = !muted;\n if (Html5.TEST_VID.muted) {\n setAttribute(Html5.TEST_VID, 'muted', 'muted');\n } else {\n removeAttribute(Html5.TEST_VID, 'muted', 'muted');\n }\n return muted !== Html5.TEST_VID.muted;\n } catch (e) {\n return false;\n }\n};\n\n/**\n * Check if the playback rate can be changed in this browser/device.\n *\n * @return {boolean}\n * - True if playback rate can be controlled\n * - False otherwise\n */\nHtml5.canControlPlaybackRate = function () {\n // Playback rate API is implemented in Android Chrome, but doesn't do anything\n // https://github.com/videojs/video.js/issues/3180\n if (IS_ANDROID && IS_CHROME && CHROME_VERSION < 58) {\n return false;\n }\n // IE will error if Windows Media Player not installed #3315\n try {\n const playbackRate = Html5.TEST_VID.playbackRate;\n Html5.TEST_VID.playbackRate = playbackRate / 2 + 0.1;\n return playbackRate !== Html5.TEST_VID.playbackRate;\n } catch (e) {\n return false;\n }\n};\n\n/**\n * Check if we can override a video/audio elements attributes, with\n * Object.defineProperty.\n *\n * @return {boolean}\n * - True if builtin attributes can be overridden\n * - False otherwise\n */\nHtml5.canOverrideAttributes = function () {\n // if we cannot overwrite the src/innerHTML property, there is no support\n // iOS 7 safari for instance cannot do this.\n try {\n const noop = () => {};\n Object.defineProperty(document.createElement('video'), 'src', {\n get: noop,\n set: noop\n });\n Object.defineProperty(document.createElement('audio'), 'src', {\n get: noop,\n set: noop\n });\n Object.defineProperty(document.createElement('video'), 'innerHTML', {\n get: noop,\n set: noop\n });\n Object.defineProperty(document.createElement('audio'), 'innerHTML', {\n get: noop,\n set: noop\n });\n } catch (e) {\n return false;\n }\n return true;\n};\n\n/**\n * Check to see if native `TextTrack`s are supported by this browser/device.\n *\n * @return {boolean}\n * - True if native `TextTrack`s are supported.\n * - False otherwise\n */\nHtml5.supportsNativeTextTracks = function () {\n return IS_ANY_SAFARI || IS_IOS && IS_CHROME;\n};\n\n/**\n * Check to see if native `VideoTrack`s are supported by this browser/device\n *\n * @return {boolean}\n * - True if native `VideoTrack`s are supported.\n * - False otherwise\n */\nHtml5.supportsNativeVideoTracks = function () {\n return !!(Html5.TEST_VID && Html5.TEST_VID.videoTracks);\n};\n\n/**\n * Check to see if native `AudioTrack`s are supported by this browser/device\n *\n * @return {boolean}\n * - True if native `AudioTrack`s are supported.\n * - False otherwise\n */\nHtml5.supportsNativeAudioTracks = function () {\n return !!(Html5.TEST_VID && Html5.TEST_VID.audioTracks);\n};\n\n/**\n * An array of events available on the Html5 tech.\n *\n * @private\n * @type {Array}\n */\nHtml5.Events = ['loadstart', 'suspend', 'abort', 'error', 'emptied', 'stalled', 'loadedmetadata', 'loadeddata', 'canplay', 'canplaythrough', 'playing', 'waiting', 'seeking', 'seeked', 'ended', 'durationchange', 'timeupdate', 'progress', 'play', 'pause', 'ratechange', 'resize', 'volumechange'];\n\n/**\n * Boolean indicating whether the `Tech` supports volume control.\n *\n * @type {boolean}\n * @default {@link Html5.canControlVolume}\n */\n/**\n * Boolean indicating whether the `Tech` supports muting volume.\n *\n * @type {boolean}\n * @default {@link Html5.canMuteVolume}\n */\n\n/**\n * Boolean indicating whether the `Tech` supports changing the speed at which the media\n * plays. Examples:\n * - Set player to play 2x (twice) as fast\n * - Set player to play 0.5x (half) as fast\n *\n * @type {boolean}\n * @default {@link Html5.canControlPlaybackRate}\n */\n\n/**\n * Boolean indicating whether the `Tech` supports the `sourceset` event.\n *\n * @type {boolean}\n * @default\n */\n/**\n * Boolean indicating whether the `HTML5` tech currently supports native `TextTrack`s.\n *\n * @type {boolean}\n * @default {@link Html5.supportsNativeTextTracks}\n */\n/**\n * Boolean indicating whether the `HTML5` tech currently supports native `VideoTrack`s.\n *\n * @type {boolean}\n * @default {@link Html5.supportsNativeVideoTracks}\n */\n/**\n * Boolean indicating whether the `HTML5` tech currently supports native `AudioTrack`s.\n *\n * @type {boolean}\n * @default {@link Html5.supportsNativeAudioTracks}\n */\n[['featuresMuteControl', 'canMuteVolume'], ['featuresPlaybackRate', 'canControlPlaybackRate'], ['featuresSourceset', 'canOverrideAttributes'], ['featuresNativeTextTracks', 'supportsNativeTextTracks'], ['featuresNativeVideoTracks', 'supportsNativeVideoTracks'], ['featuresNativeAudioTracks', 'supportsNativeAudioTracks']].forEach(function ([key, fn]) {\n defineLazyProperty(Html5.prototype, key, () => Html5[fn](), true);\n});\nHtml5.prototype.featuresVolumeControl = Html5.canControlVolume();\n\n/**\n * Boolean indicating whether the `HTML5` tech currently supports the media element\n * moving in the DOM. iOS breaks if you move the media element, so this is set this to\n * false there. Everywhere else this should be true.\n *\n * @type {boolean}\n * @default\n */\nHtml5.prototype.movingMediaElementInDOM = !IS_IOS;\n\n// TODO: Previous comment: No longer appears to be used. Can probably be removed.\n// Is this true?\n/**\n * Boolean indicating whether the `HTML5` tech currently supports automatic media resize\n * when going into fullscreen.\n *\n * @type {boolean}\n * @default\n */\nHtml5.prototype.featuresFullscreenResize = true;\n\n/**\n * Boolean indicating whether the `HTML5` tech currently supports the progress event.\n * If this is false, manual `progress` events will be triggered instead.\n *\n * @type {boolean}\n * @default\n */\nHtml5.prototype.featuresProgressEvents = true;\n\n/**\n * Boolean indicating whether the `HTML5` tech currently supports the timeupdate event.\n * If this is false, manual `timeupdate` events will be triggered instead.\n *\n * @default\n */\nHtml5.prototype.featuresTimeupdateEvents = true;\n\n/**\n * Whether the HTML5 el supports `requestVideoFrameCallback`\n *\n * @type {boolean}\n */\nHtml5.prototype.featuresVideoFrameCallback = !!(Html5.TEST_VID && Html5.TEST_VID.requestVideoFrameCallback);\nHtml5.disposeMediaElement = function (el) {\n if (!el) {\n return;\n }\n if (el.parentNode) {\n el.parentNode.removeChild(el);\n }\n\n // remove any child track or source nodes to prevent their loading\n while (el.hasChildNodes()) {\n el.removeChild(el.firstChild);\n }\n\n // remove any src reference. not setting `src=''` because that causes a warning\n // in firefox\n el.removeAttribute('src');\n\n // force the media element to update its loading state by calling load()\n // however IE on Windows 7N has a bug that throws an error so need a try/catch (#793)\n if (typeof el.load === 'function') {\n // wrapping in an iife so it's not deoptimized (#1060#discussion_r10324473)\n (function () {\n try {\n el.load();\n } catch (e) {\n // not supported\n }\n })();\n }\n};\nHtml5.resetMediaElement = function (el) {\n if (!el) {\n return;\n }\n const sources = el.querySelectorAll('source');\n let i = sources.length;\n while (i--) {\n el.removeChild(sources[i]);\n }\n\n // remove any src reference.\n // not setting `src=''` because that throws an error\n el.removeAttribute('src');\n if (typeof el.load === 'function') {\n // wrapping in an iife so it's not deoptimized (#1060#discussion_r10324473)\n (function () {\n try {\n el.load();\n } catch (e) {\n // satisfy linter\n }\n })();\n }\n};\n\n/* Native HTML5 element property wrapping ----------------------------------- */\n// Wrap native boolean attributes with getters that check both property and attribute\n// The list is as followed:\n// muted, defaultMuted, autoplay, controls, loop, playsinline\n[\n/**\n * Get the value of `muted` from the media element. `muted` indicates\n * that the volume for the media should be set to silent. This does not actually change\n * the `volume` attribute.\n *\n * @method Html5#muted\n * @return {boolean}\n * - True if the value of `volume` should be ignored and the audio set to silent.\n * - False if the value of `volume` should be used.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-muted}\n */\n'muted',\n/**\n * Get the value of `defaultMuted` from the media element. `defaultMuted` indicates\n * whether the media should start muted or not. Only changes the default state of the\n * media. `muted` and `defaultMuted` can have different values. {@link Html5#muted} indicates the\n * current state.\n *\n * @method Html5#defaultMuted\n * @return {boolean}\n * - The value of `defaultMuted` from the media element.\n * - True indicates that the media should start muted.\n * - False indicates that the media should not start muted\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-defaultmuted}\n */\n'defaultMuted',\n/**\n * Get the value of `autoplay` from the media element. `autoplay` indicates\n * that the media should start to play as soon as the page is ready.\n *\n * @method Html5#autoplay\n * @return {boolean}\n * - The value of `autoplay` from the media element.\n * - True indicates that the media should start as soon as the page loads.\n * - False indicates that the media should not start as soon as the page loads.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-autoplay}\n */\n'autoplay',\n/**\n * Get the value of `controls` from the media element. `controls` indicates\n * whether the native media controls should be shown or hidden.\n *\n * @method Html5#controls\n * @return {boolean}\n * - The value of `controls` from the media element.\n * - True indicates that native controls should be showing.\n * - False indicates that native controls should be hidden.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-controls}\n */\n'controls',\n/**\n * Get the value of `loop` from the media element. `loop` indicates\n * that the media should return to the start of the media and continue playing once\n * it reaches the end.\n *\n * @method Html5#loop\n * @return {boolean}\n * - The value of `loop` from the media element.\n * - True indicates that playback should seek back to start once\n * the end of a media is reached.\n * - False indicates that playback should not loop back to the start when the\n * end of the media is reached.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-loop}\n */\n'loop',\n/**\n * Get the value of `playsinline` from the media element. `playsinline` indicates\n * to the browser that non-fullscreen playback is preferred when fullscreen\n * playback is the native default, such as in iOS Safari.\n *\n * @method Html5#playsinline\n * @return {boolean}\n * - The value of `playsinline` from the media element.\n * - True indicates that the media should play inline.\n * - False indicates that the media should not play inline.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/#attr-video-playsinline}\n */\n'playsinline'].forEach(function (prop) {\n Html5.prototype[prop] = function () {\n return this.el_[prop] || this.el_.hasAttribute(prop);\n };\n});\n\n// Wrap native boolean attributes with setters that set both property and attribute\n// The list is as followed:\n// setMuted, setDefaultMuted, setAutoplay, setLoop, setPlaysinline\n// setControls is special-cased above\n[\n/**\n * Set the value of `muted` on the media element. `muted` indicates that the current\n * audio level should be silent.\n *\n * @method Html5#setMuted\n * @param {boolean} muted\n * - True if the audio should be set to silent\n * - False otherwise\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-muted}\n */\n'muted',\n/**\n * Set the value of `defaultMuted` on the media element. `defaultMuted` indicates that the current\n * audio level should be silent, but will only effect the muted level on initial playback..\n *\n * @method Html5.prototype.setDefaultMuted\n * @param {boolean} defaultMuted\n * - True if the audio should be set to silent\n * - False otherwise\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-defaultmuted}\n */\n'defaultMuted',\n/**\n * Set the value of `autoplay` on the media element. `autoplay` indicates\n * that the media should start to play as soon as the page is ready.\n *\n * @method Html5#setAutoplay\n * @param {boolean} autoplay\n * - True indicates that the media should start as soon as the page loads.\n * - False indicates that the media should not start as soon as the page loads.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-autoplay}\n */\n'autoplay',\n/**\n * Set the value of `loop` on the media element. `loop` indicates\n * that the media should return to the start of the media and continue playing once\n * it reaches the end.\n *\n * @method Html5#setLoop\n * @param {boolean} loop\n * - True indicates that playback should seek back to start once\n * the end of a media is reached.\n * - False indicates that playback should not loop back to the start when the\n * end of the media is reached.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-loop}\n */\n'loop',\n/**\n * Set the value of `playsinline` from the media element. `playsinline` indicates\n * to the browser that non-fullscreen playback is preferred when fullscreen\n * playback is the native default, such as in iOS Safari.\n *\n * @method Html5#setPlaysinline\n * @param {boolean} playsinline\n * - True indicates that the media should play inline.\n * - False indicates that the media should not play inline.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/#attr-video-playsinline}\n */\n'playsinline'].forEach(function (prop) {\n Html5.prototype['set' + toTitleCase$1(prop)] = function (v) {\n this.el_[prop] = v;\n if (v) {\n this.el_.setAttribute(prop, prop);\n } else {\n this.el_.removeAttribute(prop);\n }\n };\n});\n\n// Wrap native properties with a getter\n// The list is as followed\n// paused, currentTime, buffered, volume, poster, preload, error, seeking\n// seekable, ended, playbackRate, defaultPlaybackRate, disablePictureInPicture\n// played, networkState, readyState, videoWidth, videoHeight, crossOrigin\n[\n/**\n * Get the value of `paused` from the media element. `paused` indicates whether the media element\n * is currently paused or not.\n *\n * @method Html5#paused\n * @return {boolean}\n * The value of `paused` from the media element.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-paused}\n */\n'paused',\n/**\n * Get the value of `currentTime` from the media element. `currentTime` indicates\n * the current second that the media is at in playback.\n *\n * @method Html5#currentTime\n * @return {number}\n * The value of `currentTime` from the media element.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-currenttime}\n */\n'currentTime',\n/**\n * Get the value of `buffered` from the media element. `buffered` is a `TimeRange`\n * object that represents the parts of the media that are already downloaded and\n * available for playback.\n *\n * @method Html5#buffered\n * @return {TimeRange}\n * The value of `buffered` from the media element.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-buffered}\n */\n'buffered',\n/**\n * Get the value of `volume` from the media element. `volume` indicates\n * the current playback volume of audio for a media. `volume` will be a value from 0\n * (silent) to 1 (loudest and default).\n *\n * @method Html5#volume\n * @return {number}\n * The value of `volume` from the media element. Value will be between 0-1.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-a-volume}\n */\n'volume',\n/**\n * Get the value of `poster` from the media element. `poster` indicates\n * that the url of an image file that can/will be shown when no media data is available.\n *\n * @method Html5#poster\n * @return {string}\n * The value of `poster` from the media element. Value will be a url to an\n * image.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-video-poster}\n */\n'poster',\n/**\n * Get the value of `preload` from the media element. `preload` indicates\n * what should download before the media is interacted with. It can have the following\n * values:\n * - none: nothing should be downloaded\n * - metadata: poster and the first few frames of the media may be downloaded to get\n * media dimensions and other metadata\n * - auto: allow the media and metadata for the media to be downloaded before\n * interaction\n *\n * @method Html5#preload\n * @return {string}\n * The value of `preload` from the media element. Will be 'none', 'metadata',\n * or 'auto'.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-preload}\n */\n'preload',\n/**\n * Get the value of the `error` from the media element. `error` indicates any\n * MediaError that may have occurred during playback. If error returns null there is no\n * current error.\n *\n * @method Html5#error\n * @return {MediaError|null}\n * The value of `error` from the media element. Will be `MediaError` if there\n * is a current error and null otherwise.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-error}\n */\n'error',\n/**\n * Get the value of `seeking` from the media element. `seeking` indicates whether the\n * media is currently seeking to a new position or not.\n *\n * @method Html5#seeking\n * @return {boolean}\n * - The value of `seeking` from the media element.\n * - True indicates that the media is currently seeking to a new position.\n * - False indicates that the media is not seeking to a new position at this time.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-seeking}\n */\n'seeking',\n/**\n * Get the value of `seekable` from the media element. `seekable` returns a\n * `TimeRange` object indicating ranges of time that can currently be `seeked` to.\n *\n * @method Html5#seekable\n * @return {TimeRange}\n * The value of `seekable` from the media element. A `TimeRange` object\n * indicating the current ranges of time that can be seeked to.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-seekable}\n */\n'seekable',\n/**\n * Get the value of `ended` from the media element. `ended` indicates whether\n * the media has reached the end or not.\n *\n * @method Html5#ended\n * @return {boolean}\n * - The value of `ended` from the media element.\n * - True indicates that the media has ended.\n * - False indicates that the media has not ended.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-ended}\n */\n'ended',\n/**\n * Get the value of `playbackRate` from the media element. `playbackRate` indicates\n * the rate at which the media is currently playing back. Examples:\n * - if playbackRate is set to 2, media will play twice as fast.\n * - if playbackRate is set to 0.5, media will play half as fast.\n *\n * @method Html5#playbackRate\n * @return {number}\n * The value of `playbackRate` from the media element. A number indicating\n * the current playback speed of the media, where 1 is normal speed.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-playbackrate}\n */\n'playbackRate',\n/**\n * Get the value of `defaultPlaybackRate` from the media element. `defaultPlaybackRate` indicates\n * the rate at which the media is currently playing back. This value will not indicate the current\n * `playbackRate` after playback has started, use {@link Html5#playbackRate} for that.\n *\n * Examples:\n * - if defaultPlaybackRate is set to 2, media will play twice as fast.\n * - if defaultPlaybackRate is set to 0.5, media will play half as fast.\n *\n * @method Html5.prototype.defaultPlaybackRate\n * @return {number}\n * The value of `defaultPlaybackRate` from the media element. A number indicating\n * the current playback speed of the media, where 1 is normal speed.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-playbackrate}\n */\n'defaultPlaybackRate',\n/**\n * Get the value of 'disablePictureInPicture' from the video element.\n *\n * @method Html5#disablePictureInPicture\n * @return {boolean} value\n * - The value of `disablePictureInPicture` from the video element.\n * - True indicates that the video can't be played in Picture-In-Picture mode\n * - False indicates that the video can be played in Picture-In-Picture mode\n *\n * @see [Spec]{@link https://w3c.github.io/picture-in-picture/#disable-pip}\n */\n'disablePictureInPicture',\n/**\n * Get the value of `played` from the media element. `played` returns a `TimeRange`\n * object representing points in the media timeline that have been played.\n *\n * @method Html5#played\n * @return {TimeRange}\n * The value of `played` from the media element. A `TimeRange` object indicating\n * the ranges of time that have been played.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-played}\n */\n'played',\n/**\n * Get the value of `networkState` from the media element. `networkState` indicates\n * the current network state. It returns an enumeration from the following list:\n * - 0: NETWORK_EMPTY\n * - 1: NETWORK_IDLE\n * - 2: NETWORK_LOADING\n * - 3: NETWORK_NO_SOURCE\n *\n * @method Html5#networkState\n * @return {number}\n * The value of `networkState` from the media element. This will be a number\n * from the list in the description.\n *\n * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-networkstate}\n */\n'networkState',\n/**\n * Get the value of `readyState` from the media element. `readyState` indicates\n * the current state of the media element. It returns an enumeration from the\n * following list:\n * - 0: HAVE_NOTHING\n * - 1: HAVE_METADATA\n * - 2: HAVE_CURRENT_DATA\n * - 3: HAVE_FUTURE_DATA\n * - 4: HAVE_ENOUGH_DATA\n *\n * @method Html5#readyState\n * @return {number}\n * The value of `readyState` from the media element. This will be a number\n * from the list in the description.\n *\n * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#ready-states}\n */\n'readyState',\n/**\n * Get the value of `videoWidth` from the video element. `videoWidth` indicates\n * the current width of the video in css pixels.\n *\n * @method Html5#videoWidth\n * @return {number}\n * The value of `videoWidth` from the video element. This will be a number\n * in css pixels.\n *\n * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-video-videowidth}\n */\n'videoWidth',\n/**\n * Get the value of `videoHeight` from the video element. `videoHeight` indicates\n * the current height of the video in css pixels.\n *\n * @method Html5#videoHeight\n * @return {number}\n * The value of `videoHeight` from the video element. This will be a number\n * in css pixels.\n *\n * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-video-videowidth}\n */\n'videoHeight',\n/**\n * Get the value of `crossOrigin` from the media element. `crossOrigin` indicates\n * to the browser that should sent the cookies along with the requests for the\n * different assets/playlists\n *\n * @method Html5#crossOrigin\n * @return {string}\n * - anonymous indicates that the media should not sent cookies.\n * - use-credentials indicates that the media should sent cookies along the requests.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/#attr-media-crossorigin}\n */\n'crossOrigin'].forEach(function (prop) {\n Html5.prototype[prop] = function () {\n return this.el_[prop];\n };\n});\n\n// Wrap native properties with a setter in this format:\n// set + toTitleCase(name)\n// The list is as follows:\n// setVolume, setSrc, setPoster, setPreload, setPlaybackRate, setDefaultPlaybackRate,\n// setDisablePictureInPicture, setCrossOrigin\n[\n/**\n * Set the value of `volume` on the media element. `volume` indicates the current\n * audio level as a percentage in decimal form. This means that 1 is 100%, 0.5 is 50%, and\n * so on.\n *\n * @method Html5#setVolume\n * @param {number} percentAsDecimal\n * The volume percent as a decimal. Valid range is from 0-1.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-a-volume}\n */\n'volume',\n/**\n * Set the value of `src` on the media element. `src` indicates the current\n * {@link Tech~SourceObject} for the media.\n *\n * @method Html5#setSrc\n * @param {Tech~SourceObject} src\n * The source object to set as the current source.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-src}\n */\n'src',\n/**\n * Set the value of `poster` on the media element. `poster` is the url to\n * an image file that can/will be shown when no media data is available.\n *\n * @method Html5#setPoster\n * @param {string} poster\n * The url to an image that should be used as the `poster` for the media\n * element.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-poster}\n */\n'poster',\n/**\n * Set the value of `preload` on the media element. `preload` indicates\n * what should download before the media is interacted with. It can have the following\n * values:\n * - none: nothing should be downloaded\n * - metadata: poster and the first few frames of the media may be downloaded to get\n * media dimensions and other metadata\n * - auto: allow the media and metadata for the media to be downloaded before\n * interaction\n *\n * @method Html5#setPreload\n * @param {string} preload\n * The value of `preload` to set on the media element. Must be 'none', 'metadata',\n * or 'auto'.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-preload}\n */\n'preload',\n/**\n * Set the value of `playbackRate` on the media element. `playbackRate` indicates\n * the rate at which the media should play back. Examples:\n * - if playbackRate is set to 2, media will play twice as fast.\n * - if playbackRate is set to 0.5, media will play half as fast.\n *\n * @method Html5#setPlaybackRate\n * @return {number}\n * The value of `playbackRate` from the media element. A number indicating\n * the current playback speed of the media, where 1 is normal speed.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-playbackrate}\n */\n'playbackRate',\n/**\n * Set the value of `defaultPlaybackRate` on the media element. `defaultPlaybackRate` indicates\n * the rate at which the media should play back upon initial startup. Changing this value\n * after a video has started will do nothing. Instead you should used {@link Html5#setPlaybackRate}.\n *\n * Example Values:\n * - if playbackRate is set to 2, media will play twice as fast.\n * - if playbackRate is set to 0.5, media will play half as fast.\n *\n * @method Html5.prototype.setDefaultPlaybackRate\n * @return {number}\n * The value of `defaultPlaybackRate` from the media element. A number indicating\n * the current playback speed of the media, where 1 is normal speed.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-defaultplaybackrate}\n */\n'defaultPlaybackRate',\n/**\n * Prevents the browser from suggesting a Picture-in-Picture context menu\n * or to request Picture-in-Picture automatically in some cases.\n *\n * @method Html5#setDisablePictureInPicture\n * @param {boolean} value\n * The true value will disable Picture-in-Picture mode.\n *\n * @see [Spec]{@link https://w3c.github.io/picture-in-picture/#disable-pip}\n */\n'disablePictureInPicture',\n/**\n * Set the value of `crossOrigin` from the media element. `crossOrigin` indicates\n * to the browser that should sent the cookies along with the requests for the\n * different assets/playlists\n *\n * @method Html5#setCrossOrigin\n * @param {string} crossOrigin\n * - anonymous indicates that the media should not sent cookies.\n * - use-credentials indicates that the media should sent cookies along the requests.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/#attr-media-crossorigin}\n */\n'crossOrigin'].forEach(function (prop) {\n Html5.prototype['set' + toTitleCase$1(prop)] = function (v) {\n this.el_[prop] = v;\n };\n});\n\n// wrap native functions with a function\n// The list is as follows:\n// pause, load, play\n[\n/**\n * A wrapper around the media elements `pause` function. This will call the `HTML5`\n * media elements `pause` function.\n *\n * @method Html5#pause\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-pause}\n */\n'pause',\n/**\n * A wrapper around the media elements `load` function. This will call the `HTML5`s\n * media element `load` function.\n *\n * @method Html5#load\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-load}\n */\n'load',\n/**\n * A wrapper around the media elements `play` function. This will call the `HTML5`s\n * media element `play` function.\n *\n * @method Html5#play\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-play}\n */\n'play'].forEach(function (prop) {\n Html5.prototype[prop] = function () {\n return this.el_[prop]();\n };\n});\nTech.withSourceHandlers(Html5);\n\n/**\n * Native source handler for Html5, simply passes the source to the media element.\n *\n * @property {Tech~SourceObject} source\n * The source object\n *\n * @property {Html5} tech\n * The instance of the HTML5 tech.\n */\nHtml5.nativeSourceHandler = {};\n\n/**\n * Check if the media element can play the given mime type.\n *\n * @param {string} type\n * The mimetype to check\n *\n * @return {string}\n * 'probably', 'maybe', or '' (empty string)\n */\nHtml5.nativeSourceHandler.canPlayType = function (type) {\n // IE without MediaPlayer throws an error (#519)\n try {\n return Html5.TEST_VID.canPlayType(type);\n } catch (e) {\n return '';\n }\n};\n\n/**\n * Check if the media element can handle a source natively.\n *\n * @param {Tech~SourceObject} source\n * The source object\n *\n * @param {Object} [options]\n * Options to be passed to the tech.\n *\n * @return {string}\n * 'probably', 'maybe', or '' (empty string).\n */\nHtml5.nativeSourceHandler.canHandleSource = function (source, options) {\n // If a type was provided we should rely on that\n if (source.type) {\n return Html5.nativeSourceHandler.canPlayType(source.type);\n\n // If no type, fall back to checking 'video/[EXTENSION]'\n } else if (source.src) {\n const ext = getFileExtension(source.src);\n return Html5.nativeSourceHandler.canPlayType(`video/${ext}`);\n }\n return '';\n};\n\n/**\n * Pass the source to the native media element.\n *\n * @param {Tech~SourceObject} source\n * The source object\n *\n * @param {Html5} tech\n * The instance of the Html5 tech\n *\n * @param {Object} [options]\n * The options to pass to the source\n */\nHtml5.nativeSourceHandler.handleSource = function (source, tech, options) {\n tech.setSrc(source.src);\n};\n\n/**\n * A noop for the native dispose function, as cleanup is not needed.\n */\nHtml5.nativeSourceHandler.dispose = function () {};\n\n// Register the native source handler\nHtml5.registerSourceHandler(Html5.nativeSourceHandler);\nTech.registerTech('Html5', Html5);\n\n/**\n * @file player.js\n */\n\n// The following tech events are simply re-triggered\n// on the player when they happen\nconst TECH_EVENTS_RETRIGGER = [\n/**\n * Fired while the user agent is downloading media data.\n *\n * @event Player#progress\n * @type {Event}\n */\n/**\n * Retrigger the `progress` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechProgress_\n * @fires Player#progress\n * @listens Tech#progress\n */\n'progress',\n/**\n * Fires when the loading of an audio/video is aborted.\n *\n * @event Player#abort\n * @type {Event}\n */\n/**\n * Retrigger the `abort` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechAbort_\n * @fires Player#abort\n * @listens Tech#abort\n */\n'abort',\n/**\n * Fires when the browser is intentionally not getting media data.\n *\n * @event Player#suspend\n * @type {Event}\n */\n/**\n * Retrigger the `suspend` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechSuspend_\n * @fires Player#suspend\n * @listens Tech#suspend\n */\n'suspend',\n/**\n * Fires when the current playlist is empty.\n *\n * @event Player#emptied\n * @type {Event}\n */\n/**\n * Retrigger the `emptied` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechEmptied_\n * @fires Player#emptied\n * @listens Tech#emptied\n */\n'emptied',\n/**\n * Fires when the browser is trying to get media data, but data is not available.\n *\n * @event Player#stalled\n * @type {Event}\n */\n/**\n * Retrigger the `stalled` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechStalled_\n * @fires Player#stalled\n * @listens Tech#stalled\n */\n'stalled',\n/**\n * Fires when the browser has loaded meta data for the audio/video.\n *\n * @event Player#loadedmetadata\n * @type {Event}\n */\n/**\n * Retrigger the `loadedmetadata` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechLoadedmetadata_\n * @fires Player#loadedmetadata\n * @listens Tech#loadedmetadata\n */\n'loadedmetadata',\n/**\n * Fires when the browser has loaded the current frame of the audio/video.\n *\n * @event Player#loadeddata\n * @type {event}\n */\n/**\n * Retrigger the `loadeddata` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechLoaddeddata_\n * @fires Player#loadeddata\n * @listens Tech#loadeddata\n */\n'loadeddata',\n/**\n * Fires when the current playback position has changed.\n *\n * @event Player#timeupdate\n * @type {event}\n */\n/**\n * Retrigger the `timeupdate` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechTimeUpdate_\n * @fires Player#timeupdate\n * @listens Tech#timeupdate\n */\n'timeupdate',\n/**\n * Fires when the video's intrinsic dimensions change\n *\n * @event Player#resize\n * @type {event}\n */\n/**\n * Retrigger the `resize` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechResize_\n * @fires Player#resize\n * @listens Tech#resize\n */\n'resize',\n/**\n * Fires when the volume has been changed\n *\n * @event Player#volumechange\n * @type {event}\n */\n/**\n * Retrigger the `volumechange` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechVolumechange_\n * @fires Player#volumechange\n * @listens Tech#volumechange\n */\n'volumechange',\n/**\n * Fires when the text track has been changed\n *\n * @event Player#texttrackchange\n * @type {event}\n */\n/**\n * Retrigger the `texttrackchange` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechTexttrackchange_\n * @fires Player#texttrackchange\n * @listens Tech#texttrackchange\n */\n'texttrackchange'];\n\n// events to queue when playback rate is zero\n// this is a hash for the sole purpose of mapping non-camel-cased event names\n// to camel-cased function names\nconst TECH_EVENTS_QUEUE = {\n canplay: 'CanPlay',\n canplaythrough: 'CanPlayThrough',\n playing: 'Playing',\n seeked: 'Seeked'\n};\nconst BREAKPOINT_ORDER = ['tiny', 'xsmall', 'small', 'medium', 'large', 'xlarge', 'huge'];\nconst BREAKPOINT_CLASSES = {};\n\n// grep: vjs-layout-tiny\n// grep: vjs-layout-x-small\n// grep: vjs-layout-small\n// grep: vjs-layout-medium\n// grep: vjs-layout-large\n// grep: vjs-layout-x-large\n// grep: vjs-layout-huge\nBREAKPOINT_ORDER.forEach(k => {\n const v = k.charAt(0) === 'x' ? `x-${k.substring(1)}` : k;\n BREAKPOINT_CLASSES[k] = `vjs-layout-${v}`;\n});\nconst DEFAULT_BREAKPOINTS = {\n tiny: 210,\n xsmall: 320,\n small: 425,\n medium: 768,\n large: 1440,\n xlarge: 2560,\n huge: Infinity\n};\n\n/**\n * An instance of the `Player` class is created when any of the Video.js setup methods\n * are used to initialize a video.\n *\n * After an instance has been created it can be accessed globally in three ways:\n * 1. By calling `videojs.getPlayer('example_video_1');`\n * 2. By calling `videojs('example_video_1');` (not recommended)\n * 2. By using it directly via `videojs.players.example_video_1;`\n *\n * @extends Component\n * @global\n */\nclass Player extends Component$1 {\n /**\n * Create an instance of this class.\n *\n * @param {Element} tag\n * The original video DOM element used for configuring options.\n *\n * @param {Object} [options]\n * Object of option names and values.\n *\n * @param {Function} [ready]\n * Ready callback function.\n */\n constructor(tag, options, ready) {\n // Make sure tag ID exists\n // also here.. probably better\n tag.id = tag.id || options.id || `vjs_video_${newGUID()}`;\n\n // Set Options\n // The options argument overrides options set in the video tag\n // which overrides globally set options.\n // This latter part coincides with the load order\n // (tag must exist before Player)\n options = Object.assign(Player.getTagSettings(tag), options);\n\n // Delay the initialization of children because we need to set up\n // player properties first, and can't use `this` before `super()`\n options.initChildren = false;\n\n // Same with creating the element\n options.createEl = false;\n\n // don't auto mixin the evented mixin\n options.evented = false;\n\n // we don't want the player to report touch activity on itself\n // see enableTouchActivity in Component\n options.reportTouchActivity = false;\n\n // If language is not set, get the closest lang attribute\n if (!options.language) {\n const closest = tag.closest('[lang]');\n if (closest) {\n options.language = closest.getAttribute('lang');\n }\n }\n\n // Run base component initializing with new options\n super(null, options, ready);\n\n // Create bound methods for document listeners.\n this.boundDocumentFullscreenChange_ = e => this.documentFullscreenChange_(e);\n this.boundFullWindowOnEscKey_ = e => this.fullWindowOnEscKey(e);\n this.boundUpdateStyleEl_ = e => this.updateStyleEl_(e);\n this.boundApplyInitTime_ = e => this.applyInitTime_(e);\n this.boundUpdateCurrentBreakpoint_ = e => this.updateCurrentBreakpoint_(e);\n this.boundHandleTechClick_ = e => this.handleTechClick_(e);\n this.boundHandleTechDoubleClick_ = e => this.handleTechDoubleClick_(e);\n this.boundHandleTechTouchStart_ = e => this.handleTechTouchStart_(e);\n this.boundHandleTechTouchMove_ = e => this.handleTechTouchMove_(e);\n this.boundHandleTechTouchEnd_ = e => this.handleTechTouchEnd_(e);\n this.boundHandleTechTap_ = e => this.handleTechTap_(e);\n\n // default isFullscreen_ to false\n this.isFullscreen_ = false;\n\n // create logger\n this.log = createLogger(this.id_);\n\n // Hold our own reference to fullscreen api so it can be mocked in tests\n this.fsApi_ = FullscreenApi;\n\n // Tracks when a tech changes the poster\n this.isPosterFromTech_ = false;\n\n // Holds callback info that gets queued when playback rate is zero\n // and a seek is happening\n this.queuedCallbacks_ = [];\n\n // Turn off API access because we're loading a new tech that might load asynchronously\n this.isReady_ = false;\n\n // Init state hasStarted_\n this.hasStarted_ = false;\n\n // Init state userActive_\n this.userActive_ = false;\n\n // Init debugEnabled_\n this.debugEnabled_ = false;\n\n // Init state audioOnlyMode_\n this.audioOnlyMode_ = false;\n\n // Init state audioPosterMode_\n this.audioPosterMode_ = false;\n\n // Init state audioOnlyCache_\n this.audioOnlyCache_ = {\n playerHeight: null,\n hiddenChildren: []\n };\n\n // if the global option object was accidentally blown away by\n // someone, bail early with an informative error\n if (!this.options_ || !this.options_.techOrder || !this.options_.techOrder.length) {\n throw new Error('No techOrder specified. Did you overwrite ' + 'videojs.options instead of just changing the ' + 'properties you want to override?');\n }\n\n // Store the original tag used to set options\n this.tag = tag;\n\n // Store the tag attributes used to restore html5 element\n this.tagAttributes = tag && getAttributes(tag);\n\n // Update current language\n this.language(this.options_.language);\n\n // Update Supported Languages\n if (options.languages) {\n // Normalise player option languages to lowercase\n const languagesToLower = {};\n Object.getOwnPropertyNames(options.languages).forEach(function (name) {\n languagesToLower[name.toLowerCase()] = options.languages[name];\n });\n this.languages_ = languagesToLower;\n } else {\n this.languages_ = Player.prototype.options_.languages;\n }\n this.resetCache_();\n\n // Set poster\n /** @type string */\n this.poster_ = options.poster || '';\n\n // Set controls\n /** @type {boolean} */\n this.controls_ = !!options.controls;\n\n // Original tag settings stored in options\n // now remove immediately so native controls don't flash.\n // May be turned back on by HTML5 tech if nativeControlsForTouch is true\n tag.controls = false;\n tag.removeAttribute('controls');\n this.changingSrc_ = false;\n this.playCallbacks_ = [];\n this.playTerminatedQueue_ = [];\n\n // the attribute overrides the option\n if (tag.hasAttribute('autoplay')) {\n this.autoplay(true);\n } else {\n // otherwise use the setter to validate and\n // set the correct value.\n this.autoplay(this.options_.autoplay);\n }\n\n // check plugins\n if (options.plugins) {\n Object.keys(options.plugins).forEach(name => {\n if (typeof this[name] !== 'function') {\n throw new Error(`plugin \"${name}\" does not exist`);\n }\n });\n }\n\n /*\n * Store the internal state of scrubbing\n *\n * @private\n * @return {Boolean} True if the user is scrubbing\n */\n this.scrubbing_ = false;\n this.el_ = this.createEl();\n\n // Make this an evented object and use `el_` as its event bus.\n evented(this, {\n eventBusKey: 'el_'\n });\n\n // listen to document and player fullscreenchange handlers so we receive those events\n // before a user can receive them so we can update isFullscreen appropriately.\n // make sure that we listen to fullscreenchange events before everything else to make sure that\n // our isFullscreen method is updated properly for internal components as well as external.\n if (this.fsApi_.requestFullscreen) {\n on(document, this.fsApi_.fullscreenchange, this.boundDocumentFullscreenChange_);\n this.on(this.fsApi_.fullscreenchange, this.boundDocumentFullscreenChange_);\n }\n if (this.fluid_) {\n this.on(['playerreset', 'resize'], this.boundUpdateStyleEl_);\n }\n // We also want to pass the original player options to each component and plugin\n // as well so they don't need to reach back into the player for options later.\n // We also need to do another copy of this.options_ so we don't end up with\n // an infinite loop.\n const playerOptionsCopy = merge$1(this.options_);\n\n // Load plugins\n if (options.plugins) {\n Object.keys(options.plugins).forEach(name => {\n this[name](options.plugins[name]);\n });\n }\n\n // Enable debug mode to fire debugon event for all plugins.\n if (options.debug) {\n this.debug(true);\n }\n this.options_.playerOptions = playerOptionsCopy;\n this.middleware_ = [];\n this.playbackRates(options.playbackRates);\n if (options.experimentalSvgIcons) {\n // Add SVG Sprite to the DOM\n const parser = new window$1.DOMParser();\n const parsedSVG = parser.parseFromString(icons, 'image/svg+xml');\n const errorNode = parsedSVG.querySelector('parsererror');\n if (errorNode) {\n log$1.warn('Failed to load SVG Icons. Falling back to Font Icons.');\n this.options_.experimentalSvgIcons = null;\n } else {\n const sprite = parsedSVG.documentElement;\n sprite.style.display = 'none';\n this.el_.appendChild(sprite);\n this.addClass('vjs-svg-icons-enabled');\n }\n }\n this.initChildren();\n\n // Set isAudio based on whether or not an audio tag was used\n this.isAudio(tag.nodeName.toLowerCase() === 'audio');\n\n // Update controls className. Can't do this when the controls are initially\n // set because the element doesn't exist yet.\n if (this.controls()) {\n this.addClass('vjs-controls-enabled');\n } else {\n this.addClass('vjs-controls-disabled');\n }\n\n // Set ARIA label and region role depending on player type\n this.el_.setAttribute('role', 'region');\n if (this.isAudio()) {\n this.el_.setAttribute('aria-label', this.localize('Audio Player'));\n } else {\n this.el_.setAttribute('aria-label', this.localize('Video Player'));\n }\n if (this.isAudio()) {\n this.addClass('vjs-audio');\n }\n\n // TODO: Make this smarter. Toggle user state between touching/mousing\n // using events, since devices can have both touch and mouse events.\n // TODO: Make this check be performed again when the window switches between monitors\n // (See https://github.com/videojs/video.js/issues/5683)\n if (TOUCH_ENABLED) {\n this.addClass('vjs-touch-enabled');\n }\n\n // iOS Safari has broken hover handling\n if (!IS_IOS) {\n this.addClass('vjs-workinghover');\n }\n\n // Make player easily findable by ID\n Player.players[this.id_] = this;\n\n // Add a major version class to aid css in plugins\n const majorVersion = version$6.split('.')[0];\n this.addClass(`vjs-v${majorVersion}`);\n\n // When the player is first initialized, trigger activity so components\n // like the control bar show themselves if needed\n this.userActive(true);\n this.reportUserActivity();\n this.one('play', e => this.listenForUserActivity_(e));\n this.on('keydown', e => this.handleKeyDown(e));\n this.on('languagechange', e => this.handleLanguagechange(e));\n this.breakpoints(this.options_.breakpoints);\n this.responsive(this.options_.responsive);\n\n // Calling both the audio mode methods after the player is fully\n // setup to be able to listen to the events triggered by them\n this.on('ready', () => {\n // Calling the audioPosterMode method first so that\n // the audioOnlyMode can take precedence when both options are set to true\n this.audioPosterMode(this.options_.audioPosterMode);\n this.audioOnlyMode(this.options_.audioOnlyMode);\n });\n }\n\n /**\n * Destroys the video player and does any necessary cleanup.\n *\n * This is especially helpful if you are dynamically adding and removing videos\n * to/from the DOM.\n *\n * @fires Player#dispose\n */\n dispose() {\n /**\n * Called when the player is being disposed of.\n *\n * @event Player#dispose\n * @type {Event}\n */\n this.trigger('dispose');\n // prevent dispose from being called twice\n this.off('dispose');\n\n // Make sure all player-specific document listeners are unbound. This is\n off(document, this.fsApi_.fullscreenchange, this.boundDocumentFullscreenChange_);\n off(document, 'keydown', this.boundFullWindowOnEscKey_);\n if (this.styleEl_ && this.styleEl_.parentNode) {\n this.styleEl_.parentNode.removeChild(this.styleEl_);\n this.styleEl_ = null;\n }\n\n // Kill reference to this player\n Player.players[this.id_] = null;\n if (this.tag && this.tag.player) {\n this.tag.player = null;\n }\n if (this.el_ && this.el_.player) {\n this.el_.player = null;\n }\n if (this.tech_) {\n this.tech_.dispose();\n this.isPosterFromTech_ = false;\n this.poster_ = '';\n }\n if (this.playerElIngest_) {\n this.playerElIngest_ = null;\n }\n if (this.tag) {\n this.tag = null;\n }\n clearCacheForPlayer(this);\n\n // remove all event handlers for track lists\n // all tracks and track listeners are removed on\n // tech dispose\n ALL.names.forEach(name => {\n const props = ALL[name];\n const list = this[props.getterName]();\n\n // if it is not a native list\n // we have to manually remove event listeners\n if (list && list.off) {\n list.off();\n }\n });\n\n // the actual .el_ is removed here, or replaced if\n super.dispose({\n restoreEl: this.options_.restoreEl\n });\n }\n\n /**\n * Create the `Player`'s DOM element.\n *\n * @return {Element}\n * The DOM element that gets created.\n */\n createEl() {\n let tag = this.tag;\n let el;\n let playerElIngest = this.playerElIngest_ = tag.parentNode && tag.parentNode.hasAttribute && tag.parentNode.hasAttribute('data-vjs-player');\n const divEmbed = this.tag.tagName.toLowerCase() === 'video-js';\n if (playerElIngest) {\n el = this.el_ = tag.parentNode;\n } else if (!divEmbed) {\n el = this.el_ = super.createEl('div');\n }\n\n // Copy over all the attributes from the tag, including ID and class\n // ID will now reference player box, not the video tag\n const attrs = getAttributes(tag);\n if (divEmbed) {\n el = this.el_ = tag;\n tag = this.tag = document.createElement('video');\n while (el.children.length) {\n tag.appendChild(el.firstChild);\n }\n if (!hasClass(el, 'video-js')) {\n addClass(el, 'video-js');\n }\n el.appendChild(tag);\n playerElIngest = this.playerElIngest_ = el;\n // move properties over from our custom `video-js` element\n // to our new `video` element. This will move things like\n // `src` or `controls` that were set via js before the player\n // was initialized.\n Object.keys(el).forEach(k => {\n try {\n tag[k] = el[k];\n } catch (e) {\n // we got a a property like outerHTML which we can't actually copy, ignore it\n }\n });\n }\n\n // set tabindex to -1 to remove the video element from the focus order\n tag.setAttribute('tabindex', '-1');\n attrs.tabindex = '-1';\n\n // Workaround for #4583 on Chrome (on Windows) with JAWS.\n // See https://github.com/FreedomScientific/VFO-standards-support/issues/78\n // Note that we can't detect if JAWS is being used, but this ARIA attribute\n // doesn't change behavior of Chrome if JAWS is not being used\n if (IS_CHROME && IS_WINDOWS) {\n tag.setAttribute('role', 'application');\n attrs.role = 'application';\n }\n\n // Remove width/height attrs from tag so CSS can make it 100% width/height\n tag.removeAttribute('width');\n tag.removeAttribute('height');\n if ('width' in attrs) {\n delete attrs.width;\n }\n if ('height' in attrs) {\n delete attrs.height;\n }\n Object.getOwnPropertyNames(attrs).forEach(function (attr) {\n // don't copy over the class attribute to the player element when we're in a div embed\n // the class is already set up properly in the divEmbed case\n // and we want to make sure that the `video-js` class doesn't get lost\n if (!(divEmbed && attr === 'class')) {\n el.setAttribute(attr, attrs[attr]);\n }\n if (divEmbed) {\n tag.setAttribute(attr, attrs[attr]);\n }\n });\n\n // Update tag id/class for use as HTML5 playback tech\n // Might think we should do this after embedding in container so .vjs-tech class\n // doesn't flash 100% width/height, but class only applies with .video-js parent\n tag.playerId = tag.id;\n tag.id += '_html5_api';\n tag.className = 'vjs-tech';\n\n // Make player findable on elements\n tag.player = el.player = this;\n // Default state of video is paused\n this.addClass('vjs-paused');\n\n // Add a style element in the player that we'll use to set the width/height\n // of the player in a way that's still overridable by CSS, just like the\n // video element\n if (window$1.VIDEOJS_NO_DYNAMIC_STYLE !== true) {\n this.styleEl_ = createStyleElement('vjs-styles-dimensions');\n const defaultsStyleEl = $('.vjs-styles-defaults');\n const head = $('head');\n head.insertBefore(this.styleEl_, defaultsStyleEl ? defaultsStyleEl.nextSibling : head.firstChild);\n }\n this.fill_ = false;\n this.fluid_ = false;\n\n // Pass in the width/height/aspectRatio options which will update the style el\n this.width(this.options_.width);\n this.height(this.options_.height);\n this.fill(this.options_.fill);\n this.fluid(this.options_.fluid);\n this.aspectRatio(this.options_.aspectRatio);\n // support both crossOrigin and crossorigin to reduce confusion and issues around the name\n this.crossOrigin(this.options_.crossOrigin || this.options_.crossorigin);\n\n // Hide any links within the video/audio tag,\n // because IE doesn't hide them completely from screen readers.\n const links = tag.getElementsByTagName('a');\n for (let i = 0; i < links.length; i++) {\n const linkEl = links.item(i);\n addClass(linkEl, 'vjs-hidden');\n linkEl.setAttribute('hidden', 'hidden');\n }\n\n // insertElFirst seems to cause the networkState to flicker from 3 to 2, so\n // keep track of the original for later so we can know if the source originally failed\n tag.initNetworkState_ = tag.networkState;\n\n // Wrap video tag in div (el/box) container\n if (tag.parentNode && !playerElIngest) {\n tag.parentNode.insertBefore(el, tag);\n }\n\n // insert the tag as the first child of the player element\n // then manually add it to the children array so that this.addChild\n // will work properly for other components\n //\n // Breaks iPhone, fixed in HTML5 setup.\n prependTo(tag, el);\n this.children_.unshift(tag);\n\n // Set lang attr on player to ensure CSS :lang() in consistent with player\n // if it's been set to something different to the doc\n this.el_.setAttribute('lang', this.language_);\n this.el_.setAttribute('translate', 'no');\n this.el_ = el;\n return el;\n }\n\n /**\n * Get or set the `Player`'s crossOrigin option. For the HTML5 player, this\n * sets the `crossOrigin` property on the `<video>` tag to control the CORS\n * behavior.\n *\n * @see [Video Element Attributes]{@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#attr-crossorigin}\n *\n * @param {string|null} [value]\n * The value to set the `Player`'s crossOrigin to. If an argument is\n * given, must be one of `'anonymous'` or `'use-credentials'`, or 'null'.\n *\n * @return {string|null|undefined}\n * - The current crossOrigin value of the `Player` when getting.\n * - undefined when setting\n */\n crossOrigin(value) {\n // `null` can be set to unset a value\n if (typeof value === 'undefined') {\n return this.techGet_('crossOrigin');\n }\n if (value !== null && value !== 'anonymous' && value !== 'use-credentials') {\n log$1.warn(`crossOrigin must be null, \"anonymous\" or \"use-credentials\", given \"${value}\"`);\n return;\n }\n this.techCall_('setCrossOrigin', value);\n if (this.posterImage) {\n this.posterImage.crossOrigin(value);\n }\n return;\n }\n\n /**\n * A getter/setter for the `Player`'s width. Returns the player's configured value.\n * To get the current width use `currentWidth()`.\n *\n * @param {number|string} [value]\n * CSS value to set the `Player`'s width to.\n *\n * @return {number|undefined}\n * - The current width of the `Player` when getting.\n * - Nothing when setting\n */\n width(value) {\n return this.dimension('width', value);\n }\n\n /**\n * A getter/setter for the `Player`'s height. Returns the player's configured value.\n * To get the current height use `currentheight()`.\n *\n * @param {number|string} [value]\n * CSS value to set the `Player`'s height to.\n *\n * @return {number|undefined}\n * - The current height of the `Player` when getting.\n * - Nothing when setting\n */\n height(value) {\n return this.dimension('height', value);\n }\n\n /**\n * A getter/setter for the `Player`'s width & height.\n *\n * @param {string} dimension\n * This string can be:\n * - 'width'\n * - 'height'\n *\n * @param {number|string} [value]\n * Value for dimension specified in the first argument.\n *\n * @return {number}\n * The dimension arguments value when getting (width/height).\n */\n dimension(dimension, value) {\n const privDimension = dimension + '_';\n if (value === undefined) {\n return this[privDimension] || 0;\n }\n if (value === '' || value === 'auto') {\n // If an empty string is given, reset the dimension to be automatic\n this[privDimension] = undefined;\n this.updateStyleEl_();\n return;\n }\n const parsedVal = parseFloat(value);\n if (isNaN(parsedVal)) {\n log$1.error(`Improper value \"${value}\" supplied for for ${dimension}`);\n return;\n }\n this[privDimension] = parsedVal;\n this.updateStyleEl_();\n }\n\n /**\n * A getter/setter/toggler for the vjs-fluid `className` on the `Player`.\n *\n * Turning this on will turn off fill mode.\n *\n * @param {boolean} [bool]\n * - A value of true adds the class.\n * - A value of false removes the class.\n * - No value will be a getter.\n *\n * @return {boolean|undefined}\n * - The value of fluid when getting.\n * - `undefined` when setting.\n */\n fluid(bool) {\n if (bool === undefined) {\n return !!this.fluid_;\n }\n this.fluid_ = !!bool;\n if (isEvented(this)) {\n this.off(['playerreset', 'resize'], this.boundUpdateStyleEl_);\n }\n if (bool) {\n this.addClass('vjs-fluid');\n this.fill(false);\n addEventedCallback(this, () => {\n this.on(['playerreset', 'resize'], this.boundUpdateStyleEl_);\n });\n } else {\n this.removeClass('vjs-fluid');\n }\n this.updateStyleEl_();\n }\n\n /**\n * A getter/setter/toggler for the vjs-fill `className` on the `Player`.\n *\n * Turning this on will turn off fluid mode.\n *\n * @param {boolean} [bool]\n * - A value of true adds the class.\n * - A value of false removes the class.\n * - No value will be a getter.\n *\n * @return {boolean|undefined}\n * - The value of fluid when getting.\n * - `undefined` when setting.\n */\n fill(bool) {\n if (bool === undefined) {\n return !!this.fill_;\n }\n this.fill_ = !!bool;\n if (bool) {\n this.addClass('vjs-fill');\n this.fluid(false);\n } else {\n this.removeClass('vjs-fill');\n }\n }\n\n /**\n * Get/Set the aspect ratio\n *\n * @param {string} [ratio]\n * Aspect ratio for player\n *\n * @return {string|undefined}\n * returns the current aspect ratio when getting\n */\n\n /**\n * A getter/setter for the `Player`'s aspect ratio.\n *\n * @param {string} [ratio]\n * The value to set the `Player`'s aspect ratio to.\n *\n * @return {string|undefined}\n * - The current aspect ratio of the `Player` when getting.\n * - undefined when setting\n */\n aspectRatio(ratio) {\n if (ratio === undefined) {\n return this.aspectRatio_;\n }\n\n // Check for width:height format\n if (!/^\\d+\\:\\d+$/.test(ratio)) {\n throw new Error('Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.');\n }\n this.aspectRatio_ = ratio;\n\n // We're assuming if you set an aspect ratio you want fluid mode,\n // because in fixed mode you could calculate width and height yourself.\n this.fluid(true);\n this.updateStyleEl_();\n }\n\n /**\n * Update styles of the `Player` element (height, width and aspect ratio).\n *\n * @private\n * @listens Tech#loadedmetadata\n */\n updateStyleEl_() {\n if (window$1.VIDEOJS_NO_DYNAMIC_STYLE === true) {\n const width = typeof this.width_ === 'number' ? this.width_ : this.options_.width;\n const height = typeof this.height_ === 'number' ? this.height_ : this.options_.height;\n const techEl = this.tech_ && this.tech_.el();\n if (techEl) {\n if (width >= 0) {\n techEl.width = width;\n }\n if (height >= 0) {\n techEl.height = height;\n }\n }\n return;\n }\n let width;\n let height;\n let aspectRatio;\n let idClass;\n\n // The aspect ratio is either used directly or to calculate width and height.\n if (this.aspectRatio_ !== undefined && this.aspectRatio_ !== 'auto') {\n // Use any aspectRatio that's been specifically set\n aspectRatio = this.aspectRatio_;\n } else if (this.videoWidth() > 0) {\n // Otherwise try to get the aspect ratio from the video metadata\n aspectRatio = this.videoWidth() + ':' + this.videoHeight();\n } else {\n // Or use a default. The video element's is 2:1, but 16:9 is more common.\n aspectRatio = '16:9';\n }\n\n // Get the ratio as a decimal we can use to calculate dimensions\n const ratioParts = aspectRatio.split(':');\n const ratioMultiplier = ratioParts[1] / ratioParts[0];\n if (this.width_ !== undefined) {\n // Use any width that's been specifically set\n width = this.width_;\n } else if (this.height_ !== undefined) {\n // Or calculate the width from the aspect ratio if a height has been set\n width = this.height_ / ratioMultiplier;\n } else {\n // Or use the video's metadata, or use the video el's default of 300\n width = this.videoWidth() || 300;\n }\n if (this.height_ !== undefined) {\n // Use any height that's been specifically set\n height = this.height_;\n } else {\n // Otherwise calculate the height from the ratio and the width\n height = width * ratioMultiplier;\n }\n\n // Ensure the CSS class is valid by starting with an alpha character\n if (/^[^a-zA-Z]/.test(this.id())) {\n idClass = 'dimensions-' + this.id();\n } else {\n idClass = this.id() + '-dimensions';\n }\n\n // Ensure the right class is still on the player for the style element\n this.addClass(idClass);\n setTextContent(this.styleEl_, `\n .${idClass} {\n width: ${width}px;\n height: ${height}px;\n }\n\n .${idClass}.vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: ${ratioMultiplier * 100}%;\n }\n `);\n }\n\n /**\n * Load/Create an instance of playback {@link Tech} including element\n * and API methods. Then append the `Tech` element in `Player` as a child.\n *\n * @param {string} techName\n * name of the playback technology\n *\n * @param {string} source\n * video source\n *\n * @private\n */\n loadTech_(techName, source) {\n // Pause and remove current playback technology\n if (this.tech_) {\n this.unloadTech_();\n }\n const titleTechName = toTitleCase$1(techName);\n const camelTechName = techName.charAt(0).toLowerCase() + techName.slice(1);\n\n // get rid of the HTML5 video tag as soon as we are using another tech\n if (titleTechName !== 'Html5' && this.tag) {\n Tech.getTech('Html5').disposeMediaElement(this.tag);\n this.tag.player = null;\n this.tag = null;\n }\n this.techName_ = titleTechName;\n\n // Turn off API access because we're loading a new tech that might load asynchronously\n this.isReady_ = false;\n let autoplay = this.autoplay();\n\n // if autoplay is a string (or `true` with normalizeAutoplay: true) we pass false to the tech\n // because the player is going to handle autoplay on `loadstart`\n if (typeof this.autoplay() === 'string' || this.autoplay() === true && this.options_.normalizeAutoplay) {\n autoplay = false;\n }\n\n // Grab tech-specific options from player options and add source and parent element to use.\n const techOptions = {\n source,\n autoplay,\n 'nativeControlsForTouch': this.options_.nativeControlsForTouch,\n 'playerId': this.id(),\n 'techId': `${this.id()}_${camelTechName}_api`,\n 'playsinline': this.options_.playsinline,\n 'preload': this.options_.preload,\n 'loop': this.options_.loop,\n 'disablePictureInPicture': this.options_.disablePictureInPicture,\n 'muted': this.options_.muted,\n 'poster': this.poster(),\n 'language': this.language(),\n 'playerElIngest': this.playerElIngest_ || false,\n 'vtt.js': this.options_['vtt.js'],\n 'canOverridePoster': !!this.options_.techCanOverridePoster,\n 'enableSourceset': this.options_.enableSourceset\n };\n ALL.names.forEach(name => {\n const props = ALL[name];\n techOptions[props.getterName] = this[props.privateName];\n });\n Object.assign(techOptions, this.options_[titleTechName]);\n Object.assign(techOptions, this.options_[camelTechName]);\n Object.assign(techOptions, this.options_[techName.toLowerCase()]);\n if (this.tag) {\n techOptions.tag = this.tag;\n }\n if (source && source.src === this.cache_.src && this.cache_.currentTime > 0) {\n techOptions.startTime = this.cache_.currentTime;\n }\n\n // Initialize tech instance\n const TechClass = Tech.getTech(techName);\n if (!TechClass) {\n throw new Error(`No Tech named '${titleTechName}' exists! '${titleTechName}' should be registered using videojs.registerTech()'`);\n }\n this.tech_ = new TechClass(techOptions);\n\n // player.triggerReady is always async, so don't need this to be async\n this.tech_.ready(bind_(this, this.handleTechReady_), true);\n textTrackConverter.jsonToTextTracks(this.textTracksJson_ || [], this.tech_);\n\n // Listen to all HTML5-defined events and trigger them on the player\n TECH_EVENTS_RETRIGGER.forEach(event => {\n this.on(this.tech_, event, e => this[`handleTech${toTitleCase$1(event)}_`](e));\n });\n Object.keys(TECH_EVENTS_QUEUE).forEach(event => {\n this.on(this.tech_, event, eventObj => {\n if (this.tech_.playbackRate() === 0 && this.tech_.seeking()) {\n this.queuedCallbacks_.push({\n callback: this[`handleTech${TECH_EVENTS_QUEUE[event]}_`].bind(this),\n event: eventObj\n });\n return;\n }\n this[`handleTech${TECH_EVENTS_QUEUE[event]}_`](eventObj);\n });\n });\n this.on(this.tech_, 'loadstart', e => this.handleTechLoadStart_(e));\n this.on(this.tech_, 'sourceset', e => this.handleTechSourceset_(e));\n this.on(this.tech_, 'waiting', e => this.handleTechWaiting_(e));\n this.on(this.tech_, 'ended', e => this.handleTechEnded_(e));\n this.on(this.tech_, 'seeking', e => this.handleTechSeeking_(e));\n this.on(this.tech_, 'play', e => this.handleTechPlay_(e));\n this.on(this.tech_, 'pause', e => this.handleTechPause_(e));\n this.on(this.tech_, 'durationchange', e => this.handleTechDurationChange_(e));\n this.on(this.tech_, 'fullscreenchange', (e, data) => this.handleTechFullscreenChange_(e, data));\n this.on(this.tech_, 'fullscreenerror', (e, err) => this.handleTechFullscreenError_(e, err));\n this.on(this.tech_, 'enterpictureinpicture', e => this.handleTechEnterPictureInPicture_(e));\n this.on(this.tech_, 'leavepictureinpicture', e => this.handleTechLeavePictureInPicture_(e));\n this.on(this.tech_, 'error', e => this.handleTechError_(e));\n this.on(this.tech_, 'posterchange', e => this.handleTechPosterChange_(e));\n this.on(this.tech_, 'textdata', e => this.handleTechTextData_(e));\n this.on(this.tech_, 'ratechange', e => this.handleTechRateChange_(e));\n this.on(this.tech_, 'loadedmetadata', this.boundUpdateStyleEl_);\n this.usingNativeControls(this.techGet_('controls'));\n if (this.controls() && !this.usingNativeControls()) {\n this.addTechControlsListeners_();\n }\n\n // Add the tech element in the DOM if it was not already there\n // Make sure to not insert the original video element if using Html5\n if (this.tech_.el().parentNode !== this.el() && (titleTechName !== 'Html5' || !this.tag)) {\n prependTo(this.tech_.el(), this.el());\n }\n\n // Get rid of the original video tag reference after the first tech is loaded\n if (this.tag) {\n this.tag.player = null;\n this.tag = null;\n }\n }\n\n /**\n * Unload and dispose of the current playback {@link Tech}.\n *\n * @private\n */\n unloadTech_() {\n // Save the current text tracks so that we can reuse the same text tracks with the next tech\n ALL.names.forEach(name => {\n const props = ALL[name];\n this[props.privateName] = this[props.getterName]();\n });\n this.textTracksJson_ = textTrackConverter.textTracksToJson(this.tech_);\n this.isReady_ = false;\n this.tech_.dispose();\n this.tech_ = false;\n if (this.isPosterFromTech_) {\n this.poster_ = '';\n this.trigger('posterchange');\n }\n this.isPosterFromTech_ = false;\n }\n\n /**\n * Return a reference to the current {@link Tech}.\n * It will print a warning by default about the danger of using the tech directly\n * but any argument that is passed in will silence the warning.\n *\n * @param {*} [safety]\n * Anything passed in to silence the warning\n *\n * @return {Tech}\n * The Tech\n */\n tech(safety) {\n if (safety === undefined) {\n log$1.warn('Using the tech directly can be dangerous. I hope you know what you\\'re doing.\\n' + 'See https://github.com/videojs/video.js/issues/2617 for more info.\\n');\n }\n return this.tech_;\n }\n\n /**\n * Set up click and touch listeners for the playback element\n *\n * - On desktops: a click on the video itself will toggle playback\n * - On mobile devices: a click on the video toggles controls\n * which is done by toggling the user state between active and\n * inactive\n * - A tap can signal that a user has become active or has become inactive\n * e.g. a quick tap on an iPhone movie should reveal the controls. Another\n * quick tap should hide them again (signaling the user is in an inactive\n * viewing state)\n * - In addition to this, we still want the user to be considered inactive after\n * a few seconds of inactivity.\n *\n * > Note: the only part of iOS interaction we can't mimic with this setup\n * is a touch and hold on the video element counting as activity in order to\n * keep the controls showing, but that shouldn't be an issue. A touch and hold\n * on any controls will still keep the user active\n *\n * @private\n */\n addTechControlsListeners_() {\n // Make sure to remove all the previous listeners in case we are called multiple times.\n this.removeTechControlsListeners_();\n this.on(this.tech_, 'click', this.boundHandleTechClick_);\n this.on(this.tech_, 'dblclick', this.boundHandleTechDoubleClick_);\n\n // If the controls were hidden we don't want that to change without a tap event\n // so we'll check if the controls were already showing before reporting user\n // activity\n this.on(this.tech_, 'touchstart', this.boundHandleTechTouchStart_);\n this.on(this.tech_, 'touchmove', this.boundHandleTechTouchMove_);\n this.on(this.tech_, 'touchend', this.boundHandleTechTouchEnd_);\n\n // The tap listener needs to come after the touchend listener because the tap\n // listener cancels out any reportedUserActivity when setting userActive(false)\n this.on(this.tech_, 'tap', this.boundHandleTechTap_);\n }\n\n /**\n * Remove the listeners used for click and tap controls. This is needed for\n * toggling to controls disabled, where a tap/touch should do nothing.\n *\n * @private\n */\n removeTechControlsListeners_() {\n // We don't want to just use `this.off()` because there might be other needed\n // listeners added by techs that extend this.\n this.off(this.tech_, 'tap', this.boundHandleTechTap_);\n this.off(this.tech_, 'touchstart', this.boundHandleTechTouchStart_);\n this.off(this.tech_, 'touchmove', this.boundHandleTechTouchMove_);\n this.off(this.tech_, 'touchend', this.boundHandleTechTouchEnd_);\n this.off(this.tech_, 'click', this.boundHandleTechClick_);\n this.off(this.tech_, 'dblclick', this.boundHandleTechDoubleClick_);\n }\n\n /**\n * Player waits for the tech to be ready\n *\n * @private\n */\n handleTechReady_() {\n this.triggerReady();\n\n // Keep the same volume as before\n if (this.cache_.volume) {\n this.techCall_('setVolume', this.cache_.volume);\n }\n\n // Look if the tech found a higher resolution poster while loading\n this.handleTechPosterChange_();\n\n // Update the duration if available\n this.handleTechDurationChange_();\n }\n\n /**\n * Retrigger the `loadstart` event that was triggered by the {@link Tech}.\n *\n * @fires Player#loadstart\n * @listens Tech#loadstart\n * @private\n */\n handleTechLoadStart_() {\n // TODO: Update to use `emptied` event instead. See #1277.\n\n this.removeClass('vjs-ended', 'vjs-seeking');\n\n // reset the error state\n this.error(null);\n\n // Update the duration\n this.handleTechDurationChange_();\n if (!this.paused()) {\n /**\n * Fired when the user agent begins looking for media data\n *\n * @event Player#loadstart\n * @type {Event}\n */\n this.trigger('loadstart');\n } else {\n // reset the hasStarted state\n this.hasStarted(false);\n this.trigger('loadstart');\n }\n\n // autoplay happens after loadstart for the browser,\n // so we mimic that behavior\n this.manualAutoplay_(this.autoplay() === true && this.options_.normalizeAutoplay ? 'play' : this.autoplay());\n }\n\n /**\n * Handle autoplay string values, rather than the typical boolean\n * values that should be handled by the tech. Note that this is not\n * part of any specification. Valid values and what they do can be\n * found on the autoplay getter at Player#autoplay()\n */\n manualAutoplay_(type) {\n if (!this.tech_ || typeof type !== 'string') {\n return;\n }\n\n // Save original muted() value, set muted to true, and attempt to play().\n // On promise rejection, restore muted from saved value\n const resolveMuted = () => {\n const previouslyMuted = this.muted();\n this.muted(true);\n const restoreMuted = () => {\n this.muted(previouslyMuted);\n };\n\n // restore muted on play terminatation\n this.playTerminatedQueue_.push(restoreMuted);\n const mutedPromise = this.play();\n if (!isPromise(mutedPromise)) {\n return;\n }\n return mutedPromise.catch(err => {\n restoreMuted();\n throw new Error(`Rejection at manualAutoplay. Restoring muted value. ${err ? err : ''}`);\n });\n };\n let promise;\n\n // if muted defaults to true\n // the only thing we can do is call play\n if (type === 'any' && !this.muted()) {\n promise = this.play();\n if (isPromise(promise)) {\n promise = promise.catch(resolveMuted);\n }\n } else if (type === 'muted' && !this.muted()) {\n promise = resolveMuted();\n } else {\n promise = this.play();\n }\n if (!isPromise(promise)) {\n return;\n }\n return promise.then(() => {\n this.trigger({\n type: 'autoplay-success',\n autoplay: type\n });\n }).catch(() => {\n this.trigger({\n type: 'autoplay-failure',\n autoplay: type\n });\n });\n }\n\n /**\n * Update the internal source caches so that we return the correct source from\n * `src()`, `currentSource()`, and `currentSources()`.\n *\n * > Note: `currentSources` will not be updated if the source that is passed in exists\n * in the current `currentSources` cache.\n *\n *\n * @param {Tech~SourceObject} srcObj\n * A string or object source to update our caches to.\n */\n updateSourceCaches_(srcObj = '') {\n let src = srcObj;\n let type = '';\n if (typeof src !== 'string') {\n src = srcObj.src;\n type = srcObj.type;\n }\n\n // make sure all the caches are set to default values\n // to prevent null checking\n this.cache_.source = this.cache_.source || {};\n this.cache_.sources = this.cache_.sources || [];\n\n // try to get the type of the src that was passed in\n if (src && !type) {\n type = findMimetype(this, src);\n }\n\n // update `currentSource` cache always\n this.cache_.source = merge$1({}, srcObj, {\n src,\n type\n });\n const matchingSources = this.cache_.sources.filter(s => s.src && s.src === src);\n const sourceElSources = [];\n const sourceEls = this.$$('source');\n const matchingSourceEls = [];\n for (let i = 0; i < sourceEls.length; i++) {\n const sourceObj = getAttributes(sourceEls[i]);\n sourceElSources.push(sourceObj);\n if (sourceObj.src && sourceObj.src === src) {\n matchingSourceEls.push(sourceObj.src);\n }\n }\n\n // if we have matching source els but not matching sources\n // the current source cache is not up to date\n if (matchingSourceEls.length && !matchingSources.length) {\n this.cache_.sources = sourceElSources;\n // if we don't have matching source or source els set the\n // sources cache to the `currentSource` cache\n } else if (!matchingSources.length) {\n this.cache_.sources = [this.cache_.source];\n }\n\n // update the tech `src` cache\n this.cache_.src = src;\n }\n\n /**\n * *EXPERIMENTAL* Fired when the source is set or changed on the {@link Tech}\n * causing the media element to reload.\n *\n * It will fire for the initial source and each subsequent source.\n * This event is a custom event from Video.js and is triggered by the {@link Tech}.\n *\n * The event object for this event contains a `src` property that will contain the source\n * that was available when the event was triggered. This is generally only necessary if Video.js\n * is switching techs while the source was being changed.\n *\n * It is also fired when `load` is called on the player (or media element)\n * because the {@link https://html.spec.whatwg.org/multipage/media.html#dom-media-load|specification for `load`}\n * says that the resource selection algorithm needs to be aborted and restarted.\n * In this case, it is very likely that the `src` property will be set to the\n * empty string `\"\"` to indicate we do not know what the source will be but\n * that it is changing.\n *\n * *This event is currently still experimental and may change in minor releases.*\n * __To use this, pass `enableSourceset` option to the player.__\n *\n * @event Player#sourceset\n * @type {Event}\n * @prop {string} src\n * The source url available when the `sourceset` was triggered.\n * It will be an empty string if we cannot know what the source is\n * but know that the source will change.\n */\n /**\n * Retrigger the `sourceset` event that was triggered by the {@link Tech}.\n *\n * @fires Player#sourceset\n * @listens Tech#sourceset\n * @private\n */\n handleTechSourceset_(event) {\n // only update the source cache when the source\n // was not updated using the player api\n if (!this.changingSrc_) {\n let updateSourceCaches = src => this.updateSourceCaches_(src);\n const playerSrc = this.currentSource().src;\n const eventSrc = event.src;\n\n // if we have a playerSrc that is not a blob, and a tech src that is a blob\n if (playerSrc && !/^blob:/.test(playerSrc) && /^blob:/.test(eventSrc)) {\n // if both the tech source and the player source were updated we assume\n // something like @videojs/http-streaming did the sourceset and skip updating the source cache.\n if (!this.lastSource_ || this.lastSource_.tech !== eventSrc && this.lastSource_.player !== playerSrc) {\n updateSourceCaches = () => {};\n }\n }\n\n // update the source to the initial source right away\n // in some cases this will be empty string\n updateSourceCaches(eventSrc);\n\n // if the `sourceset` `src` was an empty string\n // wait for a `loadstart` to update the cache to `currentSrc`.\n // If a sourceset happens before a `loadstart`, we reset the state\n if (!event.src) {\n this.tech_.any(['sourceset', 'loadstart'], e => {\n // if a sourceset happens before a `loadstart` there\n // is nothing to do as this `handleTechSourceset_`\n // will be called again and this will be handled there.\n if (e.type === 'sourceset') {\n return;\n }\n const techSrc = this.techGet_('currentSrc');\n this.lastSource_.tech = techSrc;\n this.updateSourceCaches_(techSrc);\n });\n }\n }\n this.lastSource_ = {\n player: this.currentSource().src,\n tech: event.src\n };\n this.trigger({\n src: event.src,\n type: 'sourceset'\n });\n }\n\n /**\n * Add/remove the vjs-has-started class\n *\n *\n * @param {boolean} request\n * - true: adds the class\n * - false: remove the class\n *\n * @return {boolean}\n * the boolean value of hasStarted_\n */\n hasStarted(request) {\n if (request === undefined) {\n // act as getter, if we have no request to change\n return this.hasStarted_;\n }\n if (request === this.hasStarted_) {\n return;\n }\n this.hasStarted_ = request;\n if (this.hasStarted_) {\n this.addClass('vjs-has-started');\n } else {\n this.removeClass('vjs-has-started');\n }\n }\n\n /**\n * Fired whenever the media begins or resumes playback\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-play}\n * @fires Player#play\n * @listens Tech#play\n * @private\n */\n handleTechPlay_() {\n this.removeClass('vjs-ended', 'vjs-paused');\n this.addClass('vjs-playing');\n\n // hide the poster when the user hits play\n this.hasStarted(true);\n /**\n * Triggered whenever an {@link Tech#play} event happens. Indicates that\n * playback has started or resumed.\n *\n * @event Player#play\n * @type {Event}\n */\n this.trigger('play');\n }\n\n /**\n * Retrigger the `ratechange` event that was triggered by the {@link Tech}.\n *\n * If there were any events queued while the playback rate was zero, fire\n * those events now.\n *\n * @private\n * @method Player#handleTechRateChange_\n * @fires Player#ratechange\n * @listens Tech#ratechange\n */\n handleTechRateChange_() {\n if (this.tech_.playbackRate() > 0 && this.cache_.lastPlaybackRate === 0) {\n this.queuedCallbacks_.forEach(queued => queued.callback(queued.event));\n this.queuedCallbacks_ = [];\n }\n this.cache_.lastPlaybackRate = this.tech_.playbackRate();\n /**\n * Fires when the playing speed of the audio/video is changed\n *\n * @event Player#ratechange\n * @type {event}\n */\n this.trigger('ratechange');\n }\n\n /**\n * Retrigger the `waiting` event that was triggered by the {@link Tech}.\n *\n * @fires Player#waiting\n * @listens Tech#waiting\n * @private\n */\n handleTechWaiting_() {\n this.addClass('vjs-waiting');\n /**\n * A readyState change on the DOM element has caused playback to stop.\n *\n * @event Player#waiting\n * @type {Event}\n */\n this.trigger('waiting');\n\n // Browsers may emit a timeupdate event after a waiting event. In order to prevent\n // premature removal of the waiting class, wait for the time to change.\n const timeWhenWaiting = this.currentTime();\n const timeUpdateListener = () => {\n if (timeWhenWaiting !== this.currentTime()) {\n this.removeClass('vjs-waiting');\n this.off('timeupdate', timeUpdateListener);\n }\n };\n this.on('timeupdate', timeUpdateListener);\n }\n\n /**\n * Retrigger the `canplay` event that was triggered by the {@link Tech}.\n * > Note: This is not consistent between browsers. See #1351\n *\n * @fires Player#canplay\n * @listens Tech#canplay\n * @private\n */\n handleTechCanPlay_() {\n this.removeClass('vjs-waiting');\n /**\n * The media has a readyState of HAVE_FUTURE_DATA or greater.\n *\n * @event Player#canplay\n * @type {Event}\n */\n this.trigger('canplay');\n }\n\n /**\n * Retrigger the `canplaythrough` event that was triggered by the {@link Tech}.\n *\n * @fires Player#canplaythrough\n * @listens Tech#canplaythrough\n * @private\n */\n handleTechCanPlayThrough_() {\n this.removeClass('vjs-waiting');\n /**\n * The media has a readyState of HAVE_ENOUGH_DATA or greater. This means that the\n * entire media file can be played without buffering.\n *\n * @event Player#canplaythrough\n * @type {Event}\n */\n this.trigger('canplaythrough');\n }\n\n /**\n * Retrigger the `playing` event that was triggered by the {@link Tech}.\n *\n * @fires Player#playing\n * @listens Tech#playing\n * @private\n */\n handleTechPlaying_() {\n this.removeClass('vjs-waiting');\n /**\n * The media is no longer blocked from playback, and has started playing.\n *\n * @event Player#playing\n * @type {Event}\n */\n this.trigger('playing');\n }\n\n /**\n * Retrigger the `seeking` event that was triggered by the {@link Tech}.\n *\n * @fires Player#seeking\n * @listens Tech#seeking\n * @private\n */\n handleTechSeeking_() {\n this.addClass('vjs-seeking');\n /**\n * Fired whenever the player is jumping to a new time\n *\n * @event Player#seeking\n * @type {Event}\n */\n this.trigger('seeking');\n }\n\n /**\n * Retrigger the `seeked` event that was triggered by the {@link Tech}.\n *\n * @fires Player#seeked\n * @listens Tech#seeked\n * @private\n */\n handleTechSeeked_() {\n this.removeClass('vjs-seeking', 'vjs-ended');\n /**\n * Fired when the player has finished jumping to a new time\n *\n * @event Player#seeked\n * @type {Event}\n */\n this.trigger('seeked');\n }\n\n /**\n * Retrigger the `pause` event that was triggered by the {@link Tech}.\n *\n * @fires Player#pause\n * @listens Tech#pause\n * @private\n */\n handleTechPause_() {\n this.removeClass('vjs-playing');\n this.addClass('vjs-paused');\n /**\n * Fired whenever the media has been paused\n *\n * @event Player#pause\n * @type {Event}\n */\n this.trigger('pause');\n }\n\n /**\n * Retrigger the `ended` event that was triggered by the {@link Tech}.\n *\n * @fires Player#ended\n * @listens Tech#ended\n * @private\n */\n handleTechEnded_() {\n this.addClass('vjs-ended');\n this.removeClass('vjs-waiting');\n if (this.options_.loop) {\n this.currentTime(0);\n this.play();\n } else if (!this.paused()) {\n this.pause();\n }\n\n /**\n * Fired when the end of the media resource is reached (currentTime == duration)\n *\n * @event Player#ended\n * @type {Event}\n */\n this.trigger('ended');\n }\n\n /**\n * Fired when the duration of the media resource is first known or changed\n *\n * @listens Tech#durationchange\n * @private\n */\n handleTechDurationChange_() {\n this.duration(this.techGet_('duration'));\n }\n\n /**\n * Handle a click on the media element to play/pause\n *\n * @param {Event} event\n * the event that caused this function to trigger\n *\n * @listens Tech#click\n * @private\n */\n handleTechClick_(event) {\n // When controls are disabled a click should not toggle playback because\n // the click is considered a control\n if (!this.controls_) {\n return;\n }\n if (this.options_ === undefined || this.options_.userActions === undefined || this.options_.userActions.click === undefined || this.options_.userActions.click !== false) {\n if (this.options_ !== undefined && this.options_.userActions !== undefined && typeof this.options_.userActions.click === 'function') {\n this.options_.userActions.click.call(this, event);\n } else if (this.paused()) {\n silencePromise(this.play());\n } else {\n this.pause();\n }\n }\n }\n\n /**\n * Handle a double-click on the media element to enter/exit fullscreen\n *\n * @param {Event} event\n * the event that caused this function to trigger\n *\n * @listens Tech#dblclick\n * @private\n */\n handleTechDoubleClick_(event) {\n if (!this.controls_) {\n return;\n }\n\n // we do not want to toggle fullscreen state\n // when double-clicking inside a control bar or a modal\n const inAllowedEls = Array.prototype.some.call(this.$$('.vjs-control-bar, .vjs-modal-dialog'), el => el.contains(event.target));\n if (!inAllowedEls) {\n /*\n * options.userActions.doubleClick\n *\n * If `undefined` or `true`, double-click toggles fullscreen if controls are present\n * Set to `false` to disable double-click handling\n * Set to a function to substitute an external double-click handler\n */\n if (this.options_ === undefined || this.options_.userActions === undefined || this.options_.userActions.doubleClick === undefined || this.options_.userActions.doubleClick !== false) {\n if (this.options_ !== undefined && this.options_.userActions !== undefined && typeof this.options_.userActions.doubleClick === 'function') {\n this.options_.userActions.doubleClick.call(this, event);\n } else if (this.isFullscreen()) {\n this.exitFullscreen();\n } else {\n this.requestFullscreen();\n }\n }\n }\n }\n\n /**\n * Handle a tap on the media element. It will toggle the user\n * activity state, which hides and shows the controls.\n *\n * @listens Tech#tap\n * @private\n */\n handleTechTap_() {\n this.userActive(!this.userActive());\n }\n\n /**\n * Handle touch to start\n *\n * @listens Tech#touchstart\n * @private\n */\n handleTechTouchStart_() {\n this.userWasActive = this.userActive();\n }\n\n /**\n * Handle touch to move\n *\n * @listens Tech#touchmove\n * @private\n */\n handleTechTouchMove_() {\n if (this.userWasActive) {\n this.reportUserActivity();\n }\n }\n\n /**\n * Handle touch to end\n *\n * @param {Event} event\n * the touchend event that triggered\n * this function\n *\n * @listens Tech#touchend\n * @private\n */\n handleTechTouchEnd_(event) {\n // Stop the mouse events from also happening\n if (event.cancelable) {\n event.preventDefault();\n }\n }\n\n /**\n * @private\n */\n toggleFullscreenClass_() {\n if (this.isFullscreen()) {\n this.addClass('vjs-fullscreen');\n } else {\n this.removeClass('vjs-fullscreen');\n }\n }\n\n /**\n * when the document fschange event triggers it calls this\n */\n documentFullscreenChange_(e) {\n const targetPlayer = e.target.player;\n\n // if another player was fullscreen\n // do a null check for targetPlayer because older firefox's would put document as e.target\n if (targetPlayer && targetPlayer !== this) {\n return;\n }\n const el = this.el();\n let isFs = document[this.fsApi_.fullscreenElement] === el;\n if (!isFs && el.matches) {\n isFs = el.matches(':' + this.fsApi_.fullscreen);\n }\n this.isFullscreen(isFs);\n }\n\n /**\n * Handle Tech Fullscreen Change\n *\n * @param {Event} event\n * the fullscreenchange event that triggered this function\n *\n * @param {Object} data\n * the data that was sent with the event\n *\n * @private\n * @listens Tech#fullscreenchange\n * @fires Player#fullscreenchange\n */\n handleTechFullscreenChange_(event, data) {\n if (data) {\n if (data.nativeIOSFullscreen) {\n this.addClass('vjs-ios-native-fs');\n this.tech_.one('webkitendfullscreen', () => {\n this.removeClass('vjs-ios-native-fs');\n });\n }\n this.isFullscreen(data.isFullscreen);\n }\n }\n handleTechFullscreenError_(event, err) {\n this.trigger('fullscreenerror', err);\n }\n\n /**\n * @private\n */\n togglePictureInPictureClass_() {\n if (this.isInPictureInPicture()) {\n this.addClass('vjs-picture-in-picture');\n } else {\n this.removeClass('vjs-picture-in-picture');\n }\n }\n\n /**\n * Handle Tech Enter Picture-in-Picture.\n *\n * @param {Event} event\n * the enterpictureinpicture event that triggered this function\n *\n * @private\n * @listens Tech#enterpictureinpicture\n */\n handleTechEnterPictureInPicture_(event) {\n this.isInPictureInPicture(true);\n }\n\n /**\n * Handle Tech Leave Picture-in-Picture.\n *\n * @param {Event} event\n * the leavepictureinpicture event that triggered this function\n *\n * @private\n * @listens Tech#leavepictureinpicture\n */\n handleTechLeavePictureInPicture_(event) {\n this.isInPictureInPicture(false);\n }\n\n /**\n * Fires when an error occurred during the loading of an audio/video.\n *\n * @private\n * @listens Tech#error\n */\n handleTechError_() {\n const error = this.tech_.error();\n if (error) {\n this.error(error);\n }\n }\n\n /**\n * Retrigger the `textdata` event that was triggered by the {@link Tech}.\n *\n * @fires Player#textdata\n * @listens Tech#textdata\n * @private\n */\n handleTechTextData_() {\n let data = null;\n if (arguments.length > 1) {\n data = arguments[1];\n }\n\n /**\n * Fires when we get a textdata event from tech\n *\n * @event Player#textdata\n * @type {Event}\n */\n this.trigger('textdata', data);\n }\n\n /**\n * Get object for cached values.\n *\n * @return {Object}\n * get the current object cache\n */\n getCache() {\n return this.cache_;\n }\n\n /**\n * Resets the internal cache object.\n *\n * Using this function outside the player constructor or reset method may\n * have unintended side-effects.\n *\n * @private\n */\n resetCache_() {\n this.cache_ = {\n // Right now, the currentTime is not _really_ cached because it is always\n // retrieved from the tech (see: currentTime). However, for completeness,\n // we set it to zero here to ensure that if we do start actually caching\n // it, we reset it along with everything else.\n currentTime: 0,\n initTime: 0,\n inactivityTimeout: this.options_.inactivityTimeout,\n duration: NaN,\n lastVolume: 1,\n lastPlaybackRate: this.defaultPlaybackRate(),\n media: null,\n src: '',\n source: {},\n sources: [],\n playbackRates: [],\n volume: 1\n };\n }\n\n /**\n * Pass values to the playback tech\n *\n * @param {string} [method]\n * the method to call\n *\n * @param {Object} [arg]\n * the argument to pass\n *\n * @private\n */\n techCall_(method, arg) {\n // If it's not ready yet, call method when it is\n\n this.ready(function () {\n if (method in allowedSetters) {\n return set(this.middleware_, this.tech_, method, arg);\n } else if (method in allowedMediators) {\n return mediate(this.middleware_, this.tech_, method, arg);\n }\n try {\n if (this.tech_) {\n this.tech_[method](arg);\n }\n } catch (e) {\n log$1(e);\n throw e;\n }\n }, true);\n }\n\n /**\n * Mediate attempt to call playback tech method\n * and return the value of the method called.\n *\n * @param {string} method\n * Tech method\n *\n * @return {*}\n * Value returned by the tech method called, undefined if tech\n * is not ready or tech method is not present\n *\n * @private\n */\n techGet_(method) {\n if (!this.tech_ || !this.tech_.isReady_) {\n return;\n }\n if (method in allowedGetters) {\n return get(this.middleware_, this.tech_, method);\n } else if (method in allowedMediators) {\n return mediate(this.middleware_, this.tech_, method);\n }\n\n // Log error when playback tech object is present but method\n // is undefined or unavailable\n try {\n return this.tech_[method]();\n } catch (e) {\n // When building additional tech libs, an expected method may not be defined yet\n if (this.tech_[method] === undefined) {\n log$1(`Video.js: ${method} method not defined for ${this.techName_} playback technology.`, e);\n throw e;\n }\n\n // When a method isn't available on the object it throws a TypeError\n if (e.name === 'TypeError') {\n log$1(`Video.js: ${method} unavailable on ${this.techName_} playback technology element.`, e);\n this.tech_.isReady_ = false;\n throw e;\n }\n\n // If error unknown, just log and throw\n log$1(e);\n throw e;\n }\n }\n\n /**\n * Attempt to begin playback at the first opportunity.\n *\n * @return {Promise|undefined}\n * Returns a promise if the browser supports Promises (or one\n * was passed in as an option). This promise will be resolved on\n * the return value of play. If this is undefined it will fulfill the\n * promise chain otherwise the promise chain will be fulfilled when\n * the promise from play is fulfilled.\n */\n play() {\n return new Promise(resolve => {\n this.play_(resolve);\n });\n }\n\n /**\n * The actual logic for play, takes a callback that will be resolved on the\n * return value of play. This allows us to resolve to the play promise if there\n * is one on modern browsers.\n *\n * @private\n * @param {Function} [callback]\n * The callback that should be called when the techs play is actually called\n */\n play_(callback = silencePromise) {\n this.playCallbacks_.push(callback);\n const isSrcReady = Boolean(!this.changingSrc_ && (this.src() || this.currentSrc()));\n const isSafariOrIOS = Boolean(IS_ANY_SAFARI || IS_IOS);\n\n // treat calls to play_ somewhat like the `one` event function\n if (this.waitToPlay_) {\n this.off(['ready', 'loadstart'], this.waitToPlay_);\n this.waitToPlay_ = null;\n }\n\n // if the player/tech is not ready or the src itself is not ready\n // queue up a call to play on `ready` or `loadstart`\n if (!this.isReady_ || !isSrcReady) {\n this.waitToPlay_ = e => {\n this.play_();\n };\n this.one(['ready', 'loadstart'], this.waitToPlay_);\n\n // if we are in Safari, there is a high chance that loadstart will trigger after the gesture timeperiod\n // in that case, we need to prime the video element by calling load so it'll be ready in time\n if (!isSrcReady && isSafariOrIOS) {\n this.load();\n }\n return;\n }\n\n // If the player/tech is ready and we have a source, we can attempt playback.\n const val = this.techGet_('play');\n\n // For native playback, reset the progress bar if we get a play call from a replay.\n const isNativeReplay = isSafariOrIOS && this.hasClass('vjs-ended');\n if (isNativeReplay) {\n this.resetProgressBar_();\n }\n // play was terminated if the returned value is null\n if (val === null) {\n this.runPlayTerminatedQueue_();\n } else {\n this.runPlayCallbacks_(val);\n }\n }\n\n /**\n * These functions will be run when if play is terminated. If play\n * runPlayCallbacks_ is run these function will not be run. This allows us\n * to differentiate between a terminated play and an actual call to play.\n */\n runPlayTerminatedQueue_() {\n const queue = this.playTerminatedQueue_.slice(0);\n this.playTerminatedQueue_ = [];\n queue.forEach(function (q) {\n q();\n });\n }\n\n /**\n * When a callback to play is delayed we have to run these\n * callbacks when play is actually called on the tech. This function\n * runs the callbacks that were delayed and accepts the return value\n * from the tech.\n *\n * @param {undefined|Promise} val\n * The return value from the tech.\n */\n runPlayCallbacks_(val) {\n const callbacks = this.playCallbacks_.slice(0);\n this.playCallbacks_ = [];\n // clear play terminatedQueue since we finished a real play\n this.playTerminatedQueue_ = [];\n callbacks.forEach(function (cb) {\n cb(val);\n });\n }\n\n /**\n * Pause the video playback\n */\n pause() {\n this.techCall_('pause');\n }\n\n /**\n * Check if the player is paused or has yet to play\n *\n * @return {boolean}\n * - false: if the media is currently playing\n * - true: if media is not currently playing\n */\n paused() {\n // The initial state of paused should be true (in Safari it's actually false)\n return this.techGet_('paused') === false ? false : true;\n }\n\n /**\n * Get a TimeRange object representing the current ranges of time that the user\n * has played.\n *\n * @return { import('./utils/time').TimeRange }\n * A time range object that represents all the increments of time that have\n * been played.\n */\n played() {\n return this.techGet_('played') || createTimeRanges$1(0, 0);\n }\n\n /**\n * Sets or returns whether or not the user is \"scrubbing\". Scrubbing is\n * when the user has clicked the progress bar handle and is\n * dragging it along the progress bar.\n *\n * @param {boolean} [isScrubbing]\n * whether the user is or is not scrubbing\n *\n * @return {boolean|undefined}\n * - The value of scrubbing when getting\n * - Nothing when setting\n */\n scrubbing(isScrubbing) {\n if (typeof isScrubbing === 'undefined') {\n return this.scrubbing_;\n }\n this.scrubbing_ = !!isScrubbing;\n this.techCall_('setScrubbing', this.scrubbing_);\n if (isScrubbing) {\n this.addClass('vjs-scrubbing');\n } else {\n this.removeClass('vjs-scrubbing');\n }\n }\n\n /**\n * Get or set the current time (in seconds)\n *\n * @param {number|string} [seconds]\n * The time to seek to in seconds\n *\n * @return {number|undefined}\n * - the current time in seconds when getting\n * - Nothing when setting\n */\n currentTime(seconds) {\n if (seconds === undefined) {\n // cache last currentTime and return. default to 0 seconds\n //\n // Caching the currentTime is meant to prevent a massive amount of reads on the tech's\n // currentTime when scrubbing, but may not provide much performance benefit after all.\n // Should be tested. Also something has to read the actual current time or the cache will\n // never get updated.\n this.cache_.currentTime = this.techGet_('currentTime') || 0;\n return this.cache_.currentTime;\n }\n if (seconds < 0) {\n seconds = 0;\n }\n if (!this.isReady_ || this.changingSrc_ || !this.tech_ || !this.tech_.isReady_) {\n this.cache_.initTime = seconds;\n this.off('canplay', this.boundApplyInitTime_);\n this.one('canplay', this.boundApplyInitTime_);\n return;\n }\n this.techCall_('setCurrentTime', seconds);\n this.cache_.initTime = 0;\n if (isFinite(seconds)) {\n this.cache_.currentTime = Number(seconds);\n }\n }\n\n /**\n * Apply the value of initTime stored in cache as currentTime.\n *\n * @private\n */\n applyInitTime_() {\n this.currentTime(this.cache_.initTime);\n }\n\n /**\n * Normally gets the length in time of the video in seconds;\n * in all but the rarest use cases an argument will NOT be passed to the method\n *\n * > **NOTE**: The video must have started loading before the duration can be\n * known, and depending on preload behaviour may not be known until the video starts\n * playing.\n *\n * @fires Player#durationchange\n *\n * @param {number} [seconds]\n * The duration of the video to set in seconds\n *\n * @return {number|undefined}\n * - The duration of the video in seconds when getting\n * - Nothing when setting\n */\n duration(seconds) {\n if (seconds === undefined) {\n // return NaN if the duration is not known\n return this.cache_.duration !== undefined ? this.cache_.duration : NaN;\n }\n seconds = parseFloat(seconds);\n\n // Standardize on Infinity for signaling video is live\n if (seconds < 0) {\n seconds = Infinity;\n }\n if (seconds !== this.cache_.duration) {\n // Cache the last set value for optimized scrubbing\n this.cache_.duration = seconds;\n if (seconds === Infinity) {\n this.addClass('vjs-live');\n } else {\n this.removeClass('vjs-live');\n }\n if (!isNaN(seconds)) {\n // Do not fire durationchange unless the duration value is known.\n // @see [Spec]{@link https://www.w3.org/TR/2011/WD-html5-20110113/video.html#media-element-load-algorithm}\n\n /**\n * @event Player#durationchange\n * @type {Event}\n */\n this.trigger('durationchange');\n }\n }\n }\n\n /**\n * Calculates how much time is left in the video. Not part\n * of the native video API.\n *\n * @return {number}\n * The time remaining in seconds\n */\n remainingTime() {\n return this.duration() - this.currentTime();\n }\n\n /**\n * A remaining time function that is intended to be used when\n * the time is to be displayed directly to the user.\n *\n * @return {number}\n * The rounded time remaining in seconds\n */\n remainingTimeDisplay() {\n return Math.floor(this.duration()) - Math.floor(this.currentTime());\n }\n\n //\n // Kind of like an array of portions of the video that have been downloaded.\n\n /**\n * Get a TimeRange object with an array of the times of the video\n * that have been downloaded. If you just want the percent of the\n * video that's been downloaded, use bufferedPercent.\n *\n * @see [Buffered Spec]{@link http://dev.w3.org/html5/spec/video.html#dom-media-buffered}\n *\n * @return { import('./utils/time').TimeRange }\n * A mock {@link TimeRanges} object (following HTML spec)\n */\n buffered() {\n let buffered = this.techGet_('buffered');\n if (!buffered || !buffered.length) {\n buffered = createTimeRanges$1(0, 0);\n }\n return buffered;\n }\n\n /**\n * Get the percent (as a decimal) of the video that's been downloaded.\n * This method is not a part of the native HTML video API.\n *\n * @return {number}\n * A decimal between 0 and 1 representing the percent\n * that is buffered 0 being 0% and 1 being 100%\n */\n bufferedPercent() {\n return bufferedPercent(this.buffered(), this.duration());\n }\n\n /**\n * Get the ending time of the last buffered time range\n * This is used in the progress bar to encapsulate all time ranges.\n *\n * @return {number}\n * The end of the last buffered time range\n */\n bufferedEnd() {\n const buffered = this.buffered();\n const duration = this.duration();\n let end = buffered.end(buffered.length - 1);\n if (end > duration) {\n end = duration;\n }\n return end;\n }\n\n /**\n * Get or set the current volume of the media\n *\n * @param {number} [percentAsDecimal]\n * The new volume as a decimal percent:\n * - 0 is muted/0%/off\n * - 1.0 is 100%/full\n * - 0.5 is half volume or 50%\n *\n * @return {number|undefined}\n * The current volume as a percent when getting\n */\n volume(percentAsDecimal) {\n let vol;\n if (percentAsDecimal !== undefined) {\n // Force value to between 0 and 1\n vol = Math.max(0, Math.min(1, percentAsDecimal));\n this.cache_.volume = vol;\n this.techCall_('setVolume', vol);\n if (vol > 0) {\n this.lastVolume_(vol);\n }\n return;\n }\n\n // Default to 1 when returning current volume.\n vol = parseFloat(this.techGet_('volume'));\n return isNaN(vol) ? 1 : vol;\n }\n\n /**\n * Get the current muted state, or turn mute on or off\n *\n * @param {boolean} [muted]\n * - true to mute\n * - false to unmute\n *\n * @return {boolean|undefined}\n * - true if mute is on and getting\n * - false if mute is off and getting\n * - nothing if setting\n */\n muted(muted) {\n if (muted !== undefined) {\n this.techCall_('setMuted', muted);\n return;\n }\n return this.techGet_('muted') || false;\n }\n\n /**\n * Get the current defaultMuted state, or turn defaultMuted on or off. defaultMuted\n * indicates the state of muted on initial playback.\n *\n * ```js\n * var myPlayer = videojs('some-player-id');\n *\n * myPlayer.src(\"http://www.example.com/path/to/video.mp4\");\n *\n * // get, should be false\n * console.log(myPlayer.defaultMuted());\n * // set to true\n * myPlayer.defaultMuted(true);\n * // get should be true\n * console.log(myPlayer.defaultMuted());\n * ```\n *\n * @param {boolean} [defaultMuted]\n * - true to mute\n * - false to unmute\n *\n * @return {boolean|undefined}\n * - true if defaultMuted is on and getting\n * - false if defaultMuted is off and getting\n * - Nothing when setting\n */\n defaultMuted(defaultMuted) {\n if (defaultMuted !== undefined) {\n this.techCall_('setDefaultMuted', defaultMuted);\n }\n return this.techGet_('defaultMuted') || false;\n }\n\n /**\n * Get the last volume, or set it\n *\n * @param {number} [percentAsDecimal]\n * The new last volume as a decimal percent:\n * - 0 is muted/0%/off\n * - 1.0 is 100%/full\n * - 0.5 is half volume or 50%\n *\n * @return {number|undefined}\n * - The current value of lastVolume as a percent when getting\n * - Nothing when setting\n *\n * @private\n */\n lastVolume_(percentAsDecimal) {\n if (percentAsDecimal !== undefined && percentAsDecimal !== 0) {\n this.cache_.lastVolume = percentAsDecimal;\n return;\n }\n return this.cache_.lastVolume;\n }\n\n /**\n * Check if current tech can support native fullscreen\n * (e.g. with built in controls like iOS)\n *\n * @return {boolean}\n * if native fullscreen is supported\n */\n supportsFullScreen() {\n return this.techGet_('supportsFullScreen') || false;\n }\n\n /**\n * Check if the player is in fullscreen mode or tell the player that it\n * is or is not in fullscreen mode.\n *\n * > NOTE: As of the latest HTML5 spec, isFullscreen is no longer an official\n * property and instead document.fullscreenElement is used. But isFullscreen is\n * still a valuable property for internal player workings.\n *\n * @param {boolean} [isFS]\n * Set the players current fullscreen state\n *\n * @return {boolean|undefined}\n * - true if fullscreen is on and getting\n * - false if fullscreen is off and getting\n * - Nothing when setting\n */\n isFullscreen(isFS) {\n if (isFS !== undefined) {\n const oldValue = this.isFullscreen_;\n this.isFullscreen_ = Boolean(isFS);\n\n // if we changed fullscreen state and we're in prefixed mode, trigger fullscreenchange\n // this is the only place where we trigger fullscreenchange events for older browsers\n // fullWindow mode is treated as a prefixed event and will get a fullscreenchange event as well\n if (this.isFullscreen_ !== oldValue && this.fsApi_.prefixed) {\n /**\n * @event Player#fullscreenchange\n * @type {Event}\n */\n this.trigger('fullscreenchange');\n }\n this.toggleFullscreenClass_();\n return;\n }\n return this.isFullscreen_;\n }\n\n /**\n * Increase the size of the video to full screen\n * In some browsers, full screen is not supported natively, so it enters\n * \"full window mode\", where the video fills the browser window.\n * In browsers and devices that support native full screen, sometimes the\n * browser's default controls will be shown, and not the Video.js custom skin.\n * This includes most mobile devices (iOS, Android) and older versions of\n * Safari.\n *\n * @param {Object} [fullscreenOptions]\n * Override the player fullscreen options\n *\n * @fires Player#fullscreenchange\n */\n requestFullscreen(fullscreenOptions) {\n if (this.isInPictureInPicture()) {\n this.exitPictureInPicture();\n }\n const self = this;\n return new Promise((resolve, reject) => {\n function offHandler() {\n self.off('fullscreenerror', errorHandler);\n self.off('fullscreenchange', changeHandler);\n }\n function changeHandler() {\n offHandler();\n resolve();\n }\n function errorHandler(e, err) {\n offHandler();\n reject(err);\n }\n self.one('fullscreenchange', changeHandler);\n self.one('fullscreenerror', errorHandler);\n const promise = self.requestFullscreenHelper_(fullscreenOptions);\n if (promise) {\n promise.then(offHandler, offHandler);\n promise.then(resolve, reject);\n }\n });\n }\n requestFullscreenHelper_(fullscreenOptions) {\n let fsOptions;\n\n // Only pass fullscreen options to requestFullscreen in spec-compliant browsers.\n // Use defaults or player configured option unless passed directly to this method.\n if (!this.fsApi_.prefixed) {\n fsOptions = this.options_.fullscreen && this.options_.fullscreen.options || {};\n if (fullscreenOptions !== undefined) {\n fsOptions = fullscreenOptions;\n }\n }\n\n // This method works as follows:\n // 1. if a fullscreen api is available, use it\n // 1. call requestFullscreen with potential options\n // 2. if we got a promise from above, use it to update isFullscreen()\n // 2. otherwise, if the tech supports fullscreen, call `enterFullScreen` on it.\n // This is particularly used for iPhone, older iPads, and non-safari browser on iOS.\n // 3. otherwise, use \"fullWindow\" mode\n if (this.fsApi_.requestFullscreen) {\n const promise = this.el_[this.fsApi_.requestFullscreen](fsOptions);\n\n // Even on browsers with promise support this may not return a promise\n if (promise) {\n promise.then(() => this.isFullscreen(true), () => this.isFullscreen(false));\n }\n return promise;\n } else if (this.tech_.supportsFullScreen() && !this.options_.preferFullWindow === true) {\n // we can't take the video.js controls fullscreen but we can go fullscreen\n // with native controls\n this.techCall_('enterFullScreen');\n } else {\n // fullscreen isn't supported so we'll just stretch the video element to\n // fill the viewport\n this.enterFullWindow();\n }\n }\n\n /**\n * Return the video to its normal size after having been in full screen mode\n *\n * @fires Player#fullscreenchange\n */\n exitFullscreen() {\n const self = this;\n return new Promise((resolve, reject) => {\n function offHandler() {\n self.off('fullscreenerror', errorHandler);\n self.off('fullscreenchange', changeHandler);\n }\n function changeHandler() {\n offHandler();\n resolve();\n }\n function errorHandler(e, err) {\n offHandler();\n reject(err);\n }\n self.one('fullscreenchange', changeHandler);\n self.one('fullscreenerror', errorHandler);\n const promise = self.exitFullscreenHelper_();\n if (promise) {\n promise.then(offHandler, offHandler);\n // map the promise to our resolve/reject methods\n promise.then(resolve, reject);\n }\n });\n }\n exitFullscreenHelper_() {\n if (this.fsApi_.requestFullscreen) {\n const promise = document[this.fsApi_.exitFullscreen]();\n\n // Even on browsers with promise support this may not return a promise\n if (promise) {\n // we're splitting the promise here, so, we want to catch the\n // potential error so that this chain doesn't have unhandled errors\n silencePromise(promise.then(() => this.isFullscreen(false)));\n }\n return promise;\n } else if (this.tech_.supportsFullScreen() && !this.options_.preferFullWindow === true) {\n this.techCall_('exitFullScreen');\n } else {\n this.exitFullWindow();\n }\n }\n\n /**\n * When fullscreen isn't supported we can stretch the\n * video container to as wide as the browser will let us.\n *\n * @fires Player#enterFullWindow\n */\n enterFullWindow() {\n this.isFullscreen(true);\n this.isFullWindow = true;\n\n // Storing original doc overflow value to return to when fullscreen is off\n this.docOrigOverflow = document.documentElement.style.overflow;\n\n // Add listener for esc key to exit fullscreen\n on(document, 'keydown', this.boundFullWindowOnEscKey_);\n\n // Hide any scroll bars\n document.documentElement.style.overflow = 'hidden';\n\n // Apply fullscreen styles\n addClass(document.body, 'vjs-full-window');\n\n /**\n * @event Player#enterFullWindow\n * @type {Event}\n */\n this.trigger('enterFullWindow');\n }\n\n /**\n * Check for call to either exit full window or\n * full screen on ESC key\n *\n * @param {string} event\n * Event to check for key press\n */\n fullWindowOnEscKey(event) {\n if (keycode.isEventKey(event, 'Esc')) {\n if (this.isFullscreen() === true) {\n if (!this.isFullWindow) {\n this.exitFullscreen();\n } else {\n this.exitFullWindow();\n }\n }\n }\n }\n\n /**\n * Exit full window\n *\n * @fires Player#exitFullWindow\n */\n exitFullWindow() {\n this.isFullscreen(false);\n this.isFullWindow = false;\n off(document, 'keydown', this.boundFullWindowOnEscKey_);\n\n // Unhide scroll bars.\n document.documentElement.style.overflow = this.docOrigOverflow;\n\n // Remove fullscreen styles\n removeClass(document.body, 'vjs-full-window');\n\n // Resize the box, controller, and poster to original sizes\n // this.positionAll();\n /**\n * @event Player#exitFullWindow\n * @type {Event}\n */\n this.trigger('exitFullWindow');\n }\n\n /**\n * Get or set disable Picture-in-Picture mode.\n *\n * @param {boolean} [value]\n * - true will disable Picture-in-Picture mode\n * - false will enable Picture-in-Picture mode\n */\n disablePictureInPicture(value) {\n if (value === undefined) {\n return this.techGet_('disablePictureInPicture');\n }\n this.techCall_('setDisablePictureInPicture', value);\n this.options_.disablePictureInPicture = value;\n this.trigger('disablepictureinpicturechanged');\n }\n\n /**\n * Check if the player is in Picture-in-Picture mode or tell the player that it\n * is or is not in Picture-in-Picture mode.\n *\n * @param {boolean} [isPiP]\n * Set the players current Picture-in-Picture state\n *\n * @return {boolean|undefined}\n * - true if Picture-in-Picture is on and getting\n * - false if Picture-in-Picture is off and getting\n * - nothing if setting\n */\n isInPictureInPicture(isPiP) {\n if (isPiP !== undefined) {\n this.isInPictureInPicture_ = !!isPiP;\n this.togglePictureInPictureClass_();\n return;\n }\n return !!this.isInPictureInPicture_;\n }\n\n /**\n * Create a floating video window always on top of other windows so that users may\n * continue consuming media while they interact with other content sites, or\n * applications on their device.\n *\n * This can use document picture-in-picture or element picture in picture\n *\n * Set `enableDocumentPictureInPicture` to `true` to use docPiP on a supported browser\n * Else set `disablePictureInPicture` to `false` to disable elPiP on a supported browser\n *\n *\n * @see [Spec]{@link https://w3c.github.io/picture-in-picture/}\n * @see [Spec]{@link https://wicg.github.io/document-picture-in-picture/}\n *\n * @fires Player#enterpictureinpicture\n *\n * @return {Promise}\n * A promise with a Picture-in-Picture window.\n */\n requestPictureInPicture() {\n if (this.options_.enableDocumentPictureInPicture && window$1.documentPictureInPicture) {\n const pipContainer = document.createElement(this.el().tagName);\n pipContainer.classList = this.el().classList;\n pipContainer.classList.add('vjs-pip-container');\n if (this.posterImage) {\n pipContainer.appendChild(this.posterImage.el().cloneNode(true));\n }\n if (this.titleBar) {\n pipContainer.appendChild(this.titleBar.el().cloneNode(true));\n }\n pipContainer.appendChild(createEl('p', {\n className: 'vjs-pip-text'\n }, {}, this.localize('Playing in picture-in-picture')));\n return window$1.documentPictureInPicture.requestWindow({\n // The aspect ratio won't be correct, Chrome bug https://crbug.com/1407629\n width: this.videoWidth(),\n height: this.videoHeight()\n }).then(pipWindow => {\n copyStyleSheetsToWindow(pipWindow);\n this.el_.parentNode.insertBefore(pipContainer, this.el_);\n pipWindow.document.body.appendChild(this.el_);\n pipWindow.document.body.classList.add('vjs-pip-window');\n this.player_.isInPictureInPicture(true);\n this.player_.trigger('enterpictureinpicture');\n\n // Listen for the PiP closing event to move the video back.\n pipWindow.addEventListener('pagehide', event => {\n const pipVideo = event.target.querySelector('.video-js');\n pipContainer.parentNode.replaceChild(pipVideo, pipContainer);\n this.player_.isInPictureInPicture(false);\n this.player_.trigger('leavepictureinpicture');\n });\n return pipWindow;\n });\n }\n if ('pictureInPictureEnabled' in document && this.disablePictureInPicture() === false) {\n /**\n * This event fires when the player enters picture in picture mode\n *\n * @event Player#enterpictureinpicture\n * @type {Event}\n */\n return this.techGet_('requestPictureInPicture');\n }\n return Promise.reject('No PiP mode is available');\n }\n\n /**\n * Exit Picture-in-Picture mode.\n *\n * @see [Spec]{@link https://wicg.github.io/picture-in-picture}\n *\n * @fires Player#leavepictureinpicture\n *\n * @return {Promise}\n * A promise.\n */\n exitPictureInPicture() {\n if (window$1.documentPictureInPicture && window$1.documentPictureInPicture.window) {\n // With documentPictureInPicture, Player#leavepictureinpicture is fired in the pagehide handler\n window$1.documentPictureInPicture.window.close();\n return Promise.resolve();\n }\n if ('pictureInPictureEnabled' in document) {\n /**\n * This event fires when the player leaves picture in picture mode\n *\n * @event Player#leavepictureinpicture\n * @type {Event}\n */\n return document.exitPictureInPicture();\n }\n }\n\n /**\n * Called when this Player has focus and a key gets pressed down, or when\n * any Component of this player receives a key press that it doesn't handle.\n * This allows player-wide hotkeys (either as defined below, or optionally\n * by an external function).\n *\n * @param {KeyboardEvent} event\n * The `keydown` event that caused this function to be called.\n *\n * @listens keydown\n */\n handleKeyDown(event) {\n const {\n userActions\n } = this.options_;\n\n // Bail out if hotkeys are not configured.\n if (!userActions || !userActions.hotkeys) {\n return;\n }\n\n // Function that determines whether or not to exclude an element from\n // hotkeys handling.\n const excludeElement = el => {\n const tagName = el.tagName.toLowerCase();\n\n // The first and easiest test is for `contenteditable` elements.\n if (el.isContentEditable) {\n return true;\n }\n\n // Inputs matching these types will still trigger hotkey handling as\n // they are not text inputs.\n const allowedInputTypes = ['button', 'checkbox', 'hidden', 'radio', 'reset', 'submit'];\n if (tagName === 'input') {\n return allowedInputTypes.indexOf(el.type) === -1;\n }\n\n // The final test is by tag name. These tags will be excluded entirely.\n const excludedTags = ['textarea'];\n return excludedTags.indexOf(tagName) !== -1;\n };\n\n // Bail out if the user is focused on an interactive form element.\n if (excludeElement(this.el_.ownerDocument.activeElement)) {\n return;\n }\n if (typeof userActions.hotkeys === 'function') {\n userActions.hotkeys.call(this, event);\n } else {\n this.handleHotkeys(event);\n }\n }\n\n /**\n * Called when this Player receives a hotkey keydown event.\n * Supported player-wide hotkeys are:\n *\n * f - toggle fullscreen\n * m - toggle mute\n * k or Space - toggle play/pause\n *\n * @param {Event} event\n * The `keydown` event that caused this function to be called.\n */\n handleHotkeys(event) {\n const hotkeys = this.options_.userActions ? this.options_.userActions.hotkeys : {};\n\n // set fullscreenKey, muteKey, playPauseKey from `hotkeys`, use defaults if not set\n const {\n fullscreenKey = keydownEvent => keycode.isEventKey(keydownEvent, 'f'),\n muteKey = keydownEvent => keycode.isEventKey(keydownEvent, 'm'),\n playPauseKey = keydownEvent => keycode.isEventKey(keydownEvent, 'k') || keycode.isEventKey(keydownEvent, 'Space')\n } = hotkeys;\n if (fullscreenKey.call(this, event)) {\n event.preventDefault();\n event.stopPropagation();\n const FSToggle = Component$1.getComponent('FullscreenToggle');\n if (document[this.fsApi_.fullscreenEnabled] !== false) {\n FSToggle.prototype.handleClick.call(this, event);\n }\n } else if (muteKey.call(this, event)) {\n event.preventDefault();\n event.stopPropagation();\n const MuteToggle = Component$1.getComponent('MuteToggle');\n MuteToggle.prototype.handleClick.call(this, event);\n } else if (playPauseKey.call(this, event)) {\n event.preventDefault();\n event.stopPropagation();\n const PlayToggle = Component$1.getComponent('PlayToggle');\n PlayToggle.prototype.handleClick.call(this, event);\n }\n }\n\n /**\n * Check whether the player can play a given mimetype\n *\n * @see https://www.w3.org/TR/2011/WD-html5-20110113/video.html#dom-navigator-canplaytype\n *\n * @param {string} type\n * The mimetype to check\n *\n * @return {string}\n * 'probably', 'maybe', or '' (empty string)\n */\n canPlayType(type) {\n let can;\n\n // Loop through each playback technology in the options order\n for (let i = 0, j = this.options_.techOrder; i < j.length; i++) {\n const techName = j[i];\n let tech = Tech.getTech(techName);\n\n // Support old behavior of techs being registered as components.\n // Remove once that deprecated behavior is removed.\n if (!tech) {\n tech = Component$1.getComponent(techName);\n }\n\n // Check if the current tech is defined before continuing\n if (!tech) {\n log$1.error(`The \"${techName}\" tech is undefined. Skipped browser support check for that tech.`);\n continue;\n }\n\n // Check if the browser supports this technology\n if (tech.isSupported()) {\n can = tech.canPlayType(type);\n if (can) {\n return can;\n }\n }\n }\n return '';\n }\n\n /**\n * Select source based on tech-order or source-order\n * Uses source-order selection if `options.sourceOrder` is truthy. Otherwise,\n * defaults to tech-order selection\n *\n * @param {Array} sources\n * The sources for a media asset\n *\n * @return {Object|boolean}\n * Object of source and tech order or false\n */\n selectSource(sources) {\n // Get only the techs specified in `techOrder` that exist and are supported by the\n // current platform\n const techs = this.options_.techOrder.map(techName => {\n return [techName, Tech.getTech(techName)];\n }).filter(([techName, tech]) => {\n // Check if the current tech is defined before continuing\n if (tech) {\n // Check if the browser supports this technology\n return tech.isSupported();\n }\n log$1.error(`The \"${techName}\" tech is undefined. Skipped browser support check for that tech.`);\n return false;\n });\n\n // Iterate over each `innerArray` element once per `outerArray` element and execute\n // `tester` with both. If `tester` returns a non-falsy value, exit early and return\n // that value.\n const findFirstPassingTechSourcePair = function (outerArray, innerArray, tester) {\n let found;\n outerArray.some(outerChoice => {\n return innerArray.some(innerChoice => {\n found = tester(outerChoice, innerChoice);\n if (found) {\n return true;\n }\n });\n });\n return found;\n };\n let foundSourceAndTech;\n const flip = fn => (a, b) => fn(b, a);\n const finder = ([techName, tech], source) => {\n if (tech.canPlaySource(source, this.options_[techName.toLowerCase()])) {\n return {\n source,\n tech: techName\n };\n }\n };\n\n // Depending on the truthiness of `options.sourceOrder`, we swap the order of techs and sources\n // to select from them based on their priority.\n if (this.options_.sourceOrder) {\n // Source-first ordering\n foundSourceAndTech = findFirstPassingTechSourcePair(sources, techs, flip(finder));\n } else {\n // Tech-first ordering\n foundSourceAndTech = findFirstPassingTechSourcePair(techs, sources, finder);\n }\n return foundSourceAndTech || false;\n }\n\n /**\n * Executes source setting and getting logic\n *\n * @param {Tech~SourceObject|Tech~SourceObject[]|string} [source]\n * A SourceObject, an array of SourceObjects, or a string referencing\n * a URL to a media source. It is _highly recommended_ that an object\n * or array of objects is used here, so that source selection\n * algorithms can take the `type` into account.\n *\n * If not provided, this method acts as a getter.\n * @param {boolean} [isRetry]\n * Indicates whether this is being called internally as a result of a retry\n *\n * @return {string|undefined}\n * If the `source` argument is missing, returns the current source\n * URL. Otherwise, returns nothing/undefined.\n */\n handleSrc_(source, isRetry) {\n // getter usage\n if (typeof source === 'undefined') {\n return this.cache_.src || '';\n }\n\n // Reset retry behavior for new source\n if (this.resetRetryOnError_) {\n this.resetRetryOnError_();\n }\n\n // filter out invalid sources and turn our source into\n // an array of source objects\n const sources = filterSource(source);\n\n // if a source was passed in then it is invalid because\n // it was filtered to a zero length Array. So we have to\n // show an error\n if (!sources.length) {\n this.setTimeout(function () {\n this.error({\n code: 4,\n message: this.options_.notSupportedMessage\n });\n }, 0);\n return;\n }\n\n // initial sources\n this.changingSrc_ = true;\n\n // Only update the cached source list if we are not retrying a new source after error,\n // since in that case we want to include the failed source(s) in the cache\n if (!isRetry) {\n this.cache_.sources = sources;\n }\n this.updateSourceCaches_(sources[0]);\n\n // middlewareSource is the source after it has been changed by middleware\n setSource(this, sources[0], (middlewareSource, mws) => {\n this.middleware_ = mws;\n\n // since sourceSet is async we have to update the cache again after we select a source since\n // the source that is selected could be out of order from the cache update above this callback.\n if (!isRetry) {\n this.cache_.sources = sources;\n }\n this.updateSourceCaches_(middlewareSource);\n const err = this.src_(middlewareSource);\n if (err) {\n if (sources.length > 1) {\n return this.handleSrc_(sources.slice(1));\n }\n this.changingSrc_ = false;\n\n // We need to wrap this in a timeout to give folks a chance to add error event handlers\n this.setTimeout(function () {\n this.error({\n code: 4,\n message: this.options_.notSupportedMessage\n });\n }, 0);\n\n // we could not find an appropriate tech, but let's still notify the delegate that this is it\n // this needs a better comment about why this is needed\n this.triggerReady();\n return;\n }\n setTech(mws, this.tech_);\n });\n\n // Try another available source if this one fails before playback.\n if (sources.length > 1) {\n const retry = () => {\n // Remove the error modal\n this.error(null);\n this.handleSrc_(sources.slice(1), true);\n };\n const stopListeningForErrors = () => {\n this.off('error', retry);\n };\n this.one('error', retry);\n this.one('playing', stopListeningForErrors);\n this.resetRetryOnError_ = () => {\n this.off('error', retry);\n this.off('playing', stopListeningForErrors);\n };\n }\n }\n\n /**\n * Get or set the video source.\n *\n * @param {Tech~SourceObject|Tech~SourceObject[]|string} [source]\n * A SourceObject, an array of SourceObjects, or a string referencing\n * a URL to a media source. It is _highly recommended_ that an object\n * or array of objects is used here, so that source selection\n * algorithms can take the `type` into account.\n *\n * If not provided, this method acts as a getter.\n *\n * @return {string|undefined}\n * If the `source` argument is missing, returns the current source\n * URL. Otherwise, returns nothing/undefined.\n */\n src(source) {\n return this.handleSrc_(source, false);\n }\n\n /**\n * Set the source object on the tech, returns a boolean that indicates whether\n * there is a tech that can play the source or not\n *\n * @param {Tech~SourceObject} source\n * The source object to set on the Tech\n *\n * @return {boolean}\n * - True if there is no Tech to playback this source\n * - False otherwise\n *\n * @private\n */\n src_(source) {\n const sourceTech = this.selectSource([source]);\n if (!sourceTech) {\n return true;\n }\n if (!titleCaseEquals(sourceTech.tech, this.techName_)) {\n this.changingSrc_ = true;\n // load this technology with the chosen source\n this.loadTech_(sourceTech.tech, sourceTech.source);\n this.tech_.ready(() => {\n this.changingSrc_ = false;\n });\n return false;\n }\n\n // wait until the tech is ready to set the source\n // and set it synchronously if possible (#2326)\n this.ready(function () {\n // The setSource tech method was added with source handlers\n // so older techs won't support it\n // We need to check the direct prototype for the case where subclasses\n // of the tech do not support source handlers\n if (this.tech_.constructor.prototype.hasOwnProperty('setSource')) {\n this.techCall_('setSource', source);\n } else {\n this.techCall_('src', source.src);\n }\n this.changingSrc_ = false;\n }, true);\n return false;\n }\n\n /**\n * Begin loading the src data.\n */\n load() {\n // Workaround to use the load method with the VHS.\n // Does not cover the case when the load method is called directly from the mediaElement.\n if (this.tech_ && this.tech_.vhs) {\n this.src(this.currentSource());\n return;\n }\n this.techCall_('load');\n }\n\n /**\n * Reset the player. Loads the first tech in the techOrder,\n * removes all the text tracks in the existing `tech`,\n * and calls `reset` on the `tech`.\n */\n reset() {\n if (this.paused()) {\n this.doReset_();\n } else {\n const playPromise = this.play();\n silencePromise(playPromise.then(() => this.doReset_()));\n }\n }\n doReset_() {\n if (this.tech_) {\n this.tech_.clearTracks('text');\n }\n this.resetCache_();\n this.poster('');\n this.loadTech_(this.options_.techOrder[0], null);\n this.techCall_('reset');\n this.resetControlBarUI_();\n if (isEvented(this)) {\n this.trigger('playerreset');\n }\n }\n\n /**\n * Reset Control Bar's UI by calling sub-methods that reset\n * all of Control Bar's components\n */\n resetControlBarUI_() {\n this.resetProgressBar_();\n this.resetPlaybackRate_();\n this.resetVolumeBar_();\n }\n\n /**\n * Reset tech's progress so progress bar is reset in the UI\n */\n resetProgressBar_() {\n this.currentTime(0);\n const {\n currentTimeDisplay,\n durationDisplay,\n progressControl,\n remainingTimeDisplay\n } = this.controlBar || {};\n const {\n seekBar\n } = progressControl || {};\n if (currentTimeDisplay) {\n currentTimeDisplay.updateContent();\n }\n if (durationDisplay) {\n durationDisplay.updateContent();\n }\n if (remainingTimeDisplay) {\n remainingTimeDisplay.updateContent();\n }\n if (seekBar) {\n seekBar.update();\n if (seekBar.loadProgressBar) {\n seekBar.loadProgressBar.update();\n }\n }\n }\n\n /**\n * Reset Playback ratio\n */\n resetPlaybackRate_() {\n this.playbackRate(this.defaultPlaybackRate());\n this.handleTechRateChange_();\n }\n\n /**\n * Reset Volume bar\n */\n resetVolumeBar_() {\n this.volume(1.0);\n this.trigger('volumechange');\n }\n\n /**\n * Returns all of the current source objects.\n *\n * @return {Tech~SourceObject[]}\n * The current source objects\n */\n currentSources() {\n const source = this.currentSource();\n const sources = [];\n\n // assume `{}` or `{ src }`\n if (Object.keys(source).length !== 0) {\n sources.push(source);\n }\n return this.cache_.sources || sources;\n }\n\n /**\n * Returns the current source object.\n *\n * @return {Tech~SourceObject}\n * The current source object\n */\n currentSource() {\n return this.cache_.source || {};\n }\n\n /**\n * Returns the fully qualified URL of the current source value e.g. http://mysite.com/video.mp4\n * Can be used in conjunction with `currentType` to assist in rebuilding the current source object.\n *\n * @return {string}\n * The current source\n */\n currentSrc() {\n return this.currentSource() && this.currentSource().src || '';\n }\n\n /**\n * Get the current source type e.g. video/mp4\n * This can allow you rebuild the current source object so that you could load the same\n * source and tech later\n *\n * @return {string}\n * The source MIME type\n */\n currentType() {\n return this.currentSource() && this.currentSource().type || '';\n }\n\n /**\n * Get or set the preload attribute\n *\n * @param {'none'|'auto'|'metadata'} [value]\n * Preload mode to pass to tech\n *\n * @return {string|undefined}\n * - The preload attribute value when getting\n * - Nothing when setting\n */\n preload(value) {\n if (value !== undefined) {\n this.techCall_('setPreload', value);\n this.options_.preload = value;\n return;\n }\n return this.techGet_('preload');\n }\n\n /**\n * Get or set the autoplay option. When this is a boolean it will\n * modify the attribute on the tech. When this is a string the attribute on\n * the tech will be removed and `Player` will handle autoplay on loadstarts.\n *\n * @param {boolean|'play'|'muted'|'any'} [value]\n * - true: autoplay using the browser behavior\n * - false: do not autoplay\n * - 'play': call play() on every loadstart\n * - 'muted': call muted() then play() on every loadstart\n * - 'any': call play() on every loadstart. if that fails call muted() then play().\n * - *: values other than those listed here will be set `autoplay` to true\n *\n * @return {boolean|string|undefined}\n * - The current value of autoplay when getting\n * - Nothing when setting\n */\n autoplay(value) {\n // getter usage\n if (value === undefined) {\n return this.options_.autoplay || false;\n }\n let techAutoplay;\n\n // if the value is a valid string set it to that, or normalize `true` to 'play', if need be\n if (typeof value === 'string' && /(any|play|muted)/.test(value) || value === true && this.options_.normalizeAutoplay) {\n this.options_.autoplay = value;\n this.manualAutoplay_(typeof value === 'string' ? value : 'play');\n techAutoplay = false;\n\n // any falsy value sets autoplay to false in the browser,\n // lets do the same\n } else if (!value) {\n this.options_.autoplay = false;\n\n // any other value (ie truthy) sets autoplay to true\n } else {\n this.options_.autoplay = true;\n }\n techAutoplay = typeof techAutoplay === 'undefined' ? this.options_.autoplay : techAutoplay;\n\n // if we don't have a tech then we do not queue up\n // a setAutoplay call on tech ready. We do this because the\n // autoplay option will be passed in the constructor and we\n // do not need to set it twice\n if (this.tech_) {\n this.techCall_('setAutoplay', techAutoplay);\n }\n }\n\n /**\n * Set or unset the playsinline attribute.\n * Playsinline tells the browser that non-fullscreen playback is preferred.\n *\n * @param {boolean} [value]\n * - true means that we should try to play inline by default\n * - false means that we should use the browser's default playback mode,\n * which in most cases is inline. iOS Safari is a notable exception\n * and plays fullscreen by default.\n *\n * @return {string|undefined}\n * - the current value of playsinline\n * - Nothing when setting\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/#attr-video-playsinline}\n */\n playsinline(value) {\n if (value !== undefined) {\n this.techCall_('setPlaysinline', value);\n this.options_.playsinline = value;\n }\n return this.techGet_('playsinline');\n }\n\n /**\n * Get or set the loop attribute on the video element.\n *\n * @param {boolean} [value]\n * - true means that we should loop the video\n * - false means that we should not loop the video\n *\n * @return {boolean|undefined}\n * - The current value of loop when getting\n * - Nothing when setting\n */\n loop(value) {\n if (value !== undefined) {\n this.techCall_('setLoop', value);\n this.options_.loop = value;\n return;\n }\n return this.techGet_('loop');\n }\n\n /**\n * Get or set the poster image source url\n *\n * @fires Player#posterchange\n *\n * @param {string} [src]\n * Poster image source URL\n *\n * @return {string|undefined}\n * - The current value of poster when getting\n * - Nothing when setting\n */\n poster(src) {\n if (src === undefined) {\n return this.poster_;\n }\n\n // The correct way to remove a poster is to set as an empty string\n // other falsey values will throw errors\n if (!src) {\n src = '';\n }\n if (src === this.poster_) {\n return;\n }\n\n // update the internal poster variable\n this.poster_ = src;\n\n // update the tech's poster\n this.techCall_('setPoster', src);\n this.isPosterFromTech_ = false;\n\n // alert components that the poster has been set\n /**\n * This event fires when the poster image is changed on the player.\n *\n * @event Player#posterchange\n * @type {Event}\n */\n this.trigger('posterchange');\n }\n\n /**\n * Some techs (e.g. YouTube) can provide a poster source in an\n * asynchronous way. We want the poster component to use this\n * poster source so that it covers up the tech's controls.\n * (YouTube's play button). However we only want to use this\n * source if the player user hasn't set a poster through\n * the normal APIs.\n *\n * @fires Player#posterchange\n * @listens Tech#posterchange\n * @private\n */\n handleTechPosterChange_() {\n if ((!this.poster_ || this.options_.techCanOverridePoster) && this.tech_ && this.tech_.poster) {\n const newPoster = this.tech_.poster() || '';\n if (newPoster !== this.poster_) {\n this.poster_ = newPoster;\n this.isPosterFromTech_ = true;\n\n // Let components know the poster has changed\n this.trigger('posterchange');\n }\n }\n }\n\n /**\n * Get or set whether or not the controls are showing.\n *\n * @fires Player#controlsenabled\n *\n * @param {boolean} [bool]\n * - true to turn controls on\n * - false to turn controls off\n *\n * @return {boolean|undefined}\n * - The current value of controls when getting\n * - Nothing when setting\n */\n controls(bool) {\n if (bool === undefined) {\n return !!this.controls_;\n }\n bool = !!bool;\n\n // Don't trigger a change event unless it actually changed\n if (this.controls_ === bool) {\n return;\n }\n this.controls_ = bool;\n if (this.usingNativeControls()) {\n this.techCall_('setControls', bool);\n }\n if (this.controls_) {\n this.removeClass('vjs-controls-disabled');\n this.addClass('vjs-controls-enabled');\n /**\n * @event Player#controlsenabled\n * @type {Event}\n */\n this.trigger('controlsenabled');\n if (!this.usingNativeControls()) {\n this.addTechControlsListeners_();\n }\n } else {\n this.removeClass('vjs-controls-enabled');\n this.addClass('vjs-controls-disabled');\n /**\n * @event Player#controlsdisabled\n * @type {Event}\n */\n this.trigger('controlsdisabled');\n if (!this.usingNativeControls()) {\n this.removeTechControlsListeners_();\n }\n }\n }\n\n /**\n * Toggle native controls on/off. Native controls are the controls built into\n * devices (e.g. default iPhone controls) or other techs\n * (e.g. Vimeo Controls)\n * **This should only be set by the current tech, because only the tech knows\n * if it can support native controls**\n *\n * @fires Player#usingnativecontrols\n * @fires Player#usingcustomcontrols\n *\n * @param {boolean} [bool]\n * - true to turn native controls on\n * - false to turn native controls off\n *\n * @return {boolean|undefined}\n * - The current value of native controls when getting\n * - Nothing when setting\n */\n usingNativeControls(bool) {\n if (bool === undefined) {\n return !!this.usingNativeControls_;\n }\n bool = !!bool;\n\n // Don't trigger a change event unless it actually changed\n if (this.usingNativeControls_ === bool) {\n return;\n }\n this.usingNativeControls_ = bool;\n if (this.usingNativeControls_) {\n this.addClass('vjs-using-native-controls');\n\n /**\n * player is using the native device controls\n *\n * @event Player#usingnativecontrols\n * @type {Event}\n */\n this.trigger('usingnativecontrols');\n } else {\n this.removeClass('vjs-using-native-controls');\n\n /**\n * player is using the custom HTML controls\n *\n * @event Player#usingcustomcontrols\n * @type {Event}\n */\n this.trigger('usingcustomcontrols');\n }\n }\n\n /**\n * Set or get the current MediaError\n *\n * @fires Player#error\n *\n * @param {MediaError|string|number} [err]\n * A MediaError or a string/number to be turned\n * into a MediaError\n *\n * @return {MediaError|null|undefined}\n * - The current MediaError when getting (or null)\n * - Nothing when setting\n */\n error(err) {\n if (err === undefined) {\n return this.error_ || null;\n }\n\n // allow hooks to modify error object\n hooks('beforeerror').forEach(hookFunction => {\n const newErr = hookFunction(this, err);\n if (!(isObject(newErr) && !Array.isArray(newErr) || typeof newErr === 'string' || typeof newErr === 'number' || newErr === null)) {\n this.log.error('please return a value that MediaError expects in beforeerror hooks');\n return;\n }\n err = newErr;\n });\n\n // Suppress the first error message for no compatible source until\n // user interaction\n if (this.options_.suppressNotSupportedError && err && err.code === 4) {\n const triggerSuppressedError = function () {\n this.error(err);\n };\n this.options_.suppressNotSupportedError = false;\n this.any(['click', 'touchstart'], triggerSuppressedError);\n this.one('loadstart', function () {\n this.off(['click', 'touchstart'], triggerSuppressedError);\n });\n return;\n }\n\n // restoring to default\n if (err === null) {\n this.error_ = null;\n this.removeClass('vjs-error');\n if (this.errorDisplay) {\n this.errorDisplay.close();\n }\n return;\n }\n this.error_ = new MediaError(err);\n\n // add the vjs-error classname to the player\n this.addClass('vjs-error');\n\n // log the name of the error type and any message\n // IE11 logs \"[object object]\" and required you to expand message to see error object\n log$1.error(`(CODE:${this.error_.code} ${MediaError.errorTypes[this.error_.code]})`, this.error_.message, this.error_);\n\n /**\n * @event Player#error\n * @type {Event}\n */\n this.trigger('error');\n\n // notify hooks of the per player error\n hooks('error').forEach(hookFunction => hookFunction(this, this.error_));\n return;\n }\n\n /**\n * Report user activity\n *\n * @param {Object} event\n * Event object\n */\n reportUserActivity(event) {\n this.userActivity_ = true;\n }\n\n /**\n * Get/set if user is active\n *\n * @fires Player#useractive\n * @fires Player#userinactive\n *\n * @param {boolean} [bool]\n * - true if the user is active\n * - false if the user is inactive\n *\n * @return {boolean|undefined}\n * - The current value of userActive when getting\n * - Nothing when setting\n */\n userActive(bool) {\n if (bool === undefined) {\n return this.userActive_;\n }\n bool = !!bool;\n if (bool === this.userActive_) {\n return;\n }\n this.userActive_ = bool;\n if (this.userActive_) {\n this.userActivity_ = true;\n this.removeClass('vjs-user-inactive');\n this.addClass('vjs-user-active');\n /**\n * @event Player#useractive\n * @type {Event}\n */\n this.trigger('useractive');\n return;\n }\n\n // Chrome/Safari/IE have bugs where when you change the cursor it can\n // trigger a mousemove event. This causes an issue when you're hiding\n // the cursor when the user is inactive, and a mousemove signals user\n // activity. Making it impossible to go into inactive mode. Specifically\n // this happens in fullscreen when we really need to hide the cursor.\n //\n // When this gets resolved in ALL browsers it can be removed\n // https://code.google.com/p/chromium/issues/detail?id=103041\n if (this.tech_) {\n this.tech_.one('mousemove', function (e) {\n e.stopPropagation();\n e.preventDefault();\n });\n }\n this.userActivity_ = false;\n this.removeClass('vjs-user-active');\n this.addClass('vjs-user-inactive');\n /**\n * @event Player#userinactive\n * @type {Event}\n */\n this.trigger('userinactive');\n }\n\n /**\n * Listen for user activity based on timeout value\n *\n * @private\n */\n listenForUserActivity_() {\n let mouseInProgress;\n let lastMoveX;\n let lastMoveY;\n const handleActivity = bind_(this, this.reportUserActivity);\n const handleMouseMove = function (e) {\n // #1068 - Prevent mousemove spamming\n // Chrome Bug: https://code.google.com/p/chromium/issues/detail?id=366970\n if (e.screenX !== lastMoveX || e.screenY !== lastMoveY) {\n lastMoveX = e.screenX;\n lastMoveY = e.screenY;\n handleActivity();\n }\n };\n const handleMouseDown = function () {\n handleActivity();\n // For as long as the they are touching the device or have their mouse down,\n // we consider them active even if they're not moving their finger or mouse.\n // So we want to continue to update that they are active\n this.clearInterval(mouseInProgress);\n // Setting userActivity=true now and setting the interval to the same time\n // as the activityCheck interval (250) should ensure we never miss the\n // next activityCheck\n mouseInProgress = this.setInterval(handleActivity, 250);\n };\n const handleMouseUpAndMouseLeave = function (event) {\n handleActivity();\n // Stop the interval that maintains activity if the mouse/touch is down\n this.clearInterval(mouseInProgress);\n };\n\n // Any mouse movement will be considered user activity\n this.on('mousedown', handleMouseDown);\n this.on('mousemove', handleMouseMove);\n this.on('mouseup', handleMouseUpAndMouseLeave);\n this.on('mouseleave', handleMouseUpAndMouseLeave);\n const controlBar = this.getChild('controlBar');\n\n // Fixes bug on Android & iOS where when tapping progressBar (when control bar is displayed)\n // controlBar would no longer be hidden by default timeout.\n if (controlBar && !IS_IOS && !IS_ANDROID) {\n controlBar.on('mouseenter', function (event) {\n if (this.player().options_.inactivityTimeout !== 0) {\n this.player().cache_.inactivityTimeout = this.player().options_.inactivityTimeout;\n }\n this.player().options_.inactivityTimeout = 0;\n });\n controlBar.on('mouseleave', function (event) {\n this.player().options_.inactivityTimeout = this.player().cache_.inactivityTimeout;\n });\n }\n\n // Listen for keyboard navigation\n // Shouldn't need to use inProgress interval because of key repeat\n this.on('keydown', handleActivity);\n this.on('keyup', handleActivity);\n\n // Run an interval every 250 milliseconds instead of stuffing everything into\n // the mousemove/touchmove function itself, to prevent performance degradation.\n // `this.reportUserActivity` simply sets this.userActivity_ to true, which\n // then gets picked up by this loop\n // http://ejohn.org/blog/learning-from-twitter/\n let inactivityTimeout;\n\n /** @this Player */\n const activityCheck = function () {\n // Check to see if mouse/touch activity has happened\n if (!this.userActivity_) {\n return;\n }\n\n // Reset the activity tracker\n this.userActivity_ = false;\n\n // If the user state was inactive, set the state to active\n this.userActive(true);\n\n // Clear any existing inactivity timeout to start the timer over\n this.clearTimeout(inactivityTimeout);\n const timeout = this.options_.inactivityTimeout;\n if (timeout <= 0) {\n return;\n }\n\n // In <timeout> milliseconds, if no more activity has occurred the\n // user will be considered inactive\n inactivityTimeout = this.setTimeout(function () {\n // Protect against the case where the inactivityTimeout can trigger just\n // before the next user activity is picked up by the activity check loop\n // causing a flicker\n if (!this.userActivity_) {\n this.userActive(false);\n }\n }, timeout);\n };\n this.setInterval(activityCheck, 250);\n }\n\n /**\n * Gets or sets the current playback rate. A playback rate of\n * 1.0 represents normal speed and 0.5 would indicate half-speed\n * playback, for instance.\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-playbackrate\n *\n * @param {number} [rate]\n * New playback rate to set.\n *\n * @return {number|undefined}\n * - The current playback rate when getting or 1.0\n * - Nothing when setting\n */\n playbackRate(rate) {\n if (rate !== undefined) {\n // NOTE: this.cache_.lastPlaybackRate is set from the tech handler\n // that is registered above\n this.techCall_('setPlaybackRate', rate);\n return;\n }\n if (this.tech_ && this.tech_.featuresPlaybackRate) {\n return this.cache_.lastPlaybackRate || this.techGet_('playbackRate');\n }\n return 1.0;\n }\n\n /**\n * Gets or sets the current default playback rate. A default playback rate of\n * 1.0 represents normal speed and 0.5 would indicate half-speed playback, for instance.\n * defaultPlaybackRate will only represent what the initial playbackRate of a video was, not\n * not the current playbackRate.\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-defaultplaybackrate\n *\n * @param {number} [rate]\n * New default playback rate to set.\n *\n * @return {number|undefined}\n * - The default playback rate when getting or 1.0\n * - Nothing when setting\n */\n defaultPlaybackRate(rate) {\n if (rate !== undefined) {\n return this.techCall_('setDefaultPlaybackRate', rate);\n }\n if (this.tech_ && this.tech_.featuresPlaybackRate) {\n return this.techGet_('defaultPlaybackRate');\n }\n return 1.0;\n }\n\n /**\n * Gets or sets the audio flag\n *\n * @param {boolean} [bool]\n * - true signals that this is an audio player\n * - false signals that this is not an audio player\n *\n * @return {boolean|undefined}\n * - The current value of isAudio when getting\n * - Nothing when setting\n */\n isAudio(bool) {\n if (bool !== undefined) {\n this.isAudio_ = !!bool;\n return;\n }\n return !!this.isAudio_;\n }\n enableAudioOnlyUI_() {\n // Update styling immediately to show the control bar so we can get its height\n this.addClass('vjs-audio-only-mode');\n const playerChildren = this.children();\n const controlBar = this.getChild('ControlBar');\n const controlBarHeight = controlBar && controlBar.currentHeight();\n\n // Hide all player components except the control bar. Control bar components\n // needed only for video are hidden with CSS\n playerChildren.forEach(child => {\n if (child === controlBar) {\n return;\n }\n if (child.el_ && !child.hasClass('vjs-hidden')) {\n child.hide();\n this.audioOnlyCache_.hiddenChildren.push(child);\n }\n });\n this.audioOnlyCache_.playerHeight = this.currentHeight();\n\n // Set the player height the same as the control bar\n this.height(controlBarHeight);\n this.trigger('audioonlymodechange');\n }\n disableAudioOnlyUI_() {\n this.removeClass('vjs-audio-only-mode');\n\n // Show player components that were previously hidden\n this.audioOnlyCache_.hiddenChildren.forEach(child => child.show());\n\n // Reset player height\n this.height(this.audioOnlyCache_.playerHeight);\n this.trigger('audioonlymodechange');\n }\n\n /**\n * Get the current audioOnlyMode state or set audioOnlyMode to true or false.\n *\n * Setting this to `true` will hide all player components except the control bar,\n * as well as control bar components needed only for video.\n *\n * @param {boolean} [value]\n * The value to set audioOnlyMode to.\n *\n * @return {Promise|boolean}\n * A Promise is returned when setting the state, and a boolean when getting\n * the present state\n */\n audioOnlyMode(value) {\n if (typeof value !== 'boolean' || value === this.audioOnlyMode_) {\n return this.audioOnlyMode_;\n }\n this.audioOnlyMode_ = value;\n\n // Enable Audio Only Mode\n if (value) {\n const exitPromises = [];\n\n // Fullscreen and PiP are not supported in audioOnlyMode, so exit if we need to.\n if (this.isInPictureInPicture()) {\n exitPromises.push(this.exitPictureInPicture());\n }\n if (this.isFullscreen()) {\n exitPromises.push(this.exitFullscreen());\n }\n if (this.audioPosterMode()) {\n exitPromises.push(this.audioPosterMode(false));\n }\n return Promise.all(exitPromises).then(() => this.enableAudioOnlyUI_());\n }\n\n // Disable Audio Only Mode\n return Promise.resolve().then(() => this.disableAudioOnlyUI_());\n }\n enablePosterModeUI_() {\n // Hide the video element and show the poster image to enable posterModeUI\n const tech = this.tech_ && this.tech_;\n tech.hide();\n this.addClass('vjs-audio-poster-mode');\n this.trigger('audiopostermodechange');\n }\n disablePosterModeUI_() {\n // Show the video element and hide the poster image to disable posterModeUI\n const tech = this.tech_ && this.tech_;\n tech.show();\n this.removeClass('vjs-audio-poster-mode');\n this.trigger('audiopostermodechange');\n }\n\n /**\n * Get the current audioPosterMode state or set audioPosterMode to true or false\n *\n * @param {boolean} [value]\n * The value to set audioPosterMode to.\n *\n * @return {Promise|boolean}\n * A Promise is returned when setting the state, and a boolean when getting\n * the present state\n */\n audioPosterMode(value) {\n if (typeof value !== 'boolean' || value === this.audioPosterMode_) {\n return this.audioPosterMode_;\n }\n this.audioPosterMode_ = value;\n if (value) {\n if (this.audioOnlyMode()) {\n const audioOnlyModePromise = this.audioOnlyMode(false);\n return audioOnlyModePromise.then(() => {\n // enable audio poster mode after audio only mode is disabled\n this.enablePosterModeUI_();\n });\n }\n return Promise.resolve().then(() => {\n // enable audio poster mode\n this.enablePosterModeUI_();\n });\n }\n return Promise.resolve().then(() => {\n // disable audio poster mode\n this.disablePosterModeUI_();\n });\n }\n\n /**\n * A helper method for adding a {@link TextTrack} to our\n * {@link TextTrackList}.\n *\n * In addition to the W3C settings we allow adding additional info through options.\n *\n * @see http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-addtexttrack\n *\n * @param {string} [kind]\n * the kind of TextTrack you are adding\n *\n * @param {string} [label]\n * the label to give the TextTrack label\n *\n * @param {string} [language]\n * the language to set on the TextTrack\n *\n * @return {TextTrack|undefined}\n * the TextTrack that was added or undefined\n * if there is no tech\n */\n addTextTrack(kind, label, language) {\n if (this.tech_) {\n return this.tech_.addTextTrack(kind, label, language);\n }\n }\n\n /**\n * Create a remote {@link TextTrack} and an {@link HTMLTrackElement}.\n *\n * @param {Object} options\n * Options to pass to {@link HTMLTrackElement} during creation. See\n * {@link HTMLTrackElement} for object properties that you should use.\n *\n * @param {boolean} [manualCleanup=false] if set to true, the TextTrack will not be removed\n * from the TextTrackList and HtmlTrackElementList\n * after a source change\n *\n * @return { import('./tracks/html-track-element').default }\n * the HTMLTrackElement that was created and added\n * to the HtmlTrackElementList and the remote\n * TextTrackList\n *\n */\n addRemoteTextTrack(options, manualCleanup) {\n if (this.tech_) {\n return this.tech_.addRemoteTextTrack(options, manualCleanup);\n }\n }\n\n /**\n * Remove a remote {@link TextTrack} from the respective\n * {@link TextTrackList} and {@link HtmlTrackElementList}.\n *\n * @param {Object} track\n * Remote {@link TextTrack} to remove\n *\n * @return {undefined}\n * does not return anything\n */\n removeRemoteTextTrack(obj = {}) {\n let {\n track\n } = obj;\n if (!track) {\n track = obj;\n }\n\n // destructure the input into an object with a track argument, defaulting to arguments[0]\n // default the whole argument to an empty object if nothing was passed in\n\n if (this.tech_) {\n return this.tech_.removeRemoteTextTrack(track);\n }\n }\n\n /**\n * Gets available media playback quality metrics as specified by the W3C's Media\n * Playback Quality API.\n *\n * @see [Spec]{@link https://wicg.github.io/media-playback-quality}\n *\n * @return {Object|undefined}\n * An object with supported media playback quality metrics or undefined if there\n * is no tech or the tech does not support it.\n */\n getVideoPlaybackQuality() {\n return this.techGet_('getVideoPlaybackQuality');\n }\n\n /**\n * Get video width\n *\n * @return {number}\n * current video width\n */\n videoWidth() {\n return this.tech_ && this.tech_.videoWidth && this.tech_.videoWidth() || 0;\n }\n\n /**\n * Get video height\n *\n * @return {number}\n * current video height\n */\n videoHeight() {\n return this.tech_ && this.tech_.videoHeight && this.tech_.videoHeight() || 0;\n }\n\n /**\n * Set or get the player's language code.\n *\n * Changing the language will trigger\n * [languagechange]{@link Player#event:languagechange}\n * which Components can use to update control text.\n * ClickableComponent will update its control text by default on\n * [languagechange]{@link Player#event:languagechange}.\n *\n * @fires Player#languagechange\n *\n * @param {string} [code]\n * the language code to set the player to\n *\n * @return {string|undefined}\n * - The current language code when getting\n * - Nothing when setting\n */\n language(code) {\n if (code === undefined) {\n return this.language_;\n }\n if (this.language_ !== String(code).toLowerCase()) {\n this.language_ = String(code).toLowerCase();\n\n // during first init, it's possible some things won't be evented\n if (isEvented(this)) {\n /**\n * fires when the player language change\n *\n * @event Player#languagechange\n * @type {Event}\n */\n this.trigger('languagechange');\n }\n }\n }\n\n /**\n * Get the player's language dictionary\n * Merge every time, because a newly added plugin might call videojs.addLanguage() at any time\n * Languages specified directly in the player options have precedence\n *\n * @return {Array}\n * An array of of supported languages\n */\n languages() {\n return merge$1(Player.prototype.options_.languages, this.languages_);\n }\n\n /**\n * returns a JavaScript object representing the current track\n * information. **DOES not return it as JSON**\n *\n * @return {Object}\n * Object representing the current of track info\n */\n toJSON() {\n const options = merge$1(this.options_);\n const tracks = options.tracks;\n options.tracks = [];\n for (let i = 0; i < tracks.length; i++) {\n let track = tracks[i];\n\n // deep merge tracks and null out player so no circular references\n track = merge$1(track);\n track.player = undefined;\n options.tracks[i] = track;\n }\n return options;\n }\n\n /**\n * Creates a simple modal dialog (an instance of the {@link ModalDialog}\n * component) that immediately overlays the player with arbitrary\n * content and removes itself when closed.\n *\n * @param {string|Function|Element|Array|null} content\n * Same as {@link ModalDialog#content}'s param of the same name.\n * The most straight-forward usage is to provide a string or DOM\n * element.\n *\n * @param {Object} [options]\n * Extra options which will be passed on to the {@link ModalDialog}.\n *\n * @return {ModalDialog}\n * the {@link ModalDialog} that was created\n */\n createModal(content, options) {\n options = options || {};\n options.content = content || '';\n const modal = new ModalDialog(this, options);\n this.addChild(modal);\n modal.on('dispose', () => {\n this.removeChild(modal);\n });\n modal.open();\n return modal;\n }\n\n /**\n * Change breakpoint classes when the player resizes.\n *\n * @private\n */\n updateCurrentBreakpoint_() {\n if (!this.responsive()) {\n return;\n }\n const currentBreakpoint = this.currentBreakpoint();\n const currentWidth = this.currentWidth();\n for (let i = 0; i < BREAKPOINT_ORDER.length; i++) {\n const candidateBreakpoint = BREAKPOINT_ORDER[i];\n const maxWidth = this.breakpoints_[candidateBreakpoint];\n if (currentWidth <= maxWidth) {\n // The current breakpoint did not change, nothing to do.\n if (currentBreakpoint === candidateBreakpoint) {\n return;\n }\n\n // Only remove a class if there is a current breakpoint.\n if (currentBreakpoint) {\n this.removeClass(BREAKPOINT_CLASSES[currentBreakpoint]);\n }\n this.addClass(BREAKPOINT_CLASSES[candidateBreakpoint]);\n this.breakpoint_ = candidateBreakpoint;\n break;\n }\n }\n }\n\n /**\n * Removes the current breakpoint.\n *\n * @private\n */\n removeCurrentBreakpoint_() {\n const className = this.currentBreakpointClass();\n this.breakpoint_ = '';\n if (className) {\n this.removeClass(className);\n }\n }\n\n /**\n * Get or set breakpoints on the player.\n *\n * Calling this method with an object or `true` will remove any previous\n * custom breakpoints and start from the defaults again.\n *\n * @param {Object|boolean} [breakpoints]\n * If an object is given, it can be used to provide custom\n * breakpoints. If `true` is given, will set default breakpoints.\n * If this argument is not given, will simply return the current\n * breakpoints.\n *\n * @param {number} [breakpoints.tiny]\n * The maximum width for the \"vjs-layout-tiny\" class.\n *\n * @param {number} [breakpoints.xsmall]\n * The maximum width for the \"vjs-layout-x-small\" class.\n *\n * @param {number} [breakpoints.small]\n * The maximum width for the \"vjs-layout-small\" class.\n *\n * @param {number} [breakpoints.medium]\n * The maximum width for the \"vjs-layout-medium\" class.\n *\n * @param {number} [breakpoints.large]\n * The maximum width for the \"vjs-layout-large\" class.\n *\n * @param {number} [breakpoints.xlarge]\n * The maximum width for the \"vjs-layout-x-large\" class.\n *\n * @param {number} [breakpoints.huge]\n * The maximum width for the \"vjs-layout-huge\" class.\n *\n * @return {Object}\n * An object mapping breakpoint names to maximum width values.\n */\n breakpoints(breakpoints) {\n // Used as a getter.\n if (breakpoints === undefined) {\n return Object.assign(this.breakpoints_);\n }\n this.breakpoint_ = '';\n this.breakpoints_ = Object.assign({}, DEFAULT_BREAKPOINTS, breakpoints);\n\n // When breakpoint definitions change, we need to update the currently\n // selected breakpoint.\n this.updateCurrentBreakpoint_();\n\n // Clone the breakpoints before returning.\n return Object.assign(this.breakpoints_);\n }\n\n /**\n * Get or set a flag indicating whether or not this player should adjust\n * its UI based on its dimensions.\n *\n * @param {boolean} [value]\n * Should be `true` if the player should adjust its UI based on its\n * dimensions; otherwise, should be `false`.\n *\n * @return {boolean|undefined}\n * Will be `true` if this player should adjust its UI based on its\n * dimensions; otherwise, will be `false`.\n * Nothing if setting\n */\n responsive(value) {\n // Used as a getter.\n if (value === undefined) {\n return this.responsive_;\n }\n value = Boolean(value);\n const current = this.responsive_;\n\n // Nothing changed.\n if (value === current) {\n return;\n }\n\n // The value actually changed, set it.\n this.responsive_ = value;\n\n // Start listening for breakpoints and set the initial breakpoint if the\n // player is now responsive.\n if (value) {\n this.on('playerresize', this.boundUpdateCurrentBreakpoint_);\n this.updateCurrentBreakpoint_();\n\n // Stop listening for breakpoints if the player is no longer responsive.\n } else {\n this.off('playerresize', this.boundUpdateCurrentBreakpoint_);\n this.removeCurrentBreakpoint_();\n }\n return value;\n }\n\n /**\n * Get current breakpoint name, if any.\n *\n * @return {string}\n * If there is currently a breakpoint set, returns a the key from the\n * breakpoints object matching it. Otherwise, returns an empty string.\n */\n currentBreakpoint() {\n return this.breakpoint_;\n }\n\n /**\n * Get the current breakpoint class name.\n *\n * @return {string}\n * The matching class name (e.g. `\"vjs-layout-tiny\"` or\n * `\"vjs-layout-large\"`) for the current breakpoint. Empty string if\n * there is no current breakpoint.\n */\n currentBreakpointClass() {\n return BREAKPOINT_CLASSES[this.breakpoint_] || '';\n }\n\n /**\n * An object that describes a single piece of media.\n *\n * Properties that are not part of this type description will be retained; so,\n * this can be viewed as a generic metadata storage mechanism as well.\n *\n * @see {@link https://wicg.github.io/mediasession/#the-mediametadata-interface}\n * @typedef {Object} Player~MediaObject\n *\n * @property {string} [album]\n * Unused, except if this object is passed to the `MediaSession`\n * API.\n *\n * @property {string} [artist]\n * Unused, except if this object is passed to the `MediaSession`\n * API.\n *\n * @property {Object[]} [artwork]\n * Unused, except if this object is passed to the `MediaSession`\n * API. If not specified, will be populated via the `poster`, if\n * available.\n *\n * @property {string} [poster]\n * URL to an image that will display before playback.\n *\n * @property {Tech~SourceObject|Tech~SourceObject[]|string} [src]\n * A single source object, an array of source objects, or a string\n * referencing a URL to a media source. It is _highly recommended_\n * that an object or array of objects is used here, so that source\n * selection algorithms can take the `type` into account.\n *\n * @property {string} [title]\n * Unused, except if this object is passed to the `MediaSession`\n * API.\n *\n * @property {Object[]} [textTracks]\n * An array of objects to be used to create text tracks, following\n * the {@link https://www.w3.org/TR/html50/embedded-content-0.html#the-track-element|native track element format}.\n * For ease of removal, these will be created as \"remote\" text\n * tracks and set to automatically clean up on source changes.\n *\n * These objects may have properties like `src`, `kind`, `label`,\n * and `language`, see {@link Tech#createRemoteTextTrack}.\n */\n\n /**\n * Populate the player using a {@link Player~MediaObject|MediaObject}.\n *\n * @param {Player~MediaObject} media\n * A media object.\n *\n * @param {Function} ready\n * A callback to be called when the player is ready.\n */\n loadMedia(media, ready) {\n if (!media || typeof media !== 'object') {\n return;\n }\n const crossOrigin = this.crossOrigin();\n this.reset();\n\n // Clone the media object so it cannot be mutated from outside.\n this.cache_.media = merge$1(media);\n const {\n artist,\n artwork,\n description,\n poster,\n src,\n textTracks,\n title\n } = this.cache_.media;\n\n // If `artwork` is not given, create it using `poster`.\n if (!artwork && poster) {\n this.cache_.media.artwork = [{\n src: poster,\n type: getMimetype(poster)\n }];\n }\n if (crossOrigin) {\n this.crossOrigin(crossOrigin);\n }\n if (src) {\n this.src(src);\n }\n if (poster) {\n this.poster(poster);\n }\n if (Array.isArray(textTracks)) {\n textTracks.forEach(tt => this.addRemoteTextTrack(tt, false));\n }\n if (this.titleBar) {\n this.titleBar.update({\n title,\n description: description || artist || ''\n });\n }\n this.ready(ready);\n }\n\n /**\n * Get a clone of the current {@link Player~MediaObject} for this player.\n *\n * If the `loadMedia` method has not been used, will attempt to return a\n * {@link Player~MediaObject} based on the current state of the player.\n *\n * @return {Player~MediaObject}\n */\n getMedia() {\n if (!this.cache_.media) {\n const poster = this.poster();\n const src = this.currentSources();\n const textTracks = Array.prototype.map.call(this.remoteTextTracks(), tt => ({\n kind: tt.kind,\n label: tt.label,\n language: tt.language,\n src: tt.src\n }));\n const media = {\n src,\n textTracks\n };\n if (poster) {\n media.poster = poster;\n media.artwork = [{\n src: media.poster,\n type: getMimetype(media.poster)\n }];\n }\n return media;\n }\n return merge$1(this.cache_.media);\n }\n\n /**\n * Gets tag settings\n *\n * @param {Element} tag\n * The player tag\n *\n * @return {Object}\n * An object containing all of the settings\n * for a player tag\n */\n static getTagSettings(tag) {\n const baseOptions = {\n sources: [],\n tracks: []\n };\n const tagOptions = getAttributes(tag);\n const dataSetup = tagOptions['data-setup'];\n if (hasClass(tag, 'vjs-fill')) {\n tagOptions.fill = true;\n }\n if (hasClass(tag, 'vjs-fluid')) {\n tagOptions.fluid = true;\n }\n\n // Check if data-setup attr exists.\n if (dataSetup !== null) {\n // Parse options JSON\n // If empty string, make it a parsable json object.\n const [err, data] = safeParseTuple(dataSetup || '{}');\n if (err) {\n log$1.error(err);\n }\n Object.assign(tagOptions, data);\n }\n Object.assign(baseOptions, tagOptions);\n\n // Get tag children settings\n if (tag.hasChildNodes()) {\n const children = tag.childNodes;\n for (let i = 0, j = children.length; i < j; i++) {\n const child = children[i];\n // Change case needed: http://ejohn.org/blog/nodename-case-sensitivity/\n const childName = child.nodeName.toLowerCase();\n if (childName === 'source') {\n baseOptions.sources.push(getAttributes(child));\n } else if (childName === 'track') {\n baseOptions.tracks.push(getAttributes(child));\n }\n }\n }\n return baseOptions;\n }\n\n /**\n * Set debug mode to enable/disable logs at info level.\n *\n * @param {boolean} enabled\n * @fires Player#debugon\n * @fires Player#debugoff\n * @return {boolean|undefined}\n */\n debug(enabled) {\n if (enabled === undefined) {\n return this.debugEnabled_;\n }\n if (enabled) {\n this.trigger('debugon');\n this.previousLogLevel_ = this.log.level;\n this.log.level('debug');\n this.debugEnabled_ = true;\n } else {\n this.trigger('debugoff');\n this.log.level(this.previousLogLevel_);\n this.previousLogLevel_ = undefined;\n this.debugEnabled_ = false;\n }\n }\n\n /**\n * Set or get current playback rates.\n * Takes an array and updates the playback rates menu with the new items.\n * Pass in an empty array to hide the menu.\n * Values other than arrays are ignored.\n *\n * @fires Player#playbackrateschange\n * @param {number[]} newRates\n * The new rates that the playback rates menu should update to.\n * An empty array will hide the menu\n * @return {number[]} When used as a getter will return the current playback rates\n */\n playbackRates(newRates) {\n if (newRates === undefined) {\n return this.cache_.playbackRates;\n }\n\n // ignore any value that isn't an array\n if (!Array.isArray(newRates)) {\n return;\n }\n\n // ignore any arrays that don't only contain numbers\n if (!newRates.every(rate => typeof rate === 'number')) {\n return;\n }\n this.cache_.playbackRates = newRates;\n\n /**\n * fires when the playback rates in a player are changed\n *\n * @event Player#playbackrateschange\n * @type {Event}\n */\n this.trigger('playbackrateschange');\n }\n}\n\n/**\n * Get the {@link VideoTrackList}\n *\n * @link https://html.spec.whatwg.org/multipage/embedded-content.html#videotracklist\n *\n * @return {VideoTrackList}\n * the current video track list\n *\n * @method Player.prototype.videoTracks\n */\n\n/**\n * Get the {@link AudioTrackList}\n *\n * @link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotracklist\n *\n * @return {AudioTrackList}\n * the current audio track list\n *\n * @method Player.prototype.audioTracks\n */\n\n/**\n * Get the {@link TextTrackList}\n *\n * @link http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-texttracks\n *\n * @return {TextTrackList}\n * the current text track list\n *\n * @method Player.prototype.textTracks\n */\n\n/**\n * Get the remote {@link TextTrackList}\n *\n * @return {TextTrackList}\n * The current remote text track list\n *\n * @method Player.prototype.remoteTextTracks\n */\n\n/**\n * Get the remote {@link HtmlTrackElementList} tracks.\n *\n * @return {HtmlTrackElementList}\n * The current remote text track element list\n *\n * @method Player.prototype.remoteTextTrackEls\n */\n\nALL.names.forEach(function (name) {\n const props = ALL[name];\n Player.prototype[props.getterName] = function () {\n if (this.tech_) {\n return this.tech_[props.getterName]();\n }\n\n // if we have not yet loadTech_, we create {video,audio,text}Tracks_\n // these will be passed to the tech during loading\n this[props.privateName] = this[props.privateName] || new props.ListClass();\n return this[props.privateName];\n };\n});\n\n/**\n * Get or set the `Player`'s crossorigin option. For the HTML5 player, this\n * sets the `crossOrigin` property on the `<video>` tag to control the CORS\n * behavior.\n *\n * @see [Video Element Attributes]{@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#attr-crossorigin}\n *\n * @param {string} [value]\n * The value to set the `Player`'s crossorigin to. If an argument is\n * given, must be one of `anonymous` or `use-credentials`.\n *\n * @return {string|undefined}\n * - The current crossorigin value of the `Player` when getting.\n * - undefined when setting\n */\nPlayer.prototype.crossorigin = Player.prototype.crossOrigin;\n\n/**\n * Global enumeration of players.\n *\n * The keys are the player IDs and the values are either the {@link Player}\n * instance or `null` for disposed players.\n *\n * @type {Object}\n */\nPlayer.players = {};\nconst navigator = window$1.navigator;\n\n/*\n * Player instance options, surfaced using options\n * options = Player.prototype.options_\n * Make changes in options, not here.\n *\n * @type {Object}\n * @private\n */\nPlayer.prototype.options_ = {\n // Default order of fallback technology\n techOrder: Tech.defaultTechOrder_,\n html5: {},\n // enable sourceset by default\n enableSourceset: true,\n // default inactivity timeout\n inactivityTimeout: 2000,\n // default playback rates\n playbackRates: [],\n // Add playback rate selection by adding rates\n // 'playbackRates': [0.5, 1, 1.5, 2],\n liveui: false,\n // Included control sets\n children: ['mediaLoader', 'posterImage', 'titleBar', 'textTrackDisplay', 'loadingSpinner', 'bigPlayButton', 'liveTracker', 'controlBar', 'errorDisplay', 'textTrackSettings', 'resizeManager'],\n language: navigator && (navigator.languages && navigator.languages[0] || navigator.userLanguage || navigator.language) || 'en',\n // locales and their language translations\n languages: {},\n // Default message to show when a video cannot be played.\n notSupportedMessage: 'No compatible source was found for this media.',\n normalizeAutoplay: false,\n fullscreen: {\n options: {\n navigationUI: 'hide'\n }\n },\n breakpoints: {},\n responsive: false,\n audioOnlyMode: false,\n audioPosterMode: false\n};\n[\n/**\n * Returns whether or not the player is in the \"ended\" state.\n *\n * @return {Boolean} True if the player is in the ended state, false if not.\n * @method Player#ended\n */\n'ended',\n/**\n * Returns whether or not the player is in the \"seeking\" state.\n *\n * @return {Boolean} True if the player is in the seeking state, false if not.\n * @method Player#seeking\n */\n'seeking',\n/**\n * Returns the TimeRanges of the media that are currently available\n * for seeking to.\n *\n * @return {TimeRanges} the seekable intervals of the media timeline\n * @method Player#seekable\n */\n'seekable',\n/**\n * Returns the current state of network activity for the element, from\n * the codes in the list below.\n * - NETWORK_EMPTY (numeric value 0)\n * The element has not yet been initialised. All attributes are in\n * their initial states.\n * - NETWORK_IDLE (numeric value 1)\n * The element's resource selection algorithm is active and has\n * selected a resource, but it is not actually using the network at\n * this time.\n * - NETWORK_LOADING (numeric value 2)\n * The user agent is actively trying to download data.\n * - NETWORK_NO_SOURCE (numeric value 3)\n * The element's resource selection algorithm is active, but it has\n * not yet found a resource to use.\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#network-states\n * @return {number} the current network activity state\n * @method Player#networkState\n */\n'networkState',\n/**\n * Returns a value that expresses the current state of the element\n * with respect to rendering the current playback position, from the\n * codes in the list below.\n * - HAVE_NOTHING (numeric value 0)\n * No information regarding the media resource is available.\n * - HAVE_METADATA (numeric value 1)\n * Enough of the resource has been obtained that the duration of the\n * resource is available.\n * - HAVE_CURRENT_DATA (numeric value 2)\n * Data for the immediate current playback position is available.\n * - HAVE_FUTURE_DATA (numeric value 3)\n * Data for the immediate current playback position is available, as\n * well as enough data for the user agent to advance the current\n * playback position in the direction of playback.\n * - HAVE_ENOUGH_DATA (numeric value 4)\n * The user agent estimates that enough data is available for\n * playback to proceed uninterrupted.\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-readystate\n * @return {number} the current playback rendering state\n * @method Player#readyState\n */\n'readyState'].forEach(function (fn) {\n Player.prototype[fn] = function () {\n return this.techGet_(fn);\n };\n});\nTECH_EVENTS_RETRIGGER.forEach(function (event) {\n Player.prototype[`handleTech${toTitleCase$1(event)}_`] = function () {\n return this.trigger(event);\n };\n});\n\n/**\n * Fired when the player has initial duration and dimension information\n *\n * @event Player#loadedmetadata\n * @type {Event}\n */\n\n/**\n * Fired when the player has downloaded data at the current playback position\n *\n * @event Player#loadeddata\n * @type {Event}\n */\n\n/**\n * Fired when the current playback position has changed *\n * During playback this is fired every 15-250 milliseconds, depending on the\n * playback technology in use.\n *\n * @event Player#timeupdate\n * @type {Event}\n */\n\n/**\n * Fired when the volume changes\n *\n * @event Player#volumechange\n * @type {Event}\n */\n\n/**\n * Reports whether or not a player has a plugin available.\n *\n * This does not report whether or not the plugin has ever been initialized\n * on this player. For that, [usingPlugin]{@link Player#usingPlugin}.\n *\n * @method Player#hasPlugin\n * @param {string} name\n * The name of a plugin.\n *\n * @return {boolean}\n * Whether or not this player has the requested plugin available.\n */\n\n/**\n * Reports whether or not a player is using a plugin by name.\n *\n * For basic plugins, this only reports whether the plugin has _ever_ been\n * initialized on this player.\n *\n * @method Player#usingPlugin\n * @param {string} name\n * The name of a plugin.\n *\n * @return {boolean}\n * Whether or not this player is using the requested plugin.\n */\n\nComponent$1.registerComponent('Player', Player);\n\n/**\n * @file plugin.js\n */\n\n/**\n * The base plugin name.\n *\n * @private\n * @constant\n * @type {string}\n */\nconst BASE_PLUGIN_NAME = 'plugin';\n\n/**\n * The key on which a player's active plugins cache is stored.\n *\n * @private\n * @constant\n * @type {string}\n */\nconst PLUGIN_CACHE_KEY = 'activePlugins_';\n\n/**\n * Stores registered plugins in a private space.\n *\n * @private\n * @type {Object}\n */\nconst pluginStorage = {};\n\n/**\n * Reports whether or not a plugin has been registered.\n *\n * @private\n * @param {string} name\n * The name of a plugin.\n *\n * @return {boolean}\n * Whether or not the plugin has been registered.\n */\nconst pluginExists = name => pluginStorage.hasOwnProperty(name);\n\n/**\n * Get a single registered plugin by name.\n *\n * @private\n * @param {string} name\n * The name of a plugin.\n *\n * @return {typeof Plugin|Function|undefined}\n * The plugin (or undefined).\n */\nconst getPlugin = name => pluginExists(name) ? pluginStorage[name] : undefined;\n\n/**\n * Marks a plugin as \"active\" on a player.\n *\n * Also, ensures that the player has an object for tracking active plugins.\n *\n * @private\n * @param {Player} player\n * A Video.js player instance.\n *\n * @param {string} name\n * The name of a plugin.\n */\nconst markPluginAsActive = (player, name) => {\n player[PLUGIN_CACHE_KEY] = player[PLUGIN_CACHE_KEY] || {};\n player[PLUGIN_CACHE_KEY][name] = true;\n};\n\n/**\n * Triggers a pair of plugin setup events.\n *\n * @private\n * @param {Player} player\n * A Video.js player instance.\n *\n * @param {PluginEventHash} hash\n * A plugin event hash.\n *\n * @param {boolean} [before]\n * If true, prefixes the event name with \"before\". In other words,\n * use this to trigger \"beforepluginsetup\" instead of \"pluginsetup\".\n */\nconst triggerSetupEvent = (player, hash, before) => {\n const eventName = (before ? 'before' : '') + 'pluginsetup';\n player.trigger(eventName, hash);\n player.trigger(eventName + ':' + hash.name, hash);\n};\n\n/**\n * Takes a basic plugin function and returns a wrapper function which marks\n * on the player that the plugin has been activated.\n *\n * @private\n * @param {string} name\n * The name of the plugin.\n *\n * @param {Function} plugin\n * The basic plugin.\n *\n * @return {Function}\n * A wrapper function for the given plugin.\n */\nconst createBasicPlugin = function (name, plugin) {\n const basicPluginWrapper = function () {\n // We trigger the \"beforepluginsetup\" and \"pluginsetup\" events on the player\n // regardless, but we want the hash to be consistent with the hash provided\n // for advanced plugins.\n //\n // The only potentially counter-intuitive thing here is the `instance` in\n // the \"pluginsetup\" event is the value returned by the `plugin` function.\n triggerSetupEvent(this, {\n name,\n plugin,\n instance: null\n }, true);\n const instance = plugin.apply(this, arguments);\n markPluginAsActive(this, name);\n triggerSetupEvent(this, {\n name,\n plugin,\n instance\n });\n return instance;\n };\n Object.keys(plugin).forEach(function (prop) {\n basicPluginWrapper[prop] = plugin[prop];\n });\n return basicPluginWrapper;\n};\n\n/**\n * Takes a plugin sub-class and returns a factory function for generating\n * instances of it.\n *\n * This factory function will replace itself with an instance of the requested\n * sub-class of Plugin.\n *\n * @private\n * @param {string} name\n * The name of the plugin.\n *\n * @param {Plugin} PluginSubClass\n * The advanced plugin.\n *\n * @return {Function}\n */\nconst createPluginFactory = (name, PluginSubClass) => {\n // Add a `name` property to the plugin prototype so that each plugin can\n // refer to itself by name.\n PluginSubClass.prototype.name = name;\n return function (...args) {\n triggerSetupEvent(this, {\n name,\n plugin: PluginSubClass,\n instance: null\n }, true);\n const instance = new PluginSubClass(...[this, ...args]);\n\n // The plugin is replaced by a function that returns the current instance.\n this[name] = () => instance;\n triggerSetupEvent(this, instance.getEventHash());\n return instance;\n };\n};\n\n/**\n * Parent class for all advanced plugins.\n *\n * @mixes module:evented~EventedMixin\n * @mixes module:stateful~StatefulMixin\n * @fires Player#beforepluginsetup\n * @fires Player#beforepluginsetup:$name\n * @fires Player#pluginsetup\n * @fires Player#pluginsetup:$name\n * @listens Player#dispose\n * @throws {Error}\n * If attempting to instantiate the base {@link Plugin} class\n * directly instead of via a sub-class.\n */\nclass Plugin {\n /**\n * Creates an instance of this class.\n *\n * Sub-classes should call `super` to ensure plugins are properly initialized.\n *\n * @param {Player} player\n * A Video.js player instance.\n */\n constructor(player) {\n if (this.constructor === Plugin) {\n throw new Error('Plugin must be sub-classed; not directly instantiated.');\n }\n this.player = player;\n if (!this.log) {\n this.log = this.player.log.createLogger(this.name);\n }\n\n // Make this object evented, but remove the added `trigger` method so we\n // use the prototype version instead.\n evented(this);\n delete this.trigger;\n stateful(this, this.constructor.defaultState);\n markPluginAsActive(player, this.name);\n\n // Auto-bind the dispose method so we can use it as a listener and unbind\n // it later easily.\n this.dispose = this.dispose.bind(this);\n\n // If the player is disposed, dispose the plugin.\n player.on('dispose', this.dispose);\n }\n\n /**\n * Get the version of the plugin that was set on <pluginName>.VERSION\n */\n version() {\n return this.constructor.VERSION;\n }\n\n /**\n * Each event triggered by plugins includes a hash of additional data with\n * conventional properties.\n *\n * This returns that object or mutates an existing hash.\n *\n * @param {Object} [hash={}]\n * An object to be used as event an event hash.\n *\n * @return {PluginEventHash}\n * An event hash object with provided properties mixed-in.\n */\n getEventHash(hash = {}) {\n hash.name = this.name;\n hash.plugin = this.constructor;\n hash.instance = this;\n return hash;\n }\n\n /**\n * Triggers an event on the plugin object and overrides\n * {@link module:evented~EventedMixin.trigger|EventedMixin.trigger}.\n *\n * @param {string|Object} event\n * An event type or an object with a type property.\n *\n * @param {Object} [hash={}]\n * Additional data hash to merge with a\n * {@link PluginEventHash|PluginEventHash}.\n *\n * @return {boolean}\n * Whether or not default was prevented.\n */\n trigger(event, hash = {}) {\n return trigger(this.eventBusEl_, event, this.getEventHash(hash));\n }\n\n /**\n * Handles \"statechanged\" events on the plugin. No-op by default, override by\n * subclassing.\n *\n * @abstract\n * @param {Event} e\n * An event object provided by a \"statechanged\" event.\n *\n * @param {Object} e.changes\n * An object describing changes that occurred with the \"statechanged\"\n * event.\n */\n handleStateChanged(e) {}\n\n /**\n * Disposes a plugin.\n *\n * Subclasses can override this if they want, but for the sake of safety,\n * it's probably best to subscribe the \"dispose\" event.\n *\n * @fires Plugin#dispose\n */\n dispose() {\n const {\n name,\n player\n } = this;\n\n /**\n * Signals that a advanced plugin is about to be disposed.\n *\n * @event Plugin#dispose\n * @type {Event}\n */\n this.trigger('dispose');\n this.off();\n player.off('dispose', this.dispose);\n\n // Eliminate any possible sources of leaking memory by clearing up\n // references between the player and the plugin instance and nulling out\n // the plugin's state and replacing methods with a function that throws.\n player[PLUGIN_CACHE_KEY][name] = false;\n this.player = this.state = null;\n\n // Finally, replace the plugin name on the player with a new factory\n // function, so that the plugin is ready to be set up again.\n player[name] = createPluginFactory(name, pluginStorage[name]);\n }\n\n /**\n * Determines if a plugin is a basic plugin (i.e. not a sub-class of `Plugin`).\n *\n * @param {string|Function} plugin\n * If a string, matches the name of a plugin. If a function, will be\n * tested directly.\n *\n * @return {boolean}\n * Whether or not a plugin is a basic plugin.\n */\n static isBasic(plugin) {\n const p = typeof plugin === 'string' ? getPlugin(plugin) : plugin;\n return typeof p === 'function' && !Plugin.prototype.isPrototypeOf(p.prototype);\n }\n\n /**\n * Register a Video.js plugin.\n *\n * @param {string} name\n * The name of the plugin to be registered. Must be a string and\n * must not match an existing plugin or a method on the `Player`\n * prototype.\n *\n * @param {typeof Plugin|Function} plugin\n * A sub-class of `Plugin` or a function for basic plugins.\n *\n * @return {typeof Plugin|Function}\n * For advanced plugins, a factory function for that plugin. For\n * basic plugins, a wrapper function that initializes the plugin.\n */\n static registerPlugin(name, plugin) {\n if (typeof name !== 'string') {\n throw new Error(`Illegal plugin name, \"${name}\", must be a string, was ${typeof name}.`);\n }\n if (pluginExists(name)) {\n log$1.warn(`A plugin named \"${name}\" already exists. You may want to avoid re-registering plugins!`);\n } else if (Player.prototype.hasOwnProperty(name)) {\n throw new Error(`Illegal plugin name, \"${name}\", cannot share a name with an existing player method!`);\n }\n if (typeof plugin !== 'function') {\n throw new Error(`Illegal plugin for \"${name}\", must be a function, was ${typeof plugin}.`);\n }\n pluginStorage[name] = plugin;\n\n // Add a player prototype method for all sub-classed plugins (but not for\n // the base Plugin class).\n if (name !== BASE_PLUGIN_NAME) {\n if (Plugin.isBasic(plugin)) {\n Player.prototype[name] = createBasicPlugin(name, plugin);\n } else {\n Player.prototype[name] = createPluginFactory(name, plugin);\n }\n }\n return plugin;\n }\n\n /**\n * De-register a Video.js plugin.\n *\n * @param {string} name\n * The name of the plugin to be de-registered. Must be a string that\n * matches an existing plugin.\n *\n * @throws {Error}\n * If an attempt is made to de-register the base plugin.\n */\n static deregisterPlugin(name) {\n if (name === BASE_PLUGIN_NAME) {\n throw new Error('Cannot de-register base plugin.');\n }\n if (pluginExists(name)) {\n delete pluginStorage[name];\n delete Player.prototype[name];\n }\n }\n\n /**\n * Gets an object containing multiple Video.js plugins.\n *\n * @param {Array} [names]\n * If provided, should be an array of plugin names. Defaults to _all_\n * plugin names.\n *\n * @return {Object|undefined}\n * An object containing plugin(s) associated with their name(s) or\n * `undefined` if no matching plugins exist).\n */\n static getPlugins(names = Object.keys(pluginStorage)) {\n let result;\n names.forEach(name => {\n const plugin = getPlugin(name);\n if (plugin) {\n result = result || {};\n result[name] = plugin;\n }\n });\n return result;\n }\n\n /**\n * Gets a plugin's version, if available\n *\n * @param {string} name\n * The name of a plugin.\n *\n * @return {string}\n * The plugin's version or an empty string.\n */\n static getPluginVersion(name) {\n const plugin = getPlugin(name);\n return plugin && plugin.VERSION || '';\n }\n}\n\n/**\n * Gets a plugin by name if it exists.\n *\n * @static\n * @method getPlugin\n * @memberOf Plugin\n * @param {string} name\n * The name of a plugin.\n *\n * @returns {typeof Plugin|Function|undefined}\n * The plugin (or `undefined`).\n */\nPlugin.getPlugin = getPlugin;\n\n/**\n * The name of the base plugin class as it is registered.\n *\n * @type {string}\n */\nPlugin.BASE_PLUGIN_NAME = BASE_PLUGIN_NAME;\nPlugin.registerPlugin(BASE_PLUGIN_NAME, Plugin);\n\n/**\n * Documented in player.js\n *\n * @ignore\n */\nPlayer.prototype.usingPlugin = function (name) {\n return !!this[PLUGIN_CACHE_KEY] && this[PLUGIN_CACHE_KEY][name] === true;\n};\n\n/**\n * Documented in player.js\n *\n * @ignore\n */\nPlayer.prototype.hasPlugin = function (name) {\n return !!pluginExists(name);\n};\n\n/**\n * Signals that a plugin is about to be set up on a player.\n *\n * @event Player#beforepluginsetup\n * @type {PluginEventHash}\n */\n\n/**\n * Signals that a plugin is about to be set up on a player - by name. The name\n * is the name of the plugin.\n *\n * @event Player#beforepluginsetup:$name\n * @type {PluginEventHash}\n */\n\n/**\n * Signals that a plugin has just been set up on a player.\n *\n * @event Player#pluginsetup\n * @type {PluginEventHash}\n */\n\n/**\n * Signals that a plugin has just been set up on a player - by name. The name\n * is the name of the plugin.\n *\n * @event Player#pluginsetup:$name\n * @type {PluginEventHash}\n */\n\n/**\n * @typedef {Object} PluginEventHash\n *\n * @property {string} instance\n * For basic plugins, the return value of the plugin function. For\n * advanced plugins, the plugin instance on which the event is fired.\n *\n * @property {string} name\n * The name of the plugin.\n *\n * @property {string} plugin\n * For basic plugins, the plugin function. For advanced plugins, the\n * plugin class/constructor.\n */\n\n/**\n * @file deprecate.js\n * @module deprecate\n */\n\n/**\n * Decorate a function with a deprecation message the first time it is called.\n *\n * @param {string} message\n * A deprecation message to log the first time the returned function\n * is called.\n *\n * @param {Function} fn\n * The function to be deprecated.\n *\n * @return {Function}\n * A wrapper function that will log a deprecation warning the first\n * time it is called. The return value will be the return value of\n * the wrapped function.\n */\nfunction deprecate(message, fn) {\n let warned = false;\n return function (...args) {\n if (!warned) {\n log$1.warn(message);\n }\n warned = true;\n return fn.apply(this, args);\n };\n}\n\n/**\n * Internal function used to mark a function as deprecated in the next major\n * version with consistent messaging.\n *\n * @param {number} major The major version where it will be removed\n * @param {string} oldName The old function name\n * @param {string} newName The new function name\n * @param {Function} fn The function to deprecate\n * @return {Function} The decorated function\n */\nfunction deprecateForMajor(major, oldName, newName, fn) {\n return deprecate(`${oldName} is deprecated and will be removed in ${major}.0; please use ${newName} instead.`, fn);\n}\n\n/**\n * @file video.js\n * @module videojs\n */\n\n/**\n * Normalize an `id` value by trimming off a leading `#`\n *\n * @private\n * @param {string} id\n * A string, maybe with a leading `#`.\n *\n * @return {string}\n * The string, without any leading `#`.\n */\nconst normalizeId = id => id.indexOf('#') === 0 ? id.slice(1) : id;\n\n/**\n * A callback that is called when a component is ready. Does not have any\n * parameters and any callback value will be ignored. See: {@link Component~ReadyCallback}\n *\n * @callback ReadyCallback\n */\n\n/**\n * The `videojs()` function doubles as the main function for users to create a\n * {@link Player} instance as well as the main library namespace.\n *\n * It can also be used as a getter for a pre-existing {@link Player} instance.\n * However, we _strongly_ recommend using `videojs.getPlayer()` for this\n * purpose because it avoids any potential for unintended initialization.\n *\n * Due to [limitations](https://github.com/jsdoc3/jsdoc/issues/955#issuecomment-313829149)\n * of our JSDoc template, we cannot properly document this as both a function\n * and a namespace, so its function signature is documented here.\n *\n * #### Arguments\n * ##### id\n * string|Element, **required**\n *\n * Video element or video element ID.\n *\n * ##### options\n * Object, optional\n *\n * Options object for providing settings.\n * See: [Options Guide](https://docs.videojs.com/tutorial-options.html).\n *\n * ##### ready\n * {@link Component~ReadyCallback}, optional\n *\n * A function to be called when the {@link Player} and {@link Tech} are ready.\n *\n * #### Return Value\n *\n * The `videojs()` function returns a {@link Player} instance.\n *\n * @namespace\n *\n * @borrows AudioTrack as AudioTrack\n * @borrows Component.getComponent as getComponent\n * @borrows module:events.on as on\n * @borrows module:events.one as one\n * @borrows module:events.off as off\n * @borrows module:events.trigger as trigger\n * @borrows EventTarget as EventTarget\n * @borrows module:middleware.use as use\n * @borrows Player.players as players\n * @borrows Plugin.registerPlugin as registerPlugin\n * @borrows Plugin.deregisterPlugin as deregisterPlugin\n * @borrows Plugin.getPlugins as getPlugins\n * @borrows Plugin.getPlugin as getPlugin\n * @borrows Plugin.getPluginVersion as getPluginVersion\n * @borrows Tech.getTech as getTech\n * @borrows Tech.registerTech as registerTech\n * @borrows TextTrack as TextTrack\n * @borrows VideoTrack as VideoTrack\n *\n * @param {string|Element} id\n * Video element or video element ID.\n *\n * @param {Object} [options]\n * Options object for providing settings.\n * See: [Options Guide](https://docs.videojs.com/tutorial-options.html).\n *\n * @param {ReadyCallback} [ready]\n * A function to be called when the {@link Player} and {@link Tech} are\n * ready.\n *\n * @return {Player}\n * The `videojs()` function returns a {@link Player|Player} instance.\n */\nfunction videojs(id, options, ready) {\n let player = videojs.getPlayer(id);\n if (player) {\n if (options) {\n log$1.warn(`Player \"${id}\" is already initialised. Options will not be applied.`);\n }\n if (ready) {\n player.ready(ready);\n }\n return player;\n }\n const el = typeof id === 'string' ? $('#' + normalizeId(id)) : id;\n if (!isEl(el)) {\n throw new TypeError('The element or ID supplied is not valid. (videojs)');\n }\n\n // document.body.contains(el) will only check if el is contained within that one document.\n // This causes problems for elements in iframes.\n // Instead, use the element's ownerDocument instead of the global document.\n // This will make sure that the element is indeed in the dom of that document.\n // Additionally, check that the document in question has a default view.\n // If the document is no longer attached to the dom, the defaultView of the document will be null.\n // If element is inside Shadow DOM (e.g. is part of a Custom element), ownerDocument.body\n // always returns false. Instead, use the Shadow DOM root.\n const inShadowDom = 'getRootNode' in el ? el.getRootNode() instanceof window$1.ShadowRoot : false;\n const rootNode = inShadowDom ? el.getRootNode() : el.ownerDocument.body;\n if (!el.ownerDocument.defaultView || !rootNode.contains(el)) {\n log$1.warn('The element supplied is not included in the DOM');\n }\n options = options || {};\n\n // Store a copy of the el before modification, if it is to be restored in destroy()\n // If div ingest, store the parent div\n if (options.restoreEl === true) {\n options.restoreEl = (el.parentNode && el.parentNode.hasAttribute('data-vjs-player') ? el.parentNode : el).cloneNode(true);\n }\n hooks('beforesetup').forEach(hookFunction => {\n const opts = hookFunction(el, merge$1(options));\n if (!isObject(opts) || Array.isArray(opts)) {\n log$1.error('please return an object in beforesetup hooks');\n return;\n }\n options = merge$1(options, opts);\n });\n\n // We get the current \"Player\" component here in case an integration has\n // replaced it with a custom player.\n const PlayerComponent = Component$1.getComponent('Player');\n player = new PlayerComponent(el, options, ready);\n hooks('setup').forEach(hookFunction => hookFunction(player));\n return player;\n}\nvideojs.hooks_ = hooks_;\nvideojs.hooks = hooks;\nvideojs.hook = hook;\nvideojs.hookOnce = hookOnce;\nvideojs.removeHook = removeHook;\n\n// Add default styles\nif (window$1.VIDEOJS_NO_DYNAMIC_STYLE !== true && isReal()) {\n let style = $('.vjs-styles-defaults');\n if (!style) {\n style = createStyleElement('vjs-styles-defaults');\n const head = $('head');\n if (head) {\n head.insertBefore(style, head.firstChild);\n }\n setTextContent(style, `\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: 56.25%\n }\n `);\n }\n}\n\n// Run Auto-load players\n// You have to wait at least once in case this script is loaded after your\n// video in the DOM (weird behavior only with minified version)\nautoSetupTimeout(1, videojs);\n\n/**\n * Current Video.js version. Follows [semantic versioning](https://semver.org/).\n *\n * @type {string}\n */\nvideojs.VERSION = version$6;\n\n/**\n * The global options object. These are the settings that take effect\n * if no overrides are specified when the player is created.\n *\n * @type {Object}\n */\nvideojs.options = Player.prototype.options_;\n\n/**\n * Get an object with the currently created players, keyed by player ID\n *\n * @return {Object}\n * The created players\n */\nvideojs.getPlayers = () => Player.players;\n\n/**\n * Get a single player based on an ID or DOM element.\n *\n * This is useful if you want to check if an element or ID has an associated\n * Video.js player, but not create one if it doesn't.\n *\n * @param {string|Element} id\n * An HTML element - `<video>`, `<audio>`, or `<video-js>` -\n * or a string matching the `id` of such an element.\n *\n * @return {Player|undefined}\n * A player instance or `undefined` if there is no player instance\n * matching the argument.\n */\nvideojs.getPlayer = id => {\n const players = Player.players;\n let tag;\n if (typeof id === 'string') {\n const nId = normalizeId(id);\n const player = players[nId];\n if (player) {\n return player;\n }\n tag = $('#' + nId);\n } else {\n tag = id;\n }\n if (isEl(tag)) {\n const {\n player,\n playerId\n } = tag;\n\n // Element may have a `player` property referring to an already created\n // player instance. If so, return that.\n if (player || players[playerId]) {\n return player || players[playerId];\n }\n }\n};\n\n/**\n * Returns an array of all current players.\n *\n * @return {Array}\n * An array of all players. The array will be in the order that\n * `Object.keys` provides, which could potentially vary between\n * JavaScript engines.\n *\n */\nvideojs.getAllPlayers = () =>\n// Disposed players leave a key with a `null` value, so we need to make sure\n// we filter those out.\nObject.keys(Player.players).map(k => Player.players[k]).filter(Boolean);\nvideojs.players = Player.players;\nvideojs.getComponent = Component$1.getComponent;\n\n/**\n * Register a component so it can referred to by name. Used when adding to other\n * components, either through addChild `component.addChild('myComponent')` or through\n * default children options `{ children: ['myComponent'] }`.\n *\n * > NOTE: You could also just initialize the component before adding.\n * `component.addChild(new MyComponent());`\n *\n * @param {string} name\n * The class name of the component\n *\n * @param {typeof Component} comp\n * The component class\n *\n * @return {typeof Component}\n * The newly registered component\n */\nvideojs.registerComponent = (name, comp) => {\n if (Tech.isTech(comp)) {\n log$1.warn(`The ${name} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`);\n }\n return Component$1.registerComponent.call(Component$1, name, comp);\n};\nvideojs.getTech = Tech.getTech;\nvideojs.registerTech = Tech.registerTech;\nvideojs.use = use;\n\n/**\n * An object that can be returned by a middleware to signify\n * that the middleware is being terminated.\n *\n * @type {object}\n * @property {object} middleware.TERMINATOR\n */\nObject.defineProperty(videojs, 'middleware', {\n value: {},\n writeable: false,\n enumerable: true\n});\nObject.defineProperty(videojs.middleware, 'TERMINATOR', {\n value: TERMINATOR,\n writeable: false,\n enumerable: true\n});\n\n/**\n * A reference to the {@link module:browser|browser utility module} as an object.\n *\n * @type {Object}\n * @see {@link module:browser|browser}\n */\nvideojs.browser = browser;\n\n/**\n * A reference to the {@link module:obj|obj utility module} as an object.\n *\n * @type {Object}\n * @see {@link module:obj|obj}\n */\nvideojs.obj = Obj;\n\n/**\n * Deprecated reference to the {@link module:obj.merge|merge function}\n *\n * @type {Function}\n * @see {@link module:obj.merge|merge}\n * @deprecated Deprecated and will be removed in 9.0. Please use videojs.obj.merge instead.\n */\nvideojs.mergeOptions = deprecateForMajor(9, 'videojs.mergeOptions', 'videojs.obj.merge', merge$1);\n\n/**\n * Deprecated reference to the {@link module:obj.defineLazyProperty|defineLazyProperty function}\n *\n * @type {Function}\n * @see {@link module:obj.defineLazyProperty|defineLazyProperty}\n * @deprecated Deprecated and will be removed in 9.0. Please use videojs.obj.defineLazyProperty instead.\n */\nvideojs.defineLazyProperty = deprecateForMajor(9, 'videojs.defineLazyProperty', 'videojs.obj.defineLazyProperty', defineLazyProperty);\n\n/**\n * Deprecated reference to the {@link module:fn.bind_|fn.bind_ function}\n *\n * @type {Function}\n * @see {@link module:fn.bind_|fn.bind_}\n * @deprecated Deprecated and will be removed in 9.0. Please use native Function.prototype.bind instead.\n */\nvideojs.bind = deprecateForMajor(9, 'videojs.bind', 'native Function.prototype.bind', bind_);\nvideojs.registerPlugin = Plugin.registerPlugin;\nvideojs.deregisterPlugin = Plugin.deregisterPlugin;\n\n/**\n * Deprecated method to register a plugin with Video.js\n *\n * @deprecated Deprecated and will be removed in 9.0. Use videojs.registerPlugin() instead.\n *\n * @param {string} name\n * The plugin name\n*\n * @param {typeof Plugin|Function} plugin\n * The plugin sub-class or function\n *\n * @return {typeof Plugin|Function}\n */\nvideojs.plugin = (name, plugin) => {\n log$1.warn('videojs.plugin() is deprecated; use videojs.registerPlugin() instead');\n return Plugin.registerPlugin(name, plugin);\n};\nvideojs.getPlugins = Plugin.getPlugins;\nvideojs.getPlugin = Plugin.getPlugin;\nvideojs.getPluginVersion = Plugin.getPluginVersion;\n\n/**\n * Adding languages so that they're available to all players.\n * Example: `videojs.addLanguage('es', { 'Hello': 'Hola' });`\n *\n * @param {string} code\n * The language code or dictionary property\n *\n * @param {Object} data\n * The data values to be translated\n *\n * @return {Object}\n * The resulting language dictionary object\n */\nvideojs.addLanguage = function (code, data) {\n code = ('' + code).toLowerCase();\n videojs.options.languages = merge$1(videojs.options.languages, {\n [code]: data\n });\n return videojs.options.languages[code];\n};\n\n/**\n * A reference to the {@link module:log|log utility module} as an object.\n *\n * @type {Function}\n * @see {@link module:log|log}\n */\nvideojs.log = log$1;\nvideojs.createLogger = createLogger;\n\n/**\n * A reference to the {@link module:time|time utility module} as an object.\n *\n * @type {Object}\n * @see {@link module:time|time}\n */\nvideojs.time = Time;\n\n/**\n * Deprecated reference to the {@link module:time.createTimeRanges|createTimeRanges function}\n *\n * @type {Function}\n * @see {@link module:time.createTimeRanges|createTimeRanges}\n * @deprecated Deprecated and will be removed in 9.0. Please use videojs.time.createTimeRanges instead.\n */\nvideojs.createTimeRange = deprecateForMajor(9, 'videojs.createTimeRange', 'videojs.time.createTimeRanges', createTimeRanges$1);\n\n/**\n * Deprecated reference to the {@link module:time.createTimeRanges|createTimeRanges function}\n *\n * @type {Function}\n * @see {@link module:time.createTimeRanges|createTimeRanges}\n * @deprecated Deprecated and will be removed in 9.0. Please use videojs.time.createTimeRanges instead.\n */\nvideojs.createTimeRanges = deprecateForMajor(9, 'videojs.createTimeRanges', 'videojs.time.createTimeRanges', createTimeRanges$1);\n\n/**\n * Deprecated reference to the {@link module:time.formatTime|formatTime function}\n *\n * @type {Function}\n * @see {@link module:time.formatTime|formatTime}\n * @deprecated Deprecated and will be removed in 9.0. Please use videojs.time.format instead.\n */\nvideojs.formatTime = deprecateForMajor(9, 'videojs.formatTime', 'videojs.time.formatTime', formatTime);\n\n/**\n * Deprecated reference to the {@link module:time.setFormatTime|setFormatTime function}\n *\n * @type {Function}\n * @see {@link module:time.setFormatTime|setFormatTime}\n * @deprecated Deprecated and will be removed in 9.0. Please use videojs.time.setFormat instead.\n */\nvideojs.setFormatTime = deprecateForMajor(9, 'videojs.setFormatTime', 'videojs.time.setFormatTime', setFormatTime);\n\n/**\n * Deprecated reference to the {@link module:time.resetFormatTime|resetFormatTime function}\n *\n * @type {Function}\n * @see {@link module:time.resetFormatTime|resetFormatTime}\n * @deprecated Deprecated and will be removed in 9.0. Please use videojs.time.resetFormat instead.\n */\nvideojs.resetFormatTime = deprecateForMajor(9, 'videojs.resetFormatTime', 'videojs.time.resetFormatTime', resetFormatTime);\n\n/**\n * Deprecated reference to the {@link module:url.parseUrl|Url.parseUrl function}\n *\n * @type {Function}\n * @see {@link module:url.parseUrl|parseUrl}\n * @deprecated Deprecated and will be removed in 9.0. Please use videojs.url.parseUrl instead.\n */\nvideojs.parseUrl = deprecateForMajor(9, 'videojs.parseUrl', 'videojs.url.parseUrl', parseUrl);\n\n/**\n * Deprecated reference to the {@link module:url.isCrossOrigin|Url.isCrossOrigin function}\n *\n * @type {Function}\n * @see {@link module:url.isCrossOrigin|isCrossOrigin}\n * @deprecated Deprecated and will be removed in 9.0. Please use videojs.url.isCrossOrigin instead.\n */\nvideojs.isCrossOrigin = deprecateForMajor(9, 'videojs.isCrossOrigin', 'videojs.url.isCrossOrigin', isCrossOrigin);\nvideojs.EventTarget = EventTarget$2;\nvideojs.any = any;\nvideojs.on = on;\nvideojs.one = one;\nvideojs.off = off;\nvideojs.trigger = trigger;\n\n/**\n * A cross-browser XMLHttpRequest wrapper.\n *\n * @function\n * @param {Object} options\n * Settings for the request.\n *\n * @return {XMLHttpRequest|XDomainRequest}\n * The request object.\n *\n * @see https://github.com/Raynos/xhr\n */\nvideojs.xhr = XHR;\nvideojs.TextTrack = TextTrack;\nvideojs.AudioTrack = AudioTrack;\nvideojs.VideoTrack = VideoTrack;\n['isEl', 'isTextNode', 'createEl', 'hasClass', 'addClass', 'removeClass', 'toggleClass', 'setAttributes', 'getAttributes', 'emptyEl', 'appendContent', 'insertContent'].forEach(k => {\n videojs[k] = function () {\n log$1.warn(`videojs.${k}() is deprecated; use videojs.dom.${k}() instead`);\n return Dom[k].apply(null, arguments);\n };\n});\nvideojs.computedStyle = deprecateForMajor(9, 'videojs.computedStyle', 'videojs.dom.computedStyle', computedStyle);\n\n/**\n * A reference to the {@link module:dom|DOM utility module} as an object.\n *\n * @type {Object}\n * @see {@link module:dom|dom}\n */\nvideojs.dom = Dom;\n\n/**\n * A reference to the {@link module:fn|fn utility module} as an object.\n *\n * @type {Object}\n * @see {@link module:fn|fn}\n */\nvideojs.fn = Fn;\n\n/**\n * A reference to the {@link module:num|num utility module} as an object.\n *\n * @type {Object}\n * @see {@link module:num|num}\n */\nvideojs.num = Num;\n\n/**\n * A reference to the {@link module:str|str utility module} as an object.\n *\n * @type {Object}\n * @see {@link module:str|str}\n */\nvideojs.str = Str;\n\n/**\n * A reference to the {@link module:url|URL utility module} as an object.\n *\n * @type {Object}\n * @see {@link module:url|url}\n */\nvideojs.url = Url;\n\n/*! @name videojs-contrib-quality-levels @version 4.0.0 @license Apache-2.0 */\n\n/**\n * A single QualityLevel.\n *\n * interface QualityLevel {\n * readonly attribute DOMString id;\n * attribute DOMString label;\n * readonly attribute long width;\n * readonly attribute long height;\n * readonly attribute long bitrate;\n * attribute boolean enabled;\n * };\n *\n * @class QualityLevel\n */\nclass QualityLevel {\n /**\n * Creates a QualityLevel\n *\n * @param {Representation|Object} representation The representation of the quality level\n * @param {string} representation.id Unique id of the QualityLevel\n * @param {number=} representation.width Resolution width of the QualityLevel\n * @param {number=} representation.height Resolution height of the QualityLevel\n * @param {number} representation.bandwidth Bitrate of the QualityLevel\n * @param {number=} representation.frameRate Frame-rate of the QualityLevel\n * @param {Function} representation.enabled Callback to enable/disable QualityLevel\n */\n constructor(representation) {\n let level = this; // eslint-disable-line\n\n level.id = representation.id;\n level.label = level.id;\n level.width = representation.width;\n level.height = representation.height;\n level.bitrate = representation.bandwidth;\n level.frameRate = representation.frameRate;\n level.enabled_ = representation.enabled;\n Object.defineProperty(level, 'enabled', {\n /**\n * Get whether the QualityLevel is enabled.\n *\n * @return {boolean} True if the QualityLevel is enabled.\n */\n get() {\n return level.enabled_();\n },\n /**\n * Enable or disable the QualityLevel.\n *\n * @param {boolean} enable true to enable QualityLevel, false to disable.\n */\n set(enable) {\n level.enabled_(enable);\n }\n });\n return level;\n }\n}\n\n/**\n * A list of QualityLevels.\n *\n * interface QualityLevelList : EventTarget {\n * getter QualityLevel (unsigned long index);\n * readonly attribute unsigned long length;\n * readonly attribute long selectedIndex;\n *\n * void addQualityLevel(QualityLevel qualityLevel)\n * void removeQualityLevel(QualityLevel remove)\n * QualityLevel? getQualityLevelById(DOMString id);\n *\n * attribute EventHandler onchange;\n * attribute EventHandler onaddqualitylevel;\n * attribute EventHandler onremovequalitylevel;\n * };\n *\n * @extends videojs.EventTarget\n * @class QualityLevelList\n */\n\nclass QualityLevelList extends videojs.EventTarget {\n /**\n * Creates a QualityLevelList.\n */\n constructor() {\n super();\n let list = this; // eslint-disable-line\n\n list.levels_ = [];\n list.selectedIndex_ = -1;\n /**\n * Get the index of the currently selected QualityLevel.\n *\n * @returns {number} The index of the selected QualityLevel. -1 if none selected.\n * @readonly\n */\n\n Object.defineProperty(list, 'selectedIndex', {\n get() {\n return list.selectedIndex_;\n }\n });\n /**\n * Get the length of the list of QualityLevels.\n *\n * @returns {number} The length of the list.\n * @readonly\n */\n\n Object.defineProperty(list, 'length', {\n get() {\n return list.levels_.length;\n }\n });\n list[Symbol.iterator] = () => list.levels_.values();\n return list;\n }\n /**\n * Adds a quality level to the list.\n *\n * @param {Representation|Object} representation The representation of the quality level\n * @param {string} representation.id Unique id of the QualityLevel\n * @param {number=} representation.width Resolution width of the QualityLevel\n * @param {number=} representation.height Resolution height of the QualityLevel\n * @param {number} representation.bandwidth Bitrate of the QualityLevel\n * @param {number=} representation.frameRate Frame-rate of the QualityLevel\n * @param {Function} representation.enabled Callback to enable/disable QualityLevel\n * @return {QualityLevel} the QualityLevel added to the list\n * @method addQualityLevel\n */\n\n addQualityLevel(representation) {\n let qualityLevel = this.getQualityLevelById(representation.id); // Do not add duplicate quality levels\n\n if (qualityLevel) {\n return qualityLevel;\n }\n const index = this.levels_.length;\n qualityLevel = new QualityLevel(representation);\n if (!('' + index in this)) {\n Object.defineProperty(this, index, {\n get() {\n return this.levels_[index];\n }\n });\n }\n this.levels_.push(qualityLevel);\n this.trigger({\n qualityLevel,\n type: 'addqualitylevel'\n });\n return qualityLevel;\n }\n /**\n * Removes a quality level from the list.\n *\n * @param {QualityLevel} qualityLevel The QualityLevel to remove from the list.\n * @return {QualityLevel|null} the QualityLevel removed or null if nothing removed\n * @method removeQualityLevel\n */\n\n removeQualityLevel(qualityLevel) {\n let removed = null;\n for (let i = 0, l = this.length; i < l; i++) {\n if (this[i] === qualityLevel) {\n removed = this.levels_.splice(i, 1)[0];\n if (this.selectedIndex_ === i) {\n this.selectedIndex_ = -1;\n } else if (this.selectedIndex_ > i) {\n this.selectedIndex_--;\n }\n break;\n }\n }\n if (removed) {\n this.trigger({\n qualityLevel,\n type: 'removequalitylevel'\n });\n }\n return removed;\n }\n /**\n * Searches for a QualityLevel with the given id.\n *\n * @param {string} id The id of the QualityLevel to find.\n * @return {QualityLevel|null} The QualityLevel with id, or null if not found.\n * @method getQualityLevelById\n */\n\n getQualityLevelById(id) {\n for (let i = 0, l = this.length; i < l; i++) {\n const level = this[i];\n if (level.id === id) {\n return level;\n }\n }\n return null;\n }\n /**\n * Resets the list of QualityLevels to empty\n *\n * @method dispose\n */\n\n dispose() {\n this.selectedIndex_ = -1;\n this.levels_.length = 0;\n }\n}\n/**\n * change - The selected QualityLevel has changed.\n * addqualitylevel - A QualityLevel has been added to the QualityLevelList.\n * removequalitylevel - A QualityLevel has been removed from the QualityLevelList.\n */\n\nQualityLevelList.prototype.allowedEvents_ = {\n change: 'change',\n addqualitylevel: 'addqualitylevel',\n removequalitylevel: 'removequalitylevel'\n}; // emulate attribute EventHandler support to allow for feature detection\n\nfor (const event in QualityLevelList.prototype.allowedEvents_) {\n QualityLevelList.prototype['on' + event] = null;\n}\nvar version$5 = \"4.0.0\";\n\n/**\n * Initialization function for the qualityLevels plugin. Sets up the QualityLevelList and\n * event handlers.\n *\n * @param {Player} player Player object.\n * @param {Object} options Plugin options object.\n * @return {QualityLevelList} a list of QualityLevels\n */\n\nconst initPlugin$1 = function (player, options) {\n const originalPluginFn = player.qualityLevels;\n const qualityLevelList = new QualityLevelList();\n const disposeHandler = function () {\n qualityLevelList.dispose();\n player.qualityLevels = originalPluginFn;\n player.off('dispose', disposeHandler);\n };\n player.on('dispose', disposeHandler);\n player.qualityLevels = () => qualityLevelList;\n player.qualityLevels.VERSION = version$5;\n return qualityLevelList;\n};\n/**\n * A video.js plugin.\n *\n * In the plugin function, the value of `this` is a video.js `Player`\n * instance. You cannot rely on the player being in a \"ready\" state here,\n * depending on how the plugin is invoked. This may or may not be important\n * to you; if not, remove the wait for \"ready\"!\n *\n * @param {Object} options Plugin options object\n * @return {QualityLevelList} a list of QualityLevels\n */\n\nconst qualityLevels = function (options) {\n return initPlugin$1(this, videojs.obj.merge({}, options));\n}; // Register the plugin with video.js.\n\nvideojs.registerPlugin('qualityLevels', qualityLevels); // Include the version number.\n\nqualityLevels.VERSION = version$5;\n\n/*! @name @videojs/http-streaming @version 3.7.0 @license Apache-2.0 */\n\n/**\n * @file resolve-url.js - Handling how URLs are resolved and manipulated\n */\nconst resolveUrl = _resolveUrl;\n/**\n * If the xhr request was redirected, return the responseURL, otherwise,\n * return the original url.\n *\n * @api private\n *\n * @param {string} url - an url being requested\n * @param {XMLHttpRequest} req - xhr request result\n *\n * @return {string}\n */\n\nconst resolveManifestRedirect = (url, req) => {\n // To understand how the responseURL below is set and generated:\n // - https://fetch.spec.whatwg.org/#concept-response-url\n // - https://fetch.spec.whatwg.org/#atomic-http-redirect-handling\n if (req && req.responseURL && url !== req.responseURL) {\n return req.responseURL;\n }\n return url;\n};\nconst logger = source => {\n if (videojs.log.debug) {\n return videojs.log.debug.bind(videojs, 'VHS:', `${source} >`);\n }\n return function () {};\n};\n\n/**\n * Provides a compatibility layer between Video.js 7 and 8 API changes for VHS.\n */\n/**\n * Delegates to videojs.obj.merge (Video.js 8) or\n * videojs.mergeOptions (Video.js 7).\n */\n\nfunction merge(...args) {\n const context = videojs.obj || videojs;\n const fn = context.merge || context.mergeOptions;\n return fn.apply(context, args);\n}\n/**\n * Delegates to videojs.time.createTimeRanges (Video.js 8) or\n * videojs.createTimeRanges (Video.js 7).\n */\n\nfunction createTimeRanges(...args) {\n const context = videojs.time || videojs;\n const fn = context.createTimeRanges || context.createTimeRanges;\n return fn.apply(context, args);\n}\n/**\n * Converts any buffered time range to a descriptive string\n *\n * @param {TimeRanges} buffered - time ranges\n * @return {string} - descriptive string\n */\n\nfunction prettyBuffered(buffered) {\n let result = '';\n for (let i = 0; i < buffered.length; i++) {\n const start = buffered.start(i);\n const end = buffered.end(i);\n const duration = end - start;\n if (result.length) {\n result += '\\n';\n }\n result += `[${duration}](${start} -> ${end})`;\n }\n return result || 'empty';\n}\n\n/**\n * ranges\n *\n * Utilities for working with TimeRanges.\n *\n */\n\nconst TIME_FUDGE_FACTOR = 1 / 30; // Comparisons between time values such as current time and the end of the buffered range\n// can be misleading because of precision differences or when the current media has poorly\n// aligned audio and video, which can cause values to be slightly off from what you would\n// expect. This value is what we consider to be safe to use in such comparisons to account\n// for these scenarios.\n\nconst SAFE_TIME_DELTA = TIME_FUDGE_FACTOR * 3;\nconst filterRanges = function (timeRanges, predicate) {\n const results = [];\n let i;\n if (timeRanges && timeRanges.length) {\n // Search for ranges that match the predicate\n for (i = 0; i < timeRanges.length; i++) {\n if (predicate(timeRanges.start(i), timeRanges.end(i))) {\n results.push([timeRanges.start(i), timeRanges.end(i)]);\n }\n }\n }\n return createTimeRanges(results);\n};\n/**\n * Attempts to find the buffered TimeRange that contains the specified\n * time.\n *\n * @param {TimeRanges} buffered - the TimeRanges object to query\n * @param {number} time - the time to filter on.\n * @return {TimeRanges} a new TimeRanges object\n */\n\nconst findRange = function (buffered, time) {\n return filterRanges(buffered, function (start, end) {\n return start - SAFE_TIME_DELTA <= time && end + SAFE_TIME_DELTA >= time;\n });\n};\n/**\n * Returns the TimeRanges that begin later than the specified time.\n *\n * @param {TimeRanges} timeRanges - the TimeRanges object to query\n * @param {number} time - the time to filter on.\n * @return {TimeRanges} a new TimeRanges object.\n */\n\nconst findNextRange = function (timeRanges, time) {\n return filterRanges(timeRanges, function (start) {\n return start - TIME_FUDGE_FACTOR >= time;\n });\n};\n/**\n * Returns gaps within a list of TimeRanges\n *\n * @param {TimeRanges} buffered - the TimeRanges object\n * @return {TimeRanges} a TimeRanges object of gaps\n */\n\nconst findGaps = function (buffered) {\n if (buffered.length < 2) {\n return createTimeRanges();\n }\n const ranges = [];\n for (let i = 1; i < buffered.length; i++) {\n const start = buffered.end(i - 1);\n const end = buffered.start(i);\n ranges.push([start, end]);\n }\n return createTimeRanges(ranges);\n};\n/**\n * Calculate the intersection of two TimeRanges\n *\n * @param {TimeRanges} bufferA\n * @param {TimeRanges} bufferB\n * @return {TimeRanges} The interesection of `bufferA` with `bufferB`\n */\n\nconst bufferIntersection = function (bufferA, bufferB) {\n let start = null;\n let end = null;\n let arity = 0;\n const extents = [];\n const ranges = [];\n if (!bufferA || !bufferA.length || !bufferB || !bufferB.length) {\n return createTimeRanges();\n } // Handle the case where we have both buffers and create an\n // intersection of the two\n\n let count = bufferA.length; // A) Gather up all start and end times\n\n while (count--) {\n extents.push({\n time: bufferA.start(count),\n type: 'start'\n });\n extents.push({\n time: bufferA.end(count),\n type: 'end'\n });\n }\n count = bufferB.length;\n while (count--) {\n extents.push({\n time: bufferB.start(count),\n type: 'start'\n });\n extents.push({\n time: bufferB.end(count),\n type: 'end'\n });\n } // B) Sort them by time\n\n extents.sort(function (a, b) {\n return a.time - b.time;\n }); // C) Go along one by one incrementing arity for start and decrementing\n // arity for ends\n\n for (count = 0; count < extents.length; count++) {\n if (extents[count].type === 'start') {\n arity++; // D) If arity is ever incremented to 2 we are entering an\n // overlapping range\n\n if (arity === 2) {\n start = extents[count].time;\n }\n } else if (extents[count].type === 'end') {\n arity--; // E) If arity is ever decremented to 1 we leaving an\n // overlapping range\n\n if (arity === 1) {\n end = extents[count].time;\n }\n } // F) Record overlapping ranges\n\n if (start !== null && end !== null) {\n ranges.push([start, end]);\n start = null;\n end = null;\n }\n }\n return createTimeRanges(ranges);\n};\n/**\n * Gets a human readable string for a TimeRange\n *\n * @param {TimeRange} range\n * @return {string} a human readable string\n */\n\nconst printableRange = range => {\n const strArr = [];\n if (!range || !range.length) {\n return '';\n }\n for (let i = 0; i < range.length; i++) {\n strArr.push(range.start(i) + ' => ' + range.end(i));\n }\n return strArr.join(', ');\n};\n/**\n * Calculates the amount of time left in seconds until the player hits the end of the\n * buffer and causes a rebuffer\n *\n * @param {TimeRange} buffered\n * The state of the buffer\n * @param {Numnber} currentTime\n * The current time of the player\n * @param {number} playbackRate\n * The current playback rate of the player. Defaults to 1.\n * @return {number}\n * Time until the player has to start rebuffering in seconds.\n * @function timeUntilRebuffer\n */\n\nconst timeUntilRebuffer = function (buffered, currentTime, playbackRate = 1) {\n const bufferedEnd = buffered.length ? buffered.end(buffered.length - 1) : 0;\n return (bufferedEnd - currentTime) / playbackRate;\n};\n/**\n * Converts a TimeRanges object into an array representation\n *\n * @param {TimeRanges} timeRanges\n * @return {Array}\n */\n\nconst timeRangesToArray = timeRanges => {\n const timeRangesList = [];\n for (let i = 0; i < timeRanges.length; i++) {\n timeRangesList.push({\n start: timeRanges.start(i),\n end: timeRanges.end(i)\n });\n }\n return timeRangesList;\n};\n/**\n * Determines if two time range objects are different.\n *\n * @param {TimeRange} a\n * the first time range object to check\n *\n * @param {TimeRange} b\n * the second time range object to check\n *\n * @return {Boolean}\n * Whether the time range objects differ\n */\n\nconst isRangeDifferent = function (a, b) {\n // same object\n if (a === b) {\n return false;\n } // one or the other is undefined\n\n if (!a && b || !b && a) {\n return true;\n } // length is different\n\n if (a.length !== b.length) {\n return true;\n } // see if any start/end pair is different\n\n for (let i = 0; i < a.length; i++) {\n if (a.start(i) !== b.start(i) || a.end(i) !== b.end(i)) {\n return true;\n }\n } // if the length and every pair is the same\n // this is the same time range\n\n return false;\n};\nconst lastBufferedEnd = function (a) {\n if (!a || !a.length || !a.end) {\n return;\n }\n return a.end(a.length - 1);\n};\n/**\n * A utility function to add up the amount of time in a timeRange\n * after a specified startTime.\n * ie:[[0, 10], [20, 40], [50, 60]] with a startTime 0\n * would return 40 as there are 40s seconds after 0 in the timeRange\n *\n * @param {TimeRange} range\n * The range to check against\n * @param {number} startTime\n * The time in the time range that you should start counting from\n *\n * @return {number}\n * The number of seconds in the buffer passed the specified time.\n */\n\nconst timeAheadOf = function (range, startTime) {\n let time = 0;\n if (!range || !range.length) {\n return time;\n }\n for (let i = 0; i < range.length; i++) {\n const start = range.start(i);\n const end = range.end(i); // startTime is after this range entirely\n\n if (startTime > end) {\n continue;\n } // startTime is within this range\n\n if (startTime > start && startTime <= end) {\n time += end - startTime;\n continue;\n } // startTime is before this range.\n\n time += end - start;\n }\n return time;\n};\n\n/**\n * @file playlist.js\n *\n * Playlist related utilities.\n */\n/**\n * Get the duration of a segment, with special cases for\n * llhls segments that do not have a duration yet.\n *\n * @param {Object} playlist\n * the playlist that the segment belongs to.\n * @param {Object} segment\n * the segment to get a duration for.\n *\n * @return {number}\n * the segment duration\n */\n\nconst segmentDurationWithParts = (playlist, segment) => {\n // if this isn't a preload segment\n // then we will have a segment duration that is accurate.\n if (!segment.preload) {\n return segment.duration;\n } // otherwise we have to add up parts and preload hints\n // to get an up to date duration.\n\n let result = 0;\n (segment.parts || []).forEach(function (p) {\n result += p.duration;\n }); // for preload hints we have to use partTargetDuration\n // as they won't even have a duration yet.\n\n (segment.preloadHints || []).forEach(function (p) {\n if (p.type === 'PART') {\n result += playlist.partTargetDuration;\n }\n });\n return result;\n};\n/**\n * A function to get a combined list of parts and segments with durations\n * and indexes.\n *\n * @param {Playlist} playlist the playlist to get the list for.\n *\n * @return {Array} The part/segment list.\n */\n\nconst getPartsAndSegments = playlist => (playlist.segments || []).reduce((acc, segment, si) => {\n if (segment.parts) {\n segment.parts.forEach(function (part, pi) {\n acc.push({\n duration: part.duration,\n segmentIndex: si,\n partIndex: pi,\n part,\n segment\n });\n });\n } else {\n acc.push({\n duration: segment.duration,\n segmentIndex: si,\n partIndex: null,\n segment,\n part: null\n });\n }\n return acc;\n}, []);\nconst getLastParts = media => {\n const lastSegment = media.segments && media.segments.length && media.segments[media.segments.length - 1];\n return lastSegment && lastSegment.parts || [];\n};\nconst getKnownPartCount = ({\n preloadSegment\n}) => {\n if (!preloadSegment) {\n return;\n }\n const {\n parts,\n preloadHints\n } = preloadSegment;\n let partCount = (preloadHints || []).reduce((count, hint) => count + (hint.type === 'PART' ? 1 : 0), 0);\n partCount += parts && parts.length ? parts.length : 0;\n return partCount;\n};\n/**\n * Get the number of seconds to delay from the end of a\n * live playlist.\n *\n * @param {Playlist} main the main playlist\n * @param {Playlist} media the media playlist\n * @return {number} the hold back in seconds.\n */\n\nconst liveEdgeDelay = (main, media) => {\n if (media.endList) {\n return 0;\n } // dash suggestedPresentationDelay trumps everything\n\n if (main && main.suggestedPresentationDelay) {\n return main.suggestedPresentationDelay;\n }\n const hasParts = getLastParts(media).length > 0; // look for \"part\" delays from ll-hls first\n\n if (hasParts && media.serverControl && media.serverControl.partHoldBack) {\n return media.serverControl.partHoldBack;\n } else if (hasParts && media.partTargetDuration) {\n return media.partTargetDuration * 3; // finally look for full segment delays\n } else if (media.serverControl && media.serverControl.holdBack) {\n return media.serverControl.holdBack;\n } else if (media.targetDuration) {\n return media.targetDuration * 3;\n }\n return 0;\n};\n/**\n * walk backward until we find a duration we can use\n * or return a failure\n *\n * @param {Playlist} playlist the playlist to walk through\n * @param {Number} endSequence the mediaSequence to stop walking on\n */\n\nconst backwardDuration = function (playlist, endSequence) {\n let result = 0;\n let i = endSequence - playlist.mediaSequence; // if a start time is available for segment immediately following\n // the interval, use it\n\n let segment = playlist.segments[i]; // Walk backward until we find the latest segment with timeline\n // information that is earlier than endSequence\n\n if (segment) {\n if (typeof segment.start !== 'undefined') {\n return {\n result: segment.start,\n precise: true\n };\n }\n if (typeof segment.end !== 'undefined') {\n return {\n result: segment.end - segment.duration,\n precise: true\n };\n }\n }\n while (i--) {\n segment = playlist.segments[i];\n if (typeof segment.end !== 'undefined') {\n return {\n result: result + segment.end,\n precise: true\n };\n }\n result += segmentDurationWithParts(playlist, segment);\n if (typeof segment.start !== 'undefined') {\n return {\n result: result + segment.start,\n precise: true\n };\n }\n }\n return {\n result,\n precise: false\n };\n};\n/**\n * walk forward until we find a duration we can use\n * or return a failure\n *\n * @param {Playlist} playlist the playlist to walk through\n * @param {number} endSequence the mediaSequence to stop walking on\n */\n\nconst forwardDuration = function (playlist, endSequence) {\n let result = 0;\n let segment;\n let i = endSequence - playlist.mediaSequence; // Walk forward until we find the earliest segment with timeline\n // information\n\n for (; i < playlist.segments.length; i++) {\n segment = playlist.segments[i];\n if (typeof segment.start !== 'undefined') {\n return {\n result: segment.start - result,\n precise: true\n };\n }\n result += segmentDurationWithParts(playlist, segment);\n if (typeof segment.end !== 'undefined') {\n return {\n result: segment.end - result,\n precise: true\n };\n }\n } // indicate we didn't find a useful duration estimate\n\n return {\n result: -1,\n precise: false\n };\n};\n/**\n * Calculate the media duration from the segments associated with a\n * playlist. The duration of a subinterval of the available segments\n * may be calculated by specifying an end index.\n *\n * @param {Object} playlist a media playlist object\n * @param {number=} endSequence an exclusive upper boundary\n * for the playlist. Defaults to playlist length.\n * @param {number} expired the amount of time that has dropped\n * off the front of the playlist in a live scenario\n * @return {number} the duration between the first available segment\n * and end index.\n */\n\nconst intervalDuration = function (playlist, endSequence, expired) {\n if (typeof endSequence === 'undefined') {\n endSequence = playlist.mediaSequence + playlist.segments.length;\n }\n if (endSequence < playlist.mediaSequence) {\n return 0;\n } // do a backward walk to estimate the duration\n\n const backward = backwardDuration(playlist, endSequence);\n if (backward.precise) {\n // if we were able to base our duration estimate on timing\n // information provided directly from the Media Source, return\n // it\n return backward.result;\n } // walk forward to see if a precise duration estimate can be made\n // that way\n\n const forward = forwardDuration(playlist, endSequence);\n if (forward.precise) {\n // we found a segment that has been buffered and so it's\n // position is known precisely\n return forward.result;\n } // return the less-precise, playlist-based duration estimate\n\n return backward.result + expired;\n};\n/**\n * Calculates the duration of a playlist. If a start and end index\n * are specified, the duration will be for the subset of the media\n * timeline between those two indices. The total duration for live\n * playlists is always Infinity.\n *\n * @param {Object} playlist a media playlist object\n * @param {number=} endSequence an exclusive upper\n * boundary for the playlist. Defaults to the playlist media\n * sequence number plus its length.\n * @param {number=} expired the amount of time that has\n * dropped off the front of the playlist in a live scenario\n * @return {number} the duration between the start index and end\n * index.\n */\n\nconst duration = function (playlist, endSequence, expired) {\n if (!playlist) {\n return 0;\n }\n if (typeof expired !== 'number') {\n expired = 0;\n } // if a slice of the total duration is not requested, use\n // playlist-level duration indicators when they're present\n\n if (typeof endSequence === 'undefined') {\n // if present, use the duration specified in the playlist\n if (playlist.totalDuration) {\n return playlist.totalDuration;\n } // duration should be Infinity for live playlists\n\n if (!playlist.endList) {\n return window$1.Infinity;\n }\n } // calculate the total duration based on the segment durations\n\n return intervalDuration(playlist, endSequence, expired);\n};\n/**\n * Calculate the time between two indexes in the current playlist\n * neight the start- nor the end-index need to be within the current\n * playlist in which case, the targetDuration of the playlist is used\n * to approximate the durations of the segments\n *\n * @param {Array} options.durationList list to iterate over for durations.\n * @param {number} options.defaultDuration duration to use for elements before or after the durationList\n * @param {number} options.startIndex partsAndSegments index to start\n * @param {number} options.endIndex partsAndSegments index to end.\n * @return {number} the number of seconds between startIndex and endIndex\n */\n\nconst sumDurations = function ({\n defaultDuration,\n durationList,\n startIndex,\n endIndex\n}) {\n let durations = 0;\n if (startIndex > endIndex) {\n [startIndex, endIndex] = [endIndex, startIndex];\n }\n if (startIndex < 0) {\n for (let i = startIndex; i < Math.min(0, endIndex); i++) {\n durations += defaultDuration;\n }\n startIndex = 0;\n }\n for (let i = startIndex; i < endIndex; i++) {\n durations += durationList[i].duration;\n }\n return durations;\n};\n/**\n * Calculates the playlist end time\n *\n * @param {Object} playlist a media playlist object\n * @param {number=} expired the amount of time that has\n * dropped off the front of the playlist in a live scenario\n * @param {boolean|false} useSafeLiveEnd a boolean value indicating whether or not the\n * playlist end calculation should consider the safe live end\n * (truncate the playlist end by three segments). This is normally\n * used for calculating the end of the playlist's seekable range.\n * This takes into account the value of liveEdgePadding.\n * Setting liveEdgePadding to 0 is equivalent to setting this to false.\n * @param {number} liveEdgePadding a number indicating how far from the end of the playlist we should be in seconds.\n * If this is provided, it is used in the safe live end calculation.\n * Setting useSafeLiveEnd=false or liveEdgePadding=0 are equivalent.\n * Corresponds to suggestedPresentationDelay in DASH manifests.\n * @return {number} the end time of playlist\n * @function playlistEnd\n */\n\nconst playlistEnd = function (playlist, expired, useSafeLiveEnd, liveEdgePadding) {\n if (!playlist || !playlist.segments) {\n return null;\n }\n if (playlist.endList) {\n return duration(playlist);\n }\n if (expired === null) {\n return null;\n }\n expired = expired || 0;\n let lastSegmentEndTime = intervalDuration(playlist, playlist.mediaSequence + playlist.segments.length, expired);\n if (useSafeLiveEnd) {\n liveEdgePadding = typeof liveEdgePadding === 'number' ? liveEdgePadding : liveEdgeDelay(null, playlist);\n lastSegmentEndTime -= liveEdgePadding;\n } // don't return a time less than zero\n\n return Math.max(0, lastSegmentEndTime);\n};\n/**\n * Calculates the interval of time that is currently seekable in a\n * playlist. The returned time ranges are relative to the earliest\n * moment in the specified playlist that is still available. A full\n * seekable implementation for live streams would need to offset\n * these values by the duration of content that has expired from the\n * stream.\n *\n * @param {Object} playlist a media playlist object\n * dropped off the front of the playlist in a live scenario\n * @param {number=} expired the amount of time that has\n * dropped off the front of the playlist in a live scenario\n * @param {number} liveEdgePadding how far from the end of the playlist we should be in seconds.\n * Corresponds to suggestedPresentationDelay in DASH manifests.\n * @return {TimeRanges} the periods of time that are valid targets\n * for seeking\n */\n\nconst seekable = function (playlist, expired, liveEdgePadding) {\n const useSafeLiveEnd = true;\n const seekableStart = expired || 0;\n let seekableEnd = playlistEnd(playlist, expired, useSafeLiveEnd, liveEdgePadding);\n if (seekableEnd === null) {\n return createTimeRanges();\n } // Clamp seekable end since it can not be less than the seekable start\n\n if (seekableEnd < seekableStart) {\n seekableEnd = seekableStart;\n }\n return createTimeRanges(seekableStart, seekableEnd);\n};\n/**\n * Determine the index and estimated starting time of the segment that\n * contains a specified playback position in a media playlist.\n *\n * @param {Object} options.playlist the media playlist to query\n * @param {number} options.currentTime The number of seconds since the earliest\n * possible position to determine the containing segment for\n * @param {number} options.startTime the time when the segment/part starts\n * @param {number} options.startingSegmentIndex the segment index to start looking at.\n * @param {number?} [options.startingPartIndex] the part index to look at within the segment.\n *\n * @return {Object} an object with partIndex, segmentIndex, and startTime.\n */\n\nconst getMediaInfoForTime = function ({\n playlist,\n currentTime,\n startingSegmentIndex,\n startingPartIndex,\n startTime,\n exactManifestTimings\n}) {\n let time = currentTime - startTime;\n const partsAndSegments = getPartsAndSegments(playlist);\n let startIndex = 0;\n for (let i = 0; i < partsAndSegments.length; i++) {\n const partAndSegment = partsAndSegments[i];\n if (startingSegmentIndex !== partAndSegment.segmentIndex) {\n continue;\n } // skip this if part index does not match.\n\n if (typeof startingPartIndex === 'number' && typeof partAndSegment.partIndex === 'number' && startingPartIndex !== partAndSegment.partIndex) {\n continue;\n }\n startIndex = i;\n break;\n }\n if (time < 0) {\n // Walk backward from startIndex in the playlist, adding durations\n // until we find a segment that contains `time` and return it\n if (startIndex > 0) {\n for (let i = startIndex - 1; i >= 0; i--) {\n const partAndSegment = partsAndSegments[i];\n time += partAndSegment.duration;\n if (exactManifestTimings) {\n if (time < 0) {\n continue;\n }\n } else if (time + TIME_FUDGE_FACTOR <= 0) {\n continue;\n }\n return {\n partIndex: partAndSegment.partIndex,\n segmentIndex: partAndSegment.segmentIndex,\n startTime: startTime - sumDurations({\n defaultDuration: playlist.targetDuration,\n durationList: partsAndSegments,\n startIndex,\n endIndex: i\n })\n };\n }\n } // We were unable to find a good segment within the playlist\n // so select the first segment\n\n return {\n partIndex: partsAndSegments[0] && partsAndSegments[0].partIndex || null,\n segmentIndex: partsAndSegments[0] && partsAndSegments[0].segmentIndex || 0,\n startTime: currentTime\n };\n } // When startIndex is negative, we first walk forward to first segment\n // adding target durations. If we \"run out of time\" before getting to\n // the first segment, return the first segment\n\n if (startIndex < 0) {\n for (let i = startIndex; i < 0; i++) {\n time -= playlist.targetDuration;\n if (time < 0) {\n return {\n partIndex: partsAndSegments[0] && partsAndSegments[0].partIndex || null,\n segmentIndex: partsAndSegments[0] && partsAndSegments[0].segmentIndex || 0,\n startTime: currentTime\n };\n }\n }\n startIndex = 0;\n } // Walk forward from startIndex in the playlist, subtracting durations\n // until we find a segment that contains `time` and return it\n\n for (let i = startIndex; i < partsAndSegments.length; i++) {\n const partAndSegment = partsAndSegments[i];\n time -= partAndSegment.duration;\n if (exactManifestTimings) {\n if (time > 0) {\n continue;\n }\n } else if (time - TIME_FUDGE_FACTOR >= 0) {\n continue;\n }\n return {\n partIndex: partAndSegment.partIndex,\n segmentIndex: partAndSegment.segmentIndex,\n startTime: startTime + sumDurations({\n defaultDuration: playlist.targetDuration,\n durationList: partsAndSegments,\n startIndex,\n endIndex: i\n })\n };\n } // We are out of possible candidates so load the last one...\n\n return {\n segmentIndex: partsAndSegments[partsAndSegments.length - 1].segmentIndex,\n partIndex: partsAndSegments[partsAndSegments.length - 1].partIndex,\n startTime: currentTime\n };\n};\n/**\n * Check whether the playlist is excluded or not.\n *\n * @param {Object} playlist the media playlist object\n * @return {boolean} whether the playlist is excluded or not\n * @function isExcluded\n */\n\nconst isExcluded = function (playlist) {\n return playlist.excludeUntil && playlist.excludeUntil > Date.now();\n};\n/**\n * Check whether the playlist is compatible with current playback configuration or has\n * been excluded permanently for being incompatible.\n *\n * @param {Object} playlist the media playlist object\n * @return {boolean} whether the playlist is incompatible or not\n * @function isIncompatible\n */\n\nconst isIncompatible = function (playlist) {\n return playlist.excludeUntil && playlist.excludeUntil === Infinity;\n};\n/**\n * Check whether the playlist is enabled or not.\n *\n * @param {Object} playlist the media playlist object\n * @return {boolean} whether the playlist is enabled or not\n * @function isEnabled\n */\n\nconst isEnabled = function (playlist) {\n const excluded = isExcluded(playlist);\n return !playlist.disabled && !excluded;\n};\n/**\n * Check whether the playlist has been manually disabled through the representations api.\n *\n * @param {Object} playlist the media playlist object\n * @return {boolean} whether the playlist is disabled manually or not\n * @function isDisabled\n */\n\nconst isDisabled = function (playlist) {\n return playlist.disabled;\n};\n/**\n * Returns whether the current playlist is an AES encrypted HLS stream\n *\n * @return {boolean} true if it's an AES encrypted HLS stream\n */\n\nconst isAes = function (media) {\n for (let i = 0; i < media.segments.length; i++) {\n if (media.segments[i].key) {\n return true;\n }\n }\n return false;\n};\n/**\n * Checks if the playlist has a value for the specified attribute\n *\n * @param {string} attr\n * Attribute to check for\n * @param {Object} playlist\n * The media playlist object\n * @return {boolean}\n * Whether the playlist contains a value for the attribute or not\n * @function hasAttribute\n */\n\nconst hasAttribute = function (attr, playlist) {\n return playlist.attributes && playlist.attributes[attr];\n};\n/**\n * Estimates the time required to complete a segment download from the specified playlist\n *\n * @param {number} segmentDuration\n * Duration of requested segment\n * @param {number} bandwidth\n * Current measured bandwidth of the player\n * @param {Object} playlist\n * The media playlist object\n * @param {number=} bytesReceived\n * Number of bytes already received for the request. Defaults to 0\n * @return {number|NaN}\n * The estimated time to request the segment. NaN if bandwidth information for\n * the given playlist is unavailable\n * @function estimateSegmentRequestTime\n */\n\nconst estimateSegmentRequestTime = function (segmentDuration, bandwidth, playlist, bytesReceived = 0) {\n if (!hasAttribute('BANDWIDTH', playlist)) {\n return NaN;\n }\n const size = segmentDuration * playlist.attributes.BANDWIDTH;\n return (size - bytesReceived * 8) / bandwidth;\n};\n/*\n * Returns whether the current playlist is the lowest rendition\n *\n * @return {Boolean} true if on lowest rendition\n */\n\nconst isLowestEnabledRendition = (main, media) => {\n if (main.playlists.length === 1) {\n return true;\n }\n const currentBandwidth = media.attributes.BANDWIDTH || Number.MAX_VALUE;\n return main.playlists.filter(playlist => {\n if (!isEnabled(playlist)) {\n return false;\n }\n return (playlist.attributes.BANDWIDTH || 0) < currentBandwidth;\n }).length === 0;\n};\nconst playlistMatch = (a, b) => {\n // both playlits are null\n // or only one playlist is non-null\n // no match\n if (!a && !b || !a && b || a && !b) {\n return false;\n } // playlist objects are the same, match\n\n if (a === b) {\n return true;\n } // first try to use id as it should be the most\n // accurate\n\n if (a.id && b.id && a.id === b.id) {\n return true;\n } // next try to use reslovedUri as it should be the\n // second most accurate.\n\n if (a.resolvedUri && b.resolvedUri && a.resolvedUri === b.resolvedUri) {\n return true;\n } // finally try to use uri as it should be accurate\n // but might miss a few cases for relative uris\n\n if (a.uri && b.uri && a.uri === b.uri) {\n return true;\n }\n return false;\n};\nconst someAudioVariant = function (main, callback) {\n const AUDIO = main && main.mediaGroups && main.mediaGroups.AUDIO || {};\n let found = false;\n for (const groupName in AUDIO) {\n for (const label in AUDIO[groupName]) {\n found = callback(AUDIO[groupName][label]);\n if (found) {\n break;\n }\n }\n if (found) {\n break;\n }\n }\n return !!found;\n};\nconst isAudioOnly = main => {\n // we are audio only if we have no main playlists but do\n // have media group playlists.\n if (!main || !main.playlists || !main.playlists.length) {\n // without audio variants or playlists this\n // is not an audio only main.\n const found = someAudioVariant(main, variant => variant.playlists && variant.playlists.length || variant.uri);\n return found;\n } // if every playlist has only an audio codec it is audio only\n\n for (let i = 0; i < main.playlists.length; i++) {\n const playlist = main.playlists[i];\n const CODECS = playlist.attributes && playlist.attributes.CODECS; // all codecs are audio, this is an audio playlist.\n\n if (CODECS && CODECS.split(',').every(c => isAudioCodec(c))) {\n continue;\n } // playlist is in an audio group it is audio only\n\n const found = someAudioVariant(main, variant => playlistMatch(playlist, variant));\n if (found) {\n continue;\n } // if we make it here this playlist isn't audio and we\n // are not audio only\n\n return false;\n } // if we make it past every playlist without returning, then\n // this is an audio only playlist.\n\n return true;\n}; // exports\n\nvar Playlist = {\n liveEdgeDelay,\n duration,\n seekable,\n getMediaInfoForTime,\n isEnabled,\n isDisabled,\n isExcluded,\n isIncompatible,\n playlistEnd,\n isAes,\n hasAttribute,\n estimateSegmentRequestTime,\n isLowestEnabledRendition,\n isAudioOnly,\n playlistMatch,\n segmentDurationWithParts\n};\nconst {\n log\n} = videojs;\nconst createPlaylistID = (index, uri) => {\n return `${index}-${uri}`;\n}; // default function for creating a group id\n\nconst groupID = (type, group, label) => {\n return `placeholder-uri-${type}-${group}-${label}`;\n};\n/**\n * Parses a given m3u8 playlist\n *\n * @param {Function} [onwarn]\n * a function to call when the parser triggers a warning event.\n * @param {Function} [oninfo]\n * a function to call when the parser triggers an info event.\n * @param {string} manifestString\n * The downloaded manifest string\n * @param {Object[]} [customTagParsers]\n * An array of custom tag parsers for the m3u8-parser instance\n * @param {Object[]} [customTagMappers]\n * An array of custom tag mappers for the m3u8-parser instance\n * @param {boolean} [llhls]\n * Whether to keep ll-hls features in the manifest after parsing.\n * @return {Object}\n * The manifest object\n */\n\nconst parseManifest = ({\n onwarn,\n oninfo,\n manifestString,\n customTagParsers = [],\n customTagMappers = [],\n llhls\n}) => {\n const parser = new Parser();\n if (onwarn) {\n parser.on('warn', onwarn);\n }\n if (oninfo) {\n parser.on('info', oninfo);\n }\n customTagParsers.forEach(customParser => parser.addParser(customParser));\n customTagMappers.forEach(mapper => parser.addTagMapper(mapper));\n parser.push(manifestString);\n parser.end();\n const manifest = parser.manifest; // remove llhls features from the parsed manifest\n // if we don't want llhls support.\n\n if (!llhls) {\n ['preloadSegment', 'skip', 'serverControl', 'renditionReports', 'partInf', 'partTargetDuration'].forEach(function (k) {\n if (manifest.hasOwnProperty(k)) {\n delete manifest[k];\n }\n });\n if (manifest.segments) {\n manifest.segments.forEach(function (segment) {\n ['parts', 'preloadHints'].forEach(function (k) {\n if (segment.hasOwnProperty(k)) {\n delete segment[k];\n }\n });\n });\n }\n }\n if (!manifest.targetDuration) {\n let targetDuration = 10;\n if (manifest.segments && manifest.segments.length) {\n targetDuration = manifest.segments.reduce((acc, s) => Math.max(acc, s.duration), 0);\n }\n if (onwarn) {\n onwarn(`manifest has no targetDuration defaulting to ${targetDuration}`);\n }\n manifest.targetDuration = targetDuration;\n }\n const parts = getLastParts(manifest);\n if (parts.length && !manifest.partTargetDuration) {\n const partTargetDuration = parts.reduce((acc, p) => Math.max(acc, p.duration), 0);\n if (onwarn) {\n onwarn(`manifest has no partTargetDuration defaulting to ${partTargetDuration}`);\n log.error('LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.');\n }\n manifest.partTargetDuration = partTargetDuration;\n }\n return manifest;\n};\n/**\n * Loops through all supported media groups in main and calls the provided\n * callback for each group\n *\n * @param {Object} main\n * The parsed main manifest object\n * @param {Function} callback\n * Callback to call for each media group\n */\n\nconst forEachMediaGroup = (main, callback) => {\n if (!main.mediaGroups) {\n return;\n }\n ['AUDIO', 'SUBTITLES'].forEach(mediaType => {\n if (!main.mediaGroups[mediaType]) {\n return;\n }\n for (const groupKey in main.mediaGroups[mediaType]) {\n for (const labelKey in main.mediaGroups[mediaType][groupKey]) {\n const mediaProperties = main.mediaGroups[mediaType][groupKey][labelKey];\n callback(mediaProperties, mediaType, groupKey, labelKey);\n }\n }\n });\n};\n/**\n * Adds properties and attributes to the playlist to keep consistent functionality for\n * playlists throughout VHS.\n *\n * @param {Object} config\n * Arguments object\n * @param {Object} config.playlist\n * The media playlist\n * @param {string} [config.uri]\n * The uri to the media playlist (if media playlist is not from within a main\n * playlist)\n * @param {string} id\n * ID to use for the playlist\n */\n\nconst setupMediaPlaylist = ({\n playlist,\n uri,\n id\n}) => {\n playlist.id = id;\n playlist.playlistErrors_ = 0;\n if (uri) {\n // For media playlists, m3u8-parser does not have access to a URI, as HLS media\n // playlists do not contain their own source URI, but one is needed for consistency in\n // VHS.\n playlist.uri = uri;\n } // For HLS main playlists, even though certain attributes MUST be defined, the\n // stream may still be played without them.\n // For HLS media playlists, m3u8-parser does not attach an attributes object to the\n // manifest.\n //\n // To avoid undefined reference errors through the project, and make the code easier\n // to write/read, add an empty attributes object for these cases.\n\n playlist.attributes = playlist.attributes || {};\n};\n/**\n * Adds ID, resolvedUri, and attributes properties to each playlist of the main, where\n * necessary. In addition, creates playlist IDs for each playlist and adds playlist ID to\n * playlist references to the playlists array.\n *\n * @param {Object} main\n * The main playlist\n */\n\nconst setupMediaPlaylists = main => {\n let i = main.playlists.length;\n while (i--) {\n const playlist = main.playlists[i];\n setupMediaPlaylist({\n playlist,\n id: createPlaylistID(i, playlist.uri)\n });\n playlist.resolvedUri = resolveUrl(main.uri, playlist.uri);\n main.playlists[playlist.id] = playlist; // URI reference added for backwards compatibility\n\n main.playlists[playlist.uri] = playlist; // Although the spec states an #EXT-X-STREAM-INF tag MUST have a BANDWIDTH attribute,\n // the stream can be played without it. Although an attributes property may have been\n // added to the playlist to prevent undefined references, issue a warning to fix the\n // manifest.\n\n if (!playlist.attributes.BANDWIDTH) {\n log.warn('Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.');\n }\n }\n};\n/**\n * Adds resolvedUri properties to each media group.\n *\n * @param {Object} main\n * The main playlist\n */\n\nconst resolveMediaGroupUris = main => {\n forEachMediaGroup(main, properties => {\n if (properties.uri) {\n properties.resolvedUri = resolveUrl(main.uri, properties.uri);\n }\n });\n};\n/**\n * Creates a main playlist wrapper to insert a sole media playlist into.\n *\n * @param {Object} media\n * Media playlist\n * @param {string} uri\n * The media URI\n *\n * @return {Object}\n * main playlist\n */\n\nconst mainForMedia = (media, uri) => {\n const id = createPlaylistID(0, uri);\n const main = {\n mediaGroups: {\n 'AUDIO': {},\n 'VIDEO': {},\n 'CLOSED-CAPTIONS': {},\n 'SUBTITLES': {}\n },\n uri: window$1.location.href,\n resolvedUri: window$1.location.href,\n playlists: [{\n uri,\n id,\n resolvedUri: uri,\n // m3u8-parser does not attach an attributes property to media playlists so make\n // sure that the property is attached to avoid undefined reference errors\n attributes: {}\n }]\n }; // set up ID reference\n\n main.playlists[id] = main.playlists[0]; // URI reference added for backwards compatibility\n\n main.playlists[uri] = main.playlists[0];\n return main;\n};\n/**\n * Does an in-place update of the main manifest to add updated playlist URI references\n * as well as other properties needed by VHS that aren't included by the parser.\n *\n * @param {Object} main\n * main manifest object\n * @param {string} uri\n * The source URI\n * @param {function} createGroupID\n * A function to determine how to create the groupID for mediaGroups\n */\n\nconst addPropertiesToMain = (main, uri, createGroupID = groupID) => {\n main.uri = uri;\n for (let i = 0; i < main.playlists.length; i++) {\n if (!main.playlists[i].uri) {\n // Set up phony URIs for the playlists since playlists are referenced by their URIs\n // throughout VHS, but some formats (e.g., DASH) don't have external URIs\n // TODO: consider adding dummy URIs in mpd-parser\n const phonyUri = `placeholder-uri-${i}`;\n main.playlists[i].uri = phonyUri;\n }\n }\n const audioOnlyMain = isAudioOnly(main);\n forEachMediaGroup(main, (properties, mediaType, groupKey, labelKey) => {\n // add a playlist array under properties\n if (!properties.playlists || !properties.playlists.length) {\n // If the manifest is audio only and this media group does not have a uri, check\n // if the media group is located in the main list of playlists. If it is, don't add\n // placeholder properties as it shouldn't be considered an alternate audio track.\n if (audioOnlyMain && mediaType === 'AUDIO' && !properties.uri) {\n for (let i = 0; i < main.playlists.length; i++) {\n const p = main.playlists[i];\n if (p.attributes && p.attributes.AUDIO && p.attributes.AUDIO === groupKey) {\n return;\n }\n }\n }\n properties.playlists = [_extends({}, properties)];\n }\n properties.playlists.forEach(function (p, i) {\n const groupId = createGroupID(mediaType, groupKey, labelKey, p);\n const id = createPlaylistID(i, groupId);\n if (p.uri) {\n p.resolvedUri = p.resolvedUri || resolveUrl(main.uri, p.uri);\n } else {\n // DEPRECATED, this has been added to prevent a breaking change.\n // previously we only ever had a single media group playlist, so\n // we mark the first playlist uri without prepending the index as we used to\n // ideally we would do all of the playlists the same way.\n p.uri = i === 0 ? groupId : id; // don't resolve a placeholder uri to an absolute url, just use\n // the placeholder again\n\n p.resolvedUri = p.uri;\n }\n p.id = p.id || id; // add an empty attributes object, all playlists are\n // expected to have this.\n\n p.attributes = p.attributes || {}; // setup ID and URI references (URI for backwards compatibility)\n\n main.playlists[p.id] = p;\n main.playlists[p.uri] = p;\n });\n });\n setupMediaPlaylists(main);\n resolveMediaGroupUris(main);\n};\nclass DateRangesStorage {\n constructor() {\n this.offset_ = null;\n this.pendingDateRanges_ = new Map();\n this.processedDateRanges_ = new Map();\n }\n setOffset(segments = []) {\n // already set\n if (this.offset_ !== null) {\n return;\n } // no segment to process\n\n if (!segments.length) {\n return;\n }\n const [firstSegment] = segments; // no program date time\n\n if (firstSegment.programDateTime === undefined) {\n return;\n } // Set offset as ProgramDateTime for the very first segment of the very first playlist load:\n\n this.offset_ = firstSegment.programDateTime / 1000;\n }\n setPendingDateRanges(dateRanges = []) {\n if (!dateRanges.length) {\n return;\n }\n const [dateRange] = dateRanges;\n const startTime = dateRange.startDate.getTime();\n this.trimProcessedDateRanges_(startTime);\n this.pendingDateRanges_ = dateRanges.reduce((map, pendingDateRange) => {\n map.set(pendingDateRange.id, pendingDateRange);\n return map;\n }, new Map());\n }\n processDateRange(dateRange) {\n this.pendingDateRanges_.delete(dateRange.id);\n this.processedDateRanges_.set(dateRange.id, dateRange);\n }\n getDateRangesToProcess() {\n if (this.offset_ === null) {\n return [];\n }\n const dateRangeClasses = {};\n const dateRangesToProcess = [];\n this.pendingDateRanges_.forEach((dateRange, id) => {\n if (this.processedDateRanges_.has(id)) {\n return;\n }\n dateRange.startTime = dateRange.startDate.getTime() / 1000 - this.offset_;\n dateRange.processDateRange = () => this.processDateRange(dateRange);\n dateRangesToProcess.push(dateRange);\n if (!dateRange.class) {\n return;\n }\n if (dateRangeClasses[dateRange.class]) {\n const length = dateRangeClasses[dateRange.class].push(dateRange);\n dateRange.classListIndex = length - 1;\n } else {\n dateRangeClasses[dateRange.class] = [dateRange];\n dateRange.classListIndex = 0;\n }\n });\n for (const dateRange of dateRangesToProcess) {\n const classList = dateRangeClasses[dateRange.class] || [];\n if (dateRange.endDate) {\n dateRange.endTime = dateRange.endDate.getTime() / 1000 - this.offset_;\n } else if (dateRange.endOnNext && classList[dateRange.classListIndex + 1]) {\n dateRange.endTime = classList[dateRange.classListIndex + 1].startTime;\n } else if (dateRange.duration) {\n dateRange.endTime = dateRange.startTime + dateRange.duration;\n } else if (dateRange.plannedDuration) {\n dateRange.endTime = dateRange.startTime + dateRange.plannedDuration;\n } else {\n dateRange.endTime = dateRange.startTime;\n }\n }\n return dateRangesToProcess;\n }\n trimProcessedDateRanges_(startTime) {\n const copy = new Map(this.processedDateRanges_);\n copy.forEach((dateRange, id) => {\n if (dateRange.startDate.getTime() < startTime) {\n this.processedDateRanges_.delete(id);\n }\n });\n }\n}\n\n/**\n * @file playlist-loader.js\n *\n * A state machine that manages the loading, caching, and updating of\n * M3U8 playlists.\n *\n */\nconst {\n EventTarget: EventTarget$1\n} = videojs;\nconst addLLHLSQueryDirectives = (uri, media) => {\n if (media.endList || !media.serverControl) {\n return uri;\n }\n const parameters = {};\n if (media.serverControl.canBlockReload) {\n const {\n preloadSegment\n } = media; // next msn is a zero based value, length is not.\n\n let nextMSN = media.mediaSequence + media.segments.length; // If preload segment has parts then it is likely\n // that we are going to request a part of that preload segment.\n // the logic below is used to determine that.\n\n if (preloadSegment) {\n const parts = preloadSegment.parts || []; // _HLS_part is a zero based index\n\n const nextPart = getKnownPartCount(media) - 1; // if nextPart is > -1 and not equal to just the\n // length of parts, then we know we had part preload hints\n // and we need to add the _HLS_part= query\n\n if (nextPart > -1 && nextPart !== parts.length - 1) {\n // add existing parts to our preload hints\n // eslint-disable-next-line\n parameters._HLS_part = nextPart;\n } // this if statement makes sure that we request the msn\n // of the preload segment if:\n // 1. the preload segment had parts (and was not yet a full segment)\n // but was added to our segments array\n // 2. the preload segment had preload hints for parts that are not in\n // the manifest yet.\n // in all other cases we want the segment after the preload segment\n // which will be given by using media.segments.length because it is 1 based\n // rather than 0 based.\n\n if (nextPart > -1 || parts.length) {\n nextMSN--;\n }\n } // add _HLS_msn= in front of any _HLS_part query\n // eslint-disable-next-line\n\n parameters._HLS_msn = nextMSN;\n }\n if (media.serverControl && media.serverControl.canSkipUntil) {\n // add _HLS_skip= infront of all other queries.\n // eslint-disable-next-line\n parameters._HLS_skip = media.serverControl.canSkipDateranges ? 'v2' : 'YES';\n }\n if (Object.keys(parameters).length) {\n const parsedUri = new window$1.URL(uri);\n ['_HLS_skip', '_HLS_msn', '_HLS_part'].forEach(function (name) {\n if (!parameters.hasOwnProperty(name)) {\n return;\n }\n parsedUri.searchParams.set(name, parameters[name]);\n });\n uri = parsedUri.toString();\n }\n return uri;\n};\n/**\n * Returns a new segment object with properties and\n * the parts array merged.\n *\n * @param {Object} a the old segment\n * @param {Object} b the new segment\n *\n * @return {Object} the merged segment\n */\n\nconst updateSegment = (a, b) => {\n if (!a) {\n return b;\n }\n const result = merge(a, b); // if only the old segment has preload hints\n // and the new one does not, remove preload hints.\n\n if (a.preloadHints && !b.preloadHints) {\n delete result.preloadHints;\n } // if only the old segment has parts\n // then the parts are no longer valid\n\n if (a.parts && !b.parts) {\n delete result.parts; // if both segments have parts\n // copy part propeties from the old segment\n // to the new one.\n } else if (a.parts && b.parts) {\n for (let i = 0; i < b.parts.length; i++) {\n if (a.parts && a.parts[i]) {\n result.parts[i] = merge(a.parts[i], b.parts[i]);\n }\n }\n } // set skipped to false for segments that have\n // have had information merged from the old segment.\n\n if (!a.skipped && b.skipped) {\n result.skipped = false;\n } // set preload to false for segments that have\n // had information added in the new segment.\n\n if (a.preload && !b.preload) {\n result.preload = false;\n }\n return result;\n};\n/**\n * Returns a new array of segments that is the result of merging\n * properties from an older list of segments onto an updated\n * list. No properties on the updated playlist will be ovewritten.\n *\n * @param {Array} original the outdated list of segments\n * @param {Array} update the updated list of segments\n * @param {number=} offset the index of the first update\n * segment in the original segment list. For non-live playlists,\n * this should always be zero and does not need to be\n * specified. For live playlists, it should be the difference\n * between the media sequence numbers in the original and updated\n * playlists.\n * @return {Array} a list of merged segment objects\n */\n\nconst updateSegments = (original, update, offset) => {\n const oldSegments = original.slice();\n const newSegments = update.slice();\n offset = offset || 0;\n const result = [];\n let currentMap;\n for (let newIndex = 0; newIndex < newSegments.length; newIndex++) {\n const oldSegment = oldSegments[newIndex + offset];\n const newSegment = newSegments[newIndex];\n if (oldSegment) {\n currentMap = oldSegment.map || currentMap;\n result.push(updateSegment(oldSegment, newSegment));\n } else {\n // carry over map to new segment if it is missing\n if (currentMap && !newSegment.map) {\n newSegment.map = currentMap;\n }\n result.push(newSegment);\n }\n }\n return result;\n};\nconst resolveSegmentUris = (segment, baseUri) => {\n // preloadSegment will not have a uri at all\n // as the segment isn't actually in the manifest yet, only parts\n if (!segment.resolvedUri && segment.uri) {\n segment.resolvedUri = resolveUrl(baseUri, segment.uri);\n }\n if (segment.key && !segment.key.resolvedUri) {\n segment.key.resolvedUri = resolveUrl(baseUri, segment.key.uri);\n }\n if (segment.map && !segment.map.resolvedUri) {\n segment.map.resolvedUri = resolveUrl(baseUri, segment.map.uri);\n }\n if (segment.map && segment.map.key && !segment.map.key.resolvedUri) {\n segment.map.key.resolvedUri = resolveUrl(baseUri, segment.map.key.uri);\n }\n if (segment.parts && segment.parts.length) {\n segment.parts.forEach(p => {\n if (p.resolvedUri) {\n return;\n }\n p.resolvedUri = resolveUrl(baseUri, p.uri);\n });\n }\n if (segment.preloadHints && segment.preloadHints.length) {\n segment.preloadHints.forEach(p => {\n if (p.resolvedUri) {\n return;\n }\n p.resolvedUri = resolveUrl(baseUri, p.uri);\n });\n }\n};\nconst getAllSegments = function (media) {\n const segments = media.segments || [];\n const preloadSegment = media.preloadSegment; // a preloadSegment with only preloadHints is not currently\n // a usable segment, only include a preloadSegment that has\n // parts.\n\n if (preloadSegment && preloadSegment.parts && preloadSegment.parts.length) {\n // if preloadHints has a MAP that means that the\n // init segment is going to change. We cannot use any of the parts\n // from this preload segment.\n if (preloadSegment.preloadHints) {\n for (let i = 0; i < preloadSegment.preloadHints.length; i++) {\n if (preloadSegment.preloadHints[i].type === 'MAP') {\n return segments;\n }\n }\n } // set the duration for our preload segment to target duration.\n\n preloadSegment.duration = media.targetDuration;\n preloadSegment.preload = true;\n segments.push(preloadSegment);\n }\n return segments;\n}; // consider the playlist unchanged if the playlist object is the same or\n// the number of segments is equal, the media sequence number is unchanged,\n// and this playlist hasn't become the end of the playlist\n\nconst isPlaylistUnchanged = (a, b) => a === b || a.segments && b.segments && a.segments.length === b.segments.length && a.endList === b.endList && a.mediaSequence === b.mediaSequence && a.preloadSegment === b.preloadSegment;\n/**\n * Returns a new main playlist that is the result of merging an\n * updated media playlist into the original version. If the\n * updated media playlist does not match any of the playlist\n * entries in the original main playlist, null is returned.\n *\n * @param {Object} main a parsed main M3U8 object\n * @param {Object} media a parsed media M3U8 object\n * @return {Object} a new object that represents the original\n * main playlist with the updated media playlist merged in, or\n * null if the merge produced no change.\n */\n\nconst updateMain$1 = (main, newMedia, unchangedCheck = isPlaylistUnchanged) => {\n const result = merge(main, {});\n const oldMedia = result.playlists[newMedia.id];\n if (!oldMedia) {\n return null;\n }\n if (unchangedCheck(oldMedia, newMedia)) {\n return null;\n }\n newMedia.segments = getAllSegments(newMedia);\n const mergedPlaylist = merge(oldMedia, newMedia); // always use the new media's preload segment\n\n if (mergedPlaylist.preloadSegment && !newMedia.preloadSegment) {\n delete mergedPlaylist.preloadSegment;\n } // if the update could overlap existing segment information, merge the two segment lists\n\n if (oldMedia.segments) {\n if (newMedia.skip) {\n newMedia.segments = newMedia.segments || []; // add back in objects for skipped segments, so that we merge\n // old properties into the new segments\n\n for (let i = 0; i < newMedia.skip.skippedSegments; i++) {\n newMedia.segments.unshift({\n skipped: true\n });\n }\n }\n mergedPlaylist.segments = updateSegments(oldMedia.segments, newMedia.segments, newMedia.mediaSequence - oldMedia.mediaSequence);\n } // resolve any segment URIs to prevent us from having to do it later\n\n mergedPlaylist.segments.forEach(segment => {\n resolveSegmentUris(segment, mergedPlaylist.resolvedUri);\n }); // TODO Right now in the playlists array there are two references to each playlist, one\n // that is referenced by index, and one by URI. The index reference may no longer be\n // necessary.\n\n for (let i = 0; i < result.playlists.length; i++) {\n if (result.playlists[i].id === newMedia.id) {\n result.playlists[i] = mergedPlaylist;\n }\n }\n result.playlists[newMedia.id] = mergedPlaylist; // URI reference added for backwards compatibility\n\n result.playlists[newMedia.uri] = mergedPlaylist; // update media group playlist references.\n\n forEachMediaGroup(main, (properties, mediaType, groupKey, labelKey) => {\n if (!properties.playlists) {\n return;\n }\n for (let i = 0; i < properties.playlists.length; i++) {\n if (newMedia.id === properties.playlists[i].id) {\n properties.playlists[i] = mergedPlaylist;\n }\n }\n });\n return result;\n};\n/**\n * Calculates the time to wait before refreshing a live playlist\n *\n * @param {Object} media\n * The current media\n * @param {boolean} update\n * True if there were any updates from the last refresh, false otherwise\n * @return {number}\n * The time in ms to wait before refreshing the live playlist\n */\n\nconst refreshDelay = (media, update) => {\n const segments = media.segments || [];\n const lastSegment = segments[segments.length - 1];\n const lastPart = lastSegment && lastSegment.parts && lastSegment.parts[lastSegment.parts.length - 1];\n const lastDuration = lastPart && lastPart.duration || lastSegment && lastSegment.duration;\n if (update && lastDuration) {\n return lastDuration * 1000;\n } // if the playlist is unchanged since the last reload or last segment duration\n // cannot be determined, try again after half the target duration\n\n return (media.partTargetDuration || media.targetDuration || 10) * 500;\n};\n/**\n * Load a playlist from a remote location\n *\n * @class PlaylistLoader\n * @extends Stream\n * @param {string|Object} src url or object of manifest\n * @param {boolean} withCredentials the withCredentials xhr option\n * @class\n */\n\nclass PlaylistLoader extends EventTarget$1 {\n constructor(src, vhs, options = {}) {\n super();\n if (!src) {\n throw new Error('A non-empty playlist URL or object is required');\n }\n this.logger_ = logger('PlaylistLoader');\n const {\n withCredentials = false\n } = options;\n this.src = src;\n this.vhs_ = vhs;\n this.withCredentials = withCredentials;\n this.addDateRangesToTextTrack_ = options.addDateRangesToTextTrack;\n const vhsOptions = vhs.options_;\n this.customTagParsers = vhsOptions && vhsOptions.customTagParsers || [];\n this.customTagMappers = vhsOptions && vhsOptions.customTagMappers || [];\n this.llhls = vhsOptions && vhsOptions.llhls;\n this.dateRangesStorage_ = new DateRangesStorage(); // initialize the loader state\n\n this.state = 'HAVE_NOTHING'; // live playlist staleness timeout\n\n this.handleMediaupdatetimeout_ = this.handleMediaupdatetimeout_.bind(this);\n this.on('mediaupdatetimeout', this.handleMediaupdatetimeout_);\n this.on('loadedplaylist', this.handleLoadedPlaylist_.bind(this));\n }\n handleLoadedPlaylist_() {\n const mediaPlaylist = this.media();\n if (!mediaPlaylist) {\n return;\n }\n this.dateRangesStorage_.setOffset(mediaPlaylist.segments);\n this.dateRangesStorage_.setPendingDateRanges(mediaPlaylist.dateRanges);\n const availableDateRanges = this.dateRangesStorage_.getDateRangesToProcess();\n if (!availableDateRanges.length || !this.addDateRangesToTextTrack_) {\n return;\n }\n this.addDateRangesToTextTrack_(availableDateRanges);\n }\n handleMediaupdatetimeout_() {\n if (this.state !== 'HAVE_METADATA') {\n // only refresh the media playlist if no other activity is going on\n return;\n }\n const media = this.media();\n let uri = resolveUrl(this.main.uri, media.uri);\n if (this.llhls) {\n uri = addLLHLSQueryDirectives(uri, media);\n }\n this.state = 'HAVE_CURRENT_METADATA';\n this.request = this.vhs_.xhr({\n uri,\n withCredentials: this.withCredentials\n }, (error, req) => {\n // disposed\n if (!this.request) {\n return;\n }\n if (error) {\n return this.playlistRequestError(this.request, this.media(), 'HAVE_METADATA');\n }\n this.haveMetadata({\n playlistString: this.request.responseText,\n url: this.media().uri,\n id: this.media().id\n });\n });\n }\n playlistRequestError(xhr, playlist, startingState) {\n const {\n uri,\n id\n } = playlist; // any in-flight request is now finished\n\n this.request = null;\n if (startingState) {\n this.state = startingState;\n }\n this.error = {\n playlist: this.main.playlists[id],\n status: xhr.status,\n message: `HLS playlist request error at URL: ${uri}.`,\n responseText: xhr.responseText,\n code: xhr.status >= 500 ? 4 : 2\n };\n this.trigger('error');\n }\n parseManifest_({\n url,\n manifestString\n }) {\n return parseManifest({\n onwarn: ({\n message\n }) => this.logger_(`m3u8-parser warn for ${url}: ${message}`),\n oninfo: ({\n message\n }) => this.logger_(`m3u8-parser info for ${url}: ${message}`),\n manifestString,\n customTagParsers: this.customTagParsers,\n customTagMappers: this.customTagMappers,\n llhls: this.llhls\n });\n }\n /**\n * Update the playlist loader's state in response to a new or updated playlist.\n *\n * @param {string} [playlistString]\n * Playlist string (if playlistObject is not provided)\n * @param {Object} [playlistObject]\n * Playlist object (if playlistString is not provided)\n * @param {string} url\n * URL of playlist\n * @param {string} id\n * ID to use for playlist\n */\n\n haveMetadata({\n playlistString,\n playlistObject,\n url,\n id\n }) {\n // any in-flight request is now finished\n this.request = null;\n this.state = 'HAVE_METADATA';\n const playlist = playlistObject || this.parseManifest_({\n url,\n manifestString: playlistString\n });\n playlist.lastRequest = Date.now();\n setupMediaPlaylist({\n playlist,\n uri: url,\n id\n }); // merge this playlist into the main manifest\n\n const update = updateMain$1(this.main, playlist);\n this.targetDuration = playlist.partTargetDuration || playlist.targetDuration;\n this.pendingMedia_ = null;\n if (update) {\n this.main = update;\n this.media_ = this.main.playlists[id];\n } else {\n this.trigger('playlistunchanged');\n }\n this.updateMediaUpdateTimeout_(refreshDelay(this.media(), !!update));\n this.trigger('loadedplaylist');\n }\n /**\n * Abort any outstanding work and clean up.\n */\n\n dispose() {\n this.trigger('dispose');\n this.stopRequest();\n window$1.clearTimeout(this.mediaUpdateTimeout);\n window$1.clearTimeout(this.finalRenditionTimeout);\n this.dateRangesStorage_ = new DateRangesStorage();\n this.off();\n }\n stopRequest() {\n if (this.request) {\n const oldRequest = this.request;\n this.request = null;\n oldRequest.onreadystatechange = null;\n oldRequest.abort();\n }\n }\n /**\n * When called without any arguments, returns the currently\n * active media playlist. When called with a single argument,\n * triggers the playlist loader to asynchronously switch to the\n * specified media playlist. Calling this method while the\n * loader is in the HAVE_NOTHING causes an error to be emitted\n * but otherwise has no effect.\n *\n * @param {Object=} playlist the parsed media playlist\n * object to switch to\n * @param {boolean=} shouldDelay whether we should delay the request by half target duration\n *\n * @return {Playlist} the current loaded media\n */\n\n media(playlist, shouldDelay) {\n // getter\n if (!playlist) {\n return this.media_;\n } // setter\n\n if (this.state === 'HAVE_NOTHING') {\n throw new Error('Cannot switch media playlist from ' + this.state);\n } // find the playlist object if the target playlist has been\n // specified by URI\n\n if (typeof playlist === 'string') {\n if (!this.main.playlists[playlist]) {\n throw new Error('Unknown playlist URI: ' + playlist);\n }\n playlist = this.main.playlists[playlist];\n }\n window$1.clearTimeout(this.finalRenditionTimeout);\n if (shouldDelay) {\n const delay = (playlist.partTargetDuration || playlist.targetDuration) / 2 * 1000 || 5 * 1000;\n this.finalRenditionTimeout = window$1.setTimeout(this.media.bind(this, playlist, false), delay);\n return;\n }\n const startingState = this.state;\n const mediaChange = !this.media_ || playlist.id !== this.media_.id;\n const mainPlaylistRef = this.main.playlists[playlist.id]; // switch to fully loaded playlists immediately\n\n if (mainPlaylistRef && mainPlaylistRef.endList ||\n // handle the case of a playlist object (e.g., if using vhs-json with a resolved\n // media playlist or, for the case of demuxed audio, a resolved audio media group)\n playlist.endList && playlist.segments.length) {\n // abort outstanding playlist requests\n if (this.request) {\n this.request.onreadystatechange = null;\n this.request.abort();\n this.request = null;\n }\n this.state = 'HAVE_METADATA';\n this.media_ = playlist; // trigger media change if the active media has been updated\n\n if (mediaChange) {\n this.trigger('mediachanging');\n if (startingState === 'HAVE_MAIN_MANIFEST') {\n // The initial playlist was a main manifest, and the first media selected was\n // also provided (in the form of a resolved playlist object) as part of the\n // source object (rather than just a URL). Therefore, since the media playlist\n // doesn't need to be requested, loadedmetadata won't trigger as part of the\n // normal flow, and needs an explicit trigger here.\n this.trigger('loadedmetadata');\n } else {\n this.trigger('mediachange');\n }\n }\n return;\n } // We update/set the timeout here so that live playlists\n // that are not a media change will \"start\" the loader as expected.\n // We expect that this function will start the media update timeout\n // cycle again. This also prevents a playlist switch failure from\n // causing us to stall during live.\n\n this.updateMediaUpdateTimeout_(refreshDelay(playlist, true)); // switching to the active playlist is a no-op\n\n if (!mediaChange) {\n return;\n }\n this.state = 'SWITCHING_MEDIA'; // there is already an outstanding playlist request\n\n if (this.request) {\n if (playlist.resolvedUri === this.request.url) {\n // requesting to switch to the same playlist multiple times\n // has no effect after the first\n return;\n }\n this.request.onreadystatechange = null;\n this.request.abort();\n this.request = null;\n } // request the new playlist\n\n if (this.media_) {\n this.trigger('mediachanging');\n }\n this.pendingMedia_ = playlist;\n this.request = this.vhs_.xhr({\n uri: playlist.resolvedUri,\n withCredentials: this.withCredentials\n }, (error, req) => {\n // disposed\n if (!this.request) {\n return;\n }\n playlist.lastRequest = Date.now();\n playlist.resolvedUri = resolveManifestRedirect(playlist.resolvedUri, req);\n if (error) {\n return this.playlistRequestError(this.request, playlist, startingState);\n }\n this.haveMetadata({\n playlistString: req.responseText,\n url: playlist.uri,\n id: playlist.id\n }); // fire loadedmetadata the first time a media playlist is loaded\n\n if (startingState === 'HAVE_MAIN_MANIFEST') {\n this.trigger('loadedmetadata');\n } else {\n this.trigger('mediachange');\n }\n });\n }\n /**\n * pause loading of the playlist\n */\n\n pause() {\n if (this.mediaUpdateTimeout) {\n window$1.clearTimeout(this.mediaUpdateTimeout);\n this.mediaUpdateTimeout = null;\n }\n this.stopRequest();\n if (this.state === 'HAVE_NOTHING') {\n // If we pause the loader before any data has been retrieved, its as if we never\n // started, so reset to an unstarted state.\n this.started = false;\n } // Need to restore state now that no activity is happening\n\n if (this.state === 'SWITCHING_MEDIA') {\n // if the loader was in the process of switching media, it should either return to\n // HAVE_MAIN_MANIFEST or HAVE_METADATA depending on if the loader has loaded a media\n // playlist yet. This is determined by the existence of loader.media_\n if (this.media_) {\n this.state = 'HAVE_METADATA';\n } else {\n this.state = 'HAVE_MAIN_MANIFEST';\n }\n } else if (this.state === 'HAVE_CURRENT_METADATA') {\n this.state = 'HAVE_METADATA';\n }\n }\n /**\n * start loading of the playlist\n */\n\n load(shouldDelay) {\n if (this.mediaUpdateTimeout) {\n window$1.clearTimeout(this.mediaUpdateTimeout);\n this.mediaUpdateTimeout = null;\n }\n const media = this.media();\n if (shouldDelay) {\n const delay = media ? (media.partTargetDuration || media.targetDuration) / 2 * 1000 : 5 * 1000;\n this.mediaUpdateTimeout = window$1.setTimeout(() => {\n this.mediaUpdateTimeout = null;\n this.load();\n }, delay);\n return;\n }\n if (!this.started) {\n this.start();\n return;\n }\n if (media && !media.endList) {\n this.trigger('mediaupdatetimeout');\n } else {\n this.trigger('loadedplaylist');\n }\n }\n updateMediaUpdateTimeout_(delay) {\n if (this.mediaUpdateTimeout) {\n window$1.clearTimeout(this.mediaUpdateTimeout);\n this.mediaUpdateTimeout = null;\n } // we only have use mediaupdatetimeout for live playlists.\n\n if (!this.media() || this.media().endList) {\n return;\n }\n this.mediaUpdateTimeout = window$1.setTimeout(() => {\n this.mediaUpdateTimeout = null;\n this.trigger('mediaupdatetimeout');\n this.updateMediaUpdateTimeout_(delay);\n }, delay);\n }\n /**\n * start loading of the playlist\n */\n\n start() {\n this.started = true;\n if (typeof this.src === 'object') {\n // in the case of an entirely constructed manifest object (meaning there's no actual\n // manifest on a server), default the uri to the page's href\n if (!this.src.uri) {\n this.src.uri = window$1.location.href;\n } // resolvedUri is added on internally after the initial request. Since there's no\n // request for pre-resolved manifests, add on resolvedUri here.\n\n this.src.resolvedUri = this.src.uri; // Since a manifest object was passed in as the source (instead of a URL), the first\n // request can be skipped (since the top level of the manifest, at a minimum, is\n // already available as a parsed manifest object). However, if the manifest object\n // represents a main playlist, some media playlists may need to be resolved before\n // the starting segment list is available. Therefore, go directly to setup of the\n // initial playlist, and let the normal flow continue from there.\n //\n // Note that the call to setup is asynchronous, as other sections of VHS may assume\n // that the first request is asynchronous.\n\n setTimeout(() => {\n this.setupInitialPlaylist(this.src);\n }, 0);\n return;\n } // request the specified URL\n\n this.request = this.vhs_.xhr({\n uri: this.src,\n withCredentials: this.withCredentials\n }, (error, req) => {\n // disposed\n if (!this.request) {\n return;\n } // clear the loader's request reference\n\n this.request = null;\n if (error) {\n this.error = {\n status: req.status,\n message: `HLS playlist request error at URL: ${this.src}.`,\n responseText: req.responseText,\n // MEDIA_ERR_NETWORK\n code: 2\n };\n if (this.state === 'HAVE_NOTHING') {\n this.started = false;\n }\n return this.trigger('error');\n }\n this.src = resolveManifestRedirect(this.src, req);\n const manifest = this.parseManifest_({\n manifestString: req.responseText,\n url: this.src\n });\n this.setupInitialPlaylist(manifest);\n });\n }\n srcUri() {\n return typeof this.src === 'string' ? this.src : this.src.uri;\n }\n /**\n * Given a manifest object that's either a main or media playlist, trigger the proper\n * events and set the state of the playlist loader.\n *\n * If the manifest object represents a main playlist, `loadedplaylist` will be\n * triggered to allow listeners to select a playlist. If none is selected, the loader\n * will default to the first one in the playlists array.\n *\n * If the manifest object represents a media playlist, `loadedplaylist` will be\n * triggered followed by `loadedmetadata`, as the only available playlist is loaded.\n *\n * In the case of a media playlist, a main playlist object wrapper with one playlist\n * will be created so that all logic can handle playlists in the same fashion (as an\n * assumed manifest object schema).\n *\n * @param {Object} manifest\n * The parsed manifest object\n */\n\n setupInitialPlaylist(manifest) {\n this.state = 'HAVE_MAIN_MANIFEST';\n if (manifest.playlists) {\n this.main = manifest;\n addPropertiesToMain(this.main, this.srcUri()); // If the initial main playlist has playlists wtih segments already resolved,\n // then resolve URIs in advance, as they are usually done after a playlist request,\n // which may not happen if the playlist is resolved.\n\n manifest.playlists.forEach(playlist => {\n playlist.segments = getAllSegments(playlist);\n playlist.segments.forEach(segment => {\n resolveSegmentUris(segment, playlist.resolvedUri);\n });\n });\n this.trigger('loadedplaylist');\n if (!this.request) {\n // no media playlist was specifically selected so start\n // from the first listed one\n this.media(this.main.playlists[0]);\n }\n return;\n } // In order to support media playlists passed in as vhs-json, the case where the uri\n // is not provided as part of the manifest should be considered, and an appropriate\n // default used.\n\n const uri = this.srcUri() || window$1.location.href;\n this.main = mainForMedia(manifest, uri);\n this.haveMetadata({\n playlistObject: manifest,\n url: uri,\n id: this.main.playlists[0].id\n });\n this.trigger('loadedmetadata');\n }\n}\n\n/**\n * @file xhr.js\n */\nconst {\n xhr: videojsXHR\n} = videojs;\nconst callbackWrapper = function (request, error, response, callback) {\n const reqResponse = request.responseType === 'arraybuffer' ? request.response : request.responseText;\n if (!error && reqResponse) {\n request.responseTime = Date.now();\n request.roundTripTime = request.responseTime - request.requestTime;\n request.bytesReceived = reqResponse.byteLength || reqResponse.length;\n if (!request.bandwidth) {\n request.bandwidth = Math.floor(request.bytesReceived / request.roundTripTime * 8 * 1000);\n }\n }\n if (response.headers) {\n request.responseHeaders = response.headers;\n } // videojs.xhr now uses a specific code on the error\n // object to signal that a request has timed out instead\n // of setting a boolean on the request object\n\n if (error && error.code === 'ETIMEDOUT') {\n request.timedout = true;\n } // videojs.xhr no longer considers status codes outside of 200 and 0\n // (for file uris) to be errors, but the old XHR did, so emulate that\n // behavior. Status 206 may be used in response to byterange requests.\n\n if (!error && !request.aborted && response.statusCode !== 200 && response.statusCode !== 206 && response.statusCode !== 0) {\n error = new Error('XHR Failed with a response of: ' + (request && (reqResponse || request.responseText)));\n }\n callback(error, request);\n};\n/**\n * Iterates over the request hooks Set and calls them in order\n *\n * @param {Set} hooks the hook Set to iterate over\n * @param {Object} options the request options to pass to the xhr wrapper\n * @return the callback hook function return value, the modified or new options Object.\n */\n\nconst callAllRequestHooks = (requestSet, options) => {\n if (!requestSet || !requestSet.size) {\n return;\n }\n let newOptions = options;\n requestSet.forEach(requestCallback => {\n newOptions = requestCallback(newOptions);\n });\n return newOptions;\n};\n/**\n * Iterates over the response hooks Set and calls them in order.\n *\n * @param {Set} hooks the hook Set to iterate over\n * @param {Object} request the xhr request object\n * @param {Object} error the xhr error object\n * @param {Object} response the xhr response object\n */\n\nconst callAllResponseHooks = (responseSet, request, error, response) => {\n if (!responseSet || !responseSet.size) {\n return;\n }\n responseSet.forEach(responseCallback => {\n responseCallback(request, error, response);\n });\n};\nconst xhrFactory = function () {\n const xhr = function XhrFunction(options, callback) {\n // Add a default timeout\n options = merge({\n timeout: 45e3\n }, options); // Allow an optional user-specified function to modify the option\n // object before we construct the xhr request\n // TODO: Remove beforeRequest in the next major release.\n\n const beforeRequest = XhrFunction.beforeRequest || videojs.Vhs.xhr.beforeRequest; // onRequest and onResponse hooks as a Set, at either the player or global level.\n // TODO: new Set added here for beforeRequest alias. Remove this when beforeRequest is removed.\n\n const _requestCallbackSet = XhrFunction._requestCallbackSet || videojs.Vhs.xhr._requestCallbackSet || new Set();\n const _responseCallbackSet = XhrFunction._responseCallbackSet || videojs.Vhs.xhr._responseCallbackSet;\n if (beforeRequest && typeof beforeRequest === 'function') {\n videojs.log.warn('beforeRequest is deprecated, use onRequest instead.');\n _requestCallbackSet.add(beforeRequest);\n } // Use the standard videojs.xhr() method unless `videojs.Vhs.xhr` has been overriden\n // TODO: switch back to videojs.Vhs.xhr.name === 'XhrFunction' when we drop IE11\n\n const xhrMethod = videojs.Vhs.xhr.original === true ? videojsXHR : videojs.Vhs.xhr; // call all registered onRequest hooks, assign new options.\n\n const beforeRequestOptions = callAllRequestHooks(_requestCallbackSet, options); // Remove the beforeRequest function from the hooks set so stale beforeRequest functions are not called.\n\n _requestCallbackSet.delete(beforeRequest); // xhrMethod will call XMLHttpRequest.open and XMLHttpRequest.send\n\n const request = xhrMethod(beforeRequestOptions || options, function (error, response) {\n // call all registered onResponse hooks\n callAllResponseHooks(_responseCallbackSet, request, error, response);\n return callbackWrapper(request, error, response, callback);\n });\n const originalAbort = request.abort;\n request.abort = function () {\n request.aborted = true;\n return originalAbort.apply(request, arguments);\n };\n request.uri = options.uri;\n request.requestTime = Date.now();\n return request;\n };\n xhr.original = true;\n return xhr;\n};\n/**\n * Turns segment byterange into a string suitable for use in\n * HTTP Range requests\n *\n * @param {Object} byterange - an object with two values defining the start and end\n * of a byte-range\n */\n\nconst byterangeStr = function (byterange) {\n // `byterangeEnd` is one less than `offset + length` because the HTTP range\n // header uses inclusive ranges\n let byterangeEnd;\n const byterangeStart = byterange.offset;\n if (typeof byterange.offset === 'bigint' || typeof byterange.length === 'bigint') {\n byterangeEnd = window$1.BigInt(byterange.offset) + window$1.BigInt(byterange.length) - window$1.BigInt(1);\n } else {\n byterangeEnd = byterange.offset + byterange.length - 1;\n }\n return 'bytes=' + byterangeStart + '-' + byterangeEnd;\n};\n/**\n * Defines headers for use in the xhr request for a particular segment.\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n * from SegmentLoader\n */\n\nconst segmentXhrHeaders = function (segment) {\n const headers = {};\n if (segment.byterange) {\n headers.Range = byterangeStr(segment.byterange);\n }\n return headers;\n};\n\n/**\n * @file bin-utils.js\n */\n\n/**\n * convert a TimeRange to text\n *\n * @param {TimeRange} range the timerange to use for conversion\n * @param {number} i the iterator on the range to convert\n * @return {string} the range in string format\n */\n\nconst textRange = function (range, i) {\n return range.start(i) + '-' + range.end(i);\n};\n/**\n * format a number as hex string\n *\n * @param {number} e The number\n * @param {number} i the iterator\n * @return {string} the hex formatted number as a string\n */\n\nconst formatHexString = function (e, i) {\n const value = e.toString(16);\n return '00'.substring(0, 2 - value.length) + value + (i % 2 ? ' ' : '');\n};\nconst formatAsciiString = function (e) {\n if (e >= 0x20 && e < 0x7e) {\n return String.fromCharCode(e);\n }\n return '.';\n};\n/**\n * Creates an object for sending to a web worker modifying properties that are TypedArrays\n * into a new object with seperated properties for the buffer, byteOffset, and byteLength.\n *\n * @param {Object} message\n * Object of properties and values to send to the web worker\n * @return {Object}\n * Modified message with TypedArray values expanded\n * @function createTransferableMessage\n */\n\nconst createTransferableMessage = function (message) {\n const transferable = {};\n Object.keys(message).forEach(key => {\n const value = message[key];\n if (isArrayBufferView(value)) {\n transferable[key] = {\n bytes: value.buffer,\n byteOffset: value.byteOffset,\n byteLength: value.byteLength\n };\n } else {\n transferable[key] = value;\n }\n });\n return transferable;\n};\n/**\n * Returns a unique string identifier for a media initialization\n * segment.\n *\n * @param {Object} initSegment\n * the init segment object.\n *\n * @return {string} the generated init segment id\n */\n\nconst initSegmentId = function (initSegment) {\n const byterange = initSegment.byterange || {\n length: Infinity,\n offset: 0\n };\n return [byterange.length, byterange.offset, initSegment.resolvedUri].join(',');\n};\n/**\n * Returns a unique string identifier for a media segment key.\n *\n * @param {Object} key the encryption key\n * @return {string} the unique id for the media segment key.\n */\n\nconst segmentKeyId = function (key) {\n return key.resolvedUri;\n};\n/**\n * utils to help dump binary data to the console\n *\n * @param {Array|TypedArray} data\n * data to dump to a string\n *\n * @return {string} the data as a hex string.\n */\n\nconst hexDump = data => {\n const bytes = Array.prototype.slice.call(data);\n const step = 16;\n let result = '';\n let hex;\n let ascii;\n for (let j = 0; j < bytes.length / step; j++) {\n hex = bytes.slice(j * step, j * step + step).map(formatHexString).join('');\n ascii = bytes.slice(j * step, j * step + step).map(formatAsciiString).join('');\n result += hex + ' ' + ascii + '\\n';\n }\n return result;\n};\nconst tagDump = ({\n bytes\n}) => hexDump(bytes);\nconst textRanges = ranges => {\n let result = '';\n let i;\n for (i = 0; i < ranges.length; i++) {\n result += textRange(ranges, i) + ' ';\n }\n return result;\n};\nvar utils = /*#__PURE__*/Object.freeze({\n __proto__: null,\n createTransferableMessage: createTransferableMessage,\n initSegmentId: initSegmentId,\n segmentKeyId: segmentKeyId,\n hexDump: hexDump,\n tagDump: tagDump,\n textRanges: textRanges\n});\n\n// TODO handle fmp4 case where the timing info is accurate and doesn't involve transmux\n// 25% was arbitrarily chosen, and may need to be refined over time.\n\nconst SEGMENT_END_FUDGE_PERCENT = 0.25;\n/**\n * Converts a player time (any time that can be gotten/set from player.currentTime(),\n * e.g., any time within player.seekable().start(0) to player.seekable().end(0)) to a\n * program time (any time referencing the real world (e.g., EXT-X-PROGRAM-DATE-TIME)).\n *\n * The containing segment is required as the EXT-X-PROGRAM-DATE-TIME serves as an \"anchor\n * point\" (a point where we have a mapping from program time to player time, with player\n * time being the post transmux start of the segment).\n *\n * For more details, see [this doc](../../docs/program-time-from-player-time.md).\n *\n * @param {number} playerTime the player time\n * @param {Object} segment the segment which contains the player time\n * @return {Date} program time\n */\n\nconst playerTimeToProgramTime = (playerTime, segment) => {\n if (!segment.dateTimeObject) {\n // Can't convert without an \"anchor point\" for the program time (i.e., a time that can\n // be used to map the start of a segment with a real world time).\n return null;\n }\n const transmuxerPrependedSeconds = segment.videoTimingInfo.transmuxerPrependedSeconds;\n const transmuxedStart = segment.videoTimingInfo.transmuxedPresentationStart; // get the start of the content from before old content is prepended\n\n const startOfSegment = transmuxedStart + transmuxerPrependedSeconds;\n const offsetFromSegmentStart = playerTime - startOfSegment;\n return new Date(segment.dateTimeObject.getTime() + offsetFromSegmentStart * 1000);\n};\nconst originalSegmentVideoDuration = videoTimingInfo => {\n return videoTimingInfo.transmuxedPresentationEnd - videoTimingInfo.transmuxedPresentationStart - videoTimingInfo.transmuxerPrependedSeconds;\n};\n/**\n * Finds a segment that contains the time requested given as an ISO-8601 string. The\n * returned segment might be an estimate or an accurate match.\n *\n * @param {string} programTime The ISO-8601 programTime to find a match for\n * @param {Object} playlist A playlist object to search within\n */\n\nconst findSegmentForProgramTime = (programTime, playlist) => {\n // Assumptions:\n // - verifyProgramDateTimeTags has already been run\n // - live streams have been started\n let dateTimeObject;\n try {\n dateTimeObject = new Date(programTime);\n } catch (e) {\n return null;\n }\n if (!playlist || !playlist.segments || playlist.segments.length === 0) {\n return null;\n }\n let segment = playlist.segments[0];\n if (dateTimeObject < new Date(segment.dateTimeObject)) {\n // Requested time is before stream start.\n return null;\n }\n for (let i = 0; i < playlist.segments.length - 1; i++) {\n segment = playlist.segments[i];\n const nextSegmentStart = new Date(playlist.segments[i + 1].dateTimeObject);\n if (dateTimeObject < nextSegmentStart) {\n break;\n }\n }\n const lastSegment = playlist.segments[playlist.segments.length - 1];\n const lastSegmentStart = lastSegment.dateTimeObject;\n const lastSegmentDuration = lastSegment.videoTimingInfo ? originalSegmentVideoDuration(lastSegment.videoTimingInfo) : lastSegment.duration + lastSegment.duration * SEGMENT_END_FUDGE_PERCENT;\n const lastSegmentEnd = new Date(lastSegmentStart.getTime() + lastSegmentDuration * 1000);\n if (dateTimeObject > lastSegmentEnd) {\n // Beyond the end of the stream, or our best guess of the end of the stream.\n return null;\n }\n if (dateTimeObject > new Date(lastSegmentStart)) {\n segment = lastSegment;\n }\n return {\n segment,\n estimatedStart: segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationStart : Playlist.duration(playlist, playlist.mediaSequence + playlist.segments.indexOf(segment)),\n // Although, given that all segments have accurate date time objects, the segment\n // selected should be accurate, unless the video has been transmuxed at some point\n // (determined by the presence of the videoTimingInfo object), the segment's \"player\n // time\" (the start time in the player) can't be considered accurate.\n type: segment.videoTimingInfo ? 'accurate' : 'estimate'\n };\n};\n/**\n * Finds a segment that contains the given player time(in seconds).\n *\n * @param {number} time The player time to find a match for\n * @param {Object} playlist A playlist object to search within\n */\n\nconst findSegmentForPlayerTime = (time, playlist) => {\n // Assumptions:\n // - there will always be a segment.duration\n // - we can start from zero\n // - segments are in time order\n if (!playlist || !playlist.segments || playlist.segments.length === 0) {\n return null;\n }\n let segmentEnd = 0;\n let segment;\n for (let i = 0; i < playlist.segments.length; i++) {\n segment = playlist.segments[i]; // videoTimingInfo is set after the segment is downloaded and transmuxed, and\n // should contain the most accurate values we have for the segment's player times.\n //\n // Use the accurate transmuxedPresentationEnd value if it is available, otherwise fall\n // back to an estimate based on the manifest derived (inaccurate) segment.duration, to\n // calculate an end value.\n\n segmentEnd = segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationEnd : segmentEnd + segment.duration;\n if (time <= segmentEnd) {\n break;\n }\n }\n const lastSegment = playlist.segments[playlist.segments.length - 1];\n if (lastSegment.videoTimingInfo && lastSegment.videoTimingInfo.transmuxedPresentationEnd < time) {\n // The time requested is beyond the stream end.\n return null;\n }\n if (time > segmentEnd) {\n // The time is within or beyond the last segment.\n //\n // Check to see if the time is beyond a reasonable guess of the end of the stream.\n if (time > segmentEnd + lastSegment.duration * SEGMENT_END_FUDGE_PERCENT) {\n // Technically, because the duration value is only an estimate, the time may still\n // exist in the last segment, however, there isn't enough information to make even\n // a reasonable estimate.\n return null;\n }\n segment = lastSegment;\n }\n return {\n segment,\n estimatedStart: segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationStart : segmentEnd - segment.duration,\n // Because videoTimingInfo is only set after transmux, it is the only way to get\n // accurate timing values.\n type: segment.videoTimingInfo ? 'accurate' : 'estimate'\n };\n};\n/**\n * Gives the offset of the comparisonTimestamp from the programTime timestamp in seconds.\n * If the offset returned is positive, the programTime occurs after the\n * comparisonTimestamp.\n * If the offset is negative, the programTime occurs before the comparisonTimestamp.\n *\n * @param {string} comparisonTimeStamp An ISO-8601 timestamp to compare against\n * @param {string} programTime The programTime as an ISO-8601 string\n * @return {number} offset\n */\n\nconst getOffsetFromTimestamp = (comparisonTimeStamp, programTime) => {\n let segmentDateTime;\n let programDateTime;\n try {\n segmentDateTime = new Date(comparisonTimeStamp);\n programDateTime = new Date(programTime);\n } catch (e) {// TODO handle error\n }\n const segmentTimeEpoch = segmentDateTime.getTime();\n const programTimeEpoch = programDateTime.getTime();\n return (programTimeEpoch - segmentTimeEpoch) / 1000;\n};\n/**\n * Checks that all segments in this playlist have programDateTime tags.\n *\n * @param {Object} playlist A playlist object\n */\n\nconst verifyProgramDateTimeTags = playlist => {\n if (!playlist.segments || playlist.segments.length === 0) {\n return false;\n }\n for (let i = 0; i < playlist.segments.length; i++) {\n const segment = playlist.segments[i];\n if (!segment.dateTimeObject) {\n return false;\n }\n }\n return true;\n};\n/**\n * Returns the programTime of the media given a playlist and a playerTime.\n * The playlist must have programDateTime tags for a programDateTime tag to be returned.\n * If the segments containing the time requested have not been buffered yet, an estimate\n * may be returned to the callback.\n *\n * @param {Object} args\n * @param {Object} args.playlist A playlist object to search within\n * @param {number} time A playerTime in seconds\n * @param {Function} callback(err, programTime)\n * @return {string} err.message A detailed error message\n * @return {Object} programTime\n * @return {number} programTime.mediaSeconds The streamTime in seconds\n * @return {string} programTime.programDateTime The programTime as an ISO-8601 String\n */\n\nconst getProgramTime = ({\n playlist,\n time = undefined,\n callback\n}) => {\n if (!callback) {\n throw new Error('getProgramTime: callback must be provided');\n }\n if (!playlist || time === undefined) {\n return callback({\n message: 'getProgramTime: playlist and time must be provided'\n });\n }\n const matchedSegment = findSegmentForPlayerTime(time, playlist);\n if (!matchedSegment) {\n return callback({\n message: 'valid programTime was not found'\n });\n }\n if (matchedSegment.type === 'estimate') {\n return callback({\n message: 'Accurate programTime could not be determined.' + ' Please seek to e.seekTime and try again',\n seekTime: matchedSegment.estimatedStart\n });\n }\n const programTimeObject = {\n mediaSeconds: time\n };\n const programTime = playerTimeToProgramTime(time, matchedSegment.segment);\n if (programTime) {\n programTimeObject.programDateTime = programTime.toISOString();\n }\n return callback(null, programTimeObject);\n};\n/**\n * Seeks in the player to a time that matches the given programTime ISO-8601 string.\n *\n * @param {Object} args\n * @param {string} args.programTime A programTime to seek to as an ISO-8601 String\n * @param {Object} args.playlist A playlist to look within\n * @param {number} args.retryCount The number of times to try for an accurate seek. Default is 2.\n * @param {Function} args.seekTo A method to perform a seek\n * @param {boolean} args.pauseAfterSeek Whether to end in a paused state after seeking. Default is true.\n * @param {Object} args.tech The tech to seek on\n * @param {Function} args.callback(err, newTime) A callback to return the new time to\n * @return {string} err.message A detailed error message\n * @return {number} newTime The exact time that was seeked to in seconds\n */\n\nconst seekToProgramTime = ({\n programTime,\n playlist,\n retryCount = 2,\n seekTo,\n pauseAfterSeek = true,\n tech,\n callback\n}) => {\n if (!callback) {\n throw new Error('seekToProgramTime: callback must be provided');\n }\n if (typeof programTime === 'undefined' || !playlist || !seekTo) {\n return callback({\n message: 'seekToProgramTime: programTime, seekTo and playlist must be provided'\n });\n }\n if (!playlist.endList && !tech.hasStarted_) {\n return callback({\n message: 'player must be playing a live stream to start buffering'\n });\n }\n if (!verifyProgramDateTimeTags(playlist)) {\n return callback({\n message: 'programDateTime tags must be provided in the manifest ' + playlist.resolvedUri\n });\n }\n const matchedSegment = findSegmentForProgramTime(programTime, playlist); // no match\n\n if (!matchedSegment) {\n return callback({\n message: `${programTime} was not found in the stream`\n });\n }\n const segment = matchedSegment.segment;\n const mediaOffset = getOffsetFromTimestamp(segment.dateTimeObject, programTime);\n if (matchedSegment.type === 'estimate') {\n // we've run out of retries\n if (retryCount === 0) {\n return callback({\n message: `${programTime} is not buffered yet. Try again`\n });\n }\n seekTo(matchedSegment.estimatedStart + mediaOffset);\n tech.one('seeked', () => {\n seekToProgramTime({\n programTime,\n playlist,\n retryCount: retryCount - 1,\n seekTo,\n pauseAfterSeek,\n tech,\n callback\n });\n });\n return;\n } // Since the segment.start value is determined from the buffered end or ending time\n // of the prior segment, the seekToTime doesn't need to account for any transmuxer\n // modifications.\n\n const seekToTime = segment.start + mediaOffset;\n const seekedCallback = () => {\n return callback(null, tech.currentTime());\n }; // listen for seeked event\n\n tech.one('seeked', seekedCallback); // pause before seeking as video.js will restore this state\n\n if (pauseAfterSeek) {\n tech.pause();\n }\n seekTo(seekToTime);\n};\n\n// which will only happen if the request is complete.\n\nconst callbackOnCompleted = (request, cb) => {\n if (request.readyState === 4) {\n return cb();\n }\n return;\n};\nconst containerRequest = (uri, xhr, cb) => {\n let bytes = [];\n let id3Offset;\n let finished = false;\n const endRequestAndCallback = function (err, req, type, _bytes) {\n req.abort();\n finished = true;\n return cb(err, req, type, _bytes);\n };\n const progressListener = function (error, request) {\n if (finished) {\n return;\n }\n if (error) {\n return endRequestAndCallback(error, request, '', bytes);\n } // grap the new part of content that was just downloaded\n\n const newPart = request.responseText.substring(bytes && bytes.byteLength || 0, request.responseText.length); // add that onto bytes\n\n bytes = concatTypedArrays(bytes, stringToBytes(newPart, true));\n id3Offset = id3Offset || getId3Offset(bytes); // we need at least 10 bytes to determine a type\n // or we need at least two bytes after an id3Offset\n\n if (bytes.length < 10 || id3Offset && bytes.length < id3Offset + 2) {\n return callbackOnCompleted(request, () => endRequestAndCallback(error, request, '', bytes));\n }\n const type = detectContainerForBytes(bytes); // if this looks like a ts segment but we don't have enough data\n // to see the second sync byte, wait until we have enough data\n // before declaring it ts\n\n if (type === 'ts' && bytes.length < 188) {\n return callbackOnCompleted(request, () => endRequestAndCallback(error, request, '', bytes));\n } // this may be an unsynced ts segment\n // wait for 376 bytes before detecting no container\n\n if (!type && bytes.length < 376) {\n return callbackOnCompleted(request, () => endRequestAndCallback(error, request, '', bytes));\n }\n return endRequestAndCallback(null, request, type, bytes);\n };\n const options = {\n uri,\n beforeSend(request) {\n // this forces the browser to pass the bytes to us unprocessed\n request.overrideMimeType('text/plain; charset=x-user-defined');\n request.addEventListener('progress', function ({\n total,\n loaded\n }) {\n return callbackWrapper(request, null, {\n statusCode: request.status\n }, progressListener);\n });\n }\n };\n const request = xhr(options, function (error, response) {\n return callbackWrapper(request, error, response, progressListener);\n });\n return request;\n};\nconst {\n EventTarget\n} = videojs;\nconst dashPlaylistUnchanged = function (a, b) {\n if (!isPlaylistUnchanged(a, b)) {\n return false;\n } // for dash the above check will often return true in scenarios where\n // the playlist actually has changed because mediaSequence isn't a\n // dash thing, and we often set it to 1. So if the playlists have the same amount\n // of segments we return true.\n // So for dash we need to make sure that the underlying segments are different.\n // if sidx changed then the playlists are different.\n\n if (a.sidx && b.sidx && (a.sidx.offset !== b.sidx.offset || a.sidx.length !== b.sidx.length)) {\n return false;\n } else if (!a.sidx && b.sidx || a.sidx && !b.sidx) {\n return false;\n } // one or the other does not have segments\n // there was a change.\n\n if (a.segments && !b.segments || !a.segments && b.segments) {\n return false;\n } // neither has segments nothing changed\n\n if (!a.segments && !b.segments) {\n return true;\n } // check segments themselves\n\n for (let i = 0; i < a.segments.length; i++) {\n const aSegment = a.segments[i];\n const bSegment = b.segments[i]; // if uris are different between segments there was a change\n\n if (aSegment.uri !== bSegment.uri) {\n return false;\n } // neither segment has a byterange, there will be no byterange change.\n\n if (!aSegment.byterange && !bSegment.byterange) {\n continue;\n }\n const aByterange = aSegment.byterange;\n const bByterange = bSegment.byterange; // if byterange only exists on one of the segments, there was a change.\n\n if (aByterange && !bByterange || !aByterange && bByterange) {\n return false;\n } // if both segments have byterange with different offsets, there was a change.\n\n if (aByterange.offset !== bByterange.offset || aByterange.length !== bByterange.length) {\n return false;\n }\n } // if everything was the same with segments, this is the same playlist.\n\n return true;\n};\n/**\n * Use the representation IDs from the mpd object to create groupIDs, the NAME is set to mandatory representation\n * ID in the parser. This allows for continuous playout across periods with the same representation IDs\n * (continuous periods as defined in DASH-IF 3.2.12). This is assumed in the mpd-parser as well. If we want to support\n * periods without continuous playback this function may need modification as well as the parser.\n */\n\nconst dashGroupId = (type, group, label, playlist) => {\n // If the manifest somehow does not have an ID (non-dash compliant), use the label.\n const playlistId = playlist.attributes.NAME || label;\n return `placeholder-uri-${type}-${group}-${playlistId}`;\n};\n/**\n * Parses the main XML string and updates playlist URI references.\n *\n * @param {Object} config\n * Object of arguments\n * @param {string} config.mainXml\n * The mpd XML\n * @param {string} config.srcUrl\n * The mpd URL\n * @param {Date} config.clientOffset\n * A time difference between server and client\n * @param {Object} config.sidxMapping\n * SIDX mappings for moof/mdat URIs and byte ranges\n * @return {Object}\n * The parsed mpd manifest object\n */\n\nconst parseMainXml = ({\n mainXml,\n srcUrl,\n clientOffset,\n sidxMapping,\n previousManifest\n}) => {\n const manifest = parse(mainXml, {\n manifestUri: srcUrl,\n clientOffset,\n sidxMapping,\n previousManifest\n });\n addPropertiesToMain(manifest, srcUrl, dashGroupId);\n return manifest;\n};\n/**\n * Removes any mediaGroup labels that no longer exist in the newMain\n *\n * @param {Object} update\n * The previous mpd object being updated\n * @param {Object} newMain\n * The new mpd object\n */\n\nconst removeOldMediaGroupLabels = (update, newMain) => {\n forEachMediaGroup(update, (properties, type, group, label) => {\n if (!(label in newMain.mediaGroups[type][group])) {\n delete update.mediaGroups[type][group][label];\n }\n });\n};\n/**\n * Returns a new main manifest that is the result of merging an updated main manifest\n * into the original version.\n *\n * @param {Object} oldMain\n * The old parsed mpd object\n * @param {Object} newMain\n * The updated parsed mpd object\n * @return {Object}\n * A new object representing the original main manifest with the updated media\n * playlists merged in\n */\n\nconst updateMain = (oldMain, newMain, sidxMapping) => {\n let noChanges = true;\n let update = merge(oldMain, {\n // These are top level properties that can be updated\n duration: newMain.duration,\n minimumUpdatePeriod: newMain.minimumUpdatePeriod,\n timelineStarts: newMain.timelineStarts\n }); // First update the playlists in playlist list\n\n for (let i = 0; i < newMain.playlists.length; i++) {\n const playlist = newMain.playlists[i];\n if (playlist.sidx) {\n const sidxKey = generateSidxKey(playlist.sidx); // add sidx segments to the playlist if we have all the sidx info already\n\n if (sidxMapping && sidxMapping[sidxKey] && sidxMapping[sidxKey].sidx) {\n addSidxSegmentsToPlaylist(playlist, sidxMapping[sidxKey].sidx, playlist.sidx.resolvedUri);\n }\n }\n const playlistUpdate = updateMain$1(update, playlist, dashPlaylistUnchanged);\n if (playlistUpdate) {\n update = playlistUpdate;\n noChanges = false;\n }\n } // Then update media group playlists\n\n forEachMediaGroup(newMain, (properties, type, group, label) => {\n if (properties.playlists && properties.playlists.length) {\n const id = properties.playlists[0].id;\n const playlistUpdate = updateMain$1(update, properties.playlists[0], dashPlaylistUnchanged);\n if (playlistUpdate) {\n update = playlistUpdate; // add new mediaGroup label if it doesn't exist and assign the new mediaGroup.\n\n if (!(label in update.mediaGroups[type][group])) {\n update.mediaGroups[type][group][label] = properties;\n } // update the playlist reference within media groups\n\n update.mediaGroups[type][group][label].playlists[0] = update.playlists[id];\n noChanges = false;\n }\n }\n }); // remove mediaGroup labels and references that no longer exist in the newMain\n\n removeOldMediaGroupLabels(update, newMain);\n if (newMain.minimumUpdatePeriod !== oldMain.minimumUpdatePeriod) {\n noChanges = false;\n }\n if (noChanges) {\n return null;\n }\n return update;\n}; // SIDX should be equivalent if the URI and byteranges of the SIDX match.\n// If the SIDXs have maps, the two maps should match,\n// both `a` and `b` missing SIDXs is considered matching.\n// If `a` or `b` but not both have a map, they aren't matching.\n\nconst equivalentSidx = (a, b) => {\n const neitherMap = Boolean(!a.map && !b.map);\n const equivalentMap = neitherMap || Boolean(a.map && b.map && a.map.byterange.offset === b.map.byterange.offset && a.map.byterange.length === b.map.byterange.length);\n return equivalentMap && a.uri === b.uri && a.byterange.offset === b.byterange.offset && a.byterange.length === b.byterange.length;\n}; // exported for testing\n\nconst compareSidxEntry = (playlists, oldSidxMapping) => {\n const newSidxMapping = {};\n for (const id in playlists) {\n const playlist = playlists[id];\n const currentSidxInfo = playlist.sidx;\n if (currentSidxInfo) {\n const key = generateSidxKey(currentSidxInfo);\n if (!oldSidxMapping[key]) {\n break;\n }\n const savedSidxInfo = oldSidxMapping[key].sidxInfo;\n if (equivalentSidx(savedSidxInfo, currentSidxInfo)) {\n newSidxMapping[key] = oldSidxMapping[key];\n }\n }\n }\n return newSidxMapping;\n};\n/**\n * A function that filters out changed items as they need to be requested separately.\n *\n * The method is exported for testing\n *\n * @param {Object} main the parsed mpd XML returned via mpd-parser\n * @param {Object} oldSidxMapping the SIDX to compare against\n */\n\nconst filterChangedSidxMappings = (main, oldSidxMapping) => {\n const videoSidx = compareSidxEntry(main.playlists, oldSidxMapping);\n let mediaGroupSidx = videoSidx;\n forEachMediaGroup(main, (properties, mediaType, groupKey, labelKey) => {\n if (properties.playlists && properties.playlists.length) {\n const playlists = properties.playlists;\n mediaGroupSidx = merge(mediaGroupSidx, compareSidxEntry(playlists, oldSidxMapping));\n }\n });\n return mediaGroupSidx;\n};\nclass DashPlaylistLoader extends EventTarget {\n // DashPlaylistLoader must accept either a src url or a playlist because subsequent\n // playlist loader setups from media groups will expect to be able to pass a playlist\n // (since there aren't external URLs to media playlists with DASH)\n constructor(srcUrlOrPlaylist, vhs, options = {}, mainPlaylistLoader) {\n super();\n this.mainPlaylistLoader_ = mainPlaylistLoader || this;\n if (!mainPlaylistLoader) {\n this.isMain_ = true;\n }\n const {\n withCredentials = false\n } = options;\n this.vhs_ = vhs;\n this.withCredentials = withCredentials;\n this.addMetadataToTextTrack = options.addMetadataToTextTrack;\n if (!srcUrlOrPlaylist) {\n throw new Error('A non-empty playlist URL or object is required');\n } // event naming?\n\n this.on('minimumUpdatePeriod', () => {\n this.refreshXml_();\n }); // live playlist staleness timeout\n\n this.on('mediaupdatetimeout', () => {\n // We handle live content steering in the playlist controller\n if (!this.media().attributes.serviceLocation) {\n this.refreshMedia_(this.media().id);\n }\n });\n this.state = 'HAVE_NOTHING';\n this.loadedPlaylists_ = {};\n this.logger_ = logger('DashPlaylistLoader'); // initialize the loader state\n // The mainPlaylistLoader will be created with a string\n\n if (this.isMain_) {\n this.mainPlaylistLoader_.srcUrl = srcUrlOrPlaylist; // TODO: reset sidxMapping between period changes\n // once multi-period is refactored\n\n this.mainPlaylistLoader_.sidxMapping_ = {};\n } else {\n this.childPlaylist_ = srcUrlOrPlaylist;\n }\n }\n requestErrored_(err, request, startingState) {\n // disposed\n if (!this.request) {\n return true;\n } // pending request is cleared\n\n this.request = null;\n if (err) {\n // use the provided error object or create one\n // based on the request/response\n this.error = typeof err === 'object' && !(err instanceof Error) ? err : {\n status: request.status,\n message: 'DASH request error at URL: ' + request.uri,\n response: request.response,\n // MEDIA_ERR_NETWORK\n code: 2\n };\n if (startingState) {\n this.state = startingState;\n }\n this.trigger('error');\n return true;\n }\n }\n /**\n * Verify that the container of the sidx segment can be parsed\n * and if it can, get and parse that segment.\n */\n\n addSidxSegments_(playlist, startingState, cb) {\n const sidxKey = playlist.sidx && generateSidxKey(playlist.sidx); // playlist lacks sidx or sidx segments were added to this playlist already.\n\n if (!playlist.sidx || !sidxKey || this.mainPlaylistLoader_.sidxMapping_[sidxKey]) {\n // keep this function async\n this.mediaRequest_ = window$1.setTimeout(() => cb(false), 0);\n return;\n } // resolve the segment URL relative to the playlist\n\n const uri = resolveManifestRedirect(playlist.sidx.resolvedUri);\n const fin = (err, request) => {\n if (this.requestErrored_(err, request, startingState)) {\n return;\n }\n const sidxMapping = this.mainPlaylistLoader_.sidxMapping_;\n let sidx;\n try {\n sidx = parseSidx(toUint8(request.response).subarray(8));\n } catch (e) {\n // sidx parsing failed.\n this.requestErrored_(e, request, startingState);\n return;\n }\n sidxMapping[sidxKey] = {\n sidxInfo: playlist.sidx,\n sidx\n };\n addSidxSegmentsToPlaylist(playlist, sidx, playlist.sidx.resolvedUri);\n return cb(true);\n };\n this.request = containerRequest(uri, this.vhs_.xhr, (err, request, container, bytes) => {\n if (err) {\n return fin(err, request);\n }\n if (!container || container !== 'mp4') {\n return fin({\n status: request.status,\n message: `Unsupported ${container || 'unknown'} container type for sidx segment at URL: ${uri}`,\n // response is just bytes in this case\n // but we really don't want to return that.\n response: '',\n playlist,\n internal: true,\n playlistExclusionDuration: Infinity,\n // MEDIA_ERR_NETWORK\n code: 2\n }, request);\n } // if we already downloaded the sidx bytes in the container request, use them\n\n const {\n offset,\n length\n } = playlist.sidx.byterange;\n if (bytes.length >= length + offset) {\n return fin(err, {\n response: bytes.subarray(offset, offset + length),\n status: request.status,\n uri: request.uri\n });\n } // otherwise request sidx bytes\n\n this.request = this.vhs_.xhr({\n uri,\n responseType: 'arraybuffer',\n headers: segmentXhrHeaders({\n byterange: playlist.sidx.byterange\n })\n }, fin);\n });\n }\n dispose() {\n this.trigger('dispose');\n this.stopRequest();\n this.loadedPlaylists_ = {};\n window$1.clearTimeout(this.minimumUpdatePeriodTimeout_);\n window$1.clearTimeout(this.mediaRequest_);\n window$1.clearTimeout(this.mediaUpdateTimeout);\n this.mediaUpdateTimeout = null;\n this.mediaRequest_ = null;\n this.minimumUpdatePeriodTimeout_ = null;\n if (this.mainPlaylistLoader_.createMupOnMedia_) {\n this.off('loadedmetadata', this.mainPlaylistLoader_.createMupOnMedia_);\n this.mainPlaylistLoader_.createMupOnMedia_ = null;\n }\n this.off();\n }\n hasPendingRequest() {\n return this.request || this.mediaRequest_;\n }\n stopRequest() {\n if (this.request) {\n const oldRequest = this.request;\n this.request = null;\n oldRequest.onreadystatechange = null;\n oldRequest.abort();\n }\n }\n media(playlist) {\n // getter\n if (!playlist) {\n return this.media_;\n } // setter\n\n if (this.state === 'HAVE_NOTHING') {\n throw new Error('Cannot switch media playlist from ' + this.state);\n }\n const startingState = this.state; // find the playlist object if the target playlist has been specified by URI\n\n if (typeof playlist === 'string') {\n if (!this.mainPlaylistLoader_.main.playlists[playlist]) {\n throw new Error('Unknown playlist URI: ' + playlist);\n }\n playlist = this.mainPlaylistLoader_.main.playlists[playlist];\n }\n const mediaChange = !this.media_ || playlist.id !== this.media_.id; // switch to previously loaded playlists immediately\n\n if (mediaChange && this.loadedPlaylists_[playlist.id] && this.loadedPlaylists_[playlist.id].endList) {\n this.state = 'HAVE_METADATA';\n this.media_ = playlist; // trigger media change if the active media has been updated\n\n if (mediaChange) {\n this.trigger('mediachanging');\n this.trigger('mediachange');\n }\n return;\n } // switching to the active playlist is a no-op\n\n if (!mediaChange) {\n return;\n } // switching from an already loaded playlist\n\n if (this.media_) {\n this.trigger('mediachanging');\n }\n this.addSidxSegments_(playlist, startingState, sidxChanged => {\n // everything is ready just continue to haveMetadata\n this.haveMetadata({\n startingState,\n playlist\n });\n });\n }\n haveMetadata({\n startingState,\n playlist\n }) {\n this.state = 'HAVE_METADATA';\n this.loadedPlaylists_[playlist.id] = playlist;\n this.mediaRequest_ = null; // This will trigger loadedplaylist\n\n this.refreshMedia_(playlist.id); // fire loadedmetadata the first time a media playlist is loaded\n // to resolve setup of media groups\n\n if (startingState === 'HAVE_MAIN_MANIFEST') {\n this.trigger('loadedmetadata');\n } else {\n // trigger media change if the active media has been updated\n this.trigger('mediachange');\n }\n }\n pause() {\n if (this.mainPlaylistLoader_.createMupOnMedia_) {\n this.off('loadedmetadata', this.mainPlaylistLoader_.createMupOnMedia_);\n this.mainPlaylistLoader_.createMupOnMedia_ = null;\n }\n this.stopRequest();\n window$1.clearTimeout(this.mediaUpdateTimeout);\n this.mediaUpdateTimeout = null;\n if (this.isMain_) {\n window$1.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_);\n this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_ = null;\n }\n if (this.state === 'HAVE_NOTHING') {\n // If we pause the loader before any data has been retrieved, its as if we never\n // started, so reset to an unstarted state.\n this.started = false;\n }\n }\n load(isFinalRendition) {\n window$1.clearTimeout(this.mediaUpdateTimeout);\n this.mediaUpdateTimeout = null;\n const media = this.media();\n if (isFinalRendition) {\n const delay = media ? media.targetDuration / 2 * 1000 : 5 * 1000;\n this.mediaUpdateTimeout = window$1.setTimeout(() => this.load(), delay);\n return;\n } // because the playlists are internal to the manifest, load should either load the\n // main manifest, or do nothing but trigger an event\n\n if (!this.started) {\n this.start();\n return;\n }\n if (media && !media.endList) {\n // Check to see if this is the main loader and the MUP was cleared (this happens\n // when the loader was paused). `media` should be set at this point since one is always\n // set during `start()`.\n if (this.isMain_ && !this.minimumUpdatePeriodTimeout_) {\n // Trigger minimumUpdatePeriod to refresh the main manifest\n this.trigger('minimumUpdatePeriod'); // Since there was no prior minimumUpdatePeriodTimeout it should be recreated\n\n this.updateMinimumUpdatePeriodTimeout_();\n }\n this.trigger('mediaupdatetimeout');\n } else {\n this.trigger('loadedplaylist');\n }\n }\n start() {\n this.started = true; // We don't need to request the main manifest again\n // Call this asynchronously to match the xhr request behavior below\n\n if (!this.isMain_) {\n this.mediaRequest_ = window$1.setTimeout(() => this.haveMain_(), 0);\n return;\n }\n this.requestMain_((req, mainChanged) => {\n this.haveMain_();\n if (!this.hasPendingRequest() && !this.media_) {\n this.media(this.mainPlaylistLoader_.main.playlists[0]);\n }\n });\n }\n requestMain_(cb) {\n this.request = this.vhs_.xhr({\n uri: this.mainPlaylistLoader_.srcUrl,\n withCredentials: this.withCredentials\n }, (error, req) => {\n if (this.requestErrored_(error, req)) {\n if (this.state === 'HAVE_NOTHING') {\n this.started = false;\n }\n return;\n }\n const mainChanged = req.responseText !== this.mainPlaylistLoader_.mainXml_;\n this.mainPlaylistLoader_.mainXml_ = req.responseText;\n if (req.responseHeaders && req.responseHeaders.date) {\n this.mainLoaded_ = Date.parse(req.responseHeaders.date);\n } else {\n this.mainLoaded_ = Date.now();\n }\n this.mainPlaylistLoader_.srcUrl = resolveManifestRedirect(this.mainPlaylistLoader_.srcUrl, req);\n if (mainChanged) {\n this.handleMain_();\n this.syncClientServerClock_(() => {\n return cb(req, mainChanged);\n });\n return;\n }\n return cb(req, mainChanged);\n });\n }\n /**\n * Parses the main xml for UTCTiming node to sync the client clock to the server\n * clock. If the UTCTiming node requires a HEAD or GET request, that request is made.\n *\n * @param {Function} done\n * Function to call when clock sync has completed\n */\n\n syncClientServerClock_(done) {\n const utcTiming = parseUTCTiming(this.mainPlaylistLoader_.mainXml_); // No UTCTiming element found in the mpd. Use Date header from mpd request as the\n // server clock\n\n if (utcTiming === null) {\n this.mainPlaylistLoader_.clientOffset_ = this.mainLoaded_ - Date.now();\n return done();\n }\n if (utcTiming.method === 'DIRECT') {\n this.mainPlaylistLoader_.clientOffset_ = utcTiming.value - Date.now();\n return done();\n }\n this.request = this.vhs_.xhr({\n uri: resolveUrl(this.mainPlaylistLoader_.srcUrl, utcTiming.value),\n method: utcTiming.method,\n withCredentials: this.withCredentials\n }, (error, req) => {\n // disposed\n if (!this.request) {\n return;\n }\n if (error) {\n // sync request failed, fall back to using date header from mpd\n // TODO: log warning\n this.mainPlaylistLoader_.clientOffset_ = this.mainLoaded_ - Date.now();\n return done();\n }\n let serverTime;\n if (utcTiming.method === 'HEAD') {\n if (!req.responseHeaders || !req.responseHeaders.date) {\n // expected date header not preset, fall back to using date header from mpd\n // TODO: log warning\n serverTime = this.mainLoaded_;\n } else {\n serverTime = Date.parse(req.responseHeaders.date);\n }\n } else {\n serverTime = Date.parse(req.responseText);\n }\n this.mainPlaylistLoader_.clientOffset_ = serverTime - Date.now();\n done();\n });\n }\n haveMain_() {\n this.state = 'HAVE_MAIN_MANIFEST';\n if (this.isMain_) {\n // We have the main playlist at this point, so\n // trigger this to allow PlaylistController\n // to make an initial playlist selection\n this.trigger('loadedplaylist');\n } else if (!this.media_) {\n // no media playlist was specifically selected so select\n // the one the child playlist loader was created with\n this.media(this.childPlaylist_);\n }\n }\n handleMain_() {\n // clear media request\n this.mediaRequest_ = null;\n const oldMain = this.mainPlaylistLoader_.main;\n let newMain = parseMainXml({\n mainXml: this.mainPlaylistLoader_.mainXml_,\n srcUrl: this.mainPlaylistLoader_.srcUrl,\n clientOffset: this.mainPlaylistLoader_.clientOffset_,\n sidxMapping: this.mainPlaylistLoader_.sidxMapping_,\n previousManifest: oldMain\n }); // if we have an old main to compare the new main against\n\n if (oldMain) {\n newMain = updateMain(oldMain, newMain, this.mainPlaylistLoader_.sidxMapping_);\n } // only update main if we have a new main\n\n this.mainPlaylistLoader_.main = newMain ? newMain : oldMain;\n const location = this.mainPlaylistLoader_.main.locations && this.mainPlaylistLoader_.main.locations[0];\n if (location && location !== this.mainPlaylistLoader_.srcUrl) {\n this.mainPlaylistLoader_.srcUrl = location;\n }\n if (!oldMain || newMain && newMain.minimumUpdatePeriod !== oldMain.minimumUpdatePeriod) {\n this.updateMinimumUpdatePeriodTimeout_();\n }\n this.addEventStreamToMetadataTrack_(newMain);\n return Boolean(newMain);\n }\n updateMinimumUpdatePeriodTimeout_() {\n const mpl = this.mainPlaylistLoader_; // cancel any pending creation of mup on media\n // a new one will be added if needed.\n\n if (mpl.createMupOnMedia_) {\n mpl.off('loadedmetadata', mpl.createMupOnMedia_);\n mpl.createMupOnMedia_ = null;\n } // clear any pending timeouts\n\n if (mpl.minimumUpdatePeriodTimeout_) {\n window$1.clearTimeout(mpl.minimumUpdatePeriodTimeout_);\n mpl.minimumUpdatePeriodTimeout_ = null;\n }\n let mup = mpl.main && mpl.main.minimumUpdatePeriod; // If the minimumUpdatePeriod has a value of 0, that indicates that the current\n // MPD has no future validity, so a new one will need to be acquired when new\n // media segments are to be made available. Thus, we use the target duration\n // in this case\n\n if (mup === 0) {\n if (mpl.media()) {\n mup = mpl.media().targetDuration * 1000;\n } else {\n mpl.createMupOnMedia_ = mpl.updateMinimumUpdatePeriodTimeout_;\n mpl.one('loadedmetadata', mpl.createMupOnMedia_);\n }\n } // if minimumUpdatePeriod is invalid or <= zero, which\n // can happen when a live video becomes VOD. skip timeout\n // creation.\n\n if (typeof mup !== 'number' || mup <= 0) {\n if (mup < 0) {\n this.logger_(`found invalid minimumUpdatePeriod of ${mup}, not setting a timeout`);\n }\n return;\n }\n this.createMUPTimeout_(mup);\n }\n createMUPTimeout_(mup) {\n const mpl = this.mainPlaylistLoader_;\n mpl.minimumUpdatePeriodTimeout_ = window$1.setTimeout(() => {\n mpl.minimumUpdatePeriodTimeout_ = null;\n mpl.trigger('minimumUpdatePeriod');\n mpl.createMUPTimeout_(mup);\n }, mup);\n }\n /**\n * Sends request to refresh the main xml and updates the parsed main manifest\n */\n\n refreshXml_() {\n this.requestMain_((req, mainChanged) => {\n if (!mainChanged) {\n return;\n }\n if (this.media_) {\n this.media_ = this.mainPlaylistLoader_.main.playlists[this.media_.id];\n } // This will filter out updated sidx info from the mapping\n\n this.mainPlaylistLoader_.sidxMapping_ = filterChangedSidxMappings(this.mainPlaylistLoader_.main, this.mainPlaylistLoader_.sidxMapping_);\n this.addSidxSegments_(this.media(), this.state, sidxChanged => {\n // TODO: do we need to reload the current playlist?\n this.refreshMedia_(this.media().id);\n });\n });\n }\n /**\n * Refreshes the media playlist by re-parsing the main xml and updating playlist\n * references. If this is an alternate loader, the updated parsed manifest is retrieved\n * from the main loader.\n */\n\n refreshMedia_(mediaID) {\n if (!mediaID) {\n throw new Error('refreshMedia_ must take a media id');\n } // for main we have to reparse the main xml\n // to re-create segments based on current timing values\n // which may change media. We only skip updating the main manifest\n // if this is the first time this.media_ is being set.\n // as main was just parsed in that case.\n\n if (this.media_ && this.isMain_) {\n this.handleMain_();\n }\n const playlists = this.mainPlaylistLoader_.main.playlists;\n const mediaChanged = !this.media_ || this.media_ !== playlists[mediaID];\n if (mediaChanged) {\n this.media_ = playlists[mediaID];\n } else {\n this.trigger('playlistunchanged');\n }\n if (!this.mediaUpdateTimeout) {\n const createMediaUpdateTimeout = () => {\n if (this.media().endList) {\n return;\n }\n this.mediaUpdateTimeout = window$1.setTimeout(() => {\n this.trigger('mediaupdatetimeout');\n createMediaUpdateTimeout();\n }, refreshDelay(this.media(), Boolean(mediaChanged)));\n };\n createMediaUpdateTimeout();\n }\n this.trigger('loadedplaylist');\n }\n /**\n * Takes eventstream data from a parsed DASH manifest and adds it to the metadata text track.\n *\n * @param {manifest} newMain the newly parsed manifest\n */\n\n addEventStreamToMetadataTrack_(newMain) {\n // Only add new event stream metadata if we have a new manifest.\n if (newMain && this.mainPlaylistLoader_.main.eventStream) {\n // convert EventStream to ID3-like data.\n const metadataArray = this.mainPlaylistLoader_.main.eventStream.map(eventStreamNode => {\n return {\n cueTime: eventStreamNode.start,\n frames: [{\n data: eventStreamNode.messageData\n }]\n };\n });\n this.addMetadataToTextTrack('EventStream', metadataArray, this.mainPlaylistLoader_.main.duration);\n }\n }\n}\nvar Config = {\n GOAL_BUFFER_LENGTH: 30,\n MAX_GOAL_BUFFER_LENGTH: 60,\n BACK_BUFFER_LENGTH: 30,\n GOAL_BUFFER_LENGTH_RATE: 1,\n // 0.5 MB/s\n INITIAL_BANDWIDTH: 4194304,\n // A fudge factor to apply to advertised playlist bitrates to account for\n // temporary flucations in client bandwidth\n BANDWIDTH_VARIANCE: 1.2,\n // How much of the buffer must be filled before we consider upswitching\n BUFFER_LOW_WATER_LINE: 0,\n MAX_BUFFER_LOW_WATER_LINE: 30,\n // TODO: Remove this when experimentalBufferBasedABR is removed\n EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE: 16,\n BUFFER_LOW_WATER_LINE_RATE: 1,\n // If the buffer is greater than the high water line, we won't switch down\n BUFFER_HIGH_WATER_LINE: 30\n};\nconst stringToArrayBuffer = string => {\n const view = new Uint8Array(new ArrayBuffer(string.length));\n for (let i = 0; i < string.length; i++) {\n view[i] = string.charCodeAt(i);\n }\n return view.buffer;\n};\n\n/* global Blob, BlobBuilder, Worker */\n// unify worker interface\nconst browserWorkerPolyFill = function (workerObj) {\n // node only supports on/off\n workerObj.on = workerObj.addEventListener;\n workerObj.off = workerObj.removeEventListener;\n return workerObj;\n};\nconst createObjectURL = function (str) {\n try {\n return URL.createObjectURL(new Blob([str], {\n type: 'application/javascript'\n }));\n } catch (e) {\n const blob = new BlobBuilder();\n blob.append(str);\n return URL.createObjectURL(blob.getBlob());\n }\n};\nconst factory = function (code) {\n return function () {\n const objectUrl = createObjectURL(code);\n const worker = browserWorkerPolyFill(new Worker(objectUrl));\n worker.objURL = objectUrl;\n const terminate = worker.terminate;\n worker.on = worker.addEventListener;\n worker.off = worker.removeEventListener;\n worker.terminate = function () {\n URL.revokeObjectURL(objectUrl);\n return terminate.call(this);\n };\n return worker;\n };\n};\nconst transform = function (code) {\n return `var browserWorkerPolyFill = ${browserWorkerPolyFill.toString()};\\n` + 'browserWorkerPolyFill(self);\\n' + code;\n};\nconst getWorkerString = function (fn) {\n return fn.toString().replace(/^function.+?{/, '').slice(0, -1);\n};\n\n/* rollup-plugin-worker-factory start for worker!/home/runner/work/http-streaming/http-streaming/src/transmuxer-worker.js */\nconst workerCode$1 = transform(getWorkerString(function () {\n var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n *\n * A lightweight readable stream implemention that handles event dispatching.\n * Objects that inherit from streams should call init in their constructors.\n */\n\n var Stream$8 = function () {\n this.init = function () {\n var listeners = {};\n /**\n * Add a listener for a specified event type.\n * @param type {string} the event name\n * @param listener {function} the callback to be invoked when an event of\n * the specified type occurs\n */\n\n this.on = function (type, listener) {\n if (!listeners[type]) {\n listeners[type] = [];\n }\n listeners[type] = listeners[type].concat(listener);\n };\n /**\n * Remove a listener for a specified event type.\n * @param type {string} the event name\n * @param listener {function} a function previously registered for this\n * type of event through `on`\n */\n\n this.off = function (type, listener) {\n var index;\n if (!listeners[type]) {\n return false;\n }\n index = listeners[type].indexOf(listener);\n listeners[type] = listeners[type].slice();\n listeners[type].splice(index, 1);\n return index > -1;\n };\n /**\n * Trigger an event of the specified type on this stream. Any additional\n * arguments to this function are passed as parameters to event listeners.\n * @param type {string} the event name\n */\n\n this.trigger = function (type) {\n var callbacks, i, length, args;\n callbacks = listeners[type];\n if (!callbacks) {\n return;\n } // Slicing the arguments on every invocation of this method\n // can add a significant amount of overhead. Avoid the\n // intermediate object creation for the common case of a\n // single callback argument\n\n if (arguments.length === 2) {\n length = callbacks.length;\n for (i = 0; i < length; ++i) {\n callbacks[i].call(this, arguments[1]);\n }\n } else {\n args = [];\n i = arguments.length;\n for (i = 1; i < arguments.length; ++i) {\n args.push(arguments[i]);\n }\n length = callbacks.length;\n for (i = 0; i < length; ++i) {\n callbacks[i].apply(this, args);\n }\n }\n };\n /**\n * Destroys the stream and cleans up.\n */\n\n this.dispose = function () {\n listeners = {};\n };\n };\n };\n /**\n * Forwards all `data` events on this stream to the destination stream. The\n * destination stream should provide a method `push` to receive the data\n * events as they arrive.\n * @param destination {stream} the stream that will receive all `data` events\n * @param autoFlush {boolean} if false, we will not call `flush` on the destination\n * when the current stream emits a 'done' event\n * @see http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options\n */\n\n Stream$8.prototype.pipe = function (destination) {\n this.on('data', function (data) {\n destination.push(data);\n });\n this.on('done', function (flushSource) {\n destination.flush(flushSource);\n });\n this.on('partialdone', function (flushSource) {\n destination.partialFlush(flushSource);\n });\n this.on('endedtimeline', function (flushSource) {\n destination.endTimeline(flushSource);\n });\n this.on('reset', function (flushSource) {\n destination.reset(flushSource);\n });\n return destination;\n }; // Default stream functions that are expected to be overridden to perform\n // actual work. These are provided by the prototype as a sort of no-op\n // implementation so that we don't have to check for their existence in the\n // `pipe` function above.\n\n Stream$8.prototype.push = function (data) {\n this.trigger('data', data);\n };\n Stream$8.prototype.flush = function (flushSource) {\n this.trigger('done', flushSource);\n };\n Stream$8.prototype.partialFlush = function (flushSource) {\n this.trigger('partialdone', flushSource);\n };\n Stream$8.prototype.endTimeline = function (flushSource) {\n this.trigger('endedtimeline', flushSource);\n };\n Stream$8.prototype.reset = function (flushSource) {\n this.trigger('reset', flushSource);\n };\n var stream = Stream$8;\n var MAX_UINT32$1 = Math.pow(2, 32);\n var getUint64$3 = function (uint8) {\n var dv = new DataView(uint8.buffer, uint8.byteOffset, uint8.byteLength);\n var value;\n if (dv.getBigUint64) {\n value = dv.getBigUint64(0);\n if (value < Number.MAX_SAFE_INTEGER) {\n return Number(value);\n }\n return value;\n }\n return dv.getUint32(0) * MAX_UINT32$1 + dv.getUint32(4);\n };\n var numbers = {\n getUint64: getUint64$3,\n MAX_UINT32: MAX_UINT32$1\n };\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n *\n * Functions that generate fragmented MP4s suitable for use with Media\n * Source Extensions.\n */\n\n var MAX_UINT32 = numbers.MAX_UINT32;\n var box, dinf, esds, ftyp, mdat, mfhd, minf, moof, moov, mvex, mvhd, trak, tkhd, mdia, mdhd, hdlr, sdtp, stbl, stsd, traf, trex, trun$1, types, MAJOR_BRAND, MINOR_VERSION, AVC1_BRAND, VIDEO_HDLR, AUDIO_HDLR, HDLR_TYPES, VMHD, SMHD, DREF, STCO, STSC, STSZ, STTS; // pre-calculate constants\n\n (function () {\n var i;\n types = {\n avc1: [],\n // codingname\n avcC: [],\n btrt: [],\n dinf: [],\n dref: [],\n esds: [],\n ftyp: [],\n hdlr: [],\n mdat: [],\n mdhd: [],\n mdia: [],\n mfhd: [],\n minf: [],\n moof: [],\n moov: [],\n mp4a: [],\n // codingname\n mvex: [],\n mvhd: [],\n pasp: [],\n sdtp: [],\n smhd: [],\n stbl: [],\n stco: [],\n stsc: [],\n stsd: [],\n stsz: [],\n stts: [],\n styp: [],\n tfdt: [],\n tfhd: [],\n traf: [],\n trak: [],\n trun: [],\n trex: [],\n tkhd: [],\n vmhd: []\n }; // In environments where Uint8Array is undefined (e.g., IE8), skip set up so that we\n // don't throw an error\n\n if (typeof Uint8Array === 'undefined') {\n return;\n }\n for (i in types) {\n if (types.hasOwnProperty(i)) {\n types[i] = [i.charCodeAt(0), i.charCodeAt(1), i.charCodeAt(2), i.charCodeAt(3)];\n }\n }\n MAJOR_BRAND = new Uint8Array(['i'.charCodeAt(0), 's'.charCodeAt(0), 'o'.charCodeAt(0), 'm'.charCodeAt(0)]);\n AVC1_BRAND = new Uint8Array(['a'.charCodeAt(0), 'v'.charCodeAt(0), 'c'.charCodeAt(0), '1'.charCodeAt(0)]);\n MINOR_VERSION = new Uint8Array([0, 0, 0, 1]);\n VIDEO_HDLR = new Uint8Array([0x00,\n // version 0\n 0x00, 0x00, 0x00,\n // flags\n 0x00, 0x00, 0x00, 0x00,\n // pre_defined\n 0x76, 0x69, 0x64, 0x65,\n // handler_type: 'vide'\n 0x00, 0x00, 0x00, 0x00,\n // reserved\n 0x00, 0x00, 0x00, 0x00,\n // reserved\n 0x00, 0x00, 0x00, 0x00,\n // reserved\n 0x56, 0x69, 0x64, 0x65, 0x6f, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'VideoHandler'\n ]);\n\n AUDIO_HDLR = new Uint8Array([0x00,\n // version 0\n 0x00, 0x00, 0x00,\n // flags\n 0x00, 0x00, 0x00, 0x00,\n // pre_defined\n 0x73, 0x6f, 0x75, 0x6e,\n // handler_type: 'soun'\n 0x00, 0x00, 0x00, 0x00,\n // reserved\n 0x00, 0x00, 0x00, 0x00,\n // reserved\n 0x00, 0x00, 0x00, 0x00,\n // reserved\n 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'SoundHandler'\n ]);\n\n HDLR_TYPES = {\n video: VIDEO_HDLR,\n audio: AUDIO_HDLR\n };\n DREF = new Uint8Array([0x00,\n // version 0\n 0x00, 0x00, 0x00,\n // flags\n 0x00, 0x00, 0x00, 0x01,\n // entry_count\n 0x00, 0x00, 0x00, 0x0c,\n // entry_size\n 0x75, 0x72, 0x6c, 0x20,\n // 'url' type\n 0x00,\n // version 0\n 0x00, 0x00, 0x01 // entry_flags\n ]);\n\n SMHD = new Uint8Array([0x00,\n // version\n 0x00, 0x00, 0x00,\n // flags\n 0x00, 0x00,\n // balance, 0 means centered\n 0x00, 0x00 // reserved\n ]);\n\n STCO = new Uint8Array([0x00,\n // version\n 0x00, 0x00, 0x00,\n // flags\n 0x00, 0x00, 0x00, 0x00 // entry_count\n ]);\n\n STSC = STCO;\n STSZ = new Uint8Array([0x00,\n // version\n 0x00, 0x00, 0x00,\n // flags\n 0x00, 0x00, 0x00, 0x00,\n // sample_size\n 0x00, 0x00, 0x00, 0x00 // sample_count\n ]);\n\n STTS = STCO;\n VMHD = new Uint8Array([0x00,\n // version\n 0x00, 0x00, 0x01,\n // flags\n 0x00, 0x00,\n // graphicsmode\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // opcolor\n ]);\n })();\n\n box = function (type) {\n var payload = [],\n size = 0,\n i,\n result,\n view;\n for (i = 1; i < arguments.length; i++) {\n payload.push(arguments[i]);\n }\n i = payload.length; // calculate the total size we need to allocate\n\n while (i--) {\n size += payload[i].byteLength;\n }\n result = new Uint8Array(size + 8);\n view = new DataView(result.buffer, result.byteOffset, result.byteLength);\n view.setUint32(0, result.byteLength);\n result.set(type, 4); // copy the payload into the result\n\n for (i = 0, size = 8; i < payload.length; i++) {\n result.set(payload[i], size);\n size += payload[i].byteLength;\n }\n return result;\n };\n dinf = function () {\n return box(types.dinf, box(types.dref, DREF));\n };\n esds = function (track) {\n return box(types.esds, new Uint8Array([0x00,\n // version\n 0x00, 0x00, 0x00,\n // flags\n // ES_Descriptor\n 0x03,\n // tag, ES_DescrTag\n 0x19,\n // length\n 0x00, 0x00,\n // ES_ID\n 0x00,\n // streamDependenceFlag, URL_flag, reserved, streamPriority\n // DecoderConfigDescriptor\n 0x04,\n // tag, DecoderConfigDescrTag\n 0x11,\n // length\n 0x40,\n // object type\n 0x15,\n // streamType\n 0x00, 0x06, 0x00,\n // bufferSizeDB\n 0x00, 0x00, 0xda, 0xc0,\n // maxBitrate\n 0x00, 0x00, 0xda, 0xc0,\n // avgBitrate\n // DecoderSpecificInfo\n 0x05,\n // tag, DecoderSpecificInfoTag\n 0x02,\n // length\n // ISO/IEC 14496-3, AudioSpecificConfig\n // for samplingFrequencyIndex see ISO/IEC 13818-7:2006, 8.1.3.2.2, Table 35\n track.audioobjecttype << 3 | track.samplingfrequencyindex >>> 1, track.samplingfrequencyindex << 7 | track.channelcount << 3, 0x06, 0x01, 0x02 // GASpecificConfig\n ]));\n };\n\n ftyp = function () {\n return box(types.ftyp, MAJOR_BRAND, MINOR_VERSION, MAJOR_BRAND, AVC1_BRAND);\n };\n hdlr = function (type) {\n return box(types.hdlr, HDLR_TYPES[type]);\n };\n mdat = function (data) {\n return box(types.mdat, data);\n };\n mdhd = function (track) {\n var result = new Uint8Array([0x00,\n // version 0\n 0x00, 0x00, 0x00,\n // flags\n 0x00, 0x00, 0x00, 0x02,\n // creation_time\n 0x00, 0x00, 0x00, 0x03,\n // modification_time\n 0x00, 0x01, 0x5f, 0x90,\n // timescale, 90,000 \"ticks\" per second\n track.duration >>> 24 & 0xFF, track.duration >>> 16 & 0xFF, track.duration >>> 8 & 0xFF, track.duration & 0xFF,\n // duration\n 0x55, 0xc4,\n // 'und' language (undetermined)\n 0x00, 0x00]); // Use the sample rate from the track metadata, when it is\n // defined. The sample rate can be parsed out of an ADTS header, for\n // instance.\n\n if (track.samplerate) {\n result[12] = track.samplerate >>> 24 & 0xFF;\n result[13] = track.samplerate >>> 16 & 0xFF;\n result[14] = track.samplerate >>> 8 & 0xFF;\n result[15] = track.samplerate & 0xFF;\n }\n return box(types.mdhd, result);\n };\n mdia = function (track) {\n return box(types.mdia, mdhd(track), hdlr(track.type), minf(track));\n };\n mfhd = function (sequenceNumber) {\n return box(types.mfhd, new Uint8Array([0x00, 0x00, 0x00, 0x00,\n // flags\n (sequenceNumber & 0xFF000000) >> 24, (sequenceNumber & 0xFF0000) >> 16, (sequenceNumber & 0xFF00) >> 8, sequenceNumber & 0xFF // sequence_number\n ]));\n };\n\n minf = function (track) {\n return box(types.minf, track.type === 'video' ? box(types.vmhd, VMHD) : box(types.smhd, SMHD), dinf(), stbl(track));\n };\n moof = function (sequenceNumber, tracks) {\n var trackFragments = [],\n i = tracks.length; // build traf boxes for each track fragment\n\n while (i--) {\n trackFragments[i] = traf(tracks[i]);\n }\n return box.apply(null, [types.moof, mfhd(sequenceNumber)].concat(trackFragments));\n };\n /**\n * Returns a movie box.\n * @param tracks {array} the tracks associated with this movie\n * @see ISO/IEC 14496-12:2012(E), section 8.2.1\n */\n\n moov = function (tracks) {\n var i = tracks.length,\n boxes = [];\n while (i--) {\n boxes[i] = trak(tracks[i]);\n }\n return box.apply(null, [types.moov, mvhd(0xffffffff)].concat(boxes).concat(mvex(tracks)));\n };\n mvex = function (tracks) {\n var i = tracks.length,\n boxes = [];\n while (i--) {\n boxes[i] = trex(tracks[i]);\n }\n return box.apply(null, [types.mvex].concat(boxes));\n };\n mvhd = function (duration) {\n var bytes = new Uint8Array([0x00,\n // version 0\n 0x00, 0x00, 0x00,\n // flags\n 0x00, 0x00, 0x00, 0x01,\n // creation_time\n 0x00, 0x00, 0x00, 0x02,\n // modification_time\n 0x00, 0x01, 0x5f, 0x90,\n // timescale, 90,000 \"ticks\" per second\n (duration & 0xFF000000) >> 24, (duration & 0xFF0000) >> 16, (duration & 0xFF00) >> 8, duration & 0xFF,\n // duration\n 0x00, 0x01, 0x00, 0x00,\n // 1.0 rate\n 0x01, 0x00,\n // 1.0 volume\n 0x00, 0x00,\n // reserved\n 0x00, 0x00, 0x00, 0x00,\n // reserved\n 0x00, 0x00, 0x00, 0x00,\n // reserved\n 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,\n // transformation: unity matrix\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n // pre_defined\n 0xff, 0xff, 0xff, 0xff // next_track_ID\n ]);\n\n return box(types.mvhd, bytes);\n };\n sdtp = function (track) {\n var samples = track.samples || [],\n bytes = new Uint8Array(4 + samples.length),\n flags,\n i; // leave the full box header (4 bytes) all zero\n // write the sample table\n\n for (i = 0; i < samples.length; i++) {\n flags = samples[i].flags;\n bytes[i + 4] = flags.dependsOn << 4 | flags.isDependedOn << 2 | flags.hasRedundancy;\n }\n return box(types.sdtp, bytes);\n };\n stbl = function (track) {\n return box(types.stbl, stsd(track), box(types.stts, STTS), box(types.stsc, STSC), box(types.stsz, STSZ), box(types.stco, STCO));\n };\n (function () {\n var videoSample, audioSample;\n stsd = function (track) {\n return box(types.stsd, new Uint8Array([0x00,\n // version 0\n 0x00, 0x00, 0x00,\n // flags\n 0x00, 0x00, 0x00, 0x01]), track.type === 'video' ? videoSample(track) : audioSample(track));\n };\n videoSample = function (track) {\n var sps = track.sps || [],\n pps = track.pps || [],\n sequenceParameterSets = [],\n pictureParameterSets = [],\n i,\n avc1Box; // assemble the SPSs\n\n for (i = 0; i < sps.length; i++) {\n sequenceParameterSets.push((sps[i].byteLength & 0xFF00) >>> 8);\n sequenceParameterSets.push(sps[i].byteLength & 0xFF); // sequenceParameterSetLength\n\n sequenceParameterSets = sequenceParameterSets.concat(Array.prototype.slice.call(sps[i])); // SPS\n } // assemble the PPSs\n\n for (i = 0; i < pps.length; i++) {\n pictureParameterSets.push((pps[i].byteLength & 0xFF00) >>> 8);\n pictureParameterSets.push(pps[i].byteLength & 0xFF);\n pictureParameterSets = pictureParameterSets.concat(Array.prototype.slice.call(pps[i]));\n }\n avc1Box = [types.avc1, new Uint8Array([0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n // reserved\n 0x00, 0x01,\n // data_reference_index\n 0x00, 0x00,\n // pre_defined\n 0x00, 0x00,\n // reserved\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n // pre_defined\n (track.width & 0xff00) >> 8, track.width & 0xff,\n // width\n (track.height & 0xff00) >> 8, track.height & 0xff,\n // height\n 0x00, 0x48, 0x00, 0x00,\n // horizresolution\n 0x00, 0x48, 0x00, 0x00,\n // vertresolution\n 0x00, 0x00, 0x00, 0x00,\n // reserved\n 0x00, 0x01,\n // frame_count\n 0x13, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x6a, 0x73, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x2d, 0x68, 0x6c, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n // compressorname\n 0x00, 0x18,\n // depth = 24\n 0x11, 0x11 // pre_defined = -1\n ]), box(types.avcC, new Uint8Array([0x01,\n // configurationVersion\n track.profileIdc,\n // AVCProfileIndication\n track.profileCompatibility,\n // profile_compatibility\n track.levelIdc,\n // AVCLevelIndication\n 0xff // lengthSizeMinusOne, hard-coded to 4 bytes\n ].concat([sps.length],\n // numOfSequenceParameterSets\n sequenceParameterSets,\n // \"SPS\"\n [pps.length],\n // numOfPictureParameterSets\n pictureParameterSets // \"PPS\"\n ))), box(types.btrt, new Uint8Array([0x00, 0x1c, 0x9c, 0x80,\n // bufferSizeDB\n 0x00, 0x2d, 0xc6, 0xc0,\n // maxBitrate\n 0x00, 0x2d, 0xc6, 0xc0 // avgBitrate\n ]))];\n\n if (track.sarRatio) {\n var hSpacing = track.sarRatio[0],\n vSpacing = track.sarRatio[1];\n avc1Box.push(box(types.pasp, new Uint8Array([(hSpacing & 0xFF000000) >> 24, (hSpacing & 0xFF0000) >> 16, (hSpacing & 0xFF00) >> 8, hSpacing & 0xFF, (vSpacing & 0xFF000000) >> 24, (vSpacing & 0xFF0000) >> 16, (vSpacing & 0xFF00) >> 8, vSpacing & 0xFF])));\n }\n return box.apply(null, avc1Box);\n };\n audioSample = function (track) {\n return box(types.mp4a, new Uint8Array([\n // SampleEntry, ISO/IEC 14496-12\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n // reserved\n 0x00, 0x01,\n // data_reference_index\n // AudioSampleEntry, ISO/IEC 14496-12\n 0x00, 0x00, 0x00, 0x00,\n // reserved\n 0x00, 0x00, 0x00, 0x00,\n // reserved\n (track.channelcount & 0xff00) >> 8, track.channelcount & 0xff,\n // channelcount\n (track.samplesize & 0xff00) >> 8, track.samplesize & 0xff,\n // samplesize\n 0x00, 0x00,\n // pre_defined\n 0x00, 0x00,\n // reserved\n (track.samplerate & 0xff00) >> 8, track.samplerate & 0xff, 0x00, 0x00 // samplerate, 16.16\n // MP4AudioSampleEntry, ISO/IEC 14496-14\n ]), esds(track));\n };\n })();\n tkhd = function (track) {\n var result = new Uint8Array([0x00,\n // version 0\n 0x00, 0x00, 0x07,\n // flags\n 0x00, 0x00, 0x00, 0x00,\n // creation_time\n 0x00, 0x00, 0x00, 0x00,\n // modification_time\n (track.id & 0xFF000000) >> 24, (track.id & 0xFF0000) >> 16, (track.id & 0xFF00) >> 8, track.id & 0xFF,\n // track_ID\n 0x00, 0x00, 0x00, 0x00,\n // reserved\n (track.duration & 0xFF000000) >> 24, (track.duration & 0xFF0000) >> 16, (track.duration & 0xFF00) >> 8, track.duration & 0xFF,\n // duration\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n // reserved\n 0x00, 0x00,\n // layer\n 0x00, 0x00,\n // alternate_group\n 0x01, 0x00,\n // non-audio track volume\n 0x00, 0x00,\n // reserved\n 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,\n // transformation: unity matrix\n (track.width & 0xFF00) >> 8, track.width & 0xFF, 0x00, 0x00,\n // width\n (track.height & 0xFF00) >> 8, track.height & 0xFF, 0x00, 0x00 // height\n ]);\n\n return box(types.tkhd, result);\n };\n /**\n * Generate a track fragment (traf) box. A traf box collects metadata\n * about tracks in a movie fragment (moof) box.\n */\n\n traf = function (track) {\n var trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable, dataOffset, upperWordBaseMediaDecodeTime, lowerWordBaseMediaDecodeTime;\n trackFragmentHeader = box(types.tfhd, new Uint8Array([0x00,\n // version 0\n 0x00, 0x00, 0x3a,\n // flags\n (track.id & 0xFF000000) >> 24, (track.id & 0xFF0000) >> 16, (track.id & 0xFF00) >> 8, track.id & 0xFF,\n // track_ID\n 0x00, 0x00, 0x00, 0x01,\n // sample_description_index\n 0x00, 0x00, 0x00, 0x00,\n // default_sample_duration\n 0x00, 0x00, 0x00, 0x00,\n // default_sample_size\n 0x00, 0x00, 0x00, 0x00 // default_sample_flags\n ]));\n\n upperWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime / MAX_UINT32);\n lowerWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime % MAX_UINT32);\n trackFragmentDecodeTime = box(types.tfdt, new Uint8Array([0x01,\n // version 1\n 0x00, 0x00, 0x00,\n // flags\n // baseMediaDecodeTime\n upperWordBaseMediaDecodeTime >>> 24 & 0xFF, upperWordBaseMediaDecodeTime >>> 16 & 0xFF, upperWordBaseMediaDecodeTime >>> 8 & 0xFF, upperWordBaseMediaDecodeTime & 0xFF, lowerWordBaseMediaDecodeTime >>> 24 & 0xFF, lowerWordBaseMediaDecodeTime >>> 16 & 0xFF, lowerWordBaseMediaDecodeTime >>> 8 & 0xFF, lowerWordBaseMediaDecodeTime & 0xFF])); // the data offset specifies the number of bytes from the start of\n // the containing moof to the first payload byte of the associated\n // mdat\n\n dataOffset = 32 +\n // tfhd\n 20 +\n // tfdt\n 8 +\n // traf header\n 16 +\n // mfhd\n 8 +\n // moof header\n 8; // mdat header\n // audio tracks require less metadata\n\n if (track.type === 'audio') {\n trackFragmentRun = trun$1(track, dataOffset);\n return box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun);\n } // video tracks should contain an independent and disposable samples\n // box (sdtp)\n // generate one and adjust offsets to match\n\n sampleDependencyTable = sdtp(track);\n trackFragmentRun = trun$1(track, sampleDependencyTable.length + dataOffset);\n return box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable);\n };\n /**\n * Generate a track box.\n * @param track {object} a track definition\n * @return {Uint8Array} the track box\n */\n\n trak = function (track) {\n track.duration = track.duration || 0xffffffff;\n return box(types.trak, tkhd(track), mdia(track));\n };\n trex = function (track) {\n var result = new Uint8Array([0x00,\n // version 0\n 0x00, 0x00, 0x00,\n // flags\n (track.id & 0xFF000000) >> 24, (track.id & 0xFF0000) >> 16, (track.id & 0xFF00) >> 8, track.id & 0xFF,\n // track_ID\n 0x00, 0x00, 0x00, 0x01,\n // default_sample_description_index\n 0x00, 0x00, 0x00, 0x00,\n // default_sample_duration\n 0x00, 0x00, 0x00, 0x00,\n // default_sample_size\n 0x00, 0x01, 0x00, 0x01 // default_sample_flags\n ]); // the last two bytes of default_sample_flags is the sample\n // degradation priority, a hint about the importance of this sample\n // relative to others. Lower the degradation priority for all sample\n // types other than video.\n\n if (track.type !== 'video') {\n result[result.length - 1] = 0x00;\n }\n return box(types.trex, result);\n };\n (function () {\n var audioTrun, videoTrun, trunHeader; // This method assumes all samples are uniform. That is, if a\n // duration is present for the first sample, it will be present for\n // all subsequent samples.\n // see ISO/IEC 14496-12:2012, Section 8.8.8.1\n\n trunHeader = function (samples, offset) {\n var durationPresent = 0,\n sizePresent = 0,\n flagsPresent = 0,\n compositionTimeOffset = 0; // trun flag constants\n\n if (samples.length) {\n if (samples[0].duration !== undefined) {\n durationPresent = 0x1;\n }\n if (samples[0].size !== undefined) {\n sizePresent = 0x2;\n }\n if (samples[0].flags !== undefined) {\n flagsPresent = 0x4;\n }\n if (samples[0].compositionTimeOffset !== undefined) {\n compositionTimeOffset = 0x8;\n }\n }\n return [0x00,\n // version 0\n 0x00, durationPresent | sizePresent | flagsPresent | compositionTimeOffset, 0x01,\n // flags\n (samples.length & 0xFF000000) >>> 24, (samples.length & 0xFF0000) >>> 16, (samples.length & 0xFF00) >>> 8, samples.length & 0xFF,\n // sample_count\n (offset & 0xFF000000) >>> 24, (offset & 0xFF0000) >>> 16, (offset & 0xFF00) >>> 8, offset & 0xFF // data_offset\n ];\n };\n\n videoTrun = function (track, offset) {\n var bytesOffest, bytes, header, samples, sample, i;\n samples = track.samples || [];\n offset += 8 + 12 + 16 * samples.length;\n header = trunHeader(samples, offset);\n bytes = new Uint8Array(header.length + samples.length * 16);\n bytes.set(header);\n bytesOffest = header.length;\n for (i = 0; i < samples.length; i++) {\n sample = samples[i];\n bytes[bytesOffest++] = (sample.duration & 0xFF000000) >>> 24;\n bytes[bytesOffest++] = (sample.duration & 0xFF0000) >>> 16;\n bytes[bytesOffest++] = (sample.duration & 0xFF00) >>> 8;\n bytes[bytesOffest++] = sample.duration & 0xFF; // sample_duration\n\n bytes[bytesOffest++] = (sample.size & 0xFF000000) >>> 24;\n bytes[bytesOffest++] = (sample.size & 0xFF0000) >>> 16;\n bytes[bytesOffest++] = (sample.size & 0xFF00) >>> 8;\n bytes[bytesOffest++] = sample.size & 0xFF; // sample_size\n\n bytes[bytesOffest++] = sample.flags.isLeading << 2 | sample.flags.dependsOn;\n bytes[bytesOffest++] = sample.flags.isDependedOn << 6 | sample.flags.hasRedundancy << 4 | sample.flags.paddingValue << 1 | sample.flags.isNonSyncSample;\n bytes[bytesOffest++] = sample.flags.degradationPriority & 0xF0 << 8;\n bytes[bytesOffest++] = sample.flags.degradationPriority & 0x0F; // sample_flags\n\n bytes[bytesOffest++] = (sample.compositionTimeOffset & 0xFF000000) >>> 24;\n bytes[bytesOffest++] = (sample.compositionTimeOffset & 0xFF0000) >>> 16;\n bytes[bytesOffest++] = (sample.compositionTimeOffset & 0xFF00) >>> 8;\n bytes[bytesOffest++] = sample.compositionTimeOffset & 0xFF; // sample_composition_time_offset\n }\n\n return box(types.trun, bytes);\n };\n audioTrun = function (track, offset) {\n var bytes, bytesOffest, header, samples, sample, i;\n samples = track.samples || [];\n offset += 8 + 12 + 8 * samples.length;\n header = trunHeader(samples, offset);\n bytes = new Uint8Array(header.length + samples.length * 8);\n bytes.set(header);\n bytesOffest = header.length;\n for (i = 0; i < samples.length; i++) {\n sample = samples[i];\n bytes[bytesOffest++] = (sample.duration & 0xFF000000) >>> 24;\n bytes[bytesOffest++] = (sample.duration & 0xFF0000) >>> 16;\n bytes[bytesOffest++] = (sample.duration & 0xFF00) >>> 8;\n bytes[bytesOffest++] = sample.duration & 0xFF; // sample_duration\n\n bytes[bytesOffest++] = (sample.size & 0xFF000000) >>> 24;\n bytes[bytesOffest++] = (sample.size & 0xFF0000) >>> 16;\n bytes[bytesOffest++] = (sample.size & 0xFF00) >>> 8;\n bytes[bytesOffest++] = sample.size & 0xFF; // sample_size\n }\n\n return box(types.trun, bytes);\n };\n trun$1 = function (track, offset) {\n if (track.type === 'audio') {\n return audioTrun(track, offset);\n }\n return videoTrun(track, offset);\n };\n })();\n var mp4Generator = {\n ftyp: ftyp,\n mdat: mdat,\n moof: moof,\n moov: moov,\n initSegment: function (tracks) {\n var fileType = ftyp(),\n movie = moov(tracks),\n result;\n result = new Uint8Array(fileType.byteLength + movie.byteLength);\n result.set(fileType);\n result.set(movie, fileType.byteLength);\n return result;\n }\n };\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n */\n // composed of the nal units that make up that frame\n // Also keep track of cummulative data about the frame from the nal units such\n // as the frame duration, starting pts, etc.\n\n var groupNalsIntoFrames = function (nalUnits) {\n var i,\n currentNal,\n currentFrame = [],\n frames = []; // TODO added for LHLS, make sure this is OK\n\n frames.byteLength = 0;\n frames.nalCount = 0;\n frames.duration = 0;\n currentFrame.byteLength = 0;\n for (i = 0; i < nalUnits.length; i++) {\n currentNal = nalUnits[i]; // Split on 'aud'-type nal units\n\n if (currentNal.nalUnitType === 'access_unit_delimiter_rbsp') {\n // Since the very first nal unit is expected to be an AUD\n // only push to the frames array when currentFrame is not empty\n if (currentFrame.length) {\n currentFrame.duration = currentNal.dts - currentFrame.dts; // TODO added for LHLS, make sure this is OK\n\n frames.byteLength += currentFrame.byteLength;\n frames.nalCount += currentFrame.length;\n frames.duration += currentFrame.duration;\n frames.push(currentFrame);\n }\n currentFrame = [currentNal];\n currentFrame.byteLength = currentNal.data.byteLength;\n currentFrame.pts = currentNal.pts;\n currentFrame.dts = currentNal.dts;\n } else {\n // Specifically flag key frames for ease of use later\n if (currentNal.nalUnitType === 'slice_layer_without_partitioning_rbsp_idr') {\n currentFrame.keyFrame = true;\n }\n currentFrame.duration = currentNal.dts - currentFrame.dts;\n currentFrame.byteLength += currentNal.data.byteLength;\n currentFrame.push(currentNal);\n }\n } // For the last frame, use the duration of the previous frame if we\n // have nothing better to go on\n\n if (frames.length && (!currentFrame.duration || currentFrame.duration <= 0)) {\n currentFrame.duration = frames[frames.length - 1].duration;\n } // Push the final frame\n // TODO added for LHLS, make sure this is OK\n\n frames.byteLength += currentFrame.byteLength;\n frames.nalCount += currentFrame.length;\n frames.duration += currentFrame.duration;\n frames.push(currentFrame);\n return frames;\n }; // Convert an array of frames into an array of Gop with each Gop being composed\n // of the frames that make up that Gop\n // Also keep track of cummulative data about the Gop from the frames such as the\n // Gop duration, starting pts, etc.\n\n var groupFramesIntoGops = function (frames) {\n var i,\n currentFrame,\n currentGop = [],\n gops = []; // We must pre-set some of the values on the Gop since we\n // keep running totals of these values\n\n currentGop.byteLength = 0;\n currentGop.nalCount = 0;\n currentGop.duration = 0;\n currentGop.pts = frames[0].pts;\n currentGop.dts = frames[0].dts; // store some metadata about all the Gops\n\n gops.byteLength = 0;\n gops.nalCount = 0;\n gops.duration = 0;\n gops.pts = frames[0].pts;\n gops.dts = frames[0].dts;\n for (i = 0; i < frames.length; i++) {\n currentFrame = frames[i];\n if (currentFrame.keyFrame) {\n // Since the very first frame is expected to be an keyframe\n // only push to the gops array when currentGop is not empty\n if (currentGop.length) {\n gops.push(currentGop);\n gops.byteLength += currentGop.byteLength;\n gops.nalCount += currentGop.nalCount;\n gops.duration += currentGop.duration;\n }\n currentGop = [currentFrame];\n currentGop.nalCount = currentFrame.length;\n currentGop.byteLength = currentFrame.byteLength;\n currentGop.pts = currentFrame.pts;\n currentGop.dts = currentFrame.dts;\n currentGop.duration = currentFrame.duration;\n } else {\n currentGop.duration += currentFrame.duration;\n currentGop.nalCount += currentFrame.length;\n currentGop.byteLength += currentFrame.byteLength;\n currentGop.push(currentFrame);\n }\n }\n if (gops.length && currentGop.duration <= 0) {\n currentGop.duration = gops[gops.length - 1].duration;\n }\n gops.byteLength += currentGop.byteLength;\n gops.nalCount += currentGop.nalCount;\n gops.duration += currentGop.duration; // push the final Gop\n\n gops.push(currentGop);\n return gops;\n };\n /*\n * Search for the first keyframe in the GOPs and throw away all frames\n * until that keyframe. Then extend the duration of the pulled keyframe\n * and pull the PTS and DTS of the keyframe so that it covers the time\n * range of the frames that were disposed.\n *\n * @param {Array} gops video GOPs\n * @returns {Array} modified video GOPs\n */\n\n var extendFirstKeyFrame = function (gops) {\n var currentGop;\n if (!gops[0][0].keyFrame && gops.length > 1) {\n // Remove the first GOP\n currentGop = gops.shift();\n gops.byteLength -= currentGop.byteLength;\n gops.nalCount -= currentGop.nalCount; // Extend the first frame of what is now the\n // first gop to cover the time period of the\n // frames we just removed\n\n gops[0][0].dts = currentGop.dts;\n gops[0][0].pts = currentGop.pts;\n gops[0][0].duration += currentGop.duration;\n }\n return gops;\n };\n /**\n * Default sample object\n * see ISO/IEC 14496-12:2012, section 8.6.4.3\n */\n\n var createDefaultSample = function () {\n return {\n size: 0,\n flags: {\n isLeading: 0,\n dependsOn: 1,\n isDependedOn: 0,\n hasRedundancy: 0,\n degradationPriority: 0,\n isNonSyncSample: 1\n }\n };\n };\n /*\n * Collates information from a video frame into an object for eventual\n * entry into an MP4 sample table.\n *\n * @param {Object} frame the video frame\n * @param {Number} dataOffset the byte offset to position the sample\n * @return {Object} object containing sample table info for a frame\n */\n\n var sampleForFrame = function (frame, dataOffset) {\n var sample = createDefaultSample();\n sample.dataOffset = dataOffset;\n sample.compositionTimeOffset = frame.pts - frame.dts;\n sample.duration = frame.duration;\n sample.size = 4 * frame.length; // Space for nal unit size\n\n sample.size += frame.byteLength;\n if (frame.keyFrame) {\n sample.flags.dependsOn = 2;\n sample.flags.isNonSyncSample = 0;\n }\n return sample;\n }; // generate the track's sample table from an array of gops\n\n var generateSampleTable$1 = function (gops, baseDataOffset) {\n var h,\n i,\n sample,\n currentGop,\n currentFrame,\n dataOffset = baseDataOffset || 0,\n samples = [];\n for (h = 0; h < gops.length; h++) {\n currentGop = gops[h];\n for (i = 0; i < currentGop.length; i++) {\n currentFrame = currentGop[i];\n sample = sampleForFrame(currentFrame, dataOffset);\n dataOffset += sample.size;\n samples.push(sample);\n }\n }\n return samples;\n }; // generate the track's raw mdat data from an array of gops\n\n var concatenateNalData = function (gops) {\n var h,\n i,\n j,\n currentGop,\n currentFrame,\n currentNal,\n dataOffset = 0,\n nalsByteLength = gops.byteLength,\n numberOfNals = gops.nalCount,\n totalByteLength = nalsByteLength + 4 * numberOfNals,\n data = new Uint8Array(totalByteLength),\n view = new DataView(data.buffer); // For each Gop..\n\n for (h = 0; h < gops.length; h++) {\n currentGop = gops[h]; // For each Frame..\n\n for (i = 0; i < currentGop.length; i++) {\n currentFrame = currentGop[i]; // For each NAL..\n\n for (j = 0; j < currentFrame.length; j++) {\n currentNal = currentFrame[j];\n view.setUint32(dataOffset, currentNal.data.byteLength);\n dataOffset += 4;\n data.set(currentNal.data, dataOffset);\n dataOffset += currentNal.data.byteLength;\n }\n }\n }\n return data;\n }; // generate the track's sample table from a frame\n\n var generateSampleTableForFrame = function (frame, baseDataOffset) {\n var sample,\n dataOffset = baseDataOffset || 0,\n samples = [];\n sample = sampleForFrame(frame, dataOffset);\n samples.push(sample);\n return samples;\n }; // generate the track's raw mdat data from a frame\n\n var concatenateNalDataForFrame = function (frame) {\n var i,\n currentNal,\n dataOffset = 0,\n nalsByteLength = frame.byteLength,\n numberOfNals = frame.length,\n totalByteLength = nalsByteLength + 4 * numberOfNals,\n data = new Uint8Array(totalByteLength),\n view = new DataView(data.buffer); // For each NAL..\n\n for (i = 0; i < frame.length; i++) {\n currentNal = frame[i];\n view.setUint32(dataOffset, currentNal.data.byteLength);\n dataOffset += 4;\n data.set(currentNal.data, dataOffset);\n dataOffset += currentNal.data.byteLength;\n }\n return data;\n };\n var frameUtils$1 = {\n groupNalsIntoFrames: groupNalsIntoFrames,\n groupFramesIntoGops: groupFramesIntoGops,\n extendFirstKeyFrame: extendFirstKeyFrame,\n generateSampleTable: generateSampleTable$1,\n concatenateNalData: concatenateNalData,\n generateSampleTableForFrame: generateSampleTableForFrame,\n concatenateNalDataForFrame: concatenateNalDataForFrame\n };\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n */\n\n var highPrefix = [33, 16, 5, 32, 164, 27];\n var lowPrefix = [33, 65, 108, 84, 1, 2, 4, 8, 168, 2, 4, 8, 17, 191, 252];\n var zeroFill = function (count) {\n var a = [];\n while (count--) {\n a.push(0);\n }\n return a;\n };\n var makeTable = function (metaTable) {\n return Object.keys(metaTable).reduce(function (obj, key) {\n obj[key] = new Uint8Array(metaTable[key].reduce(function (arr, part) {\n return arr.concat(part);\n }, []));\n return obj;\n }, {});\n };\n var silence;\n var silence_1 = function () {\n if (!silence) {\n // Frames-of-silence to use for filling in missing AAC frames\n var coneOfSilence = {\n 96000: [highPrefix, [227, 64], zeroFill(154), [56]],\n 88200: [highPrefix, [231], zeroFill(170), [56]],\n 64000: [highPrefix, [248, 192], zeroFill(240), [56]],\n 48000: [highPrefix, [255, 192], zeroFill(268), [55, 148, 128], zeroFill(54), [112]],\n 44100: [highPrefix, [255, 192], zeroFill(268), [55, 163, 128], zeroFill(84), [112]],\n 32000: [highPrefix, [255, 192], zeroFill(268), [55, 234], zeroFill(226), [112]],\n 24000: [highPrefix, [255, 192], zeroFill(268), [55, 255, 128], zeroFill(268), [111, 112], zeroFill(126), [224]],\n 16000: [highPrefix, [255, 192], zeroFill(268), [55, 255, 128], zeroFill(268), [111, 255], zeroFill(269), [223, 108], zeroFill(195), [1, 192]],\n 12000: [lowPrefix, zeroFill(268), [3, 127, 248], zeroFill(268), [6, 255, 240], zeroFill(268), [13, 255, 224], zeroFill(268), [27, 253, 128], zeroFill(259), [56]],\n 11025: [lowPrefix, zeroFill(268), [3, 127, 248], zeroFill(268), [6, 255, 240], zeroFill(268), [13, 255, 224], zeroFill(268), [27, 255, 192], zeroFill(268), [55, 175, 128], zeroFill(108), [112]],\n 8000: [lowPrefix, zeroFill(268), [3, 121, 16], zeroFill(47), [7]]\n };\n silence = makeTable(coneOfSilence);\n }\n return silence;\n };\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n */\n\n var ONE_SECOND_IN_TS$4 = 90000,\n // 90kHz clock\n secondsToVideoTs,\n secondsToAudioTs,\n videoTsToSeconds,\n audioTsToSeconds,\n audioTsToVideoTs,\n videoTsToAudioTs,\n metadataTsToSeconds;\n secondsToVideoTs = function (seconds) {\n return seconds * ONE_SECOND_IN_TS$4;\n };\n secondsToAudioTs = function (seconds, sampleRate) {\n return seconds * sampleRate;\n };\n videoTsToSeconds = function (timestamp) {\n return timestamp / ONE_SECOND_IN_TS$4;\n };\n audioTsToSeconds = function (timestamp, sampleRate) {\n return timestamp / sampleRate;\n };\n audioTsToVideoTs = function (timestamp, sampleRate) {\n return secondsToVideoTs(audioTsToSeconds(timestamp, sampleRate));\n };\n videoTsToAudioTs = function (timestamp, sampleRate) {\n return secondsToAudioTs(videoTsToSeconds(timestamp), sampleRate);\n };\n /**\n * Adjust ID3 tag or caption timing information by the timeline pts values\n * (if keepOriginalTimestamps is false) and convert to seconds\n */\n\n metadataTsToSeconds = function (timestamp, timelineStartPts, keepOriginalTimestamps) {\n return videoTsToSeconds(keepOriginalTimestamps ? timestamp : timestamp - timelineStartPts);\n };\n var clock$2 = {\n ONE_SECOND_IN_TS: ONE_SECOND_IN_TS$4,\n secondsToVideoTs: secondsToVideoTs,\n secondsToAudioTs: secondsToAudioTs,\n videoTsToSeconds: videoTsToSeconds,\n audioTsToSeconds: audioTsToSeconds,\n audioTsToVideoTs: audioTsToVideoTs,\n videoTsToAudioTs: videoTsToAudioTs,\n metadataTsToSeconds: metadataTsToSeconds\n };\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n */\n\n var coneOfSilence = silence_1;\n var clock$1 = clock$2;\n /**\n * Sum the `byteLength` properties of the data in each AAC frame\n */\n\n var sumFrameByteLengths = function (array) {\n var i,\n currentObj,\n sum = 0; // sum the byteLength's all each nal unit in the frame\n\n for (i = 0; i < array.length; i++) {\n currentObj = array[i];\n sum += currentObj.data.byteLength;\n }\n return sum;\n }; // Possibly pad (prefix) the audio track with silence if appending this track\n // would lead to the introduction of a gap in the audio buffer\n\n var prefixWithSilence = function (track, frames, audioAppendStartTs, videoBaseMediaDecodeTime) {\n var baseMediaDecodeTimeTs,\n frameDuration = 0,\n audioGapDuration = 0,\n audioFillFrameCount = 0,\n audioFillDuration = 0,\n silentFrame,\n i,\n firstFrame;\n if (!frames.length) {\n return;\n }\n baseMediaDecodeTimeTs = clock$1.audioTsToVideoTs(track.baseMediaDecodeTime, track.samplerate); // determine frame clock duration based on sample rate, round up to avoid overfills\n\n frameDuration = Math.ceil(clock$1.ONE_SECOND_IN_TS / (track.samplerate / 1024));\n if (audioAppendStartTs && videoBaseMediaDecodeTime) {\n // insert the shortest possible amount (audio gap or audio to video gap)\n audioGapDuration = baseMediaDecodeTimeTs - Math.max(audioAppendStartTs, videoBaseMediaDecodeTime); // number of full frames in the audio gap\n\n audioFillFrameCount = Math.floor(audioGapDuration / frameDuration);\n audioFillDuration = audioFillFrameCount * frameDuration;\n } // don't attempt to fill gaps smaller than a single frame or larger\n // than a half second\n\n if (audioFillFrameCount < 1 || audioFillDuration > clock$1.ONE_SECOND_IN_TS / 2) {\n return;\n }\n silentFrame = coneOfSilence()[track.samplerate];\n if (!silentFrame) {\n // we don't have a silent frame pregenerated for the sample rate, so use a frame\n // from the content instead\n silentFrame = frames[0].data;\n }\n for (i = 0; i < audioFillFrameCount; i++) {\n firstFrame = frames[0];\n frames.splice(0, 0, {\n data: silentFrame,\n dts: firstFrame.dts - frameDuration,\n pts: firstFrame.pts - frameDuration\n });\n }\n track.baseMediaDecodeTime -= Math.floor(clock$1.videoTsToAudioTs(audioFillDuration, track.samplerate));\n return audioFillDuration;\n }; // If the audio segment extends before the earliest allowed dts\n // value, remove AAC frames until starts at or after the earliest\n // allowed DTS so that we don't end up with a negative baseMedia-\n // DecodeTime for the audio track\n\n var trimAdtsFramesByEarliestDts = function (adtsFrames, track, earliestAllowedDts) {\n if (track.minSegmentDts >= earliestAllowedDts) {\n return adtsFrames;\n } // We will need to recalculate the earliest segment Dts\n\n track.minSegmentDts = Infinity;\n return adtsFrames.filter(function (currentFrame) {\n // If this is an allowed frame, keep it and record it's Dts\n if (currentFrame.dts >= earliestAllowedDts) {\n track.minSegmentDts = Math.min(track.minSegmentDts, currentFrame.dts);\n track.minSegmentPts = track.minSegmentDts;\n return true;\n } // Otherwise, discard it\n\n return false;\n });\n }; // generate the track's raw mdat data from an array of frames\n\n var generateSampleTable = function (frames) {\n var i,\n currentFrame,\n samples = [];\n for (i = 0; i < frames.length; i++) {\n currentFrame = frames[i];\n samples.push({\n size: currentFrame.data.byteLength,\n duration: 1024 // For AAC audio, all samples contain 1024 samples\n });\n }\n\n return samples;\n }; // generate the track's sample table from an array of frames\n\n var concatenateFrameData = function (frames) {\n var i,\n currentFrame,\n dataOffset = 0,\n data = new Uint8Array(sumFrameByteLengths(frames));\n for (i = 0; i < frames.length; i++) {\n currentFrame = frames[i];\n data.set(currentFrame.data, dataOffset);\n dataOffset += currentFrame.data.byteLength;\n }\n return data;\n };\n var audioFrameUtils$1 = {\n prefixWithSilence: prefixWithSilence,\n trimAdtsFramesByEarliestDts: trimAdtsFramesByEarliestDts,\n generateSampleTable: generateSampleTable,\n concatenateFrameData: concatenateFrameData\n };\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n */\n\n var ONE_SECOND_IN_TS$3 = clock$2.ONE_SECOND_IN_TS;\n /**\n * Store information about the start and end of the track and the\n * duration for each frame/sample we process in order to calculate\n * the baseMediaDecodeTime\n */\n\n var collectDtsInfo = function (track, data) {\n if (typeof data.pts === 'number') {\n if (track.timelineStartInfo.pts === undefined) {\n track.timelineStartInfo.pts = data.pts;\n }\n if (track.minSegmentPts === undefined) {\n track.minSegmentPts = data.pts;\n } else {\n track.minSegmentPts = Math.min(track.minSegmentPts, data.pts);\n }\n if (track.maxSegmentPts === undefined) {\n track.maxSegmentPts = data.pts;\n } else {\n track.maxSegmentPts = Math.max(track.maxSegmentPts, data.pts);\n }\n }\n if (typeof data.dts === 'number') {\n if (track.timelineStartInfo.dts === undefined) {\n track.timelineStartInfo.dts = data.dts;\n }\n if (track.minSegmentDts === undefined) {\n track.minSegmentDts = data.dts;\n } else {\n track.minSegmentDts = Math.min(track.minSegmentDts, data.dts);\n }\n if (track.maxSegmentDts === undefined) {\n track.maxSegmentDts = data.dts;\n } else {\n track.maxSegmentDts = Math.max(track.maxSegmentDts, data.dts);\n }\n }\n };\n /**\n * Clear values used to calculate the baseMediaDecodeTime between\n * tracks\n */\n\n var clearDtsInfo = function (track) {\n delete track.minSegmentDts;\n delete track.maxSegmentDts;\n delete track.minSegmentPts;\n delete track.maxSegmentPts;\n };\n /**\n * Calculate the track's baseMediaDecodeTime based on the earliest\n * DTS the transmuxer has ever seen and the minimum DTS for the\n * current track\n * @param track {object} track metadata configuration\n * @param keepOriginalTimestamps {boolean} If true, keep the timestamps\n * in the source; false to adjust the first segment to start at 0.\n */\n\n var calculateTrackBaseMediaDecodeTime = function (track, keepOriginalTimestamps) {\n var baseMediaDecodeTime,\n scale,\n minSegmentDts = track.minSegmentDts; // Optionally adjust the time so the first segment starts at zero.\n\n if (!keepOriginalTimestamps) {\n minSegmentDts -= track.timelineStartInfo.dts;\n } // track.timelineStartInfo.baseMediaDecodeTime is the location, in time, where\n // we want the start of the first segment to be placed\n\n baseMediaDecodeTime = track.timelineStartInfo.baseMediaDecodeTime; // Add to that the distance this segment is from the very first\n\n baseMediaDecodeTime += minSegmentDts; // baseMediaDecodeTime must not become negative\n\n baseMediaDecodeTime = Math.max(0, baseMediaDecodeTime);\n if (track.type === 'audio') {\n // Audio has a different clock equal to the sampling_rate so we need to\n // scale the PTS values into the clock rate of the track\n scale = track.samplerate / ONE_SECOND_IN_TS$3;\n baseMediaDecodeTime *= scale;\n baseMediaDecodeTime = Math.floor(baseMediaDecodeTime);\n }\n return baseMediaDecodeTime;\n };\n var trackDecodeInfo$1 = {\n clearDtsInfo: clearDtsInfo,\n calculateTrackBaseMediaDecodeTime: calculateTrackBaseMediaDecodeTime,\n collectDtsInfo: collectDtsInfo\n };\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n *\n * Reads in-band caption information from a video elementary\n * stream. Captions must follow the CEA-708 standard for injection\n * into an MPEG-2 transport streams.\n * @see https://en.wikipedia.org/wiki/CEA-708\n * @see https://www.gpo.gov/fdsys/pkg/CFR-2007-title47-vol1/pdf/CFR-2007-title47-vol1-sec15-119.pdf\n */\n // payload type field to indicate how they are to be\n // interpreted. CEAS-708 caption content is always transmitted with\n // payload type 0x04.\n\n var USER_DATA_REGISTERED_ITU_T_T35 = 4,\n RBSP_TRAILING_BITS = 128;\n /**\n * Parse a supplemental enhancement information (SEI) NAL unit.\n * Stops parsing once a message of type ITU T T35 has been found.\n *\n * @param bytes {Uint8Array} the bytes of a SEI NAL unit\n * @return {object} the parsed SEI payload\n * @see Rec. ITU-T H.264, 7.3.2.3.1\n */\n\n var parseSei = function (bytes) {\n var i = 0,\n result = {\n payloadType: -1,\n payloadSize: 0\n },\n payloadType = 0,\n payloadSize = 0; // go through the sei_rbsp parsing each each individual sei_message\n\n while (i < bytes.byteLength) {\n // stop once we have hit the end of the sei_rbsp\n if (bytes[i] === RBSP_TRAILING_BITS) {\n break;\n } // Parse payload type\n\n while (bytes[i] === 0xFF) {\n payloadType += 255;\n i++;\n }\n payloadType += bytes[i++]; // Parse payload size\n\n while (bytes[i] === 0xFF) {\n payloadSize += 255;\n i++;\n }\n payloadSize += bytes[i++]; // this sei_message is a 608/708 caption so save it and break\n // there can only ever be one caption message in a frame's sei\n\n if (!result.payload && payloadType === USER_DATA_REGISTERED_ITU_T_T35) {\n var userIdentifier = String.fromCharCode(bytes[i + 3], bytes[i + 4], bytes[i + 5], bytes[i + 6]);\n if (userIdentifier === 'GA94') {\n result.payloadType = payloadType;\n result.payloadSize = payloadSize;\n result.payload = bytes.subarray(i, i + payloadSize);\n break;\n } else {\n result.payload = void 0;\n }\n } // skip the payload and parse the next message\n\n i += payloadSize;\n payloadType = 0;\n payloadSize = 0;\n }\n return result;\n }; // see ANSI/SCTE 128-1 (2013), section 8.1\n\n var parseUserData = function (sei) {\n // itu_t_t35_contry_code must be 181 (United States) for\n // captions\n if (sei.payload[0] !== 181) {\n return null;\n } // itu_t_t35_provider_code should be 49 (ATSC) for captions\n\n if ((sei.payload[1] << 8 | sei.payload[2]) !== 49) {\n return null;\n } // the user_identifier should be \"GA94\" to indicate ATSC1 data\n\n if (String.fromCharCode(sei.payload[3], sei.payload[4], sei.payload[5], sei.payload[6]) !== 'GA94') {\n return null;\n } // finally, user_data_type_code should be 0x03 for caption data\n\n if (sei.payload[7] !== 0x03) {\n return null;\n } // return the user_data_type_structure and strip the trailing\n // marker bits\n\n return sei.payload.subarray(8, sei.payload.length - 1);\n }; // see CEA-708-D, section 4.4\n\n var parseCaptionPackets = function (pts, userData) {\n var results = [],\n i,\n count,\n offset,\n data; // if this is just filler, return immediately\n\n if (!(userData[0] & 0x40)) {\n return results;\n } // parse out the cc_data_1 and cc_data_2 fields\n\n count = userData[0] & 0x1f;\n for (i = 0; i < count; i++) {\n offset = i * 3;\n data = {\n type: userData[offset + 2] & 0x03,\n pts: pts\n }; // capture cc data when cc_valid is 1\n\n if (userData[offset + 2] & 0x04) {\n data.ccData = userData[offset + 3] << 8 | userData[offset + 4];\n results.push(data);\n }\n }\n return results;\n };\n var discardEmulationPreventionBytes$1 = function (data) {\n var length = data.byteLength,\n emulationPreventionBytesPositions = [],\n i = 1,\n newLength,\n newData; // Find all `Emulation Prevention Bytes`\n\n while (i < length - 2) {\n if (data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0x03) {\n emulationPreventionBytesPositions.push(i + 2);\n i += 2;\n } else {\n i++;\n }\n } // If no Emulation Prevention Bytes were found just return the original\n // array\n\n if (emulationPreventionBytesPositions.length === 0) {\n return data;\n } // Create a new array to hold the NAL unit data\n\n newLength = length - emulationPreventionBytesPositions.length;\n newData = new Uint8Array(newLength);\n var sourceIndex = 0;\n for (i = 0; i < newLength; sourceIndex++, i++) {\n if (sourceIndex === emulationPreventionBytesPositions[0]) {\n // Skip this byte\n sourceIndex++; // Remove this position index\n\n emulationPreventionBytesPositions.shift();\n }\n newData[i] = data[sourceIndex];\n }\n return newData;\n }; // exports\n\n var captionPacketParser = {\n parseSei: parseSei,\n parseUserData: parseUserData,\n parseCaptionPackets: parseCaptionPackets,\n discardEmulationPreventionBytes: discardEmulationPreventionBytes$1,\n USER_DATA_REGISTERED_ITU_T_T35: USER_DATA_REGISTERED_ITU_T_T35\n };\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n *\n * Reads in-band caption information from a video elementary\n * stream. Captions must follow the CEA-708 standard for injection\n * into an MPEG-2 transport streams.\n * @see https://en.wikipedia.org/wiki/CEA-708\n * @see https://www.gpo.gov/fdsys/pkg/CFR-2007-title47-vol1/pdf/CFR-2007-title47-vol1-sec15-119.pdf\n */\n // Link To Transport\n // -----------------\n\n var Stream$7 = stream;\n var cea708Parser = captionPacketParser;\n var CaptionStream$2 = function (options) {\n options = options || {};\n CaptionStream$2.prototype.init.call(this); // parse708captions flag, default to true\n\n this.parse708captions_ = typeof options.parse708captions === 'boolean' ? options.parse708captions : true;\n this.captionPackets_ = [];\n this.ccStreams_ = [new Cea608Stream(0, 0),\n // eslint-disable-line no-use-before-define\n new Cea608Stream(0, 1),\n // eslint-disable-line no-use-before-define\n new Cea608Stream(1, 0),\n // eslint-disable-line no-use-before-define\n new Cea608Stream(1, 1) // eslint-disable-line no-use-before-define\n ];\n\n if (this.parse708captions_) {\n this.cc708Stream_ = new Cea708Stream({\n captionServices: options.captionServices\n }); // eslint-disable-line no-use-before-define\n }\n\n this.reset(); // forward data and done events from CCs to this CaptionStream\n\n this.ccStreams_.forEach(function (cc) {\n cc.on('data', this.trigger.bind(this, 'data'));\n cc.on('partialdone', this.trigger.bind(this, 'partialdone'));\n cc.on('done', this.trigger.bind(this, 'done'));\n }, this);\n if (this.parse708captions_) {\n this.cc708Stream_.on('data', this.trigger.bind(this, 'data'));\n this.cc708Stream_.on('partialdone', this.trigger.bind(this, 'partialdone'));\n this.cc708Stream_.on('done', this.trigger.bind(this, 'done'));\n }\n };\n CaptionStream$2.prototype = new Stream$7();\n CaptionStream$2.prototype.push = function (event) {\n var sei, userData, newCaptionPackets; // only examine SEI NALs\n\n if (event.nalUnitType !== 'sei_rbsp') {\n return;\n } // parse the sei\n\n sei = cea708Parser.parseSei(event.escapedRBSP); // no payload data, skip\n\n if (!sei.payload) {\n return;\n } // ignore everything but user_data_registered_itu_t_t35\n\n if (sei.payloadType !== cea708Parser.USER_DATA_REGISTERED_ITU_T_T35) {\n return;\n } // parse out the user data payload\n\n userData = cea708Parser.parseUserData(sei); // ignore unrecognized userData\n\n if (!userData) {\n return;\n } // Sometimes, the same segment # will be downloaded twice. To stop the\n // caption data from being processed twice, we track the latest dts we've\n // received and ignore everything with a dts before that. However, since\n // data for a specific dts can be split across packets on either side of\n // a segment boundary, we need to make sure we *don't* ignore the packets\n // from the *next* segment that have dts === this.latestDts_. By constantly\n // tracking the number of packets received with dts === this.latestDts_, we\n // know how many should be ignored once we start receiving duplicates.\n\n if (event.dts < this.latestDts_) {\n // We've started getting older data, so set the flag.\n this.ignoreNextEqualDts_ = true;\n return;\n } else if (event.dts === this.latestDts_ && this.ignoreNextEqualDts_) {\n this.numSameDts_--;\n if (!this.numSameDts_) {\n // We've received the last duplicate packet, time to start processing again\n this.ignoreNextEqualDts_ = false;\n }\n return;\n } // parse out CC data packets and save them for later\n\n newCaptionPackets = cea708Parser.parseCaptionPackets(event.pts, userData);\n this.captionPackets_ = this.captionPackets_.concat(newCaptionPackets);\n if (this.latestDts_ !== event.dts) {\n this.numSameDts_ = 0;\n }\n this.numSameDts_++;\n this.latestDts_ = event.dts;\n };\n CaptionStream$2.prototype.flushCCStreams = function (flushType) {\n this.ccStreams_.forEach(function (cc) {\n return flushType === 'flush' ? cc.flush() : cc.partialFlush();\n }, this);\n };\n CaptionStream$2.prototype.flushStream = function (flushType) {\n // make sure we actually parsed captions before proceeding\n if (!this.captionPackets_.length) {\n this.flushCCStreams(flushType);\n return;\n } // In Chrome, the Array#sort function is not stable so add a\n // presortIndex that we can use to ensure we get a stable-sort\n\n this.captionPackets_.forEach(function (elem, idx) {\n elem.presortIndex = idx;\n }); // sort caption byte-pairs based on their PTS values\n\n this.captionPackets_.sort(function (a, b) {\n if (a.pts === b.pts) {\n return a.presortIndex - b.presortIndex;\n }\n return a.pts - b.pts;\n });\n this.captionPackets_.forEach(function (packet) {\n if (packet.type < 2) {\n // Dispatch packet to the right Cea608Stream\n this.dispatchCea608Packet(packet);\n } else {\n // Dispatch packet to the Cea708Stream\n this.dispatchCea708Packet(packet);\n }\n }, this);\n this.captionPackets_.length = 0;\n this.flushCCStreams(flushType);\n };\n CaptionStream$2.prototype.flush = function () {\n return this.flushStream('flush');\n }; // Only called if handling partial data\n\n CaptionStream$2.prototype.partialFlush = function () {\n return this.flushStream('partialFlush');\n };\n CaptionStream$2.prototype.reset = function () {\n this.latestDts_ = null;\n this.ignoreNextEqualDts_ = false;\n this.numSameDts_ = 0;\n this.activeCea608Channel_ = [null, null];\n this.ccStreams_.forEach(function (ccStream) {\n ccStream.reset();\n });\n }; // From the CEA-608 spec:\n\n /*\n * When XDS sub-packets are interleaved with other services, the end of each sub-packet shall be followed\n * by a control pair to change to a different service. When any of the control codes from 0x10 to 0x1F is\n * used to begin a control code pair, it indicates the return to captioning or Text data. The control code pair\n * and subsequent data should then be processed according to the FCC rules. It may be necessary for the\n * line 21 data encoder to automatically insert a control code pair (i.e. RCL, RU2, RU3, RU4, RDC, or RTD)\n * to switch to captioning or Text.\n */\n // With that in mind, we ignore any data between an XDS control code and a\n // subsequent closed-captioning control code.\n\n CaptionStream$2.prototype.dispatchCea608Packet = function (packet) {\n // NOTE: packet.type is the CEA608 field\n if (this.setsTextOrXDSActive(packet)) {\n this.activeCea608Channel_[packet.type] = null;\n } else if (this.setsChannel1Active(packet)) {\n this.activeCea608Channel_[packet.type] = 0;\n } else if (this.setsChannel2Active(packet)) {\n this.activeCea608Channel_[packet.type] = 1;\n }\n if (this.activeCea608Channel_[packet.type] === null) {\n // If we haven't received anything to set the active channel, or the\n // packets are Text/XDS data, discard the data; we don't want jumbled\n // captions\n return;\n }\n this.ccStreams_[(packet.type << 1) + this.activeCea608Channel_[packet.type]].push(packet);\n };\n CaptionStream$2.prototype.setsChannel1Active = function (packet) {\n return (packet.ccData & 0x7800) === 0x1000;\n };\n CaptionStream$2.prototype.setsChannel2Active = function (packet) {\n return (packet.ccData & 0x7800) === 0x1800;\n };\n CaptionStream$2.prototype.setsTextOrXDSActive = function (packet) {\n return (packet.ccData & 0x7100) === 0x0100 || (packet.ccData & 0x78fe) === 0x102a || (packet.ccData & 0x78fe) === 0x182a;\n };\n CaptionStream$2.prototype.dispatchCea708Packet = function (packet) {\n if (this.parse708captions_) {\n this.cc708Stream_.push(packet);\n }\n }; // ----------------------\n // Session to Application\n // ----------------------\n // This hash maps special and extended character codes to their\n // proper Unicode equivalent. The first one-byte key is just a\n // non-standard character code. The two-byte keys that follow are\n // the extended CEA708 character codes, along with the preceding\n // 0x10 extended character byte to distinguish these codes from\n // non-extended character codes. Every CEA708 character code that\n // is not in this object maps directly to a standard unicode\n // character code.\n // The transparent space and non-breaking transparent space are\n // technically not fully supported since there is no code to\n // make them transparent, so they have normal non-transparent\n // stand-ins.\n // The special closed caption (CC) character isn't a standard\n // unicode character, so a fairly similar unicode character was\n // chosen in it's place.\n\n var CHARACTER_TRANSLATION_708 = {\n 0x7f: 0x266a,\n // ♪\n 0x1020: 0x20,\n // Transparent Space\n 0x1021: 0xa0,\n // Nob-breaking Transparent Space\n 0x1025: 0x2026,\n // …\n 0x102a: 0x0160,\n // Š\n 0x102c: 0x0152,\n // Œ\n 0x1030: 0x2588,\n // █\n 0x1031: 0x2018,\n // ‘\n 0x1032: 0x2019,\n // ’\n 0x1033: 0x201c,\n // “\n 0x1034: 0x201d,\n // ”\n 0x1035: 0x2022,\n // •\n 0x1039: 0x2122,\n // ™\n 0x103a: 0x0161,\n // š\n 0x103c: 0x0153,\n // œ\n 0x103d: 0x2120,\n // ℠\n 0x103f: 0x0178,\n // Ÿ\n 0x1076: 0x215b,\n // ⅛\n 0x1077: 0x215c,\n // ⅜\n 0x1078: 0x215d,\n // ⅝\n 0x1079: 0x215e,\n // ⅞\n 0x107a: 0x23d0,\n // ⏐\n 0x107b: 0x23a4,\n // ⎤\n 0x107c: 0x23a3,\n // ⎣\n 0x107d: 0x23af,\n // ⎯\n 0x107e: 0x23a6,\n // ⎦\n 0x107f: 0x23a1,\n // ⎡\n 0x10a0: 0x3138 // ㄸ (CC char)\n };\n\n var get708CharFromCode = function (code) {\n var newCode = CHARACTER_TRANSLATION_708[code] || code;\n if (code & 0x1000 && code === newCode) {\n // Invalid extended code\n return '';\n }\n return String.fromCharCode(newCode);\n };\n var within708TextBlock = function (b) {\n return 0x20 <= b && b <= 0x7f || 0xa0 <= b && b <= 0xff;\n };\n var Cea708Window = function (windowNum) {\n this.windowNum = windowNum;\n this.reset();\n };\n Cea708Window.prototype.reset = function () {\n this.clearText();\n this.pendingNewLine = false;\n this.winAttr = {};\n this.penAttr = {};\n this.penLoc = {};\n this.penColor = {}; // These default values are arbitrary,\n // defineWindow will usually override them\n\n this.visible = 0;\n this.rowLock = 0;\n this.columnLock = 0;\n this.priority = 0;\n this.relativePositioning = 0;\n this.anchorVertical = 0;\n this.anchorHorizontal = 0;\n this.anchorPoint = 0;\n this.rowCount = 1;\n this.virtualRowCount = this.rowCount + 1;\n this.columnCount = 41;\n this.windowStyle = 0;\n this.penStyle = 0;\n };\n Cea708Window.prototype.getText = function () {\n return this.rows.join('\\n');\n };\n Cea708Window.prototype.clearText = function () {\n this.rows = [''];\n this.rowIdx = 0;\n };\n Cea708Window.prototype.newLine = function (pts) {\n if (this.rows.length >= this.virtualRowCount && typeof this.beforeRowOverflow === 'function') {\n this.beforeRowOverflow(pts);\n }\n if (this.rows.length > 0) {\n this.rows.push('');\n this.rowIdx++;\n } // Show all virtual rows since there's no visible scrolling\n\n while (this.rows.length > this.virtualRowCount) {\n this.rows.shift();\n this.rowIdx--;\n }\n };\n Cea708Window.prototype.isEmpty = function () {\n if (this.rows.length === 0) {\n return true;\n } else if (this.rows.length === 1) {\n return this.rows[0] === '';\n }\n return false;\n };\n Cea708Window.prototype.addText = function (text) {\n this.rows[this.rowIdx] += text;\n };\n Cea708Window.prototype.backspace = function () {\n if (!this.isEmpty()) {\n var row = this.rows[this.rowIdx];\n this.rows[this.rowIdx] = row.substr(0, row.length - 1);\n }\n };\n var Cea708Service = function (serviceNum, encoding, stream) {\n this.serviceNum = serviceNum;\n this.text = '';\n this.currentWindow = new Cea708Window(-1);\n this.windows = [];\n this.stream = stream; // Try to setup a TextDecoder if an `encoding` value was provided\n\n if (typeof encoding === 'string') {\n this.createTextDecoder(encoding);\n }\n };\n /**\n * Initialize service windows\n * Must be run before service use\n *\n * @param {Integer} pts PTS value\n * @param {Function} beforeRowOverflow Function to execute before row overflow of a window\n */\n\n Cea708Service.prototype.init = function (pts, beforeRowOverflow) {\n this.startPts = pts;\n for (var win = 0; win < 8; win++) {\n this.windows[win] = new Cea708Window(win);\n if (typeof beforeRowOverflow === 'function') {\n this.windows[win].beforeRowOverflow = beforeRowOverflow;\n }\n }\n };\n /**\n * Set current window of service to be affected by commands\n *\n * @param {Integer} windowNum Window number\n */\n\n Cea708Service.prototype.setCurrentWindow = function (windowNum) {\n this.currentWindow = this.windows[windowNum];\n };\n /**\n * Try to create a TextDecoder if it is natively supported\n */\n\n Cea708Service.prototype.createTextDecoder = function (encoding) {\n if (typeof TextDecoder === 'undefined') {\n this.stream.trigger('log', {\n level: 'warn',\n message: 'The `encoding` option is unsupported without TextDecoder support'\n });\n } else {\n try {\n this.textDecoder_ = new TextDecoder(encoding);\n } catch (error) {\n this.stream.trigger('log', {\n level: 'warn',\n message: 'TextDecoder could not be created with ' + encoding + ' encoding. ' + error\n });\n }\n }\n };\n var Cea708Stream = function (options) {\n options = options || {};\n Cea708Stream.prototype.init.call(this);\n var self = this;\n var captionServices = options.captionServices || {};\n var captionServiceEncodings = {};\n var serviceProps; // Get service encodings from captionServices option block\n\n Object.keys(captionServices).forEach(serviceName => {\n serviceProps = captionServices[serviceName];\n if (/^SERVICE/.test(serviceName)) {\n captionServiceEncodings[serviceName] = serviceProps.encoding;\n }\n });\n this.serviceEncodings = captionServiceEncodings;\n this.current708Packet = null;\n this.services = {};\n this.push = function (packet) {\n if (packet.type === 3) {\n // 708 packet start\n self.new708Packet();\n self.add708Bytes(packet);\n } else {\n if (self.current708Packet === null) {\n // This should only happen at the start of a file if there's no packet start.\n self.new708Packet();\n }\n self.add708Bytes(packet);\n }\n };\n };\n Cea708Stream.prototype = new Stream$7();\n /**\n * Push current 708 packet, create new 708 packet.\n */\n\n Cea708Stream.prototype.new708Packet = function () {\n if (this.current708Packet !== null) {\n this.push708Packet();\n }\n this.current708Packet = {\n data: [],\n ptsVals: []\n };\n };\n /**\n * Add pts and both bytes from packet into current 708 packet.\n */\n\n Cea708Stream.prototype.add708Bytes = function (packet) {\n var data = packet.ccData;\n var byte0 = data >>> 8;\n var byte1 = data & 0xff; // I would just keep a list of packets instead of bytes, but it isn't clear in the spec\n // that service blocks will always line up with byte pairs.\n\n this.current708Packet.ptsVals.push(packet.pts);\n this.current708Packet.data.push(byte0);\n this.current708Packet.data.push(byte1);\n };\n /**\n * Parse completed 708 packet into service blocks and push each service block.\n */\n\n Cea708Stream.prototype.push708Packet = function () {\n var packet708 = this.current708Packet;\n var packetData = packet708.data;\n var serviceNum = null;\n var blockSize = null;\n var i = 0;\n var b = packetData[i++];\n packet708.seq = b >> 6;\n packet708.sizeCode = b & 0x3f; // 0b00111111;\n\n for (; i < packetData.length; i++) {\n b = packetData[i++];\n serviceNum = b >> 5;\n blockSize = b & 0x1f; // 0b00011111\n\n if (serviceNum === 7 && blockSize > 0) {\n // Extended service num\n b = packetData[i++];\n serviceNum = b;\n }\n this.pushServiceBlock(serviceNum, i, blockSize);\n if (blockSize > 0) {\n i += blockSize - 1;\n }\n }\n };\n /**\n * Parse service block, execute commands, read text.\n *\n * Note: While many of these commands serve important purposes,\n * many others just parse out the parameters or attributes, but\n * nothing is done with them because this is not a full and complete\n * implementation of the entire 708 spec.\n *\n * @param {Integer} serviceNum Service number\n * @param {Integer} start Start index of the 708 packet data\n * @param {Integer} size Block size\n */\n\n Cea708Stream.prototype.pushServiceBlock = function (serviceNum, start, size) {\n var b;\n var i = start;\n var packetData = this.current708Packet.data;\n var service = this.services[serviceNum];\n if (!service) {\n service = this.initService(serviceNum, i);\n }\n for (; i < start + size && i < packetData.length; i++) {\n b = packetData[i];\n if (within708TextBlock(b)) {\n i = this.handleText(i, service);\n } else if (b === 0x18) {\n i = this.multiByteCharacter(i, service);\n } else if (b === 0x10) {\n i = this.extendedCommands(i, service);\n } else if (0x80 <= b && b <= 0x87) {\n i = this.setCurrentWindow(i, service);\n } else if (0x98 <= b && b <= 0x9f) {\n i = this.defineWindow(i, service);\n } else if (b === 0x88) {\n i = this.clearWindows(i, service);\n } else if (b === 0x8c) {\n i = this.deleteWindows(i, service);\n } else if (b === 0x89) {\n i = this.displayWindows(i, service);\n } else if (b === 0x8a) {\n i = this.hideWindows(i, service);\n } else if (b === 0x8b) {\n i = this.toggleWindows(i, service);\n } else if (b === 0x97) {\n i = this.setWindowAttributes(i, service);\n } else if (b === 0x90) {\n i = this.setPenAttributes(i, service);\n } else if (b === 0x91) {\n i = this.setPenColor(i, service);\n } else if (b === 0x92) {\n i = this.setPenLocation(i, service);\n } else if (b === 0x8f) {\n service = this.reset(i, service);\n } else if (b === 0x08) {\n // BS: Backspace\n service.currentWindow.backspace();\n } else if (b === 0x0c) {\n // FF: Form feed\n service.currentWindow.clearText();\n } else if (b === 0x0d) {\n // CR: Carriage return\n service.currentWindow.pendingNewLine = true;\n } else if (b === 0x0e) {\n // HCR: Horizontal carriage return\n service.currentWindow.clearText();\n } else if (b === 0x8d) {\n // DLY: Delay, nothing to do\n i++;\n } else ;\n }\n };\n /**\n * Execute an extended command\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Integer} New index after parsing\n */\n\n Cea708Stream.prototype.extendedCommands = function (i, service) {\n var packetData = this.current708Packet.data;\n var b = packetData[++i];\n if (within708TextBlock(b)) {\n i = this.handleText(i, service, {\n isExtended: true\n });\n }\n return i;\n };\n /**\n * Get PTS value of a given byte index\n *\n * @param {Integer} byteIndex Index of the byte\n * @return {Integer} PTS\n */\n\n Cea708Stream.prototype.getPts = function (byteIndex) {\n // There's 1 pts value per 2 bytes\n return this.current708Packet.ptsVals[Math.floor(byteIndex / 2)];\n };\n /**\n * Initializes a service\n *\n * @param {Integer} serviceNum Service number\n * @return {Service} Initialized service object\n */\n\n Cea708Stream.prototype.initService = function (serviceNum, i) {\n var serviceName = 'SERVICE' + serviceNum;\n var self = this;\n var serviceName;\n var encoding;\n if (serviceName in this.serviceEncodings) {\n encoding = this.serviceEncodings[serviceName];\n }\n this.services[serviceNum] = new Cea708Service(serviceNum, encoding, self);\n this.services[serviceNum].init(this.getPts(i), function (pts) {\n self.flushDisplayed(pts, self.services[serviceNum]);\n });\n return this.services[serviceNum];\n };\n /**\n * Execute text writing to current window\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Integer} New index after parsing\n */\n\n Cea708Stream.prototype.handleText = function (i, service, options) {\n var isExtended = options && options.isExtended;\n var isMultiByte = options && options.isMultiByte;\n var packetData = this.current708Packet.data;\n var extended = isExtended ? 0x1000 : 0x0000;\n var currentByte = packetData[i];\n var nextByte = packetData[i + 1];\n var win = service.currentWindow;\n var char;\n var charCodeArray; // Converts an array of bytes to a unicode hex string.\n\n function toHexString(byteArray) {\n return byteArray.map(byte => {\n return ('0' + (byte & 0xFF).toString(16)).slice(-2);\n }).join('');\n }\n if (isMultiByte) {\n charCodeArray = [currentByte, nextByte];\n i++;\n } else {\n charCodeArray = [currentByte];\n } // Use the TextDecoder if one was created for this service\n\n if (service.textDecoder_ && !isExtended) {\n char = service.textDecoder_.decode(new Uint8Array(charCodeArray));\n } else {\n // We assume any multi-byte char without a decoder is unicode.\n if (isMultiByte) {\n const unicode = toHexString(charCodeArray); // Takes a unicode hex string and creates a single character.\n\n char = String.fromCharCode(parseInt(unicode, 16));\n } else {\n char = get708CharFromCode(extended | currentByte);\n }\n }\n if (win.pendingNewLine && !win.isEmpty()) {\n win.newLine(this.getPts(i));\n }\n win.pendingNewLine = false;\n win.addText(char);\n return i;\n };\n /**\n * Handle decoding of multibyte character\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Integer} New index after parsing\n */\n\n Cea708Stream.prototype.multiByteCharacter = function (i, service) {\n var packetData = this.current708Packet.data;\n var firstByte = packetData[i + 1];\n var secondByte = packetData[i + 2];\n if (within708TextBlock(firstByte) && within708TextBlock(secondByte)) {\n i = this.handleText(++i, service, {\n isMultiByte: true\n });\n }\n return i;\n };\n /**\n * Parse and execute the CW# command.\n *\n * Set the current window.\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Integer} New index after parsing\n */\n\n Cea708Stream.prototype.setCurrentWindow = function (i, service) {\n var packetData = this.current708Packet.data;\n var b = packetData[i];\n var windowNum = b & 0x07;\n service.setCurrentWindow(windowNum);\n return i;\n };\n /**\n * Parse and execute the DF# command.\n *\n * Define a window and set it as the current window.\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Integer} New index after parsing\n */\n\n Cea708Stream.prototype.defineWindow = function (i, service) {\n var packetData = this.current708Packet.data;\n var b = packetData[i];\n var windowNum = b & 0x07;\n service.setCurrentWindow(windowNum);\n var win = service.currentWindow;\n b = packetData[++i];\n win.visible = (b & 0x20) >> 5; // v\n\n win.rowLock = (b & 0x10) >> 4; // rl\n\n win.columnLock = (b & 0x08) >> 3; // cl\n\n win.priority = b & 0x07; // p\n\n b = packetData[++i];\n win.relativePositioning = (b & 0x80) >> 7; // rp\n\n win.anchorVertical = b & 0x7f; // av\n\n b = packetData[++i];\n win.anchorHorizontal = b; // ah\n\n b = packetData[++i];\n win.anchorPoint = (b & 0xf0) >> 4; // ap\n\n win.rowCount = b & 0x0f; // rc\n\n b = packetData[++i];\n win.columnCount = b & 0x3f; // cc\n\n b = packetData[++i];\n win.windowStyle = (b & 0x38) >> 3; // ws\n\n win.penStyle = b & 0x07; // ps\n // The spec says there are (rowCount+1) \"virtual rows\"\n\n win.virtualRowCount = win.rowCount + 1;\n return i;\n };\n /**\n * Parse and execute the SWA command.\n *\n * Set attributes of the current window.\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Integer} New index after parsing\n */\n\n Cea708Stream.prototype.setWindowAttributes = function (i, service) {\n var packetData = this.current708Packet.data;\n var b = packetData[i];\n var winAttr = service.currentWindow.winAttr;\n b = packetData[++i];\n winAttr.fillOpacity = (b & 0xc0) >> 6; // fo\n\n winAttr.fillRed = (b & 0x30) >> 4; // fr\n\n winAttr.fillGreen = (b & 0x0c) >> 2; // fg\n\n winAttr.fillBlue = b & 0x03; // fb\n\n b = packetData[++i];\n winAttr.borderType = (b & 0xc0) >> 6; // bt\n\n winAttr.borderRed = (b & 0x30) >> 4; // br\n\n winAttr.borderGreen = (b & 0x0c) >> 2; // bg\n\n winAttr.borderBlue = b & 0x03; // bb\n\n b = packetData[++i];\n winAttr.borderType += (b & 0x80) >> 5; // bt\n\n winAttr.wordWrap = (b & 0x40) >> 6; // ww\n\n winAttr.printDirection = (b & 0x30) >> 4; // pd\n\n winAttr.scrollDirection = (b & 0x0c) >> 2; // sd\n\n winAttr.justify = b & 0x03; // j\n\n b = packetData[++i];\n winAttr.effectSpeed = (b & 0xf0) >> 4; // es\n\n winAttr.effectDirection = (b & 0x0c) >> 2; // ed\n\n winAttr.displayEffect = b & 0x03; // de\n\n return i;\n };\n /**\n * Gather text from all displayed windows and push a caption to output.\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n */\n\n Cea708Stream.prototype.flushDisplayed = function (pts, service) {\n var displayedText = []; // TODO: Positioning not supported, displaying multiple windows will not necessarily\n // display text in the correct order, but sample files so far have not shown any issue.\n\n for (var winId = 0; winId < 8; winId++) {\n if (service.windows[winId].visible && !service.windows[winId].isEmpty()) {\n displayedText.push(service.windows[winId].getText());\n }\n }\n service.endPts = pts;\n service.text = displayedText.join('\\n\\n');\n this.pushCaption(service);\n service.startPts = pts;\n };\n /**\n * Push a caption to output if the caption contains text.\n *\n * @param {Service} service The service object to be affected\n */\n\n Cea708Stream.prototype.pushCaption = function (service) {\n if (service.text !== '') {\n this.trigger('data', {\n startPts: service.startPts,\n endPts: service.endPts,\n text: service.text,\n stream: 'cc708_' + service.serviceNum\n });\n service.text = '';\n service.startPts = service.endPts;\n }\n };\n /**\n * Parse and execute the DSW command.\n *\n * Set visible property of windows based on the parsed bitmask.\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Integer} New index after parsing\n */\n\n Cea708Stream.prototype.displayWindows = function (i, service) {\n var packetData = this.current708Packet.data;\n var b = packetData[++i];\n var pts = this.getPts(i);\n this.flushDisplayed(pts, service);\n for (var winId = 0; winId < 8; winId++) {\n if (b & 0x01 << winId) {\n service.windows[winId].visible = 1;\n }\n }\n return i;\n };\n /**\n * Parse and execute the HDW command.\n *\n * Set visible property of windows based on the parsed bitmask.\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Integer} New index after parsing\n */\n\n Cea708Stream.prototype.hideWindows = function (i, service) {\n var packetData = this.current708Packet.data;\n var b = packetData[++i];\n var pts = this.getPts(i);\n this.flushDisplayed(pts, service);\n for (var winId = 0; winId < 8; winId++) {\n if (b & 0x01 << winId) {\n service.windows[winId].visible = 0;\n }\n }\n return i;\n };\n /**\n * Parse and execute the TGW command.\n *\n * Set visible property of windows based on the parsed bitmask.\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Integer} New index after parsing\n */\n\n Cea708Stream.prototype.toggleWindows = function (i, service) {\n var packetData = this.current708Packet.data;\n var b = packetData[++i];\n var pts = this.getPts(i);\n this.flushDisplayed(pts, service);\n for (var winId = 0; winId < 8; winId++) {\n if (b & 0x01 << winId) {\n service.windows[winId].visible ^= 1;\n }\n }\n return i;\n };\n /**\n * Parse and execute the CLW command.\n *\n * Clear text of windows based on the parsed bitmask.\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Integer} New index after parsing\n */\n\n Cea708Stream.prototype.clearWindows = function (i, service) {\n var packetData = this.current708Packet.data;\n var b = packetData[++i];\n var pts = this.getPts(i);\n this.flushDisplayed(pts, service);\n for (var winId = 0; winId < 8; winId++) {\n if (b & 0x01 << winId) {\n service.windows[winId].clearText();\n }\n }\n return i;\n };\n /**\n * Parse and execute the DLW command.\n *\n * Re-initialize windows based on the parsed bitmask.\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Integer} New index after parsing\n */\n\n Cea708Stream.prototype.deleteWindows = function (i, service) {\n var packetData = this.current708Packet.data;\n var b = packetData[++i];\n var pts = this.getPts(i);\n this.flushDisplayed(pts, service);\n for (var winId = 0; winId < 8; winId++) {\n if (b & 0x01 << winId) {\n service.windows[winId].reset();\n }\n }\n return i;\n };\n /**\n * Parse and execute the SPA command.\n *\n * Set pen attributes of the current window.\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Integer} New index after parsing\n */\n\n Cea708Stream.prototype.setPenAttributes = function (i, service) {\n var packetData = this.current708Packet.data;\n var b = packetData[i];\n var penAttr = service.currentWindow.penAttr;\n b = packetData[++i];\n penAttr.textTag = (b & 0xf0) >> 4; // tt\n\n penAttr.offset = (b & 0x0c) >> 2; // o\n\n penAttr.penSize = b & 0x03; // s\n\n b = packetData[++i];\n penAttr.italics = (b & 0x80) >> 7; // i\n\n penAttr.underline = (b & 0x40) >> 6; // u\n\n penAttr.edgeType = (b & 0x38) >> 3; // et\n\n penAttr.fontStyle = b & 0x07; // fs\n\n return i;\n };\n /**\n * Parse and execute the SPC command.\n *\n * Set pen color of the current window.\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Integer} New index after parsing\n */\n\n Cea708Stream.prototype.setPenColor = function (i, service) {\n var packetData = this.current708Packet.data;\n var b = packetData[i];\n var penColor = service.currentWindow.penColor;\n b = packetData[++i];\n penColor.fgOpacity = (b & 0xc0) >> 6; // fo\n\n penColor.fgRed = (b & 0x30) >> 4; // fr\n\n penColor.fgGreen = (b & 0x0c) >> 2; // fg\n\n penColor.fgBlue = b & 0x03; // fb\n\n b = packetData[++i];\n penColor.bgOpacity = (b & 0xc0) >> 6; // bo\n\n penColor.bgRed = (b & 0x30) >> 4; // br\n\n penColor.bgGreen = (b & 0x0c) >> 2; // bg\n\n penColor.bgBlue = b & 0x03; // bb\n\n b = packetData[++i];\n penColor.edgeRed = (b & 0x30) >> 4; // er\n\n penColor.edgeGreen = (b & 0x0c) >> 2; // eg\n\n penColor.edgeBlue = b & 0x03; // eb\n\n return i;\n };\n /**\n * Parse and execute the SPL command.\n *\n * Set pen location of the current window.\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Integer} New index after parsing\n */\n\n Cea708Stream.prototype.setPenLocation = function (i, service) {\n var packetData = this.current708Packet.data;\n var b = packetData[i];\n var penLoc = service.currentWindow.penLoc; // Positioning isn't really supported at the moment, so this essentially just inserts a linebreak\n\n service.currentWindow.pendingNewLine = true;\n b = packetData[++i];\n penLoc.row = b & 0x0f; // r\n\n b = packetData[++i];\n penLoc.column = b & 0x3f; // c\n\n return i;\n };\n /**\n * Execute the RST command.\n *\n * Reset service to a clean slate. Re-initialize.\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Service} Re-initialized service\n */\n\n Cea708Stream.prototype.reset = function (i, service) {\n var pts = this.getPts(i);\n this.flushDisplayed(pts, service);\n return this.initService(service.serviceNum, i);\n }; // This hash maps non-ASCII, special, and extended character codes to their\n // proper Unicode equivalent. The first keys that are only a single byte\n // are the non-standard ASCII characters, which simply map the CEA608 byte\n // to the standard ASCII/Unicode. The two-byte keys that follow are the CEA608\n // character codes, but have their MSB bitmasked with 0x03 so that a lookup\n // can be performed regardless of the field and data channel on which the\n // character code was received.\n\n var CHARACTER_TRANSLATION = {\n 0x2a: 0xe1,\n // á\n 0x5c: 0xe9,\n // é\n 0x5e: 0xed,\n // í\n 0x5f: 0xf3,\n // ó\n 0x60: 0xfa,\n // ú\n 0x7b: 0xe7,\n // ç\n 0x7c: 0xf7,\n // ÷\n 0x7d: 0xd1,\n // Ñ\n 0x7e: 0xf1,\n // ñ\n 0x7f: 0x2588,\n // █\n 0x0130: 0xae,\n // ®\n 0x0131: 0xb0,\n // °\n 0x0132: 0xbd,\n // ½\n 0x0133: 0xbf,\n // ¿\n 0x0134: 0x2122,\n // ™\n 0x0135: 0xa2,\n // ¢\n 0x0136: 0xa3,\n // £\n 0x0137: 0x266a,\n // ♪\n 0x0138: 0xe0,\n // à\n 0x0139: 0xa0,\n //\n 0x013a: 0xe8,\n // è\n 0x013b: 0xe2,\n // â\n 0x013c: 0xea,\n // ê\n 0x013d: 0xee,\n // î\n 0x013e: 0xf4,\n // ô\n 0x013f: 0xfb,\n // û\n 0x0220: 0xc1,\n // Á\n 0x0221: 0xc9,\n // É\n 0x0222: 0xd3,\n // Ó\n 0x0223: 0xda,\n // Ú\n 0x0224: 0xdc,\n // Ü\n 0x0225: 0xfc,\n // ü\n 0x0226: 0x2018,\n // ‘\n 0x0227: 0xa1,\n // ¡\n 0x0228: 0x2a,\n // *\n 0x0229: 0x27,\n // '\n 0x022a: 0x2014,\n // —\n 0x022b: 0xa9,\n // ©\n 0x022c: 0x2120,\n // ℠\n 0x022d: 0x2022,\n // •\n 0x022e: 0x201c,\n // “\n 0x022f: 0x201d,\n // ”\n 0x0230: 0xc0,\n // À\n 0x0231: 0xc2,\n // Â\n 0x0232: 0xc7,\n // Ç\n 0x0233: 0xc8,\n // È\n 0x0234: 0xca,\n // Ê\n 0x0235: 0xcb,\n // Ë\n 0x0236: 0xeb,\n // ë\n 0x0237: 0xce,\n // Î\n 0x0238: 0xcf,\n // Ï\n 0x0239: 0xef,\n // ï\n 0x023a: 0xd4,\n // Ô\n 0x023b: 0xd9,\n // Ù\n 0x023c: 0xf9,\n // ù\n 0x023d: 0xdb,\n // Û\n 0x023e: 0xab,\n // «\n 0x023f: 0xbb,\n // »\n 0x0320: 0xc3,\n // Ã\n 0x0321: 0xe3,\n // ã\n 0x0322: 0xcd,\n // Í\n 0x0323: 0xcc,\n // Ì\n 0x0324: 0xec,\n // ì\n 0x0325: 0xd2,\n // Ò\n 0x0326: 0xf2,\n // ò\n 0x0327: 0xd5,\n // Õ\n 0x0328: 0xf5,\n // õ\n 0x0329: 0x7b,\n // {\n 0x032a: 0x7d,\n // }\n 0x032b: 0x5c,\n // \\\n 0x032c: 0x5e,\n // ^\n 0x032d: 0x5f,\n // _\n 0x032e: 0x7c,\n // |\n 0x032f: 0x7e,\n // ~\n 0x0330: 0xc4,\n // Ä\n 0x0331: 0xe4,\n // ä\n 0x0332: 0xd6,\n // Ö\n 0x0333: 0xf6,\n // ö\n 0x0334: 0xdf,\n // ß\n 0x0335: 0xa5,\n // ¥\n 0x0336: 0xa4,\n // ¤\n 0x0337: 0x2502,\n // │\n 0x0338: 0xc5,\n // Å\n 0x0339: 0xe5,\n // å\n 0x033a: 0xd8,\n // Ø\n 0x033b: 0xf8,\n // ø\n 0x033c: 0x250c,\n // ┌\n 0x033d: 0x2510,\n // ┐\n 0x033e: 0x2514,\n // └\n 0x033f: 0x2518 // ┘\n };\n\n var getCharFromCode = function (code) {\n if (code === null) {\n return '';\n }\n code = CHARACTER_TRANSLATION[code] || code;\n return String.fromCharCode(code);\n }; // the index of the last row in a CEA-608 display buffer\n\n var BOTTOM_ROW = 14; // This array is used for mapping PACs -> row #, since there's no way of\n // getting it through bit logic.\n\n var ROWS = [0x1100, 0x1120, 0x1200, 0x1220, 0x1500, 0x1520, 0x1600, 0x1620, 0x1700, 0x1720, 0x1000, 0x1300, 0x1320, 0x1400, 0x1420]; // CEA-608 captions are rendered onto a 34x15 matrix of character\n // cells. The \"bottom\" row is the last element in the outer array.\n // We keep track of positioning information as we go by storing the\n // number of indentations and the tab offset in this buffer.\n\n var createDisplayBuffer = function () {\n var result = [],\n i = BOTTOM_ROW + 1;\n while (i--) {\n result.push({\n text: '',\n indent: 0,\n offset: 0\n });\n }\n return result;\n };\n var Cea608Stream = function (field, dataChannel) {\n Cea608Stream.prototype.init.call(this);\n this.field_ = field || 0;\n this.dataChannel_ = dataChannel || 0;\n this.name_ = 'CC' + ((this.field_ << 1 | this.dataChannel_) + 1);\n this.setConstants();\n this.reset();\n this.push = function (packet) {\n var data, swap, char0, char1, text; // remove the parity bits\n\n data = packet.ccData & 0x7f7f; // ignore duplicate control codes; the spec demands they're sent twice\n\n if (data === this.lastControlCode_) {\n this.lastControlCode_ = null;\n return;\n } // Store control codes\n\n if ((data & 0xf000) === 0x1000) {\n this.lastControlCode_ = data;\n } else if (data !== this.PADDING_) {\n this.lastControlCode_ = null;\n }\n char0 = data >>> 8;\n char1 = data & 0xff;\n if (data === this.PADDING_) {\n return;\n } else if (data === this.RESUME_CAPTION_LOADING_) {\n this.mode_ = 'popOn';\n } else if (data === this.END_OF_CAPTION_) {\n // If an EOC is received while in paint-on mode, the displayed caption\n // text should be swapped to non-displayed memory as if it was a pop-on\n // caption. Because of that, we should explicitly switch back to pop-on\n // mode\n this.mode_ = 'popOn';\n this.clearFormatting(packet.pts); // if a caption was being displayed, it's gone now\n\n this.flushDisplayed(packet.pts); // flip memory\n\n swap = this.displayed_;\n this.displayed_ = this.nonDisplayed_;\n this.nonDisplayed_ = swap; // start measuring the time to display the caption\n\n this.startPts_ = packet.pts;\n } else if (data === this.ROLL_UP_2_ROWS_) {\n this.rollUpRows_ = 2;\n this.setRollUp(packet.pts);\n } else if (data === this.ROLL_UP_3_ROWS_) {\n this.rollUpRows_ = 3;\n this.setRollUp(packet.pts);\n } else if (data === this.ROLL_UP_4_ROWS_) {\n this.rollUpRows_ = 4;\n this.setRollUp(packet.pts);\n } else if (data === this.CARRIAGE_RETURN_) {\n this.clearFormatting(packet.pts);\n this.flushDisplayed(packet.pts);\n this.shiftRowsUp_();\n this.startPts_ = packet.pts;\n } else if (data === this.BACKSPACE_) {\n if (this.mode_ === 'popOn') {\n this.nonDisplayed_[this.row_].text = this.nonDisplayed_[this.row_].text.slice(0, -1);\n } else {\n this.displayed_[this.row_].text = this.displayed_[this.row_].text.slice(0, -1);\n }\n } else if (data === this.ERASE_DISPLAYED_MEMORY_) {\n this.flushDisplayed(packet.pts);\n this.displayed_ = createDisplayBuffer();\n } else if (data === this.ERASE_NON_DISPLAYED_MEMORY_) {\n this.nonDisplayed_ = createDisplayBuffer();\n } else if (data === this.RESUME_DIRECT_CAPTIONING_) {\n if (this.mode_ !== 'paintOn') {\n // NOTE: This should be removed when proper caption positioning is\n // implemented\n this.flushDisplayed(packet.pts);\n this.displayed_ = createDisplayBuffer();\n }\n this.mode_ = 'paintOn';\n this.startPts_ = packet.pts; // Append special characters to caption text\n } else if (this.isSpecialCharacter(char0, char1)) {\n // Bitmask char0 so that we can apply character transformations\n // regardless of field and data channel.\n // Then byte-shift to the left and OR with char1 so we can pass the\n // entire character code to `getCharFromCode`.\n char0 = (char0 & 0x03) << 8;\n text = getCharFromCode(char0 | char1);\n this[this.mode_](packet.pts, text);\n this.column_++; // Append extended characters to caption text\n } else if (this.isExtCharacter(char0, char1)) {\n // Extended characters always follow their \"non-extended\" equivalents.\n // IE if a \"è\" is desired, you'll always receive \"eè\"; non-compliant\n // decoders are supposed to drop the \"è\", while compliant decoders\n // backspace the \"e\" and insert \"è\".\n // Delete the previous character\n if (this.mode_ === 'popOn') {\n this.nonDisplayed_[this.row_].text = this.nonDisplayed_[this.row_].text.slice(0, -1);\n } else {\n this.displayed_[this.row_].text = this.displayed_[this.row_].text.slice(0, -1);\n } // Bitmask char0 so that we can apply character transformations\n // regardless of field and data channel.\n // Then byte-shift to the left and OR with char1 so we can pass the\n // entire character code to `getCharFromCode`.\n\n char0 = (char0 & 0x03) << 8;\n text = getCharFromCode(char0 | char1);\n this[this.mode_](packet.pts, text);\n this.column_++; // Process mid-row codes\n } else if (this.isMidRowCode(char0, char1)) {\n // Attributes are not additive, so clear all formatting\n this.clearFormatting(packet.pts); // According to the standard, mid-row codes\n // should be replaced with spaces, so add one now\n\n this[this.mode_](packet.pts, ' ');\n this.column_++;\n if ((char1 & 0xe) === 0xe) {\n this.addFormatting(packet.pts, ['i']);\n }\n if ((char1 & 0x1) === 0x1) {\n this.addFormatting(packet.pts, ['u']);\n } // Detect offset control codes and adjust cursor\n } else if (this.isOffsetControlCode(char0, char1)) {\n // Cursor position is set by indent PAC (see below) in 4-column\n // increments, with an additional offset code of 1-3 to reach any\n // of the 32 columns specified by CEA-608. So all we need to do\n // here is increment the column cursor by the given offset.\n const offset = char1 & 0x03; // For an offest value 1-3, set the offset for that caption\n // in the non-displayed array.\n\n this.nonDisplayed_[this.row_].offset = offset;\n this.column_ += offset; // Detect PACs (Preamble Address Codes)\n } else if (this.isPAC(char0, char1)) {\n // There's no logic for PAC -> row mapping, so we have to just\n // find the row code in an array and use its index :(\n var row = ROWS.indexOf(data & 0x1f20); // Configure the caption window if we're in roll-up mode\n\n if (this.mode_ === 'rollUp') {\n // This implies that the base row is incorrectly set.\n // As per the recommendation in CEA-608(Base Row Implementation), defer to the number\n // of roll-up rows set.\n if (row - this.rollUpRows_ + 1 < 0) {\n row = this.rollUpRows_ - 1;\n }\n this.setRollUp(packet.pts, row);\n }\n if (row !== this.row_) {\n // formatting is only persistent for current row\n this.clearFormatting(packet.pts);\n this.row_ = row;\n } // All PACs can apply underline, so detect and apply\n // (All odd-numbered second bytes set underline)\n\n if (char1 & 0x1 && this.formatting_.indexOf('u') === -1) {\n this.addFormatting(packet.pts, ['u']);\n }\n if ((data & 0x10) === 0x10) {\n // We've got an indent level code. Each successive even number\n // increments the column cursor by 4, so we can get the desired\n // column position by bit-shifting to the right (to get n/2)\n // and multiplying by 4.\n const indentations = (data & 0xe) >> 1;\n this.column_ = indentations * 4; // add to the number of indentations for positioning\n\n this.nonDisplayed_[this.row_].indent += indentations;\n }\n if (this.isColorPAC(char1)) {\n // it's a color code, though we only support white, which\n // can be either normal or italicized. white italics can be\n // either 0x4e or 0x6e depending on the row, so we just\n // bitwise-and with 0xe to see if italics should be turned on\n if ((char1 & 0xe) === 0xe) {\n this.addFormatting(packet.pts, ['i']);\n }\n } // We have a normal character in char0, and possibly one in char1\n } else if (this.isNormalChar(char0)) {\n if (char1 === 0x00) {\n char1 = null;\n }\n text = getCharFromCode(char0);\n text += getCharFromCode(char1);\n this[this.mode_](packet.pts, text);\n this.column_ += text.length;\n } // finish data processing\n };\n };\n\n Cea608Stream.prototype = new Stream$7(); // Trigger a cue point that captures the current state of the\n // display buffer\n\n Cea608Stream.prototype.flushDisplayed = function (pts) {\n const logWarning = index => {\n this.trigger('log', {\n level: 'warn',\n message: 'Skipping a malformed 608 caption at index ' + index + '.'\n });\n };\n const content = [];\n this.displayed_.forEach((row, i) => {\n if (row && row.text && row.text.length) {\n try {\n // remove spaces from the start and end of the string\n row.text = row.text.trim();\n } catch (e) {\n // Ordinarily, this shouldn't happen. However, caption\n // parsing errors should not throw exceptions and\n // break playback.\n logWarning(i);\n } // See the below link for more details on the following fields:\n // https://dvcs.w3.org/hg/text-tracks/raw-file/default/608toVTT/608toVTT.html#positioning-in-cea-608\n\n if (row.text.length) {\n content.push({\n // The text to be displayed in the caption from this specific row, with whitespace removed.\n text: row.text,\n // Value between 1 and 15 representing the PAC row used to calculate line height.\n line: i + 1,\n // A number representing the indent position by percentage (CEA-608 PAC indent code).\n // The value will be a number between 10 and 80. Offset is used to add an aditional\n // value to the position if necessary.\n position: 10 + Math.min(70, row.indent * 10) + row.offset * 2.5\n });\n }\n } else if (row === undefined || row === null) {\n logWarning(i);\n }\n });\n if (content.length) {\n this.trigger('data', {\n startPts: this.startPts_,\n endPts: pts,\n content,\n stream: this.name_\n });\n }\n };\n /**\n * Zero out the data, used for startup and on seek\n */\n\n Cea608Stream.prototype.reset = function () {\n this.mode_ = 'popOn'; // When in roll-up mode, the index of the last row that will\n // actually display captions. If a caption is shifted to a row\n // with a lower index than this, it is cleared from the display\n // buffer\n\n this.topRow_ = 0;\n this.startPts_ = 0;\n this.displayed_ = createDisplayBuffer();\n this.nonDisplayed_ = createDisplayBuffer();\n this.lastControlCode_ = null; // Track row and column for proper line-breaking and spacing\n\n this.column_ = 0;\n this.row_ = BOTTOM_ROW;\n this.rollUpRows_ = 2; // This variable holds currently-applied formatting\n\n this.formatting_ = [];\n };\n /**\n * Sets up control code and related constants for this instance\n */\n\n Cea608Stream.prototype.setConstants = function () {\n // The following attributes have these uses:\n // ext_ : char0 for mid-row codes, and the base for extended\n // chars (ext_+0, ext_+1, and ext_+2 are char0s for\n // extended codes)\n // control_: char0 for control codes, except byte-shifted to the\n // left so that we can do this.control_ | CONTROL_CODE\n // offset_: char0 for tab offset codes\n //\n // It's also worth noting that control codes, and _only_ control codes,\n // differ between field 1 and field2. Field 2 control codes are always\n // their field 1 value plus 1. That's why there's the \"| field\" on the\n // control value.\n if (this.dataChannel_ === 0) {\n this.BASE_ = 0x10;\n this.EXT_ = 0x11;\n this.CONTROL_ = (0x14 | this.field_) << 8;\n this.OFFSET_ = 0x17;\n } else if (this.dataChannel_ === 1) {\n this.BASE_ = 0x18;\n this.EXT_ = 0x19;\n this.CONTROL_ = (0x1c | this.field_) << 8;\n this.OFFSET_ = 0x1f;\n } // Constants for the LSByte command codes recognized by Cea608Stream. This\n // list is not exhaustive. For a more comprehensive listing and semantics see\n // http://www.gpo.gov/fdsys/pkg/CFR-2010-title47-vol1/pdf/CFR-2010-title47-vol1-sec15-119.pdf\n // Padding\n\n this.PADDING_ = 0x0000; // Pop-on Mode\n\n this.RESUME_CAPTION_LOADING_ = this.CONTROL_ | 0x20;\n this.END_OF_CAPTION_ = this.CONTROL_ | 0x2f; // Roll-up Mode\n\n this.ROLL_UP_2_ROWS_ = this.CONTROL_ | 0x25;\n this.ROLL_UP_3_ROWS_ = this.CONTROL_ | 0x26;\n this.ROLL_UP_4_ROWS_ = this.CONTROL_ | 0x27;\n this.CARRIAGE_RETURN_ = this.CONTROL_ | 0x2d; // paint-on mode\n\n this.RESUME_DIRECT_CAPTIONING_ = this.CONTROL_ | 0x29; // Erasure\n\n this.BACKSPACE_ = this.CONTROL_ | 0x21;\n this.ERASE_DISPLAYED_MEMORY_ = this.CONTROL_ | 0x2c;\n this.ERASE_NON_DISPLAYED_MEMORY_ = this.CONTROL_ | 0x2e;\n };\n /**\n * Detects if the 2-byte packet data is a special character\n *\n * Special characters have a second byte in the range 0x30 to 0x3f,\n * with the first byte being 0x11 (for data channel 1) or 0x19 (for\n * data channel 2).\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are an special character\n */\n\n Cea608Stream.prototype.isSpecialCharacter = function (char0, char1) {\n return char0 === this.EXT_ && char1 >= 0x30 && char1 <= 0x3f;\n };\n /**\n * Detects if the 2-byte packet data is an extended character\n *\n * Extended characters have a second byte in the range 0x20 to 0x3f,\n * with the first byte being 0x12 or 0x13 (for data channel 1) or\n * 0x1a or 0x1b (for data channel 2).\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are an extended character\n */\n\n Cea608Stream.prototype.isExtCharacter = function (char0, char1) {\n return (char0 === this.EXT_ + 1 || char0 === this.EXT_ + 2) && char1 >= 0x20 && char1 <= 0x3f;\n };\n /**\n * Detects if the 2-byte packet is a mid-row code\n *\n * Mid-row codes have a second byte in the range 0x20 to 0x2f, with\n * the first byte being 0x11 (for data channel 1) or 0x19 (for data\n * channel 2).\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are a mid-row code\n */\n\n Cea608Stream.prototype.isMidRowCode = function (char0, char1) {\n return char0 === this.EXT_ && char1 >= 0x20 && char1 <= 0x2f;\n };\n /**\n * Detects if the 2-byte packet is an offset control code\n *\n * Offset control codes have a second byte in the range 0x21 to 0x23,\n * with the first byte being 0x17 (for data channel 1) or 0x1f (for\n * data channel 2).\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are an offset control code\n */\n\n Cea608Stream.prototype.isOffsetControlCode = function (char0, char1) {\n return char0 === this.OFFSET_ && char1 >= 0x21 && char1 <= 0x23;\n };\n /**\n * Detects if the 2-byte packet is a Preamble Address Code\n *\n * PACs have a first byte in the range 0x10 to 0x17 (for data channel 1)\n * or 0x18 to 0x1f (for data channel 2), with the second byte in the\n * range 0x40 to 0x7f.\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are a PAC\n */\n\n Cea608Stream.prototype.isPAC = function (char0, char1) {\n return char0 >= this.BASE_ && char0 < this.BASE_ + 8 && char1 >= 0x40 && char1 <= 0x7f;\n };\n /**\n * Detects if a packet's second byte is in the range of a PAC color code\n *\n * PAC color codes have the second byte be in the range 0x40 to 0x4f, or\n * 0x60 to 0x6f.\n *\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the byte is a color PAC\n */\n\n Cea608Stream.prototype.isColorPAC = function (char1) {\n return char1 >= 0x40 && char1 <= 0x4f || char1 >= 0x60 && char1 <= 0x7f;\n };\n /**\n * Detects if a single byte is in the range of a normal character\n *\n * Normal text bytes are in the range 0x20 to 0x7f.\n *\n * @param {Integer} char The byte\n * @return {Boolean} Whether the byte is a normal character\n */\n\n Cea608Stream.prototype.isNormalChar = function (char) {\n return char >= 0x20 && char <= 0x7f;\n };\n /**\n * Configures roll-up\n *\n * @param {Integer} pts Current PTS\n * @param {Integer} newBaseRow Used by PACs to slide the current window to\n * a new position\n */\n\n Cea608Stream.prototype.setRollUp = function (pts, newBaseRow) {\n // Reset the base row to the bottom row when switching modes\n if (this.mode_ !== 'rollUp') {\n this.row_ = BOTTOM_ROW;\n this.mode_ = 'rollUp'; // Spec says to wipe memories when switching to roll-up\n\n this.flushDisplayed(pts);\n this.nonDisplayed_ = createDisplayBuffer();\n this.displayed_ = createDisplayBuffer();\n }\n if (newBaseRow !== undefined && newBaseRow !== this.row_) {\n // move currently displayed captions (up or down) to the new base row\n for (var i = 0; i < this.rollUpRows_; i++) {\n this.displayed_[newBaseRow - i] = this.displayed_[this.row_ - i];\n this.displayed_[this.row_ - i] = {\n text: '',\n indent: 0,\n offset: 0\n };\n }\n }\n if (newBaseRow === undefined) {\n newBaseRow = this.row_;\n }\n this.topRow_ = newBaseRow - this.rollUpRows_ + 1;\n }; // Adds the opening HTML tag for the passed character to the caption text,\n // and keeps track of it for later closing\n\n Cea608Stream.prototype.addFormatting = function (pts, format) {\n this.formatting_ = this.formatting_.concat(format);\n var text = format.reduce(function (text, format) {\n return text + '<' + format + '>';\n }, '');\n this[this.mode_](pts, text);\n }; // Adds HTML closing tags for current formatting to caption text and\n // clears remembered formatting\n\n Cea608Stream.prototype.clearFormatting = function (pts) {\n if (!this.formatting_.length) {\n return;\n }\n var text = this.formatting_.reverse().reduce(function (text, format) {\n return text + '</' + format + '>';\n }, '');\n this.formatting_ = [];\n this[this.mode_](pts, text);\n }; // Mode Implementations\n\n Cea608Stream.prototype.popOn = function (pts, text) {\n var baseRow = this.nonDisplayed_[this.row_].text; // buffer characters\n\n baseRow += text;\n this.nonDisplayed_[this.row_].text = baseRow;\n };\n Cea608Stream.prototype.rollUp = function (pts, text) {\n var baseRow = this.displayed_[this.row_].text;\n baseRow += text;\n this.displayed_[this.row_].text = baseRow;\n };\n Cea608Stream.prototype.shiftRowsUp_ = function () {\n var i; // clear out inactive rows\n\n for (i = 0; i < this.topRow_; i++) {\n this.displayed_[i] = {\n text: '',\n indent: 0,\n offset: 0\n };\n }\n for (i = this.row_ + 1; i < BOTTOM_ROW + 1; i++) {\n this.displayed_[i] = {\n text: '',\n indent: 0,\n offset: 0\n };\n } // shift displayed rows up\n\n for (i = this.topRow_; i < this.row_; i++) {\n this.displayed_[i] = this.displayed_[i + 1];\n } // clear out the bottom row\n\n this.displayed_[this.row_] = {\n text: '',\n indent: 0,\n offset: 0\n };\n };\n Cea608Stream.prototype.paintOn = function (pts, text) {\n var baseRow = this.displayed_[this.row_].text;\n baseRow += text;\n this.displayed_[this.row_].text = baseRow;\n }; // exports\n\n var captionStream = {\n CaptionStream: CaptionStream$2,\n Cea608Stream: Cea608Stream,\n Cea708Stream: Cea708Stream\n };\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n */\n\n var streamTypes = {\n H264_STREAM_TYPE: 0x1B,\n ADTS_STREAM_TYPE: 0x0F,\n METADATA_STREAM_TYPE: 0x15\n };\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n *\n * Accepts program elementary stream (PES) data events and corrects\n * decode and presentation time stamps to account for a rollover\n * of the 33 bit value.\n */\n\n var Stream$6 = stream;\n var MAX_TS = 8589934592;\n var RO_THRESH = 4294967296;\n var TYPE_SHARED = 'shared';\n var handleRollover$1 = function (value, reference) {\n var direction = 1;\n if (value > reference) {\n // If the current timestamp value is greater than our reference timestamp and we detect a\n // timestamp rollover, this means the roll over is happening in the opposite direction.\n // Example scenario: Enter a long stream/video just after a rollover occurred. The reference\n // point will be set to a small number, e.g. 1. The user then seeks backwards over the\n // rollover point. In loading this segment, the timestamp values will be very large,\n // e.g. 2^33 - 1. Since this comes before the data we loaded previously, we want to adjust\n // the time stamp to be `value - 2^33`.\n direction = -1;\n } // Note: A seek forwards or back that is greater than the RO_THRESH (2^32, ~13 hours) will\n // cause an incorrect adjustment.\n\n while (Math.abs(reference - value) > RO_THRESH) {\n value += direction * MAX_TS;\n }\n return value;\n };\n var TimestampRolloverStream$1 = function (type) {\n var lastDTS, referenceDTS;\n TimestampRolloverStream$1.prototype.init.call(this); // The \"shared\" type is used in cases where a stream will contain muxed\n // video and audio. We could use `undefined` here, but having a string\n // makes debugging a little clearer.\n\n this.type_ = type || TYPE_SHARED;\n this.push = function (data) {\n // Any \"shared\" rollover streams will accept _all_ data. Otherwise,\n // streams will only accept data that matches their type.\n if (this.type_ !== TYPE_SHARED && data.type !== this.type_) {\n return;\n }\n if (referenceDTS === undefined) {\n referenceDTS = data.dts;\n }\n data.dts = handleRollover$1(data.dts, referenceDTS);\n data.pts = handleRollover$1(data.pts, referenceDTS);\n lastDTS = data.dts;\n this.trigger('data', data);\n };\n this.flush = function () {\n referenceDTS = lastDTS;\n this.trigger('done');\n };\n this.endTimeline = function () {\n this.flush();\n this.trigger('endedtimeline');\n };\n this.discontinuity = function () {\n referenceDTS = void 0;\n lastDTS = void 0;\n };\n this.reset = function () {\n this.discontinuity();\n this.trigger('reset');\n };\n };\n TimestampRolloverStream$1.prototype = new Stream$6();\n var timestampRolloverStream = {\n TimestampRolloverStream: TimestampRolloverStream$1,\n handleRollover: handleRollover$1\n }; // Once IE11 support is dropped, this function should be removed.\n\n var typedArrayIndexOf$1 = (typedArray, element, fromIndex) => {\n if (!typedArray) {\n return -1;\n }\n var currentIndex = fromIndex;\n for (; currentIndex < typedArray.length; currentIndex++) {\n if (typedArray[currentIndex] === element) {\n return currentIndex;\n }\n }\n return -1;\n };\n var typedArray = {\n typedArrayIndexOf: typedArrayIndexOf$1\n };\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n *\n * Tools for parsing ID3 frame data\n * @see http://id3.org/id3v2.3.0\n */\n\n var typedArrayIndexOf = typedArray.typedArrayIndexOf,\n // Frames that allow different types of text encoding contain a text\n // encoding description byte [ID3v2.4.0 section 4.]\n textEncodingDescriptionByte = {\n Iso88591: 0x00,\n // ISO-8859-1, terminated with \\0.\n Utf16: 0x01,\n // UTF-16 encoded Unicode BOM, terminated with \\0\\0\n Utf16be: 0x02,\n // UTF-16BE encoded Unicode, without BOM, terminated with \\0\\0\n Utf8: 0x03 // UTF-8 encoded Unicode, terminated with \\0\n },\n // return a percent-encoded representation of the specified byte range\n // @see http://en.wikipedia.org/wiki/Percent-encoding \n percentEncode$1 = function (bytes, start, end) {\n var i,\n result = '';\n for (i = start; i < end; i++) {\n result += '%' + ('00' + bytes[i].toString(16)).slice(-2);\n }\n return result;\n },\n // return the string representation of the specified byte range,\n // interpreted as UTf-8.\n parseUtf8 = function (bytes, start, end) {\n return decodeURIComponent(percentEncode$1(bytes, start, end));\n },\n // return the string representation of the specified byte range,\n // interpreted as ISO-8859-1.\n parseIso88591$1 = function (bytes, start, end) {\n return unescape(percentEncode$1(bytes, start, end)); // jshint ignore:line\n },\n parseSyncSafeInteger$1 = function (data) {\n return data[0] << 21 | data[1] << 14 | data[2] << 7 | data[3];\n },\n frameParsers = {\n 'APIC': function (frame) {\n var i = 1,\n mimeTypeEndIndex,\n descriptionEndIndex,\n LINK_MIME_TYPE = '-->';\n if (frame.data[0] !== textEncodingDescriptionByte.Utf8) {\n // ignore frames with unrecognized character encodings\n return;\n } // parsing fields [ID3v2.4.0 section 4.14.]\n\n mimeTypeEndIndex = typedArrayIndexOf(frame.data, 0, i);\n if (mimeTypeEndIndex < 0) {\n // malformed frame\n return;\n } // parsing Mime type field (terminated with \\0)\n\n frame.mimeType = parseIso88591$1(frame.data, i, mimeTypeEndIndex);\n i = mimeTypeEndIndex + 1; // parsing 1-byte Picture Type field\n\n frame.pictureType = frame.data[i];\n i++;\n descriptionEndIndex = typedArrayIndexOf(frame.data, 0, i);\n if (descriptionEndIndex < 0) {\n // malformed frame\n return;\n } // parsing Description field (terminated with \\0)\n\n frame.description = parseUtf8(frame.data, i, descriptionEndIndex);\n i = descriptionEndIndex + 1;\n if (frame.mimeType === LINK_MIME_TYPE) {\n // parsing Picture Data field as URL (always represented as ISO-8859-1 [ID3v2.4.0 section 4.])\n frame.url = parseIso88591$1(frame.data, i, frame.data.length);\n } else {\n // parsing Picture Data field as binary data\n frame.pictureData = frame.data.subarray(i, frame.data.length);\n }\n },\n 'T*': function (frame) {\n if (frame.data[0] !== textEncodingDescriptionByte.Utf8) {\n // ignore frames with unrecognized character encodings\n return;\n } // parse text field, do not include null terminator in the frame value\n // frames that allow different types of encoding contain terminated text [ID3v2.4.0 section 4.]\n\n frame.value = parseUtf8(frame.data, 1, frame.data.length).replace(/\\0*$/, ''); // text information frames supports multiple strings, stored as a terminator separated list [ID3v2.4.0 section 4.2.]\n\n frame.values = frame.value.split('\\0');\n },\n 'TXXX': function (frame) {\n var descriptionEndIndex;\n if (frame.data[0] !== textEncodingDescriptionByte.Utf8) {\n // ignore frames with unrecognized character encodings\n return;\n }\n descriptionEndIndex = typedArrayIndexOf(frame.data, 0, 1);\n if (descriptionEndIndex === -1) {\n return;\n } // parse the text fields\n\n frame.description = parseUtf8(frame.data, 1, descriptionEndIndex); // do not include the null terminator in the tag value\n // frames that allow different types of encoding contain terminated text\n // [ID3v2.4.0 section 4.]\n\n frame.value = parseUtf8(frame.data, descriptionEndIndex + 1, frame.data.length).replace(/\\0*$/, '');\n frame.data = frame.value;\n },\n 'W*': function (frame) {\n // parse URL field; URL fields are always represented as ISO-8859-1 [ID3v2.4.0 section 4.]\n // if the value is followed by a string termination all the following information should be ignored [ID3v2.4.0 section 4.3]\n frame.url = parseIso88591$1(frame.data, 0, frame.data.length).replace(/\\0.*$/, '');\n },\n 'WXXX': function (frame) {\n var descriptionEndIndex;\n if (frame.data[0] !== textEncodingDescriptionByte.Utf8) {\n // ignore frames with unrecognized character encodings\n return;\n }\n descriptionEndIndex = typedArrayIndexOf(frame.data, 0, 1);\n if (descriptionEndIndex === -1) {\n return;\n } // parse the description and URL fields\n\n frame.description = parseUtf8(frame.data, 1, descriptionEndIndex); // URL fields are always represented as ISO-8859-1 [ID3v2.4.0 section 4.]\n // if the value is followed by a string termination all the following information\n // should be ignored [ID3v2.4.0 section 4.3]\n\n frame.url = parseIso88591$1(frame.data, descriptionEndIndex + 1, frame.data.length).replace(/\\0.*$/, '');\n },\n 'PRIV': function (frame) {\n var i;\n for (i = 0; i < frame.data.length; i++) {\n if (frame.data[i] === 0) {\n // parse the description and URL fields\n frame.owner = parseIso88591$1(frame.data, 0, i);\n break;\n }\n }\n frame.privateData = frame.data.subarray(i + 1);\n frame.data = frame.privateData;\n }\n };\n var parseId3Frames$1 = function (data) {\n var frameSize,\n frameHeader,\n frameStart = 10,\n tagSize = 0,\n frames = []; // If we don't have enough data for a header, 10 bytes, \n // or 'ID3' in the first 3 bytes this is not a valid ID3 tag.\n\n if (data.length < 10 || data[0] !== 'I'.charCodeAt(0) || data[1] !== 'D'.charCodeAt(0) || data[2] !== '3'.charCodeAt(0)) {\n return;\n } // the frame size is transmitted as a 28-bit integer in the\n // last four bytes of the ID3 header.\n // The most significant bit of each byte is dropped and the\n // results concatenated to recover the actual value.\n\n tagSize = parseSyncSafeInteger$1(data.subarray(6, 10)); // ID3 reports the tag size excluding the header but it's more\n // convenient for our comparisons to include it\n\n tagSize += 10; // check bit 6 of byte 5 for the extended header flag.\n\n var hasExtendedHeader = data[5] & 0x40;\n if (hasExtendedHeader) {\n // advance the frame start past the extended header\n frameStart += 4; // header size field\n\n frameStart += parseSyncSafeInteger$1(data.subarray(10, 14));\n tagSize -= parseSyncSafeInteger$1(data.subarray(16, 20)); // clip any padding off the end\n } // parse one or more ID3 frames\n // http://id3.org/id3v2.3.0#ID3v2_frame_overview\n\n do {\n // determine the number of bytes in this frame\n frameSize = parseSyncSafeInteger$1(data.subarray(frameStart + 4, frameStart + 8));\n if (frameSize < 1) {\n break;\n }\n frameHeader = String.fromCharCode(data[frameStart], data[frameStart + 1], data[frameStart + 2], data[frameStart + 3]);\n var frame = {\n id: frameHeader,\n data: data.subarray(frameStart + 10, frameStart + frameSize + 10)\n };\n frame.key = frame.id; // parse frame values\n\n if (frameParsers[frame.id]) {\n // use frame specific parser\n frameParsers[frame.id](frame);\n } else if (frame.id[0] === 'T') {\n // use text frame generic parser\n frameParsers['T*'](frame);\n } else if (frame.id[0] === 'W') {\n // use URL link frame generic parser\n frameParsers['W*'](frame);\n }\n frames.push(frame);\n frameStart += 10; // advance past the frame header\n\n frameStart += frameSize; // advance past the frame body\n } while (frameStart < tagSize);\n return frames;\n };\n var parseId3 = {\n parseId3Frames: parseId3Frames$1,\n parseSyncSafeInteger: parseSyncSafeInteger$1,\n frameParsers: frameParsers\n };\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n *\n * Accepts program elementary stream (PES) data events and parses out\n * ID3 metadata from them, if present.\n * @see http://id3.org/id3v2.3.0\n */\n\n var Stream$5 = stream,\n StreamTypes$3 = streamTypes,\n id3 = parseId3,\n MetadataStream;\n MetadataStream = function (options) {\n var settings = {\n // the bytes of the program-level descriptor field in MP2T\n // see ISO/IEC 13818-1:2013 (E), section 2.6 \"Program and\n // program element descriptors\"\n descriptor: options && options.descriptor\n },\n // the total size in bytes of the ID3 tag being parsed\n tagSize = 0,\n // tag data that is not complete enough to be parsed\n buffer = [],\n // the total number of bytes currently in the buffer\n bufferSize = 0,\n i;\n MetadataStream.prototype.init.call(this); // calculate the text track in-band metadata track dispatch type\n // https://html.spec.whatwg.org/multipage/embedded-content.html#steps-to-expose-a-media-resource-specific-text-track\n\n this.dispatchType = StreamTypes$3.METADATA_STREAM_TYPE.toString(16);\n if (settings.descriptor) {\n for (i = 0; i < settings.descriptor.length; i++) {\n this.dispatchType += ('00' + settings.descriptor[i].toString(16)).slice(-2);\n }\n }\n this.push = function (chunk) {\n var tag, frameStart, frameSize, frame, i, frameHeader;\n if (chunk.type !== 'timed-metadata') {\n return;\n } // if data_alignment_indicator is set in the PES header,\n // we must have the start of a new ID3 tag. Assume anything\n // remaining in the buffer was malformed and throw it out\n\n if (chunk.dataAlignmentIndicator) {\n bufferSize = 0;\n buffer.length = 0;\n } // ignore events that don't look like ID3 data\n\n if (buffer.length === 0 && (chunk.data.length < 10 || chunk.data[0] !== 'I'.charCodeAt(0) || chunk.data[1] !== 'D'.charCodeAt(0) || chunk.data[2] !== '3'.charCodeAt(0))) {\n this.trigger('log', {\n level: 'warn',\n message: 'Skipping unrecognized metadata packet'\n });\n return;\n } // add this chunk to the data we've collected so far\n\n buffer.push(chunk);\n bufferSize += chunk.data.byteLength; // grab the size of the entire frame from the ID3 header\n\n if (buffer.length === 1) {\n // the frame size is transmitted as a 28-bit integer in the\n // last four bytes of the ID3 header.\n // The most significant bit of each byte is dropped and the\n // results concatenated to recover the actual value.\n tagSize = id3.parseSyncSafeInteger(chunk.data.subarray(6, 10)); // ID3 reports the tag size excluding the header but it's more\n // convenient for our comparisons to include it\n\n tagSize += 10;\n } // if the entire frame has not arrived, wait for more data\n\n if (bufferSize < tagSize) {\n return;\n } // collect the entire frame so it can be parsed\n\n tag = {\n data: new Uint8Array(tagSize),\n frames: [],\n pts: buffer[0].pts,\n dts: buffer[0].dts\n };\n for (i = 0; i < tagSize;) {\n tag.data.set(buffer[0].data.subarray(0, tagSize - i), i);\n i += buffer[0].data.byteLength;\n bufferSize -= buffer[0].data.byteLength;\n buffer.shift();\n } // find the start of the first frame and the end of the tag\n\n frameStart = 10;\n if (tag.data[5] & 0x40) {\n // advance the frame start past the extended header\n frameStart += 4; // header size field\n\n frameStart += id3.parseSyncSafeInteger(tag.data.subarray(10, 14)); // clip any padding off the end\n\n tagSize -= id3.parseSyncSafeInteger(tag.data.subarray(16, 20));\n } // parse one or more ID3 frames\n // http://id3.org/id3v2.3.0#ID3v2_frame_overview\n\n do {\n // determine the number of bytes in this frame\n frameSize = id3.parseSyncSafeInteger(tag.data.subarray(frameStart + 4, frameStart + 8));\n if (frameSize < 1) {\n this.trigger('log', {\n level: 'warn',\n message: 'Malformed ID3 frame encountered. Skipping remaining metadata parsing.'\n }); // If the frame is malformed, don't parse any further frames but allow previous valid parsed frames\n // to be sent along.\n\n break;\n }\n frameHeader = String.fromCharCode(tag.data[frameStart], tag.data[frameStart + 1], tag.data[frameStart + 2], tag.data[frameStart + 3]);\n frame = {\n id: frameHeader,\n data: tag.data.subarray(frameStart + 10, frameStart + frameSize + 10)\n };\n frame.key = frame.id; // parse frame values\n\n if (id3.frameParsers[frame.id]) {\n // use frame specific parser\n id3.frameParsers[frame.id](frame);\n } else if (frame.id[0] === 'T') {\n // use text frame generic parser\n id3.frameParsers['T*'](frame);\n } else if (frame.id[0] === 'W') {\n // use URL link frame generic parser\n id3.frameParsers['W*'](frame);\n } // handle the special PRIV frame used to indicate the start\n // time for raw AAC data\n\n if (frame.owner === 'com.apple.streaming.transportStreamTimestamp') {\n var d = frame.data,\n size = (d[3] & 0x01) << 30 | d[4] << 22 | d[5] << 14 | d[6] << 6 | d[7] >>> 2;\n size *= 4;\n size += d[7] & 0x03;\n frame.timeStamp = size; // in raw AAC, all subsequent data will be timestamped based\n // on the value of this frame\n // we couldn't have known the appropriate pts and dts before\n // parsing this ID3 tag so set those values now\n\n if (tag.pts === undefined && tag.dts === undefined) {\n tag.pts = frame.timeStamp;\n tag.dts = frame.timeStamp;\n }\n this.trigger('timestamp', frame);\n }\n tag.frames.push(frame);\n frameStart += 10; // advance past the frame header\n\n frameStart += frameSize; // advance past the frame body\n } while (frameStart < tagSize);\n this.trigger('data', tag);\n };\n };\n MetadataStream.prototype = new Stream$5();\n var metadataStream = MetadataStream;\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n *\n * A stream-based mp2t to mp4 converter. This utility can be used to\n * deliver mp4s to a SourceBuffer on platforms that support native\n * Media Source Extensions.\n */\n\n var Stream$4 = stream,\n CaptionStream$1 = captionStream,\n StreamTypes$2 = streamTypes,\n TimestampRolloverStream = timestampRolloverStream.TimestampRolloverStream; // object types\n\n var TransportPacketStream, TransportParseStream, ElementaryStream; // constants\n\n var MP2T_PACKET_LENGTH$1 = 188,\n // bytes\n SYNC_BYTE$1 = 0x47;\n /**\n * Splits an incoming stream of binary data into MPEG-2 Transport\n * Stream packets.\n */\n\n TransportPacketStream = function () {\n var buffer = new Uint8Array(MP2T_PACKET_LENGTH$1),\n bytesInBuffer = 0;\n TransportPacketStream.prototype.init.call(this); // Deliver new bytes to the stream.\n\n /**\n * Split a stream of data into M2TS packets\n **/\n\n this.push = function (bytes) {\n var startIndex = 0,\n endIndex = MP2T_PACKET_LENGTH$1,\n everything; // If there are bytes remaining from the last segment, prepend them to the\n // bytes that were pushed in\n\n if (bytesInBuffer) {\n everything = new Uint8Array(bytes.byteLength + bytesInBuffer);\n everything.set(buffer.subarray(0, bytesInBuffer));\n everything.set(bytes, bytesInBuffer);\n bytesInBuffer = 0;\n } else {\n everything = bytes;\n } // While we have enough data for a packet\n\n while (endIndex < everything.byteLength) {\n // Look for a pair of start and end sync bytes in the data..\n if (everything[startIndex] === SYNC_BYTE$1 && everything[endIndex] === SYNC_BYTE$1) {\n // We found a packet so emit it and jump one whole packet forward in\n // the stream\n this.trigger('data', everything.subarray(startIndex, endIndex));\n startIndex += MP2T_PACKET_LENGTH$1;\n endIndex += MP2T_PACKET_LENGTH$1;\n continue;\n } // If we get here, we have somehow become de-synchronized and we need to step\n // forward one byte at a time until we find a pair of sync bytes that denote\n // a packet\n\n startIndex++;\n endIndex++;\n } // If there was some data left over at the end of the segment that couldn't\n // possibly be a whole packet, keep it because it might be the start of a packet\n // that continues in the next segment\n\n if (startIndex < everything.byteLength) {\n buffer.set(everything.subarray(startIndex), 0);\n bytesInBuffer = everything.byteLength - startIndex;\n }\n };\n /**\n * Passes identified M2TS packets to the TransportParseStream to be parsed\n **/\n\n this.flush = function () {\n // If the buffer contains a whole packet when we are being flushed, emit it\n // and empty the buffer. Otherwise hold onto the data because it may be\n // important for decoding the next segment\n if (bytesInBuffer === MP2T_PACKET_LENGTH$1 && buffer[0] === SYNC_BYTE$1) {\n this.trigger('data', buffer);\n bytesInBuffer = 0;\n }\n this.trigger('done');\n };\n this.endTimeline = function () {\n this.flush();\n this.trigger('endedtimeline');\n };\n this.reset = function () {\n bytesInBuffer = 0;\n this.trigger('reset');\n };\n };\n TransportPacketStream.prototype = new Stream$4();\n /**\n * Accepts an MP2T TransportPacketStream and emits data events with parsed\n * forms of the individual transport stream packets.\n */\n\n TransportParseStream = function () {\n var parsePsi, parsePat, parsePmt, self;\n TransportParseStream.prototype.init.call(this);\n self = this;\n this.packetsWaitingForPmt = [];\n this.programMapTable = undefined;\n parsePsi = function (payload, psi) {\n var offset = 0; // PSI packets may be split into multiple sections and those\n // sections may be split into multiple packets. If a PSI\n // section starts in this packet, the payload_unit_start_indicator\n // will be true and the first byte of the payload will indicate\n // the offset from the current position to the start of the\n // section.\n\n if (psi.payloadUnitStartIndicator) {\n offset += payload[offset] + 1;\n }\n if (psi.type === 'pat') {\n parsePat(payload.subarray(offset), psi);\n } else {\n parsePmt(payload.subarray(offset), psi);\n }\n };\n parsePat = function (payload, pat) {\n pat.section_number = payload[7]; // eslint-disable-line camelcase\n\n pat.last_section_number = payload[8]; // eslint-disable-line camelcase\n // skip the PSI header and parse the first PMT entry\n\n self.pmtPid = (payload[10] & 0x1F) << 8 | payload[11];\n pat.pmtPid = self.pmtPid;\n };\n /**\n * Parse out the relevant fields of a Program Map Table (PMT).\n * @param payload {Uint8Array} the PMT-specific portion of an MP2T\n * packet. The first byte in this array should be the table_id\n * field.\n * @param pmt {object} the object that should be decorated with\n * fields parsed from the PMT.\n */\n\n parsePmt = function (payload, pmt) {\n var sectionLength, tableEnd, programInfoLength, offset; // PMTs can be sent ahead of the time when they should actually\n // take effect. We don't believe this should ever be the case\n // for HLS but we'll ignore \"forward\" PMT declarations if we see\n // them. Future PMT declarations have the current_next_indicator\n // set to zero.\n\n if (!(payload[5] & 0x01)) {\n return;\n } // overwrite any existing program map table\n\n self.programMapTable = {\n video: null,\n audio: null,\n 'timed-metadata': {}\n }; // the mapping table ends at the end of the current section\n\n sectionLength = (payload[1] & 0x0f) << 8 | payload[2];\n tableEnd = 3 + sectionLength - 4; // to determine where the table is, we have to figure out how\n // long the program info descriptors are\n\n programInfoLength = (payload[10] & 0x0f) << 8 | payload[11]; // advance the offset to the first entry in the mapping table\n\n offset = 12 + programInfoLength;\n while (offset < tableEnd) {\n var streamType = payload[offset];\n var pid = (payload[offset + 1] & 0x1F) << 8 | payload[offset + 2]; // only map a single elementary_pid for audio and video stream types\n // TODO: should this be done for metadata too? for now maintain behavior of\n // multiple metadata streams\n\n if (streamType === StreamTypes$2.H264_STREAM_TYPE && self.programMapTable.video === null) {\n self.programMapTable.video = pid;\n } else if (streamType === StreamTypes$2.ADTS_STREAM_TYPE && self.programMapTable.audio === null) {\n self.programMapTable.audio = pid;\n } else if (streamType === StreamTypes$2.METADATA_STREAM_TYPE) {\n // map pid to stream type for metadata streams\n self.programMapTable['timed-metadata'][pid] = streamType;\n } // move to the next table entry\n // skip past the elementary stream descriptors, if present\n\n offset += ((payload[offset + 3] & 0x0F) << 8 | payload[offset + 4]) + 5;\n } // record the map on the packet as well\n\n pmt.programMapTable = self.programMapTable;\n };\n /**\n * Deliver a new MP2T packet to the next stream in the pipeline.\n */\n\n this.push = function (packet) {\n var result = {},\n offset = 4;\n result.payloadUnitStartIndicator = !!(packet[1] & 0x40); // pid is a 13-bit field starting at the last bit of packet[1]\n\n result.pid = packet[1] & 0x1f;\n result.pid <<= 8;\n result.pid |= packet[2]; // if an adaption field is present, its length is specified by the\n // fifth byte of the TS packet header. The adaptation field is\n // used to add stuffing to PES packets that don't fill a complete\n // TS packet, and to specify some forms of timing and control data\n // that we do not currently use.\n\n if ((packet[3] & 0x30) >>> 4 > 0x01) {\n offset += packet[offset] + 1;\n } // parse the rest of the packet based on the type\n\n if (result.pid === 0) {\n result.type = 'pat';\n parsePsi(packet.subarray(offset), result);\n this.trigger('data', result);\n } else if (result.pid === this.pmtPid) {\n result.type = 'pmt';\n parsePsi(packet.subarray(offset), result);\n this.trigger('data', result); // if there are any packets waiting for a PMT to be found, process them now\n\n while (this.packetsWaitingForPmt.length) {\n this.processPes_.apply(this, this.packetsWaitingForPmt.shift());\n }\n } else if (this.programMapTable === undefined) {\n // When we have not seen a PMT yet, defer further processing of\n // PES packets until one has been parsed\n this.packetsWaitingForPmt.push([packet, offset, result]);\n } else {\n this.processPes_(packet, offset, result);\n }\n };\n this.processPes_ = function (packet, offset, result) {\n // set the appropriate stream type\n if (result.pid === this.programMapTable.video) {\n result.streamType = StreamTypes$2.H264_STREAM_TYPE;\n } else if (result.pid === this.programMapTable.audio) {\n result.streamType = StreamTypes$2.ADTS_STREAM_TYPE;\n } else {\n // if not video or audio, it is timed-metadata or unknown\n // if unknown, streamType will be undefined\n result.streamType = this.programMapTable['timed-metadata'][result.pid];\n }\n result.type = 'pes';\n result.data = packet.subarray(offset);\n this.trigger('data', result);\n };\n };\n TransportParseStream.prototype = new Stream$4();\n TransportParseStream.STREAM_TYPES = {\n h264: 0x1b,\n adts: 0x0f\n };\n /**\n * Reconsistutes program elementary stream (PES) packets from parsed\n * transport stream packets. That is, if you pipe an\n * mp2t.TransportParseStream into a mp2t.ElementaryStream, the output\n * events will be events which capture the bytes for individual PES\n * packets plus relevant metadata that has been extracted from the\n * container.\n */\n\n ElementaryStream = function () {\n var self = this,\n segmentHadPmt = false,\n // PES packet fragments\n video = {\n data: [],\n size: 0\n },\n audio = {\n data: [],\n size: 0\n },\n timedMetadata = {\n data: [],\n size: 0\n },\n programMapTable,\n parsePes = function (payload, pes) {\n var ptsDtsFlags;\n const startPrefix = payload[0] << 16 | payload[1] << 8 | payload[2]; // default to an empty array\n\n pes.data = new Uint8Array(); // In certain live streams, the start of a TS fragment has ts packets\n // that are frame data that is continuing from the previous fragment. This\n // is to check that the pes data is the start of a new pes payload\n\n if (startPrefix !== 1) {\n return;\n } // get the packet length, this will be 0 for video\n\n pes.packetLength = 6 + (payload[4] << 8 | payload[5]); // find out if this packets starts a new keyframe\n\n pes.dataAlignmentIndicator = (payload[6] & 0x04) !== 0; // PES packets may be annotated with a PTS value, or a PTS value\n // and a DTS value. Determine what combination of values is\n // available to work with.\n\n ptsDtsFlags = payload[7]; // PTS and DTS are normally stored as a 33-bit number. Javascript\n // performs all bitwise operations on 32-bit integers but javascript\n // supports a much greater range (52-bits) of integer using standard\n // mathematical operations.\n // We construct a 31-bit value using bitwise operators over the 31\n // most significant bits and then multiply by 4 (equal to a left-shift\n // of 2) before we add the final 2 least significant bits of the\n // timestamp (equal to an OR.)\n\n if (ptsDtsFlags & 0xC0) {\n // the PTS and DTS are not written out directly. For information\n // on how they are encoded, see\n // http://dvd.sourceforge.net/dvdinfo/pes-hdr.html\n pes.pts = (payload[9] & 0x0E) << 27 | (payload[10] & 0xFF) << 20 | (payload[11] & 0xFE) << 12 | (payload[12] & 0xFF) << 5 | (payload[13] & 0xFE) >>> 3;\n pes.pts *= 4; // Left shift by 2\n\n pes.pts += (payload[13] & 0x06) >>> 1; // OR by the two LSBs\n\n pes.dts = pes.pts;\n if (ptsDtsFlags & 0x40) {\n pes.dts = (payload[14] & 0x0E) << 27 | (payload[15] & 0xFF) << 20 | (payload[16] & 0xFE) << 12 | (payload[17] & 0xFF) << 5 | (payload[18] & 0xFE) >>> 3;\n pes.dts *= 4; // Left shift by 2\n\n pes.dts += (payload[18] & 0x06) >>> 1; // OR by the two LSBs\n }\n } // the data section starts immediately after the PES header.\n // pes_header_data_length specifies the number of header bytes\n // that follow the last byte of the field.\n\n pes.data = payload.subarray(9 + payload[8]);\n },\n /**\n * Pass completely parsed PES packets to the next stream in the pipeline\n **/\n flushStream = function (stream, type, forceFlush) {\n var packetData = new Uint8Array(stream.size),\n event = {\n type: type\n },\n i = 0,\n offset = 0,\n packetFlushable = false,\n fragment; // do nothing if there is not enough buffered data for a complete\n // PES header\n\n if (!stream.data.length || stream.size < 9) {\n return;\n }\n event.trackId = stream.data[0].pid; // reassemble the packet\n\n for (i = 0; i < stream.data.length; i++) {\n fragment = stream.data[i];\n packetData.set(fragment.data, offset);\n offset += fragment.data.byteLength;\n } // parse assembled packet's PES header\n\n parsePes(packetData, event); // non-video PES packets MUST have a non-zero PES_packet_length\n // check that there is enough stream data to fill the packet\n\n packetFlushable = type === 'video' || event.packetLength <= stream.size; // flush pending packets if the conditions are right\n\n if (forceFlush || packetFlushable) {\n stream.size = 0;\n stream.data.length = 0;\n } // only emit packets that are complete. this is to avoid assembling\n // incomplete PES packets due to poor segmentation\n\n if (packetFlushable) {\n self.trigger('data', event);\n }\n };\n ElementaryStream.prototype.init.call(this);\n /**\n * Identifies M2TS packet types and parses PES packets using metadata\n * parsed from the PMT\n **/\n\n this.push = function (data) {\n ({\n pat: function () {// we have to wait for the PMT to arrive as well before we\n // have any meaningful metadata\n },\n pes: function () {\n var stream, streamType;\n switch (data.streamType) {\n case StreamTypes$2.H264_STREAM_TYPE:\n stream = video;\n streamType = 'video';\n break;\n case StreamTypes$2.ADTS_STREAM_TYPE:\n stream = audio;\n streamType = 'audio';\n break;\n case StreamTypes$2.METADATA_STREAM_TYPE:\n stream = timedMetadata;\n streamType = 'timed-metadata';\n break;\n default:\n // ignore unknown stream types\n return;\n } // if a new packet is starting, we can flush the completed\n // packet\n\n if (data.payloadUnitStartIndicator) {\n flushStream(stream, streamType, true);\n } // buffer this fragment until we are sure we've received the\n // complete payload\n\n stream.data.push(data);\n stream.size += data.data.byteLength;\n },\n pmt: function () {\n var event = {\n type: 'metadata',\n tracks: []\n };\n programMapTable = data.programMapTable; // translate audio and video streams to tracks\n\n if (programMapTable.video !== null) {\n event.tracks.push({\n timelineStartInfo: {\n baseMediaDecodeTime: 0\n },\n id: +programMapTable.video,\n codec: 'avc',\n type: 'video'\n });\n }\n if (programMapTable.audio !== null) {\n event.tracks.push({\n timelineStartInfo: {\n baseMediaDecodeTime: 0\n },\n id: +programMapTable.audio,\n codec: 'adts',\n type: 'audio'\n });\n }\n segmentHadPmt = true;\n self.trigger('data', event);\n }\n })[data.type]();\n };\n this.reset = function () {\n video.size = 0;\n video.data.length = 0;\n audio.size = 0;\n audio.data.length = 0;\n this.trigger('reset');\n };\n /**\n * Flush any remaining input. Video PES packets may be of variable\n * length. Normally, the start of a new video packet can trigger the\n * finalization of the previous packet. That is not possible if no\n * more video is forthcoming, however. In that case, some other\n * mechanism (like the end of the file) has to be employed. When it is\n * clear that no additional data is forthcoming, calling this method\n * will flush the buffered packets.\n */\n\n this.flushStreams_ = function () {\n // !!THIS ORDER IS IMPORTANT!!\n // video first then audio\n flushStream(video, 'video');\n flushStream(audio, 'audio');\n flushStream(timedMetadata, 'timed-metadata');\n };\n this.flush = function () {\n // if on flush we haven't had a pmt emitted\n // and we have a pmt to emit. emit the pmt\n // so that we trigger a trackinfo downstream.\n if (!segmentHadPmt && programMapTable) {\n var pmt = {\n type: 'metadata',\n tracks: []\n }; // translate audio and video streams to tracks\n\n if (programMapTable.video !== null) {\n pmt.tracks.push({\n timelineStartInfo: {\n baseMediaDecodeTime: 0\n },\n id: +programMapTable.video,\n codec: 'avc',\n type: 'video'\n });\n }\n if (programMapTable.audio !== null) {\n pmt.tracks.push({\n timelineStartInfo: {\n baseMediaDecodeTime: 0\n },\n id: +programMapTable.audio,\n codec: 'adts',\n type: 'audio'\n });\n }\n self.trigger('data', pmt);\n }\n segmentHadPmt = false;\n this.flushStreams_();\n this.trigger('done');\n };\n };\n ElementaryStream.prototype = new Stream$4();\n var m2ts$1 = {\n PAT_PID: 0x0000,\n MP2T_PACKET_LENGTH: MP2T_PACKET_LENGTH$1,\n TransportPacketStream: TransportPacketStream,\n TransportParseStream: TransportParseStream,\n ElementaryStream: ElementaryStream,\n TimestampRolloverStream: TimestampRolloverStream,\n CaptionStream: CaptionStream$1.CaptionStream,\n Cea608Stream: CaptionStream$1.Cea608Stream,\n Cea708Stream: CaptionStream$1.Cea708Stream,\n MetadataStream: metadataStream\n };\n for (var type in StreamTypes$2) {\n if (StreamTypes$2.hasOwnProperty(type)) {\n m2ts$1[type] = StreamTypes$2[type];\n }\n }\n var m2ts_1 = m2ts$1;\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n */\n\n var Stream$3 = stream;\n var ONE_SECOND_IN_TS$2 = clock$2.ONE_SECOND_IN_TS;\n var AdtsStream$1;\n var ADTS_SAMPLING_FREQUENCIES$1 = [96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350];\n /*\n * Accepts a ElementaryStream and emits data events with parsed\n * AAC Audio Frames of the individual packets. Input audio in ADTS\n * format is unpacked and re-emitted as AAC frames.\n *\n * @see http://wiki.multimedia.cx/index.php?title=ADTS\n * @see http://wiki.multimedia.cx/?title=Understanding_AAC\n */\n\n AdtsStream$1 = function (handlePartialSegments) {\n var buffer,\n frameNum = 0;\n AdtsStream$1.prototype.init.call(this);\n this.skipWarn_ = function (start, end) {\n this.trigger('log', {\n level: 'warn',\n message: `adts skiping bytes ${start} to ${end} in frame ${frameNum} outside syncword`\n });\n };\n this.push = function (packet) {\n var i = 0,\n frameLength,\n protectionSkipBytes,\n oldBuffer,\n sampleCount,\n adtsFrameDuration;\n if (!handlePartialSegments) {\n frameNum = 0;\n }\n if (packet.type !== 'audio') {\n // ignore non-audio data\n return;\n } // Prepend any data in the buffer to the input data so that we can parse\n // aac frames the cross a PES packet boundary\n\n if (buffer && buffer.length) {\n oldBuffer = buffer;\n buffer = new Uint8Array(oldBuffer.byteLength + packet.data.byteLength);\n buffer.set(oldBuffer);\n buffer.set(packet.data, oldBuffer.byteLength);\n } else {\n buffer = packet.data;\n } // unpack any ADTS frames which have been fully received\n // for details on the ADTS header, see http://wiki.multimedia.cx/index.php?title=ADTS\n\n var skip; // We use i + 7 here because we want to be able to parse the entire header.\n // If we don't have enough bytes to do that, then we definitely won't have a full frame.\n\n while (i + 7 < buffer.length) {\n // Look for the start of an ADTS header..\n if (buffer[i] !== 0xFF || (buffer[i + 1] & 0xF6) !== 0xF0) {\n if (typeof skip !== 'number') {\n skip = i;\n } // If a valid header was not found, jump one forward and attempt to\n // find a valid ADTS header starting at the next byte\n\n i++;\n continue;\n }\n if (typeof skip === 'number') {\n this.skipWarn_(skip, i);\n skip = null;\n } // The protection skip bit tells us if we have 2 bytes of CRC data at the\n // end of the ADTS header\n\n protectionSkipBytes = (~buffer[i + 1] & 0x01) * 2; // Frame length is a 13 bit integer starting 16 bits from the\n // end of the sync sequence\n // NOTE: frame length includes the size of the header\n\n frameLength = (buffer[i + 3] & 0x03) << 11 | buffer[i + 4] << 3 | (buffer[i + 5] & 0xe0) >> 5;\n sampleCount = ((buffer[i + 6] & 0x03) + 1) * 1024;\n adtsFrameDuration = sampleCount * ONE_SECOND_IN_TS$2 / ADTS_SAMPLING_FREQUENCIES$1[(buffer[i + 2] & 0x3c) >>> 2]; // If we don't have enough data to actually finish this ADTS frame,\n // then we have to wait for more data\n\n if (buffer.byteLength - i < frameLength) {\n break;\n } // Otherwise, deliver the complete AAC frame\n\n this.trigger('data', {\n pts: packet.pts + frameNum * adtsFrameDuration,\n dts: packet.dts + frameNum * adtsFrameDuration,\n sampleCount: sampleCount,\n audioobjecttype: (buffer[i + 2] >>> 6 & 0x03) + 1,\n channelcount: (buffer[i + 2] & 1) << 2 | (buffer[i + 3] & 0xc0) >>> 6,\n samplerate: ADTS_SAMPLING_FREQUENCIES$1[(buffer[i + 2] & 0x3c) >>> 2],\n samplingfrequencyindex: (buffer[i + 2] & 0x3c) >>> 2,\n // assume ISO/IEC 14496-12 AudioSampleEntry default of 16\n samplesize: 16,\n // data is the frame without it's header\n data: buffer.subarray(i + 7 + protectionSkipBytes, i + frameLength)\n });\n frameNum++;\n i += frameLength;\n }\n if (typeof skip === 'number') {\n this.skipWarn_(skip, i);\n skip = null;\n } // remove processed bytes from the buffer.\n\n buffer = buffer.subarray(i);\n };\n this.flush = function () {\n frameNum = 0;\n this.trigger('done');\n };\n this.reset = function () {\n buffer = void 0;\n this.trigger('reset');\n };\n this.endTimeline = function () {\n buffer = void 0;\n this.trigger('endedtimeline');\n };\n };\n AdtsStream$1.prototype = new Stream$3();\n var adts = AdtsStream$1;\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n */\n\n var ExpGolomb$1;\n /**\n * Parser for exponential Golomb codes, a variable-bitwidth number encoding\n * scheme used by h264.\n */\n\n ExpGolomb$1 = function (workingData) {\n var\n // the number of bytes left to examine in workingData\n workingBytesAvailable = workingData.byteLength,\n // the current word being examined\n workingWord = 0,\n // :uint\n // the number of bits left to examine in the current word\n workingBitsAvailable = 0; // :uint;\n // ():uint\n\n this.length = function () {\n return 8 * workingBytesAvailable;\n }; // ():uint\n\n this.bitsAvailable = function () {\n return 8 * workingBytesAvailable + workingBitsAvailable;\n }; // ():void\n\n this.loadWord = function () {\n var position = workingData.byteLength - workingBytesAvailable,\n workingBytes = new Uint8Array(4),\n availableBytes = Math.min(4, workingBytesAvailable);\n if (availableBytes === 0) {\n throw new Error('no bytes available');\n }\n workingBytes.set(workingData.subarray(position, position + availableBytes));\n workingWord = new DataView(workingBytes.buffer).getUint32(0); // track the amount of workingData that has been processed\n\n workingBitsAvailable = availableBytes * 8;\n workingBytesAvailable -= availableBytes;\n }; // (count:int):void\n\n this.skipBits = function (count) {\n var skipBytes; // :int\n\n if (workingBitsAvailable > count) {\n workingWord <<= count;\n workingBitsAvailable -= count;\n } else {\n count -= workingBitsAvailable;\n skipBytes = Math.floor(count / 8);\n count -= skipBytes * 8;\n workingBytesAvailable -= skipBytes;\n this.loadWord();\n workingWord <<= count;\n workingBitsAvailable -= count;\n }\n }; // (size:int):uint\n\n this.readBits = function (size) {\n var bits = Math.min(workingBitsAvailable, size),\n // :uint\n valu = workingWord >>> 32 - bits; // :uint\n // if size > 31, handle error\n\n workingBitsAvailable -= bits;\n if (workingBitsAvailable > 0) {\n workingWord <<= bits;\n } else if (workingBytesAvailable > 0) {\n this.loadWord();\n }\n bits = size - bits;\n if (bits > 0) {\n return valu << bits | this.readBits(bits);\n }\n return valu;\n }; // ():uint\n\n this.skipLeadingZeros = function () {\n var leadingZeroCount; // :uint\n\n for (leadingZeroCount = 0; leadingZeroCount < workingBitsAvailable; ++leadingZeroCount) {\n if ((workingWord & 0x80000000 >>> leadingZeroCount) !== 0) {\n // the first bit of working word is 1\n workingWord <<= leadingZeroCount;\n workingBitsAvailable -= leadingZeroCount;\n return leadingZeroCount;\n }\n } // we exhausted workingWord and still have not found a 1\n\n this.loadWord();\n return leadingZeroCount + this.skipLeadingZeros();\n }; // ():void\n\n this.skipUnsignedExpGolomb = function () {\n this.skipBits(1 + this.skipLeadingZeros());\n }; // ():void\n\n this.skipExpGolomb = function () {\n this.skipBits(1 + this.skipLeadingZeros());\n }; // ():uint\n\n this.readUnsignedExpGolomb = function () {\n var clz = this.skipLeadingZeros(); // :uint\n\n return this.readBits(clz + 1) - 1;\n }; // ():int\n\n this.readExpGolomb = function () {\n var valu = this.readUnsignedExpGolomb(); // :int\n\n if (0x01 & valu) {\n // the number is odd if the low order bit is set\n return 1 + valu >>> 1; // add 1 to make it even, and divide by 2\n }\n\n return -1 * (valu >>> 1); // divide by two then make it negative\n }; // Some convenience functions\n // :Boolean\n\n this.readBoolean = function () {\n return this.readBits(1) === 1;\n }; // ():int\n\n this.readUnsignedByte = function () {\n return this.readBits(8);\n };\n this.loadWord();\n };\n var expGolomb = ExpGolomb$1;\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n */\n\n var Stream$2 = stream;\n var ExpGolomb = expGolomb;\n var H264Stream$1, NalByteStream;\n var PROFILES_WITH_OPTIONAL_SPS_DATA;\n /**\n * Accepts a NAL unit byte stream and unpacks the embedded NAL units.\n */\n\n NalByteStream = function () {\n var syncPoint = 0,\n i,\n buffer;\n NalByteStream.prototype.init.call(this);\n /*\n * Scans a byte stream and triggers a data event with the NAL units found.\n * @param {Object} data Event received from H264Stream\n * @param {Uint8Array} data.data The h264 byte stream to be scanned\n *\n * @see H264Stream.push\n */\n\n this.push = function (data) {\n var swapBuffer;\n if (!buffer) {\n buffer = data.data;\n } else {\n swapBuffer = new Uint8Array(buffer.byteLength + data.data.byteLength);\n swapBuffer.set(buffer);\n swapBuffer.set(data.data, buffer.byteLength);\n buffer = swapBuffer;\n }\n var len = buffer.byteLength; // Rec. ITU-T H.264, Annex B\n // scan for NAL unit boundaries\n // a match looks like this:\n // 0 0 1 .. NAL .. 0 0 1\n // ^ sync point ^ i\n // or this:\n // 0 0 1 .. NAL .. 0 0 0\n // ^ sync point ^ i\n // advance the sync point to a NAL start, if necessary\n\n for (; syncPoint < len - 3; syncPoint++) {\n if (buffer[syncPoint + 2] === 1) {\n // the sync point is properly aligned\n i = syncPoint + 5;\n break;\n }\n }\n while (i < len) {\n // look at the current byte to determine if we've hit the end of\n // a NAL unit boundary\n switch (buffer[i]) {\n case 0:\n // skip past non-sync sequences\n if (buffer[i - 1] !== 0) {\n i += 2;\n break;\n } else if (buffer[i - 2] !== 0) {\n i++;\n break;\n } // deliver the NAL unit if it isn't empty\n\n if (syncPoint + 3 !== i - 2) {\n this.trigger('data', buffer.subarray(syncPoint + 3, i - 2));\n } // drop trailing zeroes\n\n do {\n i++;\n } while (buffer[i] !== 1 && i < len);\n syncPoint = i - 2;\n i += 3;\n break;\n case 1:\n // skip past non-sync sequences\n if (buffer[i - 1] !== 0 || buffer[i - 2] !== 0) {\n i += 3;\n break;\n } // deliver the NAL unit\n\n this.trigger('data', buffer.subarray(syncPoint + 3, i - 2));\n syncPoint = i - 2;\n i += 3;\n break;\n default:\n // the current byte isn't a one or zero, so it cannot be part\n // of a sync sequence\n i += 3;\n break;\n }\n } // filter out the NAL units that were delivered\n\n buffer = buffer.subarray(syncPoint);\n i -= syncPoint;\n syncPoint = 0;\n };\n this.reset = function () {\n buffer = null;\n syncPoint = 0;\n this.trigger('reset');\n };\n this.flush = function () {\n // deliver the last buffered NAL unit\n if (buffer && buffer.byteLength > 3) {\n this.trigger('data', buffer.subarray(syncPoint + 3));\n } // reset the stream state\n\n buffer = null;\n syncPoint = 0;\n this.trigger('done');\n };\n this.endTimeline = function () {\n this.flush();\n this.trigger('endedtimeline');\n };\n };\n NalByteStream.prototype = new Stream$2(); // values of profile_idc that indicate additional fields are included in the SPS\n // see Recommendation ITU-T H.264 (4/2013),\n // 7.3.2.1.1 Sequence parameter set data syntax\n\n PROFILES_WITH_OPTIONAL_SPS_DATA = {\n 100: true,\n 110: true,\n 122: true,\n 244: true,\n 44: true,\n 83: true,\n 86: true,\n 118: true,\n 128: true,\n // TODO: the three profiles below don't\n // appear to have sps data in the specificiation anymore?\n 138: true,\n 139: true,\n 134: true\n };\n /**\n * Accepts input from a ElementaryStream and produces H.264 NAL unit data\n * events.\n */\n\n H264Stream$1 = function () {\n var nalByteStream = new NalByteStream(),\n self,\n trackId,\n currentPts,\n currentDts,\n discardEmulationPreventionBytes,\n readSequenceParameterSet,\n skipScalingList;\n H264Stream$1.prototype.init.call(this);\n self = this;\n /*\n * Pushes a packet from a stream onto the NalByteStream\n *\n * @param {Object} packet - A packet received from a stream\n * @param {Uint8Array} packet.data - The raw bytes of the packet\n * @param {Number} packet.dts - Decode timestamp of the packet\n * @param {Number} packet.pts - Presentation timestamp of the packet\n * @param {Number} packet.trackId - The id of the h264 track this packet came from\n * @param {('video'|'audio')} packet.type - The type of packet\n *\n */\n\n this.push = function (packet) {\n if (packet.type !== 'video') {\n return;\n }\n trackId = packet.trackId;\n currentPts = packet.pts;\n currentDts = packet.dts;\n nalByteStream.push(packet);\n };\n /*\n * Identify NAL unit types and pass on the NALU, trackId, presentation and decode timestamps\n * for the NALUs to the next stream component.\n * Also, preprocess caption and sequence parameter NALUs.\n *\n * @param {Uint8Array} data - A NAL unit identified by `NalByteStream.push`\n * @see NalByteStream.push\n */\n\n nalByteStream.on('data', function (data) {\n var event = {\n trackId: trackId,\n pts: currentPts,\n dts: currentDts,\n data: data,\n nalUnitTypeCode: data[0] & 0x1f\n };\n switch (event.nalUnitTypeCode) {\n case 0x05:\n event.nalUnitType = 'slice_layer_without_partitioning_rbsp_idr';\n break;\n case 0x06:\n event.nalUnitType = 'sei_rbsp';\n event.escapedRBSP = discardEmulationPreventionBytes(data.subarray(1));\n break;\n case 0x07:\n event.nalUnitType = 'seq_parameter_set_rbsp';\n event.escapedRBSP = discardEmulationPreventionBytes(data.subarray(1));\n event.config = readSequenceParameterSet(event.escapedRBSP);\n break;\n case 0x08:\n event.nalUnitType = 'pic_parameter_set_rbsp';\n break;\n case 0x09:\n event.nalUnitType = 'access_unit_delimiter_rbsp';\n break;\n } // This triggers data on the H264Stream\n\n self.trigger('data', event);\n });\n nalByteStream.on('done', function () {\n self.trigger('done');\n });\n nalByteStream.on('partialdone', function () {\n self.trigger('partialdone');\n });\n nalByteStream.on('reset', function () {\n self.trigger('reset');\n });\n nalByteStream.on('endedtimeline', function () {\n self.trigger('endedtimeline');\n });\n this.flush = function () {\n nalByteStream.flush();\n };\n this.partialFlush = function () {\n nalByteStream.partialFlush();\n };\n this.reset = function () {\n nalByteStream.reset();\n };\n this.endTimeline = function () {\n nalByteStream.endTimeline();\n };\n /**\n * Advance the ExpGolomb decoder past a scaling list. The scaling\n * list is optionally transmitted as part of a sequence parameter\n * set and is not relevant to transmuxing.\n * @param count {number} the number of entries in this scaling list\n * @param expGolombDecoder {object} an ExpGolomb pointed to the\n * start of a scaling list\n * @see Recommendation ITU-T H.264, Section 7.3.2.1.1.1\n */\n\n skipScalingList = function (count, expGolombDecoder) {\n var lastScale = 8,\n nextScale = 8,\n j,\n deltaScale;\n for (j = 0; j < count; j++) {\n if (nextScale !== 0) {\n deltaScale = expGolombDecoder.readExpGolomb();\n nextScale = (lastScale + deltaScale + 256) % 256;\n }\n lastScale = nextScale === 0 ? lastScale : nextScale;\n }\n };\n /**\n * Expunge any \"Emulation Prevention\" bytes from a \"Raw Byte\n * Sequence Payload\"\n * @param data {Uint8Array} the bytes of a RBSP from a NAL\n * unit\n * @return {Uint8Array} the RBSP without any Emulation\n * Prevention Bytes\n */\n\n discardEmulationPreventionBytes = function (data) {\n var length = data.byteLength,\n emulationPreventionBytesPositions = [],\n i = 1,\n newLength,\n newData; // Find all `Emulation Prevention Bytes`\n\n while (i < length - 2) {\n if (data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0x03) {\n emulationPreventionBytesPositions.push(i + 2);\n i += 2;\n } else {\n i++;\n }\n } // If no Emulation Prevention Bytes were found just return the original\n // array\n\n if (emulationPreventionBytesPositions.length === 0) {\n return data;\n } // Create a new array to hold the NAL unit data\n\n newLength = length - emulationPreventionBytesPositions.length;\n newData = new Uint8Array(newLength);\n var sourceIndex = 0;\n for (i = 0; i < newLength; sourceIndex++, i++) {\n if (sourceIndex === emulationPreventionBytesPositions[0]) {\n // Skip this byte\n sourceIndex++; // Remove this position index\n\n emulationPreventionBytesPositions.shift();\n }\n newData[i] = data[sourceIndex];\n }\n return newData;\n };\n /**\n * Read a sequence parameter set and return some interesting video\n * properties. A sequence parameter set is the H264 metadata that\n * describes the properties of upcoming video frames.\n * @param data {Uint8Array} the bytes of a sequence parameter set\n * @return {object} an object with configuration parsed from the\n * sequence parameter set, including the dimensions of the\n * associated video frames.\n */\n\n readSequenceParameterSet = function (data) {\n var frameCropLeftOffset = 0,\n frameCropRightOffset = 0,\n frameCropTopOffset = 0,\n frameCropBottomOffset = 0,\n expGolombDecoder,\n profileIdc,\n levelIdc,\n profileCompatibility,\n chromaFormatIdc,\n picOrderCntType,\n numRefFramesInPicOrderCntCycle,\n picWidthInMbsMinus1,\n picHeightInMapUnitsMinus1,\n frameMbsOnlyFlag,\n scalingListCount,\n sarRatio = [1, 1],\n aspectRatioIdc,\n i;\n expGolombDecoder = new ExpGolomb(data);\n profileIdc = expGolombDecoder.readUnsignedByte(); // profile_idc\n\n profileCompatibility = expGolombDecoder.readUnsignedByte(); // constraint_set[0-5]_flag\n\n levelIdc = expGolombDecoder.readUnsignedByte(); // level_idc u(8)\n\n expGolombDecoder.skipUnsignedExpGolomb(); // seq_parameter_set_id\n // some profiles have more optional data we don't need\n\n if (PROFILES_WITH_OPTIONAL_SPS_DATA[profileIdc]) {\n chromaFormatIdc = expGolombDecoder.readUnsignedExpGolomb();\n if (chromaFormatIdc === 3) {\n expGolombDecoder.skipBits(1); // separate_colour_plane_flag\n }\n\n expGolombDecoder.skipUnsignedExpGolomb(); // bit_depth_luma_minus8\n\n expGolombDecoder.skipUnsignedExpGolomb(); // bit_depth_chroma_minus8\n\n expGolombDecoder.skipBits(1); // qpprime_y_zero_transform_bypass_flag\n\n if (expGolombDecoder.readBoolean()) {\n // seq_scaling_matrix_present_flag\n scalingListCount = chromaFormatIdc !== 3 ? 8 : 12;\n for (i = 0; i < scalingListCount; i++) {\n if (expGolombDecoder.readBoolean()) {\n // seq_scaling_list_present_flag[ i ]\n if (i < 6) {\n skipScalingList(16, expGolombDecoder);\n } else {\n skipScalingList(64, expGolombDecoder);\n }\n }\n }\n }\n }\n expGolombDecoder.skipUnsignedExpGolomb(); // log2_max_frame_num_minus4\n\n picOrderCntType = expGolombDecoder.readUnsignedExpGolomb();\n if (picOrderCntType === 0) {\n expGolombDecoder.readUnsignedExpGolomb(); // log2_max_pic_order_cnt_lsb_minus4\n } else if (picOrderCntType === 1) {\n expGolombDecoder.skipBits(1); // delta_pic_order_always_zero_flag\n\n expGolombDecoder.skipExpGolomb(); // offset_for_non_ref_pic\n\n expGolombDecoder.skipExpGolomb(); // offset_for_top_to_bottom_field\n\n numRefFramesInPicOrderCntCycle = expGolombDecoder.readUnsignedExpGolomb();\n for (i = 0; i < numRefFramesInPicOrderCntCycle; i++) {\n expGolombDecoder.skipExpGolomb(); // offset_for_ref_frame[ i ]\n }\n }\n\n expGolombDecoder.skipUnsignedExpGolomb(); // max_num_ref_frames\n\n expGolombDecoder.skipBits(1); // gaps_in_frame_num_value_allowed_flag\n\n picWidthInMbsMinus1 = expGolombDecoder.readUnsignedExpGolomb();\n picHeightInMapUnitsMinus1 = expGolombDecoder.readUnsignedExpGolomb();\n frameMbsOnlyFlag = expGolombDecoder.readBits(1);\n if (frameMbsOnlyFlag === 0) {\n expGolombDecoder.skipBits(1); // mb_adaptive_frame_field_flag\n }\n\n expGolombDecoder.skipBits(1); // direct_8x8_inference_flag\n\n if (expGolombDecoder.readBoolean()) {\n // frame_cropping_flag\n frameCropLeftOffset = expGolombDecoder.readUnsignedExpGolomb();\n frameCropRightOffset = expGolombDecoder.readUnsignedExpGolomb();\n frameCropTopOffset = expGolombDecoder.readUnsignedExpGolomb();\n frameCropBottomOffset = expGolombDecoder.readUnsignedExpGolomb();\n }\n if (expGolombDecoder.readBoolean()) {\n // vui_parameters_present_flag\n if (expGolombDecoder.readBoolean()) {\n // aspect_ratio_info_present_flag\n aspectRatioIdc = expGolombDecoder.readUnsignedByte();\n switch (aspectRatioIdc) {\n case 1:\n sarRatio = [1, 1];\n break;\n case 2:\n sarRatio = [12, 11];\n break;\n case 3:\n sarRatio = [10, 11];\n break;\n case 4:\n sarRatio = [16, 11];\n break;\n case 5:\n sarRatio = [40, 33];\n break;\n case 6:\n sarRatio = [24, 11];\n break;\n case 7:\n sarRatio = [20, 11];\n break;\n case 8:\n sarRatio = [32, 11];\n break;\n case 9:\n sarRatio = [80, 33];\n break;\n case 10:\n sarRatio = [18, 11];\n break;\n case 11:\n sarRatio = [15, 11];\n break;\n case 12:\n sarRatio = [64, 33];\n break;\n case 13:\n sarRatio = [160, 99];\n break;\n case 14:\n sarRatio = [4, 3];\n break;\n case 15:\n sarRatio = [3, 2];\n break;\n case 16:\n sarRatio = [2, 1];\n break;\n case 255:\n {\n sarRatio = [expGolombDecoder.readUnsignedByte() << 8 | expGolombDecoder.readUnsignedByte(), expGolombDecoder.readUnsignedByte() << 8 | expGolombDecoder.readUnsignedByte()];\n break;\n }\n }\n if (sarRatio) {\n sarRatio[0] / sarRatio[1];\n }\n }\n }\n return {\n profileIdc: profileIdc,\n levelIdc: levelIdc,\n profileCompatibility: profileCompatibility,\n width: (picWidthInMbsMinus1 + 1) * 16 - frameCropLeftOffset * 2 - frameCropRightOffset * 2,\n height: (2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16 - frameCropTopOffset * 2 - frameCropBottomOffset * 2,\n // sar is sample aspect ratio\n sarRatio: sarRatio\n };\n };\n };\n H264Stream$1.prototype = new Stream$2();\n var h264 = {\n H264Stream: H264Stream$1,\n NalByteStream: NalByteStream\n };\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n *\n * Utilities to detect basic properties and metadata about Aac data.\n */\n\n var ADTS_SAMPLING_FREQUENCIES = [96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350];\n var parseId3TagSize = function (header, byteIndex) {\n var returnSize = header[byteIndex + 6] << 21 | header[byteIndex + 7] << 14 | header[byteIndex + 8] << 7 | header[byteIndex + 9],\n flags = header[byteIndex + 5],\n footerPresent = (flags & 16) >> 4; // if we get a negative returnSize clamp it to 0\n\n returnSize = returnSize >= 0 ? returnSize : 0;\n if (footerPresent) {\n return returnSize + 20;\n }\n return returnSize + 10;\n };\n var getId3Offset = function (data, offset) {\n if (data.length - offset < 10 || data[offset] !== 'I'.charCodeAt(0) || data[offset + 1] !== 'D'.charCodeAt(0) || data[offset + 2] !== '3'.charCodeAt(0)) {\n return offset;\n }\n offset += parseId3TagSize(data, offset);\n return getId3Offset(data, offset);\n }; // TODO: use vhs-utils\n\n var isLikelyAacData$1 = function (data) {\n var offset = getId3Offset(data, 0);\n return data.length >= offset + 2 && (data[offset] & 0xFF) === 0xFF && (data[offset + 1] & 0xF0) === 0xF0 &&\n // verify that the 2 layer bits are 0, aka this\n // is not mp3 data but aac data.\n (data[offset + 1] & 0x16) === 0x10;\n };\n var parseSyncSafeInteger = function (data) {\n return data[0] << 21 | data[1] << 14 | data[2] << 7 | data[3];\n }; // return a percent-encoded representation of the specified byte range\n // @see http://en.wikipedia.org/wiki/Percent-encoding\n\n var percentEncode = function (bytes, start, end) {\n var i,\n result = '';\n for (i = start; i < end; i++) {\n result += '%' + ('00' + bytes[i].toString(16)).slice(-2);\n }\n return result;\n }; // return the string representation of the specified byte range,\n // interpreted as ISO-8859-1.\n\n var parseIso88591 = function (bytes, start, end) {\n return unescape(percentEncode(bytes, start, end)); // jshint ignore:line\n };\n\n var parseAdtsSize = function (header, byteIndex) {\n var lowThree = (header[byteIndex + 5] & 0xE0) >> 5,\n middle = header[byteIndex + 4] << 3,\n highTwo = header[byteIndex + 3] & 0x3 << 11;\n return highTwo | middle | lowThree;\n };\n var parseType$4 = function (header, byteIndex) {\n if (header[byteIndex] === 'I'.charCodeAt(0) && header[byteIndex + 1] === 'D'.charCodeAt(0) && header[byteIndex + 2] === '3'.charCodeAt(0)) {\n return 'timed-metadata';\n } else if (header[byteIndex] & 0xff === 0xff && (header[byteIndex + 1] & 0xf0) === 0xf0) {\n return 'audio';\n }\n return null;\n };\n var parseSampleRate = function (packet) {\n var i = 0;\n while (i + 5 < packet.length) {\n if (packet[i] !== 0xFF || (packet[i + 1] & 0xF6) !== 0xF0) {\n // If a valid header was not found, jump one forward and attempt to\n // find a valid ADTS header starting at the next byte\n i++;\n continue;\n }\n return ADTS_SAMPLING_FREQUENCIES[(packet[i + 2] & 0x3c) >>> 2];\n }\n return null;\n };\n var parseAacTimestamp = function (packet) {\n var frameStart, frameSize, frame, frameHeader; // find the start of the first frame and the end of the tag\n\n frameStart = 10;\n if (packet[5] & 0x40) {\n // advance the frame start past the extended header\n frameStart += 4; // header size field\n\n frameStart += parseSyncSafeInteger(packet.subarray(10, 14));\n } // parse one or more ID3 frames\n // http://id3.org/id3v2.3.0#ID3v2_frame_overview\n\n do {\n // determine the number of bytes in this frame\n frameSize = parseSyncSafeInteger(packet.subarray(frameStart + 4, frameStart + 8));\n if (frameSize < 1) {\n return null;\n }\n frameHeader = String.fromCharCode(packet[frameStart], packet[frameStart + 1], packet[frameStart + 2], packet[frameStart + 3]);\n if (frameHeader === 'PRIV') {\n frame = packet.subarray(frameStart + 10, frameStart + frameSize + 10);\n for (var i = 0; i < frame.byteLength; i++) {\n if (frame[i] === 0) {\n var owner = parseIso88591(frame, 0, i);\n if (owner === 'com.apple.streaming.transportStreamTimestamp') {\n var d = frame.subarray(i + 1);\n var size = (d[3] & 0x01) << 30 | d[4] << 22 | d[5] << 14 | d[6] << 6 | d[7] >>> 2;\n size *= 4;\n size += d[7] & 0x03;\n return size;\n }\n break;\n }\n }\n }\n frameStart += 10; // advance past the frame header\n\n frameStart += frameSize; // advance past the frame body\n } while (frameStart < packet.byteLength);\n return null;\n };\n var utils = {\n isLikelyAacData: isLikelyAacData$1,\n parseId3TagSize: parseId3TagSize,\n parseAdtsSize: parseAdtsSize,\n parseType: parseType$4,\n parseSampleRate: parseSampleRate,\n parseAacTimestamp: parseAacTimestamp\n };\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n *\n * A stream-based aac to mp4 converter. This utility can be used to\n * deliver mp4s to a SourceBuffer on platforms that support native\n * Media Source Extensions.\n */\n\n var Stream$1 = stream;\n var aacUtils = utils; // Constants\n\n var AacStream$1;\n /**\n * Splits an incoming stream of binary data into ADTS and ID3 Frames.\n */\n\n AacStream$1 = function () {\n var everything = new Uint8Array(),\n timeStamp = 0;\n AacStream$1.prototype.init.call(this);\n this.setTimestamp = function (timestamp) {\n timeStamp = timestamp;\n };\n this.push = function (bytes) {\n var frameSize = 0,\n byteIndex = 0,\n bytesLeft,\n chunk,\n packet,\n tempLength; // If there are bytes remaining from the last segment, prepend them to the\n // bytes that were pushed in\n\n if (everything.length) {\n tempLength = everything.length;\n everything = new Uint8Array(bytes.byteLength + tempLength);\n everything.set(everything.subarray(0, tempLength));\n everything.set(bytes, tempLength);\n } else {\n everything = bytes;\n }\n while (everything.length - byteIndex >= 3) {\n if (everything[byteIndex] === 'I'.charCodeAt(0) && everything[byteIndex + 1] === 'D'.charCodeAt(0) && everything[byteIndex + 2] === '3'.charCodeAt(0)) {\n // Exit early because we don't have enough to parse\n // the ID3 tag header\n if (everything.length - byteIndex < 10) {\n break;\n } // check framesize\n\n frameSize = aacUtils.parseId3TagSize(everything, byteIndex); // Exit early if we don't have enough in the buffer\n // to emit a full packet\n // Add to byteIndex to support multiple ID3 tags in sequence\n\n if (byteIndex + frameSize > everything.length) {\n break;\n }\n chunk = {\n type: 'timed-metadata',\n data: everything.subarray(byteIndex, byteIndex + frameSize)\n };\n this.trigger('data', chunk);\n byteIndex += frameSize;\n continue;\n } else if ((everything[byteIndex] & 0xff) === 0xff && (everything[byteIndex + 1] & 0xf0) === 0xf0) {\n // Exit early because we don't have enough to parse\n // the ADTS frame header\n if (everything.length - byteIndex < 7) {\n break;\n }\n frameSize = aacUtils.parseAdtsSize(everything, byteIndex); // Exit early if we don't have enough in the buffer\n // to emit a full packet\n\n if (byteIndex + frameSize > everything.length) {\n break;\n }\n packet = {\n type: 'audio',\n data: everything.subarray(byteIndex, byteIndex + frameSize),\n pts: timeStamp,\n dts: timeStamp\n };\n this.trigger('data', packet);\n byteIndex += frameSize;\n continue;\n }\n byteIndex++;\n }\n bytesLeft = everything.length - byteIndex;\n if (bytesLeft > 0) {\n everything = everything.subarray(byteIndex);\n } else {\n everything = new Uint8Array();\n }\n };\n this.reset = function () {\n everything = new Uint8Array();\n this.trigger('reset');\n };\n this.endTimeline = function () {\n everything = new Uint8Array();\n this.trigger('endedtimeline');\n };\n };\n AacStream$1.prototype = new Stream$1();\n var aac = AacStream$1;\n var AUDIO_PROPERTIES$1 = ['audioobjecttype', 'channelcount', 'samplerate', 'samplingfrequencyindex', 'samplesize'];\n var audioProperties = AUDIO_PROPERTIES$1;\n var VIDEO_PROPERTIES$1 = ['width', 'height', 'profileIdc', 'levelIdc', 'profileCompatibility', 'sarRatio'];\n var videoProperties = VIDEO_PROPERTIES$1;\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n *\n * A stream-based mp2t to mp4 converter. This utility can be used to\n * deliver mp4s to a SourceBuffer on platforms that support native\n * Media Source Extensions.\n */\n\n var Stream = stream;\n var mp4 = mp4Generator;\n var frameUtils = frameUtils$1;\n var audioFrameUtils = audioFrameUtils$1;\n var trackDecodeInfo = trackDecodeInfo$1;\n var m2ts = m2ts_1;\n var clock = clock$2;\n var AdtsStream = adts;\n var H264Stream = h264.H264Stream;\n var AacStream = aac;\n var isLikelyAacData = utils.isLikelyAacData;\n var ONE_SECOND_IN_TS$1 = clock$2.ONE_SECOND_IN_TS;\n var AUDIO_PROPERTIES = audioProperties;\n var VIDEO_PROPERTIES = videoProperties; // object types\n\n var VideoSegmentStream, AudioSegmentStream, Transmuxer, CoalesceStream;\n var retriggerForStream = function (key, event) {\n event.stream = key;\n this.trigger('log', event);\n };\n var addPipelineLogRetriggers = function (transmuxer, pipeline) {\n var keys = Object.keys(pipeline);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i]; // skip non-stream keys and headOfPipeline\n // which is just a duplicate\n\n if (key === 'headOfPipeline' || !pipeline[key].on) {\n continue;\n }\n pipeline[key].on('log', retriggerForStream.bind(transmuxer, key));\n }\n };\n /**\n * Compare two arrays (even typed) for same-ness\n */\n\n var arrayEquals = function (a, b) {\n var i;\n if (a.length !== b.length) {\n return false;\n } // compare the value of each element in the array\n\n for (i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n };\n var generateSegmentTimingInfo = function (baseMediaDecodeTime, startDts, startPts, endDts, endPts, prependedContentDuration) {\n var ptsOffsetFromDts = startPts - startDts,\n decodeDuration = endDts - startDts,\n presentationDuration = endPts - startPts; // The PTS and DTS values are based on the actual stream times from the segment,\n // however, the player time values will reflect a start from the baseMediaDecodeTime.\n // In order to provide relevant values for the player times, base timing info on the\n // baseMediaDecodeTime and the DTS and PTS durations of the segment.\n\n return {\n start: {\n dts: baseMediaDecodeTime,\n pts: baseMediaDecodeTime + ptsOffsetFromDts\n },\n end: {\n dts: baseMediaDecodeTime + decodeDuration,\n pts: baseMediaDecodeTime + presentationDuration\n },\n prependedContentDuration: prependedContentDuration,\n baseMediaDecodeTime: baseMediaDecodeTime\n };\n };\n /**\n * Constructs a single-track, ISO BMFF media segment from AAC data\n * events. The output of this stream can be fed to a SourceBuffer\n * configured with a suitable initialization segment.\n * @param track {object} track metadata configuration\n * @param options {object} transmuxer options object\n * @param options.keepOriginalTimestamps {boolean} If true, keep the timestamps\n * in the source; false to adjust the first segment to start at 0.\n */\n\n AudioSegmentStream = function (track, options) {\n var adtsFrames = [],\n sequenceNumber,\n earliestAllowedDts = 0,\n audioAppendStartTs = 0,\n videoBaseMediaDecodeTime = Infinity;\n options = options || {};\n sequenceNumber = options.firstSequenceNumber || 0;\n AudioSegmentStream.prototype.init.call(this);\n this.push = function (data) {\n trackDecodeInfo.collectDtsInfo(track, data);\n if (track) {\n AUDIO_PROPERTIES.forEach(function (prop) {\n track[prop] = data[prop];\n });\n } // buffer audio data until end() is called\n\n adtsFrames.push(data);\n };\n this.setEarliestDts = function (earliestDts) {\n earliestAllowedDts = earliestDts;\n };\n this.setVideoBaseMediaDecodeTime = function (baseMediaDecodeTime) {\n videoBaseMediaDecodeTime = baseMediaDecodeTime;\n };\n this.setAudioAppendStart = function (timestamp) {\n audioAppendStartTs = timestamp;\n };\n this.flush = function () {\n var frames, moof, mdat, boxes, frameDuration, segmentDuration, videoClockCyclesOfSilencePrefixed; // return early if no audio data has been observed\n\n if (adtsFrames.length === 0) {\n this.trigger('done', 'AudioSegmentStream');\n return;\n }\n frames = audioFrameUtils.trimAdtsFramesByEarliestDts(adtsFrames, track, earliestAllowedDts);\n track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(track, options.keepOriginalTimestamps); // amount of audio filled but the value is in video clock rather than audio clock\n\n videoClockCyclesOfSilencePrefixed = audioFrameUtils.prefixWithSilence(track, frames, audioAppendStartTs, videoBaseMediaDecodeTime); // we have to build the index from byte locations to\n // samples (that is, adts frames) in the audio data\n\n track.samples = audioFrameUtils.generateSampleTable(frames); // concatenate the audio data to constuct the mdat\n\n mdat = mp4.mdat(audioFrameUtils.concatenateFrameData(frames));\n adtsFrames = [];\n moof = mp4.moof(sequenceNumber, [track]);\n boxes = new Uint8Array(moof.byteLength + mdat.byteLength); // bump the sequence number for next time\n\n sequenceNumber++;\n boxes.set(moof);\n boxes.set(mdat, moof.byteLength);\n trackDecodeInfo.clearDtsInfo(track);\n frameDuration = Math.ceil(ONE_SECOND_IN_TS$1 * 1024 / track.samplerate); // TODO this check was added to maintain backwards compatibility (particularly with\n // tests) on adding the timingInfo event. However, it seems unlikely that there's a\n // valid use-case where an init segment/data should be triggered without associated\n // frames. Leaving for now, but should be looked into.\n\n if (frames.length) {\n segmentDuration = frames.length * frameDuration;\n this.trigger('segmentTimingInfo', generateSegmentTimingInfo(\n // The audio track's baseMediaDecodeTime is in audio clock cycles, but the\n // frame info is in video clock cycles. Convert to match expectation of\n // listeners (that all timestamps will be based on video clock cycles).\n clock.audioTsToVideoTs(track.baseMediaDecodeTime, track.samplerate),\n // frame times are already in video clock, as is segment duration\n frames[0].dts, frames[0].pts, frames[0].dts + segmentDuration, frames[0].pts + segmentDuration, videoClockCyclesOfSilencePrefixed || 0));\n this.trigger('timingInfo', {\n start: frames[0].pts,\n end: frames[0].pts + segmentDuration\n });\n }\n this.trigger('data', {\n track: track,\n boxes: boxes\n });\n this.trigger('done', 'AudioSegmentStream');\n };\n this.reset = function () {\n trackDecodeInfo.clearDtsInfo(track);\n adtsFrames = [];\n this.trigger('reset');\n };\n };\n AudioSegmentStream.prototype = new Stream();\n /**\n * Constructs a single-track, ISO BMFF media segment from H264 data\n * events. The output of this stream can be fed to a SourceBuffer\n * configured with a suitable initialization segment.\n * @param track {object} track metadata configuration\n * @param options {object} transmuxer options object\n * @param options.alignGopsAtEnd {boolean} If true, start from the end of the\n * gopsToAlignWith list when attempting to align gop pts\n * @param options.keepOriginalTimestamps {boolean} If true, keep the timestamps\n * in the source; false to adjust the first segment to start at 0.\n */\n\n VideoSegmentStream = function (track, options) {\n var sequenceNumber,\n nalUnits = [],\n gopsToAlignWith = [],\n config,\n pps;\n options = options || {};\n sequenceNumber = options.firstSequenceNumber || 0;\n VideoSegmentStream.prototype.init.call(this);\n delete track.minPTS;\n this.gopCache_ = [];\n /**\n * Constructs a ISO BMFF segment given H264 nalUnits\n * @param {Object} nalUnit A data event representing a nalUnit\n * @param {String} nalUnit.nalUnitType\n * @param {Object} nalUnit.config Properties for a mp4 track\n * @param {Uint8Array} nalUnit.data The nalUnit bytes\n * @see lib/codecs/h264.js\n **/\n\n this.push = function (nalUnit) {\n trackDecodeInfo.collectDtsInfo(track, nalUnit); // record the track config\n\n if (nalUnit.nalUnitType === 'seq_parameter_set_rbsp' && !config) {\n config = nalUnit.config;\n track.sps = [nalUnit.data];\n VIDEO_PROPERTIES.forEach(function (prop) {\n track[prop] = config[prop];\n }, this);\n }\n if (nalUnit.nalUnitType === 'pic_parameter_set_rbsp' && !pps) {\n pps = nalUnit.data;\n track.pps = [nalUnit.data];\n } // buffer video until flush() is called\n\n nalUnits.push(nalUnit);\n };\n /**\n * Pass constructed ISO BMFF track and boxes on to the\n * next stream in the pipeline\n **/\n\n this.flush = function () {\n var frames,\n gopForFusion,\n gops,\n moof,\n mdat,\n boxes,\n prependedContentDuration = 0,\n firstGop,\n lastGop; // Throw away nalUnits at the start of the byte stream until\n // we find the first AUD\n\n while (nalUnits.length) {\n if (nalUnits[0].nalUnitType === 'access_unit_delimiter_rbsp') {\n break;\n }\n nalUnits.shift();\n } // Return early if no video data has been observed\n\n if (nalUnits.length === 0) {\n this.resetStream_();\n this.trigger('done', 'VideoSegmentStream');\n return;\n } // Organize the raw nal-units into arrays that represent\n // higher-level constructs such as frames and gops\n // (group-of-pictures)\n\n frames = frameUtils.groupNalsIntoFrames(nalUnits);\n gops = frameUtils.groupFramesIntoGops(frames); // If the first frame of this fragment is not a keyframe we have\n // a problem since MSE (on Chrome) requires a leading keyframe.\n //\n // We have two approaches to repairing this situation:\n // 1) GOP-FUSION:\n // This is where we keep track of the GOPS (group-of-pictures)\n // from previous fragments and attempt to find one that we can\n // prepend to the current fragment in order to create a valid\n // fragment.\n // 2) KEYFRAME-PULLING:\n // Here we search for the first keyframe in the fragment and\n // throw away all the frames between the start of the fragment\n // and that keyframe. We then extend the duration and pull the\n // PTS of the keyframe forward so that it covers the time range\n // of the frames that were disposed of.\n //\n // #1 is far prefereable over #2 which can cause \"stuttering\" but\n // requires more things to be just right.\n\n if (!gops[0][0].keyFrame) {\n // Search for a gop for fusion from our gopCache\n gopForFusion = this.getGopForFusion_(nalUnits[0], track);\n if (gopForFusion) {\n // in order to provide more accurate timing information about the segment, save\n // the number of seconds prepended to the original segment due to GOP fusion\n prependedContentDuration = gopForFusion.duration;\n gops.unshift(gopForFusion); // Adjust Gops' metadata to account for the inclusion of the\n // new gop at the beginning\n\n gops.byteLength += gopForFusion.byteLength;\n gops.nalCount += gopForFusion.nalCount;\n gops.pts = gopForFusion.pts;\n gops.dts = gopForFusion.dts;\n gops.duration += gopForFusion.duration;\n } else {\n // If we didn't find a candidate gop fall back to keyframe-pulling\n gops = frameUtils.extendFirstKeyFrame(gops);\n }\n } // Trim gops to align with gopsToAlignWith\n\n if (gopsToAlignWith.length) {\n var alignedGops;\n if (options.alignGopsAtEnd) {\n alignedGops = this.alignGopsAtEnd_(gops);\n } else {\n alignedGops = this.alignGopsAtStart_(gops);\n }\n if (!alignedGops) {\n // save all the nals in the last GOP into the gop cache\n this.gopCache_.unshift({\n gop: gops.pop(),\n pps: track.pps,\n sps: track.sps\n }); // Keep a maximum of 6 GOPs in the cache\n\n this.gopCache_.length = Math.min(6, this.gopCache_.length); // Clear nalUnits\n\n nalUnits = []; // return early no gops can be aligned with desired gopsToAlignWith\n\n this.resetStream_();\n this.trigger('done', 'VideoSegmentStream');\n return;\n } // Some gops were trimmed. clear dts info so minSegmentDts and pts are correct\n // when recalculated before sending off to CoalesceStream\n\n trackDecodeInfo.clearDtsInfo(track);\n gops = alignedGops;\n }\n trackDecodeInfo.collectDtsInfo(track, gops); // First, we have to build the index from byte locations to\n // samples (that is, frames) in the video data\n\n track.samples = frameUtils.generateSampleTable(gops); // Concatenate the video data and construct the mdat\n\n mdat = mp4.mdat(frameUtils.concatenateNalData(gops));\n track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(track, options.keepOriginalTimestamps);\n this.trigger('processedGopsInfo', gops.map(function (gop) {\n return {\n pts: gop.pts,\n dts: gop.dts,\n byteLength: gop.byteLength\n };\n }));\n firstGop = gops[0];\n lastGop = gops[gops.length - 1];\n this.trigger('segmentTimingInfo', generateSegmentTimingInfo(track.baseMediaDecodeTime, firstGop.dts, firstGop.pts, lastGop.dts + lastGop.duration, lastGop.pts + lastGop.duration, prependedContentDuration));\n this.trigger('timingInfo', {\n start: gops[0].pts,\n end: gops[gops.length - 1].pts + gops[gops.length - 1].duration\n }); // save all the nals in the last GOP into the gop cache\n\n this.gopCache_.unshift({\n gop: gops.pop(),\n pps: track.pps,\n sps: track.sps\n }); // Keep a maximum of 6 GOPs in the cache\n\n this.gopCache_.length = Math.min(6, this.gopCache_.length); // Clear nalUnits\n\n nalUnits = [];\n this.trigger('baseMediaDecodeTime', track.baseMediaDecodeTime);\n this.trigger('timelineStartInfo', track.timelineStartInfo);\n moof = mp4.moof(sequenceNumber, [track]); // it would be great to allocate this array up front instead of\n // throwing away hundreds of media segment fragments\n\n boxes = new Uint8Array(moof.byteLength + mdat.byteLength); // Bump the sequence number for next time\n\n sequenceNumber++;\n boxes.set(moof);\n boxes.set(mdat, moof.byteLength);\n this.trigger('data', {\n track: track,\n boxes: boxes\n });\n this.resetStream_(); // Continue with the flush process now\n\n this.trigger('done', 'VideoSegmentStream');\n };\n this.reset = function () {\n this.resetStream_();\n nalUnits = [];\n this.gopCache_.length = 0;\n gopsToAlignWith.length = 0;\n this.trigger('reset');\n };\n this.resetStream_ = function () {\n trackDecodeInfo.clearDtsInfo(track); // reset config and pps because they may differ across segments\n // for instance, when we are rendition switching\n\n config = undefined;\n pps = undefined;\n }; // Search for a candidate Gop for gop-fusion from the gop cache and\n // return it or return null if no good candidate was found\n\n this.getGopForFusion_ = function (nalUnit) {\n var halfSecond = 45000,\n // Half-a-second in a 90khz clock\n allowableOverlap = 10000,\n // About 3 frames @ 30fps\n nearestDistance = Infinity,\n dtsDistance,\n nearestGopObj,\n currentGop,\n currentGopObj,\n i; // Search for the GOP nearest to the beginning of this nal unit\n\n for (i = 0; i < this.gopCache_.length; i++) {\n currentGopObj = this.gopCache_[i];\n currentGop = currentGopObj.gop; // Reject Gops with different SPS or PPS\n\n if (!(track.pps && arrayEquals(track.pps[0], currentGopObj.pps[0])) || !(track.sps && arrayEquals(track.sps[0], currentGopObj.sps[0]))) {\n continue;\n } // Reject Gops that would require a negative baseMediaDecodeTime\n\n if (currentGop.dts < track.timelineStartInfo.dts) {\n continue;\n } // The distance between the end of the gop and the start of the nalUnit\n\n dtsDistance = nalUnit.dts - currentGop.dts - currentGop.duration; // Only consider GOPS that start before the nal unit and end within\n // a half-second of the nal unit\n\n if (dtsDistance >= -allowableOverlap && dtsDistance <= halfSecond) {\n // Always use the closest GOP we found if there is more than\n // one candidate\n if (!nearestGopObj || nearestDistance > dtsDistance) {\n nearestGopObj = currentGopObj;\n nearestDistance = dtsDistance;\n }\n }\n }\n if (nearestGopObj) {\n return nearestGopObj.gop;\n }\n return null;\n }; // trim gop list to the first gop found that has a matching pts with a gop in the list\n // of gopsToAlignWith starting from the START of the list\n\n this.alignGopsAtStart_ = function (gops) {\n var alignIndex, gopIndex, align, gop, byteLength, nalCount, duration, alignedGops;\n byteLength = gops.byteLength;\n nalCount = gops.nalCount;\n duration = gops.duration;\n alignIndex = gopIndex = 0;\n while (alignIndex < gopsToAlignWith.length && gopIndex < gops.length) {\n align = gopsToAlignWith[alignIndex];\n gop = gops[gopIndex];\n if (align.pts === gop.pts) {\n break;\n }\n if (gop.pts > align.pts) {\n // this current gop starts after the current gop we want to align on, so increment\n // align index\n alignIndex++;\n continue;\n } // current gop starts before the current gop we want to align on. so increment gop\n // index\n\n gopIndex++;\n byteLength -= gop.byteLength;\n nalCount -= gop.nalCount;\n duration -= gop.duration;\n }\n if (gopIndex === 0) {\n // no gops to trim\n return gops;\n }\n if (gopIndex === gops.length) {\n // all gops trimmed, skip appending all gops\n return null;\n }\n alignedGops = gops.slice(gopIndex);\n alignedGops.byteLength = byteLength;\n alignedGops.duration = duration;\n alignedGops.nalCount = nalCount;\n alignedGops.pts = alignedGops[0].pts;\n alignedGops.dts = alignedGops[0].dts;\n return alignedGops;\n }; // trim gop list to the first gop found that has a matching pts with a gop in the list\n // of gopsToAlignWith starting from the END of the list\n\n this.alignGopsAtEnd_ = function (gops) {\n var alignIndex, gopIndex, align, gop, alignEndIndex, matchFound;\n alignIndex = gopsToAlignWith.length - 1;\n gopIndex = gops.length - 1;\n alignEndIndex = null;\n matchFound = false;\n while (alignIndex >= 0 && gopIndex >= 0) {\n align = gopsToAlignWith[alignIndex];\n gop = gops[gopIndex];\n if (align.pts === gop.pts) {\n matchFound = true;\n break;\n }\n if (align.pts > gop.pts) {\n alignIndex--;\n continue;\n }\n if (alignIndex === gopsToAlignWith.length - 1) {\n // gop.pts is greater than the last alignment candidate. If no match is found\n // by the end of this loop, we still want to append gops that come after this\n // point\n alignEndIndex = gopIndex;\n }\n gopIndex--;\n }\n if (!matchFound && alignEndIndex === null) {\n return null;\n }\n var trimIndex;\n if (matchFound) {\n trimIndex = gopIndex;\n } else {\n trimIndex = alignEndIndex;\n }\n if (trimIndex === 0) {\n return gops;\n }\n var alignedGops = gops.slice(trimIndex);\n var metadata = alignedGops.reduce(function (total, gop) {\n total.byteLength += gop.byteLength;\n total.duration += gop.duration;\n total.nalCount += gop.nalCount;\n return total;\n }, {\n byteLength: 0,\n duration: 0,\n nalCount: 0\n });\n alignedGops.byteLength = metadata.byteLength;\n alignedGops.duration = metadata.duration;\n alignedGops.nalCount = metadata.nalCount;\n alignedGops.pts = alignedGops[0].pts;\n alignedGops.dts = alignedGops[0].dts;\n return alignedGops;\n };\n this.alignGopsWith = function (newGopsToAlignWith) {\n gopsToAlignWith = newGopsToAlignWith;\n };\n };\n VideoSegmentStream.prototype = new Stream();\n /**\n * A Stream that can combine multiple streams (ie. audio & video)\n * into a single output segment for MSE. Also supports audio-only\n * and video-only streams.\n * @param options {object} transmuxer options object\n * @param options.keepOriginalTimestamps {boolean} If true, keep the timestamps\n * in the source; false to adjust the first segment to start at media timeline start.\n */\n\n CoalesceStream = function (options, metadataStream) {\n // Number of Tracks per output segment\n // If greater than 1, we combine multiple\n // tracks into a single segment\n this.numberOfTracks = 0;\n this.metadataStream = metadataStream;\n options = options || {};\n if (typeof options.remux !== 'undefined') {\n this.remuxTracks = !!options.remux;\n } else {\n this.remuxTracks = true;\n }\n if (typeof options.keepOriginalTimestamps === 'boolean') {\n this.keepOriginalTimestamps = options.keepOriginalTimestamps;\n } else {\n this.keepOriginalTimestamps = false;\n }\n this.pendingTracks = [];\n this.videoTrack = null;\n this.pendingBoxes = [];\n this.pendingCaptions = [];\n this.pendingMetadata = [];\n this.pendingBytes = 0;\n this.emittedTracks = 0;\n CoalesceStream.prototype.init.call(this); // Take output from multiple\n\n this.push = function (output) {\n // buffer incoming captions until the associated video segment\n // finishes\n if (output.content || output.text) {\n return this.pendingCaptions.push(output);\n } // buffer incoming id3 tags until the final flush\n\n if (output.frames) {\n return this.pendingMetadata.push(output);\n } // Add this track to the list of pending tracks and store\n // important information required for the construction of\n // the final segment\n\n this.pendingTracks.push(output.track);\n this.pendingBytes += output.boxes.byteLength; // TODO: is there an issue for this against chrome?\n // We unshift audio and push video because\n // as of Chrome 75 when switching from\n // one init segment to another if the video\n // mdat does not appear after the audio mdat\n // only audio will play for the duration of our transmux.\n\n if (output.track.type === 'video') {\n this.videoTrack = output.track;\n this.pendingBoxes.push(output.boxes);\n }\n if (output.track.type === 'audio') {\n this.audioTrack = output.track;\n this.pendingBoxes.unshift(output.boxes);\n }\n };\n };\n CoalesceStream.prototype = new Stream();\n CoalesceStream.prototype.flush = function (flushSource) {\n var offset = 0,\n event = {\n captions: [],\n captionStreams: {},\n metadata: [],\n info: {}\n },\n caption,\n id3,\n initSegment,\n timelineStartPts = 0,\n i;\n if (this.pendingTracks.length < this.numberOfTracks) {\n if (flushSource !== 'VideoSegmentStream' && flushSource !== 'AudioSegmentStream') {\n // Return because we haven't received a flush from a data-generating\n // portion of the segment (meaning that we have only recieved meta-data\n // or captions.)\n return;\n } else if (this.remuxTracks) {\n // Return until we have enough tracks from the pipeline to remux (if we\n // are remuxing audio and video into a single MP4)\n return;\n } else if (this.pendingTracks.length === 0) {\n // In the case where we receive a flush without any data having been\n // received we consider it an emitted track for the purposes of coalescing\n // `done` events.\n // We do this for the case where there is an audio and video track in the\n // segment but no audio data. (seen in several playlists with alternate\n // audio tracks and no audio present in the main TS segments.)\n this.emittedTracks++;\n if (this.emittedTracks >= this.numberOfTracks) {\n this.trigger('done');\n this.emittedTracks = 0;\n }\n return;\n }\n }\n if (this.videoTrack) {\n timelineStartPts = this.videoTrack.timelineStartInfo.pts;\n VIDEO_PROPERTIES.forEach(function (prop) {\n event.info[prop] = this.videoTrack[prop];\n }, this);\n } else if (this.audioTrack) {\n timelineStartPts = this.audioTrack.timelineStartInfo.pts;\n AUDIO_PROPERTIES.forEach(function (prop) {\n event.info[prop] = this.audioTrack[prop];\n }, this);\n }\n if (this.videoTrack || this.audioTrack) {\n if (this.pendingTracks.length === 1) {\n event.type = this.pendingTracks[0].type;\n } else {\n event.type = 'combined';\n }\n this.emittedTracks += this.pendingTracks.length;\n initSegment = mp4.initSegment(this.pendingTracks); // Create a new typed array to hold the init segment\n\n event.initSegment = new Uint8Array(initSegment.byteLength); // Create an init segment containing a moov\n // and track definitions\n\n event.initSegment.set(initSegment); // Create a new typed array to hold the moof+mdats\n\n event.data = new Uint8Array(this.pendingBytes); // Append each moof+mdat (one per track) together\n\n for (i = 0; i < this.pendingBoxes.length; i++) {\n event.data.set(this.pendingBoxes[i], offset);\n offset += this.pendingBoxes[i].byteLength;\n } // Translate caption PTS times into second offsets to match the\n // video timeline for the segment, and add track info\n\n for (i = 0; i < this.pendingCaptions.length; i++) {\n caption = this.pendingCaptions[i];\n caption.startTime = clock.metadataTsToSeconds(caption.startPts, timelineStartPts, this.keepOriginalTimestamps);\n caption.endTime = clock.metadataTsToSeconds(caption.endPts, timelineStartPts, this.keepOriginalTimestamps);\n event.captionStreams[caption.stream] = true;\n event.captions.push(caption);\n } // Translate ID3 frame PTS times into second offsets to match the\n // video timeline for the segment\n\n for (i = 0; i < this.pendingMetadata.length; i++) {\n id3 = this.pendingMetadata[i];\n id3.cueTime = clock.metadataTsToSeconds(id3.pts, timelineStartPts, this.keepOriginalTimestamps);\n event.metadata.push(id3);\n } // We add this to every single emitted segment even though we only need\n // it for the first\n\n event.metadata.dispatchType = this.metadataStream.dispatchType; // Reset stream state\n\n this.pendingTracks.length = 0;\n this.videoTrack = null;\n this.pendingBoxes.length = 0;\n this.pendingCaptions.length = 0;\n this.pendingBytes = 0;\n this.pendingMetadata.length = 0; // Emit the built segment\n // We include captions and ID3 tags for backwards compatibility,\n // ideally we should send only video and audio in the data event\n\n this.trigger('data', event); // Emit each caption to the outside world\n // Ideally, this would happen immediately on parsing captions,\n // but we need to ensure that video data is sent back first\n // so that caption timing can be adjusted to match video timing\n\n for (i = 0; i < event.captions.length; i++) {\n caption = event.captions[i];\n this.trigger('caption', caption);\n } // Emit each id3 tag to the outside world\n // Ideally, this would happen immediately on parsing the tag,\n // but we need to ensure that video data is sent back first\n // so that ID3 frame timing can be adjusted to match video timing\n\n for (i = 0; i < event.metadata.length; i++) {\n id3 = event.metadata[i];\n this.trigger('id3Frame', id3);\n }\n } // Only emit `done` if all tracks have been flushed and emitted\n\n if (this.emittedTracks >= this.numberOfTracks) {\n this.trigger('done');\n this.emittedTracks = 0;\n }\n };\n CoalesceStream.prototype.setRemux = function (val) {\n this.remuxTracks = val;\n };\n /**\n * A Stream that expects MP2T binary data as input and produces\n * corresponding media segments, suitable for use with Media Source\n * Extension (MSE) implementations that support the ISO BMFF byte\n * stream format, like Chrome.\n */\n\n Transmuxer = function (options) {\n var self = this,\n hasFlushed = true,\n videoTrack,\n audioTrack;\n Transmuxer.prototype.init.call(this);\n options = options || {};\n this.baseMediaDecodeTime = options.baseMediaDecodeTime || 0;\n this.transmuxPipeline_ = {};\n this.setupAacPipeline = function () {\n var pipeline = {};\n this.transmuxPipeline_ = pipeline;\n pipeline.type = 'aac';\n pipeline.metadataStream = new m2ts.MetadataStream(); // set up the parsing pipeline\n\n pipeline.aacStream = new AacStream();\n pipeline.audioTimestampRolloverStream = new m2ts.TimestampRolloverStream('audio');\n pipeline.timedMetadataTimestampRolloverStream = new m2ts.TimestampRolloverStream('timed-metadata');\n pipeline.adtsStream = new AdtsStream();\n pipeline.coalesceStream = new CoalesceStream(options, pipeline.metadataStream);\n pipeline.headOfPipeline = pipeline.aacStream;\n pipeline.aacStream.pipe(pipeline.audioTimestampRolloverStream).pipe(pipeline.adtsStream);\n pipeline.aacStream.pipe(pipeline.timedMetadataTimestampRolloverStream).pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream);\n pipeline.metadataStream.on('timestamp', function (frame) {\n pipeline.aacStream.setTimestamp(frame.timeStamp);\n });\n pipeline.aacStream.on('data', function (data) {\n if (data.type !== 'timed-metadata' && data.type !== 'audio' || pipeline.audioSegmentStream) {\n return;\n }\n audioTrack = audioTrack || {\n timelineStartInfo: {\n baseMediaDecodeTime: self.baseMediaDecodeTime\n },\n codec: 'adts',\n type: 'audio'\n }; // hook up the audio segment stream to the first track with aac data\n\n pipeline.coalesceStream.numberOfTracks++;\n pipeline.audioSegmentStream = new AudioSegmentStream(audioTrack, options);\n pipeline.audioSegmentStream.on('log', self.getLogTrigger_('audioSegmentStream'));\n pipeline.audioSegmentStream.on('timingInfo', self.trigger.bind(self, 'audioTimingInfo')); // Set up the final part of the audio pipeline\n\n pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream); // emit pmt info\n\n self.trigger('trackinfo', {\n hasAudio: !!audioTrack,\n hasVideo: !!videoTrack\n });\n }); // Re-emit any data coming from the coalesce stream to the outside world\n\n pipeline.coalesceStream.on('data', this.trigger.bind(this, 'data')); // Let the consumer know we have finished flushing the entire pipeline\n\n pipeline.coalesceStream.on('done', this.trigger.bind(this, 'done'));\n addPipelineLogRetriggers(this, pipeline);\n };\n this.setupTsPipeline = function () {\n var pipeline = {};\n this.transmuxPipeline_ = pipeline;\n pipeline.type = 'ts';\n pipeline.metadataStream = new m2ts.MetadataStream(); // set up the parsing pipeline\n\n pipeline.packetStream = new m2ts.TransportPacketStream();\n pipeline.parseStream = new m2ts.TransportParseStream();\n pipeline.elementaryStream = new m2ts.ElementaryStream();\n pipeline.timestampRolloverStream = new m2ts.TimestampRolloverStream();\n pipeline.adtsStream = new AdtsStream();\n pipeline.h264Stream = new H264Stream();\n pipeline.captionStream = new m2ts.CaptionStream(options);\n pipeline.coalesceStream = new CoalesceStream(options, pipeline.metadataStream);\n pipeline.headOfPipeline = pipeline.packetStream; // disassemble MPEG2-TS packets into elementary streams\n\n pipeline.packetStream.pipe(pipeline.parseStream).pipe(pipeline.elementaryStream).pipe(pipeline.timestampRolloverStream); // !!THIS ORDER IS IMPORTANT!!\n // demux the streams\n\n pipeline.timestampRolloverStream.pipe(pipeline.h264Stream);\n pipeline.timestampRolloverStream.pipe(pipeline.adtsStream);\n pipeline.timestampRolloverStream.pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream); // Hook up CEA-608/708 caption stream\n\n pipeline.h264Stream.pipe(pipeline.captionStream).pipe(pipeline.coalesceStream);\n pipeline.elementaryStream.on('data', function (data) {\n var i;\n if (data.type === 'metadata') {\n i = data.tracks.length; // scan the tracks listed in the metadata\n\n while (i--) {\n if (!videoTrack && data.tracks[i].type === 'video') {\n videoTrack = data.tracks[i];\n videoTrack.timelineStartInfo.baseMediaDecodeTime = self.baseMediaDecodeTime;\n } else if (!audioTrack && data.tracks[i].type === 'audio') {\n audioTrack = data.tracks[i];\n audioTrack.timelineStartInfo.baseMediaDecodeTime = self.baseMediaDecodeTime;\n }\n } // hook up the video segment stream to the first track with h264 data\n\n if (videoTrack && !pipeline.videoSegmentStream) {\n pipeline.coalesceStream.numberOfTracks++;\n pipeline.videoSegmentStream = new VideoSegmentStream(videoTrack, options);\n pipeline.videoSegmentStream.on('log', self.getLogTrigger_('videoSegmentStream'));\n pipeline.videoSegmentStream.on('timelineStartInfo', function (timelineStartInfo) {\n // When video emits timelineStartInfo data after a flush, we forward that\n // info to the AudioSegmentStream, if it exists, because video timeline\n // data takes precedence. Do not do this if keepOriginalTimestamps is set,\n // because this is a particularly subtle form of timestamp alteration.\n if (audioTrack && !options.keepOriginalTimestamps) {\n audioTrack.timelineStartInfo = timelineStartInfo; // On the first segment we trim AAC frames that exist before the\n // very earliest DTS we have seen in video because Chrome will\n // interpret any video track with a baseMediaDecodeTime that is\n // non-zero as a gap.\n\n pipeline.audioSegmentStream.setEarliestDts(timelineStartInfo.dts - self.baseMediaDecodeTime);\n }\n });\n pipeline.videoSegmentStream.on('processedGopsInfo', self.trigger.bind(self, 'gopInfo'));\n pipeline.videoSegmentStream.on('segmentTimingInfo', self.trigger.bind(self, 'videoSegmentTimingInfo'));\n pipeline.videoSegmentStream.on('baseMediaDecodeTime', function (baseMediaDecodeTime) {\n if (audioTrack) {\n pipeline.audioSegmentStream.setVideoBaseMediaDecodeTime(baseMediaDecodeTime);\n }\n });\n pipeline.videoSegmentStream.on('timingInfo', self.trigger.bind(self, 'videoTimingInfo')); // Set up the final part of the video pipeline\n\n pipeline.h264Stream.pipe(pipeline.videoSegmentStream).pipe(pipeline.coalesceStream);\n }\n if (audioTrack && !pipeline.audioSegmentStream) {\n // hook up the audio segment stream to the first track with aac data\n pipeline.coalesceStream.numberOfTracks++;\n pipeline.audioSegmentStream = new AudioSegmentStream(audioTrack, options);\n pipeline.audioSegmentStream.on('log', self.getLogTrigger_('audioSegmentStream'));\n pipeline.audioSegmentStream.on('timingInfo', self.trigger.bind(self, 'audioTimingInfo'));\n pipeline.audioSegmentStream.on('segmentTimingInfo', self.trigger.bind(self, 'audioSegmentTimingInfo')); // Set up the final part of the audio pipeline\n\n pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream);\n } // emit pmt info\n\n self.trigger('trackinfo', {\n hasAudio: !!audioTrack,\n hasVideo: !!videoTrack\n });\n }\n }); // Re-emit any data coming from the coalesce stream to the outside world\n\n pipeline.coalesceStream.on('data', this.trigger.bind(this, 'data'));\n pipeline.coalesceStream.on('id3Frame', function (id3Frame) {\n id3Frame.dispatchType = pipeline.metadataStream.dispatchType;\n self.trigger('id3Frame', id3Frame);\n });\n pipeline.coalesceStream.on('caption', this.trigger.bind(this, 'caption')); // Let the consumer know we have finished flushing the entire pipeline\n\n pipeline.coalesceStream.on('done', this.trigger.bind(this, 'done'));\n addPipelineLogRetriggers(this, pipeline);\n }; // hook up the segment streams once track metadata is delivered\n\n this.setBaseMediaDecodeTime = function (baseMediaDecodeTime) {\n var pipeline = this.transmuxPipeline_;\n if (!options.keepOriginalTimestamps) {\n this.baseMediaDecodeTime = baseMediaDecodeTime;\n }\n if (audioTrack) {\n audioTrack.timelineStartInfo.dts = undefined;\n audioTrack.timelineStartInfo.pts = undefined;\n trackDecodeInfo.clearDtsInfo(audioTrack);\n if (pipeline.audioTimestampRolloverStream) {\n pipeline.audioTimestampRolloverStream.discontinuity();\n }\n }\n if (videoTrack) {\n if (pipeline.videoSegmentStream) {\n pipeline.videoSegmentStream.gopCache_ = [];\n }\n videoTrack.timelineStartInfo.dts = undefined;\n videoTrack.timelineStartInfo.pts = undefined;\n trackDecodeInfo.clearDtsInfo(videoTrack);\n pipeline.captionStream.reset();\n }\n if (pipeline.timestampRolloverStream) {\n pipeline.timestampRolloverStream.discontinuity();\n }\n };\n this.setAudioAppendStart = function (timestamp) {\n if (audioTrack) {\n this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(timestamp);\n }\n };\n this.setRemux = function (val) {\n var pipeline = this.transmuxPipeline_;\n options.remux = val;\n if (pipeline && pipeline.coalesceStream) {\n pipeline.coalesceStream.setRemux(val);\n }\n };\n this.alignGopsWith = function (gopsToAlignWith) {\n if (videoTrack && this.transmuxPipeline_.videoSegmentStream) {\n this.transmuxPipeline_.videoSegmentStream.alignGopsWith(gopsToAlignWith);\n }\n };\n this.getLogTrigger_ = function (key) {\n var self = this;\n return function (event) {\n event.stream = key;\n self.trigger('log', event);\n };\n }; // feed incoming data to the front of the parsing pipeline\n\n this.push = function (data) {\n if (hasFlushed) {\n var isAac = isLikelyAacData(data);\n if (isAac && this.transmuxPipeline_.type !== 'aac') {\n this.setupAacPipeline();\n } else if (!isAac && this.transmuxPipeline_.type !== 'ts') {\n this.setupTsPipeline();\n }\n hasFlushed = false;\n }\n this.transmuxPipeline_.headOfPipeline.push(data);\n }; // flush any buffered data\n\n this.flush = function () {\n hasFlushed = true; // Start at the top of the pipeline and flush all pending work\n\n this.transmuxPipeline_.headOfPipeline.flush();\n };\n this.endTimeline = function () {\n this.transmuxPipeline_.headOfPipeline.endTimeline();\n };\n this.reset = function () {\n if (this.transmuxPipeline_.headOfPipeline) {\n this.transmuxPipeline_.headOfPipeline.reset();\n }\n }; // Caption data has to be reset when seeking outside buffered range\n\n this.resetCaptions = function () {\n if (this.transmuxPipeline_.captionStream) {\n this.transmuxPipeline_.captionStream.reset();\n }\n };\n };\n Transmuxer.prototype = new Stream();\n var transmuxer = {\n Transmuxer: Transmuxer,\n VideoSegmentStream: VideoSegmentStream,\n AudioSegmentStream: AudioSegmentStream,\n AUDIO_PROPERTIES: AUDIO_PROPERTIES,\n VIDEO_PROPERTIES: VIDEO_PROPERTIES,\n // exported for testing\n generateSegmentTimingInfo: generateSegmentTimingInfo\n };\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n */\n\n var toUnsigned$3 = function (value) {\n return value >>> 0;\n };\n var toHexString$1 = function (value) {\n return ('00' + value.toString(16)).slice(-2);\n };\n var bin = {\n toUnsigned: toUnsigned$3,\n toHexString: toHexString$1\n };\n var parseType$3 = function (buffer) {\n var result = '';\n result += String.fromCharCode(buffer[0]);\n result += String.fromCharCode(buffer[1]);\n result += String.fromCharCode(buffer[2]);\n result += String.fromCharCode(buffer[3]);\n return result;\n };\n var parseType_1 = parseType$3;\n var toUnsigned$2 = bin.toUnsigned;\n var parseType$2 = parseType_1;\n var findBox$2 = function (data, path) {\n var results = [],\n i,\n size,\n type,\n end,\n subresults;\n if (!path.length) {\n // short-circuit the search for empty paths\n return null;\n }\n for (i = 0; i < data.byteLength;) {\n size = toUnsigned$2(data[i] << 24 | data[i + 1] << 16 | data[i + 2] << 8 | data[i + 3]);\n type = parseType$2(data.subarray(i + 4, i + 8));\n end = size > 1 ? i + size : data.byteLength;\n if (type === path[0]) {\n if (path.length === 1) {\n // this is the end of the path and we've found the box we were\n // looking for\n results.push(data.subarray(i + 8, end));\n } else {\n // recursively search for the next box along the path\n subresults = findBox$2(data.subarray(i + 8, end), path.slice(1));\n if (subresults.length) {\n results = results.concat(subresults);\n }\n }\n }\n i = end;\n } // we've finished searching all of data\n\n return results;\n };\n var findBox_1 = findBox$2;\n var toUnsigned$1 = bin.toUnsigned;\n var getUint64$2 = numbers.getUint64;\n var tfdt = function (data) {\n var result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4))\n };\n if (result.version === 1) {\n result.baseMediaDecodeTime = getUint64$2(data.subarray(4));\n } else {\n result.baseMediaDecodeTime = toUnsigned$1(data[4] << 24 | data[5] << 16 | data[6] << 8 | data[7]);\n }\n return result;\n };\n var parseTfdt$2 = tfdt;\n var parseSampleFlags$1 = function (flags) {\n return {\n isLeading: (flags[0] & 0x0c) >>> 2,\n dependsOn: flags[0] & 0x03,\n isDependedOn: (flags[1] & 0xc0) >>> 6,\n hasRedundancy: (flags[1] & 0x30) >>> 4,\n paddingValue: (flags[1] & 0x0e) >>> 1,\n isNonSyncSample: flags[1] & 0x01,\n degradationPriority: flags[2] << 8 | flags[3]\n };\n };\n var parseSampleFlags_1 = parseSampleFlags$1;\n var parseSampleFlags = parseSampleFlags_1;\n var trun = function (data) {\n var result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n samples: []\n },\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n // Flag interpretation\n dataOffsetPresent = result.flags[2] & 0x01,\n // compare with 2nd byte of 0x1\n firstSampleFlagsPresent = result.flags[2] & 0x04,\n // compare with 2nd byte of 0x4\n sampleDurationPresent = result.flags[1] & 0x01,\n // compare with 2nd byte of 0x100\n sampleSizePresent = result.flags[1] & 0x02,\n // compare with 2nd byte of 0x200\n sampleFlagsPresent = result.flags[1] & 0x04,\n // compare with 2nd byte of 0x400\n sampleCompositionTimeOffsetPresent = result.flags[1] & 0x08,\n // compare with 2nd byte of 0x800\n sampleCount = view.getUint32(4),\n offset = 8,\n sample;\n if (dataOffsetPresent) {\n // 32 bit signed integer\n result.dataOffset = view.getInt32(offset);\n offset += 4;\n } // Overrides the flags for the first sample only. The order of\n // optional values will be: duration, size, compositionTimeOffset\n\n if (firstSampleFlagsPresent && sampleCount) {\n sample = {\n flags: parseSampleFlags(data.subarray(offset, offset + 4))\n };\n offset += 4;\n if (sampleDurationPresent) {\n sample.duration = view.getUint32(offset);\n offset += 4;\n }\n if (sampleSizePresent) {\n sample.size = view.getUint32(offset);\n offset += 4;\n }\n if (sampleCompositionTimeOffsetPresent) {\n if (result.version === 1) {\n sample.compositionTimeOffset = view.getInt32(offset);\n } else {\n sample.compositionTimeOffset = view.getUint32(offset);\n }\n offset += 4;\n }\n result.samples.push(sample);\n sampleCount--;\n }\n while (sampleCount--) {\n sample = {};\n if (sampleDurationPresent) {\n sample.duration = view.getUint32(offset);\n offset += 4;\n }\n if (sampleSizePresent) {\n sample.size = view.getUint32(offset);\n offset += 4;\n }\n if (sampleFlagsPresent) {\n sample.flags = parseSampleFlags(data.subarray(offset, offset + 4));\n offset += 4;\n }\n if (sampleCompositionTimeOffsetPresent) {\n if (result.version === 1) {\n sample.compositionTimeOffset = view.getInt32(offset);\n } else {\n sample.compositionTimeOffset = view.getUint32(offset);\n }\n offset += 4;\n }\n result.samples.push(sample);\n }\n return result;\n };\n var parseTrun$2 = trun;\n var tfhd = function (data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n trackId: view.getUint32(4)\n },\n baseDataOffsetPresent = result.flags[2] & 0x01,\n sampleDescriptionIndexPresent = result.flags[2] & 0x02,\n defaultSampleDurationPresent = result.flags[2] & 0x08,\n defaultSampleSizePresent = result.flags[2] & 0x10,\n defaultSampleFlagsPresent = result.flags[2] & 0x20,\n durationIsEmpty = result.flags[0] & 0x010000,\n defaultBaseIsMoof = result.flags[0] & 0x020000,\n i;\n i = 8;\n if (baseDataOffsetPresent) {\n i += 4; // truncate top 4 bytes\n // FIXME: should we read the full 64 bits?\n\n result.baseDataOffset = view.getUint32(12);\n i += 4;\n }\n if (sampleDescriptionIndexPresent) {\n result.sampleDescriptionIndex = view.getUint32(i);\n i += 4;\n }\n if (defaultSampleDurationPresent) {\n result.defaultSampleDuration = view.getUint32(i);\n i += 4;\n }\n if (defaultSampleSizePresent) {\n result.defaultSampleSize = view.getUint32(i);\n i += 4;\n }\n if (defaultSampleFlagsPresent) {\n result.defaultSampleFlags = view.getUint32(i);\n }\n if (durationIsEmpty) {\n result.durationIsEmpty = true;\n }\n if (!baseDataOffsetPresent && defaultBaseIsMoof) {\n result.baseDataOffsetIsMoof = true;\n }\n return result;\n };\n var parseTfhd$2 = tfhd;\n var win;\n if (typeof window !== \"undefined\") {\n win = window;\n } else if (typeof commonjsGlobal !== \"undefined\") {\n win = commonjsGlobal;\n } else if (typeof self !== \"undefined\") {\n win = self;\n } else {\n win = {};\n }\n var window_1 = win;\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n *\n * Reads in-band CEA-708 captions out of FMP4 segments.\n * @see https://en.wikipedia.org/wiki/CEA-708\n */\n\n var discardEmulationPreventionBytes = captionPacketParser.discardEmulationPreventionBytes;\n var CaptionStream = captionStream.CaptionStream;\n var findBox$1 = findBox_1;\n var parseTfdt$1 = parseTfdt$2;\n var parseTrun$1 = parseTrun$2;\n var parseTfhd$1 = parseTfhd$2;\n var window$2 = window_1;\n /**\n * Maps an offset in the mdat to a sample based on the the size of the samples.\n * Assumes that `parseSamples` has been called first.\n *\n * @param {Number} offset - The offset into the mdat\n * @param {Object[]} samples - An array of samples, parsed using `parseSamples`\n * @return {?Object} The matching sample, or null if no match was found.\n *\n * @see ISO-BMFF-12/2015, Section 8.8.8\n **/\n\n var mapToSample = function (offset, samples) {\n var approximateOffset = offset;\n for (var i = 0; i < samples.length; i++) {\n var sample = samples[i];\n if (approximateOffset < sample.size) {\n return sample;\n }\n approximateOffset -= sample.size;\n }\n return null;\n };\n /**\n * Finds SEI nal units contained in a Media Data Box.\n * Assumes that `parseSamples` has been called first.\n *\n * @param {Uint8Array} avcStream - The bytes of the mdat\n * @param {Object[]} samples - The samples parsed out by `parseSamples`\n * @param {Number} trackId - The trackId of this video track\n * @return {Object[]} seiNals - the parsed SEI NALUs found.\n * The contents of the seiNal should match what is expected by\n * CaptionStream.push (nalUnitType, size, data, escapedRBSP, pts, dts)\n *\n * @see ISO-BMFF-12/2015, Section 8.1.1\n * @see Rec. ITU-T H.264, 7.3.2.3.1\n **/\n\n var findSeiNals = function (avcStream, samples, trackId) {\n var avcView = new DataView(avcStream.buffer, avcStream.byteOffset, avcStream.byteLength),\n result = {\n logs: [],\n seiNals: []\n },\n seiNal,\n i,\n length,\n lastMatchedSample;\n for (i = 0; i + 4 < avcStream.length; i += length) {\n length = avcView.getUint32(i);\n i += 4; // Bail if this doesn't appear to be an H264 stream\n\n if (length <= 0) {\n continue;\n }\n switch (avcStream[i] & 0x1F) {\n case 0x06:\n var data = avcStream.subarray(i + 1, i + 1 + length);\n var matchingSample = mapToSample(i, samples);\n seiNal = {\n nalUnitType: 'sei_rbsp',\n size: length,\n data: data,\n escapedRBSP: discardEmulationPreventionBytes(data),\n trackId: trackId\n };\n if (matchingSample) {\n seiNal.pts = matchingSample.pts;\n seiNal.dts = matchingSample.dts;\n lastMatchedSample = matchingSample;\n } else if (lastMatchedSample) {\n // If a matching sample cannot be found, use the last\n // sample's values as they should be as close as possible\n seiNal.pts = lastMatchedSample.pts;\n seiNal.dts = lastMatchedSample.dts;\n } else {\n result.logs.push({\n level: 'warn',\n message: 'We\\'ve encountered a nal unit without data at ' + i + ' for trackId ' + trackId + '. See mux.js#223.'\n });\n break;\n }\n result.seiNals.push(seiNal);\n break;\n }\n }\n return result;\n };\n /**\n * Parses sample information out of Track Run Boxes and calculates\n * the absolute presentation and decode timestamps of each sample.\n *\n * @param {Array<Uint8Array>} truns - The Trun Run boxes to be parsed\n * @param {Number|BigInt} baseMediaDecodeTime - base media decode time from tfdt\n @see ISO-BMFF-12/2015, Section 8.8.12\n * @param {Object} tfhd - The parsed Track Fragment Header\n * @see inspect.parseTfhd\n * @return {Object[]} the parsed samples\n *\n * @see ISO-BMFF-12/2015, Section 8.8.8\n **/\n\n var parseSamples = function (truns, baseMediaDecodeTime, tfhd) {\n var currentDts = baseMediaDecodeTime;\n var defaultSampleDuration = tfhd.defaultSampleDuration || 0;\n var defaultSampleSize = tfhd.defaultSampleSize || 0;\n var trackId = tfhd.trackId;\n var allSamples = [];\n truns.forEach(function (trun) {\n // Note: We currently do not parse the sample table as well\n // as the trun. It's possible some sources will require this.\n // moov > trak > mdia > minf > stbl\n var trackRun = parseTrun$1(trun);\n var samples = trackRun.samples;\n samples.forEach(function (sample) {\n if (sample.duration === undefined) {\n sample.duration = defaultSampleDuration;\n }\n if (sample.size === undefined) {\n sample.size = defaultSampleSize;\n }\n sample.trackId = trackId;\n sample.dts = currentDts;\n if (sample.compositionTimeOffset === undefined) {\n sample.compositionTimeOffset = 0;\n }\n if (typeof currentDts === 'bigint') {\n sample.pts = currentDts + window$2.BigInt(sample.compositionTimeOffset);\n currentDts += window$2.BigInt(sample.duration);\n } else {\n sample.pts = currentDts + sample.compositionTimeOffset;\n currentDts += sample.duration;\n }\n });\n allSamples = allSamples.concat(samples);\n });\n return allSamples;\n };\n /**\n * Parses out caption nals from an FMP4 segment's video tracks.\n *\n * @param {Uint8Array} segment - The bytes of a single segment\n * @param {Number} videoTrackId - The trackId of a video track in the segment\n * @return {Object.<Number, Object[]>} A mapping of video trackId to\n * a list of seiNals found in that track\n **/\n\n var parseCaptionNals = function (segment, videoTrackId) {\n // To get the samples\n var trafs = findBox$1(segment, ['moof', 'traf']); // To get SEI NAL units\n\n var mdats = findBox$1(segment, ['mdat']);\n var captionNals = {};\n var mdatTrafPairs = []; // Pair up each traf with a mdat as moofs and mdats are in pairs\n\n mdats.forEach(function (mdat, index) {\n var matchingTraf = trafs[index];\n mdatTrafPairs.push({\n mdat: mdat,\n traf: matchingTraf\n });\n });\n mdatTrafPairs.forEach(function (pair) {\n var mdat = pair.mdat;\n var traf = pair.traf;\n var tfhd = findBox$1(traf, ['tfhd']); // Exactly 1 tfhd per traf\n\n var headerInfo = parseTfhd$1(tfhd[0]);\n var trackId = headerInfo.trackId;\n var tfdt = findBox$1(traf, ['tfdt']); // Either 0 or 1 tfdt per traf\n\n var baseMediaDecodeTime = tfdt.length > 0 ? parseTfdt$1(tfdt[0]).baseMediaDecodeTime : 0;\n var truns = findBox$1(traf, ['trun']);\n var samples;\n var result; // Only parse video data for the chosen video track\n\n if (videoTrackId === trackId && truns.length > 0) {\n samples = parseSamples(truns, baseMediaDecodeTime, headerInfo);\n result = findSeiNals(mdat, samples, trackId);\n if (!captionNals[trackId]) {\n captionNals[trackId] = {\n seiNals: [],\n logs: []\n };\n }\n captionNals[trackId].seiNals = captionNals[trackId].seiNals.concat(result.seiNals);\n captionNals[trackId].logs = captionNals[trackId].logs.concat(result.logs);\n }\n });\n return captionNals;\n };\n /**\n * Parses out inband captions from an MP4 container and returns\n * caption objects that can be used by WebVTT and the TextTrack API.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/VTTCue\n * @see https://developer.mozilla.org/en-US/docs/Web/API/TextTrack\n * Assumes that `probe.getVideoTrackIds` and `probe.timescale` have been called first\n *\n * @param {Uint8Array} segment - The fmp4 segment containing embedded captions\n * @param {Number} trackId - The id of the video track to parse\n * @param {Number} timescale - The timescale for the video track from the init segment\n *\n * @return {?Object[]} parsedCaptions - A list of captions or null if no video tracks\n * @return {Number} parsedCaptions[].startTime - The time to show the caption in seconds\n * @return {Number} parsedCaptions[].endTime - The time to stop showing the caption in seconds\n * @return {Object[]} parsedCaptions[].content - A list of individual caption segments\n * @return {String} parsedCaptions[].content.text - The visible content of the caption segment\n * @return {Number} parsedCaptions[].content.line - The line height from 1-15 for positioning of the caption segment\n * @return {Number} parsedCaptions[].content.position - The column indent percentage for cue positioning from 10-80\n **/\n\n var parseEmbeddedCaptions = function (segment, trackId, timescale) {\n var captionNals; // the ISO-BMFF spec says that trackId can't be zero, but there's some broken content out there\n\n if (trackId === null) {\n return null;\n }\n captionNals = parseCaptionNals(segment, trackId);\n var trackNals = captionNals[trackId] || {};\n return {\n seiNals: trackNals.seiNals,\n logs: trackNals.logs,\n timescale: timescale\n };\n };\n /**\n * Converts SEI NALUs into captions that can be used by video.js\n **/\n\n var CaptionParser = function () {\n var isInitialized = false;\n var captionStream; // Stores segments seen before trackId and timescale are set\n\n var segmentCache; // Stores video track ID of the track being parsed\n\n var trackId; // Stores the timescale of the track being parsed\n\n var timescale; // Stores captions parsed so far\n\n var parsedCaptions; // Stores whether we are receiving partial data or not\n\n var parsingPartial;\n /**\n * A method to indicate whether a CaptionParser has been initalized\n * @returns {Boolean}\n **/\n\n this.isInitialized = function () {\n return isInitialized;\n };\n /**\n * Initializes the underlying CaptionStream, SEI NAL parsing\n * and management, and caption collection\n **/\n\n this.init = function (options) {\n captionStream = new CaptionStream();\n isInitialized = true;\n parsingPartial = options ? options.isPartial : false; // Collect dispatched captions\n\n captionStream.on('data', function (event) {\n // Convert to seconds in the source's timescale\n event.startTime = event.startPts / timescale;\n event.endTime = event.endPts / timescale;\n parsedCaptions.captions.push(event);\n parsedCaptions.captionStreams[event.stream] = true;\n });\n captionStream.on('log', function (log) {\n parsedCaptions.logs.push(log);\n });\n };\n /**\n * Determines if a new video track will be selected\n * or if the timescale changed\n * @return {Boolean}\n **/\n\n this.isNewInit = function (videoTrackIds, timescales) {\n if (videoTrackIds && videoTrackIds.length === 0 || timescales && typeof timescales === 'object' && Object.keys(timescales).length === 0) {\n return false;\n }\n return trackId !== videoTrackIds[0] || timescale !== timescales[trackId];\n };\n /**\n * Parses out SEI captions and interacts with underlying\n * CaptionStream to return dispatched captions\n *\n * @param {Uint8Array} segment - The fmp4 segment containing embedded captions\n * @param {Number[]} videoTrackIds - A list of video tracks found in the init segment\n * @param {Object.<Number, Number>} timescales - The timescales found in the init segment\n * @see parseEmbeddedCaptions\n * @see m2ts/caption-stream.js\n **/\n\n this.parse = function (segment, videoTrackIds, timescales) {\n var parsedData;\n if (!this.isInitialized()) {\n return null; // This is not likely to be a video segment\n } else if (!videoTrackIds || !timescales) {\n return null;\n } else if (this.isNewInit(videoTrackIds, timescales)) {\n // Use the first video track only as there is no\n // mechanism to switch to other video tracks\n trackId = videoTrackIds[0];\n timescale = timescales[trackId]; // If an init segment has not been seen yet, hold onto segment\n // data until we have one.\n // the ISO-BMFF spec says that trackId can't be zero, but there's some broken content out there\n } else if (trackId === null || !timescale) {\n segmentCache.push(segment);\n return null;\n } // Now that a timescale and trackId is set, parse cached segments\n\n while (segmentCache.length > 0) {\n var cachedSegment = segmentCache.shift();\n this.parse(cachedSegment, videoTrackIds, timescales);\n }\n parsedData = parseEmbeddedCaptions(segment, trackId, timescale);\n if (parsedData && parsedData.logs) {\n parsedCaptions.logs = parsedCaptions.logs.concat(parsedData.logs);\n }\n if (parsedData === null || !parsedData.seiNals) {\n if (parsedCaptions.logs.length) {\n return {\n logs: parsedCaptions.logs,\n captions: [],\n captionStreams: []\n };\n }\n return null;\n }\n this.pushNals(parsedData.seiNals); // Force the parsed captions to be dispatched\n\n this.flushStream();\n return parsedCaptions;\n };\n /**\n * Pushes SEI NALUs onto CaptionStream\n * @param {Object[]} nals - A list of SEI nals parsed using `parseCaptionNals`\n * Assumes that `parseCaptionNals` has been called first\n * @see m2ts/caption-stream.js\n **/\n\n this.pushNals = function (nals) {\n if (!this.isInitialized() || !nals || nals.length === 0) {\n return null;\n }\n nals.forEach(function (nal) {\n captionStream.push(nal);\n });\n };\n /**\n * Flushes underlying CaptionStream to dispatch processed, displayable captions\n * @see m2ts/caption-stream.js\n **/\n\n this.flushStream = function () {\n if (!this.isInitialized()) {\n return null;\n }\n if (!parsingPartial) {\n captionStream.flush();\n } else {\n captionStream.partialFlush();\n }\n };\n /**\n * Reset caption buckets for new data\n **/\n\n this.clearParsedCaptions = function () {\n parsedCaptions.captions = [];\n parsedCaptions.captionStreams = {};\n parsedCaptions.logs = [];\n };\n /**\n * Resets underlying CaptionStream\n * @see m2ts/caption-stream.js\n **/\n\n this.resetCaptionStream = function () {\n if (!this.isInitialized()) {\n return null;\n }\n captionStream.reset();\n };\n /**\n * Convenience method to clear all captions flushed from the\n * CaptionStream and still being parsed\n * @see m2ts/caption-stream.js\n **/\n\n this.clearAllCaptions = function () {\n this.clearParsedCaptions();\n this.resetCaptionStream();\n };\n /**\n * Reset caption parser\n **/\n\n this.reset = function () {\n segmentCache = [];\n trackId = null;\n timescale = null;\n if (!parsedCaptions) {\n parsedCaptions = {\n captions: [],\n // CC1, CC2, CC3, CC4\n captionStreams: {},\n logs: []\n };\n } else {\n this.clearParsedCaptions();\n }\n this.resetCaptionStream();\n };\n this.reset();\n };\n var captionParser = CaptionParser;\n /**\n * Returns the first string in the data array ending with a null char '\\0'\n * @param {UInt8} data \n * @returns the string with the null char\n */\n\n var uint8ToCString$1 = function (data) {\n var index = 0;\n var curChar = String.fromCharCode(data[index]);\n var retString = '';\n while (curChar !== '\\0') {\n retString += curChar;\n index++;\n curChar = String.fromCharCode(data[index]);\n } // Add nullChar\n\n retString += curChar;\n return retString;\n };\n var string = {\n uint8ToCString: uint8ToCString$1\n };\n var uint8ToCString = string.uint8ToCString;\n var getUint64$1 = numbers.getUint64;\n /**\n * Based on: ISO/IEC 23009 Section: 5.10.3.3\n * References:\n * https://dashif-documents.azurewebsites.net/Events/master/event.html#emsg-format\n * https://aomediacodec.github.io/id3-emsg/\n * \n * Takes emsg box data as a uint8 array and returns a emsg box object\n * @param {UInt8Array} boxData data from emsg box\n * @returns A parsed emsg box object\n */\n\n var parseEmsgBox = function (boxData) {\n // version + flags\n var offset = 4;\n var version = boxData[0];\n var scheme_id_uri, value, timescale, presentation_time, presentation_time_delta, event_duration, id, message_data;\n if (version === 0) {\n scheme_id_uri = uint8ToCString(boxData.subarray(offset));\n offset += scheme_id_uri.length;\n value = uint8ToCString(boxData.subarray(offset));\n offset += value.length;\n var dv = new DataView(boxData.buffer);\n timescale = dv.getUint32(offset);\n offset += 4;\n presentation_time_delta = dv.getUint32(offset);\n offset += 4;\n event_duration = dv.getUint32(offset);\n offset += 4;\n id = dv.getUint32(offset);\n offset += 4;\n } else if (version === 1) {\n var dv = new DataView(boxData.buffer);\n timescale = dv.getUint32(offset);\n offset += 4;\n presentation_time = getUint64$1(boxData.subarray(offset));\n offset += 8;\n event_duration = dv.getUint32(offset);\n offset += 4;\n id = dv.getUint32(offset);\n offset += 4;\n scheme_id_uri = uint8ToCString(boxData.subarray(offset));\n offset += scheme_id_uri.length;\n value = uint8ToCString(boxData.subarray(offset));\n offset += value.length;\n }\n message_data = new Uint8Array(boxData.subarray(offset, boxData.byteLength));\n var emsgBox = {\n scheme_id_uri,\n value,\n // if timescale is undefined or 0 set to 1 \n timescale: timescale ? timescale : 1,\n presentation_time,\n presentation_time_delta,\n event_duration,\n id,\n message_data\n };\n return isValidEmsgBox(version, emsgBox) ? emsgBox : undefined;\n };\n /**\n * Scales a presentation time or time delta with an offset with a provided timescale\n * @param {number} presentationTime \n * @param {number} timescale \n * @param {number} timeDelta \n * @param {number} offset \n * @returns the scaled time as a number\n */\n\n var scaleTime = function (presentationTime, timescale, timeDelta, offset) {\n return presentationTime || presentationTime === 0 ? presentationTime / timescale : offset + timeDelta / timescale;\n };\n /**\n * Checks the emsg box data for validity based on the version\n * @param {number} version of the emsg box to validate\n * @param {Object} emsg the emsg data to validate\n * @returns if the box is valid as a boolean\n */\n\n var isValidEmsgBox = function (version, emsg) {\n var hasScheme = emsg.scheme_id_uri !== '\\0';\n var isValidV0Box = version === 0 && isDefined(emsg.presentation_time_delta) && hasScheme;\n var isValidV1Box = version === 1 && isDefined(emsg.presentation_time) && hasScheme; // Only valid versions of emsg are 0 and 1\n\n return !(version > 1) && isValidV0Box || isValidV1Box;\n }; // Utility function to check if an object is defined\n\n var isDefined = function (data) {\n return data !== undefined || data !== null;\n };\n var emsg$1 = {\n parseEmsgBox: parseEmsgBox,\n scaleTime: scaleTime\n };\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n *\n * Utilities to detect basic properties and metadata about MP4s.\n */\n\n var toUnsigned = bin.toUnsigned;\n var toHexString = bin.toHexString;\n var findBox = findBox_1;\n var parseType$1 = parseType_1;\n var emsg = emsg$1;\n var parseTfhd = parseTfhd$2;\n var parseTrun = parseTrun$2;\n var parseTfdt = parseTfdt$2;\n var getUint64 = numbers.getUint64;\n var timescale, startTime, compositionStartTime, getVideoTrackIds, getTracks, getTimescaleFromMediaHeader, getEmsgID3;\n var window$1 = window_1;\n var parseId3Frames = parseId3.parseId3Frames;\n /**\n * Parses an MP4 initialization segment and extracts the timescale\n * values for any declared tracks. Timescale values indicate the\n * number of clock ticks per second to assume for time-based values\n * elsewhere in the MP4.\n *\n * To determine the start time of an MP4, you need two pieces of\n * information: the timescale unit and the earliest base media decode\n * time. Multiple timescales can be specified within an MP4 but the\n * base media decode time is always expressed in the timescale from\n * the media header box for the track:\n * ```\n * moov > trak > mdia > mdhd.timescale\n * ```\n * @param init {Uint8Array} the bytes of the init segment\n * @return {object} a hash of track ids to timescale values or null if\n * the init segment is malformed.\n */\n\n timescale = function (init) {\n var result = {},\n traks = findBox(init, ['moov', 'trak']); // mdhd timescale\n\n return traks.reduce(function (result, trak) {\n var tkhd, version, index, id, mdhd;\n tkhd = findBox(trak, ['tkhd'])[0];\n if (!tkhd) {\n return null;\n }\n version = tkhd[0];\n index = version === 0 ? 12 : 20;\n id = toUnsigned(tkhd[index] << 24 | tkhd[index + 1] << 16 | tkhd[index + 2] << 8 | tkhd[index + 3]);\n mdhd = findBox(trak, ['mdia', 'mdhd'])[0];\n if (!mdhd) {\n return null;\n }\n version = mdhd[0];\n index = version === 0 ? 12 : 20;\n result[id] = toUnsigned(mdhd[index] << 24 | mdhd[index + 1] << 16 | mdhd[index + 2] << 8 | mdhd[index + 3]);\n return result;\n }, result);\n };\n /**\n * Determine the base media decode start time, in seconds, for an MP4\n * fragment. If multiple fragments are specified, the earliest time is\n * returned.\n *\n * The base media decode time can be parsed from track fragment\n * metadata:\n * ```\n * moof > traf > tfdt.baseMediaDecodeTime\n * ```\n * It requires the timescale value from the mdhd to interpret.\n *\n * @param timescale {object} a hash of track ids to timescale values.\n * @return {number} the earliest base media decode start time for the\n * fragment, in seconds\n */\n\n startTime = function (timescale, fragment) {\n var trafs; // we need info from two childrend of each track fragment box\n\n trafs = findBox(fragment, ['moof', 'traf']); // determine the start times for each track\n\n var lowestTime = trafs.reduce(function (acc, traf) {\n var tfhd = findBox(traf, ['tfhd'])[0]; // get the track id from the tfhd\n\n var id = toUnsigned(tfhd[4] << 24 | tfhd[5] << 16 | tfhd[6] << 8 | tfhd[7]); // assume a 90kHz clock if no timescale was specified\n\n var scale = timescale[id] || 90e3; // get the base media decode time from the tfdt\n\n var tfdt = findBox(traf, ['tfdt'])[0];\n var dv = new DataView(tfdt.buffer, tfdt.byteOffset, tfdt.byteLength);\n var baseTime; // version 1 is 64 bit\n\n if (tfdt[0] === 1) {\n baseTime = getUint64(tfdt.subarray(4, 12));\n } else {\n baseTime = dv.getUint32(4);\n } // convert base time to seconds if it is a valid number.\n\n let seconds;\n if (typeof baseTime === 'bigint') {\n seconds = baseTime / window$1.BigInt(scale);\n } else if (typeof baseTime === 'number' && !isNaN(baseTime)) {\n seconds = baseTime / scale;\n }\n if (seconds < Number.MAX_SAFE_INTEGER) {\n seconds = Number(seconds);\n }\n if (seconds < acc) {\n acc = seconds;\n }\n return acc;\n }, Infinity);\n return typeof lowestTime === 'bigint' || isFinite(lowestTime) ? lowestTime : 0;\n };\n /**\n * Determine the composition start, in seconds, for an MP4\n * fragment.\n *\n * The composition start time of a fragment can be calculated using the base\n * media decode time, composition time offset, and timescale, as follows:\n *\n * compositionStartTime = (baseMediaDecodeTime + compositionTimeOffset) / timescale\n *\n * All of the aforementioned information is contained within a media fragment's\n * `traf` box, except for timescale info, which comes from the initialization\n * segment, so a track id (also contained within a `traf`) is also necessary to\n * associate it with a timescale\n *\n *\n * @param timescales {object} - a hash of track ids to timescale values.\n * @param fragment {Unit8Array} - the bytes of a media segment\n * @return {number} the composition start time for the fragment, in seconds\n **/\n\n compositionStartTime = function (timescales, fragment) {\n var trafBoxes = findBox(fragment, ['moof', 'traf']);\n var baseMediaDecodeTime = 0;\n var compositionTimeOffset = 0;\n var trackId;\n if (trafBoxes && trafBoxes.length) {\n // The spec states that track run samples contained within a `traf` box are contiguous, but\n // it does not explicitly state whether the `traf` boxes themselves are contiguous.\n // We will assume that they are, so we only need the first to calculate start time.\n var tfhd = findBox(trafBoxes[0], ['tfhd'])[0];\n var trun = findBox(trafBoxes[0], ['trun'])[0];\n var tfdt = findBox(trafBoxes[0], ['tfdt'])[0];\n if (tfhd) {\n var parsedTfhd = parseTfhd(tfhd);\n trackId = parsedTfhd.trackId;\n }\n if (tfdt) {\n var parsedTfdt = parseTfdt(tfdt);\n baseMediaDecodeTime = parsedTfdt.baseMediaDecodeTime;\n }\n if (trun) {\n var parsedTrun = parseTrun(trun);\n if (parsedTrun.samples && parsedTrun.samples.length) {\n compositionTimeOffset = parsedTrun.samples[0].compositionTimeOffset || 0;\n }\n }\n } // Get timescale for this specific track. Assume a 90kHz clock if no timescale was\n // specified.\n\n var timescale = timescales[trackId] || 90e3; // return the composition start time, in seconds\n\n if (typeof baseMediaDecodeTime === 'bigint') {\n compositionTimeOffset = window$1.BigInt(compositionTimeOffset);\n timescale = window$1.BigInt(timescale);\n }\n var result = (baseMediaDecodeTime + compositionTimeOffset) / timescale;\n if (typeof result === 'bigint' && result < Number.MAX_SAFE_INTEGER) {\n result = Number(result);\n }\n return result;\n };\n /**\n * Find the trackIds of the video tracks in this source.\n * Found by parsing the Handler Reference and Track Header Boxes:\n * moov > trak > mdia > hdlr\n * moov > trak > tkhd\n *\n * @param {Uint8Array} init - The bytes of the init segment for this source\n * @return {Number[]} A list of trackIds\n *\n * @see ISO-BMFF-12/2015, Section 8.4.3\n **/\n\n getVideoTrackIds = function (init) {\n var traks = findBox(init, ['moov', 'trak']);\n var videoTrackIds = [];\n traks.forEach(function (trak) {\n var hdlrs = findBox(trak, ['mdia', 'hdlr']);\n var tkhds = findBox(trak, ['tkhd']);\n hdlrs.forEach(function (hdlr, index) {\n var handlerType = parseType$1(hdlr.subarray(8, 12));\n var tkhd = tkhds[index];\n var view;\n var version;\n var trackId;\n if (handlerType === 'vide') {\n view = new DataView(tkhd.buffer, tkhd.byteOffset, tkhd.byteLength);\n version = view.getUint8(0);\n trackId = version === 0 ? view.getUint32(12) : view.getUint32(20);\n videoTrackIds.push(trackId);\n }\n });\n });\n return videoTrackIds;\n };\n getTimescaleFromMediaHeader = function (mdhd) {\n // mdhd is a FullBox, meaning it will have its own version as the first byte\n var version = mdhd[0];\n var index = version === 0 ? 12 : 20;\n return toUnsigned(mdhd[index] << 24 | mdhd[index + 1] << 16 | mdhd[index + 2] << 8 | mdhd[index + 3]);\n };\n /**\n * Get all the video, audio, and hint tracks from a non fragmented\n * mp4 segment\n */\n\n getTracks = function (init) {\n var traks = findBox(init, ['moov', 'trak']);\n var tracks = [];\n traks.forEach(function (trak) {\n var track = {};\n var tkhd = findBox(trak, ['tkhd'])[0];\n var view, tkhdVersion; // id\n\n if (tkhd) {\n view = new DataView(tkhd.buffer, tkhd.byteOffset, tkhd.byteLength);\n tkhdVersion = view.getUint8(0);\n track.id = tkhdVersion === 0 ? view.getUint32(12) : view.getUint32(20);\n }\n var hdlr = findBox(trak, ['mdia', 'hdlr'])[0]; // type\n\n if (hdlr) {\n var type = parseType$1(hdlr.subarray(8, 12));\n if (type === 'vide') {\n track.type = 'video';\n } else if (type === 'soun') {\n track.type = 'audio';\n } else {\n track.type = type;\n }\n } // codec\n\n var stsd = findBox(trak, ['mdia', 'minf', 'stbl', 'stsd'])[0];\n if (stsd) {\n var sampleDescriptions = stsd.subarray(8); // gives the codec type string\n\n track.codec = parseType$1(sampleDescriptions.subarray(4, 8));\n var codecBox = findBox(sampleDescriptions, [track.codec])[0];\n var codecConfig, codecConfigType;\n if (codecBox) {\n // https://tools.ietf.org/html/rfc6381#section-3.3\n if (/^[asm]vc[1-9]$/i.test(track.codec)) {\n // we don't need anything but the \"config\" parameter of the\n // avc1 codecBox\n codecConfig = codecBox.subarray(78);\n codecConfigType = parseType$1(codecConfig.subarray(4, 8));\n if (codecConfigType === 'avcC' && codecConfig.length > 11) {\n track.codec += '.'; // left padded with zeroes for single digit hex\n // profile idc\n\n track.codec += toHexString(codecConfig[9]); // the byte containing the constraint_set flags\n\n track.codec += toHexString(codecConfig[10]); // level idc\n\n track.codec += toHexString(codecConfig[11]);\n } else {\n // TODO: show a warning that we couldn't parse the codec\n // and are using the default\n track.codec = 'avc1.4d400d';\n }\n } else if (/^mp4[a,v]$/i.test(track.codec)) {\n // we do not need anything but the streamDescriptor of the mp4a codecBox\n codecConfig = codecBox.subarray(28);\n codecConfigType = parseType$1(codecConfig.subarray(4, 8));\n if (codecConfigType === 'esds' && codecConfig.length > 20 && codecConfig[19] !== 0) {\n track.codec += '.' + toHexString(codecConfig[19]); // this value is only a single digit\n\n track.codec += '.' + toHexString(codecConfig[20] >>> 2 & 0x3f).replace(/^0/, '');\n } else {\n // TODO: show a warning that we couldn't parse the codec\n // and are using the default\n track.codec = 'mp4a.40.2';\n }\n } else {\n // flac, opus, etc\n track.codec = track.codec.toLowerCase();\n }\n }\n }\n var mdhd = findBox(trak, ['mdia', 'mdhd'])[0];\n if (mdhd) {\n track.timescale = getTimescaleFromMediaHeader(mdhd);\n }\n tracks.push(track);\n });\n return tracks;\n };\n /**\n * Returns an array of emsg ID3 data from the provided segmentData.\n * An offset can also be provided as the Latest Arrival Time to calculate \n * the Event Start Time of v0 EMSG boxes. \n * See: https://dashif-documents.azurewebsites.net/Events/master/event.html#Inband-event-timing\n * \n * @param {Uint8Array} segmentData the segment byte array.\n * @param {number} offset the segment start time or Latest Arrival Time, \n * @return {Object[]} an array of ID3 parsed from EMSG boxes\n */\n\n getEmsgID3 = function (segmentData, offset = 0) {\n var emsgBoxes = findBox(segmentData, ['emsg']);\n return emsgBoxes.map(data => {\n var parsedBox = emsg.parseEmsgBox(new Uint8Array(data));\n var parsedId3Frames = parseId3Frames(parsedBox.message_data);\n return {\n cueTime: emsg.scaleTime(parsedBox.presentation_time, parsedBox.timescale, parsedBox.presentation_time_delta, offset),\n duration: emsg.scaleTime(parsedBox.event_duration, parsedBox.timescale),\n frames: parsedId3Frames\n };\n });\n };\n var probe$2 = {\n // export mp4 inspector's findBox and parseType for backwards compatibility\n findBox: findBox,\n parseType: parseType$1,\n timescale: timescale,\n startTime: startTime,\n compositionStartTime: compositionStartTime,\n videoTrackIds: getVideoTrackIds,\n tracks: getTracks,\n getTimescaleFromMediaHeader: getTimescaleFromMediaHeader,\n getEmsgID3: getEmsgID3\n };\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n *\n * Utilities to detect basic properties and metadata about TS Segments.\n */\n\n var StreamTypes$1 = streamTypes;\n var parsePid = function (packet) {\n var pid = packet[1] & 0x1f;\n pid <<= 8;\n pid |= packet[2];\n return pid;\n };\n var parsePayloadUnitStartIndicator = function (packet) {\n return !!(packet[1] & 0x40);\n };\n var parseAdaptionField = function (packet) {\n var offset = 0; // if an adaption field is present, its length is specified by the\n // fifth byte of the TS packet header. The adaptation field is\n // used to add stuffing to PES packets that don't fill a complete\n // TS packet, and to specify some forms of timing and control data\n // that we do not currently use.\n\n if ((packet[3] & 0x30) >>> 4 > 0x01) {\n offset += packet[4] + 1;\n }\n return offset;\n };\n var parseType = function (packet, pmtPid) {\n var pid = parsePid(packet);\n if (pid === 0) {\n return 'pat';\n } else if (pid === pmtPid) {\n return 'pmt';\n } else if (pmtPid) {\n return 'pes';\n }\n return null;\n };\n var parsePat = function (packet) {\n var pusi = parsePayloadUnitStartIndicator(packet);\n var offset = 4 + parseAdaptionField(packet);\n if (pusi) {\n offset += packet[offset] + 1;\n }\n return (packet[offset + 10] & 0x1f) << 8 | packet[offset + 11];\n };\n var parsePmt = function (packet) {\n var programMapTable = {};\n var pusi = parsePayloadUnitStartIndicator(packet);\n var payloadOffset = 4 + parseAdaptionField(packet);\n if (pusi) {\n payloadOffset += packet[payloadOffset] + 1;\n } // PMTs can be sent ahead of the time when they should actually\n // take effect. We don't believe this should ever be the case\n // for HLS but we'll ignore \"forward\" PMT declarations if we see\n // them. Future PMT declarations have the current_next_indicator\n // set to zero.\n\n if (!(packet[payloadOffset + 5] & 0x01)) {\n return;\n }\n var sectionLength, tableEnd, programInfoLength; // the mapping table ends at the end of the current section\n\n sectionLength = (packet[payloadOffset + 1] & 0x0f) << 8 | packet[payloadOffset + 2];\n tableEnd = 3 + sectionLength - 4; // to determine where the table is, we have to figure out how\n // long the program info descriptors are\n\n programInfoLength = (packet[payloadOffset + 10] & 0x0f) << 8 | packet[payloadOffset + 11]; // advance the offset to the first entry in the mapping table\n\n var offset = 12 + programInfoLength;\n while (offset < tableEnd) {\n var i = payloadOffset + offset; // add an entry that maps the elementary_pid to the stream_type\n\n programMapTable[(packet[i + 1] & 0x1F) << 8 | packet[i + 2]] = packet[i]; // move to the next table entry\n // skip past the elementary stream descriptors, if present\n\n offset += ((packet[i + 3] & 0x0F) << 8 | packet[i + 4]) + 5;\n }\n return programMapTable;\n };\n var parsePesType = function (packet, programMapTable) {\n var pid = parsePid(packet);\n var type = programMapTable[pid];\n switch (type) {\n case StreamTypes$1.H264_STREAM_TYPE:\n return 'video';\n case StreamTypes$1.ADTS_STREAM_TYPE:\n return 'audio';\n case StreamTypes$1.METADATA_STREAM_TYPE:\n return 'timed-metadata';\n default:\n return null;\n }\n };\n var parsePesTime = function (packet) {\n var pusi = parsePayloadUnitStartIndicator(packet);\n if (!pusi) {\n return null;\n }\n var offset = 4 + parseAdaptionField(packet);\n if (offset >= packet.byteLength) {\n // From the H 222.0 MPEG-TS spec\n // \"For transport stream packets carrying PES packets, stuffing is needed when there\n // is insufficient PES packet data to completely fill the transport stream packet\n // payload bytes. Stuffing is accomplished by defining an adaptation field longer than\n // the sum of the lengths of the data elements in it, so that the payload bytes\n // remaining after the adaptation field exactly accommodates the available PES packet\n // data.\"\n //\n // If the offset is >= the length of the packet, then the packet contains no data\n // and instead is just adaption field stuffing bytes\n return null;\n }\n var pes = null;\n var ptsDtsFlags; // PES packets may be annotated with a PTS value, or a PTS value\n // and a DTS value. Determine what combination of values is\n // available to work with.\n\n ptsDtsFlags = packet[offset + 7]; // PTS and DTS are normally stored as a 33-bit number. Javascript\n // performs all bitwise operations on 32-bit integers but javascript\n // supports a much greater range (52-bits) of integer using standard\n // mathematical operations.\n // We construct a 31-bit value using bitwise operators over the 31\n // most significant bits and then multiply by 4 (equal to a left-shift\n // of 2) before we add the final 2 least significant bits of the\n // timestamp (equal to an OR.)\n\n if (ptsDtsFlags & 0xC0) {\n pes = {}; // the PTS and DTS are not written out directly. For information\n // on how they are encoded, see\n // http://dvd.sourceforge.net/dvdinfo/pes-hdr.html\n\n pes.pts = (packet[offset + 9] & 0x0E) << 27 | (packet[offset + 10] & 0xFF) << 20 | (packet[offset + 11] & 0xFE) << 12 | (packet[offset + 12] & 0xFF) << 5 | (packet[offset + 13] & 0xFE) >>> 3;\n pes.pts *= 4; // Left shift by 2\n\n pes.pts += (packet[offset + 13] & 0x06) >>> 1; // OR by the two LSBs\n\n pes.dts = pes.pts;\n if (ptsDtsFlags & 0x40) {\n pes.dts = (packet[offset + 14] & 0x0E) << 27 | (packet[offset + 15] & 0xFF) << 20 | (packet[offset + 16] & 0xFE) << 12 | (packet[offset + 17] & 0xFF) << 5 | (packet[offset + 18] & 0xFE) >>> 3;\n pes.dts *= 4; // Left shift by 2\n\n pes.dts += (packet[offset + 18] & 0x06) >>> 1; // OR by the two LSBs\n }\n }\n\n return pes;\n };\n var parseNalUnitType = function (type) {\n switch (type) {\n case 0x05:\n return 'slice_layer_without_partitioning_rbsp_idr';\n case 0x06:\n return 'sei_rbsp';\n case 0x07:\n return 'seq_parameter_set_rbsp';\n case 0x08:\n return 'pic_parameter_set_rbsp';\n case 0x09:\n return 'access_unit_delimiter_rbsp';\n default:\n return null;\n }\n };\n var videoPacketContainsKeyFrame = function (packet) {\n var offset = 4 + parseAdaptionField(packet);\n var frameBuffer = packet.subarray(offset);\n var frameI = 0;\n var frameSyncPoint = 0;\n var foundKeyFrame = false;\n var nalType; // advance the sync point to a NAL start, if necessary\n\n for (; frameSyncPoint < frameBuffer.byteLength - 3; frameSyncPoint++) {\n if (frameBuffer[frameSyncPoint + 2] === 1) {\n // the sync point is properly aligned\n frameI = frameSyncPoint + 5;\n break;\n }\n }\n while (frameI < frameBuffer.byteLength) {\n // look at the current byte to determine if we've hit the end of\n // a NAL unit boundary\n switch (frameBuffer[frameI]) {\n case 0:\n // skip past non-sync sequences\n if (frameBuffer[frameI - 1] !== 0) {\n frameI += 2;\n break;\n } else if (frameBuffer[frameI - 2] !== 0) {\n frameI++;\n break;\n }\n if (frameSyncPoint + 3 !== frameI - 2) {\n nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 0x1f);\n if (nalType === 'slice_layer_without_partitioning_rbsp_idr') {\n foundKeyFrame = true;\n }\n } // drop trailing zeroes\n\n do {\n frameI++;\n } while (frameBuffer[frameI] !== 1 && frameI < frameBuffer.length);\n frameSyncPoint = frameI - 2;\n frameI += 3;\n break;\n case 1:\n // skip past non-sync sequences\n if (frameBuffer[frameI - 1] !== 0 || frameBuffer[frameI - 2] !== 0) {\n frameI += 3;\n break;\n }\n nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 0x1f);\n if (nalType === 'slice_layer_without_partitioning_rbsp_idr') {\n foundKeyFrame = true;\n }\n frameSyncPoint = frameI - 2;\n frameI += 3;\n break;\n default:\n // the current byte isn't a one or zero, so it cannot be part\n // of a sync sequence\n frameI += 3;\n break;\n }\n }\n frameBuffer = frameBuffer.subarray(frameSyncPoint);\n frameI -= frameSyncPoint;\n frameSyncPoint = 0; // parse the final nal\n\n if (frameBuffer && frameBuffer.byteLength > 3) {\n nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 0x1f);\n if (nalType === 'slice_layer_without_partitioning_rbsp_idr') {\n foundKeyFrame = true;\n }\n }\n return foundKeyFrame;\n };\n var probe$1 = {\n parseType: parseType,\n parsePat: parsePat,\n parsePmt: parsePmt,\n parsePayloadUnitStartIndicator: parsePayloadUnitStartIndicator,\n parsePesType: parsePesType,\n parsePesTime: parsePesTime,\n videoPacketContainsKeyFrame: videoPacketContainsKeyFrame\n };\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n *\n * Parse mpeg2 transport stream packets to extract basic timing information\n */\n\n var StreamTypes = streamTypes;\n var handleRollover = timestampRolloverStream.handleRollover;\n var probe = {};\n probe.ts = probe$1;\n probe.aac = utils;\n var ONE_SECOND_IN_TS = clock$2.ONE_SECOND_IN_TS;\n var MP2T_PACKET_LENGTH = 188,\n // bytes\n SYNC_BYTE = 0x47;\n /**\n * walks through segment data looking for pat and pmt packets to parse out\n * program map table information\n */\n\n var parsePsi_ = function (bytes, pmt) {\n var startIndex = 0,\n endIndex = MP2T_PACKET_LENGTH,\n packet,\n type;\n while (endIndex < bytes.byteLength) {\n // Look for a pair of start and end sync bytes in the data..\n if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {\n // We found a packet\n packet = bytes.subarray(startIndex, endIndex);\n type = probe.ts.parseType(packet, pmt.pid);\n switch (type) {\n case 'pat':\n pmt.pid = probe.ts.parsePat(packet);\n break;\n case 'pmt':\n var table = probe.ts.parsePmt(packet);\n pmt.table = pmt.table || {};\n Object.keys(table).forEach(function (key) {\n pmt.table[key] = table[key];\n });\n break;\n }\n startIndex += MP2T_PACKET_LENGTH;\n endIndex += MP2T_PACKET_LENGTH;\n continue;\n } // If we get here, we have somehow become de-synchronized and we need to step\n // forward one byte at a time until we find a pair of sync bytes that denote\n // a packet\n\n startIndex++;\n endIndex++;\n }\n };\n /**\n * walks through the segment data from the start and end to get timing information\n * for the first and last audio pes packets\n */\n\n var parseAudioPes_ = function (bytes, pmt, result) {\n var startIndex = 0,\n endIndex = MP2T_PACKET_LENGTH,\n packet,\n type,\n pesType,\n pusi,\n parsed;\n var endLoop = false; // Start walking from start of segment to get first audio packet\n\n while (endIndex <= bytes.byteLength) {\n // Look for a pair of start and end sync bytes in the data..\n if (bytes[startIndex] === SYNC_BYTE && (bytes[endIndex] === SYNC_BYTE || endIndex === bytes.byteLength)) {\n // We found a packet\n packet = bytes.subarray(startIndex, endIndex);\n type = probe.ts.parseType(packet, pmt.pid);\n switch (type) {\n case 'pes':\n pesType = probe.ts.parsePesType(packet, pmt.table);\n pusi = probe.ts.parsePayloadUnitStartIndicator(packet);\n if (pesType === 'audio' && pusi) {\n parsed = probe.ts.parsePesTime(packet);\n if (parsed) {\n parsed.type = 'audio';\n result.audio.push(parsed);\n endLoop = true;\n }\n }\n break;\n }\n if (endLoop) {\n break;\n }\n startIndex += MP2T_PACKET_LENGTH;\n endIndex += MP2T_PACKET_LENGTH;\n continue;\n } // If we get here, we have somehow become de-synchronized and we need to step\n // forward one byte at a time until we find a pair of sync bytes that denote\n // a packet\n\n startIndex++;\n endIndex++;\n } // Start walking from end of segment to get last audio packet\n\n endIndex = bytes.byteLength;\n startIndex = endIndex - MP2T_PACKET_LENGTH;\n endLoop = false;\n while (startIndex >= 0) {\n // Look for a pair of start and end sync bytes in the data..\n if (bytes[startIndex] === SYNC_BYTE && (bytes[endIndex] === SYNC_BYTE || endIndex === bytes.byteLength)) {\n // We found a packet\n packet = bytes.subarray(startIndex, endIndex);\n type = probe.ts.parseType(packet, pmt.pid);\n switch (type) {\n case 'pes':\n pesType = probe.ts.parsePesType(packet, pmt.table);\n pusi = probe.ts.parsePayloadUnitStartIndicator(packet);\n if (pesType === 'audio' && pusi) {\n parsed = probe.ts.parsePesTime(packet);\n if (parsed) {\n parsed.type = 'audio';\n result.audio.push(parsed);\n endLoop = true;\n }\n }\n break;\n }\n if (endLoop) {\n break;\n }\n startIndex -= MP2T_PACKET_LENGTH;\n endIndex -= MP2T_PACKET_LENGTH;\n continue;\n } // If we get here, we have somehow become de-synchronized and we need to step\n // forward one byte at a time until we find a pair of sync bytes that denote\n // a packet\n\n startIndex--;\n endIndex--;\n }\n };\n /**\n * walks through the segment data from the start and end to get timing information\n * for the first and last video pes packets as well as timing information for the first\n * key frame.\n */\n\n var parseVideoPes_ = function (bytes, pmt, result) {\n var startIndex = 0,\n endIndex = MP2T_PACKET_LENGTH,\n packet,\n type,\n pesType,\n pusi,\n parsed,\n frame,\n i,\n pes;\n var endLoop = false;\n var currentFrame = {\n data: [],\n size: 0\n }; // Start walking from start of segment to get first video packet\n\n while (endIndex < bytes.byteLength) {\n // Look for a pair of start and end sync bytes in the data..\n if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {\n // We found a packet\n packet = bytes.subarray(startIndex, endIndex);\n type = probe.ts.parseType(packet, pmt.pid);\n switch (type) {\n case 'pes':\n pesType = probe.ts.parsePesType(packet, pmt.table);\n pusi = probe.ts.parsePayloadUnitStartIndicator(packet);\n if (pesType === 'video') {\n if (pusi && !endLoop) {\n parsed = probe.ts.parsePesTime(packet);\n if (parsed) {\n parsed.type = 'video';\n result.video.push(parsed);\n endLoop = true;\n }\n }\n if (!result.firstKeyFrame) {\n if (pusi) {\n if (currentFrame.size !== 0) {\n frame = new Uint8Array(currentFrame.size);\n i = 0;\n while (currentFrame.data.length) {\n pes = currentFrame.data.shift();\n frame.set(pes, i);\n i += pes.byteLength;\n }\n if (probe.ts.videoPacketContainsKeyFrame(frame)) {\n var firstKeyFrame = probe.ts.parsePesTime(frame); // PTS/DTS may not be available. Simply *not* setting\n // the keyframe seems to work fine with HLS playback\n // and definitely preferable to a crash with TypeError...\n\n if (firstKeyFrame) {\n result.firstKeyFrame = firstKeyFrame;\n result.firstKeyFrame.type = 'video';\n } else {\n // eslint-disable-next-line\n console.warn('Failed to extract PTS/DTS from PES at first keyframe. ' + 'This could be an unusual TS segment, or else mux.js did not ' + 'parse your TS segment correctly. If you know your TS ' + 'segments do contain PTS/DTS on keyframes please file a bug ' + 'report! You can try ffprobe to double check for yourself.');\n }\n }\n currentFrame.size = 0;\n }\n }\n currentFrame.data.push(packet);\n currentFrame.size += packet.byteLength;\n }\n }\n break;\n }\n if (endLoop && result.firstKeyFrame) {\n break;\n }\n startIndex += MP2T_PACKET_LENGTH;\n endIndex += MP2T_PACKET_LENGTH;\n continue;\n } // If we get here, we have somehow become de-synchronized and we need to step\n // forward one byte at a time until we find a pair of sync bytes that denote\n // a packet\n\n startIndex++;\n endIndex++;\n } // Start walking from end of segment to get last video packet\n\n endIndex = bytes.byteLength;\n startIndex = endIndex - MP2T_PACKET_LENGTH;\n endLoop = false;\n while (startIndex >= 0) {\n // Look for a pair of start and end sync bytes in the data..\n if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {\n // We found a packet\n packet = bytes.subarray(startIndex, endIndex);\n type = probe.ts.parseType(packet, pmt.pid);\n switch (type) {\n case 'pes':\n pesType = probe.ts.parsePesType(packet, pmt.table);\n pusi = probe.ts.parsePayloadUnitStartIndicator(packet);\n if (pesType === 'video' && pusi) {\n parsed = probe.ts.parsePesTime(packet);\n if (parsed) {\n parsed.type = 'video';\n result.video.push(parsed);\n endLoop = true;\n }\n }\n break;\n }\n if (endLoop) {\n break;\n }\n startIndex -= MP2T_PACKET_LENGTH;\n endIndex -= MP2T_PACKET_LENGTH;\n continue;\n } // If we get here, we have somehow become de-synchronized and we need to step\n // forward one byte at a time until we find a pair of sync bytes that denote\n // a packet\n\n startIndex--;\n endIndex--;\n }\n };\n /**\n * Adjusts the timestamp information for the segment to account for\n * rollover and convert to seconds based on pes packet timescale (90khz clock)\n */\n\n var adjustTimestamp_ = function (segmentInfo, baseTimestamp) {\n if (segmentInfo.audio && segmentInfo.audio.length) {\n var audioBaseTimestamp = baseTimestamp;\n if (typeof audioBaseTimestamp === 'undefined' || isNaN(audioBaseTimestamp)) {\n audioBaseTimestamp = segmentInfo.audio[0].dts;\n }\n segmentInfo.audio.forEach(function (info) {\n info.dts = handleRollover(info.dts, audioBaseTimestamp);\n info.pts = handleRollover(info.pts, audioBaseTimestamp); // time in seconds\n\n info.dtsTime = info.dts / ONE_SECOND_IN_TS;\n info.ptsTime = info.pts / ONE_SECOND_IN_TS;\n });\n }\n if (segmentInfo.video && segmentInfo.video.length) {\n var videoBaseTimestamp = baseTimestamp;\n if (typeof videoBaseTimestamp === 'undefined' || isNaN(videoBaseTimestamp)) {\n videoBaseTimestamp = segmentInfo.video[0].dts;\n }\n segmentInfo.video.forEach(function (info) {\n info.dts = handleRollover(info.dts, videoBaseTimestamp);\n info.pts = handleRollover(info.pts, videoBaseTimestamp); // time in seconds\n\n info.dtsTime = info.dts / ONE_SECOND_IN_TS;\n info.ptsTime = info.pts / ONE_SECOND_IN_TS;\n });\n if (segmentInfo.firstKeyFrame) {\n var frame = segmentInfo.firstKeyFrame;\n frame.dts = handleRollover(frame.dts, videoBaseTimestamp);\n frame.pts = handleRollover(frame.pts, videoBaseTimestamp); // time in seconds\n\n frame.dtsTime = frame.dts / ONE_SECOND_IN_TS;\n frame.ptsTime = frame.pts / ONE_SECOND_IN_TS;\n }\n }\n };\n /**\n * inspects the aac data stream for start and end time information\n */\n\n var inspectAac_ = function (bytes) {\n var endLoop = false,\n audioCount = 0,\n sampleRate = null,\n timestamp = null,\n frameSize = 0,\n byteIndex = 0,\n packet;\n while (bytes.length - byteIndex >= 3) {\n var type = probe.aac.parseType(bytes, byteIndex);\n switch (type) {\n case 'timed-metadata':\n // Exit early because we don't have enough to parse\n // the ID3 tag header\n if (bytes.length - byteIndex < 10) {\n endLoop = true;\n break;\n }\n frameSize = probe.aac.parseId3TagSize(bytes, byteIndex); // Exit early if we don't have enough in the buffer\n // to emit a full packet\n\n if (frameSize > bytes.length) {\n endLoop = true;\n break;\n }\n if (timestamp === null) {\n packet = bytes.subarray(byteIndex, byteIndex + frameSize);\n timestamp = probe.aac.parseAacTimestamp(packet);\n }\n byteIndex += frameSize;\n break;\n case 'audio':\n // Exit early because we don't have enough to parse\n // the ADTS frame header\n if (bytes.length - byteIndex < 7) {\n endLoop = true;\n break;\n }\n frameSize = probe.aac.parseAdtsSize(bytes, byteIndex); // Exit early if we don't have enough in the buffer\n // to emit a full packet\n\n if (frameSize > bytes.length) {\n endLoop = true;\n break;\n }\n if (sampleRate === null) {\n packet = bytes.subarray(byteIndex, byteIndex + frameSize);\n sampleRate = probe.aac.parseSampleRate(packet);\n }\n audioCount++;\n byteIndex += frameSize;\n break;\n default:\n byteIndex++;\n break;\n }\n if (endLoop) {\n return null;\n }\n }\n if (sampleRate === null || timestamp === null) {\n return null;\n }\n var audioTimescale = ONE_SECOND_IN_TS / sampleRate;\n var result = {\n audio: [{\n type: 'audio',\n dts: timestamp,\n pts: timestamp\n }, {\n type: 'audio',\n dts: timestamp + audioCount * 1024 * audioTimescale,\n pts: timestamp + audioCount * 1024 * audioTimescale\n }]\n };\n return result;\n };\n /**\n * inspects the transport stream segment data for start and end time information\n * of the audio and video tracks (when present) as well as the first key frame's\n * start time.\n */\n\n var inspectTs_ = function (bytes) {\n var pmt = {\n pid: null,\n table: null\n };\n var result = {};\n parsePsi_(bytes, pmt);\n for (var pid in pmt.table) {\n if (pmt.table.hasOwnProperty(pid)) {\n var type = pmt.table[pid];\n switch (type) {\n case StreamTypes.H264_STREAM_TYPE:\n result.video = [];\n parseVideoPes_(bytes, pmt, result);\n if (result.video.length === 0) {\n delete result.video;\n }\n break;\n case StreamTypes.ADTS_STREAM_TYPE:\n result.audio = [];\n parseAudioPes_(bytes, pmt, result);\n if (result.audio.length === 0) {\n delete result.audio;\n }\n break;\n }\n }\n }\n return result;\n };\n /**\n * Inspects segment byte data and returns an object with start and end timing information\n *\n * @param {Uint8Array} bytes The segment byte data\n * @param {Number} baseTimestamp Relative reference timestamp used when adjusting frame\n * timestamps for rollover. This value must be in 90khz clock.\n * @return {Object} Object containing start and end frame timing info of segment.\n */\n\n var inspect = function (bytes, baseTimestamp) {\n var isAacData = probe.aac.isLikelyAacData(bytes);\n var result;\n if (isAacData) {\n result = inspectAac_(bytes);\n } else {\n result = inspectTs_(bytes);\n }\n if (!result || !result.audio && !result.video) {\n return null;\n }\n adjustTimestamp_(result, baseTimestamp);\n return result;\n };\n var tsInspector = {\n inspect: inspect,\n parseAudioPes_: parseAudioPes_\n };\n /* global self */\n\n /**\n * Re-emits transmuxer events by converting them into messages to the\n * world outside the worker.\n *\n * @param {Object} transmuxer the transmuxer to wire events on\n * @private\n */\n\n const wireTransmuxerEvents = function (self, transmuxer) {\n transmuxer.on('data', function (segment) {\n // transfer ownership of the underlying ArrayBuffer\n // instead of doing a copy to save memory\n // ArrayBuffers are transferable but generic TypedArrays are not\n // @link https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers#Passing_data_by_transferring_ownership_(transferable_objects)\n const initArray = segment.initSegment;\n segment.initSegment = {\n data: initArray.buffer,\n byteOffset: initArray.byteOffset,\n byteLength: initArray.byteLength\n };\n const typedArray = segment.data;\n segment.data = typedArray.buffer;\n self.postMessage({\n action: 'data',\n segment,\n byteOffset: typedArray.byteOffset,\n byteLength: typedArray.byteLength\n }, [segment.data]);\n });\n transmuxer.on('done', function (data) {\n self.postMessage({\n action: 'done'\n });\n });\n transmuxer.on('gopInfo', function (gopInfo) {\n self.postMessage({\n action: 'gopInfo',\n gopInfo\n });\n });\n transmuxer.on('videoSegmentTimingInfo', function (timingInfo) {\n const videoSegmentTimingInfo = {\n start: {\n decode: clock$2.videoTsToSeconds(timingInfo.start.dts),\n presentation: clock$2.videoTsToSeconds(timingInfo.start.pts)\n },\n end: {\n decode: clock$2.videoTsToSeconds(timingInfo.end.dts),\n presentation: clock$2.videoTsToSeconds(timingInfo.end.pts)\n },\n baseMediaDecodeTime: clock$2.videoTsToSeconds(timingInfo.baseMediaDecodeTime)\n };\n if (timingInfo.prependedContentDuration) {\n videoSegmentTimingInfo.prependedContentDuration = clock$2.videoTsToSeconds(timingInfo.prependedContentDuration);\n }\n self.postMessage({\n action: 'videoSegmentTimingInfo',\n videoSegmentTimingInfo\n });\n });\n transmuxer.on('audioSegmentTimingInfo', function (timingInfo) {\n // Note that all times for [audio/video]SegmentTimingInfo events are in video clock\n const audioSegmentTimingInfo = {\n start: {\n decode: clock$2.videoTsToSeconds(timingInfo.start.dts),\n presentation: clock$2.videoTsToSeconds(timingInfo.start.pts)\n },\n end: {\n decode: clock$2.videoTsToSeconds(timingInfo.end.dts),\n presentation: clock$2.videoTsToSeconds(timingInfo.end.pts)\n },\n baseMediaDecodeTime: clock$2.videoTsToSeconds(timingInfo.baseMediaDecodeTime)\n };\n if (timingInfo.prependedContentDuration) {\n audioSegmentTimingInfo.prependedContentDuration = clock$2.videoTsToSeconds(timingInfo.prependedContentDuration);\n }\n self.postMessage({\n action: 'audioSegmentTimingInfo',\n audioSegmentTimingInfo\n });\n });\n transmuxer.on('id3Frame', function (id3Frame) {\n self.postMessage({\n action: 'id3Frame',\n id3Frame\n });\n });\n transmuxer.on('caption', function (caption) {\n self.postMessage({\n action: 'caption',\n caption\n });\n });\n transmuxer.on('trackinfo', function (trackInfo) {\n self.postMessage({\n action: 'trackinfo',\n trackInfo\n });\n });\n transmuxer.on('audioTimingInfo', function (audioTimingInfo) {\n // convert to video TS since we prioritize video time over audio\n self.postMessage({\n action: 'audioTimingInfo',\n audioTimingInfo: {\n start: clock$2.videoTsToSeconds(audioTimingInfo.start),\n end: clock$2.videoTsToSeconds(audioTimingInfo.end)\n }\n });\n });\n transmuxer.on('videoTimingInfo', function (videoTimingInfo) {\n self.postMessage({\n action: 'videoTimingInfo',\n videoTimingInfo: {\n start: clock$2.videoTsToSeconds(videoTimingInfo.start),\n end: clock$2.videoTsToSeconds(videoTimingInfo.end)\n }\n });\n });\n transmuxer.on('log', function (log) {\n self.postMessage({\n action: 'log',\n log\n });\n });\n };\n /**\n * All incoming messages route through this hash. If no function exists\n * to handle an incoming message, then we ignore the message.\n *\n * @class MessageHandlers\n * @param {Object} options the options to initialize with\n */\n\n class MessageHandlers {\n constructor(self, options) {\n this.options = options || {};\n this.self = self;\n this.init();\n }\n /**\n * initialize our web worker and wire all the events.\n */\n\n init() {\n if (this.transmuxer) {\n this.transmuxer.dispose();\n }\n this.transmuxer = new transmuxer.Transmuxer(this.options);\n wireTransmuxerEvents(this.self, this.transmuxer);\n }\n pushMp4Captions(data) {\n if (!this.captionParser) {\n this.captionParser = new captionParser();\n this.captionParser.init();\n }\n const segment = new Uint8Array(data.data, data.byteOffset, data.byteLength);\n const parsed = this.captionParser.parse(segment, data.trackIds, data.timescales);\n this.self.postMessage({\n action: 'mp4Captions',\n captions: parsed && parsed.captions || [],\n logs: parsed && parsed.logs || [],\n data: segment.buffer\n }, [segment.buffer]);\n }\n probeMp4StartTime({\n timescales,\n data\n }) {\n const startTime = probe$2.startTime(timescales, data);\n this.self.postMessage({\n action: 'probeMp4StartTime',\n startTime,\n data\n }, [data.buffer]);\n }\n probeMp4Tracks({\n data\n }) {\n const tracks = probe$2.tracks(data);\n this.self.postMessage({\n action: 'probeMp4Tracks',\n tracks,\n data\n }, [data.buffer]);\n }\n /**\n * Probes an mp4 segment for EMSG boxes containing ID3 data.\n * https://aomediacodec.github.io/id3-emsg/\n *\n * @param {Uint8Array} data segment data\n * @param {number} offset segment start time\n * @return {Object[]} an array of ID3 frames\n */\n\n probeEmsgID3({\n data,\n offset\n }) {\n const id3Frames = probe$2.getEmsgID3(data, offset);\n this.self.postMessage({\n action: 'probeEmsgID3',\n id3Frames,\n emsgData: data\n }, [data.buffer]);\n }\n /**\n * Probe an mpeg2-ts segment to determine the start time of the segment in it's\n * internal \"media time,\" as well as whether it contains video and/or audio.\n *\n * @private\n * @param {Uint8Array} bytes - segment bytes\n * @param {number} baseStartTime\n * Relative reference timestamp used when adjusting frame timestamps for rollover.\n * This value should be in seconds, as it's converted to a 90khz clock within the\n * function body.\n * @return {Object} The start time of the current segment in \"media time\" as well as\n * whether it contains video and/or audio\n */\n\n probeTs({\n data,\n baseStartTime\n }) {\n const tsStartTime = typeof baseStartTime === 'number' && !isNaN(baseStartTime) ? baseStartTime * clock$2.ONE_SECOND_IN_TS : void 0;\n const timeInfo = tsInspector.inspect(data, tsStartTime);\n let result = null;\n if (timeInfo) {\n result = {\n // each type's time info comes back as an array of 2 times, start and end\n hasVideo: timeInfo.video && timeInfo.video.length === 2 || false,\n hasAudio: timeInfo.audio && timeInfo.audio.length === 2 || false\n };\n if (result.hasVideo) {\n result.videoStart = timeInfo.video[0].ptsTime;\n }\n if (result.hasAudio) {\n result.audioStart = timeInfo.audio[0].ptsTime;\n }\n }\n this.self.postMessage({\n action: 'probeTs',\n result,\n data\n }, [data.buffer]);\n }\n clearAllMp4Captions() {\n if (this.captionParser) {\n this.captionParser.clearAllCaptions();\n }\n }\n clearParsedMp4Captions() {\n if (this.captionParser) {\n this.captionParser.clearParsedCaptions();\n }\n }\n /**\n * Adds data (a ts segment) to the start of the transmuxer pipeline for\n * processing.\n *\n * @param {ArrayBuffer} data data to push into the muxer\n */\n\n push(data) {\n // Cast array buffer to correct type for transmuxer\n const segment = new Uint8Array(data.data, data.byteOffset, data.byteLength);\n this.transmuxer.push(segment);\n }\n /**\n * Recreate the transmuxer so that the next segment added via `push`\n * start with a fresh transmuxer.\n */\n\n reset() {\n this.transmuxer.reset();\n }\n /**\n * Set the value that will be used as the `baseMediaDecodeTime` time for the\n * next segment pushed in. Subsequent segments will have their `baseMediaDecodeTime`\n * set relative to the first based on the PTS values.\n *\n * @param {Object} data used to set the timestamp offset in the muxer\n */\n\n setTimestampOffset(data) {\n const timestampOffset = data.timestampOffset || 0;\n this.transmuxer.setBaseMediaDecodeTime(Math.round(clock$2.secondsToVideoTs(timestampOffset)));\n }\n setAudioAppendStart(data) {\n this.transmuxer.setAudioAppendStart(Math.ceil(clock$2.secondsToVideoTs(data.appendStart)));\n }\n setRemux(data) {\n this.transmuxer.setRemux(data.remux);\n }\n /**\n * Forces the pipeline to finish processing the last segment and emit it's\n * results.\n *\n * @param {Object} data event data, not really used\n */\n\n flush(data) {\n this.transmuxer.flush(); // transmuxed done action is fired after both audio/video pipelines are flushed\n\n self.postMessage({\n action: 'done',\n type: 'transmuxed'\n });\n }\n endTimeline() {\n this.transmuxer.endTimeline(); // transmuxed endedtimeline action is fired after both audio/video pipelines end their\n // timelines\n\n self.postMessage({\n action: 'endedtimeline',\n type: 'transmuxed'\n });\n }\n alignGopsWith(data) {\n this.transmuxer.alignGopsWith(data.gopsToAlignWith.slice());\n }\n }\n /**\n * Our web worker interface so that things can talk to mux.js\n * that will be running in a web worker. the scope is passed to this by\n * webworkify.\n *\n * @param {Object} self the scope for the web worker\n */\n\n self.onmessage = function (event) {\n if (event.data.action === 'init' && event.data.options) {\n this.messageHandlers = new MessageHandlers(self, event.data.options);\n return;\n }\n if (!this.messageHandlers) {\n this.messageHandlers = new MessageHandlers(self);\n }\n if (event.data && event.data.action && event.data.action !== 'init') {\n if (this.messageHandlers[event.data.action]) {\n this.messageHandlers[event.data.action](event.data);\n }\n }\n };\n}));\nvar TransmuxWorker = factory(workerCode$1);\n/* rollup-plugin-worker-factory end for worker!/home/runner/work/http-streaming/http-streaming/src/transmuxer-worker.js */\n\nconst handleData_ = (event, transmuxedData, callback) => {\n const {\n type,\n initSegment,\n captions,\n captionStreams,\n metadata,\n videoFrameDtsTime,\n videoFramePtsTime\n } = event.data.segment;\n transmuxedData.buffer.push({\n captions,\n captionStreams,\n metadata\n });\n const boxes = event.data.segment.boxes || {\n data: event.data.segment.data\n };\n const result = {\n type,\n // cast ArrayBuffer to TypedArray\n data: new Uint8Array(boxes.data, boxes.data.byteOffset, boxes.data.byteLength),\n initSegment: new Uint8Array(initSegment.data, initSegment.byteOffset, initSegment.byteLength)\n };\n if (typeof videoFrameDtsTime !== 'undefined') {\n result.videoFrameDtsTime = videoFrameDtsTime;\n }\n if (typeof videoFramePtsTime !== 'undefined') {\n result.videoFramePtsTime = videoFramePtsTime;\n }\n callback(result);\n};\nconst handleDone_ = ({\n transmuxedData,\n callback\n}) => {\n // Previously we only returned data on data events,\n // not on done events. Clear out the buffer to keep that consistent.\n transmuxedData.buffer = []; // all buffers should have been flushed from the muxer, so start processing anything we\n // have received\n\n callback(transmuxedData);\n};\nconst handleGopInfo_ = (event, transmuxedData) => {\n transmuxedData.gopInfo = event.data.gopInfo;\n};\nconst processTransmux = options => {\n const {\n transmuxer,\n bytes,\n audioAppendStart,\n gopsToAlignWith,\n remux,\n onData,\n onTrackInfo,\n onAudioTimingInfo,\n onVideoTimingInfo,\n onVideoSegmentTimingInfo,\n onAudioSegmentTimingInfo,\n onId3,\n onCaptions,\n onDone,\n onEndedTimeline,\n onTransmuxerLog,\n isEndOfTimeline\n } = options;\n const transmuxedData = {\n buffer: []\n };\n let waitForEndedTimelineEvent = isEndOfTimeline;\n const handleMessage = event => {\n if (transmuxer.currentTransmux !== options) {\n // disposed\n return;\n }\n if (event.data.action === 'data') {\n handleData_(event, transmuxedData, onData);\n }\n if (event.data.action === 'trackinfo') {\n onTrackInfo(event.data.trackInfo);\n }\n if (event.data.action === 'gopInfo') {\n handleGopInfo_(event, transmuxedData);\n }\n if (event.data.action === 'audioTimingInfo') {\n onAudioTimingInfo(event.data.audioTimingInfo);\n }\n if (event.data.action === 'videoTimingInfo') {\n onVideoTimingInfo(event.data.videoTimingInfo);\n }\n if (event.data.action === 'videoSegmentTimingInfo') {\n onVideoSegmentTimingInfo(event.data.videoSegmentTimingInfo);\n }\n if (event.data.action === 'audioSegmentTimingInfo') {\n onAudioSegmentTimingInfo(event.data.audioSegmentTimingInfo);\n }\n if (event.data.action === 'id3Frame') {\n onId3([event.data.id3Frame], event.data.id3Frame.dispatchType);\n }\n if (event.data.action === 'caption') {\n onCaptions(event.data.caption);\n }\n if (event.data.action === 'endedtimeline') {\n waitForEndedTimelineEvent = false;\n onEndedTimeline();\n }\n if (event.data.action === 'log') {\n onTransmuxerLog(event.data.log);\n } // wait for the transmuxed event since we may have audio and video\n\n if (event.data.type !== 'transmuxed') {\n return;\n } // If the \"endedtimeline\" event has not yet fired, and this segment represents the end\n // of a timeline, that means there may still be data events before the segment\n // processing can be considerred complete. In that case, the final event should be\n // an \"endedtimeline\" event with the type \"transmuxed.\"\n\n if (waitForEndedTimelineEvent) {\n return;\n }\n transmuxer.onmessage = null;\n handleDone_({\n transmuxedData,\n callback: onDone\n });\n /* eslint-disable no-use-before-define */\n\n dequeue(transmuxer);\n /* eslint-enable */\n };\n\n transmuxer.onmessage = handleMessage;\n if (audioAppendStart) {\n transmuxer.postMessage({\n action: 'setAudioAppendStart',\n appendStart: audioAppendStart\n });\n } // allow empty arrays to be passed to clear out GOPs\n\n if (Array.isArray(gopsToAlignWith)) {\n transmuxer.postMessage({\n action: 'alignGopsWith',\n gopsToAlignWith\n });\n }\n if (typeof remux !== 'undefined') {\n transmuxer.postMessage({\n action: 'setRemux',\n remux\n });\n }\n if (bytes.byteLength) {\n const buffer = bytes instanceof ArrayBuffer ? bytes : bytes.buffer;\n const byteOffset = bytes instanceof ArrayBuffer ? 0 : bytes.byteOffset;\n transmuxer.postMessage({\n action: 'push',\n // Send the typed-array of data as an ArrayBuffer so that\n // it can be sent as a \"Transferable\" and avoid the costly\n // memory copy\n data: buffer,\n // To recreate the original typed-array, we need information\n // about what portion of the ArrayBuffer it was a view into\n byteOffset,\n byteLength: bytes.byteLength\n }, [buffer]);\n }\n if (isEndOfTimeline) {\n transmuxer.postMessage({\n action: 'endTimeline'\n });\n } // even if we didn't push any bytes, we have to make sure we flush in case we reached\n // the end of the segment\n\n transmuxer.postMessage({\n action: 'flush'\n });\n};\nconst dequeue = transmuxer => {\n transmuxer.currentTransmux = null;\n if (transmuxer.transmuxQueue.length) {\n transmuxer.currentTransmux = transmuxer.transmuxQueue.shift();\n if (typeof transmuxer.currentTransmux === 'function') {\n transmuxer.currentTransmux();\n } else {\n processTransmux(transmuxer.currentTransmux);\n }\n }\n};\nconst processAction = (transmuxer, action) => {\n transmuxer.postMessage({\n action\n });\n dequeue(transmuxer);\n};\nconst enqueueAction = (action, transmuxer) => {\n if (!transmuxer.currentTransmux) {\n transmuxer.currentTransmux = action;\n processAction(transmuxer, action);\n return;\n }\n transmuxer.transmuxQueue.push(processAction.bind(null, transmuxer, action));\n};\nconst reset = transmuxer => {\n enqueueAction('reset', transmuxer);\n};\nconst endTimeline = transmuxer => {\n enqueueAction('endTimeline', transmuxer);\n};\nconst transmux = options => {\n if (!options.transmuxer.currentTransmux) {\n options.transmuxer.currentTransmux = options;\n processTransmux(options);\n return;\n }\n options.transmuxer.transmuxQueue.push(options);\n};\nconst createTransmuxer = options => {\n const transmuxer = new TransmuxWorker();\n transmuxer.currentTransmux = null;\n transmuxer.transmuxQueue = [];\n const term = transmuxer.terminate;\n transmuxer.terminate = () => {\n transmuxer.currentTransmux = null;\n transmuxer.transmuxQueue.length = 0;\n return term.call(transmuxer);\n };\n transmuxer.postMessage({\n action: 'init',\n options\n });\n return transmuxer;\n};\nvar segmentTransmuxer = {\n reset,\n endTimeline,\n transmux,\n createTransmuxer\n};\nconst workerCallback = function (options) {\n const transmuxer = options.transmuxer;\n const endAction = options.endAction || options.action;\n const callback = options.callback;\n const message = _extends({}, options, {\n endAction: null,\n transmuxer: null,\n callback: null\n });\n const listenForEndEvent = event => {\n if (event.data.action !== endAction) {\n return;\n }\n transmuxer.removeEventListener('message', listenForEndEvent); // transfer ownership of bytes back to us.\n\n if (event.data.data) {\n event.data.data = new Uint8Array(event.data.data, options.byteOffset || 0, options.byteLength || event.data.data.byteLength);\n if (options.data) {\n options.data = event.data.data;\n }\n }\n callback(event.data);\n };\n transmuxer.addEventListener('message', listenForEndEvent);\n if (options.data) {\n const isArrayBuffer = options.data instanceof ArrayBuffer;\n message.byteOffset = isArrayBuffer ? 0 : options.data.byteOffset;\n message.byteLength = options.data.byteLength;\n const transfers = [isArrayBuffer ? options.data : options.data.buffer];\n transmuxer.postMessage(message, transfers);\n } else {\n transmuxer.postMessage(message);\n }\n};\nconst REQUEST_ERRORS = {\n FAILURE: 2,\n TIMEOUT: -101,\n ABORTED: -102\n};\n/**\n * Abort all requests\n *\n * @param {Object} activeXhrs - an object that tracks all XHR requests\n */\n\nconst abortAll = activeXhrs => {\n activeXhrs.forEach(xhr => {\n xhr.abort();\n });\n};\n/**\n * Gather important bandwidth stats once a request has completed\n *\n * @param {Object} request - the XHR request from which to gather stats\n */\n\nconst getRequestStats = request => {\n return {\n bandwidth: request.bandwidth,\n bytesReceived: request.bytesReceived || 0,\n roundTripTime: request.roundTripTime || 0\n };\n};\n/**\n * If possible gather bandwidth stats as a request is in\n * progress\n *\n * @param {Event} progressEvent - an event object from an XHR's progress event\n */\n\nconst getProgressStats = progressEvent => {\n const request = progressEvent.target;\n const roundTripTime = Date.now() - request.requestTime;\n const stats = {\n bandwidth: Infinity,\n bytesReceived: 0,\n roundTripTime: roundTripTime || 0\n };\n stats.bytesReceived = progressEvent.loaded; // This can result in Infinity if stats.roundTripTime is 0 but that is ok\n // because we should only use bandwidth stats on progress to determine when\n // abort a request early due to insufficient bandwidth\n\n stats.bandwidth = Math.floor(stats.bytesReceived / stats.roundTripTime * 8 * 1000);\n return stats;\n};\n/**\n * Handle all error conditions in one place and return an object\n * with all the information\n *\n * @param {Error|null} error - if non-null signals an error occured with the XHR\n * @param {Object} request - the XHR request that possibly generated the error\n */\n\nconst handleErrors = (error, request) => {\n if (request.timedout) {\n return {\n status: request.status,\n message: 'HLS request timed-out at URL: ' + request.uri,\n code: REQUEST_ERRORS.TIMEOUT,\n xhr: request\n };\n }\n if (request.aborted) {\n return {\n status: request.status,\n message: 'HLS request aborted at URL: ' + request.uri,\n code: REQUEST_ERRORS.ABORTED,\n xhr: request\n };\n }\n if (error) {\n return {\n status: request.status,\n message: 'HLS request errored at URL: ' + request.uri,\n code: REQUEST_ERRORS.FAILURE,\n xhr: request\n };\n }\n if (request.responseType === 'arraybuffer' && request.response.byteLength === 0) {\n return {\n status: request.status,\n message: 'Empty HLS response at URL: ' + request.uri,\n code: REQUEST_ERRORS.FAILURE,\n xhr: request\n };\n }\n return null;\n};\n/**\n * Handle responses for key data and convert the key data to the correct format\n * for the decryption step later\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n * from SegmentLoader\n * @param {Array} objects - objects to add the key bytes to.\n * @param {Function} finishProcessingFn - a callback to execute to continue processing\n * this request\n */\n\nconst handleKeyResponse = (segment, objects, finishProcessingFn) => (error, request) => {\n const response = request.response;\n const errorObj = handleErrors(error, request);\n if (errorObj) {\n return finishProcessingFn(errorObj, segment);\n }\n if (response.byteLength !== 16) {\n return finishProcessingFn({\n status: request.status,\n message: 'Invalid HLS key at URL: ' + request.uri,\n code: REQUEST_ERRORS.FAILURE,\n xhr: request\n }, segment);\n }\n const view = new DataView(response);\n const bytes = new Uint32Array([view.getUint32(0), view.getUint32(4), view.getUint32(8), view.getUint32(12)]);\n for (let i = 0; i < objects.length; i++) {\n objects[i].bytes = bytes;\n }\n return finishProcessingFn(null, segment);\n};\nconst parseInitSegment = (segment, callback) => {\n const type = detectContainerForBytes(segment.map.bytes); // TODO: We should also handle ts init segments here, but we\n // only know how to parse mp4 init segments at the moment\n\n if (type !== 'mp4') {\n const uri = segment.map.resolvedUri || segment.map.uri;\n return callback({\n internal: true,\n message: `Found unsupported ${type || 'unknown'} container for initialization segment at URL: ${uri}`,\n code: REQUEST_ERRORS.FAILURE\n });\n }\n workerCallback({\n action: 'probeMp4Tracks',\n data: segment.map.bytes,\n transmuxer: segment.transmuxer,\n callback: ({\n tracks,\n data\n }) => {\n // transfer bytes back to us\n segment.map.bytes = data;\n tracks.forEach(function (track) {\n segment.map.tracks = segment.map.tracks || {}; // only support one track of each type for now\n\n if (segment.map.tracks[track.type]) {\n return;\n }\n segment.map.tracks[track.type] = track;\n if (typeof track.id === 'number' && track.timescale) {\n segment.map.timescales = segment.map.timescales || {};\n segment.map.timescales[track.id] = track.timescale;\n }\n });\n return callback(null);\n }\n });\n};\n/**\n * Handle init-segment responses\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n * from SegmentLoader\n * @param {Function} finishProcessingFn - a callback to execute to continue processing\n * this request\n */\n\nconst handleInitSegmentResponse = ({\n segment,\n finishProcessingFn\n}) => (error, request) => {\n const errorObj = handleErrors(error, request);\n if (errorObj) {\n return finishProcessingFn(errorObj, segment);\n }\n const bytes = new Uint8Array(request.response); // init segment is encypted, we will have to wait\n // until the key request is done to decrypt.\n\n if (segment.map.key) {\n segment.map.encryptedBytes = bytes;\n return finishProcessingFn(null, segment);\n }\n segment.map.bytes = bytes;\n parseInitSegment(segment, function (parseError) {\n if (parseError) {\n parseError.xhr = request;\n parseError.status = request.status;\n return finishProcessingFn(parseError, segment);\n }\n finishProcessingFn(null, segment);\n });\n};\n/**\n * Response handler for segment-requests being sure to set the correct\n * property depending on whether the segment is encryped or not\n * Also records and keeps track of stats that are used for ABR purposes\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n * from SegmentLoader\n * @param {Function} finishProcessingFn - a callback to execute to continue processing\n * this request\n */\n\nconst handleSegmentResponse = ({\n segment,\n finishProcessingFn,\n responseType\n}) => (error, request) => {\n const errorObj = handleErrors(error, request);\n if (errorObj) {\n return finishProcessingFn(errorObj, segment);\n }\n const newBytes =\n // although responseText \"should\" exist, this guard serves to prevent an error being\n // thrown for two primary cases:\n // 1. the mime type override stops working, or is not implemented for a specific\n // browser\n // 2. when using mock XHR libraries like sinon that do not allow the override behavior\n responseType === 'arraybuffer' || !request.responseText ? request.response : stringToArrayBuffer(request.responseText.substring(segment.lastReachedChar || 0));\n segment.stats = getRequestStats(request);\n if (segment.key) {\n segment.encryptedBytes = new Uint8Array(newBytes);\n } else {\n segment.bytes = new Uint8Array(newBytes);\n }\n return finishProcessingFn(null, segment);\n};\nconst transmuxAndNotify = ({\n segment,\n bytes,\n trackInfoFn,\n timingInfoFn,\n videoSegmentTimingInfoFn,\n audioSegmentTimingInfoFn,\n id3Fn,\n captionsFn,\n isEndOfTimeline,\n endedTimelineFn,\n dataFn,\n doneFn,\n onTransmuxerLog\n}) => {\n const fmp4Tracks = segment.map && segment.map.tracks || {};\n const isMuxed = Boolean(fmp4Tracks.audio && fmp4Tracks.video); // Keep references to each function so we can null them out after we're done with them.\n // One reason for this is that in the case of full segments, we want to trust start\n // times from the probe, rather than the transmuxer.\n\n let audioStartFn = timingInfoFn.bind(null, segment, 'audio', 'start');\n const audioEndFn = timingInfoFn.bind(null, segment, 'audio', 'end');\n let videoStartFn = timingInfoFn.bind(null, segment, 'video', 'start');\n const videoEndFn = timingInfoFn.bind(null, segment, 'video', 'end');\n const finish = () => transmux({\n bytes,\n transmuxer: segment.transmuxer,\n audioAppendStart: segment.audioAppendStart,\n gopsToAlignWith: segment.gopsToAlignWith,\n remux: isMuxed,\n onData: result => {\n result.type = result.type === 'combined' ? 'video' : result.type;\n dataFn(segment, result);\n },\n onTrackInfo: trackInfo => {\n if (trackInfoFn) {\n if (isMuxed) {\n trackInfo.isMuxed = true;\n }\n trackInfoFn(segment, trackInfo);\n }\n },\n onAudioTimingInfo: audioTimingInfo => {\n // we only want the first start value we encounter\n if (audioStartFn && typeof audioTimingInfo.start !== 'undefined') {\n audioStartFn(audioTimingInfo.start);\n audioStartFn = null;\n } // we want to continually update the end time\n\n if (audioEndFn && typeof audioTimingInfo.end !== 'undefined') {\n audioEndFn(audioTimingInfo.end);\n }\n },\n onVideoTimingInfo: videoTimingInfo => {\n // we only want the first start value we encounter\n if (videoStartFn && typeof videoTimingInfo.start !== 'undefined') {\n videoStartFn(videoTimingInfo.start);\n videoStartFn = null;\n } // we want to continually update the end time\n\n if (videoEndFn && typeof videoTimingInfo.end !== 'undefined') {\n videoEndFn(videoTimingInfo.end);\n }\n },\n onVideoSegmentTimingInfo: videoSegmentTimingInfo => {\n videoSegmentTimingInfoFn(videoSegmentTimingInfo);\n },\n onAudioSegmentTimingInfo: audioSegmentTimingInfo => {\n audioSegmentTimingInfoFn(audioSegmentTimingInfo);\n },\n onId3: (id3Frames, dispatchType) => {\n id3Fn(segment, id3Frames, dispatchType);\n },\n onCaptions: captions => {\n captionsFn(segment, [captions]);\n },\n isEndOfTimeline,\n onEndedTimeline: () => {\n endedTimelineFn();\n },\n onTransmuxerLog,\n onDone: result => {\n if (!doneFn) {\n return;\n }\n result.type = result.type === 'combined' ? 'video' : result.type;\n doneFn(null, segment, result);\n }\n }); // In the transmuxer, we don't yet have the ability to extract a \"proper\" start time.\n // Meaning cached frame data may corrupt our notion of where this segment\n // really starts. To get around this, probe for the info needed.\n\n workerCallback({\n action: 'probeTs',\n transmuxer: segment.transmuxer,\n data: bytes,\n baseStartTime: segment.baseStartTime,\n callback: data => {\n segment.bytes = bytes = data.data;\n const probeResult = data.result;\n if (probeResult) {\n trackInfoFn(segment, {\n hasAudio: probeResult.hasAudio,\n hasVideo: probeResult.hasVideo,\n isMuxed\n });\n trackInfoFn = null;\n }\n finish();\n }\n });\n};\nconst handleSegmentBytes = ({\n segment,\n bytes,\n trackInfoFn,\n timingInfoFn,\n videoSegmentTimingInfoFn,\n audioSegmentTimingInfoFn,\n id3Fn,\n captionsFn,\n isEndOfTimeline,\n endedTimelineFn,\n dataFn,\n doneFn,\n onTransmuxerLog\n}) => {\n let bytesAsUint8Array = new Uint8Array(bytes); // TODO:\n // We should have a handler that fetches the number of bytes required\n // to check if something is fmp4. This will allow us to save bandwidth\n // because we can only exclude a playlist and abort requests\n // by codec after trackinfo triggers.\n\n if (isLikelyFmp4MediaSegment(bytesAsUint8Array)) {\n segment.isFmp4 = true;\n const {\n tracks\n } = segment.map;\n const trackInfo = {\n isFmp4: true,\n hasVideo: !!tracks.video,\n hasAudio: !!tracks.audio\n }; // if we have a audio track, with a codec that is not set to\n // encrypted audio\n\n if (tracks.audio && tracks.audio.codec && tracks.audio.codec !== 'enca') {\n trackInfo.audioCodec = tracks.audio.codec;\n } // if we have a video track, with a codec that is not set to\n // encrypted video\n\n if (tracks.video && tracks.video.codec && tracks.video.codec !== 'encv') {\n trackInfo.videoCodec = tracks.video.codec;\n }\n if (tracks.video && tracks.audio) {\n trackInfo.isMuxed = true;\n } // since we don't support appending fmp4 data on progress, we know we have the full\n // segment here\n\n trackInfoFn(segment, trackInfo); // The probe doesn't provide the segment end time, so only callback with the start\n // time. The end time can be roughly calculated by the receiver using the duration.\n //\n // Note that the start time returned by the probe reflects the baseMediaDecodeTime, as\n // that is the true start of the segment (where the playback engine should begin\n // decoding).\n\n const finishLoading = (captions, id3Frames) => {\n // if the track still has audio at this point it is only possible\n // for it to be audio only. See `tracks.video && tracks.audio` if statement\n // above.\n // we make sure to use segment.bytes here as that\n dataFn(segment, {\n data: bytesAsUint8Array,\n type: trackInfo.hasAudio && !trackInfo.isMuxed ? 'audio' : 'video'\n });\n if (id3Frames && id3Frames.length) {\n id3Fn(segment, id3Frames);\n }\n if (captions && captions.length) {\n captionsFn(segment, captions);\n }\n doneFn(null, segment, {});\n };\n workerCallback({\n action: 'probeMp4StartTime',\n timescales: segment.map.timescales,\n data: bytesAsUint8Array,\n transmuxer: segment.transmuxer,\n callback: ({\n data,\n startTime\n }) => {\n // transfer bytes back to us\n bytes = data.buffer;\n segment.bytes = bytesAsUint8Array = data;\n if (trackInfo.hasAudio && !trackInfo.isMuxed) {\n timingInfoFn(segment, 'audio', 'start', startTime);\n }\n if (trackInfo.hasVideo) {\n timingInfoFn(segment, 'video', 'start', startTime);\n }\n workerCallback({\n action: 'probeEmsgID3',\n data: bytesAsUint8Array,\n transmuxer: segment.transmuxer,\n offset: startTime,\n callback: ({\n emsgData,\n id3Frames\n }) => {\n // transfer bytes back to us\n bytes = emsgData.buffer;\n segment.bytes = bytesAsUint8Array = emsgData; // Run through the CaptionParser in case there are captions.\n // Initialize CaptionParser if it hasn't been yet\n\n if (!tracks.video || !emsgData.byteLength || !segment.transmuxer) {\n finishLoading(undefined, id3Frames);\n return;\n }\n workerCallback({\n action: 'pushMp4Captions',\n endAction: 'mp4Captions',\n transmuxer: segment.transmuxer,\n data: bytesAsUint8Array,\n timescales: segment.map.timescales,\n trackIds: [tracks.video.id],\n callback: message => {\n // transfer bytes back to us\n bytes = message.data.buffer;\n segment.bytes = bytesAsUint8Array = message.data;\n message.logs.forEach(function (log) {\n onTransmuxerLog(merge(log, {\n stream: 'mp4CaptionParser'\n }));\n });\n finishLoading(message.captions, id3Frames);\n }\n });\n }\n });\n }\n });\n return;\n } // VTT or other segments that don't need processing\n\n if (!segment.transmuxer) {\n doneFn(null, segment, {});\n return;\n }\n if (typeof segment.container === 'undefined') {\n segment.container = detectContainerForBytes(bytesAsUint8Array);\n }\n if (segment.container !== 'ts' && segment.container !== 'aac') {\n trackInfoFn(segment, {\n hasAudio: false,\n hasVideo: false\n });\n doneFn(null, segment, {});\n return;\n } // ts or aac\n\n transmuxAndNotify({\n segment,\n bytes,\n trackInfoFn,\n timingInfoFn,\n videoSegmentTimingInfoFn,\n audioSegmentTimingInfoFn,\n id3Fn,\n captionsFn,\n isEndOfTimeline,\n endedTimelineFn,\n dataFn,\n doneFn,\n onTransmuxerLog\n });\n};\nconst decrypt = function ({\n id,\n key,\n encryptedBytes,\n decryptionWorker\n}, callback) {\n const decryptionHandler = event => {\n if (event.data.source === id) {\n decryptionWorker.removeEventListener('message', decryptionHandler);\n const decrypted = event.data.decrypted;\n callback(new Uint8Array(decrypted.bytes, decrypted.byteOffset, decrypted.byteLength));\n }\n };\n decryptionWorker.addEventListener('message', decryptionHandler);\n let keyBytes;\n if (key.bytes.slice) {\n keyBytes = key.bytes.slice();\n } else {\n keyBytes = new Uint32Array(Array.prototype.slice.call(key.bytes));\n } // incrementally decrypt the bytes\n\n decryptionWorker.postMessage(createTransferableMessage({\n source: id,\n encrypted: encryptedBytes,\n key: keyBytes,\n iv: key.iv\n }), [encryptedBytes.buffer, keyBytes.buffer]);\n};\n/**\n * Decrypt the segment via the decryption web worker\n *\n * @param {WebWorker} decryptionWorker - a WebWorker interface to AES-128 decryption\n * routines\n * @param {Object} segment - a simplified copy of the segmentInfo object\n * from SegmentLoader\n * @param {Function} trackInfoFn - a callback that receives track info\n * @param {Function} timingInfoFn - a callback that receives timing info\n * @param {Function} videoSegmentTimingInfoFn\n * a callback that receives video timing info based on media times and\n * any adjustments made by the transmuxer\n * @param {Function} audioSegmentTimingInfoFn\n * a callback that receives audio timing info based on media times and\n * any adjustments made by the transmuxer\n * @param {boolean} isEndOfTimeline\n * true if this segment represents the last segment in a timeline\n * @param {Function} endedTimelineFn\n * a callback made when a timeline is ended, will only be called if\n * isEndOfTimeline is true\n * @param {Function} dataFn - a callback that is executed when segment bytes are available\n * and ready to use\n * @param {Function} doneFn - a callback that is executed after decryption has completed\n */\n\nconst decryptSegment = ({\n decryptionWorker,\n segment,\n trackInfoFn,\n timingInfoFn,\n videoSegmentTimingInfoFn,\n audioSegmentTimingInfoFn,\n id3Fn,\n captionsFn,\n isEndOfTimeline,\n endedTimelineFn,\n dataFn,\n doneFn,\n onTransmuxerLog\n}) => {\n decrypt({\n id: segment.requestId,\n key: segment.key,\n encryptedBytes: segment.encryptedBytes,\n decryptionWorker\n }, decryptedBytes => {\n segment.bytes = decryptedBytes;\n handleSegmentBytes({\n segment,\n bytes: segment.bytes,\n trackInfoFn,\n timingInfoFn,\n videoSegmentTimingInfoFn,\n audioSegmentTimingInfoFn,\n id3Fn,\n captionsFn,\n isEndOfTimeline,\n endedTimelineFn,\n dataFn,\n doneFn,\n onTransmuxerLog\n });\n });\n};\n/**\n * This function waits for all XHRs to finish (with either success or failure)\n * before continueing processing via it's callback. The function gathers errors\n * from each request into a single errors array so that the error status for\n * each request can be examined later.\n *\n * @param {Object} activeXhrs - an object that tracks all XHR requests\n * @param {WebWorker} decryptionWorker - a WebWorker interface to AES-128 decryption\n * routines\n * @param {Function} trackInfoFn - a callback that receives track info\n * @param {Function} timingInfoFn - a callback that receives timing info\n * @param {Function} videoSegmentTimingInfoFn\n * a callback that receives video timing info based on media times and\n * any adjustments made by the transmuxer\n * @param {Function} audioSegmentTimingInfoFn\n * a callback that receives audio timing info based on media times and\n * any adjustments made by the transmuxer\n * @param {Function} id3Fn - a callback that receives ID3 metadata\n * @param {Function} captionsFn - a callback that receives captions\n * @param {boolean} isEndOfTimeline\n * true if this segment represents the last segment in a timeline\n * @param {Function} endedTimelineFn\n * a callback made when a timeline is ended, will only be called if\n * isEndOfTimeline is true\n * @param {Function} dataFn - a callback that is executed when segment bytes are available\n * and ready to use\n * @param {Function} doneFn - a callback that is executed after all resources have been\n * downloaded and any decryption completed\n */\n\nconst waitForCompletion = ({\n activeXhrs,\n decryptionWorker,\n trackInfoFn,\n timingInfoFn,\n videoSegmentTimingInfoFn,\n audioSegmentTimingInfoFn,\n id3Fn,\n captionsFn,\n isEndOfTimeline,\n endedTimelineFn,\n dataFn,\n doneFn,\n onTransmuxerLog\n}) => {\n let count = 0;\n let didError = false;\n return (error, segment) => {\n if (didError) {\n return;\n }\n if (error) {\n didError = true; // If there are errors, we have to abort any outstanding requests\n\n abortAll(activeXhrs); // Even though the requests above are aborted, and in theory we could wait until we\n // handle the aborted events from those requests, there are some cases where we may\n // never get an aborted event. For instance, if the network connection is lost and\n // there were two requests, the first may have triggered an error immediately, while\n // the second request remains unsent. In that case, the aborted algorithm will not\n // trigger an abort: see https://xhr.spec.whatwg.org/#the-abort()-method\n //\n // We also can't rely on the ready state of the XHR, since the request that\n // triggered the connection error may also show as a ready state of 0 (unsent).\n // Therefore, we have to finish this group of requests immediately after the first\n // seen error.\n\n return doneFn(error, segment);\n }\n count += 1;\n if (count === activeXhrs.length) {\n const segmentFinish = function () {\n if (segment.encryptedBytes) {\n return decryptSegment({\n decryptionWorker,\n segment,\n trackInfoFn,\n timingInfoFn,\n videoSegmentTimingInfoFn,\n audioSegmentTimingInfoFn,\n id3Fn,\n captionsFn,\n isEndOfTimeline,\n endedTimelineFn,\n dataFn,\n doneFn,\n onTransmuxerLog\n });\n } // Otherwise, everything is ready just continue\n\n handleSegmentBytes({\n segment,\n bytes: segment.bytes,\n trackInfoFn,\n timingInfoFn,\n videoSegmentTimingInfoFn,\n audioSegmentTimingInfoFn,\n id3Fn,\n captionsFn,\n isEndOfTimeline,\n endedTimelineFn,\n dataFn,\n doneFn,\n onTransmuxerLog\n });\n }; // Keep track of when *all* of the requests have completed\n\n segment.endOfAllRequests = Date.now();\n if (segment.map && segment.map.encryptedBytes && !segment.map.bytes) {\n return decrypt({\n decryptionWorker,\n // add -init to the \"id\" to differentiate between segment\n // and init segment decryption, just in case they happen\n // at the same time at some point in the future.\n id: segment.requestId + '-init',\n encryptedBytes: segment.map.encryptedBytes,\n key: segment.map.key\n }, decryptedBytes => {\n segment.map.bytes = decryptedBytes;\n parseInitSegment(segment, parseError => {\n if (parseError) {\n abortAll(activeXhrs);\n return doneFn(parseError, segment);\n }\n segmentFinish();\n });\n });\n }\n segmentFinish();\n }\n };\n};\n/**\n * Calls the abort callback if any request within the batch was aborted. Will only call\n * the callback once per batch of requests, even if multiple were aborted.\n *\n * @param {Object} loadendState - state to check to see if the abort function was called\n * @param {Function} abortFn - callback to call for abort\n */\n\nconst handleLoadEnd = ({\n loadendState,\n abortFn\n}) => event => {\n const request = event.target;\n if (request.aborted && abortFn && !loadendState.calledAbortFn) {\n abortFn();\n loadendState.calledAbortFn = true;\n }\n};\n/**\n * Simple progress event callback handler that gathers some stats before\n * executing a provided callback with the `segment` object\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n * from SegmentLoader\n * @param {Function} progressFn - a callback that is executed each time a progress event\n * is received\n * @param {Function} trackInfoFn - a callback that receives track info\n * @param {Function} timingInfoFn - a callback that receives timing info\n * @param {Function} videoSegmentTimingInfoFn\n * a callback that receives video timing info based on media times and\n * any adjustments made by the transmuxer\n * @param {Function} audioSegmentTimingInfoFn\n * a callback that receives audio timing info based on media times and\n * any adjustments made by the transmuxer\n * @param {boolean} isEndOfTimeline\n * true if this segment represents the last segment in a timeline\n * @param {Function} endedTimelineFn\n * a callback made when a timeline is ended, will only be called if\n * isEndOfTimeline is true\n * @param {Function} dataFn - a callback that is executed when segment bytes are available\n * and ready to use\n * @param {Event} event - the progress event object from XMLHttpRequest\n */\n\nconst handleProgress = ({\n segment,\n progressFn,\n trackInfoFn,\n timingInfoFn,\n videoSegmentTimingInfoFn,\n audioSegmentTimingInfoFn,\n id3Fn,\n captionsFn,\n isEndOfTimeline,\n endedTimelineFn,\n dataFn\n}) => event => {\n const request = event.target;\n if (request.aborted) {\n return;\n }\n segment.stats = merge(segment.stats, getProgressStats(event)); // record the time that we receive the first byte of data\n\n if (!segment.stats.firstBytesReceivedAt && segment.stats.bytesReceived) {\n segment.stats.firstBytesReceivedAt = Date.now();\n }\n return progressFn(event, segment);\n};\n/**\n * Load all resources and does any processing necessary for a media-segment\n *\n * Features:\n * decrypts the media-segment if it has a key uri and an iv\n * aborts *all* requests if *any* one request fails\n *\n * The segment object, at minimum, has the following format:\n * {\n * resolvedUri: String,\n * [transmuxer]: Object,\n * [byterange]: {\n * offset: Number,\n * length: Number\n * },\n * [key]: {\n * resolvedUri: String\n * [byterange]: {\n * offset: Number,\n * length: Number\n * },\n * iv: {\n * bytes: Uint32Array\n * }\n * },\n * [map]: {\n * resolvedUri: String,\n * [byterange]: {\n * offset: Number,\n * length: Number\n * },\n * [bytes]: Uint8Array\n * }\n * }\n * ...where [name] denotes optional properties\n *\n * @param {Function} xhr - an instance of the xhr wrapper in xhr.js\n * @param {Object} xhrOptions - the base options to provide to all xhr requests\n * @param {WebWorker} decryptionWorker - a WebWorker interface to AES-128\n * decryption routines\n * @param {Object} segment - a simplified copy of the segmentInfo object\n * from SegmentLoader\n * @param {Function} abortFn - a callback called (only once) if any piece of a request was\n * aborted\n * @param {Function} progressFn - a callback that receives progress events from the main\n * segment's xhr request\n * @param {Function} trackInfoFn - a callback that receives track info\n * @param {Function} timingInfoFn - a callback that receives timing info\n * @param {Function} videoSegmentTimingInfoFn\n * a callback that receives video timing info based on media times and\n * any adjustments made by the transmuxer\n * @param {Function} audioSegmentTimingInfoFn\n * a callback that receives audio timing info based on media times and\n * any adjustments made by the transmuxer\n * @param {Function} id3Fn - a callback that receives ID3 metadata\n * @param {Function} captionsFn - a callback that receives captions\n * @param {boolean} isEndOfTimeline\n * true if this segment represents the last segment in a timeline\n * @param {Function} endedTimelineFn\n * a callback made when a timeline is ended, will only be called if\n * isEndOfTimeline is true\n * @param {Function} dataFn - a callback that receives data from the main segment's xhr\n * request, transmuxed if needed\n * @param {Function} doneFn - a callback that is executed only once all requests have\n * succeeded or failed\n * @return {Function} a function that, when invoked, immediately aborts all\n * outstanding requests\n */\n\nconst mediaSegmentRequest = ({\n xhr,\n xhrOptions,\n decryptionWorker,\n segment,\n abortFn,\n progressFn,\n trackInfoFn,\n timingInfoFn,\n videoSegmentTimingInfoFn,\n audioSegmentTimingInfoFn,\n id3Fn,\n captionsFn,\n isEndOfTimeline,\n endedTimelineFn,\n dataFn,\n doneFn,\n onTransmuxerLog\n}) => {\n const activeXhrs = [];\n const finishProcessingFn = waitForCompletion({\n activeXhrs,\n decryptionWorker,\n trackInfoFn,\n timingInfoFn,\n videoSegmentTimingInfoFn,\n audioSegmentTimingInfoFn,\n id3Fn,\n captionsFn,\n isEndOfTimeline,\n endedTimelineFn,\n dataFn,\n doneFn,\n onTransmuxerLog\n }); // optionally, request the decryption key\n\n if (segment.key && !segment.key.bytes) {\n const objects = [segment.key];\n if (segment.map && !segment.map.bytes && segment.map.key && segment.map.key.resolvedUri === segment.key.resolvedUri) {\n objects.push(segment.map.key);\n }\n const keyRequestOptions = merge(xhrOptions, {\n uri: segment.key.resolvedUri,\n responseType: 'arraybuffer'\n });\n const keyRequestCallback = handleKeyResponse(segment, objects, finishProcessingFn);\n const keyXhr = xhr(keyRequestOptions, keyRequestCallback);\n activeXhrs.push(keyXhr);\n } // optionally, request the associated media init segment\n\n if (segment.map && !segment.map.bytes) {\n const differentMapKey = segment.map.key && (!segment.key || segment.key.resolvedUri !== segment.map.key.resolvedUri);\n if (differentMapKey) {\n const mapKeyRequestOptions = merge(xhrOptions, {\n uri: segment.map.key.resolvedUri,\n responseType: 'arraybuffer'\n });\n const mapKeyRequestCallback = handleKeyResponse(segment, [segment.map.key], finishProcessingFn);\n const mapKeyXhr = xhr(mapKeyRequestOptions, mapKeyRequestCallback);\n activeXhrs.push(mapKeyXhr);\n }\n const initSegmentOptions = merge(xhrOptions, {\n uri: segment.map.resolvedUri,\n responseType: 'arraybuffer',\n headers: segmentXhrHeaders(segment.map)\n });\n const initSegmentRequestCallback = handleInitSegmentResponse({\n segment,\n finishProcessingFn\n });\n const initSegmentXhr = xhr(initSegmentOptions, initSegmentRequestCallback);\n activeXhrs.push(initSegmentXhr);\n }\n const segmentRequestOptions = merge(xhrOptions, {\n uri: segment.part && segment.part.resolvedUri || segment.resolvedUri,\n responseType: 'arraybuffer',\n headers: segmentXhrHeaders(segment)\n });\n const segmentRequestCallback = handleSegmentResponse({\n segment,\n finishProcessingFn,\n responseType: segmentRequestOptions.responseType\n });\n const segmentXhr = xhr(segmentRequestOptions, segmentRequestCallback);\n segmentXhr.addEventListener('progress', handleProgress({\n segment,\n progressFn,\n trackInfoFn,\n timingInfoFn,\n videoSegmentTimingInfoFn,\n audioSegmentTimingInfoFn,\n id3Fn,\n captionsFn,\n isEndOfTimeline,\n endedTimelineFn,\n dataFn\n }));\n activeXhrs.push(segmentXhr); // since all parts of the request must be considered, but should not make callbacks\n // multiple times, provide a shared state object\n\n const loadendState = {};\n activeXhrs.forEach(activeXhr => {\n activeXhr.addEventListener('loadend', handleLoadEnd({\n loadendState,\n abortFn\n }));\n });\n return () => abortAll(activeXhrs);\n};\n\n/**\n * @file - codecs.js - Handles tasks regarding codec strings such as translating them to\n * codec strings, or translating codec strings into objects that can be examined.\n */\nconst logFn$1 = logger('CodecUtils');\n/**\n * Returns a set of codec strings parsed from the playlist or the default\n * codec strings if no codecs were specified in the playlist\n *\n * @param {Playlist} media the current media playlist\n * @return {Object} an object with the video and audio codecs\n */\n\nconst getCodecs = function (media) {\n // if the codecs were explicitly specified, use them instead of the\n // defaults\n const mediaAttributes = media.attributes || {};\n if (mediaAttributes.CODECS) {\n return parseCodecs(mediaAttributes.CODECS);\n }\n};\nconst isMaat = (main, media) => {\n const mediaAttributes = media.attributes || {};\n return main && main.mediaGroups && main.mediaGroups.AUDIO && mediaAttributes.AUDIO && main.mediaGroups.AUDIO[mediaAttributes.AUDIO];\n};\nconst isMuxed = (main, media) => {\n if (!isMaat(main, media)) {\n return true;\n }\n const mediaAttributes = media.attributes || {};\n const audioGroup = main.mediaGroups.AUDIO[mediaAttributes.AUDIO];\n for (const groupId in audioGroup) {\n // If an audio group has a URI (the case for HLS, as HLS will use external playlists),\n // or there are listed playlists (the case for DASH, as the manifest will have already\n // provided all of the details necessary to generate the audio playlist, as opposed to\n // HLS' externally requested playlists), then the content is demuxed.\n if (!audioGroup[groupId].uri && !audioGroup[groupId].playlists) {\n return true;\n }\n }\n return false;\n};\nconst unwrapCodecList = function (codecList) {\n const codecs = {};\n codecList.forEach(({\n mediaType,\n type,\n details\n }) => {\n codecs[mediaType] = codecs[mediaType] || [];\n codecs[mediaType].push(translateLegacyCodec(`${type}${details}`));\n });\n Object.keys(codecs).forEach(function (mediaType) {\n if (codecs[mediaType].length > 1) {\n logFn$1(`multiple ${mediaType} codecs found as attributes: ${codecs[mediaType].join(', ')}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`);\n codecs[mediaType] = null;\n return;\n }\n codecs[mediaType] = codecs[mediaType][0];\n });\n return codecs;\n};\nconst codecCount = function (codecObj) {\n let count = 0;\n if (codecObj.audio) {\n count++;\n }\n if (codecObj.video) {\n count++;\n }\n return count;\n};\n/**\n * Calculates the codec strings for a working configuration of\n * SourceBuffers to play variant streams in a main playlist. If\n * there is no possible working configuration, an empty object will be\n * returned.\n *\n * @param main {Object} the m3u8 object for the main playlist\n * @param media {Object} the m3u8 object for the variant playlist\n * @return {Object} the codec strings.\n *\n * @private\n */\n\nconst codecsForPlaylist = function (main, media) {\n const mediaAttributes = media.attributes || {};\n const codecInfo = unwrapCodecList(getCodecs(media) || []); // HLS with multiple-audio tracks must always get an audio codec.\n // Put another way, there is no way to have a video-only multiple-audio HLS!\n\n if (isMaat(main, media) && !codecInfo.audio) {\n if (!isMuxed(main, media)) {\n // It is possible for codecs to be specified on the audio media group playlist but\n // not on the rendition playlist. This is mostly the case for DASH, where audio and\n // video are always separate (and separately specified).\n const defaultCodecs = unwrapCodecList(codecsFromDefault(main, mediaAttributes.AUDIO) || []);\n if (defaultCodecs.audio) {\n codecInfo.audio = defaultCodecs.audio;\n }\n }\n }\n return codecInfo;\n};\nconst logFn = logger('PlaylistSelector');\nconst representationToString = function (representation) {\n if (!representation || !representation.playlist) {\n return;\n }\n const playlist = representation.playlist;\n return JSON.stringify({\n id: playlist.id,\n bandwidth: representation.bandwidth,\n width: representation.width,\n height: representation.height,\n codecs: playlist.attributes && playlist.attributes.CODECS || ''\n });\n}; // Utilities\n\n/**\n * Returns the CSS value for the specified property on an element\n * using `getComputedStyle`. Firefox has a long-standing issue where\n * getComputedStyle() may return null when running in an iframe with\n * `display: none`.\n *\n * @see https://bugzilla.mozilla.org/show_bug.cgi?id=548397\n * @param {HTMLElement} el the htmlelement to work on\n * @param {string} the proprety to get the style for\n */\n\nconst safeGetComputedStyle = function (el, property) {\n if (!el) {\n return '';\n }\n const result = window$1.getComputedStyle(el);\n if (!result) {\n return '';\n }\n return result[property];\n};\n/**\n * Resuable stable sort function\n *\n * @param {Playlists} array\n * @param {Function} sortFn Different comparators\n * @function stableSort\n */\n\nconst stableSort = function (array, sortFn) {\n const newArray = array.slice();\n array.sort(function (left, right) {\n const cmp = sortFn(left, right);\n if (cmp === 0) {\n return newArray.indexOf(left) - newArray.indexOf(right);\n }\n return cmp;\n });\n};\n/**\n * A comparator function to sort two playlist object by bandwidth.\n *\n * @param {Object} left a media playlist object\n * @param {Object} right a media playlist object\n * @return {number} Greater than zero if the bandwidth attribute of\n * left is greater than the corresponding attribute of right. Less\n * than zero if the bandwidth of right is greater than left and\n * exactly zero if the two are equal.\n */\n\nconst comparePlaylistBandwidth = function (left, right) {\n let leftBandwidth;\n let rightBandwidth;\n if (left.attributes.BANDWIDTH) {\n leftBandwidth = left.attributes.BANDWIDTH;\n }\n leftBandwidth = leftBandwidth || window$1.Number.MAX_VALUE;\n if (right.attributes.BANDWIDTH) {\n rightBandwidth = right.attributes.BANDWIDTH;\n }\n rightBandwidth = rightBandwidth || window$1.Number.MAX_VALUE;\n return leftBandwidth - rightBandwidth;\n};\n/**\n * A comparator function to sort two playlist object by resolution (width).\n *\n * @param {Object} left a media playlist object\n * @param {Object} right a media playlist object\n * @return {number} Greater than zero if the resolution.width attribute of\n * left is greater than the corresponding attribute of right. Less\n * than zero if the resolution.width of right is greater than left and\n * exactly zero if the two are equal.\n */\n\nconst comparePlaylistResolution = function (left, right) {\n let leftWidth;\n let rightWidth;\n if (left.attributes.RESOLUTION && left.attributes.RESOLUTION.width) {\n leftWidth = left.attributes.RESOLUTION.width;\n }\n leftWidth = leftWidth || window$1.Number.MAX_VALUE;\n if (right.attributes.RESOLUTION && right.attributes.RESOLUTION.width) {\n rightWidth = right.attributes.RESOLUTION.width;\n }\n rightWidth = rightWidth || window$1.Number.MAX_VALUE; // NOTE - Fallback to bandwidth sort as appropriate in cases where multiple renditions\n // have the same media dimensions/ resolution\n\n if (leftWidth === rightWidth && left.attributes.BANDWIDTH && right.attributes.BANDWIDTH) {\n return left.attributes.BANDWIDTH - right.attributes.BANDWIDTH;\n }\n return leftWidth - rightWidth;\n};\n/**\n * Chooses the appropriate media playlist based on bandwidth and player size\n *\n * @param {Object} main\n * Object representation of the main manifest\n * @param {number} playerBandwidth\n * Current calculated bandwidth of the player\n * @param {number} playerWidth\n * Current width of the player element (should account for the device pixel ratio)\n * @param {number} playerHeight\n * Current height of the player element (should account for the device pixel ratio)\n * @param {boolean} limitRenditionByPlayerDimensions\n * True if the player width and height should be used during the selection, false otherwise\n * @param {Object} playlistController\n * the current playlistController object\n * @return {Playlist} the highest bitrate playlist less than the\n * currently detected bandwidth, accounting for some amount of\n * bandwidth variance\n */\n\nlet simpleSelector = function (main, playerBandwidth, playerWidth, playerHeight, limitRenditionByPlayerDimensions, playlistController) {\n // If we end up getting called before `main` is available, exit early\n if (!main) {\n return;\n }\n const options = {\n bandwidth: playerBandwidth,\n width: playerWidth,\n height: playerHeight,\n limitRenditionByPlayerDimensions\n };\n let playlists = main.playlists; // if playlist is audio only, select between currently active audio group playlists.\n\n if (Playlist.isAudioOnly(main)) {\n playlists = playlistController.getAudioTrackPlaylists_(); // add audioOnly to options so that we log audioOnly: true\n // at the buttom of this function for debugging.\n\n options.audioOnly = true;\n } // convert the playlists to an intermediary representation to make comparisons easier\n\n let sortedPlaylistReps = playlists.map(playlist => {\n let bandwidth;\n const width = playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.width;\n const height = playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.height;\n bandwidth = playlist.attributes && playlist.attributes.BANDWIDTH;\n bandwidth = bandwidth || window$1.Number.MAX_VALUE;\n return {\n bandwidth,\n width,\n height,\n playlist\n };\n });\n stableSort(sortedPlaylistReps, (left, right) => left.bandwidth - right.bandwidth); // filter out any playlists that have been excluded due to\n // incompatible configurations\n\n sortedPlaylistReps = sortedPlaylistReps.filter(rep => !Playlist.isIncompatible(rep.playlist)); // filter out any playlists that have been disabled manually through the representations\n // api or excluded temporarily due to playback errors.\n\n let enabledPlaylistReps = sortedPlaylistReps.filter(rep => Playlist.isEnabled(rep.playlist));\n if (!enabledPlaylistReps.length) {\n // if there are no enabled playlists, then they have all been excluded or disabled\n // by the user through the representations api. In this case, ignore exclusion and\n // fallback to what the user wants by using playlists the user has not disabled.\n enabledPlaylistReps = sortedPlaylistReps.filter(rep => !Playlist.isDisabled(rep.playlist));\n } // filter out any variant that has greater effective bitrate\n // than the current estimated bandwidth\n\n const bandwidthPlaylistReps = enabledPlaylistReps.filter(rep => rep.bandwidth * Config.BANDWIDTH_VARIANCE < playerBandwidth);\n let highestRemainingBandwidthRep = bandwidthPlaylistReps[bandwidthPlaylistReps.length - 1]; // get all of the renditions with the same (highest) bandwidth\n // and then taking the very first element\n\n const bandwidthBestRep = bandwidthPlaylistReps.filter(rep => rep.bandwidth === highestRemainingBandwidthRep.bandwidth)[0]; // if we're not going to limit renditions by player size, make an early decision.\n\n if (limitRenditionByPlayerDimensions === false) {\n const chosenRep = bandwidthBestRep || enabledPlaylistReps[0] || sortedPlaylistReps[0];\n if (chosenRep && chosenRep.playlist) {\n let type = 'sortedPlaylistReps';\n if (bandwidthBestRep) {\n type = 'bandwidthBestRep';\n }\n if (enabledPlaylistReps[0]) {\n type = 'enabledPlaylistReps';\n }\n logFn(`choosing ${representationToString(chosenRep)} using ${type} with options`, options);\n return chosenRep.playlist;\n }\n logFn('could not choose a playlist with options', options);\n return null;\n } // filter out playlists without resolution information\n\n const haveResolution = bandwidthPlaylistReps.filter(rep => rep.width && rep.height); // sort variants by resolution\n\n stableSort(haveResolution, (left, right) => left.width - right.width); // if we have the exact resolution as the player use it\n\n const resolutionBestRepList = haveResolution.filter(rep => rep.width === playerWidth && rep.height === playerHeight);\n highestRemainingBandwidthRep = resolutionBestRepList[resolutionBestRepList.length - 1]; // ensure that we pick the highest bandwidth variant that have exact resolution\n\n const resolutionBestRep = resolutionBestRepList.filter(rep => rep.bandwidth === highestRemainingBandwidthRep.bandwidth)[0];\n let resolutionPlusOneList;\n let resolutionPlusOneSmallest;\n let resolutionPlusOneRep; // find the smallest variant that is larger than the player\n // if there is no match of exact resolution\n\n if (!resolutionBestRep) {\n resolutionPlusOneList = haveResolution.filter(rep => rep.width > playerWidth || rep.height > playerHeight); // find all the variants have the same smallest resolution\n\n resolutionPlusOneSmallest = resolutionPlusOneList.filter(rep => rep.width === resolutionPlusOneList[0].width && rep.height === resolutionPlusOneList[0].height); // ensure that we also pick the highest bandwidth variant that\n // is just-larger-than the video player\n\n highestRemainingBandwidthRep = resolutionPlusOneSmallest[resolutionPlusOneSmallest.length - 1];\n resolutionPlusOneRep = resolutionPlusOneSmallest.filter(rep => rep.bandwidth === highestRemainingBandwidthRep.bandwidth)[0];\n }\n let leastPixelDiffRep; // If this selector proves to be better than others,\n // resolutionPlusOneRep and resolutionBestRep and all\n // the code involving them should be removed.\n\n if (playlistController.leastPixelDiffSelector) {\n // find the variant that is closest to the player's pixel size\n const leastPixelDiffList = haveResolution.map(rep => {\n rep.pixelDiff = Math.abs(rep.width - playerWidth) + Math.abs(rep.height - playerHeight);\n return rep;\n }); // get the highest bandwidth, closest resolution playlist\n\n stableSort(leastPixelDiffList, (left, right) => {\n // sort by highest bandwidth if pixelDiff is the same\n if (left.pixelDiff === right.pixelDiff) {\n return right.bandwidth - left.bandwidth;\n }\n return left.pixelDiff - right.pixelDiff;\n });\n leastPixelDiffRep = leastPixelDiffList[0];\n } // fallback chain of variants\n\n const chosenRep = leastPixelDiffRep || resolutionPlusOneRep || resolutionBestRep || bandwidthBestRep || enabledPlaylistReps[0] || sortedPlaylistReps[0];\n if (chosenRep && chosenRep.playlist) {\n let type = 'sortedPlaylistReps';\n if (leastPixelDiffRep) {\n type = 'leastPixelDiffRep';\n } else if (resolutionPlusOneRep) {\n type = 'resolutionPlusOneRep';\n } else if (resolutionBestRep) {\n type = 'resolutionBestRep';\n } else if (bandwidthBestRep) {\n type = 'bandwidthBestRep';\n } else if (enabledPlaylistReps[0]) {\n type = 'enabledPlaylistReps';\n }\n logFn(`choosing ${representationToString(chosenRep)} using ${type} with options`, options);\n return chosenRep.playlist;\n }\n logFn('could not choose a playlist with options', options);\n return null;\n};\n\n/**\n * Chooses the appropriate media playlist based on the most recent\n * bandwidth estimate and the player size.\n *\n * Expects to be called within the context of an instance of VhsHandler\n *\n * @return {Playlist} the highest bitrate playlist less than the\n * currently detected bandwidth, accounting for some amount of\n * bandwidth variance\n */\n\nconst lastBandwidthSelector = function () {\n const pixelRatio = this.useDevicePixelRatio ? window$1.devicePixelRatio || 1 : 1;\n return simpleSelector(this.playlists.main, this.systemBandwidth, parseInt(safeGetComputedStyle(this.tech_.el(), 'width'), 10) * pixelRatio, parseInt(safeGetComputedStyle(this.tech_.el(), 'height'), 10) * pixelRatio, this.limitRenditionByPlayerDimensions, this.playlistController_);\n};\n/**\n * Chooses the appropriate media playlist based on an\n * exponential-weighted moving average of the bandwidth after\n * filtering for player size.\n *\n * Expects to be called within the context of an instance of VhsHandler\n *\n * @param {number} decay - a number between 0 and 1. Higher values of\n * this parameter will cause previous bandwidth estimates to lose\n * significance more quickly.\n * @return {Function} a function which can be invoked to create a new\n * playlist selector function.\n * @see https://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average\n */\n\nconst movingAverageBandwidthSelector = function (decay) {\n let average = -1;\n let lastSystemBandwidth = -1;\n if (decay < 0 || decay > 1) {\n throw new Error('Moving average bandwidth decay must be between 0 and 1.');\n }\n return function () {\n const pixelRatio = this.useDevicePixelRatio ? window$1.devicePixelRatio || 1 : 1;\n if (average < 0) {\n average = this.systemBandwidth;\n lastSystemBandwidth = this.systemBandwidth;\n } // stop the average value from decaying for every 250ms\n // when the systemBandwidth is constant\n // and\n // stop average from setting to a very low value when the\n // systemBandwidth becomes 0 in case of chunk cancellation\n\n if (this.systemBandwidth > 0 && this.systemBandwidth !== lastSystemBandwidth) {\n average = decay * this.systemBandwidth + (1 - decay) * average;\n lastSystemBandwidth = this.systemBandwidth;\n }\n return simpleSelector(this.playlists.main, average, parseInt(safeGetComputedStyle(this.tech_.el(), 'width'), 10) * pixelRatio, parseInt(safeGetComputedStyle(this.tech_.el(), 'height'), 10) * pixelRatio, this.limitRenditionByPlayerDimensions, this.playlistController_);\n };\n};\n/**\n * Chooses the appropriate media playlist based on the potential to rebuffer\n *\n * @param {Object} settings\n * Object of information required to use this selector\n * @param {Object} settings.main\n * Object representation of the main manifest\n * @param {number} settings.currentTime\n * The current time of the player\n * @param {number} settings.bandwidth\n * Current measured bandwidth\n * @param {number} settings.duration\n * Duration of the media\n * @param {number} settings.segmentDuration\n * Segment duration to be used in round trip time calculations\n * @param {number} settings.timeUntilRebuffer\n * Time left in seconds until the player has to rebuffer\n * @param {number} settings.currentTimeline\n * The current timeline segments are being loaded from\n * @param {SyncController} settings.syncController\n * SyncController for determining if we have a sync point for a given playlist\n * @return {Object|null}\n * {Object} return.playlist\n * The highest bandwidth playlist with the least amount of rebuffering\n * {Number} return.rebufferingImpact\n * The amount of time in seconds switching to this playlist will rebuffer. A\n * negative value means that switching will cause zero rebuffering.\n */\n\nconst minRebufferMaxBandwidthSelector = function (settings) {\n const {\n main,\n currentTime,\n bandwidth,\n duration,\n segmentDuration,\n timeUntilRebuffer,\n currentTimeline,\n syncController\n } = settings; // filter out any playlists that have been excluded due to\n // incompatible configurations\n\n const compatiblePlaylists = main.playlists.filter(playlist => !Playlist.isIncompatible(playlist)); // filter out any playlists that have been disabled manually through the representations\n // api or excluded temporarily due to playback errors.\n\n let enabledPlaylists = compatiblePlaylists.filter(Playlist.isEnabled);\n if (!enabledPlaylists.length) {\n // if there are no enabled playlists, then they have all been excluded or disabled\n // by the user through the representations api. In this case, ignore exclusion and\n // fallback to what the user wants by using playlists the user has not disabled.\n enabledPlaylists = compatiblePlaylists.filter(playlist => !Playlist.isDisabled(playlist));\n }\n const bandwidthPlaylists = enabledPlaylists.filter(Playlist.hasAttribute.bind(null, 'BANDWIDTH'));\n const rebufferingEstimates = bandwidthPlaylists.map(playlist => {\n const syncPoint = syncController.getSyncPoint(playlist, duration, currentTimeline, currentTime); // If there is no sync point for this playlist, switching to it will require a\n // sync request first. This will double the request time\n\n const numRequests = syncPoint ? 1 : 2;\n const requestTimeEstimate = Playlist.estimateSegmentRequestTime(segmentDuration, bandwidth, playlist);\n const rebufferingImpact = requestTimeEstimate * numRequests - timeUntilRebuffer;\n return {\n playlist,\n rebufferingImpact\n };\n });\n const noRebufferingPlaylists = rebufferingEstimates.filter(estimate => estimate.rebufferingImpact <= 0); // Sort by bandwidth DESC\n\n stableSort(noRebufferingPlaylists, (a, b) => comparePlaylistBandwidth(b.playlist, a.playlist));\n if (noRebufferingPlaylists.length) {\n return noRebufferingPlaylists[0];\n }\n stableSort(rebufferingEstimates, (a, b) => a.rebufferingImpact - b.rebufferingImpact);\n return rebufferingEstimates[0] || null;\n};\n/**\n * Chooses the appropriate media playlist, which in this case is the lowest bitrate\n * one with video. If no renditions with video exist, return the lowest audio rendition.\n *\n * Expects to be called within the context of an instance of VhsHandler\n *\n * @return {Object|null}\n * {Object} return.playlist\n * The lowest bitrate playlist that contains a video codec. If no such rendition\n * exists pick the lowest audio rendition.\n */\n\nconst lowestBitrateCompatibleVariantSelector = function () {\n // filter out any playlists that have been excluded due to\n // incompatible configurations or playback errors\n const playlists = this.playlists.main.playlists.filter(Playlist.isEnabled); // Sort ascending by bitrate\n\n stableSort(playlists, (a, b) => comparePlaylistBandwidth(a, b)); // Parse and assume that playlists with no video codec have no video\n // (this is not necessarily true, although it is generally true).\n //\n // If an entire manifest has no valid videos everything will get filtered\n // out.\n\n const playlistsWithVideo = playlists.filter(playlist => !!codecsForPlaylist(this.playlists.main, playlist).video);\n return playlistsWithVideo[0] || null;\n};\n\n/**\n * Combine all segments into a single Uint8Array\n *\n * @param {Object} segmentObj\n * @return {Uint8Array} concatenated bytes\n * @private\n */\nconst concatSegments = segmentObj => {\n let offset = 0;\n let tempBuffer;\n if (segmentObj.bytes) {\n tempBuffer = new Uint8Array(segmentObj.bytes); // combine the individual segments into one large typed-array\n\n segmentObj.segments.forEach(segment => {\n tempBuffer.set(segment, offset);\n offset += segment.byteLength;\n });\n }\n return tempBuffer;\n};\n\n/**\n * @file text-tracks.js\n */\n/**\n * Create captions text tracks on video.js if they do not exist\n *\n * @param {Object} inbandTextTracks a reference to current inbandTextTracks\n * @param {Object} tech the video.js tech\n * @param {Object} captionStream the caption stream to create\n * @private\n */\n\nconst createCaptionsTrackIfNotExists = function (inbandTextTracks, tech, captionStream) {\n if (!inbandTextTracks[captionStream]) {\n tech.trigger({\n type: 'usage',\n name: 'vhs-608'\n });\n let instreamId = captionStream; // we need to translate SERVICEn for 708 to how mux.js currently labels them\n\n if (/^cc708_/.test(captionStream)) {\n instreamId = 'SERVICE' + captionStream.split('_')[1];\n }\n const track = tech.textTracks().getTrackById(instreamId);\n if (track) {\n // Resuse an existing track with a CC# id because this was\n // very likely created by videojs-contrib-hls from information\n // in the m3u8 for us to use\n inbandTextTracks[captionStream] = track;\n } else {\n // This section gets called when we have caption services that aren't specified in the manifest.\n // Manifest level caption services are handled in media-groups.js under CLOSED-CAPTIONS.\n const captionServices = tech.options_.vhs && tech.options_.vhs.captionServices || {};\n let label = captionStream;\n let language = captionStream;\n let def = false;\n const captionService = captionServices[instreamId];\n if (captionService) {\n label = captionService.label;\n language = captionService.language;\n def = captionService.default;\n } // Otherwise, create a track with the default `CC#` label and\n // without a language\n\n inbandTextTracks[captionStream] = tech.addRemoteTextTrack({\n kind: 'captions',\n id: instreamId,\n // TODO: investigate why this doesn't seem to turn the caption on by default\n default: def,\n label,\n language\n }, false).track;\n }\n }\n};\n/**\n * Add caption text track data to a source handler given an array of captions\n *\n * @param {Object}\n * @param {Object} inbandTextTracks the inband text tracks\n * @param {number} timestampOffset the timestamp offset of the source buffer\n * @param {Array} captionArray an array of caption data\n * @private\n */\n\nconst addCaptionData = function ({\n inbandTextTracks,\n captionArray,\n timestampOffset\n}) {\n if (!captionArray) {\n return;\n }\n const Cue = window$1.WebKitDataCue || window$1.VTTCue;\n captionArray.forEach(caption => {\n const track = caption.stream; // in CEA 608 captions, video.js/mux.js sends a content array\n // with positioning data\n\n if (caption.content) {\n caption.content.forEach(value => {\n const cue = new Cue(caption.startTime + timestampOffset, caption.endTime + timestampOffset, value.text);\n cue.line = value.line;\n cue.align = 'left';\n cue.position = value.position;\n cue.positionAlign = 'line-left';\n inbandTextTracks[track].addCue(cue);\n });\n } else {\n // otherwise, a text value with combined captions is sent\n inbandTextTracks[track].addCue(new Cue(caption.startTime + timestampOffset, caption.endTime + timestampOffset, caption.text));\n }\n });\n};\n/**\n * Define properties on a cue for backwards compatability,\n * but warn the user that the way that they are using it\n * is depricated and will be removed at a later date.\n *\n * @param {Cue} cue the cue to add the properties on\n * @private\n */\n\nconst deprecateOldCue = function (cue) {\n Object.defineProperties(cue.frame, {\n id: {\n get() {\n videojs.log.warn('cue.frame.id is deprecated. Use cue.value.key instead.');\n return cue.value.key;\n }\n },\n value: {\n get() {\n videojs.log.warn('cue.frame.value is deprecated. Use cue.value.data instead.');\n return cue.value.data;\n }\n },\n privateData: {\n get() {\n videojs.log.warn('cue.frame.privateData is deprecated. Use cue.value.data instead.');\n return cue.value.data;\n }\n }\n });\n};\n/**\n * Add metadata text track data to a source handler given an array of metadata\n *\n * @param {Object}\n * @param {Object} inbandTextTracks the inband text tracks\n * @param {Array} metadataArray an array of meta data\n * @param {number} timestampOffset the timestamp offset of the source buffer\n * @param {number} videoDuration the duration of the video\n * @private\n */\n\nconst addMetadata = ({\n inbandTextTracks,\n metadataArray,\n timestampOffset,\n videoDuration\n}) => {\n if (!metadataArray) {\n return;\n }\n const Cue = window$1.WebKitDataCue || window$1.VTTCue;\n const metadataTrack = inbandTextTracks.metadataTrack_;\n if (!metadataTrack) {\n return;\n }\n metadataArray.forEach(metadata => {\n const time = metadata.cueTime + timestampOffset; // if time isn't a finite number between 0 and Infinity, like NaN,\n // ignore this bit of metadata.\n // This likely occurs when you have an non-timed ID3 tag like TIT2,\n // which is the \"Title/Songname/Content description\" frame\n\n if (typeof time !== 'number' || window$1.isNaN(time) || time < 0 || !(time < Infinity)) {\n return;\n } // If we have no frames, we can't create a cue.\n\n if (!metadata.frames || !metadata.frames.length) {\n return;\n }\n metadata.frames.forEach(frame => {\n const cue = new Cue(time, time, frame.value || frame.url || frame.data || '');\n cue.frame = frame;\n cue.value = frame;\n deprecateOldCue(cue);\n metadataTrack.addCue(cue);\n });\n });\n if (!metadataTrack.cues || !metadataTrack.cues.length) {\n return;\n } // Updating the metadeta cues so that\n // the endTime of each cue is the startTime of the next cue\n // the endTime of last cue is the duration of the video\n\n const cues = metadataTrack.cues;\n const cuesArray = []; // Create a copy of the TextTrackCueList...\n // ...disregarding cues with a falsey value\n\n for (let i = 0; i < cues.length; i++) {\n if (cues[i]) {\n cuesArray.push(cues[i]);\n }\n } // Group cues by their startTime value\n\n const cuesGroupedByStartTime = cuesArray.reduce((obj, cue) => {\n const timeSlot = obj[cue.startTime] || [];\n timeSlot.push(cue);\n obj[cue.startTime] = timeSlot;\n return obj;\n }, {}); // Sort startTimes by ascending order\n\n const sortedStartTimes = Object.keys(cuesGroupedByStartTime).sort((a, b) => Number(a) - Number(b)); // Map each cue group's endTime to the next group's startTime\n\n sortedStartTimes.forEach((startTime, idx) => {\n const cueGroup = cuesGroupedByStartTime[startTime];\n const finiteDuration = isFinite(videoDuration) ? videoDuration : 0;\n const nextTime = Number(sortedStartTimes[idx + 1]) || finiteDuration; // Map each cue's endTime the next group's startTime\n\n cueGroup.forEach(cue => {\n cue.endTime = nextTime;\n });\n });\n}; // object for mapping daterange attributes\n\nconst dateRangeAttr = {\n id: 'ID',\n class: 'CLASS',\n startDate: 'START-DATE',\n duration: 'DURATION',\n endDate: 'END-DATE',\n endOnNext: 'END-ON-NEXT',\n plannedDuration: 'PLANNED-DURATION',\n scte35Out: 'SCTE35-OUT',\n scte35In: 'SCTE35-IN'\n};\nconst dateRangeKeysToOmit = new Set(['id', 'class', 'startDate', 'duration', 'endDate', 'endOnNext', 'startTime', 'endTime', 'processDateRange']);\n/**\n * Add DateRange metadata text track to a source handler given an array of metadata\n *\n * @param {Object}\n * @param {Object} inbandTextTracks the inband text tracks\n * @param {Array} dateRanges parsed media playlist\n * @private\n */\n\nconst addDateRangeMetadata = ({\n inbandTextTracks,\n dateRanges\n}) => {\n const metadataTrack = inbandTextTracks.metadataTrack_;\n if (!metadataTrack) {\n return;\n }\n const Cue = window$1.WebKitDataCue || window$1.VTTCue;\n dateRanges.forEach(dateRange => {\n // we generate multiple cues for each date range with different attributes\n for (const key of Object.keys(dateRange)) {\n if (dateRangeKeysToOmit.has(key)) {\n continue;\n }\n const cue = new Cue(dateRange.startTime, dateRange.endTime, '');\n cue.id = dateRange.id;\n cue.type = 'com.apple.quicktime.HLS';\n cue.value = {\n key: dateRangeAttr[key],\n data: dateRange[key]\n };\n if (key === 'scte35Out' || key === 'scte35In') {\n cue.value.data = new Uint8Array(cue.value.data.match(/[\\da-f]{2}/gi)).buffer;\n }\n metadataTrack.addCue(cue);\n }\n dateRange.processDateRange();\n });\n};\n/**\n * Create metadata text track on video.js if it does not exist\n *\n * @param {Object} inbandTextTracks a reference to current inbandTextTracks\n * @param {string} dispatchType the inband metadata track dispatch type\n * @param {Object} tech the video.js tech\n * @private\n */\n\nconst createMetadataTrackIfNotExists = (inbandTextTracks, dispatchType, tech) => {\n if (inbandTextTracks.metadataTrack_) {\n return;\n }\n inbandTextTracks.metadataTrack_ = tech.addRemoteTextTrack({\n kind: 'metadata',\n label: 'Timed Metadata'\n }, false).track;\n if (!videojs.browser.IS_ANY_SAFARI) {\n inbandTextTracks.metadataTrack_.inBandMetadataTrackDispatchType = dispatchType;\n }\n};\n/**\n * Remove cues from a track on video.js.\n *\n * @param {Double} start start of where we should remove the cue\n * @param {Double} end end of where the we should remove the cue\n * @param {Object} track the text track to remove the cues from\n * @private\n */\n\nconst removeCuesFromTrack = function (start, end, track) {\n let i;\n let cue;\n if (!track) {\n return;\n }\n if (!track.cues) {\n return;\n }\n i = track.cues.length;\n while (i--) {\n cue = track.cues[i]; // Remove any cue within the provided start and end time\n\n if (cue.startTime >= start && cue.endTime <= end) {\n track.removeCue(cue);\n }\n }\n};\n/**\n * Remove duplicate cues from a track on video.js (a cue is considered a\n * duplicate if it has the same time interval and text as another)\n *\n * @param {Object} track the text track to remove the duplicate cues from\n * @private\n */\n\nconst removeDuplicateCuesFromTrack = function (track) {\n const cues = track.cues;\n if (!cues) {\n return;\n }\n const uniqueCues = {};\n for (let i = cues.length - 1; i >= 0; i--) {\n const cue = cues[i];\n const cueKey = `${cue.startTime}-${cue.endTime}-${cue.text}`;\n if (uniqueCues[cueKey]) {\n track.removeCue(cue);\n } else {\n uniqueCues[cueKey] = cue;\n }\n }\n};\n\n/**\n * Returns a list of gops in the buffer that have a pts value of 3 seconds or more in\n * front of current time.\n *\n * @param {Array} buffer\n * The current buffer of gop information\n * @param {number} currentTime\n * The current time\n * @param {Double} mapping\n * Offset to map display time to stream presentation time\n * @return {Array}\n * List of gops considered safe to append over\n */\n\nconst gopsSafeToAlignWith = (buffer, currentTime, mapping) => {\n if (typeof currentTime === 'undefined' || currentTime === null || !buffer.length) {\n return [];\n } // pts value for current time + 3 seconds to give a bit more wiggle room\n\n const currentTimePts = Math.ceil((currentTime - mapping + 3) * ONE_SECOND_IN_TS);\n let i;\n for (i = 0; i < buffer.length; i++) {\n if (buffer[i].pts > currentTimePts) {\n break;\n }\n }\n return buffer.slice(i);\n};\n/**\n * Appends gop information (timing and byteLength) received by the transmuxer for the\n * gops appended in the last call to appendBuffer\n *\n * @param {Array} buffer\n * The current buffer of gop information\n * @param {Array} gops\n * List of new gop information\n * @param {boolean} replace\n * If true, replace the buffer with the new gop information. If false, append the\n * new gop information to the buffer in the right location of time.\n * @return {Array}\n * Updated list of gop information\n */\n\nconst updateGopBuffer = (buffer, gops, replace) => {\n if (!gops.length) {\n return buffer;\n }\n if (replace) {\n // If we are in safe append mode, then completely overwrite the gop buffer\n // with the most recent appeneded data. This will make sure that when appending\n // future segments, we only try to align with gops that are both ahead of current\n // time and in the last segment appended.\n return gops.slice();\n }\n const start = gops[0].pts;\n let i = 0;\n for (i; i < buffer.length; i++) {\n if (buffer[i].pts >= start) {\n break;\n }\n }\n return buffer.slice(0, i).concat(gops);\n};\n/**\n * Removes gop information in buffer that overlaps with provided start and end\n *\n * @param {Array} buffer\n * The current buffer of gop information\n * @param {Double} start\n * position to start the remove at\n * @param {Double} end\n * position to end the remove at\n * @param {Double} mapping\n * Offset to map display time to stream presentation time\n */\n\nconst removeGopBuffer = (buffer, start, end, mapping) => {\n const startPts = Math.ceil((start - mapping) * ONE_SECOND_IN_TS);\n const endPts = Math.ceil((end - mapping) * ONE_SECOND_IN_TS);\n const updatedBuffer = buffer.slice();\n let i = buffer.length;\n while (i--) {\n if (buffer[i].pts <= endPts) {\n break;\n }\n }\n if (i === -1) {\n // no removal because end of remove range is before start of buffer\n return updatedBuffer;\n }\n let j = i + 1;\n while (j--) {\n if (buffer[j].pts <= startPts) {\n break;\n }\n } // clamp remove range start to 0 index\n\n j = Math.max(j, 0);\n updatedBuffer.splice(j, i - j + 1);\n return updatedBuffer;\n};\nconst shallowEqual = function (a, b) {\n // if both are undefined\n // or one or the other is undefined\n // they are not equal\n if (!a && !b || !a && b || a && !b) {\n return false;\n } // they are the same object and thus, equal\n\n if (a === b) {\n return true;\n } // sort keys so we can make sure they have\n // all the same keys later.\n\n const akeys = Object.keys(a).sort();\n const bkeys = Object.keys(b).sort(); // different number of keys, not equal\n\n if (akeys.length !== bkeys.length) {\n return false;\n }\n for (let i = 0; i < akeys.length; i++) {\n const key = akeys[i]; // different sorted keys, not equal\n\n if (key !== bkeys[i]) {\n return false;\n } // different values, not equal\n\n if (a[key] !== b[key]) {\n return false;\n }\n }\n return true;\n};\n\n// https://www.w3.org/TR/WebIDL-1/#quotaexceedederror\nconst QUOTA_EXCEEDED_ERR = 22;\n\n/**\n * The segment loader has no recourse except to fetch a segment in the\n * current playlist and use the internal timestamps in that segment to\n * generate a syncPoint. This function returns a good candidate index\n * for that process.\n *\n * @param {Array} segments - the segments array from a playlist.\n * @return {number} An index of a segment from the playlist to load\n */\n\nconst getSyncSegmentCandidate = function (currentTimeline, segments, targetTime) {\n segments = segments || [];\n const timelineSegments = [];\n let time = 0;\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n if (currentTimeline === segment.timeline) {\n timelineSegments.push(i);\n time += segment.duration;\n if (time > targetTime) {\n return i;\n }\n }\n }\n if (timelineSegments.length === 0) {\n return 0;\n } // default to the last timeline segment\n\n return timelineSegments[timelineSegments.length - 1];\n}; // In the event of a quota exceeded error, keep at least one second of back buffer. This\n// number was arbitrarily chosen and may be updated in the future, but seemed reasonable\n// as a start to prevent any potential issues with removing content too close to the\n// playhead.\n\nconst MIN_BACK_BUFFER = 1; // in ms\n\nconst CHECK_BUFFER_DELAY = 500;\nconst finite = num => typeof num === 'number' && isFinite(num); // With most content hovering around 30fps, if a segment has a duration less than a half\n// frame at 30fps or one frame at 60fps, the bandwidth and throughput calculations will\n// not accurately reflect the rest of the content.\n\nconst MIN_SEGMENT_DURATION_TO_SAVE_STATS = 1 / 60;\nconst illegalMediaSwitch = (loaderType, startingMedia, trackInfo) => {\n // Although these checks should most likely cover non 'main' types, for now it narrows\n // the scope of our checks.\n if (loaderType !== 'main' || !startingMedia || !trackInfo) {\n return null;\n }\n if (!trackInfo.hasAudio && !trackInfo.hasVideo) {\n return 'Neither audio nor video found in segment.';\n }\n if (startingMedia.hasVideo && !trackInfo.hasVideo) {\n return 'Only audio found in segment when we expected video.' + ' We can\\'t switch to audio only from a stream that had video.' + ' To get rid of this message, please add codec information to the manifest.';\n }\n if (!startingMedia.hasVideo && trackInfo.hasVideo) {\n return 'Video found in segment when we expected only audio.' + ' We can\\'t switch to a stream with video from an audio only stream.' + ' To get rid of this message, please add codec information to the manifest.';\n }\n return null;\n};\n/**\n * Calculates a time value that is safe to remove from the back buffer without interrupting\n * playback.\n *\n * @param {TimeRange} seekable\n * The current seekable range\n * @param {number} currentTime\n * The current time of the player\n * @param {number} targetDuration\n * The target duration of the current playlist\n * @return {number}\n * Time that is safe to remove from the back buffer without interrupting playback\n */\n\nconst safeBackBufferTrimTime = (seekable, currentTime, targetDuration) => {\n // 30 seconds before the playhead provides a safe default for trimming.\n //\n // Choosing a reasonable default is particularly important for high bitrate content and\n // VOD videos/live streams with large windows, as the buffer may end up overfilled and\n // throw an APPEND_BUFFER_ERR.\n let trimTime = currentTime - Config.BACK_BUFFER_LENGTH;\n if (seekable.length) {\n // Some live playlists may have a shorter window of content than the full allowed back\n // buffer. For these playlists, don't save content that's no longer within the window.\n trimTime = Math.max(trimTime, seekable.start(0));\n } // Don't remove within target duration of the current time to avoid the possibility of\n // removing the GOP currently being played, as removing it can cause playback stalls.\n\n const maxTrimTime = currentTime - targetDuration;\n return Math.min(maxTrimTime, trimTime);\n};\nconst segmentInfoString = segmentInfo => {\n const {\n startOfSegment,\n duration,\n segment,\n part,\n playlist: {\n mediaSequence: seq,\n id,\n segments = []\n },\n mediaIndex: index,\n partIndex,\n timeline\n } = segmentInfo;\n const segmentLen = segments.length - 1;\n let selection = 'mediaIndex/partIndex increment';\n if (segmentInfo.getMediaInfoForTime) {\n selection = `getMediaInfoForTime (${segmentInfo.getMediaInfoForTime})`;\n } else if (segmentInfo.isSyncRequest) {\n selection = 'getSyncSegmentCandidate (isSyncRequest)';\n }\n if (segmentInfo.independent) {\n selection += ` with independent ${segmentInfo.independent}`;\n }\n const hasPartIndex = typeof partIndex === 'number';\n const name = segmentInfo.segment.uri ? 'segment' : 'pre-segment';\n const zeroBasedPartCount = hasPartIndex ? getKnownPartCount({\n preloadSegment: segment\n }) - 1 : 0;\n return `${name} [${seq + index}/${seq + segmentLen}]` + (hasPartIndex ? ` part [${partIndex}/${zeroBasedPartCount}]` : '') + ` segment start/end [${segment.start} => ${segment.end}]` + (hasPartIndex ? ` part start/end [${part.start} => ${part.end}]` : '') + ` startOfSegment [${startOfSegment}]` + ` duration [${duration}]` + ` timeline [${timeline}]` + ` selected by [${selection}]` + ` playlist [${id}]`;\n};\nconst timingInfoPropertyForMedia = mediaType => `${mediaType}TimingInfo`;\nconst getBufferedEndOrFallback = (buffered, fallback) => buffered.length ? buffered.end(buffered.length - 1) : fallback;\n/**\n * Returns the timestamp offset to use for the segment.\n *\n * @param {number} segmentTimeline\n * The timeline of the segment\n * @param {number} currentTimeline\n * The timeline currently being followed by the loader\n * @param {number} startOfSegment\n * The estimated segment start\n * @param {TimeRange[]} buffered\n * The loader's buffer\n * @param {boolean} calculateTimestampOffsetForEachSegment\n * Feature flag to always calculate timestampOffset\n * @param {boolean} overrideCheck\n * If true, no checks are made to see if the timestamp offset value should be set,\n * but sets it directly to a value.\n *\n * @return {number|null}\n * Either a number representing a new timestamp offset, or null if the segment is\n * part of the same timeline\n */\n\nconst timestampOffsetForSegment = ({\n segmentTimeline,\n currentTimeline,\n startOfSegment,\n buffered,\n calculateTimestampOffsetForEachSegment,\n overrideCheck\n}) => {\n if (calculateTimestampOffsetForEachSegment) {\n return getBufferedEndOrFallback(buffered, startOfSegment);\n } // Check to see if we are crossing a discontinuity to see if we need to set the\n // timestamp offset on the transmuxer and source buffer.\n //\n // Previously, we changed the timestampOffset if the start of this segment was less than\n // the currently set timestampOffset, but this isn't desirable as it can produce bad\n // behavior, especially around long running live streams.\n\n if (!overrideCheck && segmentTimeline === currentTimeline) {\n return null;\n } // When changing renditions, it's possible to request a segment on an older timeline. For\n // instance, given two renditions with the following:\n //\n // #EXTINF:10\n // segment1\n // #EXT-X-DISCONTINUITY\n // #EXTINF:10\n // segment2\n // #EXTINF:10\n // segment3\n //\n // And the current player state:\n //\n // current time: 8\n // buffer: 0 => 20\n //\n // The next segment on the current rendition would be segment3, filling the buffer from\n // 20s onwards. However, if a rendition switch happens after segment2 was requested,\n // then the next segment to be requested will be segment1 from the new rendition in\n // order to fill time 8 and onwards. Using the buffered end would result in repeated\n // content (since it would position segment1 of the new rendition starting at 20s). This\n // case can be identified when the new segment's timeline is a prior value. Instead of\n // using the buffered end, the startOfSegment can be used, which, hopefully, will be\n // more accurate to the actual start time of the segment.\n\n if (segmentTimeline < currentTimeline) {\n return startOfSegment;\n } // segmentInfo.startOfSegment used to be used as the timestamp offset, however, that\n // value uses the end of the last segment if it is available. While this value\n // should often be correct, it's better to rely on the buffered end, as the new\n // content post discontinuity should line up with the buffered end as if it were\n // time 0 for the new content.\n\n return getBufferedEndOrFallback(buffered, startOfSegment);\n};\n/**\n * Returns whether or not the loader should wait for a timeline change from the timeline\n * change controller before processing the segment.\n *\n * Primary timing in VHS goes by video. This is different from most media players, as\n * audio is more often used as the primary timing source. For the foreseeable future, VHS\n * will continue to use video as the primary timing source, due to the current logic and\n * expectations built around it.\n\n * Since the timing follows video, in order to maintain sync, the video loader is\n * responsible for setting both audio and video source buffer timestamp offsets.\n *\n * Setting different values for audio and video source buffers could lead to\n * desyncing. The following examples demonstrate some of the situations where this\n * distinction is important. Note that all of these cases involve demuxed content. When\n * content is muxed, the audio and video are packaged together, therefore syncing\n * separate media playlists is not an issue.\n *\n * CASE 1: Audio prepares to load a new timeline before video:\n *\n * Timeline: 0 1\n * Audio Segments: 0 1 2 3 4 5 DISCO 6 7 8 9\n * Audio Loader: ^\n * Video Segments: 0 1 2 3 4 5 DISCO 6 7 8 9\n * Video Loader ^\n *\n * In the above example, the audio loader is preparing to load the 6th segment, the first\n * after a discontinuity, while the video loader is still loading the 5th segment, before\n * the discontinuity.\n *\n * If the audio loader goes ahead and loads and appends the 6th segment before the video\n * loader crosses the discontinuity, then when appended, the 6th audio segment will use\n * the timestamp offset from timeline 0. This will likely lead to desyncing. In addition,\n * the audio loader must provide the audioAppendStart value to trim the content in the\n * transmuxer, and that value relies on the audio timestamp offset. Since the audio\n * timestamp offset is set by the video (main) loader, the audio loader shouldn't load the\n * segment until that value is provided.\n *\n * CASE 2: Video prepares to load a new timeline before audio:\n *\n * Timeline: 0 1\n * Audio Segments: 0 1 2 3 4 5 DISCO 6 7 8 9\n * Audio Loader: ^\n * Video Segments: 0 1 2 3 4 5 DISCO 6 7 8 9\n * Video Loader ^\n *\n * In the above example, the video loader is preparing to load the 6th segment, the first\n * after a discontinuity, while the audio loader is still loading the 5th segment, before\n * the discontinuity.\n *\n * If the video loader goes ahead and loads and appends the 6th segment, then once the\n * segment is loaded and processed, both the video and audio timestamp offsets will be\n * set, since video is used as the primary timing source. This is to ensure content lines\n * up appropriately, as any modifications to the video timing are reflected by audio when\n * the video loader sets the audio and video timestamp offsets to the same value. However,\n * setting the timestamp offset for audio before audio has had a chance to change\n * timelines will likely lead to desyncing, as the audio loader will append segment 5 with\n * a timestamp intended to apply to segments from timeline 1 rather than timeline 0.\n *\n * CASE 3: When seeking, audio prepares to load a new timeline before video\n *\n * Timeline: 0 1\n * Audio Segments: 0 1 2 3 4 5 DISCO 6 7 8 9\n * Audio Loader: ^\n * Video Segments: 0 1 2 3 4 5 DISCO 6 7 8 9\n * Video Loader ^\n *\n * In the above example, both audio and video loaders are loading segments from timeline\n * 0, but imagine that the seek originated from timeline 1.\n *\n * When seeking to a new timeline, the timestamp offset will be set based on the expected\n * segment start of the loaded video segment. In order to maintain sync, the audio loader\n * must wait for the video loader to load its segment and update both the audio and video\n * timestamp offsets before it may load and append its own segment. This is the case\n * whether the seek results in a mismatched segment request (e.g., the audio loader\n * chooses to load segment 3 and the video loader chooses to load segment 4) or the\n * loaders choose to load the same segment index from each playlist, as the segments may\n * not be aligned perfectly, even for matching segment indexes.\n *\n * @param {Object} timelinechangeController\n * @param {number} currentTimeline\n * The timeline currently being followed by the loader\n * @param {number} segmentTimeline\n * The timeline of the segment being loaded\n * @param {('main'|'audio')} loaderType\n * The loader type\n * @param {boolean} audioDisabled\n * Whether the audio is disabled for the loader. This should only be true when the\n * loader may have muxed audio in its segment, but should not append it, e.g., for\n * the main loader when an alternate audio playlist is active.\n *\n * @return {boolean}\n * Whether the loader should wait for a timeline change from the timeline change\n * controller before processing the segment\n */\n\nconst shouldWaitForTimelineChange = ({\n timelineChangeController,\n currentTimeline,\n segmentTimeline,\n loaderType,\n audioDisabled\n}) => {\n if (currentTimeline === segmentTimeline) {\n return false;\n }\n if (loaderType === 'audio') {\n const lastMainTimelineChange = timelineChangeController.lastTimelineChange({\n type: 'main'\n }); // Audio loader should wait if:\n //\n // * main hasn't had a timeline change yet (thus has not loaded its first segment)\n // * main hasn't yet changed to the timeline audio is looking to load\n\n return !lastMainTimelineChange || lastMainTimelineChange.to !== segmentTimeline;\n } // The main loader only needs to wait for timeline changes if there's demuxed audio.\n // Otherwise, there's nothing to wait for, since audio would be muxed into the main\n // loader's segments (or the content is audio/video only and handled by the main\n // loader).\n\n if (loaderType === 'main' && audioDisabled) {\n const pendingAudioTimelineChange = timelineChangeController.pendingTimelineChange({\n type: 'audio'\n }); // Main loader should wait for the audio loader if audio is not pending a timeline\n // change to the current timeline.\n //\n // Since the main loader is responsible for setting the timestamp offset for both\n // audio and video, the main loader must wait for audio to be about to change to its\n // timeline before setting the offset, otherwise, if audio is behind in loading,\n // segments from the previous timeline would be adjusted by the new timestamp offset.\n //\n // This requirement means that video will not cross a timeline until the audio is\n // about to cross to it, so that way audio and video will always cross the timeline\n // together.\n //\n // In addition to normal timeline changes, these rules also apply to the start of a\n // stream (going from a non-existent timeline, -1, to timeline 0). It's important\n // that these rules apply to the first timeline change because if they did not, it's\n // possible that the main loader will cross two timelines before the audio loader has\n // crossed one. Logic may be implemented to handle the startup as a special case, but\n // it's easier to simply treat all timeline changes the same.\n\n if (pendingAudioTimelineChange && pendingAudioTimelineChange.to === segmentTimeline) {\n return false;\n }\n return true;\n }\n return false;\n};\nconst mediaDuration = timingInfos => {\n let maxDuration = 0;\n ['video', 'audio'].forEach(function (type) {\n const typeTimingInfo = timingInfos[`${type}TimingInfo`];\n if (!typeTimingInfo) {\n return;\n }\n const {\n start,\n end\n } = typeTimingInfo;\n let duration;\n if (typeof start === 'bigint' || typeof end === 'bigint') {\n duration = window$1.BigInt(end) - window$1.BigInt(start);\n } else if (typeof start === 'number' && typeof end === 'number') {\n duration = end - start;\n }\n if (typeof duration !== 'undefined' && duration > maxDuration) {\n maxDuration = duration;\n }\n }); // convert back to a number if it is lower than MAX_SAFE_INTEGER\n // as we only need BigInt when we are above that.\n\n if (typeof maxDuration === 'bigint' && maxDuration < Number.MAX_SAFE_INTEGER) {\n maxDuration = Number(maxDuration);\n }\n return maxDuration;\n};\nconst segmentTooLong = ({\n segmentDuration,\n maxDuration\n}) => {\n // 0 duration segments are most likely due to metadata only segments or a lack of\n // information.\n if (!segmentDuration) {\n return false;\n } // For HLS:\n //\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1\n // The EXTINF duration of each Media Segment in the Playlist\n // file, when rounded to the nearest integer, MUST be less than or equal\n // to the target duration; longer segments can trigger playback stalls\n // or other errors.\n //\n // For DASH, the mpd-parser uses the largest reported segment duration as the target\n // duration. Although that reported duration is occasionally approximate (i.e., not\n // exact), a strict check may report that a segment is too long more often in DASH.\n\n return Math.round(segmentDuration) > maxDuration + TIME_FUDGE_FACTOR;\n};\nconst getTroublesomeSegmentDurationMessage = (segmentInfo, sourceType) => {\n // Right now we aren't following DASH's timing model exactly, so only perform\n // this check for HLS content.\n if (sourceType !== 'hls') {\n return null;\n }\n const segmentDuration = mediaDuration({\n audioTimingInfo: segmentInfo.audioTimingInfo,\n videoTimingInfo: segmentInfo.videoTimingInfo\n }); // Don't report if we lack information.\n //\n // If the segment has a duration of 0 it is either a lack of information or a\n // metadata only segment and shouldn't be reported here.\n\n if (!segmentDuration) {\n return null;\n }\n const targetDuration = segmentInfo.playlist.targetDuration;\n const isSegmentWayTooLong = segmentTooLong({\n segmentDuration,\n maxDuration: targetDuration * 2\n });\n const isSegmentSlightlyTooLong = segmentTooLong({\n segmentDuration,\n maxDuration: targetDuration\n });\n const segmentTooLongMessage = `Segment with index ${segmentInfo.mediaIndex} ` + `from playlist ${segmentInfo.playlist.id} ` + `has a duration of ${segmentDuration} ` + `when the reported duration is ${segmentInfo.duration} ` + `and the target duration is ${targetDuration}. ` + 'For HLS content, a duration in excess of the target duration may result in ' + 'playback issues. See the HLS specification section on EXT-X-TARGETDURATION for ' + 'more details: ' + 'https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1';\n if (isSegmentWayTooLong || isSegmentSlightlyTooLong) {\n return {\n severity: isSegmentWayTooLong ? 'warn' : 'info',\n message: segmentTooLongMessage\n };\n }\n return null;\n};\n/**\n * An object that manages segment loading and appending.\n *\n * @class SegmentLoader\n * @param {Object} options required and optional options\n * @extends videojs.EventTarget\n */\n\nclass SegmentLoader extends videojs.EventTarget {\n constructor(settings, options = {}) {\n super(); // check pre-conditions\n\n if (!settings) {\n throw new TypeError('Initialization settings are required');\n }\n if (typeof settings.currentTime !== 'function') {\n throw new TypeError('No currentTime getter specified');\n }\n if (!settings.mediaSource) {\n throw new TypeError('No MediaSource specified');\n } // public properties\n\n this.bandwidth = settings.bandwidth;\n this.throughput = {\n rate: 0,\n count: 0\n };\n this.roundTrip = NaN;\n this.resetStats_();\n this.mediaIndex = null;\n this.partIndex = null; // private settings\n\n this.hasPlayed_ = settings.hasPlayed;\n this.currentTime_ = settings.currentTime;\n this.seekable_ = settings.seekable;\n this.seeking_ = settings.seeking;\n this.duration_ = settings.duration;\n this.mediaSource_ = settings.mediaSource;\n this.vhs_ = settings.vhs;\n this.loaderType_ = settings.loaderType;\n this.currentMediaInfo_ = void 0;\n this.startingMediaInfo_ = void 0;\n this.segmentMetadataTrack_ = settings.segmentMetadataTrack;\n this.goalBufferLength_ = settings.goalBufferLength;\n this.sourceType_ = settings.sourceType;\n this.sourceUpdater_ = settings.sourceUpdater;\n this.inbandTextTracks_ = settings.inbandTextTracks;\n this.state_ = 'INIT';\n this.timelineChangeController_ = settings.timelineChangeController;\n this.shouldSaveSegmentTimingInfo_ = true;\n this.parse708captions_ = settings.parse708captions;\n this.useDtsForTimestampOffset_ = settings.useDtsForTimestampOffset;\n this.calculateTimestampOffsetForEachSegment_ = settings.calculateTimestampOffsetForEachSegment;\n this.captionServices_ = settings.captionServices;\n this.exactManifestTimings = settings.exactManifestTimings;\n this.addMetadataToTextTrack = settings.addMetadataToTextTrack; // private instance variables\n\n this.checkBufferTimeout_ = null;\n this.error_ = void 0;\n this.currentTimeline_ = -1;\n this.pendingSegment_ = null;\n this.xhrOptions_ = null;\n this.pendingSegments_ = [];\n this.audioDisabled_ = false;\n this.isPendingTimestampOffset_ = false; // TODO possibly move gopBuffer and timeMapping info to a separate controller\n\n this.gopBuffer_ = [];\n this.timeMapping_ = 0;\n this.safeAppend_ = false;\n this.appendInitSegment_ = {\n audio: true,\n video: true\n };\n this.playlistOfLastInitSegment_ = {\n audio: null,\n video: null\n };\n this.callQueue_ = []; // If the segment loader prepares to load a segment, but does not have enough\n // information yet to start the loading process (e.g., if the audio loader wants to\n // load a segment from the next timeline but the main loader hasn't yet crossed that\n // timeline), then the load call will be added to the queue until it is ready to be\n // processed.\n\n this.loadQueue_ = [];\n this.metadataQueue_ = {\n id3: [],\n caption: []\n };\n this.waitingOnRemove_ = false;\n this.quotaExceededErrorRetryTimeout_ = null; // Fragmented mp4 playback\n\n this.activeInitSegmentId_ = null;\n this.initSegments_ = {}; // HLSe playback\n\n this.cacheEncryptionKeys_ = settings.cacheEncryptionKeys;\n this.keyCache_ = {};\n this.decrypter_ = settings.decrypter; // Manages the tracking and generation of sync-points, mappings\n // between a time in the display time and a segment index within\n // a playlist\n\n this.syncController_ = settings.syncController;\n this.syncPoint_ = {\n segmentIndex: 0,\n time: 0\n };\n this.transmuxer_ = this.createTransmuxer_();\n this.triggerSyncInfoUpdate_ = () => this.trigger('syncinfoupdate');\n this.syncController_.on('syncinfoupdate', this.triggerSyncInfoUpdate_);\n this.mediaSource_.addEventListener('sourceopen', () => {\n if (!this.isEndOfStream_()) {\n this.ended_ = false;\n }\n }); // ...for determining the fetch location\n\n this.fetchAtBuffer_ = false; // For comparing with currentTime when overwriting segments on fastQualityChange_ changes. Use -1 as the inactive flag.\n\n this.replaceSegmentsUntil_ = -1;\n this.logger_ = logger(`SegmentLoader[${this.loaderType_}]`);\n Object.defineProperty(this, 'state', {\n get() {\n return this.state_;\n },\n set(newState) {\n if (newState !== this.state_) {\n this.logger_(`${this.state_} -> ${newState}`);\n this.state_ = newState;\n this.trigger('statechange');\n }\n }\n });\n this.sourceUpdater_.on('ready', () => {\n if (this.hasEnoughInfoToAppend_()) {\n this.processCallQueue_();\n }\n }); // Only the main loader needs to listen for pending timeline changes, as the main\n // loader should wait for audio to be ready to change its timeline so that both main\n // and audio timelines change together. For more details, see the\n // shouldWaitForTimelineChange function.\n\n if (this.loaderType_ === 'main') {\n this.timelineChangeController_.on('pendingtimelinechange', () => {\n if (this.hasEnoughInfoToAppend_()) {\n this.processCallQueue_();\n }\n });\n } // The main loader only listens on pending timeline changes, but the audio loader,\n // since its loads follow main, needs to listen on timeline changes. For more details,\n // see the shouldWaitForTimelineChange function.\n\n if (this.loaderType_ === 'audio') {\n this.timelineChangeController_.on('timelinechange', () => {\n if (this.hasEnoughInfoToLoad_()) {\n this.processLoadQueue_();\n }\n if (this.hasEnoughInfoToAppend_()) {\n this.processCallQueue_();\n }\n });\n }\n }\n createTransmuxer_() {\n return segmentTransmuxer.createTransmuxer({\n remux: false,\n alignGopsAtEnd: this.safeAppend_,\n keepOriginalTimestamps: true,\n parse708captions: this.parse708captions_,\n captionServices: this.captionServices_\n });\n }\n /**\n * reset all of our media stats\n *\n * @private\n */\n\n resetStats_() {\n this.mediaBytesTransferred = 0;\n this.mediaRequests = 0;\n this.mediaRequestsAborted = 0;\n this.mediaRequestsTimedout = 0;\n this.mediaRequestsErrored = 0;\n this.mediaTransferDuration = 0;\n this.mediaSecondsLoaded = 0;\n this.mediaAppends = 0;\n }\n /**\n * dispose of the SegmentLoader and reset to the default state\n */\n\n dispose() {\n this.trigger('dispose');\n this.state = 'DISPOSED';\n this.pause();\n this.abort_();\n if (this.transmuxer_) {\n this.transmuxer_.terminate();\n }\n this.resetStats_();\n if (this.checkBufferTimeout_) {\n window$1.clearTimeout(this.checkBufferTimeout_);\n }\n if (this.syncController_ && this.triggerSyncInfoUpdate_) {\n this.syncController_.off('syncinfoupdate', this.triggerSyncInfoUpdate_);\n }\n this.off();\n }\n setAudio(enable) {\n this.audioDisabled_ = !enable;\n if (enable) {\n this.appendInitSegment_.audio = true;\n } else {\n // remove current track audio if it gets disabled\n this.sourceUpdater_.removeAudio(0, this.duration_());\n }\n }\n /**\n * abort anything that is currently doing on with the SegmentLoader\n * and reset to a default state\n */\n\n abort() {\n if (this.state !== 'WAITING') {\n if (this.pendingSegment_) {\n this.pendingSegment_ = null;\n }\n return;\n }\n this.abort_(); // We aborted the requests we were waiting on, so reset the loader's state to READY\n // since we are no longer \"waiting\" on any requests. XHR callback is not always run\n // when the request is aborted. This will prevent the loader from being stuck in the\n // WAITING state indefinitely.\n\n this.state = 'READY'; // don't wait for buffer check timeouts to begin fetching the\n // next segment\n\n if (!this.paused()) {\n this.monitorBuffer_();\n }\n }\n /**\n * abort all pending xhr requests and null any pending segements\n *\n * @private\n */\n\n abort_() {\n if (this.pendingSegment_ && this.pendingSegment_.abortRequests) {\n this.pendingSegment_.abortRequests();\n } // clear out the segment being processed\n\n this.pendingSegment_ = null;\n this.callQueue_ = [];\n this.loadQueue_ = [];\n this.metadataQueue_.id3 = [];\n this.metadataQueue_.caption = [];\n this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);\n this.waitingOnRemove_ = false;\n window$1.clearTimeout(this.quotaExceededErrorRetryTimeout_);\n this.quotaExceededErrorRetryTimeout_ = null;\n }\n checkForAbort_(requestId) {\n // If the state is APPENDING, then aborts will not modify the state, meaning the first\n // callback that happens should reset the state to READY so that loading can continue.\n if (this.state === 'APPENDING' && !this.pendingSegment_) {\n this.state = 'READY';\n return true;\n }\n if (!this.pendingSegment_ || this.pendingSegment_.requestId !== requestId) {\n return true;\n }\n return false;\n }\n /**\n * set an error on the segment loader and null out any pending segements\n *\n * @param {Error} error the error to set on the SegmentLoader\n * @return {Error} the error that was set or that is currently set\n */\n\n error(error) {\n if (typeof error !== 'undefined') {\n this.logger_('error occurred:', error);\n this.error_ = error;\n }\n this.pendingSegment_ = null;\n return this.error_;\n }\n endOfStream() {\n this.ended_ = true;\n if (this.transmuxer_) {\n // need to clear out any cached data to prepare for the new segment\n segmentTransmuxer.reset(this.transmuxer_);\n }\n this.gopBuffer_.length = 0;\n this.pause();\n this.trigger('ended');\n }\n /**\n * Indicates which time ranges are buffered\n *\n * @return {TimeRange}\n * TimeRange object representing the current buffered ranges\n */\n\n buffered_() {\n const trackInfo = this.getMediaInfo_();\n if (!this.sourceUpdater_ || !trackInfo) {\n return createTimeRanges();\n }\n if (this.loaderType_ === 'main') {\n const {\n hasAudio,\n hasVideo,\n isMuxed\n } = trackInfo;\n if (hasVideo && hasAudio && !this.audioDisabled_ && !isMuxed) {\n return this.sourceUpdater_.buffered();\n }\n if (hasVideo) {\n return this.sourceUpdater_.videoBuffered();\n }\n } // One case that can be ignored for now is audio only with alt audio,\n // as we don't yet have proper support for that.\n\n return this.sourceUpdater_.audioBuffered();\n }\n /**\n * Gets and sets init segment for the provided map\n *\n * @param {Object} map\n * The map object representing the init segment to get or set\n * @param {boolean=} set\n * If true, the init segment for the provided map should be saved\n * @return {Object}\n * map object for desired init segment\n */\n\n initSegmentForMap(map, set = false) {\n if (!map) {\n return null;\n }\n const id = initSegmentId(map);\n let storedMap = this.initSegments_[id];\n if (set && !storedMap && map.bytes) {\n this.initSegments_[id] = storedMap = {\n resolvedUri: map.resolvedUri,\n byterange: map.byterange,\n bytes: map.bytes,\n tracks: map.tracks,\n timescales: map.timescales\n };\n }\n return storedMap || map;\n }\n /**\n * Gets and sets key for the provided key\n *\n * @param {Object} key\n * The key object representing the key to get or set\n * @param {boolean=} set\n * If true, the key for the provided key should be saved\n * @return {Object}\n * Key object for desired key\n */\n\n segmentKey(key, set = false) {\n if (!key) {\n return null;\n }\n const id = segmentKeyId(key);\n let storedKey = this.keyCache_[id]; // TODO: We should use the HTTP Expires header to invalidate our cache per\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-6.2.3\n\n if (this.cacheEncryptionKeys_ && set && !storedKey && key.bytes) {\n this.keyCache_[id] = storedKey = {\n resolvedUri: key.resolvedUri,\n bytes: key.bytes\n };\n }\n const result = {\n resolvedUri: (storedKey || key).resolvedUri\n };\n if (storedKey) {\n result.bytes = storedKey.bytes;\n }\n return result;\n }\n /**\n * Returns true if all configuration required for loading is present, otherwise false.\n *\n * @return {boolean} True if the all configuration is ready for loading\n * @private\n */\n\n couldBeginLoading_() {\n return this.playlist_ && !this.paused();\n }\n /**\n * load a playlist and start to fill the buffer\n */\n\n load() {\n // un-pause\n this.monitorBuffer_(); // if we don't have a playlist yet, keep waiting for one to be\n // specified\n\n if (!this.playlist_) {\n return;\n } // if all the configuration is ready, initialize and begin loading\n\n if (this.state === 'INIT' && this.couldBeginLoading_()) {\n return this.init_();\n } // if we're in the middle of processing a segment already, don't\n // kick off an additional segment request\n\n if (!this.couldBeginLoading_() || this.state !== 'READY' && this.state !== 'INIT') {\n return;\n }\n this.state = 'READY';\n }\n /**\n * Once all the starting parameters have been specified, begin\n * operation. This method should only be invoked from the INIT\n * state.\n *\n * @private\n */\n\n init_() {\n this.state = 'READY'; // if this is the audio segment loader, and it hasn't been inited before, then any old\n // audio data from the muxed content should be removed\n\n this.resetEverything();\n return this.monitorBuffer_();\n }\n /**\n * set a playlist on the segment loader\n *\n * @param {PlaylistLoader} media the playlist to set on the segment loader\n */\n\n playlist(newPlaylist, options = {}) {\n if (!newPlaylist) {\n return;\n }\n const oldPlaylist = this.playlist_;\n const segmentInfo = this.pendingSegment_;\n this.playlist_ = newPlaylist;\n this.xhrOptions_ = options; // when we haven't started playing yet, the start of a live playlist\n // is always our zero-time so force a sync update each time the playlist\n // is refreshed from the server\n //\n // Use the INIT state to determine if playback has started, as the playlist sync info\n // should be fixed once requests begin (as sync points are generated based on sync\n // info), but not before then.\n\n if (this.state === 'INIT') {\n newPlaylist.syncInfo = {\n mediaSequence: newPlaylist.mediaSequence,\n time: 0\n }; // Setting the date time mapping means mapping the program date time (if available)\n // to time 0 on the player's timeline. The playlist's syncInfo serves a similar\n // purpose, mapping the initial mediaSequence to time zero. Since the syncInfo can\n // be updated as the playlist is refreshed before the loader starts loading, the\n // program date time mapping needs to be updated as well.\n //\n // This mapping is only done for the main loader because a program date time should\n // map equivalently between playlists.\n\n if (this.loaderType_ === 'main') {\n this.syncController_.setDateTimeMappingForStart(newPlaylist);\n }\n }\n let oldId = null;\n if (oldPlaylist) {\n if (oldPlaylist.id) {\n oldId = oldPlaylist.id;\n } else if (oldPlaylist.uri) {\n oldId = oldPlaylist.uri;\n }\n }\n this.logger_(`playlist update [${oldId} => ${newPlaylist.id || newPlaylist.uri}]`); // in VOD, this is always a rendition switch (or we updated our syncInfo above)\n // in LIVE, we always want to update with new playlists (including refreshes)\n\n this.trigger('syncinfoupdate'); // if we were unpaused but waiting for a playlist, start\n // buffering now\n\n if (this.state === 'INIT' && this.couldBeginLoading_()) {\n return this.init_();\n }\n if (!oldPlaylist || oldPlaylist.uri !== newPlaylist.uri) {\n if (this.mediaIndex !== null) {\n // we must reset/resync the segment loader when we switch renditions and\n // the segment loader is already synced to the previous rendition\n // We only want to reset the loader here for LLHLS playback, as resetLoader sets fetchAtBuffer_\n // to false, resulting in fetching segments at currentTime and causing repeated\n // same-segment requests on playlist change. This erroneously drives up the playback watcher\n // stalled segment count, as re-requesting segments at the currentTime or browser cached segments\n // will not change the buffer.\n // Reference for LLHLS fixes: https://github.com/videojs/http-streaming/pull/1201\n const isLLHLS = !newPlaylist.endList && typeof newPlaylist.partTargetDuration === 'number';\n if (isLLHLS) {\n this.resetLoader();\n } else {\n this.resyncLoader();\n }\n }\n this.currentMediaInfo_ = void 0;\n this.trigger('playlistupdate'); // the rest of this function depends on `oldPlaylist` being defined\n\n return;\n } // we reloaded the same playlist so we are in a live scenario\n // and we will likely need to adjust the mediaIndex\n\n const mediaSequenceDiff = newPlaylist.mediaSequence - oldPlaylist.mediaSequence;\n this.logger_(`live window shift [${mediaSequenceDiff}]`); // update the mediaIndex on the SegmentLoader\n // this is important because we can abort a request and this value must be\n // equal to the last appended mediaIndex\n\n if (this.mediaIndex !== null) {\n this.mediaIndex -= mediaSequenceDiff; // this can happen if we are going to load the first segment, but get a playlist\n // update during that. mediaIndex would go from 0 to -1 if mediaSequence in the\n // new playlist was incremented by 1.\n\n if (this.mediaIndex < 0) {\n this.mediaIndex = null;\n this.partIndex = null;\n } else {\n const segment = this.playlist_.segments[this.mediaIndex]; // partIndex should remain the same for the same segment\n // unless parts fell off of the playlist for this segment.\n // In that case we need to reset partIndex and resync\n\n if (this.partIndex && (!segment.parts || !segment.parts.length || !segment.parts[this.partIndex])) {\n const mediaIndex = this.mediaIndex;\n this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`);\n this.resetLoader(); // We want to throw away the partIndex and the data associated with it,\n // as the part was dropped from our current playlists segment.\n // The mediaIndex will still be valid so keep that around.\n\n this.mediaIndex = mediaIndex;\n }\n }\n } // update the mediaIndex on the SegmentInfo object\n // this is important because we will update this.mediaIndex with this value\n // in `handleAppendsDone_` after the segment has been successfully appended\n\n if (segmentInfo) {\n segmentInfo.mediaIndex -= mediaSequenceDiff;\n if (segmentInfo.mediaIndex < 0) {\n segmentInfo.mediaIndex = null;\n segmentInfo.partIndex = null;\n } else {\n // we need to update the referenced segment so that timing information is\n // saved for the new playlist's segment, however, if the segment fell off the\n // playlist, we can leave the old reference and just lose the timing info\n if (segmentInfo.mediaIndex >= 0) {\n segmentInfo.segment = newPlaylist.segments[segmentInfo.mediaIndex];\n }\n if (segmentInfo.partIndex >= 0 && segmentInfo.segment.parts) {\n segmentInfo.part = segmentInfo.segment.parts[segmentInfo.partIndex];\n }\n }\n }\n this.syncController_.saveExpiredSegmentInfo(oldPlaylist, newPlaylist);\n }\n /**\n * Prevent the loader from fetching additional segments. If there\n * is a segment request outstanding, it will finish processing\n * before the loader halts. A segment loader can be unpaused by\n * calling load().\n */\n\n pause() {\n if (this.checkBufferTimeout_) {\n window$1.clearTimeout(this.checkBufferTimeout_);\n this.checkBufferTimeout_ = null;\n }\n }\n /**\n * Returns whether the segment loader is fetching additional\n * segments when given the opportunity. This property can be\n * modified through calls to pause() and load().\n */\n\n paused() {\n return this.checkBufferTimeout_ === null;\n }\n /**\n * Resets the segment loader ended and init properties.\n */\n\n resetLoaderProperties() {\n this.ended_ = false;\n this.activeInitSegmentId_ = null;\n this.appendInitSegment_ = {\n audio: true,\n video: true\n };\n }\n /**\n * Delete all the buffered data and reset the SegmentLoader\n *\n * @param {Function} [done] an optional callback to be executed when the remove\n * operation is complete\n */\n\n resetEverything(done) {\n this.resetLoaderProperties();\n this.resetLoader(); // remove from 0, the earliest point, to Infinity, to signify removal of everything.\n // VTT Segment Loader doesn't need to do anything but in the regular SegmentLoader,\n // we then clamp the value to duration if necessary.\n\n this.remove(0, Infinity, done); // clears fmp4 captions\n\n if (this.transmuxer_) {\n this.transmuxer_.postMessage({\n action: 'clearAllMp4Captions'\n }); // reset the cache in the transmuxer\n\n this.transmuxer_.postMessage({\n action: 'reset'\n });\n }\n }\n /**\n * Force the SegmentLoader to resync and start loading around the currentTime instead\n * of starting at the end of the buffer\n *\n * Useful for fast quality changes\n */\n\n resetLoader() {\n this.fetchAtBuffer_ = false;\n this.resyncLoader();\n }\n /**\n * Force the SegmentLoader to restart synchronization and make a conservative guess\n * before returning to the simple walk-forward method\n */\n\n resyncLoader() {\n if (this.transmuxer_) {\n // need to clear out any cached data to prepare for the new segment\n segmentTransmuxer.reset(this.transmuxer_);\n }\n this.mediaIndex = null;\n this.partIndex = null;\n this.syncPoint_ = null;\n this.isPendingTimestampOffset_ = false;\n this.callQueue_ = [];\n this.loadQueue_ = [];\n this.metadataQueue_.id3 = [];\n this.metadataQueue_.caption = [];\n this.abort();\n if (this.transmuxer_) {\n this.transmuxer_.postMessage({\n action: 'clearParsedMp4Captions'\n });\n }\n }\n /**\n * Remove any data in the source buffer between start and end times\n *\n * @param {number} start - the start time of the region to remove from the buffer\n * @param {number} end - the end time of the region to remove from the buffer\n * @param {Function} [done] - an optional callback to be executed when the remove\n * @param {boolean} force - force all remove operations to happen\n * operation is complete\n */\n\n remove(start, end, done = () => {}, force = false) {\n // clamp end to duration if we need to remove everything.\n // This is due to a browser bug that causes issues if we remove to Infinity.\n // videojs/videojs-contrib-hls#1225\n if (end === Infinity) {\n end = this.duration_();\n } // skip removes that would throw an error\n // commonly happens during a rendition switch at the start of a video\n // from start 0 to end 0\n\n if (end <= start) {\n this.logger_('skipping remove because end ${end} is <= start ${start}');\n return;\n }\n if (!this.sourceUpdater_ || !this.getMediaInfo_()) {\n this.logger_('skipping remove because no source updater or starting media info'); // nothing to remove if we haven't processed any media\n\n return;\n } // set it to one to complete this function's removes\n\n let removesRemaining = 1;\n const removeFinished = () => {\n removesRemaining--;\n if (removesRemaining === 0) {\n done();\n }\n };\n if (force || !this.audioDisabled_) {\n removesRemaining++;\n this.sourceUpdater_.removeAudio(start, end, removeFinished);\n } // While it would be better to only remove video if the main loader has video, this\n // should be safe with audio only as removeVideo will call back even if there's no\n // video buffer.\n //\n // In theory we can check to see if there's video before calling the remove, but in\n // the event that we're switching between renditions and from video to audio only\n // (when we add support for that), we may need to clear the video contents despite\n // what the new media will contain.\n\n if (force || this.loaderType_ === 'main') {\n this.gopBuffer_ = removeGopBuffer(this.gopBuffer_, start, end, this.timeMapping_);\n removesRemaining++;\n this.sourceUpdater_.removeVideo(start, end, removeFinished);\n } // remove any captions and ID3 tags\n\n for (const track in this.inbandTextTracks_) {\n removeCuesFromTrack(start, end, this.inbandTextTracks_[track]);\n }\n removeCuesFromTrack(start, end, this.segmentMetadataTrack_); // finished this function's removes\n\n removeFinished();\n }\n /**\n * (re-)schedule monitorBufferTick_ to run as soon as possible\n *\n * @private\n */\n\n monitorBuffer_() {\n if (this.checkBufferTimeout_) {\n window$1.clearTimeout(this.checkBufferTimeout_);\n }\n this.checkBufferTimeout_ = window$1.setTimeout(this.monitorBufferTick_.bind(this), 1);\n }\n /**\n * As long as the SegmentLoader is in the READY state, periodically\n * invoke fillBuffer_().\n *\n * @private\n */\n\n monitorBufferTick_() {\n if (this.state === 'READY') {\n this.fillBuffer_();\n }\n if (this.checkBufferTimeout_) {\n window$1.clearTimeout(this.checkBufferTimeout_);\n }\n this.checkBufferTimeout_ = window$1.setTimeout(this.monitorBufferTick_.bind(this), CHECK_BUFFER_DELAY);\n }\n /**\n * fill the buffer with segements unless the sourceBuffers are\n * currently updating\n *\n * Note: this function should only ever be called by monitorBuffer_\n * and never directly\n *\n * @private\n */\n\n fillBuffer_() {\n // TODO since the source buffer maintains a queue, and we shouldn't call this function\n // except when we're ready for the next segment, this check can most likely be removed\n if (this.sourceUpdater_.updating()) {\n return;\n } // see if we need to begin loading immediately\n\n const segmentInfo = this.chooseNextRequest_();\n if (!segmentInfo) {\n return;\n }\n if (typeof segmentInfo.timestampOffset === 'number') {\n this.isPendingTimestampOffset_ = false;\n this.timelineChangeController_.pendingTimelineChange({\n type: this.loaderType_,\n from: this.currentTimeline_,\n to: segmentInfo.timeline\n });\n }\n this.loadSegment_(segmentInfo);\n }\n /**\n * Determines if we should call endOfStream on the media source based\n * on the state of the buffer or if appened segment was the final\n * segment in the playlist.\n *\n * @param {number} [mediaIndex] the media index of segment we last appended\n * @param {Object} [playlist] a media playlist object\n * @return {boolean} do we need to call endOfStream on the MediaSource\n */\n\n isEndOfStream_(mediaIndex = this.mediaIndex, playlist = this.playlist_, partIndex = this.partIndex) {\n if (!playlist || !this.mediaSource_) {\n return false;\n }\n const segment = typeof mediaIndex === 'number' && playlist.segments[mediaIndex]; // mediaIndex is zero based but length is 1 based\n\n const appendedLastSegment = mediaIndex + 1 === playlist.segments.length; // true if there are no parts, or this is the last part.\n\n const appendedLastPart = !segment || !segment.parts || partIndex + 1 === segment.parts.length; // if we've buffered to the end of the video, we need to call endOfStream\n // so that MediaSources can trigger the `ended` event when it runs out of\n // buffered data instead of waiting for me\n\n return playlist.endList && this.mediaSource_.readyState === 'open' && appendedLastSegment && appendedLastPart;\n }\n /**\n * Determines what request should be made given current segment loader state.\n *\n * @return {Object} a request object that describes the segment/part to load\n */\n\n chooseNextRequest_() {\n const buffered = this.buffered_();\n const bufferedEnd = lastBufferedEnd(buffered) || 0;\n const bufferedTime = timeAheadOf(buffered, this.currentTime_());\n const preloaded = !this.hasPlayed_() && bufferedTime >= 1;\n const haveEnoughBuffer = bufferedTime >= this.goalBufferLength_();\n const segments = this.playlist_.segments; // return no segment if:\n // 1. we don't have segments\n // 2. The video has not yet played and we already downloaded a segment\n // 3. we already have enough buffered time\n\n if (!segments.length || preloaded || haveEnoughBuffer) {\n return null;\n }\n this.syncPoint_ = this.syncPoint_ || this.syncController_.getSyncPoint(this.playlist_, this.duration_(), this.currentTimeline_, this.currentTime_());\n const next = {\n partIndex: null,\n mediaIndex: null,\n startOfSegment: null,\n playlist: this.playlist_,\n isSyncRequest: Boolean(!this.syncPoint_)\n };\n if (next.isSyncRequest) {\n next.mediaIndex = getSyncSegmentCandidate(this.currentTimeline_, segments, bufferedEnd);\n } else if (this.mediaIndex !== null) {\n const segment = segments[this.mediaIndex];\n const partIndex = typeof this.partIndex === 'number' ? this.partIndex : -1;\n next.startOfSegment = segment.end ? segment.end : bufferedEnd;\n if (segment.parts && segment.parts[partIndex + 1]) {\n next.mediaIndex = this.mediaIndex;\n next.partIndex = partIndex + 1;\n } else {\n next.mediaIndex = this.mediaIndex + 1;\n }\n } else {\n // Find the segment containing the end of the buffer or current time.\n const {\n segmentIndex,\n startTime,\n partIndex\n } = Playlist.getMediaInfoForTime({\n exactManifestTimings: this.exactManifestTimings,\n playlist: this.playlist_,\n currentTime: this.fetchAtBuffer_ ? bufferedEnd : this.currentTime_(),\n startingPartIndex: this.syncPoint_.partIndex,\n startingSegmentIndex: this.syncPoint_.segmentIndex,\n startTime: this.syncPoint_.time\n });\n next.getMediaInfoForTime = this.fetchAtBuffer_ ? `bufferedEnd ${bufferedEnd}` : `currentTime ${this.currentTime_()}`;\n next.mediaIndex = segmentIndex;\n next.startOfSegment = startTime;\n next.partIndex = partIndex;\n }\n const nextSegment = segments[next.mediaIndex];\n let nextPart = nextSegment && typeof next.partIndex === 'number' && nextSegment.parts && nextSegment.parts[next.partIndex]; // if the next segment index is invalid or\n // the next partIndex is invalid do not choose a next segment.\n\n if (!nextSegment || typeof next.partIndex === 'number' && !nextPart) {\n return null;\n } // if the next segment has parts, and we don't have a partIndex.\n // Set partIndex to 0\n\n if (typeof next.partIndex !== 'number' && nextSegment.parts) {\n next.partIndex = 0;\n nextPart = nextSegment.parts[0];\n } // independentSegments applies to every segment in a playlist. If independentSegments appears in a main playlist,\n // it applies to each segment in each media playlist.\n // https://datatracker.ietf.org/doc/html/draft-pantos-http-live-streaming-23#section-4.3.5.1\n\n const hasIndependentSegments = this.vhs_.playlists && this.vhs_.playlists.main && this.vhs_.playlists.main.independentSegments || this.playlist_.independentSegments; // if we have no buffered data then we need to make sure\n // that the next part we append is \"independent\" if possible.\n // So we check if the previous part is independent, and request\n // it if it is.\n\n if (!bufferedTime && nextPart && !hasIndependentSegments && !nextPart.independent) {\n if (next.partIndex === 0) {\n const lastSegment = segments[next.mediaIndex - 1];\n const lastSegmentLastPart = lastSegment.parts && lastSegment.parts.length && lastSegment.parts[lastSegment.parts.length - 1];\n if (lastSegmentLastPart && lastSegmentLastPart.independent) {\n next.mediaIndex -= 1;\n next.partIndex = lastSegment.parts.length - 1;\n next.independent = 'previous segment';\n }\n } else if (nextSegment.parts[next.partIndex - 1].independent) {\n next.partIndex -= 1;\n next.independent = 'previous part';\n }\n }\n const ended = this.mediaSource_ && this.mediaSource_.readyState === 'ended'; // do not choose a next segment if all of the following:\n // 1. this is the last segment in the playlist\n // 2. end of stream has been called on the media source already\n // 3. the player is not seeking\n\n if (next.mediaIndex >= segments.length - 1 && ended && !this.seeking_()) {\n return null;\n }\n return this.generateSegmentInfo_(next);\n }\n generateSegmentInfo_(options) {\n const {\n independent,\n playlist,\n mediaIndex,\n startOfSegment,\n isSyncRequest,\n partIndex,\n forceTimestampOffset,\n getMediaInfoForTime\n } = options;\n const segment = playlist.segments[mediaIndex];\n const part = typeof partIndex === 'number' && segment.parts[partIndex];\n const segmentInfo = {\n requestId: 'segment-loader-' + Math.random(),\n // resolve the segment URL relative to the playlist\n uri: part && part.resolvedUri || segment.resolvedUri,\n // the segment's mediaIndex at the time it was requested\n mediaIndex,\n partIndex: part ? partIndex : null,\n // whether or not to update the SegmentLoader's state with this\n // segment's mediaIndex\n isSyncRequest,\n startOfSegment,\n // the segment's playlist\n playlist,\n // unencrypted bytes of the segment\n bytes: null,\n // when a key is defined for this segment, the encrypted bytes\n encryptedBytes: null,\n // The target timestampOffset for this segment when we append it\n // to the source buffer\n timestampOffset: null,\n // The timeline that the segment is in\n timeline: segment.timeline,\n // The expected duration of the segment in seconds\n duration: part && part.duration || segment.duration,\n // retain the segment in case the playlist updates while doing an async process\n segment,\n part,\n byteLength: 0,\n transmuxer: this.transmuxer_,\n // type of getMediaInfoForTime that was used to get this segment\n getMediaInfoForTime,\n independent\n };\n const overrideCheck = typeof forceTimestampOffset !== 'undefined' ? forceTimestampOffset : this.isPendingTimestampOffset_;\n segmentInfo.timestampOffset = this.timestampOffsetForSegment_({\n segmentTimeline: segment.timeline,\n currentTimeline: this.currentTimeline_,\n startOfSegment,\n buffered: this.buffered_(),\n calculateTimestampOffsetForEachSegment: this.calculateTimestampOffsetForEachSegment_,\n overrideCheck\n });\n const audioBufferedEnd = lastBufferedEnd(this.sourceUpdater_.audioBuffered());\n if (typeof audioBufferedEnd === 'number') {\n // since the transmuxer is using the actual timing values, but the buffer is\n // adjusted by the timestamp offset, we must adjust the value here\n segmentInfo.audioAppendStart = audioBufferedEnd - this.sourceUpdater_.audioTimestampOffset();\n }\n if (this.sourceUpdater_.videoBuffered().length) {\n segmentInfo.gopsToAlignWith = gopsSafeToAlignWith(this.gopBuffer_,\n // since the transmuxer is using the actual timing values, but the time is\n // adjusted by the timestmap offset, we must adjust the value here\n this.currentTime_() - this.sourceUpdater_.videoTimestampOffset(), this.timeMapping_);\n }\n return segmentInfo;\n } // get the timestampoffset for a segment,\n // added so that vtt segment loader can override and prevent\n // adding timestamp offsets.\n\n timestampOffsetForSegment_(options) {\n return timestampOffsetForSegment(options);\n }\n /**\n * Determines if the network has enough bandwidth to complete the current segment\n * request in a timely manner. If not, the request will be aborted early and bandwidth\n * updated to trigger a playlist switch.\n *\n * @param {Object} stats\n * Object containing stats about the request timing and size\n * @private\n */\n\n earlyAbortWhenNeeded_(stats) {\n if (this.vhs_.tech_.paused() ||\n // Don't abort if the current playlist is on the lowestEnabledRendition\n // TODO: Replace using timeout with a boolean indicating whether this playlist is\n // the lowestEnabledRendition.\n !this.xhrOptions_.timeout ||\n // Don't abort if we have no bandwidth information to estimate segment sizes\n !this.playlist_.attributes.BANDWIDTH) {\n return;\n } // Wait at least 1 second since the first byte of data has been received before\n // using the calculated bandwidth from the progress event to allow the bitrate\n // to stabilize\n\n if (Date.now() - (stats.firstBytesReceivedAt || Date.now()) < 1000) {\n return;\n }\n const currentTime = this.currentTime_();\n const measuredBandwidth = stats.bandwidth;\n const segmentDuration = this.pendingSegment_.duration;\n const requestTimeRemaining = Playlist.estimateSegmentRequestTime(segmentDuration, measuredBandwidth, this.playlist_, stats.bytesReceived); // Subtract 1 from the timeUntilRebuffer so we still consider an early abort\n // if we are only left with less than 1 second when the request completes.\n // A negative timeUntilRebuffering indicates we are already rebuffering\n\n const timeUntilRebuffer$1 = timeUntilRebuffer(this.buffered_(), currentTime, this.vhs_.tech_.playbackRate()) - 1; // Only consider aborting early if the estimated time to finish the download\n // is larger than the estimated time until the player runs out of forward buffer\n\n if (requestTimeRemaining <= timeUntilRebuffer$1) {\n return;\n }\n const switchCandidate = minRebufferMaxBandwidthSelector({\n main: this.vhs_.playlists.main,\n currentTime,\n bandwidth: measuredBandwidth,\n duration: this.duration_(),\n segmentDuration,\n timeUntilRebuffer: timeUntilRebuffer$1,\n currentTimeline: this.currentTimeline_,\n syncController: this.syncController_\n });\n if (!switchCandidate) {\n return;\n }\n const rebufferingImpact = requestTimeRemaining - timeUntilRebuffer$1;\n const timeSavedBySwitching = rebufferingImpact - switchCandidate.rebufferingImpact;\n let minimumTimeSaving = 0.5; // If we are already rebuffering, increase the amount of variance we add to the\n // potential round trip time of the new request so that we are not too aggressive\n // with switching to a playlist that might save us a fraction of a second.\n\n if (timeUntilRebuffer$1 <= TIME_FUDGE_FACTOR) {\n minimumTimeSaving = 1;\n }\n if (!switchCandidate.playlist || switchCandidate.playlist.uri === this.playlist_.uri || timeSavedBySwitching < minimumTimeSaving) {\n return;\n } // set the bandwidth to that of the desired playlist being sure to scale by\n // BANDWIDTH_VARIANCE and add one so the playlist selector does not exclude it\n // don't trigger a bandwidthupdate as the bandwidth is artifial\n\n this.bandwidth = switchCandidate.playlist.attributes.BANDWIDTH * Config.BANDWIDTH_VARIANCE + 1;\n this.trigger('earlyabort');\n }\n handleAbort_(segmentInfo) {\n this.logger_(`Aborting ${segmentInfoString(segmentInfo)}`);\n this.mediaRequestsAborted += 1;\n }\n /**\n * XHR `progress` event handler\n *\n * @param {Event}\n * The XHR `progress` event\n * @param {Object} simpleSegment\n * A simplified segment object copy\n * @private\n */\n\n handleProgress_(event, simpleSegment) {\n this.earlyAbortWhenNeeded_(simpleSegment.stats);\n if (this.checkForAbort_(simpleSegment.requestId)) {\n return;\n }\n this.trigger('progress');\n }\n handleTrackInfo_(simpleSegment, trackInfo) {\n this.earlyAbortWhenNeeded_(simpleSegment.stats);\n if (this.checkForAbort_(simpleSegment.requestId)) {\n return;\n }\n if (this.checkForIllegalMediaSwitch(trackInfo)) {\n return;\n }\n trackInfo = trackInfo || {}; // When we have track info, determine what media types this loader is dealing with.\n // Guard against cases where we're not getting track info at all until we are\n // certain that all streams will provide it.\n\n if (!shallowEqual(this.currentMediaInfo_, trackInfo)) {\n this.appendInitSegment_ = {\n audio: true,\n video: true\n };\n this.startingMediaInfo_ = trackInfo;\n this.currentMediaInfo_ = trackInfo;\n this.logger_('trackinfo update', trackInfo);\n this.trigger('trackinfo');\n } // trackinfo may cause an abort if the trackinfo\n // causes a codec change to an unsupported codec.\n\n if (this.checkForAbort_(simpleSegment.requestId)) {\n return;\n } // set trackinfo on the pending segment so that\n // it can append.\n\n this.pendingSegment_.trackInfo = trackInfo; // check if any calls were waiting on the track info\n\n if (this.hasEnoughInfoToAppend_()) {\n this.processCallQueue_();\n }\n }\n handleTimingInfo_(simpleSegment, mediaType, timeType, time) {\n this.earlyAbortWhenNeeded_(simpleSegment.stats);\n if (this.checkForAbort_(simpleSegment.requestId)) {\n return;\n }\n const segmentInfo = this.pendingSegment_;\n const timingInfoProperty = timingInfoPropertyForMedia(mediaType);\n segmentInfo[timingInfoProperty] = segmentInfo[timingInfoProperty] || {};\n segmentInfo[timingInfoProperty][timeType] = time;\n this.logger_(`timinginfo: ${mediaType} - ${timeType} - ${time}`); // check if any calls were waiting on the timing info\n\n if (this.hasEnoughInfoToAppend_()) {\n this.processCallQueue_();\n }\n }\n handleCaptions_(simpleSegment, captionData) {\n this.earlyAbortWhenNeeded_(simpleSegment.stats);\n if (this.checkForAbort_(simpleSegment.requestId)) {\n return;\n } // This could only happen with fmp4 segments, but\n // should still not happen in general\n\n if (captionData.length === 0) {\n this.logger_('SegmentLoader received no captions from a caption event');\n return;\n }\n const segmentInfo = this.pendingSegment_; // Wait until we have some video data so that caption timing\n // can be adjusted by the timestamp offset\n\n if (!segmentInfo.hasAppendedData_) {\n this.metadataQueue_.caption.push(this.handleCaptions_.bind(this, simpleSegment, captionData));\n return;\n }\n const timestampOffset = this.sourceUpdater_.videoTimestampOffset() === null ? this.sourceUpdater_.audioTimestampOffset() : this.sourceUpdater_.videoTimestampOffset();\n const captionTracks = {}; // get total start/end and captions for each track/stream\n\n captionData.forEach(caption => {\n // caption.stream is actually a track name...\n // set to the existing values in tracks or default values\n captionTracks[caption.stream] = captionTracks[caption.stream] || {\n // Infinity, as any other value will be less than this\n startTime: Infinity,\n captions: [],\n // 0 as an other value will be more than this\n endTime: 0\n };\n const captionTrack = captionTracks[caption.stream];\n captionTrack.startTime = Math.min(captionTrack.startTime, caption.startTime + timestampOffset);\n captionTrack.endTime = Math.max(captionTrack.endTime, caption.endTime + timestampOffset);\n captionTrack.captions.push(caption);\n });\n Object.keys(captionTracks).forEach(trackName => {\n const {\n startTime,\n endTime,\n captions\n } = captionTracks[trackName];\n const inbandTextTracks = this.inbandTextTracks_;\n this.logger_(`adding cues from ${startTime} -> ${endTime} for ${trackName}`);\n createCaptionsTrackIfNotExists(inbandTextTracks, this.vhs_.tech_, trackName); // clear out any cues that start and end at the same time period for the same track.\n // We do this because a rendition change that also changes the timescale for captions\n // will result in captions being re-parsed for certain segments. If we add them again\n // without clearing we will have two of the same captions visible.\n\n removeCuesFromTrack(startTime, endTime, inbandTextTracks[trackName]);\n addCaptionData({\n captionArray: captions,\n inbandTextTracks,\n timestampOffset\n });\n }); // Reset stored captions since we added parsed\n // captions to a text track at this point\n\n if (this.transmuxer_) {\n this.transmuxer_.postMessage({\n action: 'clearParsedMp4Captions'\n });\n }\n }\n handleId3_(simpleSegment, id3Frames, dispatchType) {\n this.earlyAbortWhenNeeded_(simpleSegment.stats);\n if (this.checkForAbort_(simpleSegment.requestId)) {\n return;\n }\n const segmentInfo = this.pendingSegment_; // we need to have appended data in order for the timestamp offset to be set\n\n if (!segmentInfo.hasAppendedData_) {\n this.metadataQueue_.id3.push(this.handleId3_.bind(this, simpleSegment, id3Frames, dispatchType));\n return;\n }\n this.addMetadataToTextTrack(dispatchType, id3Frames, this.duration_());\n }\n processMetadataQueue_() {\n this.metadataQueue_.id3.forEach(fn => fn());\n this.metadataQueue_.caption.forEach(fn => fn());\n this.metadataQueue_.id3 = [];\n this.metadataQueue_.caption = [];\n }\n processCallQueue_() {\n const callQueue = this.callQueue_; // Clear out the queue before the queued functions are run, since some of the\n // functions may check the length of the load queue and default to pushing themselves\n // back onto the queue.\n\n this.callQueue_ = [];\n callQueue.forEach(fun => fun());\n }\n processLoadQueue_() {\n const loadQueue = this.loadQueue_; // Clear out the queue before the queued functions are run, since some of the\n // functions may check the length of the load queue and default to pushing themselves\n // back onto the queue.\n\n this.loadQueue_ = [];\n loadQueue.forEach(fun => fun());\n }\n /**\n * Determines whether the loader has enough info to load the next segment.\n *\n * @return {boolean}\n * Whether or not the loader has enough info to load the next segment\n */\n\n hasEnoughInfoToLoad_() {\n // Since primary timing goes by video, only the audio loader potentially needs to wait\n // to load.\n if (this.loaderType_ !== 'audio') {\n return true;\n }\n const segmentInfo = this.pendingSegment_; // A fill buffer must have already run to establish a pending segment before there's\n // enough info to load.\n\n if (!segmentInfo) {\n return false;\n } // The first segment can and should be loaded immediately so that source buffers are\n // created together (before appending). Source buffer creation uses the presence of\n // audio and video data to determine whether to create audio/video source buffers, and\n // uses processed (transmuxed or parsed) media to determine the types required.\n\n if (!this.getCurrentMediaInfo_()) {\n return true;\n }\n if (\n // Technically, instead of waiting to load a segment on timeline changes, a segment\n // can be requested and downloaded and only wait before it is transmuxed or parsed.\n // But in practice, there are a few reasons why it is better to wait until a loader\n // is ready to append that segment before requesting and downloading:\n //\n // 1. Because audio and main loaders cross discontinuities together, if this loader\n // is waiting for the other to catch up, then instead of requesting another\n // segment and using up more bandwidth, by not yet loading, more bandwidth is\n // allotted to the loader currently behind.\n // 2. media-segment-request doesn't have to have logic to consider whether a segment\n // is ready to be processed or not, isolating the queueing behavior to the loader.\n // 3. The audio loader bases some of its segment properties on timing information\n // provided by the main loader, meaning that, if the logic for waiting on\n // processing was in media-segment-request, then it would also need to know how\n // to re-generate the segment information after the main loader caught up.\n shouldWaitForTimelineChange({\n timelineChangeController: this.timelineChangeController_,\n currentTimeline: this.currentTimeline_,\n segmentTimeline: segmentInfo.timeline,\n loaderType: this.loaderType_,\n audioDisabled: this.audioDisabled_\n })) {\n return false;\n }\n return true;\n }\n getCurrentMediaInfo_(segmentInfo = this.pendingSegment_) {\n return segmentInfo && segmentInfo.trackInfo || this.currentMediaInfo_;\n }\n getMediaInfo_(segmentInfo = this.pendingSegment_) {\n return this.getCurrentMediaInfo_(segmentInfo) || this.startingMediaInfo_;\n }\n getPendingSegmentPlaylist() {\n return this.pendingSegment_ ? this.pendingSegment_.playlist : null;\n }\n hasEnoughInfoToAppend_() {\n if (!this.sourceUpdater_.ready()) {\n return false;\n } // If content needs to be removed or the loader is waiting on an append reattempt,\n // then no additional content should be appended until the prior append is resolved.\n\n if (this.waitingOnRemove_ || this.quotaExceededErrorRetryTimeout_) {\n return false;\n }\n const segmentInfo = this.pendingSegment_;\n const trackInfo = this.getCurrentMediaInfo_(); // no segment to append any data for or\n // we do not have information on this specific\n // segment yet\n\n if (!segmentInfo || !trackInfo) {\n return false;\n }\n const {\n hasAudio,\n hasVideo,\n isMuxed\n } = trackInfo;\n if (hasVideo && !segmentInfo.videoTimingInfo) {\n return false;\n } // muxed content only relies on video timing information for now.\n\n if (hasAudio && !this.audioDisabled_ && !isMuxed && !segmentInfo.audioTimingInfo) {\n return false;\n }\n if (shouldWaitForTimelineChange({\n timelineChangeController: this.timelineChangeController_,\n currentTimeline: this.currentTimeline_,\n segmentTimeline: segmentInfo.timeline,\n loaderType: this.loaderType_,\n audioDisabled: this.audioDisabled_\n })) {\n return false;\n }\n return true;\n }\n handleData_(simpleSegment, result) {\n this.earlyAbortWhenNeeded_(simpleSegment.stats);\n if (this.checkForAbort_(simpleSegment.requestId)) {\n return;\n } // If there's anything in the call queue, then this data came later and should be\n // executed after the calls currently queued.\n\n if (this.callQueue_.length || !this.hasEnoughInfoToAppend_()) {\n this.callQueue_.push(this.handleData_.bind(this, simpleSegment, result));\n return;\n }\n const segmentInfo = this.pendingSegment_; // update the time mapping so we can translate from display time to media time\n\n this.setTimeMapping_(segmentInfo.timeline); // for tracking overall stats\n\n this.updateMediaSecondsLoaded_(segmentInfo.part || segmentInfo.segment); // Note that the state isn't changed from loading to appending. This is because abort\n // logic may change behavior depending on the state, and changing state too early may\n // inflate our estimates of bandwidth. In the future this should be re-examined to\n // note more granular states.\n // don't process and append data if the mediaSource is closed\n\n if (this.mediaSource_.readyState === 'closed') {\n return;\n } // if this request included an initialization segment, save that data\n // to the initSegment cache\n\n if (simpleSegment.map) {\n simpleSegment.map = this.initSegmentForMap(simpleSegment.map, true); // move over init segment properties to media request\n\n segmentInfo.segment.map = simpleSegment.map;\n } // if this request included a segment key, save that data in the cache\n\n if (simpleSegment.key) {\n this.segmentKey(simpleSegment.key, true);\n }\n segmentInfo.isFmp4 = simpleSegment.isFmp4;\n segmentInfo.timingInfo = segmentInfo.timingInfo || {};\n if (segmentInfo.isFmp4) {\n this.trigger('fmp4');\n segmentInfo.timingInfo.start = segmentInfo[timingInfoPropertyForMedia(result.type)].start;\n } else {\n const trackInfo = this.getCurrentMediaInfo_();\n const useVideoTimingInfo = this.loaderType_ === 'main' && trackInfo && trackInfo.hasVideo;\n let firstVideoFrameTimeForData;\n if (useVideoTimingInfo) {\n firstVideoFrameTimeForData = segmentInfo.videoTimingInfo.start;\n } // Segment loader knows more about segment timing than the transmuxer (in certain\n // aspects), so make any changes required for a more accurate start time.\n // Don't set the end time yet, as the segment may not be finished processing.\n\n segmentInfo.timingInfo.start = this.trueSegmentStart_({\n currentStart: segmentInfo.timingInfo.start,\n playlist: segmentInfo.playlist,\n mediaIndex: segmentInfo.mediaIndex,\n currentVideoTimestampOffset: this.sourceUpdater_.videoTimestampOffset(),\n useVideoTimingInfo,\n firstVideoFrameTimeForData,\n videoTimingInfo: segmentInfo.videoTimingInfo,\n audioTimingInfo: segmentInfo.audioTimingInfo\n });\n } // Init segments for audio and video only need to be appended in certain cases. Now\n // that data is about to be appended, we can check the final cases to determine\n // whether we should append an init segment.\n\n this.updateAppendInitSegmentStatus(segmentInfo, result.type); // Timestamp offset should be updated once we get new data and have its timing info,\n // as we use the start of the segment to offset the best guess (playlist provided)\n // timestamp offset.\n\n this.updateSourceBufferTimestampOffset_(segmentInfo); // if this is a sync request we need to determine whether it should\n // be appended or not.\n\n if (segmentInfo.isSyncRequest) {\n // first save/update our timing info for this segment.\n // this is what allows us to choose an accurate segment\n // and the main reason we make a sync request.\n this.updateTimingInfoEnd_(segmentInfo);\n this.syncController_.saveSegmentTimingInfo({\n segmentInfo,\n shouldSaveTimelineMapping: this.loaderType_ === 'main'\n });\n const next = this.chooseNextRequest_(); // If the sync request isn't the segment that would be requested next\n // after taking into account its timing info, do not append it.\n\n if (next.mediaIndex !== segmentInfo.mediaIndex || next.partIndex !== segmentInfo.partIndex) {\n this.logger_('sync segment was incorrect, not appending');\n return;\n } // otherwise append it like any other segment as our guess was correct.\n\n this.logger_('sync segment was correct, appending');\n } // Save some state so that in the future anything waiting on first append (and/or\n // timestamp offset(s)) can process immediately. While the extra state isn't optimal,\n // we need some notion of whether the timestamp offset or other relevant information\n // has had a chance to be set.\n\n segmentInfo.hasAppendedData_ = true; // Now that the timestamp offset should be set, we can append any waiting ID3 tags.\n\n this.processMetadataQueue_();\n this.appendData_(segmentInfo, result);\n }\n updateAppendInitSegmentStatus(segmentInfo, type) {\n // alt audio doesn't manage timestamp offset\n if (this.loaderType_ === 'main' && typeof segmentInfo.timestampOffset === 'number' &&\n // in the case that we're handling partial data, we don't want to append an init\n // segment for each chunk\n !segmentInfo.changedTimestampOffset) {\n // if the timestamp offset changed, the timeline may have changed, so we have to re-\n // append init segments\n this.appendInitSegment_ = {\n audio: true,\n video: true\n };\n }\n if (this.playlistOfLastInitSegment_[type] !== segmentInfo.playlist) {\n // make sure we append init segment on playlist changes, in case the media config\n // changed\n this.appendInitSegment_[type] = true;\n }\n }\n getInitSegmentAndUpdateState_({\n type,\n initSegment,\n map,\n playlist\n }) {\n // \"The EXT-X-MAP tag specifies how to obtain the Media Initialization Section\n // (Section 3) required to parse the applicable Media Segments. It applies to every\n // Media Segment that appears after it in the Playlist until the next EXT-X-MAP tag\n // or until the end of the playlist.\"\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.2.5\n if (map) {\n const id = initSegmentId(map);\n if (this.activeInitSegmentId_ === id) {\n // don't need to re-append the init segment if the ID matches\n return null;\n } // a map-specified init segment takes priority over any transmuxed (or otherwise\n // obtained) init segment\n //\n // this also caches the init segment for later use\n\n initSegment = this.initSegmentForMap(map, true).bytes;\n this.activeInitSegmentId_ = id;\n } // We used to always prepend init segments for video, however, that shouldn't be\n // necessary. Instead, we should only append on changes, similar to what we've always\n // done for audio. This is more important (though may not be that important) for\n // frame-by-frame appending for LHLS, simply because of the increased quantity of\n // appends.\n\n if (initSegment && this.appendInitSegment_[type]) {\n // Make sure we track the playlist that we last used for the init segment, so that\n // we can re-append the init segment in the event that we get data from a new\n // playlist. Discontinuities and track changes are handled in other sections.\n this.playlistOfLastInitSegment_[type] = playlist; // Disable future init segment appends for this type. Until a change is necessary.\n\n this.appendInitSegment_[type] = false; // we need to clear out the fmp4 active init segment id, since\n // we are appending the muxer init segment\n\n this.activeInitSegmentId_ = null;\n return initSegment;\n }\n return null;\n }\n handleQuotaExceededError_({\n segmentInfo,\n type,\n bytes\n }, error) {\n const audioBuffered = this.sourceUpdater_.audioBuffered();\n const videoBuffered = this.sourceUpdater_.videoBuffered(); // For now we're ignoring any notion of gaps in the buffer, but they, in theory,\n // should be cleared out during the buffer removals. However, log in case it helps\n // debug.\n\n if (audioBuffered.length > 1) {\n this.logger_('On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: ' + timeRangesToArray(audioBuffered).join(', '));\n }\n if (videoBuffered.length > 1) {\n this.logger_('On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: ' + timeRangesToArray(videoBuffered).join(', '));\n }\n const audioBufferStart = audioBuffered.length ? audioBuffered.start(0) : 0;\n const audioBufferEnd = audioBuffered.length ? audioBuffered.end(audioBuffered.length - 1) : 0;\n const videoBufferStart = videoBuffered.length ? videoBuffered.start(0) : 0;\n const videoBufferEnd = videoBuffered.length ? videoBuffered.end(videoBuffered.length - 1) : 0;\n if (audioBufferEnd - audioBufferStart <= MIN_BACK_BUFFER && videoBufferEnd - videoBufferStart <= MIN_BACK_BUFFER) {\n // Can't remove enough buffer to make room for new segment (or the browser doesn't\n // allow for appends of segments this size). In the future, it may be possible to\n // split up the segment and append in pieces, but for now, error out this playlist\n // in an attempt to switch to a more manageable rendition.\n this.logger_('On QUOTA_EXCEEDED_ERR, single segment too large to append to ' + 'buffer, triggering an error. ' + `Appended byte length: ${bytes.byteLength}, ` + `audio buffer: ${timeRangesToArray(audioBuffered).join(', ')}, ` + `video buffer: ${timeRangesToArray(videoBuffered).join(', ')}, `);\n this.error({\n message: 'Quota exceeded error with append of a single segment of content',\n excludeUntil: Infinity\n });\n this.trigger('error');\n return;\n } // To try to resolve the quota exceeded error, clear back buffer and retry. This means\n // that the segment-loader should block on future events until this one is handled, so\n // that it doesn't keep moving onto further segments. Adding the call to the call\n // queue will prevent further appends until waitingOnRemove_ and\n // quotaExceededErrorRetryTimeout_ are cleared.\n //\n // Note that this will only block the current loader. In the case of demuxed content,\n // the other load may keep filling as fast as possible. In practice, this should be\n // OK, as it is a rare case when either audio has a high enough bitrate to fill up a\n // source buffer, or video fills without enough room for audio to append (and without\n // the availability of clearing out seconds of back buffer to make room for audio).\n // But it might still be good to handle this case in the future as a TODO.\n\n this.waitingOnRemove_ = true;\n this.callQueue_.push(this.appendToSourceBuffer_.bind(this, {\n segmentInfo,\n type,\n bytes\n }));\n const currentTime = this.currentTime_(); // Try to remove as much audio and video as possible to make room for new content\n // before retrying.\n\n const timeToRemoveUntil = currentTime - MIN_BACK_BUFFER;\n this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${timeToRemoveUntil}`);\n this.remove(0, timeToRemoveUntil, () => {\n this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${MIN_BACK_BUFFER}s`);\n this.waitingOnRemove_ = false; // wait the length of time alotted in the back buffer to prevent wasted\n // attempts (since we can't clear less than the minimum)\n\n this.quotaExceededErrorRetryTimeout_ = window$1.setTimeout(() => {\n this.logger_('On QUOTA_EXCEEDED_ERR, re-processing call queue');\n this.quotaExceededErrorRetryTimeout_ = null;\n this.processCallQueue_();\n }, MIN_BACK_BUFFER * 1000);\n }, true);\n }\n handleAppendError_({\n segmentInfo,\n type,\n bytes\n }, error) {\n // if there's no error, nothing to do\n if (!error) {\n return;\n }\n if (error.code === QUOTA_EXCEEDED_ERR) {\n this.handleQuotaExceededError_({\n segmentInfo,\n type,\n bytes\n }); // A quota exceeded error should be recoverable with a future re-append, so no need\n // to trigger an append error.\n\n return;\n }\n this.logger_('Received non QUOTA_EXCEEDED_ERR on append', error);\n this.error(`${type} append of ${bytes.length}b failed for segment ` + `#${segmentInfo.mediaIndex} in playlist ${segmentInfo.playlist.id}`); // If an append errors, we often can't recover.\n // (see https://w3c.github.io/media-source/#sourcebuffer-append-error).\n //\n // Trigger a special error so that it can be handled separately from normal,\n // recoverable errors.\n\n this.trigger('appenderror');\n }\n appendToSourceBuffer_({\n segmentInfo,\n type,\n initSegment,\n data,\n bytes\n }) {\n // If this is a re-append, bytes were already created and don't need to be recreated\n if (!bytes) {\n const segments = [data];\n let byteLength = data.byteLength;\n if (initSegment) {\n // if the media initialization segment is changing, append it before the content\n // segment\n segments.unshift(initSegment);\n byteLength += initSegment.byteLength;\n } // Technically we should be OK appending the init segment separately, however, we\n // haven't yet tested that, and prepending is how we have always done things.\n\n bytes = concatSegments({\n bytes: byteLength,\n segments\n });\n }\n this.sourceUpdater_.appendBuffer({\n segmentInfo,\n type,\n bytes\n }, this.handleAppendError_.bind(this, {\n segmentInfo,\n type,\n bytes\n }));\n }\n handleSegmentTimingInfo_(type, requestId, segmentTimingInfo) {\n if (!this.pendingSegment_ || requestId !== this.pendingSegment_.requestId) {\n return;\n }\n const segment = this.pendingSegment_.segment;\n const timingInfoProperty = `${type}TimingInfo`;\n if (!segment[timingInfoProperty]) {\n segment[timingInfoProperty] = {};\n }\n segment[timingInfoProperty].transmuxerPrependedSeconds = segmentTimingInfo.prependedContentDuration || 0;\n segment[timingInfoProperty].transmuxedPresentationStart = segmentTimingInfo.start.presentation;\n segment[timingInfoProperty].transmuxedDecodeStart = segmentTimingInfo.start.decode;\n segment[timingInfoProperty].transmuxedPresentationEnd = segmentTimingInfo.end.presentation;\n segment[timingInfoProperty].transmuxedDecodeEnd = segmentTimingInfo.end.decode; // mainly used as a reference for debugging\n\n segment[timingInfoProperty].baseMediaDecodeTime = segmentTimingInfo.baseMediaDecodeTime;\n }\n appendData_(segmentInfo, result) {\n const {\n type,\n data\n } = result;\n if (!data || !data.byteLength) {\n return;\n }\n if (type === 'audio' && this.audioDisabled_) {\n return;\n }\n const initSegment = this.getInitSegmentAndUpdateState_({\n type,\n initSegment: result.initSegment,\n playlist: segmentInfo.playlist,\n map: segmentInfo.isFmp4 ? segmentInfo.segment.map : null\n });\n this.appendToSourceBuffer_({\n segmentInfo,\n type,\n initSegment,\n data\n });\n }\n /**\n * load a specific segment from a request into the buffer\n *\n * @private\n */\n\n loadSegment_(segmentInfo) {\n this.state = 'WAITING';\n this.pendingSegment_ = segmentInfo;\n this.trimBackBuffer_(segmentInfo);\n if (typeof segmentInfo.timestampOffset === 'number') {\n if (this.transmuxer_) {\n this.transmuxer_.postMessage({\n action: 'clearAllMp4Captions'\n });\n }\n }\n if (!this.hasEnoughInfoToLoad_()) {\n this.loadQueue_.push(() => {\n // regenerate the audioAppendStart, timestampOffset, etc as they\n // may have changed since this function was added to the queue.\n const options = _extends({}, segmentInfo, {\n forceTimestampOffset: true\n });\n _extends(segmentInfo, this.generateSegmentInfo_(options));\n this.isPendingTimestampOffset_ = false;\n this.updateTransmuxerAndRequestSegment_(segmentInfo);\n });\n return;\n }\n this.updateTransmuxerAndRequestSegment_(segmentInfo);\n }\n updateTransmuxerAndRequestSegment_(segmentInfo) {\n // We'll update the source buffer's timestamp offset once we have transmuxed data, but\n // the transmuxer still needs to be updated before then.\n //\n // Even though keepOriginalTimestamps is set to true for the transmuxer, timestamp\n // offset must be passed to the transmuxer for stream correcting adjustments.\n if (this.shouldUpdateTransmuxerTimestampOffset_(segmentInfo.timestampOffset)) {\n this.gopBuffer_.length = 0; // gopsToAlignWith was set before the GOP buffer was cleared\n\n segmentInfo.gopsToAlignWith = [];\n this.timeMapping_ = 0; // reset values in the transmuxer since a discontinuity should start fresh\n\n this.transmuxer_.postMessage({\n action: 'reset'\n });\n this.transmuxer_.postMessage({\n action: 'setTimestampOffset',\n timestampOffset: segmentInfo.timestampOffset\n });\n }\n const simpleSegment = this.createSimplifiedSegmentObj_(segmentInfo);\n const isEndOfStream = this.isEndOfStream_(segmentInfo.mediaIndex, segmentInfo.playlist, segmentInfo.partIndex);\n const isWalkingForward = this.mediaIndex !== null;\n const isDiscontinuity = segmentInfo.timeline !== this.currentTimeline_ &&\n // currentTimeline starts at -1, so we shouldn't end the timeline switching to 0,\n // the first timeline\n segmentInfo.timeline > 0;\n const isEndOfTimeline = isEndOfStream || isWalkingForward && isDiscontinuity;\n this.logger_(`Requesting ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated with this segment, but it is not cached (identified by a lack of bytes),\n // then this init segment has never been seen before and should be appended.\n //\n // At this point the content type (audio/video or both) is not yet known, but it should be safe to set\n // both to true and leave the decision of whether to append the init segment to append time.\n\n if (simpleSegment.map && !simpleSegment.map.bytes) {\n this.logger_('going to request init segment.');\n this.appendInitSegment_ = {\n video: true,\n audio: true\n };\n }\n segmentInfo.abortRequests = mediaSegmentRequest({\n xhr: this.vhs_.xhr,\n xhrOptions: this.xhrOptions_,\n decryptionWorker: this.decrypter_,\n segment: simpleSegment,\n abortFn: this.handleAbort_.bind(this, segmentInfo),\n progressFn: this.handleProgress_.bind(this),\n trackInfoFn: this.handleTrackInfo_.bind(this),\n timingInfoFn: this.handleTimingInfo_.bind(this),\n videoSegmentTimingInfoFn: this.handleSegmentTimingInfo_.bind(this, 'video', segmentInfo.requestId),\n audioSegmentTimingInfoFn: this.handleSegmentTimingInfo_.bind(this, 'audio', segmentInfo.requestId),\n captionsFn: this.handleCaptions_.bind(this),\n isEndOfTimeline,\n endedTimelineFn: () => {\n this.logger_('received endedtimeline callback');\n },\n id3Fn: this.handleId3_.bind(this),\n dataFn: this.handleData_.bind(this),\n doneFn: this.segmentRequestFinished_.bind(this),\n onTransmuxerLog: ({\n message,\n level,\n stream\n }) => {\n this.logger_(`${segmentInfoString(segmentInfo)} logged from transmuxer stream ${stream} as a ${level}: ${message}`);\n }\n });\n }\n /**\n * trim the back buffer so that we don't have too much data\n * in the source buffer\n *\n * @private\n *\n * @param {Object} segmentInfo - the current segment\n */\n\n trimBackBuffer_(segmentInfo) {\n const removeToTime = safeBackBufferTrimTime(this.seekable_(), this.currentTime_(), this.playlist_.targetDuration || 10); // Chrome has a hard limit of 150MB of\n // buffer and a very conservative \"garbage collector\"\n // We manually clear out the old buffer to ensure\n // we don't trigger the QuotaExceeded error\n // on the source buffer during subsequent appends\n\n if (removeToTime > 0) {\n this.remove(0, removeToTime);\n }\n }\n /**\n * created a simplified copy of the segment object with just the\n * information necessary to perform the XHR and decryption\n *\n * @private\n *\n * @param {Object} segmentInfo - the current segment\n * @return {Object} a simplified segment object copy\n */\n\n createSimplifiedSegmentObj_(segmentInfo) {\n const segment = segmentInfo.segment;\n const part = segmentInfo.part;\n const simpleSegment = {\n resolvedUri: part ? part.resolvedUri : segment.resolvedUri,\n byterange: part ? part.byterange : segment.byterange,\n requestId: segmentInfo.requestId,\n transmuxer: segmentInfo.transmuxer,\n audioAppendStart: segmentInfo.audioAppendStart,\n gopsToAlignWith: segmentInfo.gopsToAlignWith,\n part: segmentInfo.part\n };\n const previousSegment = segmentInfo.playlist.segments[segmentInfo.mediaIndex - 1];\n if (previousSegment && previousSegment.timeline === segment.timeline) {\n // The baseStartTime of a segment is used to handle rollover when probing the TS\n // segment to retrieve timing information. Since the probe only looks at the media's\n // times (e.g., PTS and DTS values of the segment), and doesn't consider the\n // player's time (e.g., player.currentTime()), baseStartTime should reflect the\n // media time as well. transmuxedDecodeEnd represents the end time of a segment, in\n // seconds of media time, so should be used here. The previous segment is used since\n // the end of the previous segment should represent the beginning of the current\n // segment, so long as they are on the same timeline.\n if (previousSegment.videoTimingInfo) {\n simpleSegment.baseStartTime = previousSegment.videoTimingInfo.transmuxedDecodeEnd;\n } else if (previousSegment.audioTimingInfo) {\n simpleSegment.baseStartTime = previousSegment.audioTimingInfo.transmuxedDecodeEnd;\n }\n }\n if (segment.key) {\n // if the media sequence is greater than 2^32, the IV will be incorrect\n // assuming 10s segments, that would be about 1300 years\n const iv = segment.key.iv || new Uint32Array([0, 0, 0, segmentInfo.mediaIndex + segmentInfo.playlist.mediaSequence]);\n simpleSegment.key = this.segmentKey(segment.key);\n simpleSegment.key.iv = iv;\n }\n if (segment.map) {\n simpleSegment.map = this.initSegmentForMap(segment.map);\n }\n return simpleSegment;\n }\n saveTransferStats_(stats) {\n // every request counts as a media request even if it has been aborted\n // or canceled due to a timeout\n this.mediaRequests += 1;\n if (stats) {\n this.mediaBytesTransferred += stats.bytesReceived;\n this.mediaTransferDuration += stats.roundTripTime;\n }\n }\n saveBandwidthRelatedStats_(duration, stats) {\n // byteLength will be used for throughput, and should be based on bytes receieved,\n // which we only know at the end of the request and should reflect total bytes\n // downloaded rather than just bytes processed from components of the segment\n this.pendingSegment_.byteLength = stats.bytesReceived;\n if (duration < MIN_SEGMENT_DURATION_TO_SAVE_STATS) {\n this.logger_(`Ignoring segment's bandwidth because its duration of ${duration}` + ` is less than the min to record ${MIN_SEGMENT_DURATION_TO_SAVE_STATS}`);\n return;\n }\n this.bandwidth = stats.bandwidth;\n this.roundTrip = stats.roundTripTime;\n }\n handleTimeout_() {\n // although the VTT segment loader bandwidth isn't really used, it's good to\n // maintain functinality between segment loaders\n this.mediaRequestsTimedout += 1;\n this.bandwidth = 1;\n this.roundTrip = NaN;\n this.trigger('bandwidthupdate');\n this.trigger('timeout');\n }\n /**\n * Handle the callback from the segmentRequest function and set the\n * associated SegmentLoader state and errors if necessary\n *\n * @private\n */\n\n segmentRequestFinished_(error, simpleSegment, result) {\n // TODO handle special cases, e.g., muxed audio/video but only audio in the segment\n // check the call queue directly since this function doesn't need to deal with any\n // data, and can continue even if the source buffers are not set up and we didn't get\n // any data from the segment\n if (this.callQueue_.length) {\n this.callQueue_.push(this.segmentRequestFinished_.bind(this, error, simpleSegment, result));\n return;\n }\n this.saveTransferStats_(simpleSegment.stats); // The request was aborted and the SegmentLoader has already been reset\n\n if (!this.pendingSegment_) {\n return;\n } // the request was aborted and the SegmentLoader has already started\n // another request. this can happen when the timeout for an aborted\n // request triggers due to a limitation in the XHR library\n // do not count this as any sort of request or we risk double-counting\n\n if (simpleSegment.requestId !== this.pendingSegment_.requestId) {\n return;\n } // an error occurred from the active pendingSegment_ so reset everything\n\n if (error) {\n this.pendingSegment_ = null;\n this.state = 'READY'; // aborts are not a true error condition and nothing corrective needs to be done\n\n if (error.code === REQUEST_ERRORS.ABORTED) {\n return;\n }\n this.pause(); // the error is really just that at least one of the requests timed-out\n // set the bandwidth to a very low value and trigger an ABR switch to\n // take emergency action\n\n if (error.code === REQUEST_ERRORS.TIMEOUT) {\n this.handleTimeout_();\n return;\n } // if control-flow has arrived here, then the error is real\n // emit an error event to exclude the current playlist\n\n this.mediaRequestsErrored += 1;\n this.error(error);\n this.trigger('error');\n return;\n }\n const segmentInfo = this.pendingSegment_; // the response was a success so set any bandwidth stats the request\n // generated for ABR purposes\n\n this.saveBandwidthRelatedStats_(segmentInfo.duration, simpleSegment.stats);\n segmentInfo.endOfAllRequests = simpleSegment.endOfAllRequests;\n if (result.gopInfo) {\n this.gopBuffer_ = updateGopBuffer(this.gopBuffer_, result.gopInfo, this.safeAppend_);\n } // Although we may have already started appending on progress, we shouldn't switch the\n // state away from loading until we are officially done loading the segment data.\n\n this.state = 'APPENDING'; // used for testing\n\n this.trigger('appending');\n this.waitForAppendsToComplete_(segmentInfo);\n }\n setTimeMapping_(timeline) {\n const timelineMapping = this.syncController_.mappingForTimeline(timeline);\n if (timelineMapping !== null) {\n this.timeMapping_ = timelineMapping;\n }\n }\n updateMediaSecondsLoaded_(segment) {\n if (typeof segment.start === 'number' && typeof segment.end === 'number') {\n this.mediaSecondsLoaded += segment.end - segment.start;\n } else {\n this.mediaSecondsLoaded += segment.duration;\n }\n }\n shouldUpdateTransmuxerTimestampOffset_(timestampOffset) {\n if (timestampOffset === null) {\n return false;\n } // note that we're potentially using the same timestamp offset for both video and\n // audio\n\n if (this.loaderType_ === 'main' && timestampOffset !== this.sourceUpdater_.videoTimestampOffset()) {\n return true;\n }\n if (!this.audioDisabled_ && timestampOffset !== this.sourceUpdater_.audioTimestampOffset()) {\n return true;\n }\n return false;\n }\n trueSegmentStart_({\n currentStart,\n playlist,\n mediaIndex,\n firstVideoFrameTimeForData,\n currentVideoTimestampOffset,\n useVideoTimingInfo,\n videoTimingInfo,\n audioTimingInfo\n }) {\n if (typeof currentStart !== 'undefined') {\n // if start was set once, keep using it\n return currentStart;\n }\n if (!useVideoTimingInfo) {\n return audioTimingInfo.start;\n }\n const previousSegment = playlist.segments[mediaIndex - 1]; // The start of a segment should be the start of the first full frame contained\n // within that segment. Since the transmuxer maintains a cache of incomplete data\n // from and/or the last frame seen, the start time may reflect a frame that starts\n // in the previous segment. Check for that case and ensure the start time is\n // accurate for the segment.\n\n if (mediaIndex === 0 || !previousSegment || typeof previousSegment.start === 'undefined' || previousSegment.end !== firstVideoFrameTimeForData + currentVideoTimestampOffset) {\n return firstVideoFrameTimeForData;\n }\n return videoTimingInfo.start;\n }\n waitForAppendsToComplete_(segmentInfo) {\n const trackInfo = this.getCurrentMediaInfo_(segmentInfo);\n if (!trackInfo) {\n this.error({\n message: 'No starting media returned, likely due to an unsupported media format.',\n playlistExclusionDuration: Infinity\n });\n this.trigger('error');\n return;\n } // Although transmuxing is done, appends may not yet be finished. Throw a marker\n // on each queue this loader is responsible for to ensure that the appends are\n // complete.\n\n const {\n hasAudio,\n hasVideo,\n isMuxed\n } = trackInfo;\n const waitForVideo = this.loaderType_ === 'main' && hasVideo;\n const waitForAudio = !this.audioDisabled_ && hasAudio && !isMuxed;\n segmentInfo.waitingOnAppends = 0; // segments with no data\n\n if (!segmentInfo.hasAppendedData_) {\n if (!segmentInfo.timingInfo && typeof segmentInfo.timestampOffset === 'number') {\n // When there's no audio or video data in the segment, there's no audio or video\n // timing information.\n //\n // If there's no audio or video timing information, then the timestamp offset\n // can't be adjusted to the appropriate value for the transmuxer and source\n // buffers.\n //\n // Therefore, the next segment should be used to set the timestamp offset.\n this.isPendingTimestampOffset_ = true;\n } // override settings for metadata only segments\n\n segmentInfo.timingInfo = {\n start: 0\n };\n segmentInfo.waitingOnAppends++;\n if (!this.isPendingTimestampOffset_) {\n // update the timestampoffset\n this.updateSourceBufferTimestampOffset_(segmentInfo); // make sure the metadata queue is processed even though we have\n // no video/audio data.\n\n this.processMetadataQueue_();\n } // append is \"done\" instantly with no data.\n\n this.checkAppendsDone_(segmentInfo);\n return;\n } // Since source updater could call back synchronously, do the increments first.\n\n if (waitForVideo) {\n segmentInfo.waitingOnAppends++;\n }\n if (waitForAudio) {\n segmentInfo.waitingOnAppends++;\n }\n if (waitForVideo) {\n this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this, segmentInfo));\n }\n if (waitForAudio) {\n this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this, segmentInfo));\n }\n }\n checkAppendsDone_(segmentInfo) {\n if (this.checkForAbort_(segmentInfo.requestId)) {\n return;\n }\n segmentInfo.waitingOnAppends--;\n if (segmentInfo.waitingOnAppends === 0) {\n this.handleAppendsDone_();\n }\n }\n checkForIllegalMediaSwitch(trackInfo) {\n const illegalMediaSwitchError = illegalMediaSwitch(this.loaderType_, this.getCurrentMediaInfo_(), trackInfo);\n if (illegalMediaSwitchError) {\n this.error({\n message: illegalMediaSwitchError,\n playlistExclusionDuration: Infinity\n });\n this.trigger('error');\n return true;\n }\n return false;\n }\n updateSourceBufferTimestampOffset_(segmentInfo) {\n if (segmentInfo.timestampOffset === null ||\n // we don't yet have the start for whatever media type (video or audio) has\n // priority, timing-wise, so we must wait\n typeof segmentInfo.timingInfo.start !== 'number' ||\n // already updated the timestamp offset for this segment\n segmentInfo.changedTimestampOffset ||\n // the alt audio loader should not be responsible for setting the timestamp offset\n this.loaderType_ !== 'main') {\n return;\n }\n let didChange = false; // Primary timing goes by video, and audio is trimmed in the transmuxer, meaning that\n // the timing info here comes from video. In the event that the audio is longer than\n // the video, this will trim the start of the audio.\n // This also trims any offset from 0 at the beginning of the media\n\n segmentInfo.timestampOffset -= this.getSegmentStartTimeForTimestampOffsetCalculation_({\n videoTimingInfo: segmentInfo.segment.videoTimingInfo,\n audioTimingInfo: segmentInfo.segment.audioTimingInfo,\n timingInfo: segmentInfo.timingInfo\n }); // In the event that there are part segment downloads, each will try to update the\n // timestamp offset. Retaining this bit of state prevents us from updating in the\n // future (within the same segment), however, there may be a better way to handle it.\n\n segmentInfo.changedTimestampOffset = true;\n if (segmentInfo.timestampOffset !== this.sourceUpdater_.videoTimestampOffset()) {\n this.sourceUpdater_.videoTimestampOffset(segmentInfo.timestampOffset);\n didChange = true;\n }\n if (segmentInfo.timestampOffset !== this.sourceUpdater_.audioTimestampOffset()) {\n this.sourceUpdater_.audioTimestampOffset(segmentInfo.timestampOffset);\n didChange = true;\n }\n if (didChange) {\n this.trigger('timestampoffset');\n }\n }\n getSegmentStartTimeForTimestampOffsetCalculation_({\n videoTimingInfo,\n audioTimingInfo,\n timingInfo\n }) {\n if (!this.useDtsForTimestampOffset_) {\n return timingInfo.start;\n }\n if (videoTimingInfo && typeof videoTimingInfo.transmuxedDecodeStart === 'number') {\n return videoTimingInfo.transmuxedDecodeStart;\n } // handle audio only\n\n if (audioTimingInfo && typeof audioTimingInfo.transmuxedDecodeStart === 'number') {\n return audioTimingInfo.transmuxedDecodeStart;\n } // handle content not transmuxed (e.g., MP4)\n\n return timingInfo.start;\n }\n updateTimingInfoEnd_(segmentInfo) {\n segmentInfo.timingInfo = segmentInfo.timingInfo || {};\n const trackInfo = this.getMediaInfo_();\n const useVideoTimingInfo = this.loaderType_ === 'main' && trackInfo && trackInfo.hasVideo;\n const prioritizedTimingInfo = useVideoTimingInfo && segmentInfo.videoTimingInfo ? segmentInfo.videoTimingInfo : segmentInfo.audioTimingInfo;\n if (!prioritizedTimingInfo) {\n return;\n }\n segmentInfo.timingInfo.end = typeof prioritizedTimingInfo.end === 'number' ?\n // End time may not exist in a case where we aren't parsing the full segment (one\n // current example is the case of fmp4), so use the rough duration to calculate an\n // end time.\n prioritizedTimingInfo.end : prioritizedTimingInfo.start + segmentInfo.duration;\n }\n /**\n * callback to run when appendBuffer is finished. detects if we are\n * in a good state to do things with the data we got, or if we need\n * to wait for more\n *\n * @private\n */\n\n handleAppendsDone_() {\n // appendsdone can cause an abort\n if (this.pendingSegment_) {\n this.trigger('appendsdone');\n }\n if (!this.pendingSegment_) {\n this.state = 'READY'; // TODO should this move into this.checkForAbort to speed up requests post abort in\n // all appending cases?\n\n if (!this.paused()) {\n this.monitorBuffer_();\n }\n return;\n }\n const segmentInfo = this.pendingSegment_; // Now that the end of the segment has been reached, we can set the end time. It's\n // best to wait until all appends are done so we're sure that the primary media is\n // finished (and we have its end time).\n\n this.updateTimingInfoEnd_(segmentInfo);\n if (this.shouldSaveSegmentTimingInfo_) {\n // Timeline mappings should only be saved for the main loader. This is for multiple\n // reasons:\n //\n // 1) Only one mapping is saved per timeline, meaning that if both the audio loader\n // and the main loader try to save the timeline mapping, whichever comes later\n // will overwrite the first. In theory this is OK, as the mappings should be the\n // same, however, it breaks for (2)\n // 2) In the event of a live stream, the initial live point will make for a somewhat\n // arbitrary mapping. If audio and video streams are not perfectly in-sync, then\n // the mapping will be off for one of the streams, dependent on which one was\n // first saved (see (1)).\n // 3) Primary timing goes by video in VHS, so the mapping should be video.\n //\n // Since the audio loader will wait for the main loader to load the first segment,\n // the main loader will save the first timeline mapping, and ensure that there won't\n // be a case where audio loads two segments without saving a mapping (thus leading\n // to missing segment timing info).\n this.syncController_.saveSegmentTimingInfo({\n segmentInfo,\n shouldSaveTimelineMapping: this.loaderType_ === 'main'\n });\n }\n const segmentDurationMessage = getTroublesomeSegmentDurationMessage(segmentInfo, this.sourceType_);\n if (segmentDurationMessage) {\n if (segmentDurationMessage.severity === 'warn') {\n videojs.log.warn(segmentDurationMessage.message);\n } else {\n this.logger_(segmentDurationMessage.message);\n }\n }\n this.recordThroughput_(segmentInfo);\n this.pendingSegment_ = null;\n this.state = 'READY';\n if (segmentInfo.isSyncRequest) {\n this.trigger('syncinfoupdate'); // if the sync request was not appended\n // then it was not the correct segment.\n // throw it away and use the data it gave us\n // to get the correct one.\n\n if (!segmentInfo.hasAppendedData_) {\n this.logger_(`Throwing away un-appended sync request ${segmentInfoString(segmentInfo)}`);\n return;\n }\n }\n this.logger_(`Appended ${segmentInfoString(segmentInfo)}`);\n this.addSegmentMetadataCue_(segmentInfo);\n if (this.currentTime_() >= this.replaceSegmentsUntil_) {\n this.replaceSegmentsUntil_ = -1;\n this.fetchAtBuffer_ = true;\n }\n if (this.currentTimeline_ !== segmentInfo.timeline) {\n this.timelineChangeController_.lastTimelineChange({\n type: this.loaderType_,\n from: this.currentTimeline_,\n to: segmentInfo.timeline\n }); // If audio is not disabled, the main segment loader is responsible for updating\n // the audio timeline as well. If the content is video only, this won't have any\n // impact.\n\n if (this.loaderType_ === 'main' && !this.audioDisabled_) {\n this.timelineChangeController_.lastTimelineChange({\n type: 'audio',\n from: this.currentTimeline_,\n to: segmentInfo.timeline\n });\n }\n }\n this.currentTimeline_ = segmentInfo.timeline; // We must update the syncinfo to recalculate the seekable range before\n // the following conditional otherwise it may consider this a bad \"guess\"\n // and attempt to resync when the post-update seekable window and live\n // point would mean that this was the perfect segment to fetch\n\n this.trigger('syncinfoupdate');\n const segment = segmentInfo.segment;\n const part = segmentInfo.part;\n const badSegmentGuess = segment.end && this.currentTime_() - segment.end > segmentInfo.playlist.targetDuration * 3;\n const badPartGuess = part && part.end && this.currentTime_() - part.end > segmentInfo.playlist.partTargetDuration * 3; // If we previously appended a segment/part that ends more than 3 part/targetDurations before\n // the currentTime_ that means that our conservative guess was too conservative.\n // In that case, reset the loader state so that we try to use any information gained\n // from the previous request to create a new, more accurate, sync-point.\n\n if (badSegmentGuess || badPartGuess) {\n this.logger_(`bad ${badSegmentGuess ? 'segment' : 'part'} ${segmentInfoString(segmentInfo)}`);\n this.resetEverything();\n return;\n }\n const isWalkingForward = this.mediaIndex !== null; // Don't do a rendition switch unless we have enough time to get a sync segment\n // and conservatively guess\n\n if (isWalkingForward) {\n this.trigger('bandwidthupdate');\n }\n this.trigger('progress');\n this.mediaIndex = segmentInfo.mediaIndex;\n this.partIndex = segmentInfo.partIndex; // any time an update finishes and the last segment is in the\n // buffer, end the stream. this ensures the \"ended\" event will\n // fire if playback reaches that point.\n\n if (this.isEndOfStream_(segmentInfo.mediaIndex, segmentInfo.playlist, segmentInfo.partIndex)) {\n this.endOfStream();\n } // used for testing\n\n this.trigger('appended');\n if (segmentInfo.hasAppendedData_) {\n this.mediaAppends++;\n }\n if (!this.paused()) {\n this.monitorBuffer_();\n }\n }\n /**\n * Records the current throughput of the decrypt, transmux, and append\n * portion of the semgment pipeline. `throughput.rate` is a the cumulative\n * moving average of the throughput. `throughput.count` is the number of\n * data points in the average.\n *\n * @private\n * @param {Object} segmentInfo the object returned by loadSegment\n */\n\n recordThroughput_(segmentInfo) {\n if (segmentInfo.duration < MIN_SEGMENT_DURATION_TO_SAVE_STATS) {\n this.logger_(`Ignoring segment's throughput because its duration of ${segmentInfo.duration}` + ` is less than the min to record ${MIN_SEGMENT_DURATION_TO_SAVE_STATS}`);\n return;\n }\n const rate = this.throughput.rate; // Add one to the time to ensure that we don't accidentally attempt to divide\n // by zero in the case where the throughput is ridiculously high\n\n const segmentProcessingTime = Date.now() - segmentInfo.endOfAllRequests + 1; // Multiply by 8000 to convert from bytes/millisecond to bits/second\n\n const segmentProcessingThroughput = Math.floor(segmentInfo.byteLength / segmentProcessingTime * 8 * 1000); // This is just a cumulative moving average calculation:\n // newAvg = oldAvg + (sample - oldAvg) / (sampleCount + 1)\n\n this.throughput.rate += (segmentProcessingThroughput - rate) / ++this.throughput.count;\n }\n /**\n * Adds a cue to the segment-metadata track with some metadata information about the\n * segment\n *\n * @private\n * @param {Object} segmentInfo\n * the object returned by loadSegment\n * @method addSegmentMetadataCue_\n */\n\n addSegmentMetadataCue_(segmentInfo) {\n if (!this.segmentMetadataTrack_) {\n return;\n }\n const segment = segmentInfo.segment;\n const start = segment.start;\n const end = segment.end; // Do not try adding the cue if the start and end times are invalid.\n\n if (!finite(start) || !finite(end)) {\n return;\n }\n removeCuesFromTrack(start, end, this.segmentMetadataTrack_);\n const Cue = window$1.WebKitDataCue || window$1.VTTCue;\n const value = {\n custom: segment.custom,\n dateTimeObject: segment.dateTimeObject,\n dateTimeString: segment.dateTimeString,\n programDateTime: segment.programDateTime,\n bandwidth: segmentInfo.playlist.attributes.BANDWIDTH,\n resolution: segmentInfo.playlist.attributes.RESOLUTION,\n codecs: segmentInfo.playlist.attributes.CODECS,\n byteLength: segmentInfo.byteLength,\n uri: segmentInfo.uri,\n timeline: segmentInfo.timeline,\n playlist: segmentInfo.playlist.id,\n start,\n end\n };\n const data = JSON.stringify(value);\n const cue = new Cue(start, end, data); // Attach the metadata to the value property of the cue to keep consistency between\n // the differences of WebKitDataCue in safari and VTTCue in other browsers\n\n cue.value = value;\n this.segmentMetadataTrack_.addCue(cue);\n }\n /**\n * Public setter for defining the private replaceSegmentsUntil_ property, which\n * determines when we can return fetchAtBuffer to true if overwriting the buffer.\n *\n * @param {number} bufferedEnd the end of the buffered range to replace segments\n * until currentTime reaches this time.\n */\n\n set replaceSegmentsUntil(bufferedEnd) {\n this.logger_(`Replacing currently buffered segments until ${bufferedEnd}`);\n this.replaceSegmentsUntil_ = bufferedEnd;\n }\n}\nfunction noop() {}\nconst toTitleCase = function (string) {\n if (typeof string !== 'string') {\n return string;\n }\n return string.replace(/./, w => w.toUpperCase());\n};\n\n/**\n * @file source-updater.js\n */\nconst bufferTypes = ['video', 'audio'];\nconst updating = (type, sourceUpdater) => {\n const sourceBuffer = sourceUpdater[`${type}Buffer`];\n return sourceBuffer && sourceBuffer.updating || sourceUpdater.queuePending[type];\n};\nconst nextQueueIndexOfType = (type, queue) => {\n for (let i = 0; i < queue.length; i++) {\n const queueEntry = queue[i];\n if (queueEntry.type === 'mediaSource') {\n // If the next entry is a media source entry (uses multiple source buffers), block\n // processing to allow it to go through first.\n return null;\n }\n if (queueEntry.type === type) {\n return i;\n }\n }\n return null;\n};\nconst shiftQueue = (type, sourceUpdater) => {\n if (sourceUpdater.queue.length === 0) {\n return;\n }\n let queueIndex = 0;\n let queueEntry = sourceUpdater.queue[queueIndex];\n if (queueEntry.type === 'mediaSource') {\n if (!sourceUpdater.updating() && sourceUpdater.mediaSource.readyState !== 'closed') {\n sourceUpdater.queue.shift();\n queueEntry.action(sourceUpdater);\n if (queueEntry.doneFn) {\n queueEntry.doneFn();\n } // Only specific source buffer actions must wait for async updateend events. Media\n // Source actions process synchronously. Therefore, both audio and video source\n // buffers are now clear to process the next queue entries.\n\n shiftQueue('audio', sourceUpdater);\n shiftQueue('video', sourceUpdater);\n } // Media Source actions require both source buffers, so if the media source action\n // couldn't process yet (because one or both source buffers are busy), block other\n // queue actions until both are available and the media source action can process.\n\n return;\n }\n if (type === 'mediaSource') {\n // If the queue was shifted by a media source action (this happens when pushing a\n // media source action onto the queue), then it wasn't from an updateend event from an\n // audio or video source buffer, so there's no change from previous state, and no\n // processing should be done.\n return;\n } // Media source queue entries don't need to consider whether the source updater is\n // started (i.e., source buffers are created) as they don't need the source buffers, but\n // source buffer queue entries do.\n\n if (!sourceUpdater.ready() || sourceUpdater.mediaSource.readyState === 'closed' || updating(type, sourceUpdater)) {\n return;\n }\n if (queueEntry.type !== type) {\n queueIndex = nextQueueIndexOfType(type, sourceUpdater.queue);\n if (queueIndex === null) {\n // Either there's no queue entry that uses this source buffer type in the queue, or\n // there's a media source queue entry before the next entry of this type, in which\n // case wait for that action to process first.\n return;\n }\n queueEntry = sourceUpdater.queue[queueIndex];\n }\n sourceUpdater.queue.splice(queueIndex, 1); // Keep a record that this source buffer type is in use.\n //\n // The queue pending operation must be set before the action is performed in the event\n // that the action results in a synchronous event that is acted upon. For instance, if\n // an exception is thrown that can be handled, it's possible that new actions will be\n // appended to an empty queue and immediately executed, but would not have the correct\n // pending information if this property was set after the action was performed.\n\n sourceUpdater.queuePending[type] = queueEntry;\n queueEntry.action(type, sourceUpdater);\n if (!queueEntry.doneFn) {\n // synchronous operation, process next entry\n sourceUpdater.queuePending[type] = null;\n shiftQueue(type, sourceUpdater);\n return;\n }\n};\nconst cleanupBuffer = (type, sourceUpdater) => {\n const buffer = sourceUpdater[`${type}Buffer`];\n const titleType = toTitleCase(type);\n if (!buffer) {\n return;\n }\n buffer.removeEventListener('updateend', sourceUpdater[`on${titleType}UpdateEnd_`]);\n buffer.removeEventListener('error', sourceUpdater[`on${titleType}Error_`]);\n sourceUpdater.codecs[type] = null;\n sourceUpdater[`${type}Buffer`] = null;\n};\nconst inSourceBuffers = (mediaSource, sourceBuffer) => mediaSource && sourceBuffer && Array.prototype.indexOf.call(mediaSource.sourceBuffers, sourceBuffer) !== -1;\nconst actions = {\n appendBuffer: (bytes, segmentInfo, onError) => (type, sourceUpdater) => {\n const sourceBuffer = sourceUpdater[`${type}Buffer`]; // can't do anything if the media source / source buffer is null\n // or the media source does not contain this source buffer.\n\n if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {\n return;\n }\n sourceUpdater.logger_(`Appending segment ${segmentInfo.mediaIndex}'s ${bytes.length} bytes to ${type}Buffer`);\n try {\n sourceBuffer.appendBuffer(bytes);\n } catch (e) {\n sourceUpdater.logger_(`Error with code ${e.code} ` + (e.code === QUOTA_EXCEEDED_ERR ? '(QUOTA_EXCEEDED_ERR) ' : '') + `when appending segment ${segmentInfo.mediaIndex} to ${type}Buffer`);\n sourceUpdater.queuePending[type] = null;\n onError(e);\n }\n },\n remove: (start, end) => (type, sourceUpdater) => {\n const sourceBuffer = sourceUpdater[`${type}Buffer`]; // can't do anything if the media source / source buffer is null\n // or the media source does not contain this source buffer.\n\n if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {\n return;\n }\n sourceUpdater.logger_(`Removing ${start} to ${end} from ${type}Buffer`);\n try {\n sourceBuffer.remove(start, end);\n } catch (e) {\n sourceUpdater.logger_(`Remove ${start} to ${end} from ${type}Buffer failed`);\n }\n },\n timestampOffset: offset => (type, sourceUpdater) => {\n const sourceBuffer = sourceUpdater[`${type}Buffer`]; // can't do anything if the media source / source buffer is null\n // or the media source does not contain this source buffer.\n\n if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {\n return;\n }\n sourceUpdater.logger_(`Setting ${type}timestampOffset to ${offset}`);\n sourceBuffer.timestampOffset = offset;\n },\n callback: callback => (type, sourceUpdater) => {\n callback();\n },\n endOfStream: error => sourceUpdater => {\n if (sourceUpdater.mediaSource.readyState !== 'open') {\n return;\n }\n sourceUpdater.logger_(`Calling mediaSource endOfStream(${error || ''})`);\n try {\n sourceUpdater.mediaSource.endOfStream(error);\n } catch (e) {\n videojs.log.warn('Failed to call media source endOfStream', e);\n }\n },\n duration: duration => sourceUpdater => {\n sourceUpdater.logger_(`Setting mediaSource duration to ${duration}`);\n try {\n sourceUpdater.mediaSource.duration = duration;\n } catch (e) {\n videojs.log.warn('Failed to set media source duration', e);\n }\n },\n abort: () => (type, sourceUpdater) => {\n if (sourceUpdater.mediaSource.readyState !== 'open') {\n return;\n }\n const sourceBuffer = sourceUpdater[`${type}Buffer`]; // can't do anything if the media source / source buffer is null\n // or the media source does not contain this source buffer.\n\n if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {\n return;\n }\n sourceUpdater.logger_(`calling abort on ${type}Buffer`);\n try {\n sourceBuffer.abort();\n } catch (e) {\n videojs.log.warn(`Failed to abort on ${type}Buffer`, e);\n }\n },\n addSourceBuffer: (type, codec) => sourceUpdater => {\n const titleType = toTitleCase(type);\n const mime = getMimeForCodec(codec);\n sourceUpdater.logger_(`Adding ${type}Buffer with codec ${codec} to mediaSource`);\n const sourceBuffer = sourceUpdater.mediaSource.addSourceBuffer(mime);\n sourceBuffer.addEventListener('updateend', sourceUpdater[`on${titleType}UpdateEnd_`]);\n sourceBuffer.addEventListener('error', sourceUpdater[`on${titleType}Error_`]);\n sourceUpdater.codecs[type] = codec;\n sourceUpdater[`${type}Buffer`] = sourceBuffer;\n },\n removeSourceBuffer: type => sourceUpdater => {\n const sourceBuffer = sourceUpdater[`${type}Buffer`];\n cleanupBuffer(type, sourceUpdater); // can't do anything if the media source / source buffer is null\n // or the media source does not contain this source buffer.\n\n if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {\n return;\n }\n sourceUpdater.logger_(`Removing ${type}Buffer with codec ${sourceUpdater.codecs[type]} from mediaSource`);\n try {\n sourceUpdater.mediaSource.removeSourceBuffer(sourceBuffer);\n } catch (e) {\n videojs.log.warn(`Failed to removeSourceBuffer ${type}Buffer`, e);\n }\n },\n changeType: codec => (type, sourceUpdater) => {\n const sourceBuffer = sourceUpdater[`${type}Buffer`];\n const mime = getMimeForCodec(codec); // can't do anything if the media source / source buffer is null\n // or the media source does not contain this source buffer.\n\n if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {\n return;\n } // do not update codec if we don't need to.\n\n if (sourceUpdater.codecs[type] === codec) {\n return;\n }\n sourceUpdater.logger_(`changing ${type}Buffer codec from ${sourceUpdater.codecs[type]} to ${codec}`);\n sourceBuffer.changeType(mime);\n sourceUpdater.codecs[type] = codec;\n }\n};\nconst pushQueue = ({\n type,\n sourceUpdater,\n action,\n doneFn,\n name\n}) => {\n sourceUpdater.queue.push({\n type,\n action,\n doneFn,\n name\n });\n shiftQueue(type, sourceUpdater);\n};\nconst onUpdateend = (type, sourceUpdater) => e => {\n const buffered = sourceUpdater[`${type}Buffered`]();\n const bufferedAsString = prettyBuffered(buffered);\n sourceUpdater.logger_(`${type} source buffer update end. Buffered: \\n`, bufferedAsString); // Although there should, in theory, be a pending action for any updateend receieved,\n // there are some actions that may trigger updateend events without set definitions in\n // the w3c spec. For instance, setting the duration on the media source may trigger\n // updateend events on source buffers. This does not appear to be in the spec. As such,\n // if we encounter an updateend without a corresponding pending action from our queue\n // for that source buffer type, process the next action.\n\n if (sourceUpdater.queuePending[type]) {\n const doneFn = sourceUpdater.queuePending[type].doneFn;\n sourceUpdater.queuePending[type] = null;\n if (doneFn) {\n // if there's an error, report it\n doneFn(sourceUpdater[`${type}Error_`]);\n }\n }\n shiftQueue(type, sourceUpdater);\n};\n/**\n * A queue of callbacks to be serialized and applied when a\n * MediaSource and its associated SourceBuffers are not in the\n * updating state. It is used by the segment loader to update the\n * underlying SourceBuffers when new data is loaded, for instance.\n *\n * @class SourceUpdater\n * @param {MediaSource} mediaSource the MediaSource to create the SourceBuffer from\n * @param {string} mimeType the desired MIME type of the underlying SourceBuffer\n */\n\nclass SourceUpdater extends videojs.EventTarget {\n constructor(mediaSource) {\n super();\n this.mediaSource = mediaSource;\n this.sourceopenListener_ = () => shiftQueue('mediaSource', this);\n this.mediaSource.addEventListener('sourceopen', this.sourceopenListener_);\n this.logger_ = logger('SourceUpdater'); // initial timestamp offset is 0\n\n this.audioTimestampOffset_ = 0;\n this.videoTimestampOffset_ = 0;\n this.queue = [];\n this.queuePending = {\n audio: null,\n video: null\n };\n this.delayedAudioAppendQueue_ = [];\n this.videoAppendQueued_ = false;\n this.codecs = {};\n this.onVideoUpdateEnd_ = onUpdateend('video', this);\n this.onAudioUpdateEnd_ = onUpdateend('audio', this);\n this.onVideoError_ = e => {\n // used for debugging\n this.videoError_ = e;\n };\n this.onAudioError_ = e => {\n // used for debugging\n this.audioError_ = e;\n };\n this.createdSourceBuffers_ = false;\n this.initializedEme_ = false;\n this.triggeredReady_ = false;\n }\n initializedEme() {\n this.initializedEme_ = true;\n this.triggerReady();\n }\n hasCreatedSourceBuffers() {\n // if false, likely waiting on one of the segment loaders to get enough data to create\n // source buffers\n return this.createdSourceBuffers_;\n }\n hasInitializedAnyEme() {\n return this.initializedEme_;\n }\n ready() {\n return this.hasCreatedSourceBuffers() && this.hasInitializedAnyEme();\n }\n createSourceBuffers(codecs) {\n if (this.hasCreatedSourceBuffers()) {\n // already created them before\n return;\n } // the intial addOrChangeSourceBuffers will always be\n // two add buffers.\n\n this.addOrChangeSourceBuffers(codecs);\n this.createdSourceBuffers_ = true;\n this.trigger('createdsourcebuffers');\n this.triggerReady();\n }\n triggerReady() {\n // only allow ready to be triggered once, this prevents the case\n // where:\n // 1. we trigger createdsourcebuffers\n // 2. ie 11 synchronously initializates eme\n // 3. the synchronous initialization causes us to trigger ready\n // 4. We go back to the ready check in createSourceBuffers and ready is triggered again.\n if (this.ready() && !this.triggeredReady_) {\n this.triggeredReady_ = true;\n this.trigger('ready');\n }\n }\n /**\n * Add a type of source buffer to the media source.\n *\n * @param {string} type\n * The type of source buffer to add.\n *\n * @param {string} codec\n * The codec to add the source buffer with.\n */\n\n addSourceBuffer(type, codec) {\n pushQueue({\n type: 'mediaSource',\n sourceUpdater: this,\n action: actions.addSourceBuffer(type, codec),\n name: 'addSourceBuffer'\n });\n }\n /**\n * call abort on a source buffer.\n *\n * @param {string} type\n * The type of source buffer to call abort on.\n */\n\n abort(type) {\n pushQueue({\n type,\n sourceUpdater: this,\n action: actions.abort(type),\n name: 'abort'\n });\n }\n /**\n * Call removeSourceBuffer and remove a specific type\n * of source buffer on the mediaSource.\n *\n * @param {string} type\n * The type of source buffer to remove.\n */\n\n removeSourceBuffer(type) {\n if (!this.canRemoveSourceBuffer()) {\n videojs.log.error('removeSourceBuffer is not supported!');\n return;\n }\n pushQueue({\n type: 'mediaSource',\n sourceUpdater: this,\n action: actions.removeSourceBuffer(type),\n name: 'removeSourceBuffer'\n });\n }\n /**\n * Whether or not the removeSourceBuffer function is supported\n * on the mediaSource.\n *\n * @return {boolean}\n * if removeSourceBuffer can be called.\n */\n\n canRemoveSourceBuffer() {\n // As of Firefox 83 removeSourceBuffer\n // throws errors, so we report that it does not support this.\n return !videojs.browser.IS_FIREFOX && window$1.MediaSource && window$1.MediaSource.prototype && typeof window$1.MediaSource.prototype.removeSourceBuffer === 'function';\n }\n /**\n * Whether or not the changeType function is supported\n * on our SourceBuffers.\n *\n * @return {boolean}\n * if changeType can be called.\n */\n\n static canChangeType() {\n return window$1.SourceBuffer && window$1.SourceBuffer.prototype && typeof window$1.SourceBuffer.prototype.changeType === 'function';\n }\n /**\n * Whether or not the changeType function is supported\n * on our SourceBuffers.\n *\n * @return {boolean}\n * if changeType can be called.\n */\n\n canChangeType() {\n return this.constructor.canChangeType();\n }\n /**\n * Call the changeType function on a source buffer, given the code and type.\n *\n * @param {string} type\n * The type of source buffer to call changeType on.\n *\n * @param {string} codec\n * The codec string to change type with on the source buffer.\n */\n\n changeType(type, codec) {\n if (!this.canChangeType()) {\n videojs.log.error('changeType is not supported!');\n return;\n }\n pushQueue({\n type,\n sourceUpdater: this,\n action: actions.changeType(codec),\n name: 'changeType'\n });\n }\n /**\n * Add source buffers with a codec or, if they are already created,\n * call changeType on source buffers using changeType.\n *\n * @param {Object} codecs\n * Codecs to switch to\n */\n\n addOrChangeSourceBuffers(codecs) {\n if (!codecs || typeof codecs !== 'object' || Object.keys(codecs).length === 0) {\n throw new Error('Cannot addOrChangeSourceBuffers to undefined codecs');\n }\n Object.keys(codecs).forEach(type => {\n const codec = codecs[type];\n if (!this.hasCreatedSourceBuffers()) {\n return this.addSourceBuffer(type, codec);\n }\n if (this.canChangeType()) {\n this.changeType(type, codec);\n }\n });\n }\n /**\n * Queue an update to append an ArrayBuffer.\n *\n * @param {MediaObject} object containing audioBytes and/or videoBytes\n * @param {Function} done the function to call when done\n * @see http://www.w3.org/TR/media-source/#widl-SourceBuffer-appendBuffer-void-ArrayBuffer-data\n */\n\n appendBuffer(options, doneFn) {\n const {\n segmentInfo,\n type,\n bytes\n } = options;\n this.processedAppend_ = true;\n if (type === 'audio' && this.videoBuffer && !this.videoAppendQueued_) {\n this.delayedAudioAppendQueue_.push([options, doneFn]);\n this.logger_(`delayed audio append of ${bytes.length} until video append`);\n return;\n } // In the case of certain errors, for instance, QUOTA_EXCEEDED_ERR, updateend will\n // not be fired. This means that the queue will be blocked until the next action\n // taken by the segment-loader. Provide a mechanism for segment-loader to handle\n // these errors by calling the doneFn with the specific error.\n\n const onError = doneFn;\n pushQueue({\n type,\n sourceUpdater: this,\n action: actions.appendBuffer(bytes, segmentInfo || {\n mediaIndex: -1\n }, onError),\n doneFn,\n name: 'appendBuffer'\n });\n if (type === 'video') {\n this.videoAppendQueued_ = true;\n if (!this.delayedAudioAppendQueue_.length) {\n return;\n }\n const queue = this.delayedAudioAppendQueue_.slice();\n this.logger_(`queuing delayed audio ${queue.length} appendBuffers`);\n this.delayedAudioAppendQueue_.length = 0;\n queue.forEach(que => {\n this.appendBuffer.apply(this, que);\n });\n }\n }\n /**\n * Get the audio buffer's buffered timerange.\n *\n * @return {TimeRange}\n * The audio buffer's buffered time range\n */\n\n audioBuffered() {\n // no media source/source buffer or it isn't in the media sources\n // source buffer list\n if (!inSourceBuffers(this.mediaSource, this.audioBuffer)) {\n return createTimeRanges();\n }\n return this.audioBuffer.buffered ? this.audioBuffer.buffered : createTimeRanges();\n }\n /**\n * Get the video buffer's buffered timerange.\n *\n * @return {TimeRange}\n * The video buffer's buffered time range\n */\n\n videoBuffered() {\n // no media source/source buffer or it isn't in the media sources\n // source buffer list\n if (!inSourceBuffers(this.mediaSource, this.videoBuffer)) {\n return createTimeRanges();\n }\n return this.videoBuffer.buffered ? this.videoBuffer.buffered : createTimeRanges();\n }\n /**\n * Get a combined video/audio buffer's buffered timerange.\n *\n * @return {TimeRange}\n * the combined time range\n */\n\n buffered() {\n const video = inSourceBuffers(this.mediaSource, this.videoBuffer) ? this.videoBuffer : null;\n const audio = inSourceBuffers(this.mediaSource, this.audioBuffer) ? this.audioBuffer : null;\n if (audio && !video) {\n return this.audioBuffered();\n }\n if (video && !audio) {\n return this.videoBuffered();\n }\n return bufferIntersection(this.audioBuffered(), this.videoBuffered());\n }\n /**\n * Add a callback to the queue that will set duration on the mediaSource.\n *\n * @param {number} duration\n * The duration to set\n *\n * @param {Function} [doneFn]\n * function to run after duration has been set.\n */\n\n setDuration(duration, doneFn = noop) {\n // In order to set the duration on the media source, it's necessary to wait for all\n // source buffers to no longer be updating. \"If the updating attribute equals true on\n // any SourceBuffer in sourceBuffers, then throw an InvalidStateError exception and\n // abort these steps.\" (source: https://www.w3.org/TR/media-source/#attributes).\n pushQueue({\n type: 'mediaSource',\n sourceUpdater: this,\n action: actions.duration(duration),\n name: 'duration',\n doneFn\n });\n }\n /**\n * Add a mediaSource endOfStream call to the queue\n *\n * @param {Error} [error]\n * Call endOfStream with an error\n *\n * @param {Function} [doneFn]\n * A function that should be called when the\n * endOfStream call has finished.\n */\n\n endOfStream(error = null, doneFn = noop) {\n if (typeof error !== 'string') {\n error = undefined;\n } // In order to set the duration on the media source, it's necessary to wait for all\n // source buffers to no longer be updating. \"If the updating attribute equals true on\n // any SourceBuffer in sourceBuffers, then throw an InvalidStateError exception and\n // abort these steps.\" (source: https://www.w3.org/TR/media-source/#attributes).\n\n pushQueue({\n type: 'mediaSource',\n sourceUpdater: this,\n action: actions.endOfStream(error),\n name: 'endOfStream',\n doneFn\n });\n }\n /**\n * Queue an update to remove a time range from the buffer.\n *\n * @param {number} start where to start the removal\n * @param {number} end where to end the removal\n * @param {Function} [done=noop] optional callback to be executed when the remove\n * operation is complete\n * @see http://www.w3.org/TR/media-source/#widl-SourceBuffer-remove-void-double-start-unrestricted-double-end\n */\n\n removeAudio(start, end, done = noop) {\n if (!this.audioBuffered().length || this.audioBuffered().end(0) === 0) {\n done();\n return;\n }\n pushQueue({\n type: 'audio',\n sourceUpdater: this,\n action: actions.remove(start, end),\n doneFn: done,\n name: 'remove'\n });\n }\n /**\n * Queue an update to remove a time range from the buffer.\n *\n * @param {number} start where to start the removal\n * @param {number} end where to end the removal\n * @param {Function} [done=noop] optional callback to be executed when the remove\n * operation is complete\n * @see http://www.w3.org/TR/media-source/#widl-SourceBuffer-remove-void-double-start-unrestricted-double-end\n */\n\n removeVideo(start, end, done = noop) {\n if (!this.videoBuffered().length || this.videoBuffered().end(0) === 0) {\n done();\n return;\n }\n pushQueue({\n type: 'video',\n sourceUpdater: this,\n action: actions.remove(start, end),\n doneFn: done,\n name: 'remove'\n });\n }\n /**\n * Whether the underlying sourceBuffer is updating or not\n *\n * @return {boolean} the updating status of the SourceBuffer\n */\n\n updating() {\n // the audio/video source buffer is updating\n if (updating('audio', this) || updating('video', this)) {\n return true;\n }\n return false;\n }\n /**\n * Set/get the timestampoffset on the audio SourceBuffer\n *\n * @return {number} the timestamp offset\n */\n\n audioTimestampOffset(offset) {\n if (typeof offset !== 'undefined' && this.audioBuffer &&\n // no point in updating if it's the same\n this.audioTimestampOffset_ !== offset) {\n pushQueue({\n type: 'audio',\n sourceUpdater: this,\n action: actions.timestampOffset(offset),\n name: 'timestampOffset'\n });\n this.audioTimestampOffset_ = offset;\n }\n return this.audioTimestampOffset_;\n }\n /**\n * Set/get the timestampoffset on the video SourceBuffer\n *\n * @return {number} the timestamp offset\n */\n\n videoTimestampOffset(offset) {\n if (typeof offset !== 'undefined' && this.videoBuffer &&\n // no point in updating if it's the same\n this.videoTimestampOffset !== offset) {\n pushQueue({\n type: 'video',\n sourceUpdater: this,\n action: actions.timestampOffset(offset),\n name: 'timestampOffset'\n });\n this.videoTimestampOffset_ = offset;\n }\n return this.videoTimestampOffset_;\n }\n /**\n * Add a function to the queue that will be called\n * when it is its turn to run in the audio queue.\n *\n * @param {Function} callback\n * The callback to queue.\n */\n\n audioQueueCallback(callback) {\n if (!this.audioBuffer) {\n return;\n }\n pushQueue({\n type: 'audio',\n sourceUpdater: this,\n action: actions.callback(callback),\n name: 'callback'\n });\n }\n /**\n * Add a function to the queue that will be called\n * when it is its turn to run in the video queue.\n *\n * @param {Function} callback\n * The callback to queue.\n */\n\n videoQueueCallback(callback) {\n if (!this.videoBuffer) {\n return;\n }\n pushQueue({\n type: 'video',\n sourceUpdater: this,\n action: actions.callback(callback),\n name: 'callback'\n });\n }\n /**\n * dispose of the source updater and the underlying sourceBuffer\n */\n\n dispose() {\n this.trigger('dispose');\n bufferTypes.forEach(type => {\n this.abort(type);\n if (this.canRemoveSourceBuffer()) {\n this.removeSourceBuffer(type);\n } else {\n this[`${type}QueueCallback`](() => cleanupBuffer(type, this));\n }\n });\n this.videoAppendQueued_ = false;\n this.delayedAudioAppendQueue_.length = 0;\n if (this.sourceopenListener_) {\n this.mediaSource.removeEventListener('sourceopen', this.sourceopenListener_);\n }\n this.off();\n }\n}\nconst uint8ToUtf8 = uintArray => decodeURIComponent(escape(String.fromCharCode.apply(null, uintArray)));\n\n/**\n * @file vtt-segment-loader.js\n */\nconst VTT_LINE_TERMINATORS = new Uint8Array('\\n\\n'.split('').map(char => char.charCodeAt(0)));\nclass NoVttJsError extends Error {\n constructor() {\n super('Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.');\n }\n}\n/**\n * An object that manages segment loading and appending.\n *\n * @class VTTSegmentLoader\n * @param {Object} options required and optional options\n * @extends videojs.EventTarget\n */\n\nclass VTTSegmentLoader extends SegmentLoader {\n constructor(settings, options = {}) {\n super(settings, options); // SegmentLoader requires a MediaSource be specified or it will throw an error;\n // however, VTTSegmentLoader has no need of a media source, so delete the reference\n\n this.mediaSource_ = null;\n this.subtitlesTrack_ = null;\n this.loaderType_ = 'subtitle';\n this.featuresNativeTextTracks_ = settings.featuresNativeTextTracks;\n this.loadVttJs = settings.loadVttJs; // The VTT segment will have its own time mappings. Saving VTT segment timing info in\n // the sync controller leads to improper behavior.\n\n this.shouldSaveSegmentTimingInfo_ = false;\n }\n createTransmuxer_() {\n // don't need to transmux any subtitles\n return null;\n }\n /**\n * Indicates which time ranges are buffered\n *\n * @return {TimeRange}\n * TimeRange object representing the current buffered ranges\n */\n\n buffered_() {\n if (!this.subtitlesTrack_ || !this.subtitlesTrack_.cues || !this.subtitlesTrack_.cues.length) {\n return createTimeRanges();\n }\n const cues = this.subtitlesTrack_.cues;\n const start = cues[0].startTime;\n const end = cues[cues.length - 1].startTime;\n return createTimeRanges([[start, end]]);\n }\n /**\n * Gets and sets init segment for the provided map\n *\n * @param {Object} map\n * The map object representing the init segment to get or set\n * @param {boolean=} set\n * If true, the init segment for the provided map should be saved\n * @return {Object}\n * map object for desired init segment\n */\n\n initSegmentForMap(map, set = false) {\n if (!map) {\n return null;\n }\n const id = initSegmentId(map);\n let storedMap = this.initSegments_[id];\n if (set && !storedMap && map.bytes) {\n // append WebVTT line terminators to the media initialization segment if it exists\n // to follow the WebVTT spec (https://w3c.github.io/webvtt/#file-structure) that\n // requires two or more WebVTT line terminators between the WebVTT header and the\n // rest of the file\n const combinedByteLength = VTT_LINE_TERMINATORS.byteLength + map.bytes.byteLength;\n const combinedSegment = new Uint8Array(combinedByteLength);\n combinedSegment.set(map.bytes);\n combinedSegment.set(VTT_LINE_TERMINATORS, map.bytes.byteLength);\n this.initSegments_[id] = storedMap = {\n resolvedUri: map.resolvedUri,\n byterange: map.byterange,\n bytes: combinedSegment\n };\n }\n return storedMap || map;\n }\n /**\n * Returns true if all configuration required for loading is present, otherwise false.\n *\n * @return {boolean} True if the all configuration is ready for loading\n * @private\n */\n\n couldBeginLoading_() {\n return this.playlist_ && this.subtitlesTrack_ && !this.paused();\n }\n /**\n * Once all the starting parameters have been specified, begin\n * operation. This method should only be invoked from the INIT\n * state.\n *\n * @private\n */\n\n init_() {\n this.state = 'READY';\n this.resetEverything();\n return this.monitorBuffer_();\n }\n /**\n * Set a subtitle track on the segment loader to add subtitles to\n *\n * @param {TextTrack=} track\n * The text track to add loaded subtitles to\n * @return {TextTrack}\n * Returns the subtitles track\n */\n\n track(track) {\n if (typeof track === 'undefined') {\n return this.subtitlesTrack_;\n }\n this.subtitlesTrack_ = track; // if we were unpaused but waiting for a sourceUpdater, start\n // buffering now\n\n if (this.state === 'INIT' && this.couldBeginLoading_()) {\n this.init_();\n }\n return this.subtitlesTrack_;\n }\n /**\n * Remove any data in the source buffer between start and end times\n *\n * @param {number} start - the start time of the region to remove from the buffer\n * @param {number} end - the end time of the region to remove from the buffer\n */\n\n remove(start, end) {\n removeCuesFromTrack(start, end, this.subtitlesTrack_);\n }\n /**\n * fill the buffer with segements unless the sourceBuffers are\n * currently updating\n *\n * Note: this function should only ever be called by monitorBuffer_\n * and never directly\n *\n * @private\n */\n\n fillBuffer_() {\n // see if we need to begin loading immediately\n const segmentInfo = this.chooseNextRequest_();\n if (!segmentInfo) {\n return;\n }\n if (this.syncController_.timestampOffsetForTimeline(segmentInfo.timeline) === null) {\n // We don't have the timestamp offset that we need to sync subtitles.\n // Rerun on a timestamp offset or user interaction.\n const checkTimestampOffset = () => {\n this.state = 'READY';\n if (!this.paused()) {\n // if not paused, queue a buffer check as soon as possible\n this.monitorBuffer_();\n }\n };\n this.syncController_.one('timestampoffset', checkTimestampOffset);\n this.state = 'WAITING_ON_TIMELINE';\n return;\n }\n this.loadSegment_(segmentInfo);\n } // never set a timestamp offset for vtt segments.\n\n timestampOffsetForSegment_() {\n return null;\n }\n chooseNextRequest_() {\n return this.skipEmptySegments_(super.chooseNextRequest_());\n }\n /**\n * Prevents the segment loader from requesting segments we know contain no subtitles\n * by walking forward until we find the next segment that we don't know whether it is\n * empty or not.\n *\n * @param {Object} segmentInfo\n * a segment info object that describes the current segment\n * @return {Object}\n * a segment info object that describes the current segment\n */\n\n skipEmptySegments_(segmentInfo) {\n while (segmentInfo && segmentInfo.segment.empty) {\n // stop at the last possible segmentInfo\n if (segmentInfo.mediaIndex + 1 >= segmentInfo.playlist.segments.length) {\n segmentInfo = null;\n break;\n }\n segmentInfo = this.generateSegmentInfo_({\n playlist: segmentInfo.playlist,\n mediaIndex: segmentInfo.mediaIndex + 1,\n startOfSegment: segmentInfo.startOfSegment + segmentInfo.duration,\n isSyncRequest: segmentInfo.isSyncRequest\n });\n }\n return segmentInfo;\n }\n stopForError(error) {\n this.error(error);\n this.state = 'READY';\n this.pause();\n this.trigger('error');\n }\n /**\n * append a decrypted segement to the SourceBuffer through a SourceUpdater\n *\n * @private\n */\n\n segmentRequestFinished_(error, simpleSegment, result) {\n if (!this.subtitlesTrack_) {\n this.state = 'READY';\n return;\n }\n this.saveTransferStats_(simpleSegment.stats); // the request was aborted\n\n if (!this.pendingSegment_) {\n this.state = 'READY';\n this.mediaRequestsAborted += 1;\n return;\n }\n if (error) {\n if (error.code === REQUEST_ERRORS.TIMEOUT) {\n this.handleTimeout_();\n }\n if (error.code === REQUEST_ERRORS.ABORTED) {\n this.mediaRequestsAborted += 1;\n } else {\n this.mediaRequestsErrored += 1;\n }\n this.stopForError(error);\n return;\n }\n const segmentInfo = this.pendingSegment_; // although the VTT segment loader bandwidth isn't really used, it's good to\n // maintain functionality between segment loaders\n\n this.saveBandwidthRelatedStats_(segmentInfo.duration, simpleSegment.stats); // if this request included a segment key, save that data in the cache\n\n if (simpleSegment.key) {\n this.segmentKey(simpleSegment.key, true);\n }\n this.state = 'APPENDING'; // used for tests\n\n this.trigger('appending');\n const segment = segmentInfo.segment;\n if (segment.map) {\n segment.map.bytes = simpleSegment.map.bytes;\n }\n segmentInfo.bytes = simpleSegment.bytes; // Make sure that vttjs has loaded, otherwise, load it and wait till it finished loading\n\n if (typeof window$1.WebVTT !== 'function' && typeof this.loadVttJs === 'function') {\n this.state = 'WAITING_ON_VTTJS'; // should be fine to call multiple times\n // script will be loaded once but multiple listeners will be added to the queue, which is expected.\n\n this.loadVttJs().then(() => this.segmentRequestFinished_(error, simpleSegment, result), () => this.stopForError({\n message: 'Error loading vtt.js'\n }));\n return;\n }\n segment.requested = true;\n try {\n this.parseVTTCues_(segmentInfo);\n } catch (e) {\n this.stopForError({\n message: e.message\n });\n return;\n }\n this.updateTimeMapping_(segmentInfo, this.syncController_.timelines[segmentInfo.timeline], this.playlist_);\n if (segmentInfo.cues.length) {\n segmentInfo.timingInfo = {\n start: segmentInfo.cues[0].startTime,\n end: segmentInfo.cues[segmentInfo.cues.length - 1].endTime\n };\n } else {\n segmentInfo.timingInfo = {\n start: segmentInfo.startOfSegment,\n end: segmentInfo.startOfSegment + segmentInfo.duration\n };\n }\n if (segmentInfo.isSyncRequest) {\n this.trigger('syncinfoupdate');\n this.pendingSegment_ = null;\n this.state = 'READY';\n return;\n }\n segmentInfo.byteLength = segmentInfo.bytes.byteLength;\n this.mediaSecondsLoaded += segment.duration; // Create VTTCue instances for each cue in the new segment and add them to\n // the subtitle track\n\n segmentInfo.cues.forEach(cue => {\n this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_ ? new window$1.VTTCue(cue.startTime, cue.endTime, cue.text) : cue);\n }); // Remove any duplicate cues from the subtitle track. The WebVTT spec allows\n // cues to have identical time-intervals, but if the text is also identical\n // we can safely assume it is a duplicate that can be removed (ex. when a cue\n // \"overlaps\" VTT segments)\n\n removeDuplicateCuesFromTrack(this.subtitlesTrack_);\n this.handleAppendsDone_();\n }\n handleData_() {// noop as we shouldn't be getting video/audio data captions\n // that we do not support here.\n }\n updateTimingInfoEnd_() {// noop\n }\n /**\n * Uses the WebVTT parser to parse the segment response\n *\n * @throws NoVttJsError\n *\n * @param {Object} segmentInfo\n * a segment info object that describes the current segment\n * @private\n */\n\n parseVTTCues_(segmentInfo) {\n let decoder;\n let decodeBytesToString = false;\n if (typeof window$1.WebVTT !== 'function') {\n // caller is responsible for exception handling.\n throw new NoVttJsError();\n }\n if (typeof window$1.TextDecoder === 'function') {\n decoder = new window$1.TextDecoder('utf8');\n } else {\n decoder = window$1.WebVTT.StringDecoder();\n decodeBytesToString = true;\n }\n const parser = new window$1.WebVTT.Parser(window$1, window$1.vttjs, decoder);\n segmentInfo.cues = [];\n segmentInfo.timestampmap = {\n MPEGTS: 0,\n LOCAL: 0\n };\n parser.oncue = segmentInfo.cues.push.bind(segmentInfo.cues);\n parser.ontimestampmap = map => {\n segmentInfo.timestampmap = map;\n };\n parser.onparsingerror = error => {\n videojs.log.warn('Error encountered when parsing cues: ' + error.message);\n };\n if (segmentInfo.segment.map) {\n let mapData = segmentInfo.segment.map.bytes;\n if (decodeBytesToString) {\n mapData = uint8ToUtf8(mapData);\n }\n parser.parse(mapData);\n }\n let segmentData = segmentInfo.bytes;\n if (decodeBytesToString) {\n segmentData = uint8ToUtf8(segmentData);\n }\n parser.parse(segmentData);\n parser.flush();\n }\n /**\n * Updates the start and end times of any cues parsed by the WebVTT parser using\n * the information parsed from the X-TIMESTAMP-MAP header and a TS to media time mapping\n * from the SyncController\n *\n * @param {Object} segmentInfo\n * a segment info object that describes the current segment\n * @param {Object} mappingObj\n * object containing a mapping from TS to media time\n * @param {Object} playlist\n * the playlist object containing the segment\n * @private\n */\n\n updateTimeMapping_(segmentInfo, mappingObj, playlist) {\n const segment = segmentInfo.segment;\n if (!mappingObj) {\n // If the sync controller does not have a mapping of TS to Media Time for the\n // timeline, then we don't have enough information to update the cue\n // start/end times\n return;\n }\n if (!segmentInfo.cues.length) {\n // If there are no cues, we also do not have enough information to figure out\n // segment timing. Mark that the segment contains no cues so we don't re-request\n // an empty segment.\n segment.empty = true;\n return;\n }\n const timestampmap = segmentInfo.timestampmap;\n const diff = timestampmap.MPEGTS / ONE_SECOND_IN_TS - timestampmap.LOCAL + mappingObj.mapping;\n segmentInfo.cues.forEach(cue => {\n // First convert cue time to TS time using the timestamp-map provided within the vtt\n cue.startTime += diff;\n cue.endTime += diff;\n });\n if (!playlist.syncInfo) {\n const firstStart = segmentInfo.cues[0].startTime;\n const lastStart = segmentInfo.cues[segmentInfo.cues.length - 1].startTime;\n playlist.syncInfo = {\n mediaSequence: playlist.mediaSequence + segmentInfo.mediaIndex,\n time: Math.min(firstStart, lastStart - segment.duration)\n };\n }\n }\n}\n\n/**\n * @file ad-cue-tags.js\n */\n/**\n * Searches for an ad cue that overlaps with the given mediaTime\n *\n * @param {Object} track\n * the track to find the cue for\n *\n * @param {number} mediaTime\n * the time to find the cue at\n *\n * @return {Object|null}\n * the found cue or null\n */\n\nconst findAdCue = function (track, mediaTime) {\n const cues = track.cues;\n for (let i = 0; i < cues.length; i++) {\n const cue = cues[i];\n if (mediaTime >= cue.adStartTime && mediaTime <= cue.adEndTime) {\n return cue;\n }\n }\n return null;\n};\nconst updateAdCues = function (media, track, offset = 0) {\n if (!media.segments) {\n return;\n }\n let mediaTime = offset;\n let cue;\n for (let i = 0; i < media.segments.length; i++) {\n const segment = media.segments[i];\n if (!cue) {\n // Since the cues will span for at least the segment duration, adding a fudge\n // factor of half segment duration will prevent duplicate cues from being\n // created when timing info is not exact (e.g. cue start time initialized\n // at 10.006677, but next call mediaTime is 10.003332 )\n cue = findAdCue(track, mediaTime + segment.duration / 2);\n }\n if (cue) {\n if ('cueIn' in segment) {\n // Found a CUE-IN so end the cue\n cue.endTime = mediaTime;\n cue.adEndTime = mediaTime;\n mediaTime += segment.duration;\n cue = null;\n continue;\n }\n if (mediaTime < cue.endTime) {\n // Already processed this mediaTime for this cue\n mediaTime += segment.duration;\n continue;\n } // otherwise extend cue until a CUE-IN is found\n\n cue.endTime += segment.duration;\n } else {\n if ('cueOut' in segment) {\n cue = new window$1.VTTCue(mediaTime, mediaTime + segment.duration, segment.cueOut);\n cue.adStartTime = mediaTime; // Assumes tag format to be\n // #EXT-X-CUE-OUT:30\n\n cue.adEndTime = mediaTime + parseFloat(segment.cueOut);\n track.addCue(cue);\n }\n if ('cueOutCont' in segment) {\n // Entered into the middle of an ad cue\n // Assumes tag formate to be\n // #EXT-X-CUE-OUT-CONT:10/30\n const [adOffset, adTotal] = segment.cueOutCont.split('/').map(parseFloat);\n cue = new window$1.VTTCue(mediaTime, mediaTime + segment.duration, '');\n cue.adStartTime = mediaTime - adOffset;\n cue.adEndTime = cue.adStartTime + adTotal;\n track.addCue(cue);\n }\n }\n mediaTime += segment.duration;\n }\n};\n\n/**\n * @file sync-controller.js\n */\n// synchronize expired playlist segments.\n// the max media sequence diff is 48 hours of live stream\n// content with two second segments. Anything larger than that\n// will likely be invalid.\n\nconst MAX_MEDIA_SEQUENCE_DIFF_FOR_SYNC = 86400;\nconst syncPointStrategies = [\n// Stategy \"VOD\": Handle the VOD-case where the sync-point is *always*\n// the equivalence display-time 0 === segment-index 0\n{\n name: 'VOD',\n run: (syncController, playlist, duration, currentTimeline, currentTime) => {\n if (duration !== Infinity) {\n const syncPoint = {\n time: 0,\n segmentIndex: 0,\n partIndex: null\n };\n return syncPoint;\n }\n return null;\n }\n},\n// Stategy \"ProgramDateTime\": We have a program-date-time tag in this playlist\n{\n name: 'ProgramDateTime',\n run: (syncController, playlist, duration, currentTimeline, currentTime) => {\n if (!Object.keys(syncController.timelineToDatetimeMappings).length) {\n return null;\n }\n let syncPoint = null;\n let lastDistance = null;\n const partsAndSegments = getPartsAndSegments(playlist);\n currentTime = currentTime || 0;\n for (let i = 0; i < partsAndSegments.length; i++) {\n // start from the end and loop backwards for live\n // or start from the front and loop forwards for non-live\n const index = playlist.endList || currentTime === 0 ? i : partsAndSegments.length - (i + 1);\n const partAndSegment = partsAndSegments[index];\n const segment = partAndSegment.segment;\n const datetimeMapping = syncController.timelineToDatetimeMappings[segment.timeline];\n if (!datetimeMapping || !segment.dateTimeObject) {\n continue;\n }\n const segmentTime = segment.dateTimeObject.getTime() / 1000;\n let start = segmentTime + datetimeMapping; // take part duration into account.\n\n if (segment.parts && typeof partAndSegment.partIndex === 'number') {\n for (let z = 0; z < partAndSegment.partIndex; z++) {\n start += segment.parts[z].duration;\n }\n }\n const distance = Math.abs(currentTime - start); // Once the distance begins to increase, or if distance is 0, we have passed\n // currentTime and can stop looking for better candidates\n\n if (lastDistance !== null && (distance === 0 || lastDistance < distance)) {\n break;\n }\n lastDistance = distance;\n syncPoint = {\n time: start,\n segmentIndex: partAndSegment.segmentIndex,\n partIndex: partAndSegment.partIndex\n };\n }\n return syncPoint;\n }\n},\n// Stategy \"Segment\": We have a known time mapping for a timeline and a\n// segment in the current timeline with timing data\n{\n name: 'Segment',\n run: (syncController, playlist, duration, currentTimeline, currentTime) => {\n let syncPoint = null;\n let lastDistance = null;\n currentTime = currentTime || 0;\n const partsAndSegments = getPartsAndSegments(playlist);\n for (let i = 0; i < partsAndSegments.length; i++) {\n // start from the end and loop backwards for live\n // or start from the front and loop forwards for non-live\n const index = playlist.endList || currentTime === 0 ? i : partsAndSegments.length - (i + 1);\n const partAndSegment = partsAndSegments[index];\n const segment = partAndSegment.segment;\n const start = partAndSegment.part && partAndSegment.part.start || segment && segment.start;\n if (segment.timeline === currentTimeline && typeof start !== 'undefined') {\n const distance = Math.abs(currentTime - start); // Once the distance begins to increase, we have passed\n // currentTime and can stop looking for better candidates\n\n if (lastDistance !== null && lastDistance < distance) {\n break;\n }\n if (!syncPoint || lastDistance === null || lastDistance >= distance) {\n lastDistance = distance;\n syncPoint = {\n time: start,\n segmentIndex: partAndSegment.segmentIndex,\n partIndex: partAndSegment.partIndex\n };\n }\n }\n }\n return syncPoint;\n }\n},\n// Stategy \"Discontinuity\": We have a discontinuity with a known\n// display-time\n{\n name: 'Discontinuity',\n run: (syncController, playlist, duration, currentTimeline, currentTime) => {\n let syncPoint = null;\n currentTime = currentTime || 0;\n if (playlist.discontinuityStarts && playlist.discontinuityStarts.length) {\n let lastDistance = null;\n for (let i = 0; i < playlist.discontinuityStarts.length; i++) {\n const segmentIndex = playlist.discontinuityStarts[i];\n const discontinuity = playlist.discontinuitySequence + i + 1;\n const discontinuitySync = syncController.discontinuities[discontinuity];\n if (discontinuitySync) {\n const distance = Math.abs(currentTime - discontinuitySync.time); // Once the distance begins to increase, we have passed\n // currentTime and can stop looking for better candidates\n\n if (lastDistance !== null && lastDistance < distance) {\n break;\n }\n if (!syncPoint || lastDistance === null || lastDistance >= distance) {\n lastDistance = distance;\n syncPoint = {\n time: discontinuitySync.time,\n segmentIndex,\n partIndex: null\n };\n }\n }\n }\n }\n return syncPoint;\n }\n},\n// Stategy \"Playlist\": We have a playlist with a known mapping of\n// segment index to display time\n{\n name: 'Playlist',\n run: (syncController, playlist, duration, currentTimeline, currentTime) => {\n if (playlist.syncInfo) {\n const syncPoint = {\n time: playlist.syncInfo.time,\n segmentIndex: playlist.syncInfo.mediaSequence - playlist.mediaSequence,\n partIndex: null\n };\n return syncPoint;\n }\n return null;\n }\n}];\nclass SyncController extends videojs.EventTarget {\n constructor(options = {}) {\n super(); // ...for synching across variants\n\n this.timelines = [];\n this.discontinuities = [];\n this.timelineToDatetimeMappings = {};\n this.logger_ = logger('SyncController');\n }\n /**\n * Find a sync-point for the playlist specified\n *\n * A sync-point is defined as a known mapping from display-time to\n * a segment-index in the current playlist.\n *\n * @param {Playlist} playlist\n * The playlist that needs a sync-point\n * @param {number} duration\n * Duration of the MediaSource (Infinite if playing a live source)\n * @param {number} currentTimeline\n * The last timeline from which a segment was loaded\n * @return {Object}\n * A sync-point object\n */\n\n getSyncPoint(playlist, duration, currentTimeline, currentTime) {\n const syncPoints = this.runStrategies_(playlist, duration, currentTimeline, currentTime);\n if (!syncPoints.length) {\n // Signal that we need to attempt to get a sync-point manually\n // by fetching a segment in the playlist and constructing\n // a sync-point from that information\n return null;\n } // Now find the sync-point that is closest to the currentTime because\n // that should result in the most accurate guess about which segment\n // to fetch\n\n return this.selectSyncPoint_(syncPoints, {\n key: 'time',\n value: currentTime\n });\n }\n /**\n * Calculate the amount of time that has expired off the playlist during playback\n *\n * @param {Playlist} playlist\n * Playlist object to calculate expired from\n * @param {number} duration\n * Duration of the MediaSource (Infinity if playling a live source)\n * @return {number|null}\n * The amount of time that has expired off the playlist during playback. Null\n * if no sync-points for the playlist can be found.\n */\n\n getExpiredTime(playlist, duration) {\n if (!playlist || !playlist.segments) {\n return null;\n }\n const syncPoints = this.runStrategies_(playlist, duration, playlist.discontinuitySequence, 0); // Without sync-points, there is not enough information to determine the expired time\n\n if (!syncPoints.length) {\n return null;\n }\n const syncPoint = this.selectSyncPoint_(syncPoints, {\n key: 'segmentIndex',\n value: 0\n }); // If the sync-point is beyond the start of the playlist, we want to subtract the\n // duration from index 0 to syncPoint.segmentIndex instead of adding.\n\n if (syncPoint.segmentIndex > 0) {\n syncPoint.time *= -1;\n }\n return Math.abs(syncPoint.time + sumDurations({\n defaultDuration: playlist.targetDuration,\n durationList: playlist.segments,\n startIndex: syncPoint.segmentIndex,\n endIndex: 0\n }));\n }\n /**\n * Runs each sync-point strategy and returns a list of sync-points returned by the\n * strategies\n *\n * @private\n * @param {Playlist} playlist\n * The playlist that needs a sync-point\n * @param {number} duration\n * Duration of the MediaSource (Infinity if playing a live source)\n * @param {number} currentTimeline\n * The last timeline from which a segment was loaded\n * @return {Array}\n * A list of sync-point objects\n */\n\n runStrategies_(playlist, duration, currentTimeline, currentTime) {\n const syncPoints = []; // Try to find a sync-point in by utilizing various strategies...\n\n for (let i = 0; i < syncPointStrategies.length; i++) {\n const strategy = syncPointStrategies[i];\n const syncPoint = strategy.run(this, playlist, duration, currentTimeline, currentTime);\n if (syncPoint) {\n syncPoint.strategy = strategy.name;\n syncPoints.push({\n strategy: strategy.name,\n syncPoint\n });\n }\n }\n return syncPoints;\n }\n /**\n * Selects the sync-point nearest the specified target\n *\n * @private\n * @param {Array} syncPoints\n * List of sync-points to select from\n * @param {Object} target\n * Object specifying the property and value we are targeting\n * @param {string} target.key\n * Specifies the property to target. Must be either 'time' or 'segmentIndex'\n * @param {number} target.value\n * The value to target for the specified key.\n * @return {Object}\n * The sync-point nearest the target\n */\n\n selectSyncPoint_(syncPoints, target) {\n let bestSyncPoint = syncPoints[0].syncPoint;\n let bestDistance = Math.abs(syncPoints[0].syncPoint[target.key] - target.value);\n let bestStrategy = syncPoints[0].strategy;\n for (let i = 1; i < syncPoints.length; i++) {\n const newDistance = Math.abs(syncPoints[i].syncPoint[target.key] - target.value);\n if (newDistance < bestDistance) {\n bestDistance = newDistance;\n bestSyncPoint = syncPoints[i].syncPoint;\n bestStrategy = syncPoints[i].strategy;\n }\n }\n this.logger_(`syncPoint for [${target.key}: ${target.value}] chosen with strategy` + ` [${bestStrategy}]: [time:${bestSyncPoint.time},` + ` segmentIndex:${bestSyncPoint.segmentIndex}` + (typeof bestSyncPoint.partIndex === 'number' ? `,partIndex:${bestSyncPoint.partIndex}` : '') + ']');\n return bestSyncPoint;\n }\n /**\n * Save any meta-data present on the segments when segments leave\n * the live window to the playlist to allow for synchronization at the\n * playlist level later.\n *\n * @param {Playlist} oldPlaylist - The previous active playlist\n * @param {Playlist} newPlaylist - The updated and most current playlist\n */\n\n saveExpiredSegmentInfo(oldPlaylist, newPlaylist) {\n const mediaSequenceDiff = newPlaylist.mediaSequence - oldPlaylist.mediaSequence; // Ignore large media sequence gaps\n\n if (mediaSequenceDiff > MAX_MEDIA_SEQUENCE_DIFF_FOR_SYNC) {\n videojs.log.warn(`Not saving expired segment info. Media sequence gap ${mediaSequenceDiff} is too large.`);\n return;\n } // When a segment expires from the playlist and it has a start time\n // save that information as a possible sync-point reference in future\n\n for (let i = mediaSequenceDiff - 1; i >= 0; i--) {\n const lastRemovedSegment = oldPlaylist.segments[i];\n if (lastRemovedSegment && typeof lastRemovedSegment.start !== 'undefined') {\n newPlaylist.syncInfo = {\n mediaSequence: oldPlaylist.mediaSequence + i,\n time: lastRemovedSegment.start\n };\n this.logger_(`playlist refresh sync: [time:${newPlaylist.syncInfo.time},` + ` mediaSequence: ${newPlaylist.syncInfo.mediaSequence}]`);\n this.trigger('syncinfoupdate');\n break;\n }\n }\n }\n /**\n * Save the mapping from playlist's ProgramDateTime to display. This should only happen\n * before segments start to load.\n *\n * @param {Playlist} playlist - The currently active playlist\n */\n\n setDateTimeMappingForStart(playlist) {\n // It's possible for the playlist to be updated before playback starts, meaning time\n // zero is not yet set. If, during these playlist refreshes, a discontinuity is\n // crossed, then the old time zero mapping (for the prior timeline) would be retained\n // unless the mappings are cleared.\n this.timelineToDatetimeMappings = {};\n if (playlist.segments && playlist.segments.length && playlist.segments[0].dateTimeObject) {\n const firstSegment = playlist.segments[0];\n const playlistTimestamp = firstSegment.dateTimeObject.getTime() / 1000;\n this.timelineToDatetimeMappings[firstSegment.timeline] = -playlistTimestamp;\n }\n }\n /**\n * Calculates and saves timeline mappings, playlist sync info, and segment timing values\n * based on the latest timing information.\n *\n * @param {Object} options\n * Options object\n * @param {SegmentInfo} options.segmentInfo\n * The current active request information\n * @param {boolean} options.shouldSaveTimelineMapping\n * If there's a timeline change, determines if the timeline mapping should be\n * saved for timeline mapping and program date time mappings.\n */\n\n saveSegmentTimingInfo({\n segmentInfo,\n shouldSaveTimelineMapping\n }) {\n const didCalculateSegmentTimeMapping = this.calculateSegmentTimeMapping_(segmentInfo, segmentInfo.timingInfo, shouldSaveTimelineMapping);\n const segment = segmentInfo.segment;\n if (didCalculateSegmentTimeMapping) {\n this.saveDiscontinuitySyncInfo_(segmentInfo); // If the playlist does not have sync information yet, record that information\n // now with segment timing information\n\n if (!segmentInfo.playlist.syncInfo) {\n segmentInfo.playlist.syncInfo = {\n mediaSequence: segmentInfo.playlist.mediaSequence + segmentInfo.mediaIndex,\n time: segment.start\n };\n }\n }\n const dateTime = segment.dateTimeObject;\n if (segment.discontinuity && shouldSaveTimelineMapping && dateTime) {\n this.timelineToDatetimeMappings[segment.timeline] = -(dateTime.getTime() / 1000);\n }\n }\n timestampOffsetForTimeline(timeline) {\n if (typeof this.timelines[timeline] === 'undefined') {\n return null;\n }\n return this.timelines[timeline].time;\n }\n mappingForTimeline(timeline) {\n if (typeof this.timelines[timeline] === 'undefined') {\n return null;\n }\n return this.timelines[timeline].mapping;\n }\n /**\n * Use the \"media time\" for a segment to generate a mapping to \"display time\" and\n * save that display time to the segment.\n *\n * @private\n * @param {SegmentInfo} segmentInfo\n * The current active request information\n * @param {Object} timingInfo\n * The start and end time of the current segment in \"media time\"\n * @param {boolean} shouldSaveTimelineMapping\n * If there's a timeline change, determines if the timeline mapping should be\n * saved in timelines.\n * @return {boolean}\n * Returns false if segment time mapping could not be calculated\n */\n\n calculateSegmentTimeMapping_(segmentInfo, timingInfo, shouldSaveTimelineMapping) {\n // TODO: remove side effects\n const segment = segmentInfo.segment;\n const part = segmentInfo.part;\n let mappingObj = this.timelines[segmentInfo.timeline];\n let start;\n let end;\n if (typeof segmentInfo.timestampOffset === 'number') {\n mappingObj = {\n time: segmentInfo.startOfSegment,\n mapping: segmentInfo.startOfSegment - timingInfo.start\n };\n if (shouldSaveTimelineMapping) {\n this.timelines[segmentInfo.timeline] = mappingObj;\n this.trigger('timestampoffset');\n this.logger_(`time mapping for timeline ${segmentInfo.timeline}: ` + `[time: ${mappingObj.time}] [mapping: ${mappingObj.mapping}]`);\n }\n start = segmentInfo.startOfSegment;\n end = timingInfo.end + mappingObj.mapping;\n } else if (mappingObj) {\n start = timingInfo.start + mappingObj.mapping;\n end = timingInfo.end + mappingObj.mapping;\n } else {\n return false;\n }\n if (part) {\n part.start = start;\n part.end = end;\n } // If we don't have a segment start yet or the start value we got\n // is less than our current segment.start value, save a new start value.\n // We have to do this because parts will have segment timing info saved\n // multiple times and we want segment start to be the earliest part start\n // value for that segment.\n\n if (!segment.start || start < segment.start) {\n segment.start = start;\n }\n segment.end = end;\n return true;\n }\n /**\n * Each time we have discontinuity in the playlist, attempt to calculate the location\n * in display of the start of the discontinuity and save that. We also save an accuracy\n * value so that we save values with the most accuracy (closest to 0.)\n *\n * @private\n * @param {SegmentInfo} segmentInfo - The current active request information\n */\n\n saveDiscontinuitySyncInfo_(segmentInfo) {\n const playlist = segmentInfo.playlist;\n const segment = segmentInfo.segment; // If the current segment is a discontinuity then we know exactly where\n // the start of the range and it's accuracy is 0 (greater accuracy values\n // mean more approximation)\n\n if (segment.discontinuity) {\n this.discontinuities[segment.timeline] = {\n time: segment.start,\n accuracy: 0\n };\n } else if (playlist.discontinuityStarts && playlist.discontinuityStarts.length) {\n // Search for future discontinuities that we can provide better timing\n // information for and save that information for sync purposes\n for (let i = 0; i < playlist.discontinuityStarts.length; i++) {\n const segmentIndex = playlist.discontinuityStarts[i];\n const discontinuity = playlist.discontinuitySequence + i + 1;\n const mediaIndexDiff = segmentIndex - segmentInfo.mediaIndex;\n const accuracy = Math.abs(mediaIndexDiff);\n if (!this.discontinuities[discontinuity] || this.discontinuities[discontinuity].accuracy > accuracy) {\n let time;\n if (mediaIndexDiff < 0) {\n time = segment.start - sumDurations({\n defaultDuration: playlist.targetDuration,\n durationList: playlist.segments,\n startIndex: segmentInfo.mediaIndex,\n endIndex: segmentIndex\n });\n } else {\n time = segment.end + sumDurations({\n defaultDuration: playlist.targetDuration,\n durationList: playlist.segments,\n startIndex: segmentInfo.mediaIndex + 1,\n endIndex: segmentIndex\n });\n }\n this.discontinuities[discontinuity] = {\n time,\n accuracy\n };\n }\n }\n }\n }\n dispose() {\n this.trigger('dispose');\n this.off();\n }\n}\n\n/**\n * The TimelineChangeController acts as a source for segment loaders to listen for and\n * keep track of latest and pending timeline changes. This is useful to ensure proper\n * sync, as each loader may need to make a consideration for what timeline the other\n * loader is on before making changes which could impact the other loader's media.\n *\n * @class TimelineChangeController\n * @extends videojs.EventTarget\n */\n\nclass TimelineChangeController extends videojs.EventTarget {\n constructor() {\n super();\n this.pendingTimelineChanges_ = {};\n this.lastTimelineChanges_ = {};\n }\n clearPendingTimelineChange(type) {\n this.pendingTimelineChanges_[type] = null;\n this.trigger('pendingtimelinechange');\n }\n pendingTimelineChange({\n type,\n from,\n to\n }) {\n if (typeof from === 'number' && typeof to === 'number') {\n this.pendingTimelineChanges_[type] = {\n type,\n from,\n to\n };\n this.trigger('pendingtimelinechange');\n }\n return this.pendingTimelineChanges_[type];\n }\n lastTimelineChange({\n type,\n from,\n to\n }) {\n if (typeof from === 'number' && typeof to === 'number') {\n this.lastTimelineChanges_[type] = {\n type,\n from,\n to\n };\n delete this.pendingTimelineChanges_[type];\n this.trigger('timelinechange');\n }\n return this.lastTimelineChanges_[type];\n }\n dispose() {\n this.trigger('dispose');\n this.pendingTimelineChanges_ = {};\n this.lastTimelineChanges_ = {};\n this.off();\n }\n}\n\n/* rollup-plugin-worker-factory start for worker!/home/runner/work/http-streaming/http-streaming/src/decrypter-worker.js */\nconst workerCode = transform(getWorkerString(function () {\n /**\n * @file stream.js\n */\n\n /**\n * A lightweight readable stream implemention that handles event dispatching.\n *\n * @class Stream\n */\n\n var Stream = /*#__PURE__*/function () {\n function Stream() {\n this.listeners = {};\n }\n /**\n * Add a listener for a specified event type.\n *\n * @param {string} type the event name\n * @param {Function} listener the callback to be invoked when an event of\n * the specified type occurs\n */\n\n var _proto = Stream.prototype;\n _proto.on = function on(type, listener) {\n if (!this.listeners[type]) {\n this.listeners[type] = [];\n }\n this.listeners[type].push(listener);\n }\n /**\n * Remove a listener for a specified event type.\n *\n * @param {string} type the event name\n * @param {Function} listener a function previously registered for this\n * type of event through `on`\n * @return {boolean} if we could turn it off or not\n */;\n\n _proto.off = function off(type, listener) {\n if (!this.listeners[type]) {\n return false;\n }\n var index = this.listeners[type].indexOf(listener); // TODO: which is better?\n // In Video.js we slice listener functions\n // on trigger so that it does not mess up the order\n // while we loop through.\n //\n // Here we slice on off so that the loop in trigger\n // can continue using it's old reference to loop without\n // messing up the order.\n\n this.listeners[type] = this.listeners[type].slice(0);\n this.listeners[type].splice(index, 1);\n return index > -1;\n }\n /**\n * Trigger an event of the specified type on this stream. Any additional\n * arguments to this function are passed as parameters to event listeners.\n *\n * @param {string} type the event name\n */;\n\n _proto.trigger = function trigger(type) {\n var callbacks = this.listeners[type];\n if (!callbacks) {\n return;\n } // Slicing the arguments on every invocation of this method\n // can add a significant amount of overhead. Avoid the\n // intermediate object creation for the common case of a\n // single callback argument\n\n if (arguments.length === 2) {\n var length = callbacks.length;\n for (var i = 0; i < length; ++i) {\n callbacks[i].call(this, arguments[1]);\n }\n } else {\n var args = Array.prototype.slice.call(arguments, 1);\n var _length = callbacks.length;\n for (var _i = 0; _i < _length; ++_i) {\n callbacks[_i].apply(this, args);\n }\n }\n }\n /**\n * Destroys the stream and cleans up.\n */;\n\n _proto.dispose = function dispose() {\n this.listeners = {};\n }\n /**\n * Forwards all `data` events on this stream to the destination stream. The\n * destination stream should provide a method `push` to receive the data\n * events as they arrive.\n *\n * @param {Stream} destination the stream that will receive all `data` events\n * @see http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options\n */;\n\n _proto.pipe = function pipe(destination) {\n this.on('data', function (data) {\n destination.push(data);\n });\n };\n return Stream;\n }();\n /*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */\n\n /**\n * Returns the subarray of a Uint8Array without PKCS#7 padding.\n *\n * @param padded {Uint8Array} unencrypted bytes that have been padded\n * @return {Uint8Array} the unpadded bytes\n * @see http://tools.ietf.org/html/rfc5652\n */\n\n function unpad(padded) {\n return padded.subarray(0, padded.byteLength - padded[padded.byteLength - 1]);\n }\n /*! @name aes-decrypter @version 4.0.1 @license Apache-2.0 */\n\n /**\n * @file aes.js\n *\n * This file contains an adaptation of the AES decryption algorithm\n * from the Standford Javascript Cryptography Library. That work is\n * covered by the following copyright and permissions notice:\n *\n * Copyright 2009-2010 Emily Stark, Mike Hamburg, Dan Boneh.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation\n * are those of the authors and should not be interpreted as representing\n * official policies, either expressed or implied, of the authors.\n */\n\n /**\n * Expand the S-box tables.\n *\n * @private\n */\n\n const precompute = function () {\n const tables = [[[], [], [], [], []], [[], [], [], [], []]];\n const encTable = tables[0];\n const decTable = tables[1];\n const sbox = encTable[4];\n const sboxInv = decTable[4];\n let i;\n let x;\n let xInv;\n const d = [];\n const th = [];\n let x2;\n let x4;\n let x8;\n let s;\n let tEnc;\n let tDec; // Compute double and third tables\n\n for (i = 0; i < 256; i++) {\n th[(d[i] = i << 1 ^ (i >> 7) * 283) ^ i] = i;\n }\n for (x = xInv = 0; !sbox[x]; x ^= x2 || 1, xInv = th[xInv] || 1) {\n // Compute sbox\n s = xInv ^ xInv << 1 ^ xInv << 2 ^ xInv << 3 ^ xInv << 4;\n s = s >> 8 ^ s & 255 ^ 99;\n sbox[x] = s;\n sboxInv[s] = x; // Compute MixColumns\n\n x8 = d[x4 = d[x2 = d[x]]];\n tDec = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;\n tEnc = d[s] * 0x101 ^ s * 0x1010100;\n for (i = 0; i < 4; i++) {\n encTable[i][x] = tEnc = tEnc << 24 ^ tEnc >>> 8;\n decTable[i][s] = tDec = tDec << 24 ^ tDec >>> 8;\n }\n } // Compactify. Considerable speedup on Firefox.\n\n for (i = 0; i < 5; i++) {\n encTable[i] = encTable[i].slice(0);\n decTable[i] = decTable[i].slice(0);\n }\n return tables;\n };\n let aesTables = null;\n /**\n * Schedule out an AES key for both encryption and decryption. This\n * is a low-level class. Use a cipher mode to do bulk encryption.\n *\n * @class AES\n * @param key {Array} The key as an array of 4, 6 or 8 words.\n */\n\n class AES {\n constructor(key) {\n /**\n * The expanded S-box and inverse S-box tables. These will be computed\n * on the client so that we don't have to send them down the wire.\n *\n * There are two tables, _tables[0] is for encryption and\n * _tables[1] is for decryption.\n *\n * The first 4 sub-tables are the expanded S-box with MixColumns. The\n * last (_tables[01][4]) is the S-box itself.\n *\n * @private\n */\n // if we have yet to precompute the S-box tables\n // do so now\n if (!aesTables) {\n aesTables = precompute();\n } // then make a copy of that object for use\n\n this._tables = [[aesTables[0][0].slice(), aesTables[0][1].slice(), aesTables[0][2].slice(), aesTables[0][3].slice(), aesTables[0][4].slice()], [aesTables[1][0].slice(), aesTables[1][1].slice(), aesTables[1][2].slice(), aesTables[1][3].slice(), aesTables[1][4].slice()]];\n let i;\n let j;\n let tmp;\n const sbox = this._tables[0][4];\n const decTable = this._tables[1];\n const keyLen = key.length;\n let rcon = 1;\n if (keyLen !== 4 && keyLen !== 6 && keyLen !== 8) {\n throw new Error('Invalid aes key size');\n }\n const encKey = key.slice(0);\n const decKey = [];\n this._key = [encKey, decKey]; // schedule encryption keys\n\n for (i = keyLen; i < 4 * keyLen + 28; i++) {\n tmp = encKey[i - 1]; // apply sbox\n\n if (i % keyLen === 0 || keyLen === 8 && i % keyLen === 4) {\n tmp = sbox[tmp >>> 24] << 24 ^ sbox[tmp >> 16 & 255] << 16 ^ sbox[tmp >> 8 & 255] << 8 ^ sbox[tmp & 255]; // shift rows and add rcon\n\n if (i % keyLen === 0) {\n tmp = tmp << 8 ^ tmp >>> 24 ^ rcon << 24;\n rcon = rcon << 1 ^ (rcon >> 7) * 283;\n }\n }\n encKey[i] = encKey[i - keyLen] ^ tmp;\n } // schedule decryption keys\n\n for (j = 0; i; j++, i--) {\n tmp = encKey[j & 3 ? i : i - 4];\n if (i <= 4 || j < 4) {\n decKey[j] = tmp;\n } else {\n decKey[j] = decTable[0][sbox[tmp >>> 24]] ^ decTable[1][sbox[tmp >> 16 & 255]] ^ decTable[2][sbox[tmp >> 8 & 255]] ^ decTable[3][sbox[tmp & 255]];\n }\n }\n }\n /**\n * Decrypt 16 bytes, specified as four 32-bit words.\n *\n * @param {number} encrypted0 the first word to decrypt\n * @param {number} encrypted1 the second word to decrypt\n * @param {number} encrypted2 the third word to decrypt\n * @param {number} encrypted3 the fourth word to decrypt\n * @param {Int32Array} out the array to write the decrypted words\n * into\n * @param {number} offset the offset into the output array to start\n * writing results\n * @return {Array} The plaintext.\n */\n\n decrypt(encrypted0, encrypted1, encrypted2, encrypted3, out, offset) {\n const key = this._key[1]; // state variables a,b,c,d are loaded with pre-whitened data\n\n let a = encrypted0 ^ key[0];\n let b = encrypted3 ^ key[1];\n let c = encrypted2 ^ key[2];\n let d = encrypted1 ^ key[3];\n let a2;\n let b2;\n let c2; // key.length === 2 ?\n\n const nInnerRounds = key.length / 4 - 2;\n let i;\n let kIndex = 4;\n const table = this._tables[1]; // load up the tables\n\n const table0 = table[0];\n const table1 = table[1];\n const table2 = table[2];\n const table3 = table[3];\n const sbox = table[4]; // Inner rounds. Cribbed from OpenSSL.\n\n for (i = 0; i < nInnerRounds; i++) {\n a2 = table0[a >>> 24] ^ table1[b >> 16 & 255] ^ table2[c >> 8 & 255] ^ table3[d & 255] ^ key[kIndex];\n b2 = table0[b >>> 24] ^ table1[c >> 16 & 255] ^ table2[d >> 8 & 255] ^ table3[a & 255] ^ key[kIndex + 1];\n c2 = table0[c >>> 24] ^ table1[d >> 16 & 255] ^ table2[a >> 8 & 255] ^ table3[b & 255] ^ key[kIndex + 2];\n d = table0[d >>> 24] ^ table1[a >> 16 & 255] ^ table2[b >> 8 & 255] ^ table3[c & 255] ^ key[kIndex + 3];\n kIndex += 4;\n a = a2;\n b = b2;\n c = c2;\n } // Last round.\n\n for (i = 0; i < 4; i++) {\n out[(3 & -i) + offset] = sbox[a >>> 24] << 24 ^ sbox[b >> 16 & 255] << 16 ^ sbox[c >> 8 & 255] << 8 ^ sbox[d & 255] ^ key[kIndex++];\n a2 = a;\n a = b;\n b = c;\n c = d;\n d = a2;\n }\n }\n }\n /**\n * @file async-stream.js\n */\n\n /**\n * A wrapper around the Stream class to use setTimeout\n * and run stream \"jobs\" Asynchronously\n *\n * @class AsyncStream\n * @extends Stream\n */\n\n class AsyncStream extends Stream {\n constructor() {\n super(Stream);\n this.jobs = [];\n this.delay = 1;\n this.timeout_ = null;\n }\n /**\n * process an async job\n *\n * @private\n */\n\n processJob_() {\n this.jobs.shift()();\n if (this.jobs.length) {\n this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);\n } else {\n this.timeout_ = null;\n }\n }\n /**\n * push a job into the stream\n *\n * @param {Function} job the job to push into the stream\n */\n\n push(job) {\n this.jobs.push(job);\n if (!this.timeout_) {\n this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);\n }\n }\n }\n /**\n * @file decrypter.js\n *\n * An asynchronous implementation of AES-128 CBC decryption with\n * PKCS#7 padding.\n */\n\n /**\n * Convert network-order (big-endian) bytes into their little-endian\n * representation.\n */\n\n const ntoh = function (word) {\n return word << 24 | (word & 0xff00) << 8 | (word & 0xff0000) >> 8 | word >>> 24;\n };\n /**\n * Decrypt bytes using AES-128 with CBC and PKCS#7 padding.\n *\n * @param {Uint8Array} encrypted the encrypted bytes\n * @param {Uint32Array} key the bytes of the decryption key\n * @param {Uint32Array} initVector the initialization vector (IV) to\n * use for the first round of CBC.\n * @return {Uint8Array} the decrypted bytes\n *\n * @see http://en.wikipedia.org/wiki/Advanced_Encryption_Standard\n * @see http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Cipher_Block_Chaining_.28CBC.29\n * @see https://tools.ietf.org/html/rfc2315\n */\n\n const decrypt = function (encrypted, key, initVector) {\n // word-level access to the encrypted bytes\n const encrypted32 = new Int32Array(encrypted.buffer, encrypted.byteOffset, encrypted.byteLength >> 2);\n const decipher = new AES(Array.prototype.slice.call(key)); // byte and word-level access for the decrypted output\n\n const decrypted = new Uint8Array(encrypted.byteLength);\n const decrypted32 = new Int32Array(decrypted.buffer); // temporary variables for working with the IV, encrypted, and\n // decrypted data\n\n let init0;\n let init1;\n let init2;\n let init3;\n let encrypted0;\n let encrypted1;\n let encrypted2;\n let encrypted3; // iteration variable\n\n let wordIx; // pull out the words of the IV to ensure we don't modify the\n // passed-in reference and easier access\n\n init0 = initVector[0];\n init1 = initVector[1];\n init2 = initVector[2];\n init3 = initVector[3]; // decrypt four word sequences, applying cipher-block chaining (CBC)\n // to each decrypted block\n\n for (wordIx = 0; wordIx < encrypted32.length; wordIx += 4) {\n // convert big-endian (network order) words into little-endian\n // (javascript order)\n encrypted0 = ntoh(encrypted32[wordIx]);\n encrypted1 = ntoh(encrypted32[wordIx + 1]);\n encrypted2 = ntoh(encrypted32[wordIx + 2]);\n encrypted3 = ntoh(encrypted32[wordIx + 3]); // decrypt the block\n\n decipher.decrypt(encrypted0, encrypted1, encrypted2, encrypted3, decrypted32, wordIx); // XOR with the IV, and restore network byte-order to obtain the\n // plaintext\n\n decrypted32[wordIx] = ntoh(decrypted32[wordIx] ^ init0);\n decrypted32[wordIx + 1] = ntoh(decrypted32[wordIx + 1] ^ init1);\n decrypted32[wordIx + 2] = ntoh(decrypted32[wordIx + 2] ^ init2);\n decrypted32[wordIx + 3] = ntoh(decrypted32[wordIx + 3] ^ init3); // setup the IV for the next round\n\n init0 = encrypted0;\n init1 = encrypted1;\n init2 = encrypted2;\n init3 = encrypted3;\n }\n return decrypted;\n };\n /**\n * The `Decrypter` class that manages decryption of AES\n * data through `AsyncStream` objects and the `decrypt`\n * function\n *\n * @param {Uint8Array} encrypted the encrypted bytes\n * @param {Uint32Array} key the bytes of the decryption key\n * @param {Uint32Array} initVector the initialization vector (IV) to\n * @param {Function} done the function to run when done\n * @class Decrypter\n */\n\n class Decrypter {\n constructor(encrypted, key, initVector, done) {\n const step = Decrypter.STEP;\n const encrypted32 = new Int32Array(encrypted.buffer);\n const decrypted = new Uint8Array(encrypted.byteLength);\n let i = 0;\n this.asyncStream_ = new AsyncStream(); // split up the encryption job and do the individual chunks asynchronously\n\n this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i, i + step), key, initVector, decrypted));\n for (i = step; i < encrypted32.length; i += step) {\n initVector = new Uint32Array([ntoh(encrypted32[i - 4]), ntoh(encrypted32[i - 3]), ntoh(encrypted32[i - 2]), ntoh(encrypted32[i - 1])]);\n this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i, i + step), key, initVector, decrypted));\n } // invoke the done() callback when everything is finished\n\n this.asyncStream_.push(function () {\n // remove pkcs#7 padding from the decrypted bytes\n done(null, unpad(decrypted));\n });\n }\n /**\n * a getter for step the maximum number of bytes to process at one time\n *\n * @return {number} the value of step 32000\n */\n\n static get STEP() {\n // 4 * 8000;\n return 32000;\n }\n /**\n * @private\n */\n\n decryptChunk_(encrypted, key, initVector, decrypted) {\n return function () {\n const bytes = decrypt(encrypted, key, initVector);\n decrypted.set(bytes, encrypted.byteOffset);\n };\n }\n }\n var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n var win;\n if (typeof window !== \"undefined\") {\n win = window;\n } else if (typeof commonjsGlobal !== \"undefined\") {\n win = commonjsGlobal;\n } else if (typeof self !== \"undefined\") {\n win = self;\n } else {\n win = {};\n }\n var window_1 = win;\n var isArrayBufferView = function isArrayBufferView(obj) {\n if (ArrayBuffer.isView === 'function') {\n return ArrayBuffer.isView(obj);\n }\n return obj && obj.buffer instanceof ArrayBuffer;\n };\n var BigInt = window_1.BigInt || Number;\n [BigInt('0x1'), BigInt('0x100'), BigInt('0x10000'), BigInt('0x1000000'), BigInt('0x100000000'), BigInt('0x10000000000'), BigInt('0x1000000000000'), BigInt('0x100000000000000'), BigInt('0x10000000000000000')];\n (function () {\n var a = new Uint16Array([0xFFCC]);\n var b = new Uint8Array(a.buffer, a.byteOffset, a.byteLength);\n if (b[0] === 0xFF) {\n return 'big';\n }\n if (b[0] === 0xCC) {\n return 'little';\n }\n return 'unknown';\n })();\n /**\n * Creates an object for sending to a web worker modifying properties that are TypedArrays\n * into a new object with seperated properties for the buffer, byteOffset, and byteLength.\n *\n * @param {Object} message\n * Object of properties and values to send to the web worker\n * @return {Object}\n * Modified message with TypedArray values expanded\n * @function createTransferableMessage\n */\n\n const createTransferableMessage = function (message) {\n const transferable = {};\n Object.keys(message).forEach(key => {\n const value = message[key];\n if (isArrayBufferView(value)) {\n transferable[key] = {\n bytes: value.buffer,\n byteOffset: value.byteOffset,\n byteLength: value.byteLength\n };\n } else {\n transferable[key] = value;\n }\n });\n return transferable;\n };\n /* global self */\n\n /**\n * Our web worker interface so that things can talk to aes-decrypter\n * that will be running in a web worker. the scope is passed to this by\n * webworkify.\n */\n\n self.onmessage = function (event) {\n const data = event.data;\n const encrypted = new Uint8Array(data.encrypted.bytes, data.encrypted.byteOffset, data.encrypted.byteLength);\n const key = new Uint32Array(data.key.bytes, data.key.byteOffset, data.key.byteLength / 4);\n const iv = new Uint32Array(data.iv.bytes, data.iv.byteOffset, data.iv.byteLength / 4);\n /* eslint-disable no-new, handle-callback-err */\n\n new Decrypter(encrypted, key, iv, function (err, bytes) {\n self.postMessage(createTransferableMessage({\n source: data.source,\n decrypted: bytes\n }), [bytes.buffer]);\n });\n /* eslint-enable */\n };\n}));\n\nvar Decrypter = factory(workerCode);\n/* rollup-plugin-worker-factory end for worker!/home/runner/work/http-streaming/http-streaming/src/decrypter-worker.js */\n\n/**\n * Convert the properties of an HLS track into an audioTrackKind.\n *\n * @private\n */\n\nconst audioTrackKind_ = properties => {\n let kind = properties.default ? 'main' : 'alternative';\n if (properties.characteristics && properties.characteristics.indexOf('public.accessibility.describes-video') >= 0) {\n kind = 'main-desc';\n }\n return kind;\n};\n/**\n * Pause provided segment loader and playlist loader if active\n *\n * @param {SegmentLoader} segmentLoader\n * SegmentLoader to pause\n * @param {Object} mediaType\n * Active media type\n * @function stopLoaders\n */\n\nconst stopLoaders = (segmentLoader, mediaType) => {\n segmentLoader.abort();\n segmentLoader.pause();\n if (mediaType && mediaType.activePlaylistLoader) {\n mediaType.activePlaylistLoader.pause();\n mediaType.activePlaylistLoader = null;\n }\n};\n/**\n * Start loading provided segment loader and playlist loader\n *\n * @param {PlaylistLoader} playlistLoader\n * PlaylistLoader to start loading\n * @param {Object} mediaType\n * Active media type\n * @function startLoaders\n */\n\nconst startLoaders = (playlistLoader, mediaType) => {\n // Segment loader will be started after `loadedmetadata` or `loadedplaylist` from the\n // playlist loader\n mediaType.activePlaylistLoader = playlistLoader;\n playlistLoader.load();\n};\n/**\n * Returns a function to be called when the media group changes. It performs a\n * non-destructive (preserve the buffer) resync of the SegmentLoader. This is because a\n * change of group is merely a rendition switch of the same content at another encoding,\n * rather than a change of content, such as switching audio from English to Spanish.\n *\n * @param {string} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @return {Function}\n * Handler for a non-destructive resync of SegmentLoader when the active media\n * group changes.\n * @function onGroupChanged\n */\n\nconst onGroupChanged = (type, settings) => () => {\n const {\n segmentLoaders: {\n [type]: segmentLoader,\n main: mainSegmentLoader\n },\n mediaTypes: {\n [type]: mediaType\n }\n } = settings;\n const activeTrack = mediaType.activeTrack();\n const activeGroup = mediaType.getActiveGroup();\n const previousActiveLoader = mediaType.activePlaylistLoader;\n const lastGroup = mediaType.lastGroup_; // the group did not change do nothing\n\n if (activeGroup && lastGroup && activeGroup.id === lastGroup.id) {\n return;\n }\n mediaType.lastGroup_ = activeGroup;\n mediaType.lastTrack_ = activeTrack;\n stopLoaders(segmentLoader, mediaType);\n if (!activeGroup || activeGroup.isMainPlaylist) {\n // there is no group active or active group is a main playlist and won't change\n return;\n }\n if (!activeGroup.playlistLoader) {\n if (previousActiveLoader) {\n // The previous group had a playlist loader but the new active group does not\n // this means we are switching from demuxed to muxed audio. In this case we want to\n // do a destructive reset of the main segment loader and not restart the audio\n // loaders.\n mainSegmentLoader.resetEverything();\n }\n return;\n } // Non-destructive resync\n\n segmentLoader.resyncLoader();\n startLoaders(activeGroup.playlistLoader, mediaType);\n};\nconst onGroupChanging = (type, settings) => () => {\n const {\n segmentLoaders: {\n [type]: segmentLoader\n },\n mediaTypes: {\n [type]: mediaType\n }\n } = settings;\n mediaType.lastGroup_ = null;\n segmentLoader.abort();\n segmentLoader.pause();\n};\n/**\n * Returns a function to be called when the media track changes. It performs a\n * destructive reset of the SegmentLoader to ensure we start loading as close to\n * currentTime as possible.\n *\n * @param {string} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @return {Function}\n * Handler for a destructive reset of SegmentLoader when the active media\n * track changes.\n * @function onTrackChanged\n */\n\nconst onTrackChanged = (type, settings) => () => {\n const {\n mainPlaylistLoader,\n segmentLoaders: {\n [type]: segmentLoader,\n main: mainSegmentLoader\n },\n mediaTypes: {\n [type]: mediaType\n }\n } = settings;\n const activeTrack = mediaType.activeTrack();\n const activeGroup = mediaType.getActiveGroup();\n const previousActiveLoader = mediaType.activePlaylistLoader;\n const lastTrack = mediaType.lastTrack_; // track did not change, do nothing\n\n if (lastTrack && activeTrack && lastTrack.id === activeTrack.id) {\n return;\n }\n mediaType.lastGroup_ = activeGroup;\n mediaType.lastTrack_ = activeTrack;\n stopLoaders(segmentLoader, mediaType);\n if (!activeGroup) {\n // there is no group active so we do not want to restart loaders\n return;\n }\n if (activeGroup.isMainPlaylist) {\n // track did not change, do nothing\n if (!activeTrack || !lastTrack || activeTrack.id === lastTrack.id) {\n return;\n }\n const pc = settings.vhs.playlistController_;\n const newPlaylist = pc.selectPlaylist(); // media will not change do nothing\n\n if (pc.media() === newPlaylist) {\n return;\n }\n mediaType.logger_(`track change. Switching main audio from ${lastTrack.id} to ${activeTrack.id}`);\n mainPlaylistLoader.pause();\n mainSegmentLoader.resetEverything();\n pc.fastQualityChange_(newPlaylist);\n return;\n }\n if (type === 'AUDIO') {\n if (!activeGroup.playlistLoader) {\n // when switching from demuxed audio/video to muxed audio/video (noted by no\n // playlist loader for the audio group), we want to do a destructive reset of the\n // main segment loader and not restart the audio loaders\n mainSegmentLoader.setAudio(true); // don't have to worry about disabling the audio of the audio segment loader since\n // it should be stopped\n\n mainSegmentLoader.resetEverything();\n return;\n } // although the segment loader is an audio segment loader, call the setAudio\n // function to ensure it is prepared to re-append the init segment (or handle other\n // config changes)\n\n segmentLoader.setAudio(true);\n mainSegmentLoader.setAudio(false);\n }\n if (previousActiveLoader === activeGroup.playlistLoader) {\n // Nothing has actually changed. This can happen because track change events can fire\n // multiple times for a \"single\" change. One for enabling the new active track, and\n // one for disabling the track that was active\n startLoaders(activeGroup.playlistLoader, mediaType);\n return;\n }\n if (segmentLoader.track) {\n // For WebVTT, set the new text track in the segmentloader\n segmentLoader.track(activeTrack);\n } // destructive reset\n\n segmentLoader.resetEverything();\n startLoaders(activeGroup.playlistLoader, mediaType);\n};\nconst onError = {\n /**\n * Returns a function to be called when a SegmentLoader or PlaylistLoader encounters\n * an error.\n *\n * @param {string} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @return {Function}\n * Error handler. Logs warning (or error if the playlist is excluded) to\n * console and switches back to default audio track.\n * @function onError.AUDIO\n */\n AUDIO: (type, settings) => () => {\n const {\n mediaTypes: {\n [type]: mediaType\n },\n excludePlaylist\n } = settings; // switch back to default audio track\n\n const activeTrack = mediaType.activeTrack();\n const activeGroup = mediaType.activeGroup();\n const id = (activeGroup.filter(group => group.default)[0] || activeGroup[0]).id;\n const defaultTrack = mediaType.tracks[id];\n if (activeTrack === defaultTrack) {\n // Default track encountered an error. All we can do now is exclude the current\n // rendition and hope another will switch audio groups\n excludePlaylist({\n error: {\n message: 'Problem encountered loading the default audio track.'\n }\n });\n return;\n }\n videojs.log.warn('Problem encountered loading the alternate audio track.' + 'Switching back to default.');\n for (const trackId in mediaType.tracks) {\n mediaType.tracks[trackId].enabled = mediaType.tracks[trackId] === defaultTrack;\n }\n mediaType.onTrackChanged();\n },\n /**\n * Returns a function to be called when a SegmentLoader or PlaylistLoader encounters\n * an error.\n *\n * @param {string} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @return {Function}\n * Error handler. Logs warning to console and disables the active subtitle track\n * @function onError.SUBTITLES\n */\n SUBTITLES: (type, settings) => () => {\n const {\n mediaTypes: {\n [type]: mediaType\n }\n } = settings;\n videojs.log.warn('Problem encountered loading the subtitle track.' + 'Disabling subtitle track.');\n const track = mediaType.activeTrack();\n if (track) {\n track.mode = 'disabled';\n }\n mediaType.onTrackChanged();\n }\n};\nconst setupListeners = {\n /**\n * Setup event listeners for audio playlist loader\n *\n * @param {string} type\n * MediaGroup type\n * @param {PlaylistLoader|null} playlistLoader\n * PlaylistLoader to register listeners on\n * @param {Object} settings\n * Object containing required information for media groups\n * @function setupListeners.AUDIO\n */\n AUDIO: (type, playlistLoader, settings) => {\n if (!playlistLoader) {\n // no playlist loader means audio will be muxed with the video\n return;\n }\n const {\n tech,\n requestOptions,\n segmentLoaders: {\n [type]: segmentLoader\n }\n } = settings;\n playlistLoader.on('loadedmetadata', () => {\n const media = playlistLoader.media();\n segmentLoader.playlist(media, requestOptions); // if the video is already playing, or if this isn't a live video and preload\n // permits, start downloading segments\n\n if (!tech.paused() || media.endList && tech.preload() !== 'none') {\n segmentLoader.load();\n }\n });\n playlistLoader.on('loadedplaylist', () => {\n segmentLoader.playlist(playlistLoader.media(), requestOptions); // If the player isn't paused, ensure that the segment loader is running\n\n if (!tech.paused()) {\n segmentLoader.load();\n }\n });\n playlistLoader.on('error', onError[type](type, settings));\n },\n /**\n * Setup event listeners for subtitle playlist loader\n *\n * @param {string} type\n * MediaGroup type\n * @param {PlaylistLoader|null} playlistLoader\n * PlaylistLoader to register listeners on\n * @param {Object} settings\n * Object containing required information for media groups\n * @function setupListeners.SUBTITLES\n */\n SUBTITLES: (type, playlistLoader, settings) => {\n const {\n tech,\n requestOptions,\n segmentLoaders: {\n [type]: segmentLoader\n },\n mediaTypes: {\n [type]: mediaType\n }\n } = settings;\n playlistLoader.on('loadedmetadata', () => {\n const media = playlistLoader.media();\n segmentLoader.playlist(media, requestOptions);\n segmentLoader.track(mediaType.activeTrack()); // if the video is already playing, or if this isn't a live video and preload\n // permits, start downloading segments\n\n if (!tech.paused() || media.endList && tech.preload() !== 'none') {\n segmentLoader.load();\n }\n });\n playlistLoader.on('loadedplaylist', () => {\n segmentLoader.playlist(playlistLoader.media(), requestOptions); // If the player isn't paused, ensure that the segment loader is running\n\n if (!tech.paused()) {\n segmentLoader.load();\n }\n });\n playlistLoader.on('error', onError[type](type, settings));\n }\n};\nconst initialize = {\n /**\n * Setup PlaylistLoaders and AudioTracks for the audio groups\n *\n * @param {string} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @function initialize.AUDIO\n */\n 'AUDIO': (type, settings) => {\n const {\n vhs,\n sourceType,\n segmentLoaders: {\n [type]: segmentLoader\n },\n requestOptions,\n main: {\n mediaGroups\n },\n mediaTypes: {\n [type]: {\n groups,\n tracks,\n logger_\n }\n },\n mainPlaylistLoader\n } = settings;\n const audioOnlyMain = isAudioOnly(mainPlaylistLoader.main); // force a default if we have none\n\n if (!mediaGroups[type] || Object.keys(mediaGroups[type]).length === 0) {\n mediaGroups[type] = {\n main: {\n default: {\n default: true\n }\n }\n };\n if (audioOnlyMain) {\n mediaGroups[type].main.default.playlists = mainPlaylistLoader.main.playlists;\n }\n }\n for (const groupId in mediaGroups[type]) {\n if (!groups[groupId]) {\n groups[groupId] = [];\n }\n for (const variantLabel in mediaGroups[type][groupId]) {\n let properties = mediaGroups[type][groupId][variantLabel];\n let playlistLoader;\n if (audioOnlyMain) {\n logger_(`AUDIO group '${groupId}' label '${variantLabel}' is a main playlist`);\n properties.isMainPlaylist = true;\n playlistLoader = null; // if vhs-json was provided as the source, and the media playlist was resolved,\n // use the resolved media playlist object\n } else if (sourceType === 'vhs-json' && properties.playlists) {\n playlistLoader = new PlaylistLoader(properties.playlists[0], vhs, requestOptions);\n } else if (properties.resolvedUri) {\n playlistLoader = new PlaylistLoader(properties.resolvedUri, vhs, requestOptions); // TODO: dash isn't the only type with properties.playlists\n // should we even have properties.playlists in this check.\n } else if (properties.playlists && sourceType === 'dash') {\n playlistLoader = new DashPlaylistLoader(properties.playlists[0], vhs, requestOptions, mainPlaylistLoader);\n } else {\n // no resolvedUri means the audio is muxed with the video when using this\n // audio track\n playlistLoader = null;\n }\n properties = merge({\n id: variantLabel,\n playlistLoader\n }, properties);\n setupListeners[type](type, properties.playlistLoader, settings);\n groups[groupId].push(properties);\n if (typeof tracks[variantLabel] === 'undefined') {\n const track = new videojs.AudioTrack({\n id: variantLabel,\n kind: audioTrackKind_(properties),\n enabled: false,\n language: properties.language,\n default: properties.default,\n label: variantLabel\n });\n tracks[variantLabel] = track;\n }\n }\n } // setup single error event handler for the segment loader\n\n segmentLoader.on('error', onError[type](type, settings));\n },\n /**\n * Setup PlaylistLoaders and TextTracks for the subtitle groups\n *\n * @param {string} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @function initialize.SUBTITLES\n */\n 'SUBTITLES': (type, settings) => {\n const {\n tech,\n vhs,\n sourceType,\n segmentLoaders: {\n [type]: segmentLoader\n },\n requestOptions,\n main: {\n mediaGroups\n },\n mediaTypes: {\n [type]: {\n groups,\n tracks\n }\n },\n mainPlaylistLoader\n } = settings;\n for (const groupId in mediaGroups[type]) {\n if (!groups[groupId]) {\n groups[groupId] = [];\n }\n for (const variantLabel in mediaGroups[type][groupId]) {\n if (!vhs.options_.useForcedSubtitles && mediaGroups[type][groupId][variantLabel].forced) {\n // Subtitle playlists with the forced attribute are not selectable in Safari.\n // According to Apple's HLS Authoring Specification:\n // If content has forced subtitles and regular subtitles in a given language,\n // the regular subtitles track in that language MUST contain both the forced\n // subtitles and the regular subtitles for that language.\n // Because of this requirement and that Safari does not add forced subtitles,\n // forced subtitles are skipped here to maintain consistent experience across\n // all platforms\n continue;\n }\n let properties = mediaGroups[type][groupId][variantLabel];\n let playlistLoader;\n if (sourceType === 'hls') {\n playlistLoader = new PlaylistLoader(properties.resolvedUri, vhs, requestOptions);\n } else if (sourceType === 'dash') {\n const playlists = properties.playlists.filter(p => p.excludeUntil !== Infinity);\n if (!playlists.length) {\n return;\n }\n playlistLoader = new DashPlaylistLoader(properties.playlists[0], vhs, requestOptions, mainPlaylistLoader);\n } else if (sourceType === 'vhs-json') {\n playlistLoader = new PlaylistLoader(\n // if the vhs-json object included the media playlist, use the media playlist\n // as provided, otherwise use the resolved URI to load the playlist\n properties.playlists ? properties.playlists[0] : properties.resolvedUri, vhs, requestOptions);\n }\n properties = merge({\n id: variantLabel,\n playlistLoader\n }, properties);\n setupListeners[type](type, properties.playlistLoader, settings);\n groups[groupId].push(properties);\n if (typeof tracks[variantLabel] === 'undefined') {\n const track = tech.addRemoteTextTrack({\n id: variantLabel,\n kind: 'subtitles',\n default: properties.default && properties.autoselect,\n language: properties.language,\n label: variantLabel\n }, false).track;\n tracks[variantLabel] = track;\n }\n }\n } // setup single error event handler for the segment loader\n\n segmentLoader.on('error', onError[type](type, settings));\n },\n /**\n * Setup TextTracks for the closed-caption groups\n *\n * @param {String} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @function initialize['CLOSED-CAPTIONS']\n */\n 'CLOSED-CAPTIONS': (type, settings) => {\n const {\n tech,\n main: {\n mediaGroups\n },\n mediaTypes: {\n [type]: {\n groups,\n tracks\n }\n }\n } = settings;\n for (const groupId in mediaGroups[type]) {\n if (!groups[groupId]) {\n groups[groupId] = [];\n }\n for (const variantLabel in mediaGroups[type][groupId]) {\n const properties = mediaGroups[type][groupId][variantLabel]; // Look for either 608 (CCn) or 708 (SERVICEn) caption services\n\n if (!/^(?:CC|SERVICE)/.test(properties.instreamId)) {\n continue;\n }\n const captionServices = tech.options_.vhs && tech.options_.vhs.captionServices || {};\n let newProps = {\n label: variantLabel,\n language: properties.language,\n instreamId: properties.instreamId,\n default: properties.default && properties.autoselect\n };\n if (captionServices[newProps.instreamId]) {\n newProps = merge(newProps, captionServices[newProps.instreamId]);\n }\n if (newProps.default === undefined) {\n delete newProps.default;\n } // No PlaylistLoader is required for Closed-Captions because the captions are\n // embedded within the video stream\n\n groups[groupId].push(merge({\n id: variantLabel\n }, properties));\n if (typeof tracks[variantLabel] === 'undefined') {\n const track = tech.addRemoteTextTrack({\n id: newProps.instreamId,\n kind: 'captions',\n default: newProps.default,\n language: newProps.language,\n label: newProps.label\n }, false).track;\n tracks[variantLabel] = track;\n }\n }\n }\n }\n};\nconst groupMatch = (list, media) => {\n for (let i = 0; i < list.length; i++) {\n if (playlistMatch(media, list[i])) {\n return true;\n }\n if (list[i].playlists && groupMatch(list[i].playlists, media)) {\n return true;\n }\n }\n return false;\n};\n/**\n * Returns a function used to get the active group of the provided type\n *\n * @param {string} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @return {Function}\n * Function that returns the active media group for the provided type. Takes an\n * optional parameter {TextTrack} track. If no track is provided, a list of all\n * variants in the group, otherwise the variant corresponding to the provided\n * track is returned.\n * @function activeGroup\n */\n\nconst activeGroup = (type, settings) => track => {\n const {\n mainPlaylistLoader,\n mediaTypes: {\n [type]: {\n groups\n }\n }\n } = settings;\n const media = mainPlaylistLoader.media();\n if (!media) {\n return null;\n }\n let variants = null; // set to variants to main media active group\n\n if (media.attributes[type]) {\n variants = groups[media.attributes[type]];\n }\n const groupKeys = Object.keys(groups);\n if (!variants) {\n // find the mainPlaylistLoader media\n // that is in a media group if we are dealing\n // with audio only\n if (type === 'AUDIO' && groupKeys.length > 1 && isAudioOnly(settings.main)) {\n for (let i = 0; i < groupKeys.length; i++) {\n const groupPropertyList = groups[groupKeys[i]];\n if (groupMatch(groupPropertyList, media)) {\n variants = groupPropertyList;\n break;\n }\n } // use the main group if it exists\n } else if (groups.main) {\n variants = groups.main; // only one group, use that one\n } else if (groupKeys.length === 1) {\n variants = groups[groupKeys[0]];\n }\n }\n if (typeof track === 'undefined') {\n return variants;\n }\n if (track === null || !variants) {\n // An active track was specified so a corresponding group is expected. track === null\n // means no track is currently active so there is no corresponding group\n return null;\n }\n return variants.filter(props => props.id === track.id)[0] || null;\n};\nconst activeTrack = {\n /**\n * Returns a function used to get the active track of type provided\n *\n * @param {string} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @return {Function}\n * Function that returns the active media track for the provided type. Returns\n * null if no track is active\n * @function activeTrack.AUDIO\n */\n AUDIO: (type, settings) => () => {\n const {\n mediaTypes: {\n [type]: {\n tracks\n }\n }\n } = settings;\n for (const id in tracks) {\n if (tracks[id].enabled) {\n return tracks[id];\n }\n }\n return null;\n },\n /**\n * Returns a function used to get the active track of type provided\n *\n * @param {string} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @return {Function}\n * Function that returns the active media track for the provided type. Returns\n * null if no track is active\n * @function activeTrack.SUBTITLES\n */\n SUBTITLES: (type, settings) => () => {\n const {\n mediaTypes: {\n [type]: {\n tracks\n }\n }\n } = settings;\n for (const id in tracks) {\n if (tracks[id].mode === 'showing' || tracks[id].mode === 'hidden') {\n return tracks[id];\n }\n }\n return null;\n }\n};\nconst getActiveGroup = (type, {\n mediaTypes\n}) => () => {\n const activeTrack_ = mediaTypes[type].activeTrack();\n if (!activeTrack_) {\n return null;\n }\n return mediaTypes[type].activeGroup(activeTrack_);\n};\n/**\n * Setup PlaylistLoaders and Tracks for media groups (Audio, Subtitles,\n * Closed-Captions) specified in the main manifest.\n *\n * @param {Object} settings\n * Object containing required information for setting up the media groups\n * @param {Tech} settings.tech\n * The tech of the player\n * @param {Object} settings.requestOptions\n * XHR request options used by the segment loaders\n * @param {PlaylistLoader} settings.mainPlaylistLoader\n * PlaylistLoader for the main source\n * @param {VhsHandler} settings.vhs\n * VHS SourceHandler\n * @param {Object} settings.main\n * The parsed main manifest\n * @param {Object} settings.mediaTypes\n * Object to store the loaders, tracks, and utility methods for each media type\n * @param {Function} settings.excludePlaylist\n * Excludes the current rendition and forces a rendition switch.\n * @function setupMediaGroups\n */\n\nconst setupMediaGroups = settings => {\n ['AUDIO', 'SUBTITLES', 'CLOSED-CAPTIONS'].forEach(type => {\n initialize[type](type, settings);\n });\n const {\n mediaTypes,\n mainPlaylistLoader,\n tech,\n vhs,\n segmentLoaders: {\n ['AUDIO']: audioSegmentLoader,\n main: mainSegmentLoader\n }\n } = settings; // setup active group and track getters and change event handlers\n\n ['AUDIO', 'SUBTITLES'].forEach(type => {\n mediaTypes[type].activeGroup = activeGroup(type, settings);\n mediaTypes[type].activeTrack = activeTrack[type](type, settings);\n mediaTypes[type].onGroupChanged = onGroupChanged(type, settings);\n mediaTypes[type].onGroupChanging = onGroupChanging(type, settings);\n mediaTypes[type].onTrackChanged = onTrackChanged(type, settings);\n mediaTypes[type].getActiveGroup = getActiveGroup(type, settings);\n }); // DO NOT enable the default subtitle or caption track.\n // DO enable the default audio track\n\n const audioGroup = mediaTypes.AUDIO.activeGroup();\n if (audioGroup) {\n const groupId = (audioGroup.filter(group => group.default)[0] || audioGroup[0]).id;\n mediaTypes.AUDIO.tracks[groupId].enabled = true;\n mediaTypes.AUDIO.onGroupChanged();\n mediaTypes.AUDIO.onTrackChanged();\n const activeAudioGroup = mediaTypes.AUDIO.getActiveGroup(); // a similar check for handling setAudio on each loader is run again each time the\n // track is changed, but needs to be handled here since the track may not be considered\n // changed on the first call to onTrackChanged\n\n if (!activeAudioGroup.playlistLoader) {\n // either audio is muxed with video or the stream is audio only\n mainSegmentLoader.setAudio(true);\n } else {\n // audio is demuxed\n mainSegmentLoader.setAudio(false);\n audioSegmentLoader.setAudio(true);\n }\n }\n mainPlaylistLoader.on('mediachange', () => {\n ['AUDIO', 'SUBTITLES'].forEach(type => mediaTypes[type].onGroupChanged());\n });\n mainPlaylistLoader.on('mediachanging', () => {\n ['AUDIO', 'SUBTITLES'].forEach(type => mediaTypes[type].onGroupChanging());\n }); // custom audio track change event handler for usage event\n\n const onAudioTrackChanged = () => {\n mediaTypes.AUDIO.onTrackChanged();\n tech.trigger({\n type: 'usage',\n name: 'vhs-audio-change'\n });\n };\n tech.audioTracks().addEventListener('change', onAudioTrackChanged);\n tech.remoteTextTracks().addEventListener('change', mediaTypes.SUBTITLES.onTrackChanged);\n vhs.on('dispose', () => {\n tech.audioTracks().removeEventListener('change', onAudioTrackChanged);\n tech.remoteTextTracks().removeEventListener('change', mediaTypes.SUBTITLES.onTrackChanged);\n }); // clear existing audio tracks and add the ones we just created\n\n tech.clearTracks('audio');\n for (const id in mediaTypes.AUDIO.tracks) {\n tech.audioTracks().addTrack(mediaTypes.AUDIO.tracks[id]);\n }\n};\n/**\n * Creates skeleton object used to store the loaders, tracks, and utility methods for each\n * media type\n *\n * @return {Object}\n * Object to store the loaders, tracks, and utility methods for each media type\n * @function createMediaTypes\n */\n\nconst createMediaTypes = () => {\n const mediaTypes = {};\n ['AUDIO', 'SUBTITLES', 'CLOSED-CAPTIONS'].forEach(type => {\n mediaTypes[type] = {\n groups: {},\n tracks: {},\n activePlaylistLoader: null,\n activeGroup: noop,\n activeTrack: noop,\n getActiveGroup: noop,\n onGroupChanged: noop,\n onTrackChanged: noop,\n lastTrack_: null,\n logger_: logger(`MediaGroups[${type}]`)\n };\n });\n return mediaTypes;\n};\n\n/**\n * A utility class for setting properties and maintaining the state of the content steering manifest.\n *\n * Content Steering manifest format:\n * VERSION: number (required) currently only version 1 is supported.\n * TTL: number in seconds (optional) until the next content steering manifest reload.\n * RELOAD-URI: string (optional) uri to fetch the next content steering manifest.\n * SERVICE-LOCATION-PRIORITY or PATHWAY-PRIORITY a non empty array of unique string values.\n */\n\nclass SteeringManifest {\n constructor() {\n this.priority_ = [];\n }\n set version(number) {\n // Only version 1 is currently supported for both DASH and HLS.\n if (number === 1) {\n this.version_ = number;\n }\n }\n set ttl(seconds) {\n // TTL = time-to-live, default = 300 seconds.\n this.ttl_ = seconds || 300;\n }\n set reloadUri(uri) {\n if (uri) {\n // reload URI can be relative to the previous reloadUri.\n this.reloadUri_ = resolveUrl(this.reloadUri_, uri);\n }\n }\n set priority(array) {\n // priority must be non-empty and unique values.\n if (array && array.length) {\n this.priority_ = array;\n }\n }\n get version() {\n return this.version_;\n }\n get ttl() {\n return this.ttl_;\n }\n get reloadUri() {\n return this.reloadUri_;\n }\n get priority() {\n return this.priority_;\n }\n}\n/**\n * This class represents a content steering manifest and associated state. See both HLS and DASH specifications.\n * HLS: https://developer.apple.com/streaming/HLSContentSteeringSpecification.pdf and\n * https://datatracker.ietf.org/doc/draft-pantos-hls-rfc8216bis/ section 4.4.6.6.\n * DASH: https://dashif.org/docs/DASH-IF-CTS-00XX-Content-Steering-Community-Review.pdf\n *\n * @param {function} xhr for making a network request from the browser.\n * @param {function} bandwidth for fetching the current bandwidth from the main segment loader.\n */\n\nclass ContentSteeringController extends videojs.EventTarget {\n constructor(xhr, bandwidth) {\n super();\n this.currentPathway = null;\n this.defaultPathway = null;\n this.queryBeforeStart = null;\n this.availablePathways_ = new Set();\n this.excludedPathways_ = new Set();\n this.steeringManifest = new SteeringManifest();\n this.proxyServerUrl_ = null;\n this.manifestType_ = null;\n this.ttlTimeout_ = null;\n this.request_ = null;\n this.excludedSteeringManifestURLs = new Set();\n this.logger_ = logger('Content Steering');\n this.xhr_ = xhr;\n this.getBandwidth_ = bandwidth;\n }\n /**\n * Assigns the content steering tag properties to the steering controller\n *\n * @param {string} baseUrl the baseURL from the manifest for resolving the steering manifest url\n * @param {Object} steeringTag the content steering tag from the main manifest\n */\n\n assignTagProperties(baseUrl, steeringTag) {\n this.manifestType_ = steeringTag.serverUri ? 'HLS' : 'DASH'; // serverUri is HLS serverURL is DASH\n\n const steeringUri = steeringTag.serverUri || steeringTag.serverURL;\n if (!steeringUri) {\n this.logger_(`steering manifest URL is ${steeringUri}, cannot request steering manifest.`);\n this.trigger('error');\n return;\n } // Content steering manifests can be encoded as a data URI. We can decode, parse and return early if that's the case.\n\n if (steeringUri.startsWith('data:')) {\n this.decodeDataUriManifest_(steeringUri.substring(steeringUri.indexOf(',') + 1));\n return;\n } // With DASH queryBeforeStart, we want to use the steeringUri as soon as possible for the request.\n\n this.steeringManifest.reloadUri = this.queryBeforeStart ? steeringUri : resolveUrl(baseUrl, steeringUri); // pathwayId is HLS defaultServiceLocation is DASH\n\n this.defaultPathway = steeringTag.pathwayId || steeringTag.defaultServiceLocation; // currently only DASH supports the following properties on <ContentSteering> tags.\n\n this.queryBeforeStart = steeringTag.queryBeforeStart || false;\n this.proxyServerUrl_ = steeringTag.proxyServerURL || null; // trigger a steering event if we have a pathway from the content steering tag.\n // this tells VHS which segment pathway to start with.\n // If queryBeforeStart is true we need to wait for the steering manifest response.\n\n if (this.defaultPathway && !this.queryBeforeStart) {\n this.trigger('content-steering');\n }\n if (this.queryBeforeStart) {\n this.requestSteeringManifest(this.steeringManifest.reloadUri);\n }\n }\n /**\n * Requests the content steering manifest and parse the response. This should only be called after\n * assignTagProperties was called with a content steering tag.\n *\n * @param {string} initialUri The optional uri to make the request with.\n * If set, the request should be made with exactly what is passed in this variable.\n * This scenario is specific to DASH when the queryBeforeStart parameter is true.\n * This scenario should only happen once on initalization.\n */\n\n requestSteeringManifest(initialUri) {\n const reloadUri = this.steeringManifest.reloadUri;\n if (!initialUri && !reloadUri) {\n return;\n } // We currently don't support passing MPD query parameters directly to the content steering URL as this requires\n // ExtUrlQueryInfo tag support. See the DASH content steering spec section 8.1.\n // This request URI accounts for manifest URIs that have been excluded.\n\n const uri = initialUri || this.getRequestURI(reloadUri); // If there are no valid manifest URIs, we should stop content steering.\n\n if (!uri) {\n this.logger_('No valid content steering manifest URIs. Stopping content steering.');\n this.trigger('error');\n this.dispose();\n return;\n }\n this.request_ = this.xhr_({\n uri\n }, (error, errorInfo) => {\n if (error) {\n // If the client receives HTTP 410 Gone in response to a manifest request,\n // it MUST NOT issue another request for that URI for the remainder of the\n // playback session. It MAY continue to use the most-recently obtained set\n // of Pathways.\n if (errorInfo.status === 410) {\n this.logger_(`manifest request 410 ${error}.`);\n this.logger_(`There will be no more content steering requests to ${uri} this session.`);\n this.excludedSteeringManifestURLs.add(uri);\n return;\n } // If the client receives HTTP 429 Too Many Requests with a Retry-After\n // header in response to a manifest request, it SHOULD wait until the time\n // specified by the Retry-After header to reissue the request.\n\n if (errorInfo.status === 429) {\n const retrySeconds = errorInfo.responseHeaders['retry-after'];\n this.logger_(`manifest request 429 ${error}.`);\n this.logger_(`content steering will retry in ${retrySeconds} seconds.`);\n this.startTTLTimeout_(parseInt(retrySeconds, 10));\n return;\n } // If the Steering Manifest cannot be loaded and parsed correctly, the\n // client SHOULD continue to use the previous values and attempt to reload\n // it after waiting for the previously-specified TTL (or 5 minutes if\n // none).\n\n this.logger_(`manifest failed to load ${error}.`);\n this.startTTLTimeout_();\n return;\n }\n const steeringManifestJson = JSON.parse(this.request_.responseText);\n this.startTTLTimeout_();\n this.assignSteeringProperties_(steeringManifestJson);\n });\n }\n /**\n * Set the proxy server URL and add the steering manifest url as a URI encoded parameter.\n *\n * @param {string} steeringUrl the steering manifest url\n * @return the steering manifest url to a proxy server with all parameters set\n */\n\n setProxyServerUrl_(steeringUrl) {\n const steeringUrlObject = new window$1.URL(steeringUrl);\n const proxyServerUrlObject = new window$1.URL(this.proxyServerUrl_);\n proxyServerUrlObject.searchParams.set('url', encodeURI(steeringUrlObject.toString()));\n return this.setSteeringParams_(proxyServerUrlObject.toString());\n }\n /**\n * Decodes and parses the data uri encoded steering manifest\n *\n * @param {string} dataUri the data uri to be decoded and parsed.\n */\n\n decodeDataUriManifest_(dataUri) {\n const steeringManifestJson = JSON.parse(window$1.atob(dataUri));\n this.assignSteeringProperties_(steeringManifestJson);\n }\n /**\n * Set the HLS or DASH content steering manifest request query parameters. For example:\n * _HLS_pathway=\"<CURRENT-PATHWAY-ID>\" and _HLS_throughput=<THROUGHPUT>\n * _DASH_pathway and _DASH_throughput\n *\n * @param {string} uri to add content steering server parameters to.\n * @return a new uri as a string with the added steering query parameters.\n */\n\n setSteeringParams_(url) {\n const urlObject = new window$1.URL(url);\n const path = this.getPathway();\n const networkThroughput = this.getBandwidth_();\n if (path) {\n const pathwayKey = `_${this.manifestType_}_pathway`;\n urlObject.searchParams.set(pathwayKey, path);\n }\n if (networkThroughput) {\n const throughputKey = `_${this.manifestType_}_throughput`;\n urlObject.searchParams.set(throughputKey, networkThroughput);\n }\n return urlObject.toString();\n }\n /**\n * Assigns the current steering manifest properties and to the SteeringManifest object\n *\n * @param {Object} steeringJson the raw JSON steering manifest\n */\n\n assignSteeringProperties_(steeringJson) {\n this.steeringManifest.version = steeringJson.VERSION;\n if (!this.steeringManifest.version) {\n this.logger_(`manifest version is ${steeringJson.VERSION}, which is not supported.`);\n this.trigger('error');\n return;\n }\n this.steeringManifest.ttl = steeringJson.TTL;\n this.steeringManifest.reloadUri = steeringJson['RELOAD-URI']; // HLS = PATHWAY-PRIORITY required. DASH = SERVICE-LOCATION-PRIORITY optional\n\n this.steeringManifest.priority = steeringJson['PATHWAY-PRIORITY'] || steeringJson['SERVICE-LOCATION-PRIORITY']; // TODO: HLS handle PATHWAY-CLONES. See section 7.2 https://datatracker.ietf.org/doc/draft-pantos-hls-rfc8216bis/\n // 1. apply first pathway from the array.\n // 2. if first pathway doesn't exist in manifest, try next pathway.\n // a. if all pathways are exhausted, ignore the steering manifest priority.\n // 3. if segments fail from an established pathway, try all variants/renditions, then exclude the failed pathway.\n // a. exclude a pathway for a minimum of the last TTL duration. Meaning, from the next steering response,\n // the excluded pathway will be ignored.\n // See excludePathway usage in excludePlaylist().\n // If there are no available pathways, we need to stop content steering.\n\n if (!this.availablePathways_.size) {\n this.logger_('There are no available pathways for content steering. Ending content steering.');\n this.trigger('error');\n this.dispose();\n }\n const chooseNextPathway = pathwaysByPriority => {\n for (const path of pathwaysByPriority) {\n if (this.availablePathways_.has(path)) {\n return path;\n }\n } // If no pathway matches, ignore the manifest and choose the first available.\n\n return [...this.availablePathways_][0];\n };\n const nextPathway = chooseNextPathway(this.steeringManifest.priority);\n if (this.currentPathway !== nextPathway) {\n this.currentPathway = nextPathway;\n this.trigger('content-steering');\n }\n }\n /**\n * Returns the pathway to use for steering decisions\n *\n * @return {string} returns the current pathway or the default\n */\n\n getPathway() {\n return this.currentPathway || this.defaultPathway;\n }\n /**\n * Chooses the manifest request URI based on proxy URIs and server URLs.\n * Also accounts for exclusion on certain manifest URIs.\n *\n * @param {string} reloadUri the base uri before parameters\n *\n * @return {string} the final URI for the request to the manifest server.\n */\n\n getRequestURI(reloadUri) {\n if (!reloadUri) {\n return null;\n }\n const isExcluded = uri => this.excludedSteeringManifestURLs.has(uri);\n if (this.proxyServerUrl_) {\n const proxyURI = this.setProxyServerUrl_(reloadUri);\n if (!isExcluded(proxyURI)) {\n return proxyURI;\n }\n }\n const steeringURI = this.setSteeringParams_(reloadUri);\n if (!isExcluded(steeringURI)) {\n return steeringURI;\n } // Return nothing if all valid manifest URIs are excluded.\n\n return null;\n }\n /**\n * Start the timeout for re-requesting the steering manifest at the TTL interval.\n *\n * @param {number} ttl time in seconds of the timeout. Defaults to the\n * ttl interval in the steering manifest\n */\n\n startTTLTimeout_(ttl = this.steeringManifest.ttl) {\n // 300 (5 minutes) is the default value.\n const ttlMS = ttl * 1000;\n this.ttlTimeout_ = window$1.setTimeout(() => {\n this.requestSteeringManifest();\n }, ttlMS);\n }\n /**\n * Clear the TTL timeout if necessary.\n */\n\n clearTTLTimeout_() {\n window$1.clearTimeout(this.ttlTimeout_);\n this.ttlTimeout_ = null;\n }\n /**\n * aborts any current steering xhr and sets the current request object to null\n */\n\n abort() {\n if (this.request_) {\n this.request_.abort();\n }\n this.request_ = null;\n }\n /**\n * aborts steering requests clears the ttl timeout and resets all properties.\n */\n\n dispose() {\n this.off('content-steering');\n this.off('error');\n this.abort();\n this.clearTTLTimeout_();\n this.currentPathway = null;\n this.defaultPathway = null;\n this.queryBeforeStart = null;\n this.proxyServerUrl_ = null;\n this.manifestType_ = null;\n this.ttlTimeout_ = null;\n this.request_ = null;\n this.excludedSteeringManifestURLs = new Set();\n this.availablePathways_ = new Set();\n this.excludedPathways_ = new Set();\n this.steeringManifest = new SteeringManifest();\n }\n /**\n * adds a pathway to the available pathways set\n *\n * @param {string} pathway the pathway string to add\n */\n\n addAvailablePathway(pathway) {\n if (pathway) {\n this.availablePathways_.add(pathway);\n }\n }\n /**\n * clears all pathways from the available pathways set\n */\n\n clearAvailablePathways() {\n this.availablePathways_.clear();\n }\n excludePathway(pathway) {\n return this.availablePathways_.delete(pathway);\n }\n}\n\n/**\n * @file playlist-controller.js\n */\nconst ABORT_EARLY_EXCLUSION_SECONDS = 10;\nlet Vhs$1; // SegmentLoader stats that need to have each loader's\n// values summed to calculate the final value\n\nconst loaderStats = ['mediaRequests', 'mediaRequestsAborted', 'mediaRequestsTimedout', 'mediaRequestsErrored', 'mediaTransferDuration', 'mediaBytesTransferred', 'mediaAppends'];\nconst sumLoaderStat = function (stat) {\n return this.audioSegmentLoader_[stat] + this.mainSegmentLoader_[stat];\n};\nconst shouldSwitchToMedia = function ({\n currentPlaylist,\n buffered,\n currentTime,\n nextPlaylist,\n bufferLowWaterLine,\n bufferHighWaterLine,\n duration,\n bufferBasedABR,\n log\n}) {\n // we have no other playlist to switch to\n if (!nextPlaylist) {\n videojs.log.warn('We received no playlist to switch to. Please check your stream.');\n return false;\n }\n const sharedLogLine = `allowing switch ${currentPlaylist && currentPlaylist.id || 'null'} -> ${nextPlaylist.id}`;\n if (!currentPlaylist) {\n log(`${sharedLogLine} as current playlist is not set`);\n return true;\n } // no need to switch if playlist is the same\n\n if (nextPlaylist.id === currentPlaylist.id) {\n return false;\n } // determine if current time is in a buffered range.\n\n const isBuffered = Boolean(findRange(buffered, currentTime).length); // If the playlist is live, then we want to not take low water line into account.\n // This is because in LIVE, the player plays 3 segments from the end of the\n // playlist, and if `BUFFER_LOW_WATER_LINE` is greater than the duration availble\n // in those segments, a viewer will never experience a rendition upswitch.\n\n if (!currentPlaylist.endList) {\n // For LLHLS live streams, don't switch renditions before playback has started, as it almost\n // doubles the time to first playback.\n if (!isBuffered && typeof currentPlaylist.partTargetDuration === 'number') {\n log(`not ${sharedLogLine} as current playlist is live llhls, but currentTime isn't in buffered.`);\n return false;\n }\n log(`${sharedLogLine} as current playlist is live`);\n return true;\n }\n const forwardBuffer = timeAheadOf(buffered, currentTime);\n const maxBufferLowWaterLine = bufferBasedABR ? Config.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE : Config.MAX_BUFFER_LOW_WATER_LINE; // For the same reason as LIVE, we ignore the low water line when the VOD\n // duration is below the max potential low water line\n\n if (duration < maxBufferLowWaterLine) {\n log(`${sharedLogLine} as duration < max low water line (${duration} < ${maxBufferLowWaterLine})`);\n return true;\n }\n const nextBandwidth = nextPlaylist.attributes.BANDWIDTH;\n const currBandwidth = currentPlaylist.attributes.BANDWIDTH; // when switching down, if our buffer is lower than the high water line,\n // we can switch down\n\n if (nextBandwidth < currBandwidth && (!bufferBasedABR || forwardBuffer < bufferHighWaterLine)) {\n let logLine = `${sharedLogLine} as next bandwidth < current bandwidth (${nextBandwidth} < ${currBandwidth})`;\n if (bufferBasedABR) {\n logLine += ` and forwardBuffer < bufferHighWaterLine (${forwardBuffer} < ${bufferHighWaterLine})`;\n }\n log(logLine);\n return true;\n } // and if our buffer is higher than the low water line,\n // we can switch up\n\n if ((!bufferBasedABR || nextBandwidth > currBandwidth) && forwardBuffer >= bufferLowWaterLine) {\n let logLine = `${sharedLogLine} as forwardBuffer >= bufferLowWaterLine (${forwardBuffer} >= ${bufferLowWaterLine})`;\n if (bufferBasedABR) {\n logLine += ` and next bandwidth > current bandwidth (${nextBandwidth} > ${currBandwidth})`;\n }\n log(logLine);\n return true;\n }\n log(`not ${sharedLogLine} as no switching criteria met`);\n return false;\n};\n/**\n * the main playlist controller controller all interactons\n * between playlists and segmentloaders. At this time this mainly\n * involves a main playlist and a series of audio playlists\n * if they are available\n *\n * @class PlaylistController\n * @extends videojs.EventTarget\n */\n\nclass PlaylistController extends videojs.EventTarget {\n constructor(options) {\n super();\n const {\n src,\n withCredentials,\n tech,\n bandwidth,\n externVhs,\n useCueTags,\n playlistExclusionDuration,\n enableLowInitialPlaylist,\n sourceType,\n cacheEncryptionKeys,\n bufferBasedABR,\n leastPixelDiffSelector,\n captionServices\n } = options;\n if (!src) {\n throw new Error('A non-empty playlist URL or JSON manifest string is required');\n }\n let {\n maxPlaylistRetries\n } = options;\n if (maxPlaylistRetries === null || typeof maxPlaylistRetries === 'undefined') {\n maxPlaylistRetries = Infinity;\n }\n Vhs$1 = externVhs;\n this.bufferBasedABR = Boolean(bufferBasedABR);\n this.leastPixelDiffSelector = Boolean(leastPixelDiffSelector);\n this.withCredentials = withCredentials;\n this.tech_ = tech;\n this.vhs_ = tech.vhs;\n this.sourceType_ = sourceType;\n this.useCueTags_ = useCueTags;\n this.playlistExclusionDuration = playlistExclusionDuration;\n this.maxPlaylistRetries = maxPlaylistRetries;\n this.enableLowInitialPlaylist = enableLowInitialPlaylist;\n if (this.useCueTags_) {\n this.cueTagsTrack_ = this.tech_.addTextTrack('metadata', 'ad-cues');\n this.cueTagsTrack_.inBandMetadataTrackDispatchType = '';\n }\n this.requestOptions_ = {\n withCredentials,\n maxPlaylistRetries,\n timeout: null\n };\n this.on('error', this.pauseLoading);\n this.mediaTypes_ = createMediaTypes();\n this.mediaSource = new window$1.MediaSource();\n this.handleDurationChange_ = this.handleDurationChange_.bind(this);\n this.handleSourceOpen_ = this.handleSourceOpen_.bind(this);\n this.handleSourceEnded_ = this.handleSourceEnded_.bind(this);\n this.mediaSource.addEventListener('durationchange', this.handleDurationChange_); // load the media source into the player\n\n this.mediaSource.addEventListener('sourceopen', this.handleSourceOpen_);\n this.mediaSource.addEventListener('sourceended', this.handleSourceEnded_); // we don't have to handle sourceclose since dispose will handle termination of\n // everything, and the MediaSource should not be detached without a proper disposal\n\n this.seekable_ = createTimeRanges();\n this.hasPlayed_ = false;\n this.syncController_ = new SyncController(options);\n this.segmentMetadataTrack_ = tech.addRemoteTextTrack({\n kind: 'metadata',\n label: 'segment-metadata'\n }, false).track;\n this.decrypter_ = new Decrypter();\n this.sourceUpdater_ = new SourceUpdater(this.mediaSource);\n this.inbandTextTracks_ = {};\n this.timelineChangeController_ = new TimelineChangeController();\n const segmentLoaderSettings = {\n vhs: this.vhs_,\n parse708captions: options.parse708captions,\n useDtsForTimestampOffset: options.useDtsForTimestampOffset,\n calculateTimestampOffsetForEachSegment: options.calculateTimestampOffsetForEachSegment,\n captionServices,\n mediaSource: this.mediaSource,\n currentTime: this.tech_.currentTime.bind(this.tech_),\n seekable: () => this.seekable(),\n seeking: () => this.tech_.seeking(),\n duration: () => this.duration(),\n hasPlayed: () => this.hasPlayed_,\n goalBufferLength: () => this.goalBufferLength(),\n bandwidth,\n syncController: this.syncController_,\n decrypter: this.decrypter_,\n sourceType: this.sourceType_,\n inbandTextTracks: this.inbandTextTracks_,\n cacheEncryptionKeys,\n sourceUpdater: this.sourceUpdater_,\n timelineChangeController: this.timelineChangeController_,\n exactManifestTimings: options.exactManifestTimings,\n addMetadataToTextTrack: this.addMetadataToTextTrack.bind(this)\n }; // The source type check not only determines whether a special DASH playlist loader\n // should be used, but also covers the case where the provided src is a vhs-json\n // manifest object (instead of a URL). In the case of vhs-json, the default\n // PlaylistLoader should be used.\n\n this.mainPlaylistLoader_ = this.sourceType_ === 'dash' ? new DashPlaylistLoader(src, this.vhs_, merge(this.requestOptions_, {\n addMetadataToTextTrack: this.addMetadataToTextTrack.bind(this)\n })) : new PlaylistLoader(src, this.vhs_, merge(this.requestOptions_, {\n addDateRangesToTextTrack: this.addDateRangesToTextTrack_.bind(this)\n }));\n this.setupMainPlaylistLoaderListeners_(); // setup segment loaders\n // combined audio/video or just video when alternate audio track is selected\n\n this.mainSegmentLoader_ = new SegmentLoader(merge(segmentLoaderSettings, {\n segmentMetadataTrack: this.segmentMetadataTrack_,\n loaderType: 'main'\n }), options); // alternate audio track\n\n this.audioSegmentLoader_ = new SegmentLoader(merge(segmentLoaderSettings, {\n loaderType: 'audio'\n }), options);\n this.subtitleSegmentLoader_ = new VTTSegmentLoader(merge(segmentLoaderSettings, {\n loaderType: 'vtt',\n featuresNativeTextTracks: this.tech_.featuresNativeTextTracks,\n loadVttJs: () => new Promise((resolve, reject) => {\n function onLoad() {\n tech.off('vttjserror', onError);\n resolve();\n }\n function onError() {\n tech.off('vttjsloaded', onLoad);\n reject();\n }\n tech.one('vttjsloaded', onLoad);\n tech.one('vttjserror', onError); // safe to call multiple times, script will be loaded only once:\n\n tech.addWebVttScript_();\n })\n }), options);\n const getBandwidth = () => {\n return this.mainSegmentLoader_.bandwidth;\n };\n this.contentSteeringController_ = new ContentSteeringController(this.vhs_.xhr, getBandwidth);\n this.setupSegmentLoaderListeners_();\n if (this.bufferBasedABR) {\n this.mainPlaylistLoader_.one('loadedplaylist', () => this.startABRTimer_());\n this.tech_.on('pause', () => this.stopABRTimer_());\n this.tech_.on('play', () => this.startABRTimer_());\n } // Create SegmentLoader stat-getters\n // mediaRequests_\n // mediaRequestsAborted_\n // mediaRequestsTimedout_\n // mediaRequestsErrored_\n // mediaTransferDuration_\n // mediaBytesTransferred_\n // mediaAppends_\n\n loaderStats.forEach(stat => {\n this[stat + '_'] = sumLoaderStat.bind(this, stat);\n });\n this.logger_ = logger('pc');\n this.triggeredFmp4Usage = false;\n if (this.tech_.preload() === 'none') {\n this.loadOnPlay_ = () => {\n this.loadOnPlay_ = null;\n this.mainPlaylistLoader_.load();\n };\n this.tech_.one('play', this.loadOnPlay_);\n } else {\n this.mainPlaylistLoader_.load();\n }\n this.timeToLoadedData__ = -1;\n this.mainAppendsToLoadedData__ = -1;\n this.audioAppendsToLoadedData__ = -1;\n const event = this.tech_.preload() === 'none' ? 'play' : 'loadstart'; // start the first frame timer on loadstart or play (for preload none)\n\n this.tech_.one(event, () => {\n const timeToLoadedDataStart = Date.now();\n this.tech_.one('loadeddata', () => {\n this.timeToLoadedData__ = Date.now() - timeToLoadedDataStart;\n this.mainAppendsToLoadedData__ = this.mainSegmentLoader_.mediaAppends;\n this.audioAppendsToLoadedData__ = this.audioSegmentLoader_.mediaAppends;\n });\n });\n }\n mainAppendsToLoadedData_() {\n return this.mainAppendsToLoadedData__;\n }\n audioAppendsToLoadedData_() {\n return this.audioAppendsToLoadedData__;\n }\n appendsToLoadedData_() {\n const main = this.mainAppendsToLoadedData_();\n const audio = this.audioAppendsToLoadedData_();\n if (main === -1 || audio === -1) {\n return -1;\n }\n return main + audio;\n }\n timeToLoadedData_() {\n return this.timeToLoadedData__;\n }\n /**\n * Run selectPlaylist and switch to the new playlist if we should\n *\n * @param {string} [reason=abr] a reason for why the ABR check is made\n * @private\n */\n\n checkABR_(reason = 'abr') {\n const nextPlaylist = this.selectPlaylist();\n if (nextPlaylist && this.shouldSwitchToMedia_(nextPlaylist)) {\n this.switchMedia_(nextPlaylist, reason);\n }\n }\n switchMedia_(playlist, cause, delay) {\n const oldMedia = this.media();\n const oldId = oldMedia && (oldMedia.id || oldMedia.uri);\n const newId = playlist.id || playlist.uri;\n if (oldId && oldId !== newId) {\n this.logger_(`switch media ${oldId} -> ${newId} from ${cause}`);\n this.tech_.trigger({\n type: 'usage',\n name: `vhs-rendition-change-${cause}`\n });\n }\n this.mainPlaylistLoader_.media(playlist, delay);\n }\n /**\n * A function that ensures we switch our playlists inside of `mediaTypes`\n * to match the current `serviceLocation` provided by the contentSteering controller.\n * We want to check media types of `AUDIO`, `SUBTITLES`, and `CLOSED-CAPTIONS`.\n *\n * This should only be called on a DASH playback scenario while using content steering.\n * This is necessary due to differences in how media in HLS manifests are generally tied to\n * a video playlist, where in DASH that is not always the case.\n */\n\n switchMediaForDASHContentSteering_() {\n ['AUDIO', 'SUBTITLES', 'CLOSED-CAPTIONS'].forEach(type => {\n const mediaType = this.mediaTypes_[type];\n const activeGroup = mediaType ? mediaType.activeGroup() : null;\n const pathway = this.contentSteeringController_.getPathway();\n if (activeGroup && pathway) {\n // activeGroup can be an array or a single group\n const mediaPlaylists = activeGroup.length ? activeGroup[0].playlists : activeGroup.playlists;\n const dashMediaPlaylists = mediaPlaylists.filter(p => p.attributes.serviceLocation === pathway); // Switch the current active playlist to the correct CDN\n\n if (dashMediaPlaylists.length) {\n this.mediaTypes_[type].activePlaylistLoader.media(dashMediaPlaylists[0]);\n }\n }\n });\n }\n /**\n * Start a timer that periodically calls checkABR_\n *\n * @private\n */\n\n startABRTimer_() {\n this.stopABRTimer_();\n this.abrTimer_ = window$1.setInterval(() => this.checkABR_(), 250);\n }\n /**\n * Stop the timer that periodically calls checkABR_\n *\n * @private\n */\n\n stopABRTimer_() {\n // if we're scrubbing, we don't need to pause.\n // This getter will be added to Video.js in version 7.11.\n if (this.tech_.scrubbing && this.tech_.scrubbing()) {\n return;\n }\n window$1.clearInterval(this.abrTimer_);\n this.abrTimer_ = null;\n }\n /**\n * Get a list of playlists for the currently selected audio playlist\n *\n * @return {Array} the array of audio playlists\n */\n\n getAudioTrackPlaylists_() {\n const main = this.main();\n const defaultPlaylists = main && main.playlists || []; // if we don't have any audio groups then we can only\n // assume that the audio tracks are contained in main\n // playlist array, use that or an empty array.\n\n if (!main || !main.mediaGroups || !main.mediaGroups.AUDIO) {\n return defaultPlaylists;\n }\n const AUDIO = main.mediaGroups.AUDIO;\n const groupKeys = Object.keys(AUDIO);\n let track; // get the current active track\n\n if (Object.keys(this.mediaTypes_.AUDIO.groups).length) {\n track = this.mediaTypes_.AUDIO.activeTrack(); // or get the default track from main if mediaTypes_ isn't setup yet\n } else {\n // default group is `main` or just the first group.\n const defaultGroup = AUDIO.main || groupKeys.length && AUDIO[groupKeys[0]];\n for (const label in defaultGroup) {\n if (defaultGroup[label].default) {\n track = {\n label\n };\n break;\n }\n }\n } // no active track no playlists.\n\n if (!track) {\n return defaultPlaylists;\n }\n const playlists = []; // get all of the playlists that are possible for the\n // active track.\n\n for (const group in AUDIO) {\n if (AUDIO[group][track.label]) {\n const properties = AUDIO[group][track.label];\n if (properties.playlists && properties.playlists.length) {\n playlists.push.apply(playlists, properties.playlists);\n } else if (properties.uri) {\n playlists.push(properties);\n } else if (main.playlists.length) {\n // if an audio group does not have a uri\n // see if we have main playlists that use it as a group.\n // if we do then add those to the playlists list.\n for (let i = 0; i < main.playlists.length; i++) {\n const playlist = main.playlists[i];\n if (playlist.attributes && playlist.attributes.AUDIO && playlist.attributes.AUDIO === group) {\n playlists.push(playlist);\n }\n }\n }\n }\n }\n if (!playlists.length) {\n return defaultPlaylists;\n }\n return playlists;\n }\n /**\n * Register event handlers on the main playlist loader. A helper\n * function for construction time.\n *\n * @private\n */\n\n setupMainPlaylistLoaderListeners_() {\n this.mainPlaylistLoader_.on('loadedmetadata', () => {\n const media = this.mainPlaylistLoader_.media();\n const requestTimeout = media.targetDuration * 1.5 * 1000; // If we don't have any more available playlists, we don't want to\n // timeout the request.\n\n if (isLowestEnabledRendition(this.mainPlaylistLoader_.main, this.mainPlaylistLoader_.media())) {\n this.requestOptions_.timeout = 0;\n } else {\n this.requestOptions_.timeout = requestTimeout;\n } // if this isn't a live video and preload permits, start\n // downloading segments\n\n if (media.endList && this.tech_.preload() !== 'none') {\n this.mainSegmentLoader_.playlist(media, this.requestOptions_);\n this.mainSegmentLoader_.load();\n }\n setupMediaGroups({\n sourceType: this.sourceType_,\n segmentLoaders: {\n AUDIO: this.audioSegmentLoader_,\n SUBTITLES: this.subtitleSegmentLoader_,\n main: this.mainSegmentLoader_\n },\n tech: this.tech_,\n requestOptions: this.requestOptions_,\n mainPlaylistLoader: this.mainPlaylistLoader_,\n vhs: this.vhs_,\n main: this.main(),\n mediaTypes: this.mediaTypes_,\n excludePlaylist: this.excludePlaylist.bind(this)\n });\n this.triggerPresenceUsage_(this.main(), media);\n this.setupFirstPlay();\n if (!this.mediaTypes_.AUDIO.activePlaylistLoader || this.mediaTypes_.AUDIO.activePlaylistLoader.media()) {\n this.trigger('selectedinitialmedia');\n } else {\n // We must wait for the active audio playlist loader to\n // finish setting up before triggering this event so the\n // representations API and EME setup is correct\n this.mediaTypes_.AUDIO.activePlaylistLoader.one('loadedmetadata', () => {\n this.trigger('selectedinitialmedia');\n });\n }\n });\n this.mainPlaylistLoader_.on('loadedplaylist', () => {\n if (this.loadOnPlay_) {\n this.tech_.off('play', this.loadOnPlay_);\n }\n let updatedPlaylist = this.mainPlaylistLoader_.media();\n if (!updatedPlaylist) {\n this.initContentSteeringController_(); // exclude any variants that are not supported by the browser before selecting\n // an initial media as the playlist selectors do not consider browser support\n\n this.excludeUnsupportedVariants_();\n let selectedMedia;\n if (this.enableLowInitialPlaylist) {\n selectedMedia = this.selectInitialPlaylist();\n }\n if (!selectedMedia) {\n selectedMedia = this.selectPlaylist();\n }\n if (!selectedMedia || !this.shouldSwitchToMedia_(selectedMedia)) {\n return;\n }\n this.initialMedia_ = selectedMedia;\n this.switchMedia_(this.initialMedia_, 'initial'); // Under the standard case where a source URL is provided, loadedplaylist will\n // fire again since the playlist will be requested. In the case of vhs-json\n // (where the manifest object is provided as the source), when the media\n // playlist's `segments` list is already available, a media playlist won't be\n // requested, and loadedplaylist won't fire again, so the playlist handler must be\n // called on its own here.\n\n const haveJsonSource = this.sourceType_ === 'vhs-json' && this.initialMedia_.segments;\n if (!haveJsonSource) {\n return;\n }\n updatedPlaylist = this.initialMedia_;\n }\n this.handleUpdatedMediaPlaylist(updatedPlaylist);\n });\n this.mainPlaylistLoader_.on('error', () => {\n const error = this.mainPlaylistLoader_.error;\n this.excludePlaylist({\n playlistToExclude: error.playlist,\n error\n });\n });\n this.mainPlaylistLoader_.on('mediachanging', () => {\n this.mainSegmentLoader_.abort();\n this.mainSegmentLoader_.pause();\n });\n this.mainPlaylistLoader_.on('mediachange', () => {\n const media = this.mainPlaylistLoader_.media();\n const requestTimeout = media.targetDuration * 1.5 * 1000; // If we don't have any more available playlists, we don't want to\n // timeout the request.\n\n if (isLowestEnabledRendition(this.mainPlaylistLoader_.main, this.mainPlaylistLoader_.media())) {\n this.requestOptions_.timeout = 0;\n } else {\n this.requestOptions_.timeout = requestTimeout;\n }\n this.mainPlaylistLoader_.load(); // TODO: Create a new event on the PlaylistLoader that signals\n // that the segments have changed in some way and use that to\n // update the SegmentLoader instead of doing it twice here and\n // on `loadedplaylist`\n\n this.mainSegmentLoader_.playlist(media, this.requestOptions_);\n this.mainSegmentLoader_.load();\n this.tech_.trigger({\n type: 'mediachange',\n bubbles: true\n });\n });\n this.mainPlaylistLoader_.on('playlistunchanged', () => {\n const updatedPlaylist = this.mainPlaylistLoader_.media(); // ignore unchanged playlists that have already been\n // excluded for not-changing. We likely just have a really slowly updating\n // playlist.\n\n if (updatedPlaylist.lastExcludeReason_ === 'playlist-unchanged') {\n return;\n }\n const playlistOutdated = this.stuckAtPlaylistEnd_(updatedPlaylist);\n if (playlistOutdated) {\n // Playlist has stopped updating and we're stuck at its end. Try to\n // exclude it and switch to another playlist in the hope that that\n // one is updating (and give the player a chance to re-adjust to the\n // safe live point).\n this.excludePlaylist({\n error: {\n message: 'Playlist no longer updating.',\n reason: 'playlist-unchanged'\n }\n }); // useful for monitoring QoS\n\n this.tech_.trigger('playliststuck');\n }\n });\n this.mainPlaylistLoader_.on('renditiondisabled', () => {\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-rendition-disabled'\n });\n });\n this.mainPlaylistLoader_.on('renditionenabled', () => {\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-rendition-enabled'\n });\n });\n }\n /**\n * Given an updated media playlist (whether it was loaded for the first time, or\n * refreshed for live playlists), update any relevant properties and state to reflect\n * changes in the media that should be accounted for (e.g., cues and duration).\n *\n * @param {Object} updatedPlaylist the updated media playlist object\n *\n * @private\n */\n\n handleUpdatedMediaPlaylist(updatedPlaylist) {\n if (this.useCueTags_) {\n this.updateAdCues_(updatedPlaylist);\n } // TODO: Create a new event on the PlaylistLoader that signals\n // that the segments have changed in some way and use that to\n // update the SegmentLoader instead of doing it twice here and\n // on `mediachange`\n\n this.mainSegmentLoader_.playlist(updatedPlaylist, this.requestOptions_);\n this.updateDuration(!updatedPlaylist.endList); // If the player isn't paused, ensure that the segment loader is running,\n // as it is possible that it was temporarily stopped while waiting for\n // a playlist (e.g., in case the playlist errored and we re-requested it).\n\n if (!this.tech_.paused()) {\n this.mainSegmentLoader_.load();\n if (this.audioSegmentLoader_) {\n this.audioSegmentLoader_.load();\n }\n }\n }\n /**\n * A helper function for triggerring presence usage events once per source\n *\n * @private\n */\n\n triggerPresenceUsage_(main, media) {\n const mediaGroups = main.mediaGroups || {};\n let defaultDemuxed = true;\n const audioGroupKeys = Object.keys(mediaGroups.AUDIO);\n for (const mediaGroup in mediaGroups.AUDIO) {\n for (const label in mediaGroups.AUDIO[mediaGroup]) {\n const properties = mediaGroups.AUDIO[mediaGroup][label];\n if (!properties.uri) {\n defaultDemuxed = false;\n }\n }\n }\n if (defaultDemuxed) {\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-demuxed'\n });\n }\n if (Object.keys(mediaGroups.SUBTITLES).length) {\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-webvtt'\n });\n }\n if (Vhs$1.Playlist.isAes(media)) {\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-aes'\n });\n }\n if (audioGroupKeys.length && Object.keys(mediaGroups.AUDIO[audioGroupKeys[0]]).length > 1) {\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-alternate-audio'\n });\n }\n if (this.useCueTags_) {\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-playlist-cue-tags'\n });\n }\n }\n shouldSwitchToMedia_(nextPlaylist) {\n const currentPlaylist = this.mainPlaylistLoader_.media() || this.mainPlaylistLoader_.pendingMedia_;\n const currentTime = this.tech_.currentTime();\n const bufferLowWaterLine = this.bufferLowWaterLine();\n const bufferHighWaterLine = this.bufferHighWaterLine();\n const buffered = this.tech_.buffered();\n return shouldSwitchToMedia({\n buffered,\n currentTime,\n currentPlaylist,\n nextPlaylist,\n bufferLowWaterLine,\n bufferHighWaterLine,\n duration: this.duration(),\n bufferBasedABR: this.bufferBasedABR,\n log: this.logger_\n });\n }\n /**\n * Register event handlers on the segment loaders. A helper function\n * for construction time.\n *\n * @private\n */\n\n setupSegmentLoaderListeners_() {\n this.mainSegmentLoader_.on('bandwidthupdate', () => {\n // Whether or not buffer based ABR or another ABR is used, on a bandwidth change it's\n // useful to check to see if a rendition switch should be made.\n this.checkABR_('bandwidthupdate');\n this.tech_.trigger('bandwidthupdate');\n });\n this.mainSegmentLoader_.on('timeout', () => {\n if (this.bufferBasedABR) {\n // If a rendition change is needed, then it would've be done on `bandwidthupdate`.\n // Here the only consideration is that for buffer based ABR there's no guarantee\n // of an immediate switch (since the bandwidth is averaged with a timeout\n // bandwidth value of 1), so force a load on the segment loader to keep it going.\n this.mainSegmentLoader_.load();\n }\n }); // `progress` events are not reliable enough of a bandwidth measure to trigger buffer\n // based ABR.\n\n if (!this.bufferBasedABR) {\n this.mainSegmentLoader_.on('progress', () => {\n this.trigger('progress');\n });\n }\n this.mainSegmentLoader_.on('error', () => {\n const error = this.mainSegmentLoader_.error();\n this.excludePlaylist({\n playlistToExclude: error.playlist,\n error\n });\n });\n this.mainSegmentLoader_.on('appenderror', () => {\n this.error = this.mainSegmentLoader_.error_;\n this.trigger('error');\n });\n this.mainSegmentLoader_.on('syncinfoupdate', () => {\n this.onSyncInfoUpdate_();\n });\n this.mainSegmentLoader_.on('timestampoffset', () => {\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-timestamp-offset'\n });\n });\n this.audioSegmentLoader_.on('syncinfoupdate', () => {\n this.onSyncInfoUpdate_();\n });\n this.audioSegmentLoader_.on('appenderror', () => {\n this.error = this.audioSegmentLoader_.error_;\n this.trigger('error');\n });\n this.mainSegmentLoader_.on('ended', () => {\n this.logger_('main segment loader ended');\n this.onEndOfStream();\n });\n this.mainSegmentLoader_.on('earlyabort', event => {\n // never try to early abort with the new ABR algorithm\n if (this.bufferBasedABR) {\n return;\n }\n this.delegateLoaders_('all', ['abort']);\n this.excludePlaylist({\n error: {\n message: 'Aborted early because there isn\\'t enough bandwidth to complete ' + 'the request without rebuffering.'\n },\n playlistExclusionDuration: ABORT_EARLY_EXCLUSION_SECONDS\n });\n });\n const updateCodecs = () => {\n if (!this.sourceUpdater_.hasCreatedSourceBuffers()) {\n return this.tryToCreateSourceBuffers_();\n }\n const codecs = this.getCodecsOrExclude_(); // no codecs means that the playlist was excluded\n\n if (!codecs) {\n return;\n }\n this.sourceUpdater_.addOrChangeSourceBuffers(codecs);\n };\n this.mainSegmentLoader_.on('trackinfo', updateCodecs);\n this.audioSegmentLoader_.on('trackinfo', updateCodecs);\n this.mainSegmentLoader_.on('fmp4', () => {\n if (!this.triggeredFmp4Usage) {\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-fmp4'\n });\n this.triggeredFmp4Usage = true;\n }\n });\n this.audioSegmentLoader_.on('fmp4', () => {\n if (!this.triggeredFmp4Usage) {\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-fmp4'\n });\n this.triggeredFmp4Usage = true;\n }\n });\n this.audioSegmentLoader_.on('ended', () => {\n this.logger_('audioSegmentLoader ended');\n this.onEndOfStream();\n });\n }\n mediaSecondsLoaded_() {\n return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded + this.mainSegmentLoader_.mediaSecondsLoaded);\n }\n /**\n * Call load on our SegmentLoaders\n */\n\n load() {\n this.mainSegmentLoader_.load();\n if (this.mediaTypes_.AUDIO.activePlaylistLoader) {\n this.audioSegmentLoader_.load();\n }\n if (this.mediaTypes_.SUBTITLES.activePlaylistLoader) {\n this.subtitleSegmentLoader_.load();\n }\n }\n /**\n * Re-tune playback quality level for the current player\n * conditions. This will reset the main segment loader\n * and the next segment position to the currentTime.\n * This is good for manual quality changes.\n *\n * @private\n */\n\n fastQualityChange_(media = this.selectPlaylist()) {\n if (media === this.mainPlaylistLoader_.media()) {\n this.logger_('skipping fastQualityChange because new media is same as old');\n return;\n }\n this.switchMedia_(media, 'fast-quality'); // Reset main segment loader properties and next segment position information.\n // Don't need to reset audio as it is reset when media changes.\n // We resetLoaderProperties separately here as we want to fetch init segments if\n // necessary and ensure we're not in an ended state when we switch playlists.\n\n this.resetMainLoaderReplaceSegments();\n }\n /**\n * Sets the replaceUntil flag on the main segment soader to the buffered end\n * and resets the main segment loaders properties.\n */\n\n resetMainLoaderReplaceSegments() {\n const buffered = this.tech_.buffered();\n const bufferedEnd = buffered.end(buffered.length - 1); // Set the replace segments flag to the buffered end, this forces fetchAtBuffer\n // on the main loader to remain, false after the resetLoader call, until we have\n // replaced all content buffered ahead of the currentTime.\n\n this.mainSegmentLoader_.replaceSegmentsUntil = bufferedEnd;\n this.mainSegmentLoader_.resetLoaderProperties();\n this.mainSegmentLoader_.resetLoader();\n }\n /**\n * Begin playback.\n */\n\n play() {\n if (this.setupFirstPlay()) {\n return;\n }\n if (this.tech_.ended()) {\n this.tech_.setCurrentTime(0);\n }\n if (this.hasPlayed_) {\n this.load();\n }\n const seekable = this.tech_.seekable(); // if the viewer has paused and we fell out of the live window,\n // seek forward to the live point\n\n if (this.tech_.duration() === Infinity) {\n if (this.tech_.currentTime() < seekable.start(0)) {\n return this.tech_.setCurrentTime(seekable.end(seekable.length - 1));\n }\n }\n }\n /**\n * Seek to the latest media position if this is a live video and the\n * player and video are loaded and initialized.\n */\n\n setupFirstPlay() {\n const media = this.mainPlaylistLoader_.media(); // Check that everything is ready to begin buffering for the first call to play\n // If 1) there is no active media\n // 2) the player is paused\n // 3) the first play has already been setup\n // then exit early\n\n if (!media || this.tech_.paused() || this.hasPlayed_) {\n return false;\n } // when the video is a live stream and/or has a start time\n\n if (!media.endList || media.start) {\n const seekable = this.seekable();\n if (!seekable.length) {\n // without a seekable range, the player cannot seek to begin buffering at the\n // live or start point\n return false;\n }\n const seekableEnd = seekable.end(0);\n let startPoint = seekableEnd;\n if (media.start) {\n const offset = media.start.timeOffset;\n if (offset < 0) {\n startPoint = Math.max(seekableEnd + offset, seekable.start(0));\n } else {\n startPoint = Math.min(seekableEnd, offset);\n }\n } // trigger firstplay to inform the source handler to ignore the next seek event\n\n this.trigger('firstplay'); // seek to the live point\n\n this.tech_.setCurrentTime(startPoint);\n }\n this.hasPlayed_ = true; // we can begin loading now that everything is ready\n\n this.load();\n return true;\n }\n /**\n * handle the sourceopen event on the MediaSource\n *\n * @private\n */\n\n handleSourceOpen_() {\n // Only attempt to create the source buffer if none already exist.\n // handleSourceOpen is also called when we are \"re-opening\" a source buffer\n // after `endOfStream` has been called (in response to a seek for instance)\n this.tryToCreateSourceBuffers_(); // if autoplay is enabled, begin playback. This is duplicative of\n // code in video.js but is required because play() must be invoked\n // *after* the media source has opened.\n\n if (this.tech_.autoplay()) {\n const playPromise = this.tech_.play(); // Catch/silence error when a pause interrupts a play request\n // on browsers which return a promise\n\n if (typeof playPromise !== 'undefined' && typeof playPromise.then === 'function') {\n playPromise.then(null, e => {});\n }\n }\n this.trigger('sourceopen');\n }\n /**\n * handle the sourceended event on the MediaSource\n *\n * @private\n */\n\n handleSourceEnded_() {\n if (!this.inbandTextTracks_.metadataTrack_) {\n return;\n }\n const cues = this.inbandTextTracks_.metadataTrack_.cues;\n if (!cues || !cues.length) {\n return;\n }\n const duration = this.duration();\n cues[cues.length - 1].endTime = isNaN(duration) || Math.abs(duration) === Infinity ? Number.MAX_VALUE : duration;\n }\n /**\n * handle the durationchange event on the MediaSource\n *\n * @private\n */\n\n handleDurationChange_() {\n this.tech_.trigger('durationchange');\n }\n /**\n * Calls endOfStream on the media source when all active stream types have called\n * endOfStream\n *\n * @param {string} streamType\n * Stream type of the segment loader that called endOfStream\n * @private\n */\n\n onEndOfStream() {\n let isEndOfStream = this.mainSegmentLoader_.ended_;\n if (this.mediaTypes_.AUDIO.activePlaylistLoader) {\n const mainMediaInfo = this.mainSegmentLoader_.getCurrentMediaInfo_(); // if the audio playlist loader exists, then alternate audio is active\n\n if (!mainMediaInfo || mainMediaInfo.hasVideo) {\n // if we do not know if the main segment loader contains video yet or if we\n // definitively know the main segment loader contains video, then we need to wait\n // for both main and audio segment loaders to call endOfStream\n isEndOfStream = isEndOfStream && this.audioSegmentLoader_.ended_;\n } else {\n // otherwise just rely on the audio loader\n isEndOfStream = this.audioSegmentLoader_.ended_;\n }\n }\n if (!isEndOfStream) {\n return;\n }\n this.stopABRTimer_();\n this.sourceUpdater_.endOfStream();\n }\n /**\n * Check if a playlist has stopped being updated\n *\n * @param {Object} playlist the media playlist object\n * @return {boolean} whether the playlist has stopped being updated or not\n */\n\n stuckAtPlaylistEnd_(playlist) {\n const seekable = this.seekable();\n if (!seekable.length) {\n // playlist doesn't have enough information to determine whether we are stuck\n return false;\n }\n const expired = this.syncController_.getExpiredTime(playlist, this.duration());\n if (expired === null) {\n return false;\n } // does not use the safe live end to calculate playlist end, since we\n // don't want to say we are stuck while there is still content\n\n const absolutePlaylistEnd = Vhs$1.Playlist.playlistEnd(playlist, expired);\n const currentTime = this.tech_.currentTime();\n const buffered = this.tech_.buffered();\n if (!buffered.length) {\n // return true if the playhead reached the absolute end of the playlist\n return absolutePlaylistEnd - currentTime <= SAFE_TIME_DELTA;\n }\n const bufferedEnd = buffered.end(buffered.length - 1); // return true if there is too little buffer left and buffer has reached absolute\n // end of playlist\n\n return bufferedEnd - currentTime <= SAFE_TIME_DELTA && absolutePlaylistEnd - bufferedEnd <= SAFE_TIME_DELTA;\n }\n /**\n * Exclude a playlist for a set amount of time, making it unavailable for selection by\n * the rendition selection algorithm, then force a new playlist (rendition) selection.\n *\n * @param {Object=} playlistToExclude\n * the playlist to exclude, defaults to the currently selected playlist\n * @param {Object=} error\n * an optional error\n * @param {number=} playlistExclusionDuration\n * an optional number of seconds to exclude the playlist\n */\n\n excludePlaylist({\n playlistToExclude = this.mainPlaylistLoader_.media(),\n error = {},\n playlistExclusionDuration\n }) {\n // If the `error` was generated by the playlist loader, it will contain\n // the playlist we were trying to load (but failed) and that should be\n // excluded instead of the currently selected playlist which is likely\n // out-of-date in this scenario\n playlistToExclude = playlistToExclude || this.mainPlaylistLoader_.media();\n playlistExclusionDuration = playlistExclusionDuration || error.playlistExclusionDuration || this.playlistExclusionDuration; // If there is no current playlist, then an error occurred while we were\n // trying to load the main OR while we were disposing of the tech\n\n if (!playlistToExclude) {\n this.error = error;\n if (this.mediaSource.readyState !== 'open') {\n this.trigger('error');\n } else {\n this.sourceUpdater_.endOfStream('network');\n }\n return;\n }\n playlistToExclude.playlistErrors_++;\n const playlists = this.mainPlaylistLoader_.main.playlists;\n const enabledPlaylists = playlists.filter(isEnabled);\n const isFinalRendition = enabledPlaylists.length === 1 && enabledPlaylists[0] === playlistToExclude; // Don't exclude the only playlist unless it was excluded\n // forever\n\n if (playlists.length === 1 && playlistExclusionDuration !== Infinity) {\n videojs.log.warn(`Problem encountered with playlist ${playlistToExclude.id}. ` + 'Trying again since it is the only playlist.');\n this.tech_.trigger('retryplaylist'); // if this is a final rendition, we should delay\n\n return this.mainPlaylistLoader_.load(isFinalRendition);\n }\n if (isFinalRendition) {\n // If we're content steering, try other pathways.\n if (this.main().contentSteering) {\n const pathway = this.pathwayAttribute_(playlistToExclude); // Ignore at least 1 steering manifest refresh.\n\n const reIncludeDelay = this.contentSteeringController_.steeringManifest.ttl * 1000;\n this.contentSteeringController_.excludePathway(pathway);\n this.excludeThenChangePathway_();\n setTimeout(() => {\n this.contentSteeringController_.addAvailablePathway(pathway);\n }, reIncludeDelay);\n return;\n } // Since we're on the final non-excluded playlist, and we're about to exclude\n // it, instead of erring the player or retrying this playlist, clear out the current\n // exclusion list. This allows other playlists to be attempted in case any have been\n // fixed.\n\n let reincluded = false;\n playlists.forEach(playlist => {\n // skip current playlist which is about to be excluded\n if (playlist === playlistToExclude) {\n return;\n }\n const excludeUntil = playlist.excludeUntil; // a playlist cannot be reincluded if it wasn't excluded to begin with.\n\n if (typeof excludeUntil !== 'undefined' && excludeUntil !== Infinity) {\n reincluded = true;\n delete playlist.excludeUntil;\n }\n });\n if (reincluded) {\n videojs.log.warn('Removing other playlists from the exclusion list because the last ' + 'rendition is about to be excluded.'); // Technically we are retrying a playlist, in that we are simply retrying a previous\n // playlist. This is needed for users relying on the retryplaylist event to catch a\n // case where the player might be stuck and looping through \"dead\" playlists.\n\n this.tech_.trigger('retryplaylist');\n }\n } // Exclude this playlist\n\n let excludeUntil;\n if (playlistToExclude.playlistErrors_ > this.maxPlaylistRetries) {\n excludeUntil = Infinity;\n } else {\n excludeUntil = Date.now() + playlistExclusionDuration * 1000;\n }\n playlistToExclude.excludeUntil = excludeUntil;\n if (error.reason) {\n playlistToExclude.lastExcludeReason_ = error.reason;\n }\n this.tech_.trigger('excludeplaylist');\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-rendition-excluded'\n }); // TODO: only load a new playlist if we're excluding the current playlist\n // If this function was called with a playlist that's not the current active playlist\n // (e.g., media().id !== playlistToExclude.id),\n // then a new playlist should not be selected and loaded, as there's nothing wrong with the current playlist.\n\n const nextPlaylist = this.selectPlaylist();\n if (!nextPlaylist) {\n this.error = 'Playback cannot continue. No available working or supported playlists.';\n this.trigger('error');\n return;\n }\n const logFn = error.internal ? this.logger_ : videojs.log.warn;\n const errorMessage = error.message ? ' ' + error.message : '';\n logFn(`${error.internal ? 'Internal problem' : 'Problem'} encountered with playlist ${playlistToExclude.id}.` + `${errorMessage} Switching to playlist ${nextPlaylist.id}.`); // if audio group changed reset audio loaders\n\n if (nextPlaylist.attributes.AUDIO !== playlistToExclude.attributes.AUDIO) {\n this.delegateLoaders_('audio', ['abort', 'pause']);\n } // if subtitle group changed reset subtitle loaders\n\n if (nextPlaylist.attributes.SUBTITLES !== playlistToExclude.attributes.SUBTITLES) {\n this.delegateLoaders_('subtitle', ['abort', 'pause']);\n }\n this.delegateLoaders_('main', ['abort', 'pause']);\n const delayDuration = nextPlaylist.targetDuration / 2 * 1000 || 5 * 1000;\n const shouldDelay = typeof nextPlaylist.lastRequest === 'number' && Date.now() - nextPlaylist.lastRequest <= delayDuration; // delay if it's a final rendition or if the last refresh is sooner than half targetDuration\n\n return this.switchMedia_(nextPlaylist, 'exclude', isFinalRendition || shouldDelay);\n }\n /**\n * Pause all segment/playlist loaders\n */\n\n pauseLoading() {\n this.delegateLoaders_('all', ['abort', 'pause']);\n this.stopABRTimer_();\n }\n /**\n * Call a set of functions in order on playlist loaders, segment loaders,\n * or both types of loaders.\n *\n * @param {string} filter\n * Filter loaders that should call fnNames using a string. Can be:\n * * all - run on all loaders\n * * audio - run on all audio loaders\n * * subtitle - run on all subtitle loaders\n * * main - run on the main loaders\n *\n * @param {Array|string} fnNames\n * A string or array of function names to call.\n */\n\n delegateLoaders_(filter, fnNames) {\n const loaders = [];\n const dontFilterPlaylist = filter === 'all';\n if (dontFilterPlaylist || filter === 'main') {\n loaders.push(this.mainPlaylistLoader_);\n }\n const mediaTypes = [];\n if (dontFilterPlaylist || filter === 'audio') {\n mediaTypes.push('AUDIO');\n }\n if (dontFilterPlaylist || filter === 'subtitle') {\n mediaTypes.push('CLOSED-CAPTIONS');\n mediaTypes.push('SUBTITLES');\n }\n mediaTypes.forEach(mediaType => {\n const loader = this.mediaTypes_[mediaType] && this.mediaTypes_[mediaType].activePlaylistLoader;\n if (loader) {\n loaders.push(loader);\n }\n });\n ['main', 'audio', 'subtitle'].forEach(name => {\n const loader = this[`${name}SegmentLoader_`];\n if (loader && (filter === name || filter === 'all')) {\n loaders.push(loader);\n }\n });\n loaders.forEach(loader => fnNames.forEach(fnName => {\n if (typeof loader[fnName] === 'function') {\n loader[fnName]();\n }\n }));\n }\n /**\n * set the current time on all segment loaders\n *\n * @param {TimeRange} currentTime the current time to set\n * @return {TimeRange} the current time\n */\n\n setCurrentTime(currentTime) {\n const buffered = findRange(this.tech_.buffered(), currentTime);\n if (!(this.mainPlaylistLoader_ && this.mainPlaylistLoader_.media())) {\n // return immediately if the metadata is not ready yet\n return 0;\n } // it's clearly an edge-case but don't thrown an error if asked to\n // seek within an empty playlist\n\n if (!this.mainPlaylistLoader_.media().segments) {\n return 0;\n } // if the seek location is already buffered, continue buffering as usual\n\n if (buffered && buffered.length) {\n return currentTime;\n } // cancel outstanding requests so we begin buffering at the new\n // location\n\n this.mainSegmentLoader_.resetEverything();\n if (this.mediaTypes_.AUDIO.activePlaylistLoader) {\n this.audioSegmentLoader_.resetEverything();\n }\n if (this.mediaTypes_.SUBTITLES.activePlaylistLoader) {\n this.subtitleSegmentLoader_.resetEverything();\n } // start segment loader loading in case they are paused\n\n this.load();\n }\n /**\n * get the current duration\n *\n * @return {TimeRange} the duration\n */\n\n duration() {\n if (!this.mainPlaylistLoader_) {\n return 0;\n }\n const media = this.mainPlaylistLoader_.media();\n if (!media) {\n // no playlists loaded yet, so can't determine a duration\n return 0;\n } // Don't rely on the media source for duration in the case of a live playlist since\n // setting the native MediaSource's duration to infinity ends up with consequences to\n // seekable behavior. See https://github.com/w3c/media-source/issues/5 for details.\n //\n // This is resolved in the spec by https://github.com/w3c/media-source/pull/92,\n // however, few browsers have support for setLiveSeekableRange()\n // https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/setLiveSeekableRange\n //\n // Until a time when the duration of the media source can be set to infinity, and a\n // seekable range specified across browsers, just return Infinity.\n\n if (!media.endList) {\n return Infinity;\n } // Since this is a VOD video, it is safe to rely on the media source's duration (if\n // available). If it's not available, fall back to a playlist-calculated estimate.\n\n if (this.mediaSource) {\n return this.mediaSource.duration;\n }\n return Vhs$1.Playlist.duration(media);\n }\n /**\n * check the seekable range\n *\n * @return {TimeRange} the seekable range\n */\n\n seekable() {\n return this.seekable_;\n }\n onSyncInfoUpdate_() {\n let audioSeekable; // TODO check for creation of both source buffers before updating seekable\n //\n // A fix was made to this function where a check for\n // this.sourceUpdater_.hasCreatedSourceBuffers\n // was added to ensure that both source buffers were created before seekable was\n // updated. However, it originally had a bug where it was checking for a true and\n // returning early instead of checking for false. Setting it to check for false to\n // return early though created other issues. A call to play() would check for seekable\n // end without verifying that a seekable range was present. In addition, even checking\n // for that didn't solve some issues, as handleFirstPlay is sometimes worked around\n // due to a media update calling load on the segment loaders, skipping a seek to live,\n // thereby starting live streams at the beginning of the stream rather than at the end.\n //\n // This conditional should be fixed to wait for the creation of two source buffers at\n // the same time as the other sections of code are fixed to properly seek to live and\n // not throw an error due to checking for a seekable end when no seekable range exists.\n //\n // For now, fall back to the older behavior, with the understanding that the seekable\n // range may not be completely correct, leading to a suboptimal initial live point.\n\n if (!this.mainPlaylistLoader_) {\n return;\n }\n let media = this.mainPlaylistLoader_.media();\n if (!media) {\n return;\n }\n let expired = this.syncController_.getExpiredTime(media, this.duration());\n if (expired === null) {\n // not enough information to update seekable\n return;\n }\n const main = this.mainPlaylistLoader_.main;\n const mainSeekable = Vhs$1.Playlist.seekable(media, expired, Vhs$1.Playlist.liveEdgeDelay(main, media));\n if (mainSeekable.length === 0) {\n return;\n }\n if (this.mediaTypes_.AUDIO.activePlaylistLoader) {\n media = this.mediaTypes_.AUDIO.activePlaylistLoader.media();\n expired = this.syncController_.getExpiredTime(media, this.duration());\n if (expired === null) {\n return;\n }\n audioSeekable = Vhs$1.Playlist.seekable(media, expired, Vhs$1.Playlist.liveEdgeDelay(main, media));\n if (audioSeekable.length === 0) {\n return;\n }\n }\n let oldEnd;\n let oldStart;\n if (this.seekable_ && this.seekable_.length) {\n oldEnd = this.seekable_.end(0);\n oldStart = this.seekable_.start(0);\n }\n if (!audioSeekable) {\n // seekable has been calculated based on buffering video data so it\n // can be returned directly\n this.seekable_ = mainSeekable;\n } else if (audioSeekable.start(0) > mainSeekable.end(0) || mainSeekable.start(0) > audioSeekable.end(0)) {\n // seekables are pretty far off, rely on main\n this.seekable_ = mainSeekable;\n } else {\n this.seekable_ = createTimeRanges([[audioSeekable.start(0) > mainSeekable.start(0) ? audioSeekable.start(0) : mainSeekable.start(0), audioSeekable.end(0) < mainSeekable.end(0) ? audioSeekable.end(0) : mainSeekable.end(0)]]);\n } // seekable is the same as last time\n\n if (this.seekable_ && this.seekable_.length) {\n if (this.seekable_.end(0) === oldEnd && this.seekable_.start(0) === oldStart) {\n return;\n }\n }\n this.logger_(`seekable updated [${printableRange(this.seekable_)}]`);\n this.tech_.trigger('seekablechanged');\n }\n /**\n * Update the player duration\n */\n\n updateDuration(isLive) {\n if (this.updateDuration_) {\n this.mediaSource.removeEventListener('sourceopen', this.updateDuration_);\n this.updateDuration_ = null;\n }\n if (this.mediaSource.readyState !== 'open') {\n this.updateDuration_ = this.updateDuration.bind(this, isLive);\n this.mediaSource.addEventListener('sourceopen', this.updateDuration_);\n return;\n }\n if (isLive) {\n const seekable = this.seekable();\n if (!seekable.length) {\n return;\n } // Even in the case of a live playlist, the native MediaSource's duration should not\n // be set to Infinity (even though this would be expected for a live playlist), since\n // setting the native MediaSource's duration to infinity ends up with consequences to\n // seekable behavior. See https://github.com/w3c/media-source/issues/5 for details.\n //\n // This is resolved in the spec by https://github.com/w3c/media-source/pull/92,\n // however, few browsers have support for setLiveSeekableRange()\n // https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/setLiveSeekableRange\n //\n // Until a time when the duration of the media source can be set to infinity, and a\n // seekable range specified across browsers, the duration should be greater than or\n // equal to the last possible seekable value.\n // MediaSource duration starts as NaN\n // It is possible (and probable) that this case will never be reached for many\n // sources, since the MediaSource reports duration as the highest value without\n // accounting for timestamp offset. For example, if the timestamp offset is -100 and\n // we buffered times 0 to 100 with real times of 100 to 200, even though current\n // time will be between 0 and 100, the native media source may report the duration\n // as 200. However, since we report duration separate from the media source (as\n // Infinity), and as long as the native media source duration value is greater than\n // our reported seekable range, seeks will work as expected. The large number as\n // duration for live is actually a strategy used by some players to work around the\n // issue of live seekable ranges cited above.\n\n if (isNaN(this.mediaSource.duration) || this.mediaSource.duration < seekable.end(seekable.length - 1)) {\n this.sourceUpdater_.setDuration(seekable.end(seekable.length - 1));\n }\n return;\n }\n const buffered = this.tech_.buffered();\n let duration = Vhs$1.Playlist.duration(this.mainPlaylistLoader_.media());\n if (buffered.length > 0) {\n duration = Math.max(duration, buffered.end(buffered.length - 1));\n }\n if (this.mediaSource.duration !== duration) {\n this.sourceUpdater_.setDuration(duration);\n }\n }\n /**\n * dispose of the PlaylistController and everything\n * that it controls\n */\n\n dispose() {\n this.trigger('dispose');\n this.decrypter_.terminate();\n this.mainPlaylistLoader_.dispose();\n this.mainSegmentLoader_.dispose();\n this.contentSteeringController_.dispose();\n if (this.loadOnPlay_) {\n this.tech_.off('play', this.loadOnPlay_);\n }\n ['AUDIO', 'SUBTITLES'].forEach(type => {\n const groups = this.mediaTypes_[type].groups;\n for (const id in groups) {\n groups[id].forEach(group => {\n if (group.playlistLoader) {\n group.playlistLoader.dispose();\n }\n });\n }\n });\n this.audioSegmentLoader_.dispose();\n this.subtitleSegmentLoader_.dispose();\n this.sourceUpdater_.dispose();\n this.timelineChangeController_.dispose();\n this.stopABRTimer_();\n if (this.updateDuration_) {\n this.mediaSource.removeEventListener('sourceopen', this.updateDuration_);\n }\n this.mediaSource.removeEventListener('durationchange', this.handleDurationChange_); // load the media source into the player\n\n this.mediaSource.removeEventListener('sourceopen', this.handleSourceOpen_);\n this.mediaSource.removeEventListener('sourceended', this.handleSourceEnded_);\n this.off();\n }\n /**\n * return the main playlist object if we have one\n *\n * @return {Object} the main playlist object that we parsed\n */\n\n main() {\n return this.mainPlaylistLoader_.main;\n }\n /**\n * return the currently selected playlist\n *\n * @return {Object} the currently selected playlist object that we parsed\n */\n\n media() {\n // playlist loader will not return media if it has not been fully loaded\n return this.mainPlaylistLoader_.media() || this.initialMedia_;\n }\n areMediaTypesKnown_() {\n const usingAudioLoader = !!this.mediaTypes_.AUDIO.activePlaylistLoader;\n const hasMainMediaInfo = !!this.mainSegmentLoader_.getCurrentMediaInfo_(); // if we are not using an audio loader, then we have audio media info\n // otherwise check on the segment loader.\n\n const hasAudioMediaInfo = !usingAudioLoader ? true : !!this.audioSegmentLoader_.getCurrentMediaInfo_(); // one or both loaders has not loaded sufficently to get codecs\n\n if (!hasMainMediaInfo || !hasAudioMediaInfo) {\n return false;\n }\n return true;\n }\n getCodecsOrExclude_() {\n const media = {\n main: this.mainSegmentLoader_.getCurrentMediaInfo_() || {},\n audio: this.audioSegmentLoader_.getCurrentMediaInfo_() || {}\n };\n const playlist = this.mainSegmentLoader_.getPendingSegmentPlaylist() || this.media(); // set \"main\" media equal to video\n\n media.video = media.main;\n const playlistCodecs = codecsForPlaylist(this.main(), playlist);\n const codecs = {};\n const usingAudioLoader = !!this.mediaTypes_.AUDIO.activePlaylistLoader;\n if (media.main.hasVideo) {\n codecs.video = playlistCodecs.video || media.main.videoCodec || DEFAULT_VIDEO_CODEC;\n }\n if (media.main.isMuxed) {\n codecs.video += `,${playlistCodecs.audio || media.main.audioCodec || DEFAULT_AUDIO_CODEC}`;\n }\n if (media.main.hasAudio && !media.main.isMuxed || media.audio.hasAudio || usingAudioLoader) {\n codecs.audio = playlistCodecs.audio || media.main.audioCodec || media.audio.audioCodec || DEFAULT_AUDIO_CODEC; // set audio isFmp4 so we use the correct \"supports\" function below\n\n media.audio.isFmp4 = media.main.hasAudio && !media.main.isMuxed ? media.main.isFmp4 : media.audio.isFmp4;\n } // no codecs, no playback.\n\n if (!codecs.audio && !codecs.video) {\n this.excludePlaylist({\n playlistToExclude: playlist,\n error: {\n message: 'Could not determine codecs for playlist.'\n },\n playlistExclusionDuration: Infinity\n });\n return;\n } // fmp4 relies on browser support, while ts relies on muxer support\n\n const supportFunction = (isFmp4, codec) => isFmp4 ? browserSupportsCodec(codec) : muxerSupportsCodec(codec);\n const unsupportedCodecs = {};\n let unsupportedAudio;\n ['video', 'audio'].forEach(function (type) {\n if (codecs.hasOwnProperty(type) && !supportFunction(media[type].isFmp4, codecs[type])) {\n const supporter = media[type].isFmp4 ? 'browser' : 'muxer';\n unsupportedCodecs[supporter] = unsupportedCodecs[supporter] || [];\n unsupportedCodecs[supporter].push(codecs[type]);\n if (type === 'audio') {\n unsupportedAudio = supporter;\n }\n }\n });\n if (usingAudioLoader && unsupportedAudio && playlist.attributes.AUDIO) {\n const audioGroup = playlist.attributes.AUDIO;\n this.main().playlists.forEach(variant => {\n const variantAudioGroup = variant.attributes && variant.attributes.AUDIO;\n if (variantAudioGroup === audioGroup && variant !== playlist) {\n variant.excludeUntil = Infinity;\n }\n });\n this.logger_(`excluding audio group ${audioGroup} as ${unsupportedAudio} does not support codec(s): \"${codecs.audio}\"`);\n } // if we have any unsupported codecs exclude this playlist.\n\n if (Object.keys(unsupportedCodecs).length) {\n const message = Object.keys(unsupportedCodecs).reduce((acc, supporter) => {\n if (acc) {\n acc += ', ';\n }\n acc += `${supporter} does not support codec(s): \"${unsupportedCodecs[supporter].join(',')}\"`;\n return acc;\n }, '') + '.';\n this.excludePlaylist({\n playlistToExclude: playlist,\n error: {\n internal: true,\n message\n },\n playlistExclusionDuration: Infinity\n });\n return;\n } // check if codec switching is happening\n\n if (this.sourceUpdater_.hasCreatedSourceBuffers() && !this.sourceUpdater_.canChangeType()) {\n const switchMessages = [];\n ['video', 'audio'].forEach(type => {\n const newCodec = (parseCodecs(this.sourceUpdater_.codecs[type] || '')[0] || {}).type;\n const oldCodec = (parseCodecs(codecs[type] || '')[0] || {}).type;\n if (newCodec && oldCodec && newCodec.toLowerCase() !== oldCodec.toLowerCase()) {\n switchMessages.push(`\"${this.sourceUpdater_.codecs[type]}\" -> \"${codecs[type]}\"`);\n }\n });\n if (switchMessages.length) {\n this.excludePlaylist({\n playlistToExclude: playlist,\n error: {\n message: `Codec switching not supported: ${switchMessages.join(', ')}.`,\n internal: true\n },\n playlistExclusionDuration: Infinity\n });\n return;\n }\n } // TODO: when using the muxer shouldn't we just return\n // the codecs that the muxer outputs?\n\n return codecs;\n }\n /**\n * Create source buffers and exlude any incompatible renditions.\n *\n * @private\n */\n\n tryToCreateSourceBuffers_() {\n // media source is not ready yet or sourceBuffers are already\n // created.\n if (this.mediaSource.readyState !== 'open' || this.sourceUpdater_.hasCreatedSourceBuffers()) {\n return;\n }\n if (!this.areMediaTypesKnown_()) {\n return;\n }\n const codecs = this.getCodecsOrExclude_(); // no codecs means that the playlist was excluded\n\n if (!codecs) {\n return;\n }\n this.sourceUpdater_.createSourceBuffers(codecs);\n const codecString = [codecs.video, codecs.audio].filter(Boolean).join(',');\n this.excludeIncompatibleVariants_(codecString);\n }\n /**\n * Excludes playlists with codecs that are unsupported by the muxer and browser.\n */\n\n excludeUnsupportedVariants_() {\n const playlists = this.main().playlists;\n const ids = []; // TODO: why don't we have a property to loop through all\n // playlist? Why did we ever mix indexes and keys?\n\n Object.keys(playlists).forEach(key => {\n const variant = playlists[key]; // check if we already processed this playlist.\n\n if (ids.indexOf(variant.id) !== -1) {\n return;\n }\n ids.push(variant.id);\n const codecs = codecsForPlaylist(this.main, variant);\n const unsupported = [];\n if (codecs.audio && !muxerSupportsCodec(codecs.audio) && !browserSupportsCodec(codecs.audio)) {\n unsupported.push(`audio codec ${codecs.audio}`);\n }\n if (codecs.video && !muxerSupportsCodec(codecs.video) && !browserSupportsCodec(codecs.video)) {\n unsupported.push(`video codec ${codecs.video}`);\n }\n if (codecs.text && codecs.text === 'stpp.ttml.im1t') {\n unsupported.push(`text codec ${codecs.text}`);\n }\n if (unsupported.length) {\n variant.excludeUntil = Infinity;\n this.logger_(`excluding ${variant.id} for unsupported: ${unsupported.join(', ')}`);\n }\n });\n }\n /**\n * Exclude playlists that are known to be codec or\n * stream-incompatible with the SourceBuffer configuration. For\n * instance, Media Source Extensions would cause the video element to\n * stall waiting for video data if you switched from a variant with\n * video and audio to an audio-only one.\n *\n * @param {Object} media a media playlist compatible with the current\n * set of SourceBuffers. Variants in the current main playlist that\n * do not appear to have compatible codec or stream configurations\n * will be excluded from the default playlist selection algorithm\n * indefinitely.\n * @private\n */\n\n excludeIncompatibleVariants_(codecString) {\n const ids = [];\n const playlists = this.main().playlists;\n const codecs = unwrapCodecList(parseCodecs(codecString));\n const codecCount_ = codecCount(codecs);\n const videoDetails = codecs.video && parseCodecs(codecs.video)[0] || null;\n const audioDetails = codecs.audio && parseCodecs(codecs.audio)[0] || null;\n Object.keys(playlists).forEach(key => {\n const variant = playlists[key]; // check if we already processed this playlist.\n // or it if it is already excluded forever.\n\n if (ids.indexOf(variant.id) !== -1 || variant.excludeUntil === Infinity) {\n return;\n }\n ids.push(variant.id);\n const exclusionReasons = []; // get codecs from the playlist for this variant\n\n const variantCodecs = codecsForPlaylist(this.mainPlaylistLoader_.main, variant);\n const variantCodecCount = codecCount(variantCodecs); // if no codecs are listed, we cannot determine that this\n // variant is incompatible. Wait for mux.js to probe\n\n if (!variantCodecs.audio && !variantCodecs.video) {\n return;\n } // TODO: we can support this by removing the\n // old media source and creating a new one, but it will take some work.\n // The number of streams cannot change\n\n if (variantCodecCount !== codecCount_) {\n exclusionReasons.push(`codec count \"${variantCodecCount}\" !== \"${codecCount_}\"`);\n } // only exclude playlists by codec change, if codecs cannot switch\n // during playback.\n\n if (!this.sourceUpdater_.canChangeType()) {\n const variantVideoDetails = variantCodecs.video && parseCodecs(variantCodecs.video)[0] || null;\n const variantAudioDetails = variantCodecs.audio && parseCodecs(variantCodecs.audio)[0] || null; // the video codec cannot change\n\n if (variantVideoDetails && videoDetails && variantVideoDetails.type.toLowerCase() !== videoDetails.type.toLowerCase()) {\n exclusionReasons.push(`video codec \"${variantVideoDetails.type}\" !== \"${videoDetails.type}\"`);\n } // the audio codec cannot change\n\n if (variantAudioDetails && audioDetails && variantAudioDetails.type.toLowerCase() !== audioDetails.type.toLowerCase()) {\n exclusionReasons.push(`audio codec \"${variantAudioDetails.type}\" !== \"${audioDetails.type}\"`);\n }\n }\n if (exclusionReasons.length) {\n variant.excludeUntil = Infinity;\n this.logger_(`excluding ${variant.id}: ${exclusionReasons.join(' && ')}`);\n }\n });\n }\n updateAdCues_(media) {\n let offset = 0;\n const seekable = this.seekable();\n if (seekable.length) {\n offset = seekable.start(0);\n }\n updateAdCues(media, this.cueTagsTrack_, offset);\n }\n /**\n * Calculates the desired forward buffer length based on current time\n *\n * @return {number} Desired forward buffer length in seconds\n */\n\n goalBufferLength() {\n const currentTime = this.tech_.currentTime();\n const initial = Config.GOAL_BUFFER_LENGTH;\n const rate = Config.GOAL_BUFFER_LENGTH_RATE;\n const max = Math.max(initial, Config.MAX_GOAL_BUFFER_LENGTH);\n return Math.min(initial + currentTime * rate, max);\n }\n /**\n * Calculates the desired buffer low water line based on current time\n *\n * @return {number} Desired buffer low water line in seconds\n */\n\n bufferLowWaterLine() {\n const currentTime = this.tech_.currentTime();\n const initial = Config.BUFFER_LOW_WATER_LINE;\n const rate = Config.BUFFER_LOW_WATER_LINE_RATE;\n const max = Math.max(initial, Config.MAX_BUFFER_LOW_WATER_LINE);\n const newMax = Math.max(initial, Config.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);\n return Math.min(initial + currentTime * rate, this.bufferBasedABR ? newMax : max);\n }\n bufferHighWaterLine() {\n return Config.BUFFER_HIGH_WATER_LINE;\n }\n addDateRangesToTextTrack_(dateRanges) {\n createMetadataTrackIfNotExists(this.inbandTextTracks_, 'com.apple.streaming', this.tech_);\n addDateRangeMetadata({\n inbandTextTracks: this.inbandTextTracks_,\n dateRanges\n });\n }\n addMetadataToTextTrack(dispatchType, metadataArray, videoDuration) {\n const timestampOffset = this.sourceUpdater_.videoBuffer ? this.sourceUpdater_.videoTimestampOffset() : this.sourceUpdater_.audioTimestampOffset(); // There's potentially an issue where we could double add metadata if there's a muxed\n // audio/video source with a metadata track, and an alt audio with a metadata track.\n // However, this probably won't happen, and if it does it can be handled then.\n\n createMetadataTrackIfNotExists(this.inbandTextTracks_, dispatchType, this.tech_);\n addMetadata({\n inbandTextTracks: this.inbandTextTracks_,\n metadataArray,\n timestampOffset,\n videoDuration\n });\n }\n pathwayAttribute_(playlist) {\n return playlist.attributes['PATHWAY-ID'] || playlist.attributes.serviceLocation;\n }\n /**\n * Initialize content steering listeners and apply the tag properties.\n */\n\n initContentSteeringController_() {\n const initialMain = this.main();\n if (!initialMain.contentSteering) {\n return;\n }\n const updateSteeringValues = main => {\n for (const playlist of main.playlists) {\n this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(playlist));\n }\n this.contentSteeringController_.assignTagProperties(main.uri, main.contentSteering);\n };\n updateSteeringValues(initialMain);\n this.contentSteeringController_.on('content-steering', this.excludeThenChangePathway_.bind(this)); // We need to ensure we update the content steering values when a new\n // manifest is loaded in live DASH with content steering.\n\n if (this.sourceType_ === 'dash') {\n this.mainPlaylistLoader_.on('mediaupdatetimeout', () => {\n this.mainPlaylistLoader_.refreshMedia_(this.mainPlaylistLoader_.media().id); // clear past values\n\n this.contentSteeringController_.abort();\n this.contentSteeringController_.clearTTLTimeout_();\n this.contentSteeringController_.clearAvailablePathways();\n updateSteeringValues(this.main());\n });\n } // Do this at startup only, after that the steering requests are managed by the Content Steering class.\n // DASH queryBeforeStart scenarios will be handled by the Content Steering class.\n\n if (!this.contentSteeringController_.queryBeforeStart) {\n this.tech_.one('canplay', () => {\n this.contentSteeringController_.requestSteeringManifest();\n });\n }\n }\n /**\n * Simple exclude and change playlist logic for content steering.\n */\n\n excludeThenChangePathway_() {\n const currentPathway = this.contentSteeringController_.getPathway();\n if (!currentPathway) {\n return;\n }\n const main = this.main();\n const playlists = main.playlists;\n const ids = new Set();\n let didEnablePlaylists = false;\n Object.keys(playlists).forEach(key => {\n const variant = playlists[key];\n const pathwayId = this.pathwayAttribute_(variant);\n const differentPathwayId = pathwayId && currentPathway !== pathwayId;\n const steeringExclusion = variant.excludeUntil === Infinity && variant.lastExcludeReason_ === 'content-steering';\n if (steeringExclusion && !differentPathwayId) {\n delete variant.excludeUntil;\n delete variant.lastExcludeReason_;\n didEnablePlaylists = true;\n }\n const noExcludeUntil = !variant.excludeUntil && variant.excludeUntil !== Infinity;\n const shouldExclude = !ids.has(variant.id) && differentPathwayId && noExcludeUntil;\n if (!shouldExclude) {\n return;\n }\n ids.add(variant.id);\n variant.excludeUntil = Infinity;\n variant.lastExcludeReason_ = 'content-steering'; // TODO: kind of spammy, maybe move this.\n\n this.logger_(`excluding ${variant.id} for ${variant.lastExcludeReason_}`);\n });\n if (this.contentSteeringController_.manifestType_ === 'DASH') {\n Object.keys(this.mediaTypes_).forEach(key => {\n const type = this.mediaTypes_[key];\n if (type.activePlaylistLoader) {\n const currentPlaylist = type.activePlaylistLoader.media_; // Check if the current media playlist matches the current CDN\n\n if (currentPlaylist && currentPlaylist.attributes.serviceLocation !== currentPathway) {\n didEnablePlaylists = true;\n }\n }\n });\n }\n if (didEnablePlaylists) {\n this.changeSegmentPathway_();\n }\n }\n /**\n * Changes the current playlists for audio, video and subtitles after a new pathway\n * is chosen from content steering.\n */\n\n changeSegmentPathway_() {\n const nextPlaylist = this.selectPlaylist();\n this.pauseLoading(); // Switch audio and text track playlists if necessary in DASH\n\n if (this.contentSteeringController_.manifestType_ === 'DASH') {\n this.switchMediaForDASHContentSteering_();\n }\n this.switchMedia_(nextPlaylist, 'content-steering');\n }\n}\n\n/**\n * Returns a function that acts as the Enable/disable playlist function.\n *\n * @param {PlaylistLoader} loader - The main playlist loader\n * @param {string} playlistID - id of the playlist\n * @param {Function} changePlaylistFn - A function to be called after a\n * playlist's enabled-state has been changed. Will NOT be called if a\n * playlist's enabled-state is unchanged\n * @param {boolean=} enable - Value to set the playlist enabled-state to\n * or if undefined returns the current enabled-state for the playlist\n * @return {Function} Function for setting/getting enabled\n */\n\nconst enableFunction = (loader, playlistID, changePlaylistFn) => enable => {\n const playlist = loader.main.playlists[playlistID];\n const incompatible = isIncompatible(playlist);\n const currentlyEnabled = isEnabled(playlist);\n if (typeof enable === 'undefined') {\n return currentlyEnabled;\n }\n if (enable) {\n delete playlist.disabled;\n } else {\n playlist.disabled = true;\n }\n if (enable !== currentlyEnabled && !incompatible) {\n // Ensure the outside world knows about our changes\n changePlaylistFn();\n if (enable) {\n loader.trigger('renditionenabled');\n } else {\n loader.trigger('renditiondisabled');\n }\n }\n return enable;\n};\n/**\n * The representation object encapsulates the publicly visible information\n * in a media playlist along with a setter/getter-type function (enabled)\n * for changing the enabled-state of a particular playlist entry\n *\n * @class Representation\n */\n\nclass Representation {\n constructor(vhsHandler, playlist, id) {\n const {\n playlistController_: pc\n } = vhsHandler;\n const qualityChangeFunction = pc.fastQualityChange_.bind(pc); // some playlist attributes are optional\n\n if (playlist.attributes) {\n const resolution = playlist.attributes.RESOLUTION;\n this.width = resolution && resolution.width;\n this.height = resolution && resolution.height;\n this.bandwidth = playlist.attributes.BANDWIDTH;\n this.frameRate = playlist.attributes['FRAME-RATE'];\n }\n this.codecs = codecsForPlaylist(pc.main(), playlist);\n this.playlist = playlist; // The id is simply the ordinality of the media playlist\n // within the main playlist\n\n this.id = id; // Partially-apply the enableFunction to create a playlist-\n // specific variant\n\n this.enabled = enableFunction(vhsHandler.playlists, playlist.id, qualityChangeFunction);\n }\n}\n/**\n * A mixin function that adds the `representations` api to an instance\n * of the VhsHandler class\n *\n * @param {VhsHandler} vhsHandler - An instance of VhsHandler to add the\n * representation API into\n */\n\nconst renditionSelectionMixin = function (vhsHandler) {\n // Add a single API-specific function to the VhsHandler instance\n vhsHandler.representations = () => {\n const main = vhsHandler.playlistController_.main();\n const playlists = isAudioOnly(main) ? vhsHandler.playlistController_.getAudioTrackPlaylists_() : main.playlists;\n if (!playlists) {\n return [];\n }\n return playlists.filter(media => !isIncompatible(media)).map((e, i) => new Representation(vhsHandler, e, e.id));\n };\n};\n\n/**\n * @file playback-watcher.js\n *\n * Playback starts, and now my watch begins. It shall not end until my death. I shall\n * take no wait, hold no uncleared timeouts, father no bad seeks. I shall wear no crowns\n * and win no glory. I shall live and die at my post. I am the corrector of the underflow.\n * I am the watcher of gaps. I am the shield that guards the realms of seekable. I pledge\n * my life and honor to the Playback Watch, for this Player and all the Players to come.\n */\n\nconst timerCancelEvents = ['seeking', 'seeked', 'pause', 'playing', 'error'];\n/**\n * @class PlaybackWatcher\n */\n\nclass PlaybackWatcher {\n /**\n * Represents an PlaybackWatcher object.\n *\n * @class\n * @param {Object} options an object that includes the tech and settings\n */\n constructor(options) {\n this.playlistController_ = options.playlistController;\n this.tech_ = options.tech;\n this.seekable = options.seekable;\n this.allowSeeksWithinUnsafeLiveWindow = options.allowSeeksWithinUnsafeLiveWindow;\n this.liveRangeSafeTimeDelta = options.liveRangeSafeTimeDelta;\n this.media = options.media;\n this.consecutiveUpdates = 0;\n this.lastRecordedTime = null;\n this.checkCurrentTimeTimeout_ = null;\n this.logger_ = logger('PlaybackWatcher');\n this.logger_('initialize');\n const playHandler = () => this.monitorCurrentTime_();\n const canPlayHandler = () => this.monitorCurrentTime_();\n const waitingHandler = () => this.techWaiting_();\n const cancelTimerHandler = () => this.resetTimeUpdate_();\n const pc = this.playlistController_;\n const loaderTypes = ['main', 'subtitle', 'audio'];\n const loaderChecks = {};\n loaderTypes.forEach(type => {\n loaderChecks[type] = {\n reset: () => this.resetSegmentDownloads_(type),\n updateend: () => this.checkSegmentDownloads_(type)\n };\n pc[`${type}SegmentLoader_`].on('appendsdone', loaderChecks[type].updateend); // If a rendition switch happens during a playback stall where the buffer\n // isn't changing we want to reset. We cannot assume that the new rendition\n // will also be stalled, until after new appends.\n\n pc[`${type}SegmentLoader_`].on('playlistupdate', loaderChecks[type].reset); // Playback stalls should not be detected right after seeking.\n // This prevents one segment playlists (single vtt or single segment content)\n // from being detected as stalling. As the buffer will not change in those cases, since\n // the buffer is the entire video duration.\n\n this.tech_.on(['seeked', 'seeking'], loaderChecks[type].reset);\n });\n /**\n * We check if a seek was into a gap through the following steps:\n * 1. We get a seeking event and we do not get a seeked event. This means that\n * a seek was attempted but not completed.\n * 2. We run `fixesBadSeeks_` on segment loader appends. This means that we already\n * removed everything from our buffer and appended a segment, and should be ready\n * to check for gaps.\n */\n\n const setSeekingHandlers = fn => {\n ['main', 'audio'].forEach(type => {\n pc[`${type}SegmentLoader_`][fn]('appended', this.seekingAppendCheck_);\n });\n };\n this.seekingAppendCheck_ = () => {\n if (this.fixesBadSeeks_()) {\n this.consecutiveUpdates = 0;\n this.lastRecordedTime = this.tech_.currentTime();\n setSeekingHandlers('off');\n }\n };\n this.clearSeekingAppendCheck_ = () => setSeekingHandlers('off');\n this.watchForBadSeeking_ = () => {\n this.clearSeekingAppendCheck_();\n setSeekingHandlers('on');\n };\n this.tech_.on('seeked', this.clearSeekingAppendCheck_);\n this.tech_.on('seeking', this.watchForBadSeeking_);\n this.tech_.on('waiting', waitingHandler);\n this.tech_.on(timerCancelEvents, cancelTimerHandler);\n this.tech_.on('canplay', canPlayHandler);\n /*\n An edge case exists that results in gaps not being skipped when they exist at the beginning of a stream. This case\n is surfaced in one of two ways:\n 1) The `waiting` event is fired before the player has buffered content, making it impossible\n to find or skip the gap. The `waiting` event is followed by a `play` event. On first play\n we can check if playback is stalled due to a gap, and skip the gap if necessary.\n 2) A source with a gap at the beginning of the stream is loaded programatically while the player\n is in a playing state. To catch this case, it's important that our one-time play listener is setup\n even if the player is in a playing state\n */\n\n this.tech_.one('play', playHandler); // Define the dispose function to clean up our events\n\n this.dispose = () => {\n this.clearSeekingAppendCheck_();\n this.logger_('dispose');\n this.tech_.off('waiting', waitingHandler);\n this.tech_.off(timerCancelEvents, cancelTimerHandler);\n this.tech_.off('canplay', canPlayHandler);\n this.tech_.off('play', playHandler);\n this.tech_.off('seeking', this.watchForBadSeeking_);\n this.tech_.off('seeked', this.clearSeekingAppendCheck_);\n loaderTypes.forEach(type => {\n pc[`${type}SegmentLoader_`].off('appendsdone', loaderChecks[type].updateend);\n pc[`${type}SegmentLoader_`].off('playlistupdate', loaderChecks[type].reset);\n this.tech_.off(['seeked', 'seeking'], loaderChecks[type].reset);\n });\n if (this.checkCurrentTimeTimeout_) {\n window$1.clearTimeout(this.checkCurrentTimeTimeout_);\n }\n this.resetTimeUpdate_();\n };\n }\n /**\n * Periodically check current time to see if playback stopped\n *\n * @private\n */\n\n monitorCurrentTime_() {\n this.checkCurrentTime_();\n if (this.checkCurrentTimeTimeout_) {\n window$1.clearTimeout(this.checkCurrentTimeTimeout_);\n } // 42 = 24 fps // 250 is what Webkit uses // FF uses 15\n\n this.checkCurrentTimeTimeout_ = window$1.setTimeout(this.monitorCurrentTime_.bind(this), 250);\n }\n /**\n * Reset stalled download stats for a specific type of loader\n *\n * @param {string} type\n * The segment loader type to check.\n *\n * @listens SegmentLoader#playlistupdate\n * @listens Tech#seeking\n * @listens Tech#seeked\n */\n\n resetSegmentDownloads_(type) {\n const loader = this.playlistController_[`${type}SegmentLoader_`];\n if (this[`${type}StalledDownloads_`] > 0) {\n this.logger_(`resetting possible stalled download count for ${type} loader`);\n }\n this[`${type}StalledDownloads_`] = 0;\n this[`${type}Buffered_`] = loader.buffered_();\n }\n /**\n * Checks on every segment `appendsdone` to see\n * if segment appends are making progress. If they are not\n * and we are still downloading bytes. We exclude the playlist.\n *\n * @param {string} type\n * The segment loader type to check.\n *\n * @listens SegmentLoader#appendsdone\n */\n\n checkSegmentDownloads_(type) {\n const pc = this.playlistController_;\n const loader = pc[`${type}SegmentLoader_`];\n const buffered = loader.buffered_();\n const isBufferedDifferent = isRangeDifferent(this[`${type}Buffered_`], buffered);\n this[`${type}Buffered_`] = buffered; // if another watcher is going to fix the issue or\n // the buffered value for this loader changed\n // appends are working\n\n if (isBufferedDifferent) {\n this.resetSegmentDownloads_(type);\n return;\n }\n this[`${type}StalledDownloads_`]++;\n this.logger_(`found #${this[`${type}StalledDownloads_`]} ${type} appends that did not increase buffer (possible stalled download)`, {\n playlistId: loader.playlist_ && loader.playlist_.id,\n buffered: timeRangesToArray(buffered)\n }); // after 10 possibly stalled appends with no reset, exclude\n\n if (this[`${type}StalledDownloads_`] < 10) {\n return;\n }\n this.logger_(`${type} loader stalled download exclusion`);\n this.resetSegmentDownloads_(type);\n this.tech_.trigger({\n type: 'usage',\n name: `vhs-${type}-download-exclusion`\n });\n if (type === 'subtitle') {\n return;\n } // TODO: should we exclude audio tracks rather than main tracks\n // when type is audio?\n\n pc.excludePlaylist({\n error: {\n message: `Excessive ${type} segment downloading detected.`\n },\n playlistExclusionDuration: Infinity\n });\n }\n /**\n * The purpose of this function is to emulate the \"waiting\" event on\n * browsers that do not emit it when they are waiting for more\n * data to continue playback\n *\n * @private\n */\n\n checkCurrentTime_() {\n if (this.tech_.paused() || this.tech_.seeking()) {\n return;\n }\n const currentTime = this.tech_.currentTime();\n const buffered = this.tech_.buffered();\n if (this.lastRecordedTime === currentTime && (!buffered.length || currentTime + SAFE_TIME_DELTA >= buffered.end(buffered.length - 1))) {\n // If current time is at the end of the final buffered region, then any playback\n // stall is most likely caused by buffering in a low bandwidth environment. The tech\n // should fire a `waiting` event in this scenario, but due to browser and tech\n // inconsistencies. Calling `techWaiting_` here allows us to simulate\n // responding to a native `waiting` event when the tech fails to emit one.\n return this.techWaiting_();\n }\n if (this.consecutiveUpdates >= 5 && currentTime === this.lastRecordedTime) {\n this.consecutiveUpdates++;\n this.waiting_();\n } else if (currentTime === this.lastRecordedTime) {\n this.consecutiveUpdates++;\n } else {\n this.consecutiveUpdates = 0;\n this.lastRecordedTime = currentTime;\n }\n }\n /**\n * Resets the 'timeupdate' mechanism designed to detect that we are stalled\n *\n * @private\n */\n\n resetTimeUpdate_() {\n this.consecutiveUpdates = 0;\n }\n /**\n * Fixes situations where there's a bad seek\n *\n * @return {boolean} whether an action was taken to fix the seek\n * @private\n */\n\n fixesBadSeeks_() {\n const seeking = this.tech_.seeking();\n if (!seeking) {\n return false;\n } // TODO: It's possible that these seekable checks should be moved out of this function\n // and into a function that runs on seekablechange. It's also possible that we only need\n // afterSeekableWindow as the buffered check at the bottom is good enough to handle before\n // seekable range.\n\n const seekable = this.seekable();\n const currentTime = this.tech_.currentTime();\n const isAfterSeekableRange = this.afterSeekableWindow_(seekable, currentTime, this.media(), this.allowSeeksWithinUnsafeLiveWindow);\n let seekTo;\n if (isAfterSeekableRange) {\n const seekableEnd = seekable.end(seekable.length - 1); // sync to live point (if VOD, our seekable was updated and we're simply adjusting)\n\n seekTo = seekableEnd;\n }\n if (this.beforeSeekableWindow_(seekable, currentTime)) {\n const seekableStart = seekable.start(0); // sync to the beginning of the live window\n // provide a buffer of .1 seconds to handle rounding/imprecise numbers\n\n seekTo = seekableStart + (\n // if the playlist is too short and the seekable range is an exact time (can\n // happen in live with a 3 segment playlist), then don't use a time delta\n seekableStart === seekable.end(0) ? 0 : SAFE_TIME_DELTA);\n }\n if (typeof seekTo !== 'undefined') {\n this.logger_(`Trying to seek outside of seekable at time ${currentTime} with ` + `seekable range ${printableRange(seekable)}. Seeking to ` + `${seekTo}.`);\n this.tech_.setCurrentTime(seekTo);\n return true;\n }\n const sourceUpdater = this.playlistController_.sourceUpdater_;\n const buffered = this.tech_.buffered();\n const audioBuffered = sourceUpdater.audioBuffer ? sourceUpdater.audioBuffered() : null;\n const videoBuffered = sourceUpdater.videoBuffer ? sourceUpdater.videoBuffered() : null;\n const media = this.media(); // verify that at least two segment durations or one part duration have been\n // appended before checking for a gap.\n\n const minAppendedDuration = media.partTargetDuration ? media.partTargetDuration : (media.targetDuration - TIME_FUDGE_FACTOR) * 2; // verify that at least two segment durations have been\n // appended before checking for a gap.\n\n const bufferedToCheck = [audioBuffered, videoBuffered];\n for (let i = 0; i < bufferedToCheck.length; i++) {\n // skip null buffered\n if (!bufferedToCheck[i]) {\n continue;\n }\n const timeAhead = timeAheadOf(bufferedToCheck[i], currentTime); // if we are less than two video/audio segment durations or one part\n // duration behind we haven't appended enough to call this a bad seek.\n\n if (timeAhead < minAppendedDuration) {\n return false;\n }\n }\n const nextRange = findNextRange(buffered, currentTime); // we have appended enough content, but we don't have anything buffered\n // to seek over the gap\n\n if (nextRange.length === 0) {\n return false;\n }\n seekTo = nextRange.start(0) + SAFE_TIME_DELTA;\n this.logger_(`Buffered region starts (${nextRange.start(0)}) ` + ` just beyond seek point (${currentTime}). Seeking to ${seekTo}.`);\n this.tech_.setCurrentTime(seekTo);\n return true;\n }\n /**\n * Handler for situations when we determine the player is waiting.\n *\n * @private\n */\n\n waiting_() {\n if (this.techWaiting_()) {\n return;\n } // All tech waiting checks failed. Use last resort correction\n\n const currentTime = this.tech_.currentTime();\n const buffered = this.tech_.buffered();\n const currentRange = findRange(buffered, currentTime); // Sometimes the player can stall for unknown reasons within a contiguous buffered\n // region with no indication that anything is amiss (seen in Firefox). Seeking to\n // currentTime is usually enough to kickstart the player. This checks that the player\n // is currently within a buffered region before attempting a corrective seek.\n // Chrome does not appear to continue `timeupdate` events after a `waiting` event\n // until there is ~ 3 seconds of forward buffer available. PlaybackWatcher should also\n // make sure there is ~3 seconds of forward buffer before taking any corrective action\n // to avoid triggering an `unknownwaiting` event when the network is slow.\n\n if (currentRange.length && currentTime + 3 <= currentRange.end(0)) {\n this.resetTimeUpdate_();\n this.tech_.setCurrentTime(currentTime);\n this.logger_(`Stopped at ${currentTime} while inside a buffered region ` + `[${currentRange.start(0)} -> ${currentRange.end(0)}]. Attempting to resume ` + 'playback by seeking to the current time.'); // unknown waiting corrections may be useful for monitoring QoS\n\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-unknown-waiting'\n });\n return;\n }\n }\n /**\n * Handler for situations when the tech fires a `waiting` event\n *\n * @return {boolean}\n * True if an action (or none) was needed to correct the waiting. False if no\n * checks passed\n * @private\n */\n\n techWaiting_() {\n const seekable = this.seekable();\n const currentTime = this.tech_.currentTime();\n if (this.tech_.seeking()) {\n // Tech is seeking or already waiting on another action, no action needed\n return true;\n }\n if (this.beforeSeekableWindow_(seekable, currentTime)) {\n const livePoint = seekable.end(seekable.length - 1);\n this.logger_(`Fell out of live window at time ${currentTime}. Seeking to ` + `live point (seekable end) ${livePoint}`);\n this.resetTimeUpdate_();\n this.tech_.setCurrentTime(livePoint); // live window resyncs may be useful for monitoring QoS\n\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-live-resync'\n });\n return true;\n }\n const sourceUpdater = this.tech_.vhs.playlistController_.sourceUpdater_;\n const buffered = this.tech_.buffered();\n const videoUnderflow = this.videoUnderflow_({\n audioBuffered: sourceUpdater.audioBuffered(),\n videoBuffered: sourceUpdater.videoBuffered(),\n currentTime\n });\n if (videoUnderflow) {\n // Even though the video underflowed and was stuck in a gap, the audio overplayed\n // the gap, leading currentTime into a buffered range. Seeking to currentTime\n // allows the video to catch up to the audio position without losing any audio\n // (only suffering ~3 seconds of frozen video and a pause in audio playback).\n this.resetTimeUpdate_();\n this.tech_.setCurrentTime(currentTime); // video underflow may be useful for monitoring QoS\n\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-video-underflow'\n });\n return true;\n }\n const nextRange = findNextRange(buffered, currentTime); // check for gap\n\n if (nextRange.length > 0) {\n this.logger_(`Stopped at ${currentTime} and seeking to ${nextRange.start(0)}`);\n this.resetTimeUpdate_();\n this.skipTheGap_(currentTime);\n return true;\n } // All checks failed. Returning false to indicate failure to correct waiting\n\n return false;\n }\n afterSeekableWindow_(seekable, currentTime, playlist, allowSeeksWithinUnsafeLiveWindow = false) {\n if (!seekable.length) {\n // we can't make a solid case if there's no seekable, default to false\n return false;\n }\n let allowedEnd = seekable.end(seekable.length - 1) + SAFE_TIME_DELTA;\n const isLive = !playlist.endList;\n const isLLHLS = typeof playlist.partTargetDuration === 'number';\n if (isLive && (isLLHLS || allowSeeksWithinUnsafeLiveWindow)) {\n allowedEnd = seekable.end(seekable.length - 1) + playlist.targetDuration * 3;\n }\n if (currentTime > allowedEnd) {\n return true;\n }\n return false;\n }\n beforeSeekableWindow_(seekable, currentTime) {\n if (seekable.length &&\n // can't fall before 0 and 0 seekable start identifies VOD stream\n seekable.start(0) > 0 && currentTime < seekable.start(0) - this.liveRangeSafeTimeDelta) {\n return true;\n }\n return false;\n }\n videoUnderflow_({\n videoBuffered,\n audioBuffered,\n currentTime\n }) {\n // audio only content will not have video underflow :)\n if (!videoBuffered) {\n return;\n }\n let gap; // find a gap in demuxed content.\n\n if (videoBuffered.length && audioBuffered.length) {\n // in Chrome audio will continue to play for ~3s when we run out of video\n // so we have to check that the video buffer did have some buffer in the\n // past.\n const lastVideoRange = findRange(videoBuffered, currentTime - 3);\n const videoRange = findRange(videoBuffered, currentTime);\n const audioRange = findRange(audioBuffered, currentTime);\n if (audioRange.length && !videoRange.length && lastVideoRange.length) {\n gap = {\n start: lastVideoRange.end(0),\n end: audioRange.end(0)\n };\n } // find a gap in muxed content.\n } else {\n const nextRange = findNextRange(videoBuffered, currentTime); // Even if there is no available next range, there is still a possibility we are\n // stuck in a gap due to video underflow.\n\n if (!nextRange.length) {\n gap = this.gapFromVideoUnderflow_(videoBuffered, currentTime);\n }\n }\n if (gap) {\n this.logger_(`Encountered a gap in video from ${gap.start} to ${gap.end}. ` + `Seeking to current time ${currentTime}`);\n return true;\n }\n return false;\n }\n /**\n * Timer callback. If playback still has not proceeded, then we seek\n * to the start of the next buffered region.\n *\n * @private\n */\n\n skipTheGap_(scheduledCurrentTime) {\n const buffered = this.tech_.buffered();\n const currentTime = this.tech_.currentTime();\n const nextRange = findNextRange(buffered, currentTime);\n this.resetTimeUpdate_();\n if (nextRange.length === 0 || currentTime !== scheduledCurrentTime) {\n return;\n }\n this.logger_('skipTheGap_:', 'currentTime:', currentTime, 'scheduled currentTime:', scheduledCurrentTime, 'nextRange start:', nextRange.start(0)); // only seek if we still have not played\n\n this.tech_.setCurrentTime(nextRange.start(0) + TIME_FUDGE_FACTOR);\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-gap-skip'\n });\n }\n gapFromVideoUnderflow_(buffered, currentTime) {\n // At least in Chrome, if there is a gap in the video buffer, the audio will continue\n // playing for ~3 seconds after the video gap starts. This is done to account for\n // video buffer underflow/underrun (note that this is not done when there is audio\n // buffer underflow/underrun -- in that case the video will stop as soon as it\n // encounters the gap, as audio stalls are more noticeable/jarring to a user than\n // video stalls). The player's time will reflect the playthrough of audio, so the\n // time will appear as if we are in a buffered region, even if we are stuck in a\n // \"gap.\"\n //\n // Example:\n // video buffer: 0 => 10.1, 10.2 => 20\n // audio buffer: 0 => 20\n // overall buffer: 0 => 10.1, 10.2 => 20\n // current time: 13\n //\n // Chrome's video froze at 10 seconds, where the video buffer encountered the gap,\n // however, the audio continued playing until it reached ~3 seconds past the gap\n // (13 seconds), at which point it stops as well. Since current time is past the\n // gap, findNextRange will return no ranges.\n //\n // To check for this issue, we see if there is a gap that starts somewhere within\n // a 3 second range (3 seconds +/- 1 second) back from our current time.\n const gaps = findGaps(buffered);\n for (let i = 0; i < gaps.length; i++) {\n const start = gaps.start(i);\n const end = gaps.end(i); // gap is starts no more than 4 seconds back\n\n if (currentTime - start < 4 && currentTime - start > 2) {\n return {\n start,\n end\n };\n }\n }\n return null;\n }\n}\nconst defaultOptions = {\n errorInterval: 30,\n getSource(next) {\n const tech = this.tech({\n IWillNotUseThisInPlugins: true\n });\n const sourceObj = tech.currentSource_ || this.currentSource();\n return next(sourceObj);\n }\n};\n/**\n * Main entry point for the plugin\n *\n * @param {Player} player a reference to a videojs Player instance\n * @param {Object} [options] an object with plugin options\n * @private\n */\n\nconst initPlugin = function (player, options) {\n let lastCalled = 0;\n let seekTo = 0;\n const localOptions = merge(defaultOptions, options);\n player.ready(() => {\n player.trigger({\n type: 'usage',\n name: 'vhs-error-reload-initialized'\n });\n });\n /**\n * Player modifications to perform that must wait until `loadedmetadata`\n * has been triggered\n *\n * @private\n */\n\n const loadedMetadataHandler = function () {\n if (seekTo) {\n player.currentTime(seekTo);\n }\n };\n /**\n * Set the source on the player element, play, and seek if necessary\n *\n * @param {Object} sourceObj An object specifying the source url and mime-type to play\n * @private\n */\n\n const setSource = function (sourceObj) {\n if (sourceObj === null || sourceObj === undefined) {\n return;\n }\n seekTo = player.duration() !== Infinity && player.currentTime() || 0;\n player.one('loadedmetadata', loadedMetadataHandler);\n player.src(sourceObj);\n player.trigger({\n type: 'usage',\n name: 'vhs-error-reload'\n });\n player.play();\n };\n /**\n * Attempt to get a source from either the built-in getSource function\n * or a custom function provided via the options\n *\n * @private\n */\n\n const errorHandler = function () {\n // Do not attempt to reload the source if a source-reload occurred before\n // 'errorInterval' time has elapsed since the last source-reload\n if (Date.now() - lastCalled < localOptions.errorInterval * 1000) {\n player.trigger({\n type: 'usage',\n name: 'vhs-error-reload-canceled'\n });\n return;\n }\n if (!localOptions.getSource || typeof localOptions.getSource !== 'function') {\n videojs.log.error('ERROR: reloadSourceOnError - The option getSource must be a function!');\n return;\n }\n lastCalled = Date.now();\n return localOptions.getSource.call(player, setSource);\n };\n /**\n * Unbind any event handlers that were bound by the plugin\n *\n * @private\n */\n\n const cleanupEvents = function () {\n player.off('loadedmetadata', loadedMetadataHandler);\n player.off('error', errorHandler);\n player.off('dispose', cleanupEvents);\n };\n /**\n * Cleanup before re-initializing the plugin\n *\n * @param {Object} [newOptions] an object with plugin options\n * @private\n */\n\n const reinitPlugin = function (newOptions) {\n cleanupEvents();\n initPlugin(player, newOptions);\n };\n player.on('error', errorHandler);\n player.on('dispose', cleanupEvents); // Overwrite the plugin function so that we can correctly cleanup before\n // initializing the plugin\n\n player.reloadSourceOnError = reinitPlugin;\n};\n/**\n * Reload the source when an error is detected as long as there\n * wasn't an error previously within the last 30 seconds\n *\n * @param {Object} [options] an object with plugin options\n */\n\nconst reloadSourceOnError = function (options) {\n initPlugin(this, options);\n};\nvar version$4 = \"3.7.0\";\nvar version$3 = \"7.0.1\";\nvar version$2 = \"1.2.2\";\nvar version$1 = \"7.1.0\";\nvar version = \"4.0.1\";\n\n/**\n * @file videojs-http-streaming.js\n *\n * The main file for the VHS project.\n * License: https://github.com/videojs/videojs-http-streaming/blob/main/LICENSE\n */\nconst Vhs = {\n PlaylistLoader,\n Playlist,\n utils,\n STANDARD_PLAYLIST_SELECTOR: lastBandwidthSelector,\n INITIAL_PLAYLIST_SELECTOR: lowestBitrateCompatibleVariantSelector,\n lastBandwidthSelector,\n movingAverageBandwidthSelector,\n comparePlaylistBandwidth,\n comparePlaylistResolution,\n xhr: xhrFactory()\n}; // Define getter/setters for config properties\n\nObject.keys(Config).forEach(prop => {\n Object.defineProperty(Vhs, prop, {\n get() {\n videojs.log.warn(`using Vhs.${prop} is UNSAFE be sure you know what you are doing`);\n return Config[prop];\n },\n set(value) {\n videojs.log.warn(`using Vhs.${prop} is UNSAFE be sure you know what you are doing`);\n if (typeof value !== 'number' || value < 0) {\n videojs.log.warn(`value of Vhs.${prop} must be greater than or equal to 0`);\n return;\n }\n Config[prop] = value;\n }\n });\n});\nconst LOCAL_STORAGE_KEY = 'videojs-vhs';\n/**\n * Updates the selectedIndex of the QualityLevelList when a mediachange happens in vhs.\n *\n * @param {QualityLevelList} qualityLevels The QualityLevelList to update.\n * @param {PlaylistLoader} playlistLoader PlaylistLoader containing the new media info.\n * @function handleVhsMediaChange\n */\n\nconst handleVhsMediaChange = function (qualityLevels, playlistLoader) {\n const newPlaylist = playlistLoader.media();\n let selectedIndex = -1;\n for (let i = 0; i < qualityLevels.length; i++) {\n if (qualityLevels[i].id === newPlaylist.id) {\n selectedIndex = i;\n break;\n }\n }\n qualityLevels.selectedIndex_ = selectedIndex;\n qualityLevels.trigger({\n selectedIndex,\n type: 'change'\n });\n};\n/**\n * Adds quality levels to list once playlist metadata is available\n *\n * @param {QualityLevelList} qualityLevels The QualityLevelList to attach events to.\n * @param {Object} vhs Vhs object to listen to for media events.\n * @function handleVhsLoadedMetadata\n */\n\nconst handleVhsLoadedMetadata = function (qualityLevels, vhs) {\n vhs.representations().forEach(rep => {\n qualityLevels.addQualityLevel(rep);\n });\n handleVhsMediaChange(qualityLevels, vhs.playlists);\n}; // VHS is a source handler, not a tech. Make sure attempts to use it\n// as one do not cause exceptions.\n\nVhs.canPlaySource = function () {\n return videojs.log.warn('VHS is no longer a tech. Please remove it from ' + 'your player\\'s techOrder.');\n};\nconst emeKeySystems = (keySystemOptions, mainPlaylist, audioPlaylist) => {\n if (!keySystemOptions) {\n return keySystemOptions;\n }\n let codecs = {};\n if (mainPlaylist && mainPlaylist.attributes && mainPlaylist.attributes.CODECS) {\n codecs = unwrapCodecList(parseCodecs(mainPlaylist.attributes.CODECS));\n }\n if (audioPlaylist && audioPlaylist.attributes && audioPlaylist.attributes.CODECS) {\n codecs.audio = audioPlaylist.attributes.CODECS;\n }\n const videoContentType = getMimeForCodec(codecs.video);\n const audioContentType = getMimeForCodec(codecs.audio); // upsert the content types based on the selected playlist\n\n const keySystemContentTypes = {};\n for (const keySystem in keySystemOptions) {\n keySystemContentTypes[keySystem] = {};\n if (audioContentType) {\n keySystemContentTypes[keySystem].audioContentType = audioContentType;\n }\n if (videoContentType) {\n keySystemContentTypes[keySystem].videoContentType = videoContentType;\n } // Default to using the video playlist's PSSH even though they may be different, as\n // videojs-contrib-eme will only accept one in the options.\n //\n // This shouldn't be an issue for most cases as early intialization will handle all\n // unique PSSH values, and if they aren't, then encrypted events should have the\n // specific information needed for the unique license.\n\n if (mainPlaylist.contentProtection && mainPlaylist.contentProtection[keySystem] && mainPlaylist.contentProtection[keySystem].pssh) {\n keySystemContentTypes[keySystem].pssh = mainPlaylist.contentProtection[keySystem].pssh;\n } // videojs-contrib-eme accepts the option of specifying: 'com.some.cdm': 'url'\n // so we need to prevent overwriting the URL entirely\n\n if (typeof keySystemOptions[keySystem] === 'string') {\n keySystemContentTypes[keySystem].url = keySystemOptions[keySystem];\n }\n }\n return merge(keySystemOptions, keySystemContentTypes);\n};\n/**\n * @typedef {Object} KeySystems\n *\n * keySystems configuration for https://github.com/videojs/videojs-contrib-eme\n * Note: not all options are listed here.\n *\n * @property {Uint8Array} [pssh]\n * Protection System Specific Header\n */\n\n/**\n * Goes through all the playlists and collects an array of KeySystems options objects\n * containing each playlist's keySystems and their pssh values, if available.\n *\n * @param {Object[]} playlists\n * The playlists to look through\n * @param {string[]} keySystems\n * The keySystems to collect pssh values for\n *\n * @return {KeySystems[]}\n * An array of KeySystems objects containing available key systems and their\n * pssh values\n */\n\nconst getAllPsshKeySystemsOptions = (playlists, keySystems) => {\n return playlists.reduce((keySystemsArr, playlist) => {\n if (!playlist.contentProtection) {\n return keySystemsArr;\n }\n const keySystemsOptions = keySystems.reduce((keySystemsObj, keySystem) => {\n const keySystemOptions = playlist.contentProtection[keySystem];\n if (keySystemOptions && keySystemOptions.pssh) {\n keySystemsObj[keySystem] = {\n pssh: keySystemOptions.pssh\n };\n }\n return keySystemsObj;\n }, {});\n if (Object.keys(keySystemsOptions).length) {\n keySystemsArr.push(keySystemsOptions);\n }\n return keySystemsArr;\n }, []);\n};\n/**\n * Returns a promise that waits for the\n * [eme plugin](https://github.com/videojs/videojs-contrib-eme) to create a key session.\n *\n * Works around https://bugs.chromium.org/p/chromium/issues/detail?id=895449 in non-IE11\n * browsers.\n *\n * As per the above ticket, this is particularly important for Chrome, where, if\n * unencrypted content is appended before encrypted content and the key session has not\n * been created, a MEDIA_ERR_DECODE will be thrown once the encrypted content is reached\n * during playback.\n *\n * @param {Object} player\n * The player instance\n * @param {Object[]} sourceKeySystems\n * The key systems options from the player source\n * @param {Object} [audioMedia]\n * The active audio media playlist (optional)\n * @param {Object[]} mainPlaylists\n * The playlists found on the main playlist object\n *\n * @return {Object}\n * Promise that resolves when the key session has been created\n */\n\nconst waitForKeySessionCreation = ({\n player,\n sourceKeySystems,\n audioMedia,\n mainPlaylists\n}) => {\n if (!player.eme.initializeMediaKeys) {\n return Promise.resolve();\n } // TODO should all audio PSSH values be initialized for DRM?\n //\n // All unique video rendition pssh values are initialized for DRM, but here only\n // the initial audio playlist license is initialized. In theory, an encrypted\n // event should be fired if the user switches to an alternative audio playlist\n // where a license is required, but this case hasn't yet been tested. In addition, there\n // may be many alternate audio playlists unlikely to be used (e.g., multiple different\n // languages).\n\n const playlists = audioMedia ? mainPlaylists.concat([audioMedia]) : mainPlaylists;\n const keySystemsOptionsArr = getAllPsshKeySystemsOptions(playlists, Object.keys(sourceKeySystems));\n const initializationFinishedPromises = [];\n const keySessionCreatedPromises = []; // Since PSSH values are interpreted as initData, EME will dedupe any duplicates. The\n // only place where it should not be deduped is for ms-prefixed APIs, but\n // the existence of modern EME APIs in addition to\n // ms-prefixed APIs on Edge should prevent this from being a concern.\n // initializeMediaKeys also won't use the webkit-prefixed APIs.\n\n keySystemsOptionsArr.forEach(keySystemsOptions => {\n keySessionCreatedPromises.push(new Promise((resolve, reject) => {\n player.tech_.one('keysessioncreated', resolve);\n }));\n initializationFinishedPromises.push(new Promise((resolve, reject) => {\n player.eme.initializeMediaKeys({\n keySystems: keySystemsOptions\n }, err => {\n if (err) {\n reject(err);\n return;\n }\n resolve();\n });\n }));\n }); // The reasons Promise.race is chosen over Promise.any:\n //\n // * Promise.any is only available in Safari 14+.\n // * None of these promises are expected to reject. If they do reject, it might be\n // better here for the race to surface the rejection, rather than mask it by using\n // Promise.any.\n\n return Promise.race([\n // If a session was previously created, these will all finish resolving without\n // creating a new session, otherwise it will take until the end of all license\n // requests, which is why the key session check is used (to make setup much faster).\n Promise.all(initializationFinishedPromises),\n // Once a single session is created, the browser knows DRM will be used.\n Promise.race(keySessionCreatedPromises)]);\n};\n/**\n * If the [eme](https://github.com/videojs/videojs-contrib-eme) plugin is available, and\n * there are keySystems on the source, sets up source options to prepare the source for\n * eme.\n *\n * @param {Object} player\n * The player instance\n * @param {Object[]} sourceKeySystems\n * The key systems options from the player source\n * @param {Object} media\n * The active media playlist\n * @param {Object} [audioMedia]\n * The active audio media playlist (optional)\n *\n * @return {boolean}\n * Whether or not options were configured and EME is available\n */\n\nconst setupEmeOptions = ({\n player,\n sourceKeySystems,\n media,\n audioMedia\n}) => {\n const sourceOptions = emeKeySystems(sourceKeySystems, media, audioMedia);\n if (!sourceOptions) {\n return false;\n }\n player.currentSource().keySystems = sourceOptions; // eme handles the rest of the setup, so if it is missing\n // do nothing.\n\n if (sourceOptions && !player.eme) {\n videojs.log.warn('DRM encrypted source cannot be decrypted without a DRM plugin');\n return false;\n }\n return true;\n};\nconst getVhsLocalStorage = () => {\n if (!window$1.localStorage) {\n return null;\n }\n const storedObject = window$1.localStorage.getItem(LOCAL_STORAGE_KEY);\n if (!storedObject) {\n return null;\n }\n try {\n return JSON.parse(storedObject);\n } catch (e) {\n // someone may have tampered with the value\n return null;\n }\n};\nconst updateVhsLocalStorage = options => {\n if (!window$1.localStorage) {\n return false;\n }\n let objectToStore = getVhsLocalStorage();\n objectToStore = objectToStore ? merge(objectToStore, options) : options;\n try {\n window$1.localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(objectToStore));\n } catch (e) {\n // Throws if storage is full (e.g., always on iOS 5+ Safari private mode, where\n // storage is set to 0).\n // https://developer.mozilla.org/en-US/docs/Web/API/Storage/setItem#Exceptions\n // No need to perform any operation.\n return false;\n }\n return objectToStore;\n};\n/**\n * Parses VHS-supported media types from data URIs. See\n * https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs\n * for information on data URIs.\n *\n * @param {string} dataUri\n * The data URI\n *\n * @return {string|Object}\n * The parsed object/string, or the original string if no supported media type\n * was found\n */\n\nconst expandDataUri = dataUri => {\n if (dataUri.toLowerCase().indexOf('data:application/vnd.videojs.vhs+json,') === 0) {\n return JSON.parse(dataUri.substring(dataUri.indexOf(',') + 1));\n } // no known case for this data URI, return the string as-is\n\n return dataUri;\n};\n/**\n * Adds a request hook to an xhr object\n *\n * @param {Object} xhr object to add the onRequest hook to\n * @param {function} callback hook function for an xhr request\n */\n\nconst addOnRequestHook = (xhr, callback) => {\n if (!xhr._requestCallbackSet) {\n xhr._requestCallbackSet = new Set();\n }\n xhr._requestCallbackSet.add(callback);\n};\n/**\n * Adds a response hook to an xhr object\n *\n * @param {Object} xhr object to add the onResponse hook to\n * @param {function} callback hook function for an xhr response\n */\n\nconst addOnResponseHook = (xhr, callback) => {\n if (!xhr._responseCallbackSet) {\n xhr._responseCallbackSet = new Set();\n }\n xhr._responseCallbackSet.add(callback);\n};\n/**\n * Removes a request hook on an xhr object, deletes the onRequest set if empty.\n *\n * @param {Object} xhr object to remove the onRequest hook from\n * @param {function} callback hook function to remove\n */\n\nconst removeOnRequestHook = (xhr, callback) => {\n if (!xhr._requestCallbackSet) {\n return;\n }\n xhr._requestCallbackSet.delete(callback);\n if (!xhr._requestCallbackSet.size) {\n delete xhr._requestCallbackSet;\n }\n};\n/**\n * Removes a response hook on an xhr object, deletes the onResponse set if empty.\n *\n * @param {Object} xhr object to remove the onResponse hook from\n * @param {function} callback hook function to remove\n */\n\nconst removeOnResponseHook = (xhr, callback) => {\n if (!xhr._responseCallbackSet) {\n return;\n }\n xhr._responseCallbackSet.delete(callback);\n if (!xhr._responseCallbackSet.size) {\n delete xhr._responseCallbackSet;\n }\n};\n/**\n * Whether the browser has built-in HLS support.\n */\n\nVhs.supportsNativeHls = function () {\n if (!document || !document.createElement) {\n return false;\n }\n const video = document.createElement('video'); // native HLS is definitely not supported if HTML5 video isn't\n\n if (!videojs.getTech('Html5').isSupported()) {\n return false;\n } // HLS manifests can go by many mime-types\n\n const canPlay = [\n // Apple santioned\n 'application/vnd.apple.mpegurl',\n // Apple sanctioned for backwards compatibility\n 'audio/mpegurl',\n // Very common\n 'audio/x-mpegurl',\n // Very common\n 'application/x-mpegurl',\n // Included for completeness\n 'video/x-mpegurl', 'video/mpegurl', 'application/mpegurl'];\n return canPlay.some(function (canItPlay) {\n return /maybe|probably/i.test(video.canPlayType(canItPlay));\n });\n}();\nVhs.supportsNativeDash = function () {\n if (!document || !document.createElement || !videojs.getTech('Html5').isSupported()) {\n return false;\n }\n return /maybe|probably/i.test(document.createElement('video').canPlayType('application/dash+xml'));\n}();\nVhs.supportsTypeNatively = type => {\n if (type === 'hls') {\n return Vhs.supportsNativeHls;\n }\n if (type === 'dash') {\n return Vhs.supportsNativeDash;\n }\n return false;\n};\n/**\n * VHS is a source handler, not a tech. Make sure attempts to use it\n * as one do not cause exceptions.\n */\n\nVhs.isSupported = function () {\n return videojs.log.warn('VHS is no longer a tech. Please remove it from ' + 'your player\\'s techOrder.');\n};\n/**\n * A global function for setting an onRequest hook\n *\n * @param {function} callback for request modifiction\n */\n\nVhs.xhr.onRequest = function (callback) {\n addOnRequestHook(Vhs.xhr, callback);\n};\n/**\n * A global function for setting an onResponse hook\n *\n * @param {callback} callback for response data retrieval\n */\n\nVhs.xhr.onResponse = function (callback) {\n addOnResponseHook(Vhs.xhr, callback);\n};\n/**\n * Deletes a global onRequest callback if it exists\n *\n * @param {function} callback to delete from the global set\n */\n\nVhs.xhr.offRequest = function (callback) {\n removeOnRequestHook(Vhs.xhr, callback);\n};\n/**\n * Deletes a global onResponse callback if it exists\n *\n * @param {function} callback to delete from the global set\n */\n\nVhs.xhr.offResponse = function (callback) {\n removeOnResponseHook(Vhs.xhr, callback);\n};\nconst Component = videojs.getComponent('Component');\n/**\n * The Vhs Handler object, where we orchestrate all of the parts\n * of VHS to interact with video.js\n *\n * @class VhsHandler\n * @extends videojs.Component\n * @param {Object} source the soruce object\n * @param {Tech} tech the parent tech object\n * @param {Object} options optional and required options\n */\n\nclass VhsHandler extends Component {\n constructor(source, tech, options) {\n super(tech, options.vhs); // if a tech level `initialBandwidth` option was passed\n // use that over the VHS level `bandwidth` option\n\n if (typeof options.initialBandwidth === 'number') {\n this.options_.bandwidth = options.initialBandwidth;\n }\n this.logger_ = logger('VhsHandler'); // we need access to the player in some cases,\n // so, get it from Video.js via the `playerId`\n\n if (tech.options_ && tech.options_.playerId) {\n const _player = videojs.getPlayer(tech.options_.playerId);\n this.player_ = _player;\n }\n this.tech_ = tech;\n this.source_ = source;\n this.stats = {};\n this.ignoreNextSeekingEvent_ = false;\n this.setOptions_();\n if (this.options_.overrideNative && tech.overrideNativeAudioTracks && tech.overrideNativeVideoTracks) {\n tech.overrideNativeAudioTracks(true);\n tech.overrideNativeVideoTracks(true);\n } else if (this.options_.overrideNative && (tech.featuresNativeVideoTracks || tech.featuresNativeAudioTracks)) {\n // overriding native VHS only works if audio tracks have been emulated\n // error early if we're misconfigured\n throw new Error('Overriding native VHS requires emulated tracks. ' + 'See https://git.io/vMpjB');\n } // listen for fullscreenchange events for this player so that we\n // can adjust our quality selection quickly\n\n this.on(document, ['fullscreenchange', 'webkitfullscreenchange', 'mozfullscreenchange', 'MSFullscreenChange'], event => {\n const fullscreenElement = document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement;\n if (fullscreenElement && fullscreenElement.contains(this.tech_.el())) {\n this.playlistController_.fastQualityChange_();\n } else {\n // When leaving fullscreen, since the in page pixel dimensions should be smaller\n // than full screen, see if there should be a rendition switch down to preserve\n // bandwidth.\n this.playlistController_.checkABR_();\n }\n });\n this.on(this.tech_, 'seeking', function () {\n if (this.ignoreNextSeekingEvent_) {\n this.ignoreNextSeekingEvent_ = false;\n return;\n }\n this.setCurrentTime(this.tech_.currentTime());\n });\n this.on(this.tech_, 'error', function () {\n // verify that the error was real and we are loaded\n // enough to have pc loaded.\n if (this.tech_.error() && this.playlistController_) {\n this.playlistController_.pauseLoading();\n }\n });\n this.on(this.tech_, 'play', this.play);\n }\n setOptions_() {\n // defaults\n this.options_.withCredentials = this.options_.withCredentials || false;\n this.options_.limitRenditionByPlayerDimensions = this.options_.limitRenditionByPlayerDimensions === false ? false : true;\n this.options_.useDevicePixelRatio = this.options_.useDevicePixelRatio || false;\n this.options_.useBandwidthFromLocalStorage = typeof this.source_.useBandwidthFromLocalStorage !== 'undefined' ? this.source_.useBandwidthFromLocalStorage : this.options_.useBandwidthFromLocalStorage || false;\n this.options_.useForcedSubtitles = this.options_.useForcedSubtitles || false;\n this.options_.useNetworkInformationApi = this.options_.useNetworkInformationApi || false;\n this.options_.useDtsForTimestampOffset = this.options_.useDtsForTimestampOffset || false;\n this.options_.calculateTimestampOffsetForEachSegment = this.options_.calculateTimestampOffsetForEachSegment || false;\n this.options_.customTagParsers = this.options_.customTagParsers || [];\n this.options_.customTagMappers = this.options_.customTagMappers || [];\n this.options_.cacheEncryptionKeys = this.options_.cacheEncryptionKeys || false;\n this.options_.llhls = this.options_.llhls === false ? false : true;\n this.options_.bufferBasedABR = this.options_.bufferBasedABR || false;\n if (typeof this.options_.playlistExclusionDuration !== 'number') {\n this.options_.playlistExclusionDuration = 60;\n }\n if (typeof this.options_.bandwidth !== 'number') {\n if (this.options_.useBandwidthFromLocalStorage) {\n const storedObject = getVhsLocalStorage();\n if (storedObject && storedObject.bandwidth) {\n this.options_.bandwidth = storedObject.bandwidth;\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-bandwidth-from-local-storage'\n });\n }\n if (storedObject && storedObject.throughput) {\n this.options_.throughput = storedObject.throughput;\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-throughput-from-local-storage'\n });\n }\n }\n } // if bandwidth was not set by options or pulled from local storage, start playlist\n // selection at a reasonable bandwidth\n\n if (typeof this.options_.bandwidth !== 'number') {\n this.options_.bandwidth = Config.INITIAL_BANDWIDTH;\n } // If the bandwidth number is unchanged from the initial setting\n // then this takes precedence over the enableLowInitialPlaylist option\n\n this.options_.enableLowInitialPlaylist = this.options_.enableLowInitialPlaylist && this.options_.bandwidth === Config.INITIAL_BANDWIDTH; // grab options passed to player.src\n\n ['withCredentials', 'useDevicePixelRatio', 'limitRenditionByPlayerDimensions', 'bandwidth', 'customTagParsers', 'customTagMappers', 'cacheEncryptionKeys', 'playlistSelector', 'initialPlaylistSelector', 'bufferBasedABR', 'liveRangeSafeTimeDelta', 'llhls', 'useForcedSubtitles', 'useNetworkInformationApi', 'useDtsForTimestampOffset', 'calculateTimestampOffsetForEachSegment', 'exactManifestTimings', 'leastPixelDiffSelector'].forEach(option => {\n if (typeof this.source_[option] !== 'undefined') {\n this.options_[option] = this.source_[option];\n }\n });\n this.limitRenditionByPlayerDimensions = this.options_.limitRenditionByPlayerDimensions;\n this.useDevicePixelRatio = this.options_.useDevicePixelRatio;\n }\n /**\n * called when player.src gets called, handle a new source\n *\n * @param {Object} src the source object to handle\n */\n\n src(src, type) {\n // do nothing if the src is falsey\n if (!src) {\n return;\n }\n this.setOptions_(); // add main playlist controller options\n\n this.options_.src = expandDataUri(this.source_.src);\n this.options_.tech = this.tech_;\n this.options_.externVhs = Vhs;\n this.options_.sourceType = simpleTypeFromSourceType(type); // Whenever we seek internally, we should update the tech\n\n this.options_.seekTo = time => {\n this.tech_.setCurrentTime(time);\n };\n this.playlistController_ = new PlaylistController(this.options_);\n const playbackWatcherOptions = merge({\n liveRangeSafeTimeDelta: SAFE_TIME_DELTA\n }, this.options_, {\n seekable: () => this.seekable(),\n media: () => this.playlistController_.media(),\n playlistController: this.playlistController_\n });\n this.playbackWatcher_ = new PlaybackWatcher(playbackWatcherOptions);\n this.playlistController_.on('error', () => {\n const player = videojs.players[this.tech_.options_.playerId];\n let error = this.playlistController_.error;\n if (typeof error === 'object' && !error.code) {\n error.code = 3;\n } else if (typeof error === 'string') {\n error = {\n message: error,\n code: 3\n };\n }\n player.error(error);\n });\n const defaultSelector = this.options_.bufferBasedABR ? Vhs.movingAverageBandwidthSelector(0.55) : Vhs.STANDARD_PLAYLIST_SELECTOR; // `this` in selectPlaylist should be the VhsHandler for backwards\n // compatibility with < v2\n\n this.playlistController_.selectPlaylist = this.selectPlaylist ? this.selectPlaylist.bind(this) : defaultSelector.bind(this);\n this.playlistController_.selectInitialPlaylist = Vhs.INITIAL_PLAYLIST_SELECTOR.bind(this); // re-expose some internal objects for backwards compatibility with < v2\n\n this.playlists = this.playlistController_.mainPlaylistLoader_;\n this.mediaSource = this.playlistController_.mediaSource; // Proxy assignment of some properties to the main playlist\n // controller. Using a custom property for backwards compatibility\n // with < v2\n\n Object.defineProperties(this, {\n selectPlaylist: {\n get() {\n return this.playlistController_.selectPlaylist;\n },\n set(selectPlaylist) {\n this.playlistController_.selectPlaylist = selectPlaylist.bind(this);\n }\n },\n throughput: {\n get() {\n return this.playlistController_.mainSegmentLoader_.throughput.rate;\n },\n set(throughput) {\n this.playlistController_.mainSegmentLoader_.throughput.rate = throughput; // By setting `count` to 1 the throughput value becomes the starting value\n // for the cumulative average\n\n this.playlistController_.mainSegmentLoader_.throughput.count = 1;\n }\n },\n bandwidth: {\n get() {\n let playerBandwidthEst = this.playlistController_.mainSegmentLoader_.bandwidth;\n const networkInformation = window$1.navigator.connection || window$1.navigator.mozConnection || window$1.navigator.webkitConnection;\n const tenMbpsAsBitsPerSecond = 10e6;\n if (this.options_.useNetworkInformationApi && networkInformation) {\n // downlink returns Mbps\n // https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation/downlink\n const networkInfoBandwidthEstBitsPerSec = networkInformation.downlink * 1000 * 1000; // downlink maxes out at 10 Mbps. In the event that both networkInformationApi and the player\n // estimate a bandwidth greater than 10 Mbps, use the larger of the two estimates to ensure that\n // high quality streams are not filtered out.\n\n if (networkInfoBandwidthEstBitsPerSec >= tenMbpsAsBitsPerSecond && playerBandwidthEst >= tenMbpsAsBitsPerSecond) {\n playerBandwidthEst = Math.max(playerBandwidthEst, networkInfoBandwidthEstBitsPerSec);\n } else {\n playerBandwidthEst = networkInfoBandwidthEstBitsPerSec;\n }\n }\n return playerBandwidthEst;\n },\n set(bandwidth) {\n this.playlistController_.mainSegmentLoader_.bandwidth = bandwidth; // setting the bandwidth manually resets the throughput counter\n // `count` is set to zero that current value of `rate` isn't included\n // in the cumulative average\n\n this.playlistController_.mainSegmentLoader_.throughput = {\n rate: 0,\n count: 0\n };\n }\n },\n /**\n * `systemBandwidth` is a combination of two serial processes bit-rates. The first\n * is the network bitrate provided by `bandwidth` and the second is the bitrate of\n * the entire process after that - decryption, transmuxing, and appending - provided\n * by `throughput`.\n *\n * Since the two process are serial, the overall system bandwidth is given by:\n * sysBandwidth = 1 / (1 / bandwidth + 1 / throughput)\n */\n systemBandwidth: {\n get() {\n const invBandwidth = 1 / (this.bandwidth || 1);\n let invThroughput;\n if (this.throughput > 0) {\n invThroughput = 1 / this.throughput;\n } else {\n invThroughput = 0;\n }\n const systemBitrate = Math.floor(1 / (invBandwidth + invThroughput));\n return systemBitrate;\n },\n set() {\n videojs.log.error('The \"systemBandwidth\" property is read-only');\n }\n }\n });\n if (this.options_.bandwidth) {\n this.bandwidth = this.options_.bandwidth;\n }\n if (this.options_.throughput) {\n this.throughput = this.options_.throughput;\n }\n Object.defineProperties(this.stats, {\n bandwidth: {\n get: () => this.bandwidth || 0,\n enumerable: true\n },\n mediaRequests: {\n get: () => this.playlistController_.mediaRequests_() || 0,\n enumerable: true\n },\n mediaRequestsAborted: {\n get: () => this.playlistController_.mediaRequestsAborted_() || 0,\n enumerable: true\n },\n mediaRequestsTimedout: {\n get: () => this.playlistController_.mediaRequestsTimedout_() || 0,\n enumerable: true\n },\n mediaRequestsErrored: {\n get: () => this.playlistController_.mediaRequestsErrored_() || 0,\n enumerable: true\n },\n mediaTransferDuration: {\n get: () => this.playlistController_.mediaTransferDuration_() || 0,\n enumerable: true\n },\n mediaBytesTransferred: {\n get: () => this.playlistController_.mediaBytesTransferred_() || 0,\n enumerable: true\n },\n mediaSecondsLoaded: {\n get: () => this.playlistController_.mediaSecondsLoaded_() || 0,\n enumerable: true\n },\n mediaAppends: {\n get: () => this.playlistController_.mediaAppends_() || 0,\n enumerable: true\n },\n mainAppendsToLoadedData: {\n get: () => this.playlistController_.mainAppendsToLoadedData_() || 0,\n enumerable: true\n },\n audioAppendsToLoadedData: {\n get: () => this.playlistController_.audioAppendsToLoadedData_() || 0,\n enumerable: true\n },\n appendsToLoadedData: {\n get: () => this.playlistController_.appendsToLoadedData_() || 0,\n enumerable: true\n },\n timeToLoadedData: {\n get: () => this.playlistController_.timeToLoadedData_() || 0,\n enumerable: true\n },\n buffered: {\n get: () => timeRangesToArray(this.tech_.buffered()),\n enumerable: true\n },\n currentTime: {\n get: () => this.tech_.currentTime(),\n enumerable: true\n },\n currentSource: {\n get: () => this.tech_.currentSource_,\n enumerable: true\n },\n currentTech: {\n get: () => this.tech_.name_,\n enumerable: true\n },\n duration: {\n get: () => this.tech_.duration(),\n enumerable: true\n },\n main: {\n get: () => this.playlists.main,\n enumerable: true\n },\n playerDimensions: {\n get: () => this.tech_.currentDimensions(),\n enumerable: true\n },\n seekable: {\n get: () => timeRangesToArray(this.tech_.seekable()),\n enumerable: true\n },\n timestamp: {\n get: () => Date.now(),\n enumerable: true\n },\n videoPlaybackQuality: {\n get: () => this.tech_.getVideoPlaybackQuality(),\n enumerable: true\n }\n });\n this.tech_.one('canplay', this.playlistController_.setupFirstPlay.bind(this.playlistController_));\n this.tech_.on('bandwidthupdate', () => {\n if (this.options_.useBandwidthFromLocalStorage) {\n updateVhsLocalStorage({\n bandwidth: this.bandwidth,\n throughput: Math.round(this.throughput)\n });\n }\n });\n this.playlistController_.on('selectedinitialmedia', () => {\n // Add the manual rendition mix-in to VhsHandler\n renditionSelectionMixin(this);\n });\n this.playlistController_.sourceUpdater_.on('createdsourcebuffers', () => {\n this.setupEme_();\n }); // the bandwidth of the primary segment loader is our best\n // estimate of overall bandwidth\n\n this.on(this.playlistController_, 'progress', function () {\n this.tech_.trigger('progress');\n }); // In the live case, we need to ignore the very first `seeking` event since\n // that will be the result of the seek-to-live behavior\n\n this.on(this.playlistController_, 'firstplay', function () {\n this.ignoreNextSeekingEvent_ = true;\n });\n this.setupQualityLevels_(); // do nothing if the tech has been disposed already\n // this can occur if someone sets the src in player.ready(), for instance\n\n if (!this.tech_.el()) {\n return;\n }\n this.mediaSourceUrl_ = window$1.URL.createObjectURL(this.playlistController_.mediaSource);\n this.tech_.src(this.mediaSourceUrl_);\n }\n createKeySessions_() {\n const audioPlaylistLoader = this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;\n this.logger_('waiting for EME key session creation');\n waitForKeySessionCreation({\n player: this.player_,\n sourceKeySystems: this.source_.keySystems,\n audioMedia: audioPlaylistLoader && audioPlaylistLoader.media(),\n mainPlaylists: this.playlists.main.playlists\n }).then(() => {\n this.logger_('created EME key session');\n this.playlistController_.sourceUpdater_.initializedEme();\n }).catch(err => {\n this.logger_('error while creating EME key session', err);\n this.player_.error({\n message: 'Failed to initialize media keys for EME',\n code: 3\n });\n });\n }\n handleWaitingForKey_() {\n // If waitingforkey is fired, it's possible that the data that's necessary to retrieve\n // the key is in the manifest. While this should've happened on initial source load, it\n // may happen again in live streams where the keys change, and the manifest info\n // reflects the update.\n //\n // Because videojs-contrib-eme compares the PSSH data we send to that of PSSH data it's\n // already requested keys for, we don't have to worry about this generating extraneous\n // requests.\n this.logger_('waitingforkey fired, attempting to create any new key sessions');\n this.createKeySessions_();\n }\n /**\n * If necessary and EME is available, sets up EME options and waits for key session\n * creation.\n *\n * This function also updates the source updater so taht it can be used, as for some\n * browsers, EME must be configured before content is appended (if appending unencrypted\n * content before encrypted content).\n */\n\n setupEme_() {\n const audioPlaylistLoader = this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;\n const didSetupEmeOptions = setupEmeOptions({\n player: this.player_,\n sourceKeySystems: this.source_.keySystems,\n media: this.playlists.media(),\n audioMedia: audioPlaylistLoader && audioPlaylistLoader.media()\n });\n this.player_.tech_.on('keystatuschange', e => {\n if (e.status !== 'output-restricted') {\n return;\n }\n const mainPlaylist = this.playlistController_.main();\n if (!mainPlaylist || !mainPlaylist.playlists) {\n return;\n }\n const excludedHDPlaylists = []; // Assume all HD streams are unplayable and exclude them from ABR selection\n\n mainPlaylist.playlists.forEach(playlist => {\n if (playlist && playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.height >= 720) {\n if (!playlist.excludeUntil || playlist.excludeUntil < Infinity) {\n playlist.excludeUntil = Infinity;\n excludedHDPlaylists.push(playlist);\n }\n }\n });\n if (excludedHDPlaylists.length) {\n videojs.log.warn('DRM keystatus changed to \"output-restricted.\" Removing the following HD playlists ' + 'that will most likely fail to play and clearing the buffer. ' + 'This may be due to HDCP restrictions on the stream and the capabilities of the current device.', ...excludedHDPlaylists); // Clear the buffer before switching playlists, since it may already contain unplayable segments\n\n this.playlistController_.mainSegmentLoader_.resetEverything();\n this.playlistController_.fastQualityChange_();\n }\n });\n this.handleWaitingForKey_ = this.handleWaitingForKey_.bind(this);\n this.player_.tech_.on('waitingforkey', this.handleWaitingForKey_);\n if (!didSetupEmeOptions) {\n // If EME options were not set up, we've done all we could to initialize EME.\n this.playlistController_.sourceUpdater_.initializedEme();\n return;\n }\n this.createKeySessions_();\n }\n /**\n * Initializes the quality levels and sets listeners to update them.\n *\n * @method setupQualityLevels_\n * @private\n */\n\n setupQualityLevels_() {\n const player = videojs.players[this.tech_.options_.playerId]; // if there isn't a player or there isn't a qualityLevels plugin\n // or qualityLevels_ listeners have already been setup, do nothing.\n\n if (!player || !player.qualityLevels || this.qualityLevels_) {\n return;\n }\n this.qualityLevels_ = player.qualityLevels();\n this.playlistController_.on('selectedinitialmedia', () => {\n handleVhsLoadedMetadata(this.qualityLevels_, this);\n });\n this.playlists.on('mediachange', () => {\n handleVhsMediaChange(this.qualityLevels_, this.playlists);\n });\n }\n /**\n * return the version\n */\n\n static version() {\n return {\n '@videojs/http-streaming': version$4,\n 'mux.js': version$3,\n 'mpd-parser': version$2,\n 'm3u8-parser': version$1,\n 'aes-decrypter': version\n };\n }\n /**\n * return the version\n */\n\n version() {\n return this.constructor.version();\n }\n canChangeType() {\n return SourceUpdater.canChangeType();\n }\n /**\n * Begin playing the video.\n */\n\n play() {\n this.playlistController_.play();\n }\n /**\n * a wrapper around the function in PlaylistController\n */\n\n setCurrentTime(currentTime) {\n this.playlistController_.setCurrentTime(currentTime);\n }\n /**\n * a wrapper around the function in PlaylistController\n */\n\n duration() {\n return this.playlistController_.duration();\n }\n /**\n * a wrapper around the function in PlaylistController\n */\n\n seekable() {\n return this.playlistController_.seekable();\n }\n /**\n * Abort all outstanding work and cleanup.\n */\n\n dispose() {\n if (this.playbackWatcher_) {\n this.playbackWatcher_.dispose();\n }\n if (this.playlistController_) {\n this.playlistController_.dispose();\n }\n if (this.qualityLevels_) {\n this.qualityLevels_.dispose();\n }\n if (this.tech_ && this.tech_.vhs) {\n delete this.tech_.vhs;\n }\n if (this.mediaSourceUrl_ && window$1.URL.revokeObjectURL) {\n window$1.URL.revokeObjectURL(this.mediaSourceUrl_);\n this.mediaSourceUrl_ = null;\n }\n if (this.tech_) {\n this.tech_.off('waitingforkey', this.handleWaitingForKey_);\n }\n super.dispose();\n }\n convertToProgramTime(time, callback) {\n return getProgramTime({\n playlist: this.playlistController_.media(),\n time,\n callback\n });\n } // the player must be playing before calling this\n\n seekToProgramTime(programTime, callback, pauseAfterSeek = true, retryCount = 2) {\n return seekToProgramTime({\n programTime,\n playlist: this.playlistController_.media(),\n retryCount,\n pauseAfterSeek,\n seekTo: this.options_.seekTo,\n tech: this.options_.tech,\n callback\n });\n }\n /**\n * Adds the onRequest, onResponse, offRequest and offResponse functions\n * to the VhsHandler xhr Object.\n */\n\n setupXhrHooks_() {\n /**\n * A player function for setting an onRequest hook\n *\n * @param {function} callback for request modifiction\n */\n this.xhr.onRequest = callback => {\n addOnRequestHook(this.xhr, callback);\n };\n /**\n * A player function for setting an onResponse hook\n *\n * @param {callback} callback for response data retrieval\n */\n\n this.xhr.onResponse = callback => {\n addOnResponseHook(this.xhr, callback);\n };\n /**\n * Deletes a player onRequest callback if it exists\n *\n * @param {function} callback to delete from the player set\n */\n\n this.xhr.offRequest = callback => {\n removeOnRequestHook(this.xhr, callback);\n };\n /**\n * Deletes a player onResponse callback if it exists\n *\n * @param {function} callback to delete from the player set\n */\n\n this.xhr.offResponse = callback => {\n removeOnResponseHook(this.xhr, callback);\n }; // Trigger an event on the player to notify the user that vhs is ready to set xhr hooks.\n // This allows hooks to be set before the source is set to vhs when handleSource is called.\n\n this.player_.trigger('xhr-hooks-ready');\n }\n}\n/**\n * The Source Handler object, which informs video.js what additional\n * MIME types are supported and sets up playback. It is registered\n * automatically to the appropriate tech based on the capabilities of\n * the browser it is running in. It is not necessary to use or modify\n * this object in normal usage.\n */\n\nconst VhsSourceHandler = {\n name: 'videojs-http-streaming',\n VERSION: version$4,\n canHandleSource(srcObj, options = {}) {\n const localOptions = merge(videojs.options, options);\n return VhsSourceHandler.canPlayType(srcObj.type, localOptions);\n },\n handleSource(source, tech, options = {}) {\n const localOptions = merge(videojs.options, options);\n tech.vhs = new VhsHandler(source, tech, localOptions);\n tech.vhs.xhr = xhrFactory();\n tech.vhs.setupXhrHooks_();\n tech.vhs.src(source.src, source.type);\n return tech.vhs;\n },\n canPlayType(type, options) {\n const simpleType = simpleTypeFromSourceType(type);\n if (!simpleType) {\n return '';\n }\n const overrideNative = VhsSourceHandler.getOverrideNative(options);\n const supportsTypeNatively = Vhs.supportsTypeNatively(simpleType);\n const canUseMsePlayback = !supportsTypeNatively || overrideNative;\n return canUseMsePlayback ? 'maybe' : '';\n },\n getOverrideNative(options = {}) {\n const {\n vhs = {}\n } = options;\n const defaultOverrideNative = !(videojs.browser.IS_ANY_SAFARI || videojs.browser.IS_IOS);\n const {\n overrideNative = defaultOverrideNative\n } = vhs;\n return overrideNative;\n }\n};\n/**\n * Check to see if the native MediaSource object exists and supports\n * an MP4 container with both H.264 video and AAC-LC audio.\n *\n * @return {boolean} if native media sources are supported\n */\n\nconst supportsNativeMediaSources = () => {\n return browserSupportsCodec('avc1.4d400d,mp4a.40.2');\n}; // register source handlers with the appropriate techs\n\nif (supportsNativeMediaSources()) {\n videojs.getTech('Html5').registerSourceHandler(VhsSourceHandler, 0);\n}\nvideojs.VhsHandler = VhsHandler;\nvideojs.VhsSourceHandler = VhsSourceHandler;\nvideojs.Vhs = Vhs;\nif (!videojs.use) {\n videojs.registerComponent('Vhs', Vhs);\n}\nvideojs.options.vhs = videojs.options.vhs || {};\nif (!videojs.getPlugin || !videojs.getPlugin('reloadSourceOnError')) {\n videojs.registerPlugin('reloadSourceOnError', reloadSourceOnError);\n}\n\nexport { videojs as default };\n","import $ from 'jquery';\r\nimport videojs from 'video.js';\r\nimport \"video.js/dist/video-js.css\";\r\n\r\n\r\nconst videoJs = (() => {\r\n\r\n const defaultVideoJs = () => {\r\n var homeSearchVideo = document.getElementById('search-video');\r\n if(homeSearchVideo){\r\n homeSearchVideo.play();\r\n }\r\n };\r\n\r\n\r\n const init = () => {\r\n defaultVideoJs();\r\n };\r\n\r\n return {\r\n init,\r\n };\r\n})();\r\n\r\nexport default videoJs;\r\n","/**\r\n * Get Current Browser\r\n *\r\n * @file browser.js\r\n */\r\nconst browser = (() => {\r\n const nAgt = navigator.userAgent;\r\n let browserName = navigator.appName;\r\n let fullVersion = `${ parseFloat(navigator.appVersion) }`;\r\n let majorVersion = parseInt(navigator.appVersion, 10);\r\n let nameOffset;\r\n let verOffset;\r\n let ix;\r\n\r\n /**\r\n * Get Browser Detail\r\n * Browser name and version\r\n */\r\n const getBrowserDetail = () => {\r\n if ((nAgt.indexOf('Opera')) !== -1) {\r\n verOffset = nAgt.indexOf('Opera');\r\n browserName = 'Opera';\r\n fullVersion = nAgt.substring(verOffset + 6);\r\n if ((nAgt.indexOf('Version')) !== -1) {\r\n verOffset = nAgt.indexOf('Version');\r\n fullVersion = nAgt.substring(verOffset + 8);\r\n }\r\n } else if ((nAgt.indexOf('MSIE')) !== -1) {\r\n verOffset = nAgt.indexOf('MSIE');\r\n browserName = 'Microsoft Internet Explorer';\r\n fullVersion = nAgt.substring(verOffset + 5);\r\n } else if ((nAgt.indexOf('Chrome')) !== -1) {\r\n verOffset = nAgt.indexOf('Chrome');\r\n browserName = 'Chrome';\r\n fullVersion = nAgt.substring(verOffset + 7);\r\n } else if ((nAgt.indexOf('Safari')) !== -1) {\r\n verOffset = nAgt.indexOf('Safari');\r\n browserName = 'Safari';\r\n fullVersion = nAgt.substring(verOffset + 7);\r\n if ((nAgt.indexOf('Version')) !== -1) {\r\n verOffset = nAgt.indexOf('Version');\r\n fullVersion = nAgt.substring(verOffset + 8);\r\n }\r\n } else if ((nAgt.indexOf('Firefox')) !== -1) {\r\n verOffset = nAgt.indexOf('Firefox');\r\n browserName = 'Firefox';\r\n fullVersion = nAgt.substring(verOffset + 8);\r\n } else if ((nAgt.lastIndexOf(' ') + 1) < (nAgt.lastIndexOf('/'))) {\r\n nameOffset = nAgt.lastIndexOf(' ') + 1;\r\n verOffset = nAgt.lastIndexOf('/');\r\n browserName = nAgt.substring(nameOffset, verOffset);\r\n fullVersion = nAgt.substring(verOffset + 1);\r\n\r\n if (browserName.toLowerCase() === browserName.toUpperCase()) {\r\n browserName = navigator.appName;\r\n }\r\n }\r\n\r\n // trim the fullVersion string at semicolon/space if present\r\n if ((fullVersion.indexOf(';')) !== -1) {\r\n ix = fullVersion.indexOf(';');\r\n fullVersion = fullVersion.substring(0, ix);\r\n }\r\n\r\n if ((fullVersion.indexOf(' ')) !== -1) {\r\n ix = fullVersion.indexOf(' ');\r\n fullVersion = fullVersion.substring(0, ix);\r\n }\r\n\r\n majorVersion = parseInt(`${ fullVersion }`, 10);\r\n\r\n // eslint-disable-next-line\r\n if (isNaN(majorVersion)) {\r\n fullVersion = `${ parseFloat(navigator.appVersion) }`;\r\n majorVersion = parseInt(navigator.appVersion, 10);\r\n }\r\n\r\n return { name: browserName, version: majorVersion };\r\n };\r\n\r\n return {\r\n getDetail: getBrowserDetail,\r\n };\r\n})(navigator, document);\r\n\r\nexport default browser;\r\n","export const hasTouch = 'ontouchstart' in document;\r\nexport const isApple = /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);\r\nexport const isAndroid = /(Android)/i.test(navigator.platform);\r\nexport const isIpad = navigator.userAgent.match(/iPad/i);\r\nexport const isMobile = navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(Android)|(BlackBerry)|(IEMobile)|(Windows Phone)|(kindle)|(Opera Mini)|(webOS)/i);\r\nexport const isIeBrowser = navigator.userAgent.match(/MSIE/i);\r\n","import browser from './browser';\r\nimport { hasTouch, isMobile } from './constants';\r\n\r\n/**\r\n * After Load\r\n *\r\n * @file loadPage.js\r\n */\r\nconst loadPage = (() => {\r\n const documentHtml = document.getElementsByTagName('html')[0];\r\n const browserName = browser.getDetail().name.toLowerCase() || '';\r\n const browserVersion = browser.getDetail().version || '';\r\n\r\n const classes = [];\r\n\r\n\r\n /**\r\n * JS Load Class\r\n * js load class for css\r\n */\r\n const htmlAddedClasses = () => {\r\n classes.push('no-js');\r\n if (hasTouch) {\r\n classes.push('touch');\r\n } else {\r\n classes.push('no-touch');\r\n }\r\n\r\n if (isMobile) {\r\n classes.push('mobile');\r\n } else {\r\n classes.push('desktop');\r\n }\r\n classes.push(browserName.replace(/ /g, '-'));\r\n classes.push(browserVersion);\r\n classes.push('js');\r\n classes.shift();\r\n documentHtml.className = classes.join(' ');\r\n };\r\n\r\n const init = () => {\r\n htmlAddedClasses();\r\n };\r\n\r\n\r\n return {\r\n init,\r\n };\r\n})();\r\n\r\nexport default loadPage;\r\n","/**\r\n * @author Blueprint Frontend Team\r\n */\r\nimport \"../scss/index.scss\";\r\nimport { applyForm } from './modules';\r\nimport { header, menu } from './layouts';\r\nimport { slider, tabs, accordion, cookie, aosAnim, fancyboxGallery, videoJs } from './components';\r\n\r\nimport { loadPage } from './utils';\r\n\r\n(function () {\r\n loadPage.init();\r\n\r\n // Layouts\r\n header.init();\r\n // Layouts\r\n menu.init();\r\n\r\n\r\n // Partials Modules\r\n slider.init();\r\n tabs.init();\r\n aosAnim.init();\r\n accordion.init();\r\n cookie.init();\r\n fancyboxGallery.init();\r\n videoJs.init();\r\n applyForm.init();\r\n\r\n\r\n // Page Modules\r\n}());\r\n"],"sourceRoot":""}