{"version":3,"file":"FloorplanZoom-D8k2eYEY.js","sources":["../../ClientApp/src/js/components/AjaxPanels.ts","../../ClientApp/src/js/components/InclusionDetailsLoad.ts","../../ClientApp/src/js/components/SpecificPhotoSlideshow.ts","../../ClientApp/src/js/components/GalleryPlanPhotoSlideshow.ts","../../node_modules/svg-pan-zoom/src/uniwheel.js","../../node_modules/svg-pan-zoom/src/utilities.js","../../node_modules/svg-pan-zoom/src/svg-utilities.js","../../node_modules/svg-pan-zoom/src/control-icons.js","../../node_modules/svg-pan-zoom/src/shadow-viewport.js","../../node_modules/svg-pan-zoom/src/svg-pan-zoom.js","../../ClientApp/src/js/components/FloorplanZoom.ts"],"sourcesContent":["const AjaxPanels = (\r\n panelContainerId: string,\r\n panelContentId: string,\r\n callback?: () => void,\r\n) => {\r\n const panelContainer = document.getElementById(panelContainerId);\r\n const panelContent = document.getElementById(panelContentId);\r\n\r\n if (!panelContainer) {\r\n console.warn(`Panel container with id \"${panelContainerId}\" not found.`);\r\n return;\r\n }\r\n\r\n if (!panelContent) {\r\n console.warn(`Panel container with id \"${panelContentId}\" not found.`);\r\n return;\r\n }\r\n\r\n // Function to deactivate all buttons\r\n const deactivateAllButtons = () => {\r\n const allButtons =\r\n panelContainer.querySelectorAll('.js-btn-tab-nav');\r\n allButtons.forEach(button => {\r\n button.classList.remove('active'); // Remove the active class from all buttons\r\n });\r\n };\r\n\r\n // Function to toggle the panel visibility with optional callback\r\n const loadContent = async (panelUrl: string) => {\r\n //load ajax stuff here\r\n try { \r\n // Perform the fetch operation\r\n const response = await fetch(panelUrl);\r\n\r\n if (!response.ok) {\r\n throw new Error(`Error: ${response.status}`);\r\n }\r\n\r\n const htmlContent = await response.text(); // Get HTML as a string\r\n // Process the fetched data and update the panel content\r\n panelContent.innerHTML = htmlContent; // Example: setting content from fetched data\r\n\r\n if (callback) {\r\n callback();\r\n }\r\n } catch (error) {\r\n console.error('Failed to load content:', error);\r\n }\r\n };\r\n\r\n // Event handler for panel buttons\r\n const handlePanelClick = (event: Event) => {\r\n event.preventDefault();\r\n const panelBtn = event.target as HTMLButtonElement;\r\n\r\n if (panelBtn.classList.contains('active')) {\r\n return; // Exit if the clicked button is already active\r\n }\r\n\r\n const panelUrl = panelBtn.dataset.target;\r\n\r\n if (panelUrl) {\r\n deactivateAllButtons(); // Remove the active class from all buttons\r\n panelBtn.classList.add('active'); // Add the active class to the clicked button\r\n loadContent(panelUrl); // Toggle the panel associated with the clicked button\r\n }\r\n };\r\n\r\n // Initialize by adding event listeners to all buttons with the class 'js-btn-tab-nav'\r\n const initPanels = () => {\r\n const panelBtns =\r\n panelContainer.querySelectorAll('.js-btn-tab-nav');\r\n panelBtns.forEach(panelBtn => {\r\n panelBtn.addEventListener('click', handlePanelClick);\r\n });\r\n };\r\n\r\n initPanels();\r\n};\r\n\r\nexport default AjaxPanels;\r\n","const InclusionDetailsLoad = (showLoadBtn: boolean = false, afterLoadCallBack?: () => void) => {\r\n let inclusionTiles = document.querySelectorAll('.inclusion-detail-tile');\r\n let loadMoreBtn = document.getElementById('js-inclusions-load-more');\r\n let viewAllBtn = document.getElementById('js-inclusions-view-all');\r\n\r\n let visibleCount: number = window.innerWidth >= 768 ? 6 : 3;\r\n let currentVisibleCount: number = 0;\r\n\r\n const showItems = (count: number): void => {\r\n for (\r\n let i = currentVisibleCount;\r\n i < currentVisibleCount + count && i < inclusionTiles.length;\r\n i++\r\n ) {\r\n inclusionTiles[i].classList.add('active'); // Add the 'active' class to show the item\r\n }\r\n currentVisibleCount += count;\r\n };\r\n\r\n const loadMoreItems = () => {\r\n const hiddenItems = Array.from(inclusionTiles).filter(\r\n item => !item.classList.contains('active'),\r\n );\r\n\r\n // Show the next batch of hidden items\r\n const itemsToShow = hiddenItems.slice(0, visibleCount);\r\n itemsToShow.forEach(item => {\r\n item.classList.add('active'); // Add the 'active' class\r\n });\r\n\r\n // Hide the \"Load More\" button if no more hidden items\r\n if (hiddenItems.length <= visibleCount) {\r\n if (loadMoreBtn) {\r\n loadMoreBtn.style.display = 'none';\r\n }\r\n if (viewAllBtn) {\r\n viewAllBtn.style.display = 'none';\r\n }\r\n }\r\n\r\n //primarily used for sticky nav to refresh calculations\r\n if (afterLoadCallBack) {\r\n afterLoadCallBack();\r\n }\r\n };\r\n\r\n const viewAllItems = (): void => {\r\n // Show all remaining items\r\n inclusionTiles.forEach(item => {\r\n item.classList.add('active'); // Add the 'active' class to show all items\r\n });\r\n\r\n // Hide buttons\r\n if (loadMoreBtn) {\r\n loadMoreBtn.style.display = 'none';\r\n }\r\n\r\n if (viewAllBtn) {\r\n viewAllBtn.style.display = 'none';\r\n }\r\n\r\n //primarily used for sticky nav to refresh calculations\r\n if (afterLoadCallBack) {\r\n afterLoadCallBack();\r\n }\r\n };\r\n\r\n const init = () => {\r\n if (loadMoreBtn) {\r\n loadMoreBtn.addEventListener('click', loadMoreItems);\r\n }\r\n\r\n if (viewAllBtn) {\r\n viewAllBtn.addEventListener('click', viewAllItems);\r\n }\r\n };\r\n\r\n const destroy = () => {\r\n currentVisibleCount = 0;\r\n if (loadMoreBtn) {\r\n loadMoreBtn.removeEventListener('click', loadMoreItems);\r\n }\r\n\r\n if (viewAllBtn) {\r\n viewAllBtn.removeEventListener('click', viewAllItems);\r\n }\r\n\r\n // Optionally reset styles or classes\r\n inclusionTiles.forEach(item => {\r\n item.classList.remove('active');\r\n });\r\n };\r\n\r\n const updateVisibleCount = () => {\r\n visibleCount = window.innerWidth >= 768 ? 6 : 3;\r\n\r\n // Reset current visible count\r\n currentVisibleCount = 0;\r\n\r\n // Remove the 'active' class from all items initially\r\n inclusionTiles.forEach(item => {\r\n item.classList.remove('active');\r\n });\r\n\r\n showItems(visibleCount); // Show the new number of items\r\n };\r\n\r\n // Debounced resize function\r\n let resizeTimeout: number;\r\n const onResize = () => {\r\n clearTimeout(resizeTimeout);\r\n resizeTimeout = window.setTimeout(updateVisibleCount, 100);\r\n };\r\n\r\n window.addEventListener('resize', onResize);\r\n\r\n // Show the initial number of items\r\n showItems(visibleCount);\r\n\r\n // Show the Load More button if needed\r\n if (showLoadBtn) {\r\n if (loadMoreBtn) {\r\n loadMoreBtn.style.display = 'inline-block';\r\n }\r\n\r\n if (viewAllBtn) {\r\n viewAllBtn.style.display = 'inline-block';\r\n }\r\n }\r\n\r\n const reinitialize = () => { \r\n destroy(); // Clean up any previous state\r\n inclusionTiles = document.querySelectorAll('.inclusion-detail-tile');\r\n loadMoreBtn = document.getElementById('js-inclusions-load-more');\r\n viewAllBtn = document.getElementById('js-inclusions-view-all');\r\n showItems(visibleCount); // Reinitialize visible items\r\n init(); // Reattach event listeners\r\n \r\n if (loadMoreBtn && viewAllBtn) {\r\n if (inclusionTiles.length > visibleCount) {\r\n loadMoreBtn.style.display = 'inline-block';\r\n viewAllBtn.style.display = 'inline-block';\r\n } else {\r\n loadMoreBtn.style.display = 'none';\r\n viewAllBtn.style.display = 'none';\r\n }\r\n } \r\n };\r\n\r\n init(); // Initialize the event listeners\r\n\r\n return { reinitialize, destroy };\r\n};\r\n\r\nexport default InclusionDetailsLoad;\r\n","import Swiper from 'swiper';\r\nimport { Navigation } from 'swiper/modules';\r\nimport { SwiperOptions } from 'swiper/types';\r\n\r\nSwiper.use([Navigation]);\r\nexport function initSpecificPhotoSlideShows() {\r\n const slideshowEls = document.querySelectorAll('.js-slideshows');\r\n\r\n slideshowEls.forEach(swiperElement => {\r\n const options: SwiperOptions = {\r\n slidesPerView: 1,\r\n spaceBetween: 0,\r\n navigation: {\r\n nextEl: swiperElement.querySelector(\r\n '.js-btn-slideshow-next',\r\n ) as HTMLElement,\r\n prevEl: swiperElement.querySelector(\r\n '.js-btn-slideshow-prev',\r\n ) as HTMLElement,\r\n },\r\n };\r\n\r\n new Swiper(swiperElement, options);\r\n });\r\n}\r\n","import Swiper from 'swiper';\r\nimport { Navigation } from 'swiper/modules';\r\nimport { SwiperOptions } from 'swiper/types';\r\n\r\nSwiper.use([Navigation]);\r\n\r\nconst GalleryPlanPhotoSlideshow = () => {\r\n const slideshowEls = document.querySelectorAll(\r\n '.js-gallery-plan-slideshows',\r\n );\r\n\r\n if (slideshowEls.length === 0) {\r\n console.warn('Slideshows not found');\r\n return;\r\n }\r\n\r\n const getAnimationType = () => {\r\n const width = window.innerWidth;\r\n if (width < 1024) return 'tablet'; // Tablet Down\r\n return 'desktop'; // Desktop\r\n };\r\n\r\n const slidesPer = getAnimationType() === 'tablet' ? 1 : 1.5;\r\n\r\n const filterSlides = (swiper: Swiper, keywords: string[]): void => {\r\n const slides = swiper.slides as HTMLElement[]; // Get the slides from the Swiper instance\r\n const visibleSlides: HTMLElement[] = []; // Track visible slides\r\n\r\n // Filter slides based on keywords\r\n slides.forEach((slide: HTMLElement) => {\r\n const category = slide.dataset.category || ''; // Handle undefined cases\r\n const containsAnyKeyword = keywords.some(keyword => category.includes(keyword));\r\n\r\n if (containsAnyKeyword || keywords.length === 0) {\r\n slide.style.display = ''; // Show slide\r\n visibleSlides.push(slide); // Add to visible slides list\r\n } else {\r\n slide.style.display = 'none'; // Hide slide\r\n }\r\n });\r\n\r\n swiper.updateSlides(); // Update slides after filtering\r\n swiper.update(); // Reinitialize swiper to account for new slide layout\r\n\r\n const shouldLoop = visibleSlides.length > 3; // Enable loop if 3 or more slides are visible\r\n console.log(shouldLoop);\r\n swiper.params.loop = shouldLoop; // Dynamically set loop\r\n swiper.loopDestroy(); // Destroy existing loop behavior\r\n swiper.loopCreate(); // Recreate loop behavior with new setting\r\n\r\n // Reapply Swiper active/prev/next classes to visible slides only\r\n if (visibleSlides.length > 0) {\r\n\r\n console.log(visibleSlides.length, 'vsl');\r\n let activeIndex = 0;\r\n\r\n if (visibleSlides.length == 3) {\r\n activeIndex = 0; // Center the active slide\r\n } else if (visibleSlides.length > 3) {\r\n activeIndex = Math.floor(visibleSlides.length / 2)\r\n }\r\n\r\n const activeSlide = visibleSlides[activeIndex];\r\n\r\n visibleSlides.forEach((slide, index) => {\r\n slide.classList.remove('swiper-slide-active', 'swiper-slide-next', 'swiper-slide-prev');\r\n\r\n if (index === activeIndex) {\r\n slide.classList.add('swiper-slide-active');\r\n } else if (index === activeIndex + 1) {\r\n slide.classList.add('swiper-slide-next');\r\n } else if (index === activeIndex - 1) {\r\n slide.classList.add('swiper-slide-prev');\r\n }\r\n });\r\n\r\n const newActiveIndex = swiper.slides.indexOf(activeSlide);\r\n\r\n swiper.slideTo(newActiveIndex, 0, false); // Jump to the active slide without animation\r\n }\r\n\r\n // Toggle navigation buttons based on visible slide count\r\n const nextButton = swiper.navigation?.nextEl as HTMLElement;\r\n const prevButton = swiper.navigation?.prevEl as HTMLElement;\r\n if (visibleSlides.length <= 1) {\r\n nextButton.style.display = 'none'; // Hide next button\r\n prevButton.style.display = 'none'; // Hide prev button\r\n } else {\r\n nextButton.style.display = ''; // Show next button\r\n prevButton.style.display = ''; // Show prev button\r\n }\r\n\r\n swiper.updateSlidesClasses(); // Update classes to ensure Swiper's internal state is correct\r\n };\r\n\r\n\r\n\r\n\r\n let selectedCategories: string[] = [];\r\n\r\n const handleFilterButtonClick = (event: Event, swiper: Swiper) => {\r\n const target = event.target as HTMLElement;\r\n const filter = target.dataset.target;\r\n\r\n if (!filter) return;\r\n\r\n // Clear previous selections\r\n document.querySelectorAll('.js-btn-gallery-filter').forEach(btn => btn.classList.remove('active'));\r\n\r\n // If the clicked button is \"All\", reset selectedCategories\r\n if (filter === 'all') {\r\n selectedCategories = []; // Reset to show all slides\r\n target.classList.add('active'); // Highlight \"All Photos\" button\r\n } else {\r\n selectedCategories = [filter]; // Set the single category as selected\r\n target.classList.add('active'); // Highlight the clicked button\r\n }\r\n\r\n filterSlides(swiper, selectedCategories); // Filter slides based on the single selected category\r\n };\r\n\r\n const init = () => {\r\n slideshowEls.forEach(swiperElement => {\r\n const parentElement = swiperElement.closest('.js-gallery-plan-slideshow-container')!;\r\n\r\n const nextButton = parentElement.querySelector('.js-btn-slideshow-next') as HTMLElement;\r\n const prevButton = parentElement.querySelector('.js-btn-slideshow-prev') as HTMLElement;\r\n\r\n // Get the initial number of slides that are visible (not filtered)\r\n const initialSlides = swiperElement.querySelectorAll('.swiper-slide:not([style*=\"display: none\"])');\r\n const shouldLoop = initialSlides.length >= 3; // Disable loop if fewer than 3 slides\r\n\r\n const options: SwiperOptions = {\r\n slidesPerView: slidesPer, // Show a portion of the next and previous slides\r\n centeredSlides: true,\r\n spaceBetween: 10,\r\n loop: shouldLoop, // Dynamically set loop based on the number of slides\r\n slideToClickedSlide: true,\r\n navigation: {\r\n nextEl: nextButton,\r\n prevEl: prevButton,\r\n },\r\n };\r\n\r\n const swiper = new Swiper(swiperElement, options);\r\n swiper.update();\r\n\r\n // Check the number of slides and hide navigation if there are fewer than 2\r\n if (swiper.slides.length < 2) {\r\n nextButton.style.display = 'none';\r\n prevButton.style.display = 'none';\r\n }\r\n\r\n // Event listeners for filtering\r\n const filterButtons = parentElement.querySelectorAll('.js-btn-gallery-filter');\r\n filterButtons.forEach(button => {\r\n button.addEventListener('click', event => handleFilterButtonClick(event, swiper));\r\n });\r\n });\r\n };\r\n\r\n\r\n init();\r\n};\r\n\r\nexport default GalleryPlanPhotoSlideshow;\r\n","// uniwheel 0.1.2 (customized)\n// A unified cross browser mouse wheel event handler\n// https://github.com/teemualap/uniwheel\n\nmodule.exports = (function(){\n\n //Full details: https://developer.mozilla.org/en-US/docs/Web/Reference/Events/wheel\n\n var prefix = \"\", _addEventListener, _removeEventListener, support, fns = [];\n var passiveOption = {passive: true};\n\n // detect event model\n if ( window.addEventListener ) {\n _addEventListener = \"addEventListener\";\n _removeEventListener = \"removeEventListener\";\n } else {\n _addEventListener = \"attachEvent\";\n _removeEventListener = \"detachEvent\";\n prefix = \"on\";\n }\n\n // detect available wheel event\n support = \"onwheel\" in document.createElement(\"div\") ? \"wheel\" : // Modern browsers support \"wheel\"\n document.onmousewheel !== undefined ? \"mousewheel\" : // Webkit and IE support at least \"mousewheel\"\n \"DOMMouseScroll\"; // let's assume that remaining browsers are older Firefox\n\n\n function createCallback(element,callback) {\n\n var fn = function(originalEvent) {\n\n !originalEvent && ( originalEvent = window.event );\n\n // create a normalized event object\n var event = {\n // keep a ref to the original event object\n originalEvent: originalEvent,\n target: originalEvent.target || originalEvent.srcElement,\n type: \"wheel\",\n deltaMode: originalEvent.type == \"MozMousePixelScroll\" ? 0 : 1,\n deltaX: 0,\n delatZ: 0,\n preventDefault: function() {\n originalEvent.preventDefault ?\n originalEvent.preventDefault() :\n originalEvent.returnValue = false;\n }\n };\n\n // calculate deltaY (and deltaX) according to the event\n if ( support == \"mousewheel\" ) {\n event.deltaY = - 1/40 * originalEvent.wheelDelta;\n // Webkit also support wheelDeltaX\n originalEvent.wheelDeltaX && ( event.deltaX = - 1/40 * originalEvent.wheelDeltaX );\n } else {\n event.deltaY = originalEvent.detail;\n }\n\n // it's time to fire the callback\n return callback( event );\n\n };\n\n fns.push({\n element: element,\n fn: fn,\n });\n\n return fn;\n }\n\n function getCallback(element) {\n for (var i = 0; i < fns.length; i++) {\n if (fns[i].element === element) {\n return fns[i].fn;\n }\n }\n return function(){};\n }\n\n function removeCallback(element) {\n for (var i = 0; i < fns.length; i++) {\n if (fns[i].element === element) {\n return fns.splice(i,1);\n }\n }\n }\n\n function _addWheelListener(elem, eventName, callback, isPassiveListener ) {\n var cb;\n\n if (support === \"wheel\") {\n cb = callback;\n } else {\n cb = createCallback(elem, callback);\n }\n\n elem[_addEventListener](prefix + eventName, cb, isPassiveListener ? passiveOption : false);\n }\n\n function _removeWheelListener(elem, eventName, callback, isPassiveListener ) {\n\n var cb;\n\n if (support === \"wheel\") {\n cb = callback;\n } else {\n cb = getCallback(elem);\n }\n\n elem[_removeEventListener](prefix + eventName, cb, isPassiveListener ? passiveOption : false);\n\n removeCallback(elem);\n }\n\n function addWheelListener( elem, callback, isPassiveListener ) {\n _addWheelListener(elem, support, callback, isPassiveListener );\n\n // handle MozMousePixelScroll in older Firefox\n if( support == \"DOMMouseScroll\" ) {\n _addWheelListener(elem, \"MozMousePixelScroll\", callback, isPassiveListener );\n }\n }\n\n function removeWheelListener(elem, callback, isPassiveListener){\n _removeWheelListener(elem, support, callback, isPassiveListener);\n\n // handle MozMousePixelScroll in older Firefox\n if( support == \"DOMMouseScroll\" ) {\n _removeWheelListener(elem, \"MozMousePixelScroll\", callback, isPassiveListener);\n }\n }\n\n return {\n on: addWheelListener,\n off: removeWheelListener\n };\n\n})();\n","module.exports = {\n /**\n * Extends an object\n *\n * @param {Object} target object to extend\n * @param {Object} source object to take properties from\n * @return {Object} extended object\n */\n extend: function(target, source) {\n target = target || {};\n for (var prop in source) {\n // Go recursively\n if (this.isObject(source[prop])) {\n target[prop] = this.extend(target[prop], source[prop]);\n } else {\n target[prop] = source[prop];\n }\n }\n return target;\n },\n\n /**\n * Checks if an object is a DOM element\n *\n * @param {Object} o HTML element or String\n * @return {Boolean} returns true if object is a DOM element\n */\n isElement: function(o) {\n return (\n o instanceof HTMLElement ||\n o instanceof SVGElement ||\n o instanceof SVGSVGElement || //DOM2\n (o &&\n typeof o === \"object\" &&\n o !== null &&\n o.nodeType === 1 &&\n typeof o.nodeName === \"string\")\n );\n },\n\n /**\n * Checks if an object is an Object\n *\n * @param {Object} o Object\n * @return {Boolean} returns true if object is an Object\n */\n isObject: function(o) {\n return Object.prototype.toString.call(o) === \"[object Object]\";\n },\n\n /**\n * Checks if variable is Number\n *\n * @param {Integer|Float} n\n * @return {Boolean} returns true if variable is Number\n */\n isNumber: function(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n },\n\n /**\n * Search for an SVG element\n *\n * @param {Object|String} elementOrSelector DOM Element or selector String\n * @return {Object|Null} SVG or null\n */\n getSvg: function(elementOrSelector) {\n var element, svg;\n\n if (!this.isElement(elementOrSelector)) {\n // If selector provided\n if (\n typeof elementOrSelector === \"string\" ||\n elementOrSelector instanceof String\n ) {\n // Try to find the element\n element = document.querySelector(elementOrSelector);\n\n if (!element) {\n throw new Error(\n \"Provided selector did not find any elements. Selector: \" +\n elementOrSelector\n );\n return null;\n }\n } else {\n throw new Error(\"Provided selector is not an HTML object nor String\");\n return null;\n }\n } else {\n element = elementOrSelector;\n }\n\n if (element.tagName.toLowerCase() === \"svg\") {\n svg = element;\n } else {\n if (element.tagName.toLowerCase() === \"object\") {\n svg = element.contentDocument.documentElement;\n } else {\n if (element.tagName.toLowerCase() === \"embed\") {\n svg = element.getSVGDocument().documentElement;\n } else {\n if (element.tagName.toLowerCase() === \"img\") {\n throw new Error(\n 'Cannot script an SVG in an \"img\" element. Please use an \"object\" element or an in-line SVG.'\n );\n } else {\n throw new Error(\"Cannot get SVG.\");\n }\n return null;\n }\n }\n }\n\n return svg;\n },\n\n /**\n * Attach a given context to a function\n * @param {Function} fn Function\n * @param {Object} context Context\n * @return {Function} Function with certain context\n */\n proxy: function(fn, context) {\n return function() {\n return fn.apply(context, arguments);\n };\n },\n\n /**\n * Returns object type\n * Uses toString that returns [object SVGPoint]\n * And than parses object type from string\n *\n * @param {Object} o Any object\n * @return {String} Object type\n */\n getType: function(o) {\n return Object.prototype.toString\n .apply(o)\n .replace(/^\\[object\\s/, \"\")\n .replace(/\\]$/, \"\");\n },\n\n /**\n * If it is a touch event than add clientX and clientY to event object\n *\n * @param {Event} evt\n * @param {SVGSVGElement} svg\n */\n mouseAndTouchNormalize: function(evt, svg) {\n // If no clientX then fallback\n if (evt.clientX === void 0 || evt.clientX === null) {\n // Fallback\n evt.clientX = 0;\n evt.clientY = 0;\n\n // If it is a touch event\n if (evt.touches !== void 0 && evt.touches.length) {\n if (evt.touches[0].clientX !== void 0) {\n evt.clientX = evt.touches[0].clientX;\n evt.clientY = evt.touches[0].clientY;\n } else if (evt.touches[0].pageX !== void 0) {\n var rect = svg.getBoundingClientRect();\n\n evt.clientX = evt.touches[0].pageX - rect.left;\n evt.clientY = evt.touches[0].pageY - rect.top;\n }\n // If it is a custom event\n } else if (evt.originalEvent !== void 0) {\n if (evt.originalEvent.clientX !== void 0) {\n evt.clientX = evt.originalEvent.clientX;\n evt.clientY = evt.originalEvent.clientY;\n }\n }\n }\n },\n\n /**\n * Check if an event is a double click/tap\n * TODO: For touch gestures use a library (hammer.js) that takes in account other events\n * (touchmove and touchend). It should take in account tap duration and traveled distance\n *\n * @param {Event} evt\n * @param {Event} prevEvt Previous Event\n * @return {Boolean}\n */\n isDblClick: function(evt, prevEvt) {\n // Double click detected by browser\n if (evt.detail === 2) {\n return true;\n }\n // Try to compare events\n else if (prevEvt !== void 0 && prevEvt !== null) {\n var timeStampDiff = evt.timeStamp - prevEvt.timeStamp, // should be lower than 250 ms\n touchesDistance = Math.sqrt(\n Math.pow(evt.clientX - prevEvt.clientX, 2) +\n Math.pow(evt.clientY - prevEvt.clientY, 2)\n );\n\n return timeStampDiff < 250 && touchesDistance < 10;\n }\n\n // Nothing found\n return false;\n },\n\n /**\n * Returns current timestamp as an integer\n *\n * @return {Number}\n */\n now:\n Date.now ||\n function() {\n return new Date().getTime();\n },\n\n // From underscore.\n // Returns a function, that, when invoked, will only be triggered at most once\n // during a given window of time. Normally, the throttled function will run\n // as much as it can, without ever going more than once per `wait` duration;\n // but if you'd like to disable the execution on the leading edge, pass\n // `{leading: false}`. To disable execution on the trailing edge, ditto.\n throttle: function(func, wait, options) {\n var that = this;\n var context, args, result;\n var timeout = null;\n var previous = 0;\n if (!options) {\n options = {};\n }\n var later = function() {\n previous = options.leading === false ? 0 : that.now();\n timeout = null;\n result = func.apply(context, args);\n if (!timeout) {\n context = args = null;\n }\n };\n return function() {\n var now = that.now();\n if (!previous && options.leading === false) {\n previous = now;\n }\n var remaining = wait - (now - previous);\n context = this; // eslint-disable-line consistent-this\n args = arguments;\n if (remaining <= 0 || remaining > wait) {\n clearTimeout(timeout);\n timeout = null;\n previous = now;\n result = func.apply(context, args);\n if (!timeout) {\n context = args = null;\n }\n } else if (!timeout && options.trailing !== false) {\n timeout = setTimeout(later, remaining);\n }\n return result;\n };\n },\n\n /**\n * Create a requestAnimationFrame simulation\n *\n * @param {Number|String} refreshRate\n * @return {Function}\n */\n createRequestAnimationFrame: function(refreshRate) {\n var timeout = null;\n\n // Convert refreshRate to timeout\n if (refreshRate !== \"auto\" && refreshRate < 60 && refreshRate > 1) {\n timeout = Math.floor(1000 / refreshRate);\n }\n\n if (timeout === null) {\n return window.requestAnimationFrame || requestTimeout(33);\n } else {\n return requestTimeout(timeout);\n }\n }\n};\n\n/**\n * Create a callback that will execute after a given timeout\n *\n * @param {Function} timeout\n * @return {Function}\n */\nfunction requestTimeout(timeout) {\n return function(callback) {\n window.setTimeout(callback, timeout);\n };\n}\n","var Utils = require(\"./utilities\"),\n _browser = \"unknown\";\n\n// http://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser\nif (/*@cc_on!@*/ false || !!document.documentMode) {\n // internet explorer\n _browser = \"ie\";\n}\n\nmodule.exports = {\n svgNS: \"http://www.w3.org/2000/svg\",\n xmlNS: \"http://www.w3.org/XML/1998/namespace\",\n xmlnsNS: \"http://www.w3.org/2000/xmlns/\",\n xlinkNS: \"http://www.w3.org/1999/xlink\",\n evNS: \"http://www.w3.org/2001/xml-events\",\n\n /**\n * Get svg dimensions: width and height\n *\n * @param {SVGSVGElement} svg\n * @return {Object} {width: 0, height: 0}\n */\n getBoundingClientRectNormalized: function(svg) {\n if (svg.clientWidth && svg.clientHeight) {\n return { width: svg.clientWidth, height: svg.clientHeight };\n } else if (!!svg.getBoundingClientRect()) {\n return svg.getBoundingClientRect();\n } else {\n throw new Error(\"Cannot get BoundingClientRect for SVG.\");\n }\n },\n\n /**\n * Gets g element with class of \"viewport\" or creates it if it doesn't exist\n *\n * @param {SVGSVGElement} svg\n * @return {SVGElement} g (group) element\n */\n getOrCreateViewport: function(svg, selector) {\n var viewport = null;\n\n if (Utils.isElement(selector)) {\n viewport = selector;\n } else {\n viewport = svg.querySelector(selector);\n }\n\n // Check if there is just one main group in SVG\n if (!viewport) {\n var childNodes = Array.prototype.slice\n .call(svg.childNodes || svg.children)\n .filter(function(el) {\n return el.nodeName !== \"defs\" && el.nodeName !== \"#text\";\n });\n\n // Node name should be SVGGElement and should have no transform attribute\n // Groups with transform are not used as viewport because it involves parsing of all transform possibilities\n if (\n childNodes.length === 1 &&\n childNodes[0].nodeName === \"g\" &&\n childNodes[0].getAttribute(\"transform\") === null\n ) {\n viewport = childNodes[0];\n }\n }\n\n // If no favorable group element exists then create one\n if (!viewport) {\n var viewportId =\n \"viewport-\" + new Date().toISOString().replace(/\\D/g, \"\");\n viewport = document.createElementNS(this.svgNS, \"g\");\n viewport.setAttribute(\"id\", viewportId);\n\n // Internet Explorer (all versions?) can't use childNodes, but other browsers prefer (require?) using childNodes\n var svgChildren = svg.childNodes || svg.children;\n if (!!svgChildren && svgChildren.length > 0) {\n for (var i = svgChildren.length; i > 0; i--) {\n // Move everything into viewport except defs\n if (svgChildren[svgChildren.length - i].nodeName !== \"defs\") {\n viewport.appendChild(svgChildren[svgChildren.length - i]);\n }\n }\n }\n svg.appendChild(viewport);\n }\n\n // Parse class names\n var classNames = [];\n if (viewport.getAttribute(\"class\")) {\n classNames = viewport.getAttribute(\"class\").split(\" \");\n }\n\n // Set class (if not set already)\n if (!~classNames.indexOf(\"svg-pan-zoom_viewport\")) {\n classNames.push(\"svg-pan-zoom_viewport\");\n viewport.setAttribute(\"class\", classNames.join(\" \"));\n }\n\n return viewport;\n },\n\n /**\n * Set SVG attributes\n *\n * @param {SVGSVGElement} svg\n */\n setupSvgAttributes: function(svg) {\n // Setting default attributes\n svg.setAttribute(\"xmlns\", this.svgNS);\n svg.setAttributeNS(this.xmlnsNS, \"xmlns:xlink\", this.xlinkNS);\n svg.setAttributeNS(this.xmlnsNS, \"xmlns:ev\", this.evNS);\n\n // Needed for Internet Explorer, otherwise the viewport overflows\n if (svg.parentNode !== null) {\n var style = svg.getAttribute(\"style\") || \"\";\n if (style.toLowerCase().indexOf(\"overflow\") === -1) {\n svg.setAttribute(\"style\", \"overflow: hidden; \" + style);\n }\n }\n },\n\n /**\n * How long Internet Explorer takes to finish updating its display (ms).\n */\n internetExplorerRedisplayInterval: 300,\n\n /**\n * Forces the browser to redisplay all SVG elements that rely on an\n * element defined in a 'defs' section. It works globally, for every\n * available defs element on the page.\n * The throttling is intentionally global.\n *\n * This is only needed for IE. It is as a hack to make markers (and 'use' elements?)\n * visible after pan/zoom when there are multiple SVGs on the page.\n * See bug report: https://connect.microsoft.com/IE/feedback/details/781964/\n * also see svg-pan-zoom issue: https://github.com/ariutta/svg-pan-zoom/issues/62\n */\n refreshDefsGlobal: Utils.throttle(\n function() {\n var allDefs = document.querySelectorAll(\"defs\");\n var allDefsCount = allDefs.length;\n for (var i = 0; i < allDefsCount; i++) {\n var thisDefs = allDefs[i];\n thisDefs.parentNode.insertBefore(thisDefs, thisDefs);\n }\n },\n this ? this.internetExplorerRedisplayInterval : null\n ),\n\n /**\n * Sets the current transform matrix of an element\n *\n * @param {SVGElement} element\n * @param {SVGMatrix} matrix CTM\n * @param {SVGElement} defs\n */\n setCTM: function(element, matrix, defs) {\n var that = this,\n s =\n \"matrix(\" +\n matrix.a +\n \",\" +\n matrix.b +\n \",\" +\n matrix.c +\n \",\" +\n matrix.d +\n \",\" +\n matrix.e +\n \",\" +\n matrix.f +\n \")\";\n\n element.setAttributeNS(null, \"transform\", s);\n if (\"transform\" in element.style) {\n element.style.transform = s;\n } else if (\"-ms-transform\" in element.style) {\n element.style[\"-ms-transform\"] = s;\n } else if (\"-webkit-transform\" in element.style) {\n element.style[\"-webkit-transform\"] = s;\n }\n\n // IE has a bug that makes markers disappear on zoom (when the matrix \"a\" and/or \"d\" elements change)\n // see http://stackoverflow.com/questions/17654578/svg-marker-does-not-work-in-ie9-10\n // and http://srndolha.wordpress.com/2013/11/25/svg-line-markers-may-disappear-in-internet-explorer-11/\n if (_browser === \"ie\" && !!defs) {\n // this refresh is intended for redisplaying the SVG during zooming\n defs.parentNode.insertBefore(defs, defs);\n // this refresh is intended for redisplaying the other SVGs on a page when panning a given SVG\n // it is also needed for the given SVG itself, on zoomEnd, if the SVG contains any markers that\n // are located under any other element(s).\n window.setTimeout(function() {\n that.refreshDefsGlobal();\n }, that.internetExplorerRedisplayInterval);\n }\n },\n\n /**\n * Instantiate an SVGPoint object with given event coordinates\n *\n * @param {Event} evt\n * @param {SVGSVGElement} svg\n * @return {SVGPoint} point\n */\n getEventPoint: function(evt, svg) {\n var point = svg.createSVGPoint();\n\n Utils.mouseAndTouchNormalize(evt, svg);\n\n point.x = evt.clientX;\n point.y = evt.clientY;\n\n return point;\n },\n\n /**\n * Get SVG center point\n *\n * @param {SVGSVGElement} svg\n * @return {SVGPoint}\n */\n getSvgCenterPoint: function(svg, width, height) {\n return this.createSVGPoint(svg, width / 2, height / 2);\n },\n\n /**\n * Create a SVGPoint with given x and y\n *\n * @param {SVGSVGElement} svg\n * @param {Number} x\n * @param {Number} y\n * @return {SVGPoint}\n */\n createSVGPoint: function(svg, x, y) {\n var point = svg.createSVGPoint();\n point.x = x;\n point.y = y;\n\n return point;\n }\n};\n","var SvgUtils = require(\"./svg-utilities\");\n\nmodule.exports = {\n enable: function(instance) {\n // Select (and create if necessary) defs\n var defs = instance.svg.querySelector(\"defs\");\n if (!defs) {\n defs = document.createElementNS(SvgUtils.svgNS, \"defs\");\n instance.svg.appendChild(defs);\n }\n\n // Check for style element, and create it if it doesn't exist\n var styleEl = defs.querySelector(\"style#svg-pan-zoom-controls-styles\");\n if (!styleEl) {\n var style = document.createElementNS(SvgUtils.svgNS, \"style\");\n style.setAttribute(\"id\", \"svg-pan-zoom-controls-styles\");\n style.setAttribute(\"type\", \"text/css\");\n style.textContent =\n \".svg-pan-zoom-control { cursor: pointer; fill: black; fill-opacity: 0.333; } .svg-pan-zoom-control:hover { fill-opacity: 0.8; } .svg-pan-zoom-control-background { fill: white; fill-opacity: 0.5; } .svg-pan-zoom-control-background { fill-opacity: 0.8; }\";\n defs.appendChild(style);\n }\n\n // Zoom Group\n var zoomGroup = document.createElementNS(SvgUtils.svgNS, \"g\");\n zoomGroup.setAttribute(\"id\", \"svg-pan-zoom-controls\");\n zoomGroup.setAttribute(\n \"transform\",\n \"translate(\" +\n (instance.width - 70) +\n \" \" +\n (instance.height - 76) +\n \") scale(0.75)\"\n );\n zoomGroup.setAttribute(\"class\", \"svg-pan-zoom-control\");\n\n // Control elements\n zoomGroup.appendChild(this._createZoomIn(instance));\n zoomGroup.appendChild(this._createZoomReset(instance));\n zoomGroup.appendChild(this._createZoomOut(instance));\n\n // Finally append created element\n instance.svg.appendChild(zoomGroup);\n\n // Cache control instance\n instance.controlIcons = zoomGroup;\n },\n\n _createZoomIn: function(instance) {\n var zoomIn = document.createElementNS(SvgUtils.svgNS, \"g\");\n zoomIn.setAttribute(\"id\", \"svg-pan-zoom-zoom-in\");\n zoomIn.setAttribute(\"transform\", \"translate(30.5 5) scale(0.015)\");\n zoomIn.setAttribute(\"class\", \"svg-pan-zoom-control\");\n zoomIn.addEventListener(\n \"click\",\n function() {\n instance.getPublicInstance().zoomIn();\n },\n false\n );\n zoomIn.addEventListener(\n \"touchstart\",\n function() {\n instance.getPublicInstance().zoomIn();\n },\n false\n );\n\n var zoomInBackground = document.createElementNS(SvgUtils.svgNS, \"rect\"); // TODO change these background space fillers to rounded rectangles so they look prettier\n zoomInBackground.setAttribute(\"x\", \"0\");\n zoomInBackground.setAttribute(\"y\", \"0\");\n zoomInBackground.setAttribute(\"width\", \"1500\"); // larger than expected because the whole group is transformed to scale down\n zoomInBackground.setAttribute(\"height\", \"1400\");\n zoomInBackground.setAttribute(\"class\", \"svg-pan-zoom-control-background\");\n zoomIn.appendChild(zoomInBackground);\n\n var zoomInShape = document.createElementNS(SvgUtils.svgNS, \"path\");\n zoomInShape.setAttribute(\n \"d\",\n \"M1280 576v128q0 26 -19 45t-45 19h-320v320q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-320h-320q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h320v-320q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v320h320q26 0 45 19t19 45zM1536 1120v-960 q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z\"\n );\n zoomInShape.setAttribute(\"class\", \"svg-pan-zoom-control-element\");\n zoomIn.appendChild(zoomInShape);\n\n return zoomIn;\n },\n\n _createZoomReset: function(instance) {\n // reset\n var resetPanZoomControl = document.createElementNS(SvgUtils.svgNS, \"g\");\n resetPanZoomControl.setAttribute(\"id\", \"svg-pan-zoom-reset-pan-zoom\");\n resetPanZoomControl.setAttribute(\"transform\", \"translate(5 35) scale(0.4)\");\n resetPanZoomControl.setAttribute(\"class\", \"svg-pan-zoom-control\");\n resetPanZoomControl.addEventListener(\n \"click\",\n function() {\n instance.getPublicInstance().reset();\n },\n false\n );\n resetPanZoomControl.addEventListener(\n \"touchstart\",\n function() {\n instance.getPublicInstance().reset();\n },\n false\n );\n\n var resetPanZoomControlBackground = document.createElementNS(\n SvgUtils.svgNS,\n \"rect\"\n ); // TODO change these background space fillers to rounded rectangles so they look prettier\n resetPanZoomControlBackground.setAttribute(\"x\", \"2\");\n resetPanZoomControlBackground.setAttribute(\"y\", \"2\");\n resetPanZoomControlBackground.setAttribute(\"width\", \"182\"); // larger than expected because the whole group is transformed to scale down\n resetPanZoomControlBackground.setAttribute(\"height\", \"58\");\n resetPanZoomControlBackground.setAttribute(\n \"class\",\n \"svg-pan-zoom-control-background\"\n );\n resetPanZoomControl.appendChild(resetPanZoomControlBackground);\n\n var resetPanZoomControlShape1 = document.createElementNS(\n SvgUtils.svgNS,\n \"path\"\n );\n resetPanZoomControlShape1.setAttribute(\n \"d\",\n \"M33.051,20.632c-0.742-0.406-1.854-0.609-3.338-0.609h-7.969v9.281h7.769c1.543,0,2.701-0.188,3.473-0.562c1.365-0.656,2.048-1.953,2.048-3.891C35.032,22.757,34.372,21.351,33.051,20.632z\"\n );\n resetPanZoomControlShape1.setAttribute(\n \"class\",\n \"svg-pan-zoom-control-element\"\n );\n resetPanZoomControl.appendChild(resetPanZoomControlShape1);\n\n var resetPanZoomControlShape2 = document.createElementNS(\n SvgUtils.svgNS,\n \"path\"\n );\n resetPanZoomControlShape2.setAttribute(\n \"d\",\n \"M170.231,0.5H15.847C7.102,0.5,0.5,5.708,0.5,11.84v38.861C0.5,56.833,7.102,61.5,15.847,61.5h154.384c8.745,0,15.269-4.667,15.269-10.798V11.84C185.5,5.708,178.976,0.5,170.231,0.5z M42.837,48.569h-7.969c-0.219-0.766-0.375-1.383-0.469-1.852c-0.188-0.969-0.289-1.961-0.305-2.977l-0.047-3.211c-0.03-2.203-0.41-3.672-1.142-4.406c-0.732-0.734-2.103-1.102-4.113-1.102h-7.05v13.547h-7.055V14.022h16.524c2.361,0.047,4.178,0.344,5.45,0.891c1.272,0.547,2.351,1.352,3.234,2.414c0.731,0.875,1.31,1.844,1.737,2.906s0.64,2.273,0.64,3.633c0,1.641-0.414,3.254-1.242,4.84s-2.195,2.707-4.102,3.363c1.594,0.641,2.723,1.551,3.387,2.73s0.996,2.98,0.996,5.402v2.32c0,1.578,0.063,2.648,0.19,3.211c0.19,0.891,0.635,1.547,1.333,1.969V48.569z M75.579,48.569h-26.18V14.022h25.336v6.117H56.454v7.336h16.781v6H56.454v8.883h19.125V48.569z M104.497,46.331c-2.44,2.086-5.887,3.129-10.34,3.129c-4.548,0-8.125-1.027-10.731-3.082s-3.909-4.879-3.909-8.473h6.891c0.224,1.578,0.662,2.758,1.316,3.539c1.196,1.422,3.246,2.133,6.15,2.133c1.739,0,3.151-0.188,4.236-0.562c2.058-0.719,3.087-2.055,3.087-4.008c0-1.141-0.504-2.023-1.512-2.648c-1.008-0.609-2.607-1.148-4.796-1.617l-3.74-0.82c-3.676-0.812-6.201-1.695-7.576-2.648c-2.328-1.594-3.492-4.086-3.492-7.477c0-3.094,1.139-5.664,3.417-7.711s5.623-3.07,10.036-3.07c3.685,0,6.829,0.965,9.431,2.895c2.602,1.93,3.966,4.73,4.093,8.402h-6.938c-0.128-2.078-1.057-3.555-2.787-4.43c-1.154-0.578-2.587-0.867-4.301-0.867c-1.907,0-3.428,0.375-4.565,1.125c-1.138,0.75-1.706,1.797-1.706,3.141c0,1.234,0.561,2.156,1.682,2.766c0.721,0.406,2.25,0.883,4.589,1.43l6.063,1.43c2.657,0.625,4.648,1.461,5.975,2.508c2.059,1.625,3.089,3.977,3.089,7.055C108.157,41.624,106.937,44.245,104.497,46.331z M139.61,48.569h-26.18V14.022h25.336v6.117h-18.281v7.336h16.781v6h-16.781v8.883h19.125V48.569z M170.337,20.14h-10.336v28.43h-7.266V20.14h-10.383v-6.117h27.984V20.14z\"\n );\n resetPanZoomControlShape2.setAttribute(\n \"class\",\n \"svg-pan-zoom-control-element\"\n );\n resetPanZoomControl.appendChild(resetPanZoomControlShape2);\n\n return resetPanZoomControl;\n },\n\n _createZoomOut: function(instance) {\n // zoom out\n var zoomOut = document.createElementNS(SvgUtils.svgNS, \"g\");\n zoomOut.setAttribute(\"id\", \"svg-pan-zoom-zoom-out\");\n zoomOut.setAttribute(\"transform\", \"translate(30.5 70) scale(0.015)\");\n zoomOut.setAttribute(\"class\", \"svg-pan-zoom-control\");\n zoomOut.addEventListener(\n \"click\",\n function() {\n instance.getPublicInstance().zoomOut();\n },\n false\n );\n zoomOut.addEventListener(\n \"touchstart\",\n function() {\n instance.getPublicInstance().zoomOut();\n },\n false\n );\n\n var zoomOutBackground = document.createElementNS(SvgUtils.svgNS, \"rect\"); // TODO change these background space fillers to rounded rectangles so they look prettier\n zoomOutBackground.setAttribute(\"x\", \"0\");\n zoomOutBackground.setAttribute(\"y\", \"0\");\n zoomOutBackground.setAttribute(\"width\", \"1500\"); // larger than expected because the whole group is transformed to scale down\n zoomOutBackground.setAttribute(\"height\", \"1400\");\n zoomOutBackground.setAttribute(\"class\", \"svg-pan-zoom-control-background\");\n zoomOut.appendChild(zoomOutBackground);\n\n var zoomOutShape = document.createElementNS(SvgUtils.svgNS, \"path\");\n zoomOutShape.setAttribute(\n \"d\",\n \"M1280 576v128q0 26 -19 45t-45 19h-896q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h896q26 0 45 19t19 45zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5 t84.5 -203.5z\"\n );\n zoomOutShape.setAttribute(\"class\", \"svg-pan-zoom-control-element\");\n zoomOut.appendChild(zoomOutShape);\n\n return zoomOut;\n },\n\n disable: function(instance) {\n if (instance.controlIcons) {\n instance.controlIcons.parentNode.removeChild(instance.controlIcons);\n instance.controlIcons = null;\n }\n }\n};\n","var SvgUtils = require(\"./svg-utilities\"),\n Utils = require(\"./utilities\");\n\nvar ShadowViewport = function(viewport, options) {\n this.init(viewport, options);\n};\n\n/**\n * Initialization\n *\n * @param {SVGElement} viewport\n * @param {Object} options\n */\nShadowViewport.prototype.init = function(viewport, options) {\n // DOM Elements\n this.viewport = viewport;\n this.options = options;\n\n // State cache\n this.originalState = { zoom: 1, x: 0, y: 0 };\n this.activeState = { zoom: 1, x: 0, y: 0 };\n\n this.updateCTMCached = Utils.proxy(this.updateCTM, this);\n\n // Create a custom requestAnimationFrame taking in account refreshRate\n this.requestAnimationFrame = Utils.createRequestAnimationFrame(\n this.options.refreshRate\n );\n\n // ViewBox\n this.viewBox = { x: 0, y: 0, width: 0, height: 0 };\n this.cacheViewBox();\n\n // Process CTM\n var newCTM = this.processCTM();\n\n // Update viewport CTM and cache zoom and pan\n this.setCTM(newCTM);\n\n // Update CTM in this frame\n this.updateCTM();\n};\n\n/**\n * Cache initial viewBox value\n * If no viewBox is defined, then use viewport size/position instead for viewBox values\n */\nShadowViewport.prototype.cacheViewBox = function() {\n var svgViewBox = this.options.svg.getAttribute(\"viewBox\");\n\n if (svgViewBox) {\n var viewBoxValues = svgViewBox\n .split(/[\\s\\,]/)\n .filter(function(v) {\n return v;\n })\n .map(parseFloat);\n\n // Cache viewbox x and y offset\n this.viewBox.x = viewBoxValues[0];\n this.viewBox.y = viewBoxValues[1];\n this.viewBox.width = viewBoxValues[2];\n this.viewBox.height = viewBoxValues[3];\n\n var zoom = Math.min(\n this.options.width / this.viewBox.width,\n this.options.height / this.viewBox.height\n );\n\n // Update active state\n this.activeState.zoom = zoom;\n this.activeState.x = (this.options.width - this.viewBox.width * zoom) / 2;\n this.activeState.y = (this.options.height - this.viewBox.height * zoom) / 2;\n\n // Force updating CTM\n this.updateCTMOnNextFrame();\n\n this.options.svg.removeAttribute(\"viewBox\");\n } else {\n this.simpleViewBoxCache();\n }\n};\n\n/**\n * Recalculate viewport sizes and update viewBox cache\n */\nShadowViewport.prototype.simpleViewBoxCache = function() {\n var bBox = this.viewport.getBBox();\n\n this.viewBox.x = bBox.x;\n this.viewBox.y = bBox.y;\n this.viewBox.width = bBox.width;\n this.viewBox.height = bBox.height;\n};\n\n/**\n * Returns a viewbox object. Safe to alter\n *\n * @return {Object} viewbox object\n */\nShadowViewport.prototype.getViewBox = function() {\n return Utils.extend({}, this.viewBox);\n};\n\n/**\n * Get initial zoom and pan values. Save them into originalState\n * Parses viewBox attribute to alter initial sizes\n *\n * @return {CTM} CTM object based on options\n */\nShadowViewport.prototype.processCTM = function() {\n var newCTM = this.getCTM();\n\n if (this.options.fit || this.options.contain) {\n var newScale;\n if (this.options.fit) {\n newScale = Math.min(\n this.options.width / this.viewBox.width,\n this.options.height / this.viewBox.height\n );\n } else {\n newScale = Math.max(\n this.options.width / this.viewBox.width,\n this.options.height / this.viewBox.height\n );\n }\n\n newCTM.a = newScale; //x-scale\n newCTM.d = newScale; //y-scale\n newCTM.e = -this.viewBox.x * newScale; //x-transform\n newCTM.f = -this.viewBox.y * newScale; //y-transform\n }\n\n if (this.options.center) {\n var offsetX =\n (this.options.width -\n (this.viewBox.width + this.viewBox.x * 2) * newCTM.a) *\n 0.5,\n offsetY =\n (this.options.height -\n (this.viewBox.height + this.viewBox.y * 2) * newCTM.a) *\n 0.5;\n\n newCTM.e = offsetX;\n newCTM.f = offsetY;\n }\n\n // Cache initial values. Based on activeState and fix+center opitons\n this.originalState.zoom = newCTM.a;\n this.originalState.x = newCTM.e;\n this.originalState.y = newCTM.f;\n\n return newCTM;\n};\n\n/**\n * Return originalState object. Safe to alter\n *\n * @return {Object}\n */\nShadowViewport.prototype.getOriginalState = function() {\n return Utils.extend({}, this.originalState);\n};\n\n/**\n * Return actualState object. Safe to alter\n *\n * @return {Object}\n */\nShadowViewport.prototype.getState = function() {\n return Utils.extend({}, this.activeState);\n};\n\n/**\n * Get zoom scale\n *\n * @return {Float} zoom scale\n */\nShadowViewport.prototype.getZoom = function() {\n return this.activeState.zoom;\n};\n\n/**\n * Get zoom scale for pubilc usage\n *\n * @return {Float} zoom scale\n */\nShadowViewport.prototype.getRelativeZoom = function() {\n return this.activeState.zoom / this.originalState.zoom;\n};\n\n/**\n * Compute zoom scale for pubilc usage\n *\n * @return {Float} zoom scale\n */\nShadowViewport.prototype.computeRelativeZoom = function(scale) {\n return scale / this.originalState.zoom;\n};\n\n/**\n * Get pan\n *\n * @return {Object}\n */\nShadowViewport.prototype.getPan = function() {\n return { x: this.activeState.x, y: this.activeState.y };\n};\n\n/**\n * Return cached viewport CTM value that can be safely modified\n *\n * @return {SVGMatrix}\n */\nShadowViewport.prototype.getCTM = function() {\n var safeCTM = this.options.svg.createSVGMatrix();\n\n // Copy values manually as in FF they are not itterable\n safeCTM.a = this.activeState.zoom;\n safeCTM.b = 0;\n safeCTM.c = 0;\n safeCTM.d = this.activeState.zoom;\n safeCTM.e = this.activeState.x;\n safeCTM.f = this.activeState.y;\n\n return safeCTM;\n};\n\n/**\n * Set a new CTM\n *\n * @param {SVGMatrix} newCTM\n */\nShadowViewport.prototype.setCTM = function(newCTM) {\n var willZoom = this.isZoomDifferent(newCTM),\n willPan = this.isPanDifferent(newCTM);\n\n if (willZoom || willPan) {\n // Before zoom\n if (willZoom) {\n // If returns false then cancel zooming\n if (\n this.options.beforeZoom(\n this.getRelativeZoom(),\n this.computeRelativeZoom(newCTM.a)\n ) === false\n ) {\n newCTM.a = newCTM.d = this.activeState.zoom;\n willZoom = false;\n } else {\n this.updateCache(newCTM);\n this.options.onZoom(this.getRelativeZoom());\n }\n }\n\n // Before pan\n if (willPan) {\n var preventPan = this.options.beforePan(this.getPan(), {\n x: newCTM.e,\n y: newCTM.f\n }),\n // If prevent pan is an object\n preventPanX = false,\n preventPanY = false;\n\n // If prevent pan is Boolean false\n if (preventPan === false) {\n // Set x and y same as before\n newCTM.e = this.getPan().x;\n newCTM.f = this.getPan().y;\n\n preventPanX = preventPanY = true;\n } else if (Utils.isObject(preventPan)) {\n // Check for X axes attribute\n if (preventPan.x === false) {\n // Prevent panning on x axes\n newCTM.e = this.getPan().x;\n preventPanX = true;\n } else if (Utils.isNumber(preventPan.x)) {\n // Set a custom pan value\n newCTM.e = preventPan.x;\n }\n\n // Check for Y axes attribute\n if (preventPan.y === false) {\n // Prevent panning on x axes\n newCTM.f = this.getPan().y;\n preventPanY = true;\n } else if (Utils.isNumber(preventPan.y)) {\n // Set a custom pan value\n newCTM.f = preventPan.y;\n }\n }\n\n // Update willPan flag\n // Check if newCTM is still different\n if ((preventPanX && preventPanY) || !this.isPanDifferent(newCTM)) {\n willPan = false;\n } else {\n this.updateCache(newCTM);\n this.options.onPan(this.getPan());\n }\n }\n\n // Check again if should zoom or pan\n if (willZoom || willPan) {\n this.updateCTMOnNextFrame();\n }\n }\n};\n\nShadowViewport.prototype.isZoomDifferent = function(newCTM) {\n return this.activeState.zoom !== newCTM.a;\n};\n\nShadowViewport.prototype.isPanDifferent = function(newCTM) {\n return this.activeState.x !== newCTM.e || this.activeState.y !== newCTM.f;\n};\n\n/**\n * Update cached CTM and active state\n *\n * @param {SVGMatrix} newCTM\n */\nShadowViewport.prototype.updateCache = function(newCTM) {\n this.activeState.zoom = newCTM.a;\n this.activeState.x = newCTM.e;\n this.activeState.y = newCTM.f;\n};\n\nShadowViewport.prototype.pendingUpdate = false;\n\n/**\n * Place a request to update CTM on next Frame\n */\nShadowViewport.prototype.updateCTMOnNextFrame = function() {\n if (!this.pendingUpdate) {\n // Lock\n this.pendingUpdate = true;\n\n // Throttle next update\n this.requestAnimationFrame.call(window, this.updateCTMCached);\n }\n};\n\n/**\n * Update viewport CTM with cached CTM\n */\nShadowViewport.prototype.updateCTM = function() {\n var ctm = this.getCTM();\n\n // Updates SVG element\n SvgUtils.setCTM(this.viewport, ctm, this.defs);\n\n // Free the lock\n this.pendingUpdate = false;\n\n // Notify about the update\n if (this.options.onUpdatedCTM) {\n this.options.onUpdatedCTM(ctm);\n }\n};\n\nmodule.exports = function(viewport, options) {\n return new ShadowViewport(viewport, options);\n};\n","var Wheel = require(\"./uniwheel\"),\n ControlIcons = require(\"./control-icons\"),\n Utils = require(\"./utilities\"),\n SvgUtils = require(\"./svg-utilities\"),\n ShadowViewport = require(\"./shadow-viewport\");\n\nvar SvgPanZoom = function(svg, options) {\n this.init(svg, options);\n};\n\nvar optionsDefaults = {\n viewportSelector: \".svg-pan-zoom_viewport\", // Viewport selector. Can be querySelector string or SVGElement\n panEnabled: true, // enable or disable panning (default enabled)\n controlIconsEnabled: false, // insert icons to give user an option in addition to mouse events to control pan/zoom (default disabled)\n zoomEnabled: true, // enable or disable zooming (default enabled)\n dblClickZoomEnabled: true, // enable or disable zooming by double clicking (default enabled)\n mouseWheelZoomEnabled: true, // enable or disable zooming by mouse wheel (default enabled)\n preventMouseEventsDefault: true, // enable or disable preventDefault for mouse events\n zoomScaleSensitivity: 0.1, // Zoom sensitivity\n minZoom: 0.5, // Minimum Zoom level\n maxZoom: 10, // Maximum Zoom level\n fit: true, // enable or disable viewport fit in SVG (default true)\n contain: false, // enable or disable viewport contain the svg (default false)\n center: true, // enable or disable viewport centering in SVG (default true)\n refreshRate: \"auto\", // Maximum number of frames per second (altering SVG's viewport)\n beforeZoom: null,\n onZoom: null,\n beforePan: null,\n onPan: null,\n customEventsHandler: null,\n eventsListenerElement: null,\n onUpdatedCTM: null\n};\n\nvar passiveListenerOption = { passive: true };\n\nSvgPanZoom.prototype.init = function(svg, options) {\n var that = this;\n\n this.svg = svg;\n this.defs = svg.querySelector(\"defs\");\n\n // Add default attributes to SVG\n SvgUtils.setupSvgAttributes(this.svg);\n\n // Set options\n this.options = Utils.extend(Utils.extend({}, optionsDefaults), options);\n\n // Set default state\n this.state = \"none\";\n\n // Get dimensions\n var boundingClientRectNormalized = SvgUtils.getBoundingClientRectNormalized(\n svg\n );\n this.width = boundingClientRectNormalized.width;\n this.height = boundingClientRectNormalized.height;\n\n // Init shadow viewport\n this.viewport = ShadowViewport(\n SvgUtils.getOrCreateViewport(this.svg, this.options.viewportSelector),\n {\n svg: this.svg,\n width: this.width,\n height: this.height,\n fit: this.options.fit,\n contain: this.options.contain,\n center: this.options.center,\n refreshRate: this.options.refreshRate,\n // Put callbacks into functions as they can change through time\n beforeZoom: function(oldScale, newScale) {\n if (that.viewport && that.options.beforeZoom) {\n return that.options.beforeZoom(oldScale, newScale);\n }\n },\n onZoom: function(scale) {\n if (that.viewport && that.options.onZoom) {\n return that.options.onZoom(scale);\n }\n },\n beforePan: function(oldPoint, newPoint) {\n if (that.viewport && that.options.beforePan) {\n return that.options.beforePan(oldPoint, newPoint);\n }\n },\n onPan: function(point) {\n if (that.viewport && that.options.onPan) {\n return that.options.onPan(point);\n }\n },\n onUpdatedCTM: function(ctm) {\n if (that.viewport && that.options.onUpdatedCTM) {\n return that.options.onUpdatedCTM(ctm);\n }\n }\n }\n );\n\n // Wrap callbacks into public API context\n var publicInstance = this.getPublicInstance();\n publicInstance.setBeforeZoom(this.options.beforeZoom);\n publicInstance.setOnZoom(this.options.onZoom);\n publicInstance.setBeforePan(this.options.beforePan);\n publicInstance.setOnPan(this.options.onPan);\n publicInstance.setOnUpdatedCTM(this.options.onUpdatedCTM);\n\n if (this.options.controlIconsEnabled) {\n ControlIcons.enable(this);\n }\n\n // Init events handlers\n this.lastMouseWheelEventTime = Date.now();\n this.setupHandlers();\n};\n\n/**\n * Register event handlers\n */\nSvgPanZoom.prototype.setupHandlers = function() {\n var that = this,\n prevEvt = null; // use for touchstart event to detect double tap\n\n this.eventListeners = {\n // Mouse down group\n mousedown: function(evt) {\n var result = that.handleMouseDown(evt, prevEvt);\n prevEvt = evt;\n return result;\n },\n touchstart: function(evt) {\n var result = that.handleMouseDown(evt, prevEvt);\n prevEvt = evt;\n return result;\n },\n\n // Mouse up group\n mouseup: function(evt) {\n return that.handleMouseUp(evt);\n },\n touchend: function(evt) {\n return that.handleMouseUp(evt);\n },\n\n // Mouse move group\n mousemove: function(evt) {\n return that.handleMouseMove(evt);\n },\n touchmove: function(evt) {\n return that.handleMouseMove(evt);\n },\n\n // Mouse leave group\n mouseleave: function(evt) {\n return that.handleMouseUp(evt);\n },\n touchleave: function(evt) {\n return that.handleMouseUp(evt);\n },\n touchcancel: function(evt) {\n return that.handleMouseUp(evt);\n }\n };\n\n // Init custom events handler if available\n // eslint-disable-next-line eqeqeq\n if (this.options.customEventsHandler != null) {\n this.options.customEventsHandler.init({\n svgElement: this.svg,\n eventsListenerElement: this.options.eventsListenerElement,\n instance: this.getPublicInstance()\n });\n\n // Custom event handler may halt builtin listeners\n var haltEventListeners = this.options.customEventsHandler\n .haltEventListeners;\n if (haltEventListeners && haltEventListeners.length) {\n for (var i = haltEventListeners.length - 1; i >= 0; i--) {\n if (this.eventListeners.hasOwnProperty(haltEventListeners[i])) {\n delete this.eventListeners[haltEventListeners[i]];\n }\n }\n }\n }\n\n // Bind eventListeners\n for (var event in this.eventListeners) {\n // Attach event to eventsListenerElement or SVG if not available\n (this.options.eventsListenerElement || this.svg).addEventListener(\n event,\n this.eventListeners[event],\n !this.options.preventMouseEventsDefault ? passiveListenerOption : false\n );\n }\n\n // Zoom using mouse wheel\n if (this.options.mouseWheelZoomEnabled) {\n this.options.mouseWheelZoomEnabled = false; // set to false as enable will set it back to true\n this.enableMouseWheelZoom();\n }\n};\n\n/**\n * Enable ability to zoom using mouse wheel\n */\nSvgPanZoom.prototype.enableMouseWheelZoom = function() {\n if (!this.options.mouseWheelZoomEnabled) {\n var that = this;\n\n // Mouse wheel listener\n this.wheelListener = function(evt) {\n return that.handleMouseWheel(evt);\n };\n\n // Bind wheelListener\n var isPassiveListener = !this.options.preventMouseEventsDefault;\n Wheel.on(\n this.options.eventsListenerElement || this.svg,\n this.wheelListener,\n isPassiveListener\n );\n\n this.options.mouseWheelZoomEnabled = true;\n }\n};\n\n/**\n * Disable ability to zoom using mouse wheel\n */\nSvgPanZoom.prototype.disableMouseWheelZoom = function() {\n if (this.options.mouseWheelZoomEnabled) {\n var isPassiveListener = !this.options.preventMouseEventsDefault;\n Wheel.off(\n this.options.eventsListenerElement || this.svg,\n this.wheelListener,\n isPassiveListener\n );\n this.options.mouseWheelZoomEnabled = false;\n }\n};\n\n/**\n * Handle mouse wheel event\n *\n * @param {Event} evt\n */\nSvgPanZoom.prototype.handleMouseWheel = function(evt) {\n if (!this.options.zoomEnabled || this.state !== \"none\") {\n return;\n }\n\n if (this.options.preventMouseEventsDefault) {\n if (evt.preventDefault) {\n evt.preventDefault();\n } else {\n evt.returnValue = false;\n }\n }\n\n // Default delta in case that deltaY is not available\n var delta = evt.deltaY || 1,\n timeDelta = Date.now() - this.lastMouseWheelEventTime,\n divider = 3 + Math.max(0, 30 - timeDelta);\n\n // Update cache\n this.lastMouseWheelEventTime = Date.now();\n\n // Make empirical adjustments for browsers that give deltaY in pixels (deltaMode=0)\n if (\"deltaMode\" in evt && evt.deltaMode === 0 && evt.wheelDelta) {\n delta = evt.deltaY === 0 ? 0 : Math.abs(evt.wheelDelta) / evt.deltaY;\n }\n\n delta =\n -0.3 < delta && delta < 0.3\n ? delta\n : ((delta > 0 ? 1 : -1) * Math.log(Math.abs(delta) + 10)) / divider;\n\n var inversedScreenCTM = this.svg.getScreenCTM().inverse(),\n relativeMousePoint = SvgUtils.getEventPoint(evt, this.svg).matrixTransform(\n inversedScreenCTM\n ),\n zoom = Math.pow(1 + this.options.zoomScaleSensitivity, -1 * delta); // multiplying by neg. 1 so as to make zoom in/out behavior match Google maps behavior\n\n this.zoomAtPoint(zoom, relativeMousePoint);\n};\n\n/**\n * Zoom in at a SVG point\n *\n * @param {SVGPoint} point\n * @param {Float} zoomScale Number representing how much to zoom\n * @param {Boolean} zoomAbsolute Default false. If true, zoomScale is treated as an absolute value.\n * Otherwise, zoomScale is treated as a multiplied (e.g. 1.10 would zoom in 10%)\n */\nSvgPanZoom.prototype.zoomAtPoint = function(zoomScale, point, zoomAbsolute) {\n var originalState = this.viewport.getOriginalState();\n\n if (!zoomAbsolute) {\n // Fit zoomScale in set bounds\n if (\n this.getZoom() * zoomScale <\n this.options.minZoom * originalState.zoom\n ) {\n zoomScale = (this.options.minZoom * originalState.zoom) / this.getZoom();\n } else if (\n this.getZoom() * zoomScale >\n this.options.maxZoom * originalState.zoom\n ) {\n zoomScale = (this.options.maxZoom * originalState.zoom) / this.getZoom();\n }\n } else {\n // Fit zoomScale in set bounds\n zoomScale = Math.max(\n this.options.minZoom * originalState.zoom,\n Math.min(this.options.maxZoom * originalState.zoom, zoomScale)\n );\n // Find relative scale to achieve desired scale\n zoomScale = zoomScale / this.getZoom();\n }\n\n var oldCTM = this.viewport.getCTM(),\n relativePoint = point.matrixTransform(oldCTM.inverse()),\n modifier = this.svg\n .createSVGMatrix()\n .translate(relativePoint.x, relativePoint.y)\n .scale(zoomScale)\n .translate(-relativePoint.x, -relativePoint.y),\n newCTM = oldCTM.multiply(modifier);\n\n if (newCTM.a !== oldCTM.a) {\n this.viewport.setCTM(newCTM);\n }\n};\n\n/**\n * Zoom at center point\n *\n * @param {Float} scale\n * @param {Boolean} absolute Marks zoom scale as relative or absolute\n */\nSvgPanZoom.prototype.zoom = function(scale, absolute) {\n this.zoomAtPoint(\n scale,\n SvgUtils.getSvgCenterPoint(this.svg, this.width, this.height),\n absolute\n );\n};\n\n/**\n * Zoom used by public instance\n *\n * @param {Float} scale\n * @param {Boolean} absolute Marks zoom scale as relative or absolute\n */\nSvgPanZoom.prototype.publicZoom = function(scale, absolute) {\n if (absolute) {\n scale = this.computeFromRelativeZoom(scale);\n }\n\n this.zoom(scale, absolute);\n};\n\n/**\n * Zoom at point used by public instance\n *\n * @param {Float} scale\n * @param {SVGPoint|Object} point An object that has x and y attributes\n * @param {Boolean} absolute Marks zoom scale as relative or absolute\n */\nSvgPanZoom.prototype.publicZoomAtPoint = function(scale, point, absolute) {\n if (absolute) {\n // Transform zoom into a relative value\n scale = this.computeFromRelativeZoom(scale);\n }\n\n // If not a SVGPoint but has x and y then create a SVGPoint\n if (Utils.getType(point) !== \"SVGPoint\") {\n if (\"x\" in point && \"y\" in point) {\n point = SvgUtils.createSVGPoint(this.svg, point.x, point.y);\n } else {\n throw new Error(\"Given point is invalid\");\n }\n }\n\n this.zoomAtPoint(scale, point, absolute);\n};\n\n/**\n * Get zoom scale\n *\n * @return {Float} zoom scale\n */\nSvgPanZoom.prototype.getZoom = function() {\n return this.viewport.getZoom();\n};\n\n/**\n * Get zoom scale for public usage\n *\n * @return {Float} zoom scale\n */\nSvgPanZoom.prototype.getRelativeZoom = function() {\n return this.viewport.getRelativeZoom();\n};\n\n/**\n * Compute actual zoom from public zoom\n *\n * @param {Float} zoom\n * @return {Float} zoom scale\n */\nSvgPanZoom.prototype.computeFromRelativeZoom = function(zoom) {\n return zoom * this.viewport.getOriginalState().zoom;\n};\n\n/**\n * Set zoom to initial state\n */\nSvgPanZoom.prototype.resetZoom = function() {\n var originalState = this.viewport.getOriginalState();\n\n this.zoom(originalState.zoom, true);\n};\n\n/**\n * Set pan to initial state\n */\nSvgPanZoom.prototype.resetPan = function() {\n this.pan(this.viewport.getOriginalState());\n};\n\n/**\n * Set pan and zoom to initial state\n */\nSvgPanZoom.prototype.reset = function() {\n this.resetZoom();\n this.resetPan();\n};\n\n/**\n * Handle double click event\n * See handleMouseDown() for alternate detection method\n *\n * @param {Event} evt\n */\nSvgPanZoom.prototype.handleDblClick = function(evt) {\n if (this.options.preventMouseEventsDefault) {\n if (evt.preventDefault) {\n evt.preventDefault();\n } else {\n evt.returnValue = false;\n }\n }\n\n // Check if target was a control button\n if (this.options.controlIconsEnabled) {\n var targetClass = evt.target.getAttribute(\"class\") || \"\";\n if (targetClass.indexOf(\"svg-pan-zoom-control\") > -1) {\n return false;\n }\n }\n\n var zoomFactor;\n\n if (evt.shiftKey) {\n zoomFactor = 1 / ((1 + this.options.zoomScaleSensitivity) * 2); // zoom out when shift key pressed\n } else {\n zoomFactor = (1 + this.options.zoomScaleSensitivity) * 2;\n }\n\n var point = SvgUtils.getEventPoint(evt, this.svg).matrixTransform(\n this.svg.getScreenCTM().inverse()\n );\n this.zoomAtPoint(zoomFactor, point);\n};\n\n/**\n * Handle click event\n *\n * @param {Event} evt\n */\nSvgPanZoom.prototype.handleMouseDown = function(evt, prevEvt) {\n if (this.options.preventMouseEventsDefault) {\n if (evt.preventDefault) {\n evt.preventDefault();\n } else {\n evt.returnValue = false;\n }\n }\n\n Utils.mouseAndTouchNormalize(evt, this.svg);\n\n // Double click detection; more consistent than ondblclick\n if (this.options.dblClickZoomEnabled && Utils.isDblClick(evt, prevEvt)) {\n this.handleDblClick(evt);\n } else {\n // Pan mode\n this.state = \"pan\";\n this.firstEventCTM = this.viewport.getCTM();\n this.stateOrigin = SvgUtils.getEventPoint(evt, this.svg).matrixTransform(\n this.firstEventCTM.inverse()\n );\n }\n};\n\n/**\n * Handle mouse move event\n *\n * @param {Event} evt\n */\nSvgPanZoom.prototype.handleMouseMove = function(evt) {\n if (this.options.preventMouseEventsDefault) {\n if (evt.preventDefault) {\n evt.preventDefault();\n } else {\n evt.returnValue = false;\n }\n }\n\n if (this.state === \"pan\" && this.options.panEnabled) {\n // Pan mode\n var point = SvgUtils.getEventPoint(evt, this.svg).matrixTransform(\n this.firstEventCTM.inverse()\n ),\n viewportCTM = this.firstEventCTM.translate(\n point.x - this.stateOrigin.x,\n point.y - this.stateOrigin.y\n );\n\n this.viewport.setCTM(viewportCTM);\n }\n};\n\n/**\n * Handle mouse button release event\n *\n * @param {Event} evt\n */\nSvgPanZoom.prototype.handleMouseUp = function(evt) {\n if (this.options.preventMouseEventsDefault) {\n if (evt.preventDefault) {\n evt.preventDefault();\n } else {\n evt.returnValue = false;\n }\n }\n\n if (this.state === \"pan\") {\n // Quit pan mode\n this.state = \"none\";\n }\n};\n\n/**\n * Adjust viewport size (only) so it will fit in SVG\n * Does not center image\n */\nSvgPanZoom.prototype.fit = function() {\n var viewBox = this.viewport.getViewBox(),\n newScale = Math.min(\n this.width / viewBox.width,\n this.height / viewBox.height\n );\n\n this.zoom(newScale, true);\n};\n\n/**\n * Adjust viewport size (only) so it will contain the SVG\n * Does not center image\n */\nSvgPanZoom.prototype.contain = function() {\n var viewBox = this.viewport.getViewBox(),\n newScale = Math.max(\n this.width / viewBox.width,\n this.height / viewBox.height\n );\n\n this.zoom(newScale, true);\n};\n\n/**\n * Adjust viewport pan (only) so it will be centered in SVG\n * Does not zoom/fit/contain image\n */\nSvgPanZoom.prototype.center = function() {\n var viewBox = this.viewport.getViewBox(),\n offsetX =\n (this.width - (viewBox.width + viewBox.x * 2) * this.getZoom()) * 0.5,\n offsetY =\n (this.height - (viewBox.height + viewBox.y * 2) * this.getZoom()) * 0.5;\n\n this.getPublicInstance().pan({ x: offsetX, y: offsetY });\n};\n\n/**\n * Update content cached BorderBox\n * Use when viewport contents change\n */\nSvgPanZoom.prototype.updateBBox = function() {\n this.viewport.simpleViewBoxCache();\n};\n\n/**\n * Pan to a rendered position\n *\n * @param {Object} point {x: 0, y: 0}\n */\nSvgPanZoom.prototype.pan = function(point) {\n var viewportCTM = this.viewport.getCTM();\n viewportCTM.e = point.x;\n viewportCTM.f = point.y;\n this.viewport.setCTM(viewportCTM);\n};\n\n/**\n * Relatively pan the graph by a specified rendered position vector\n *\n * @param {Object} point {x: 0, y: 0}\n */\nSvgPanZoom.prototype.panBy = function(point) {\n var viewportCTM = this.viewport.getCTM();\n viewportCTM.e += point.x;\n viewportCTM.f += point.y;\n this.viewport.setCTM(viewportCTM);\n};\n\n/**\n * Get pan vector\n *\n * @return {Object} {x: 0, y: 0}\n */\nSvgPanZoom.prototype.getPan = function() {\n var state = this.viewport.getState();\n\n return { x: state.x, y: state.y };\n};\n\n/**\n * Recalculates cached svg dimensions and controls position\n */\nSvgPanZoom.prototype.resize = function() {\n // Get dimensions\n var boundingClientRectNormalized = SvgUtils.getBoundingClientRectNormalized(\n this.svg\n );\n this.width = boundingClientRectNormalized.width;\n this.height = boundingClientRectNormalized.height;\n\n // Recalculate original state\n var viewport = this.viewport;\n viewport.options.width = this.width;\n viewport.options.height = this.height;\n viewport.processCTM();\n\n // Reposition control icons by re-enabling them\n if (this.options.controlIconsEnabled) {\n this.getPublicInstance().disableControlIcons();\n this.getPublicInstance().enableControlIcons();\n }\n};\n\n/**\n * Unbind mouse events, free callbacks and destroy public instance\n */\nSvgPanZoom.prototype.destroy = function() {\n var that = this;\n\n // Free callbacks\n this.beforeZoom = null;\n this.onZoom = null;\n this.beforePan = null;\n this.onPan = null;\n this.onUpdatedCTM = null;\n\n // Destroy custom event handlers\n // eslint-disable-next-line eqeqeq\n if (this.options.customEventsHandler != null) {\n this.options.customEventsHandler.destroy({\n svgElement: this.svg,\n eventsListenerElement: this.options.eventsListenerElement,\n instance: this.getPublicInstance()\n });\n }\n\n // Unbind eventListeners\n for (var event in this.eventListeners) {\n (this.options.eventsListenerElement || this.svg).removeEventListener(\n event,\n this.eventListeners[event],\n !this.options.preventMouseEventsDefault ? passiveListenerOption : false\n );\n }\n\n // Unbind wheelListener\n this.disableMouseWheelZoom();\n\n // Remove control icons\n this.getPublicInstance().disableControlIcons();\n\n // Reset zoom and pan\n this.reset();\n\n // Remove instance from instancesStore\n instancesStore = instancesStore.filter(function(instance) {\n return instance.svg !== that.svg;\n });\n\n // Delete options and its contents\n delete this.options;\n\n // Delete viewport to make public shadow viewport functions uncallable\n delete this.viewport;\n\n // Destroy public instance and rewrite getPublicInstance\n delete this.publicInstance;\n delete this.pi;\n this.getPublicInstance = function() {\n return null;\n };\n};\n\n/**\n * Returns a public instance object\n *\n * @return {Object} Public instance object\n */\nSvgPanZoom.prototype.getPublicInstance = function() {\n var that = this;\n\n // Create cache\n if (!this.publicInstance) {\n this.publicInstance = this.pi = {\n // Pan\n enablePan: function() {\n that.options.panEnabled = true;\n return that.pi;\n },\n disablePan: function() {\n that.options.panEnabled = false;\n return that.pi;\n },\n isPanEnabled: function() {\n return !!that.options.panEnabled;\n },\n pan: function(point) {\n that.pan(point);\n return that.pi;\n },\n panBy: function(point) {\n that.panBy(point);\n return that.pi;\n },\n getPan: function() {\n return that.getPan();\n },\n // Pan event\n setBeforePan: function(fn) {\n that.options.beforePan =\n fn === null ? null : Utils.proxy(fn, that.publicInstance);\n return that.pi;\n },\n setOnPan: function(fn) {\n that.options.onPan =\n fn === null ? null : Utils.proxy(fn, that.publicInstance);\n return that.pi;\n },\n // Zoom and Control Icons\n enableZoom: function() {\n that.options.zoomEnabled = true;\n return that.pi;\n },\n disableZoom: function() {\n that.options.zoomEnabled = false;\n return that.pi;\n },\n isZoomEnabled: function() {\n return !!that.options.zoomEnabled;\n },\n enableControlIcons: function() {\n if (!that.options.controlIconsEnabled) {\n that.options.controlIconsEnabled = true;\n ControlIcons.enable(that);\n }\n return that.pi;\n },\n disableControlIcons: function() {\n if (that.options.controlIconsEnabled) {\n that.options.controlIconsEnabled = false;\n ControlIcons.disable(that);\n }\n return that.pi;\n },\n isControlIconsEnabled: function() {\n return !!that.options.controlIconsEnabled;\n },\n // Double click zoom\n enableDblClickZoom: function() {\n that.options.dblClickZoomEnabled = true;\n return that.pi;\n },\n disableDblClickZoom: function() {\n that.options.dblClickZoomEnabled = false;\n return that.pi;\n },\n isDblClickZoomEnabled: function() {\n return !!that.options.dblClickZoomEnabled;\n },\n // Mouse wheel zoom\n enableMouseWheelZoom: function() {\n that.enableMouseWheelZoom();\n return that.pi;\n },\n disableMouseWheelZoom: function() {\n that.disableMouseWheelZoom();\n return that.pi;\n },\n isMouseWheelZoomEnabled: function() {\n return !!that.options.mouseWheelZoomEnabled;\n },\n // Zoom scale and bounds\n setZoomScaleSensitivity: function(scale) {\n that.options.zoomScaleSensitivity = scale;\n return that.pi;\n },\n setMinZoom: function(zoom) {\n that.options.minZoom = zoom;\n return that.pi;\n },\n setMaxZoom: function(zoom) {\n that.options.maxZoom = zoom;\n return that.pi;\n },\n // Zoom event\n setBeforeZoom: function(fn) {\n that.options.beforeZoom =\n fn === null ? null : Utils.proxy(fn, that.publicInstance);\n return that.pi;\n },\n setOnZoom: function(fn) {\n that.options.onZoom =\n fn === null ? null : Utils.proxy(fn, that.publicInstance);\n return that.pi;\n },\n // Zooming\n zoom: function(scale) {\n that.publicZoom(scale, true);\n return that.pi;\n },\n zoomBy: function(scale) {\n that.publicZoom(scale, false);\n return that.pi;\n },\n zoomAtPoint: function(scale, point) {\n that.publicZoomAtPoint(scale, point, true);\n return that.pi;\n },\n zoomAtPointBy: function(scale, point) {\n that.publicZoomAtPoint(scale, point, false);\n return that.pi;\n },\n zoomIn: function() {\n this.zoomBy(1 + that.options.zoomScaleSensitivity);\n return that.pi;\n },\n zoomOut: function() {\n this.zoomBy(1 / (1 + that.options.zoomScaleSensitivity));\n return that.pi;\n },\n getZoom: function() {\n return that.getRelativeZoom();\n },\n // CTM update\n setOnUpdatedCTM: function(fn) {\n that.options.onUpdatedCTM =\n fn === null ? null : Utils.proxy(fn, that.publicInstance);\n return that.pi;\n },\n // Reset\n resetZoom: function() {\n that.resetZoom();\n return that.pi;\n },\n resetPan: function() {\n that.resetPan();\n return that.pi;\n },\n reset: function() {\n that.reset();\n return that.pi;\n },\n // Fit, Contain and Center\n fit: function() {\n that.fit();\n return that.pi;\n },\n contain: function() {\n that.contain();\n return that.pi;\n },\n center: function() {\n that.center();\n return that.pi;\n },\n // Size and Resize\n updateBBox: function() {\n that.updateBBox();\n return that.pi;\n },\n resize: function() {\n that.resize();\n return that.pi;\n },\n getSizes: function() {\n return {\n width: that.width,\n height: that.height,\n realZoom: that.getZoom(),\n viewBox: that.viewport.getViewBox()\n };\n },\n // Destroy\n destroy: function() {\n that.destroy();\n return that.pi;\n }\n };\n }\n\n return this.publicInstance;\n};\n\n/**\n * Stores pairs of instances of SvgPanZoom and SVG\n * Each pair is represented by an object {svg: SVGSVGElement, instance: SvgPanZoom}\n *\n * @type {Array}\n */\nvar instancesStore = [];\n\nvar svgPanZoom = function(elementOrSelector, options) {\n var svg = Utils.getSvg(elementOrSelector);\n\n if (svg === null) {\n return null;\n } else {\n // Look for existent instance\n for (var i = instancesStore.length - 1; i >= 0; i--) {\n if (instancesStore[i].svg === svg) {\n return instancesStore[i].instance.getPublicInstance();\n }\n }\n\n // If instance not found - create one\n instancesStore.push({\n svg: svg,\n instance: new SvgPanZoom(svg, options)\n });\n\n // Return just pushed instance\n return instancesStore[\n instancesStore.length - 1\n ].instance.getPublicInstance();\n }\n};\n\nmodule.exports = svgPanZoom;\n","import svgPanZoom from 'svg-pan-zoom';\r\n\r\nconst FloorplanZoom = () => {\r\n const btnFloorPlanZooms = document.querySelectorAll(\r\n '.js-btn-floor-plan-zoom',\r\n );\r\n\r\n const floorPlanContainer = document.getElementById('js-floor-plan-container');\r\n\r\n if (btnFloorPlanZooms.length === 0 || !floorPlanContainer) {\r\n return;\r\n }\r\n\r\n let panZoomInstance: SvgPanZoom.Instance | null = null; // Allow null initialization\r\n let initialViewBox: string | null = null; // To store the initial viewBox\r\n\r\n const initZoomComponent = () => {\r\n const zoomSlider = document.getElementById(\r\n 'zoomSlider',\r\n ) as HTMLInputElement;\r\n const floorPlanSVG = document.querySelector(\r\n '.floor-plan-images svg',\r\n );\r\n\r\n if (floorPlanSVG) {\r\n // Store the initial viewBox\r\n initialViewBox = floorPlanSVG.getAttribute('viewBox');\r\n\r\n // Initialize SVG Pan Zoom on the SVG element\r\n panZoomInstance = svgPanZoom(floorPlanSVG, {\r\n zoomEnabled: true,\r\n controlIconsEnabled: false,\r\n fit: true,\r\n center: true,\r\n minZoom: 0.5,\r\n maxZoom: 10,\r\n zoomScaleSensitivity: 0.1,\r\n onZoom: function (scale) {\r\n // Update the slider value based on zoom level\r\n if (zoomSlider) {\r\n zoomSlider.value = scale.toString(); // Set the slider to current zoom level\r\n }\r\n },\r\n });\r\n\r\n // Handle zoom slider input\r\n if (zoomSlider) {\r\n zoomSlider.addEventListener('input', () => {\r\n const zoomLevel = parseFloat(zoomSlider.value); // Parse the value from the slider\r\n if (panZoomInstance) {\r\n panZoomInstance.zoom(zoomLevel);\r\n }\r\n });\r\n }\r\n } else {\r\n console.error('Floor plan SVG element not found.');\r\n }\r\n };\r\n\r\n const destroyZoomComponent = () => {\r\n if (panZoomInstance) {\r\n panZoomInstance.reset();\r\n panZoomInstance.destroy();\r\n panZoomInstance = null; // Clear the instance reference\r\n\r\n const floorPlanSVG = document.querySelector(\r\n '.floor-plan-images svg',\r\n );\r\n\r\n if (floorPlanSVG && initialViewBox) {\r\n // Reset the SVG to its initial state\r\n floorPlanSVG.setAttribute('transform', ''); // Remove any applied transforms\r\n floorPlanSVG.setAttribute('viewBox', initialViewBox); // Reset the viewBox\r\n\r\n // Find the viewport group and reset its transform and style\r\n const viewportGroup = floorPlanSVG.querySelector(\r\n '.svg-pan-zoom_viewport',\r\n );\r\n if (viewportGroup) {\r\n console.log('vp', viewportGroup);\r\n viewportGroup.setAttribute('transform', 'matrix(1, 0, 0, 1, 0, 0)'); // Reset transform\r\n viewportGroup.removeAttribute('style'); // Remove inline styles if any\r\n }\r\n\r\n console.log('SVG reset to initial state.');\r\n }\r\n }\r\n };\r\n\r\n const init = () => {\r\n btnFloorPlanZooms.forEach(btn => {\r\n if (btn) {\r\n btn.addEventListener('click', () => {\r\n // Check if the button has the 'enlarge' class\r\n if (floorPlanContainer.classList.contains('enlarge')) {\r\n // Remove 'enlarge' class if it exists\r\n floorPlanContainer.classList.remove('enlarge');\r\n destroyZoomComponent();\r\n } else {\r\n // Add 'enlarge' class if it doesn't exist\r\n floorPlanContainer.classList.add('enlarge');\r\n initZoomComponent();\r\n }\r\n });\r\n }\r\n });\r\n };\r\n\r\n init();\r\n};\r\n\r\nexport default FloorplanZoom;\r\n"],"names":["AjaxPanels","panelContainerId","panelContentId","callback","panelContainer","panelContent","deactivateAllButtons","button","loadContent","panelUrl","response","htmlContent","error","handlePanelClick","event","panelBtn","InclusionDetailsLoad","showLoadBtn","afterLoadCallBack","inclusionTiles","loadMoreBtn","viewAllBtn","visibleCount","currentVisibleCount","showItems","count","i","loadMoreItems","hiddenItems","item","viewAllItems","init","destroy","updateVisibleCount","resizeTimeout","onResize","reinitialize","Swiper","Navigation","initSpecificPhotoSlideShows","swiperElement","options","GalleryPlanPhotoSlideshow","slideshowEls","slidesPer","filterSlides","swiper","keywords","slides","visibleSlides","slide","category","keyword","shouldLoop","activeIndex","activeSlide","index","newActiveIndex","nextButton","_a","prevButton","_b","selectedCategories","handleFilterButtonClick","target","filter","btn","parentElement","uniwheel","prefix","_addEventListener","_removeEventListener","support","fns","passiveOption","createCallback","element","fn","originalEvent","getCallback","removeCallback","_addWheelListener","elem","eventName","isPassiveListener","cb","_removeWheelListener","addWheelListener","removeWheelListener","utilities","source","prop","o","n","elementOrSelector","svg","context","evt","rect","prevEvt","timeStampDiff","touchesDistance","func","wait","that","args","result","timeout","previous","later","now","remaining","refreshRate","requestTimeout","Utils","require$$0","_browser","svgUtilities","selector","viewport","childNodes","el","viewportId","svgChildren","classNames","style","allDefs","allDefsCount","thisDefs","this","matrix","defs","s","point","width","height","x","y","SvgUtils","controlIcons","instance","styleEl","zoomGroup","zoomIn","zoomInBackground","zoomInShape","resetPanZoomControl","resetPanZoomControlBackground","resetPanZoomControlShape1","resetPanZoomControlShape2","zoomOut","zoomOutBackground","zoomOutShape","require$$1","ShadowViewport","newCTM","svgViewBox","viewBoxValues","v","zoom","bBox","newScale","offsetX","offsetY","scale","safeCTM","willZoom","willPan","preventPan","preventPanX","preventPanY","ctm","shadowViewport","Wheel","ControlIcons","require$$2","require$$3","require$$4","SvgPanZoom","optionsDefaults","passiveListenerOption","boundingClientRectNormalized","oldScale","oldPoint","newPoint","publicInstance","haltEventListeners","delta","timeDelta","divider","inversedScreenCTM","relativeMousePoint","zoomScale","zoomAbsolute","originalState","oldCTM","relativePoint","modifier","absolute","targetClass","zoomFactor","viewportCTM","viewBox","state","instancesStore","svgPanZoom","svgPanZoom_1","FloorplanZoom","btnFloorPlanZooms","floorPlanContainer","panZoomInstance","initialViewBox","initZoomComponent","zoomSlider","floorPlanSVG","zoomLevel","destroyZoomComponent","viewportGroup"],"mappings":"uKAAA,MAAMA,EAAa,CACfC,EACAC,EACAC,IACC,CACK,MAAAC,EAAiB,SAAS,eAAeH,CAAgB,EACzDI,EAAe,SAAS,eAAeH,CAAc,EAE3D,GAAI,CAACE,EAAgB,CACT,QAAA,KAAK,4BAA4BH,CAAgB,cAAc,EACvE,MACJ,CAEA,GAAI,CAACI,EAAc,CACP,QAAA,KAAK,4BAA4BH,CAAc,cAAc,EACrE,MACJ,CAGA,MAAMI,EAAuB,IAAM,CAE3BF,EAAe,iBAAoC,iBAAiB,EAC7D,QAAkBG,GAAA,CAClBA,EAAA,UAAU,OAAO,QAAQ,CAAA,CACnC,CAAA,EAICC,EAAc,MAAOC,GAAqB,CAExC,GAAA,CAEM,MAAAC,EAAW,MAAM,MAAMD,CAAQ,EAEjC,GAAA,CAACC,EAAS,GACV,MAAM,IAAI,MAAM,UAAUA,EAAS,MAAM,EAAE,EAGzC,MAAAC,EAAc,MAAMD,EAAS,OAEnCL,EAAa,UAAYM,EAErBR,GACSA,UAERS,EAAO,CACJ,QAAA,MAAM,0BAA2BA,CAAK,CAClD,CAAA,EAIEC,EAAoBC,GAAiB,CACvCA,EAAM,eAAe,EACrB,MAAMC,EAAWD,EAAM,OAEvB,GAAIC,EAAS,UAAU,SAAS,QAAQ,EACpC,OAGE,MAAAN,EAAWM,EAAS,QAAQ,OAE9BN,IACqBH,IACZS,EAAA,UAAU,IAAI,QAAQ,EAC/BP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