{"version":3,"file":"static/js/nm.ui-components.09977dcdba8a357d.js","sources":["webpack://kuika-sample-react-app/./node_modules/@react-google-maps/api/dist/esm.js","webpack://kuika-sample-react-app/./node_modules/google-map-react/node_modules/@googlemaps/js-api-loader/dist/index.mjs","webpack://kuika-sample-react-app/./node_modules/google-map-react/dist/index.modern.js","webpack://kuika-sample-react-app/./node_modules/react-big-calendar/node_modules/memoize-one/dist/memoize-one.esm.js","webpack://kuika-sample-react-app/./node_modules/react-big-calendar/dist/react-big-calendar.esm.js","webpack://kuika-sample-react-app/./node_modules/react-html5-camera-photo/build/index.js","webpack://kuika-sample-react-app/./node_modules/react-notifications-component/dist/index.js","webpack://kuika-sample-react-app/./node_modules/react-notifications-component/dist/js/react-notifications.prod.js","webpack://kuika-sample-react-app/./node_modules/react-places-autocomplete/dist/PlacesAutocomplete.js","webpack://kuika-sample-react-app/./node_modules/react-places-autocomplete/dist/helpers.js","webpack://kuika-sample-react-app/./node_modules/react-places-autocomplete/dist/index.js","webpack://kuika-sample-react-app/./node_modules/react-places-autocomplete/dist/utils.js","webpack://kuika-sample-react-app/./node_modules/react-player/lib/Player.js","webpack://kuika-sample-react-app/./node_modules/react-player/lib/Preview.js","webpack://kuika-sample-react-app/./node_modules/react-player/lib/ReactPlayer.js","webpack://kuika-sample-react-app/./node_modules/react-player/lib/index.js","webpack://kuika-sample-react-app/./node_modules/react-player/lib/patterns.js","webpack://kuika-sample-react-app/./node_modules/react-player/lib/players/DailyMotion.js","webpack://kuika-sample-react-app/./node_modules/react-player/lib/players/Facebook.js","webpack://kuika-sample-react-app/./node_modules/react-player/lib/players/FilePlayer.js","webpack://kuika-sample-react-app/./node_modules/react-player/lib/players/Kaltura.js","webpack://kuika-sample-react-app/./node_modules/react-player/lib/players/Mixcloud.js","webpack://kuika-sample-react-app/./node_modules/react-player/lib/players/SoundCloud.js","webpack://kuika-sample-react-app/./node_modules/react-player/lib/players/Streamable.js","webpack://kuika-sample-react-app/./node_modules/react-player/lib/players/Twitch.js","webpack://kuika-sample-react-app/./node_modules/react-player/lib/players/Vidyard.js","webpack://kuika-sample-react-app/./node_modules/react-player/lib/players/Vimeo.js","webpack://kuika-sample-react-app/./node_modules/react-player/lib/players/Wistia.js","webpack://kuika-sample-react-app/./node_modules/react-player/lib/players/YouTube.js","webpack://kuika-sample-react-app/./node_modules/react-player/lib/players/index.js","webpack://kuika-sample-react-app/./node_modules/react-player/lib/props.js","webpack://kuika-sample-react-app/./node_modules/react-player/lib/utils.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/index.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/internal-common.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/de-at.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/de.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales-all.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/af.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/ar-dz.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/ar-kw.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/ar-ly.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/ar-ma.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/ar-sa.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/ar-tn.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/ar.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/az.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/bg.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/bn.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/bs.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/ca.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/cs.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/cy.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/da.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/el.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/en-au.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/en-gb.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/en-nz.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/eo.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/es-us.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/es.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/et.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/eu.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/fa.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/fi.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/fr-ca.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/fr-ch.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/fr.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/gl.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/he.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/hi.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/hr.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/hu.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/hy-am.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/id.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/is.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/it.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/ja.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/ka.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/kk.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/km.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/ko.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/ku.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/lb.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/lt.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/lv.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/mk.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/ms.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/nb.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/ne.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/nl.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/nn.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/pl.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/pt-br.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/pt.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/ro.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/ru.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/si-lk.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/sk.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/sl.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/sm.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/sq.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/sr-cyrl.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/sr.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/sv.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/ta-in.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/th.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/tr.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/ug.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/uk.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/uz-cy.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/uz.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/vi.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/zh-cn.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/core/locales/zh-tw.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/daygrid/internal.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/daygrid/index.js","webpack://kuika-sample-react-app/../../node_modules/@fullcalendar/interaction/index.js","webpack://kuika-sample-react-app/./node_modules/@fullcalendar/react/dist/index.js"],"sourcesContent":["import { jsx, jsxs, Fragment } from 'react/jsx-runtime';\nimport { createContext, useContext, memo, useState, useRef, useEffect, PureComponent, createRef, useMemo, Children, isValidElement, cloneElement } from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { createPortal } from 'react-dom';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\n\r\nfunction __rest$1(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nfunction __awaiter$1(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nfunction __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\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;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\n\nfunction getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar NODE_ENV = process.env.NODE_ENV;\n\nvar invariant = function(condition, format, a, b, c, d, e, f) {\n if (NODE_ENV !== 'production') {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error(\n 'Minified exception occurred; use the non-minified dev environment ' +\n 'for the full error message and additional helpful warnings.'\n );\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(\n format.replace(/%s/g, function() { return args[argIndex++]; })\n );\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n};\n\nvar invariant_1 = invariant;\n\nvar invariant$1 = /*@__PURE__*/getDefaultExportFromCjs(invariant_1);\n\nvar MapContext = createContext(null);\nfunction useGoogleMap() {\n invariant$1(!!useContext, 'useGoogleMap is React hook and requires React version 16.8+');\n var map = useContext(MapContext);\n invariant$1(!!map, 'useGoogleMap needs a GoogleMap available up in the tree');\n return map;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction reduce(obj, fn, acc) {\n return Object.keys(obj).reduce(function reducer(newAcc, key) {\n return fn(newAcc, obj[key], key);\n }, acc);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction forEach(obj, fn) {\n Object.keys(obj).forEach(function (key) {\n return fn(obj[key], key);\n });\n}\n\n/* global google */\nfunction applyUpdaterToNextProps(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nupdaterMap, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nprevProps, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nnextProps, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ninstance\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n var map = {};\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n var iter = function (fn, key) {\n var nextValue = nextProps[key];\n if (nextValue !== prevProps[key]) {\n map[key] = nextValue;\n fn(instance, nextValue);\n }\n };\n forEach(updaterMap, iter);\n return map;\n}\nfunction registerEvents(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nprops, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ninstance, eventMap) {\n var registeredList = reduce(eventMap, function reducer(acc, googleEventName, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onEventName) {\n if (typeof props[onEventName] === 'function') {\n acc.push(google.maps.event.addListener(instance, googleEventName, props[onEventName]));\n }\n return acc;\n }, []);\n return registeredList;\n}\nfunction unregisterEvent(registered) {\n google.maps.event.removeListener(registered);\n}\nfunction unregisterEvents(events) {\n if (events === void 0) { events = []; }\n events.forEach(unregisterEvent);\n}\nfunction applyUpdatersToPropsAndRegisterEvents(_a) {\n var updaterMap = _a.updaterMap, eventMap = _a.eventMap, prevProps = _a.prevProps, nextProps = _a.nextProps, instance = _a.instance;\n var registeredEvents = registerEvents(nextProps, instance, eventMap);\n applyUpdaterToNextProps(updaterMap, prevProps, nextProps, instance);\n return registeredEvents;\n}\n\nvar eventMap$i = {\n onDblClick: 'dblclick',\n onDragEnd: 'dragend',\n onDragStart: 'dragstart',\n onMapTypeIdChanged: 'maptypeid_changed',\n onMouseMove: 'mousemove',\n onMouseOut: 'mouseout',\n onMouseOver: 'mouseover',\n onMouseDown: 'mousedown',\n onMouseUp: 'mouseup',\n onRightClick: 'rightclick',\n onTilesLoaded: 'tilesloaded',\n onBoundsChanged: 'bounds_changed',\n onCenterChanged: 'center_changed',\n onClick: 'click',\n onDrag: 'drag',\n onHeadingChanged: 'heading_changed',\n onIdle: 'idle',\n onProjectionChanged: 'projection_changed',\n onResize: 'resize',\n onTiltChanged: 'tilt_changed',\n onZoomChanged: 'zoom_changed',\n};\nvar updaterMap$i = {\n extraMapTypes: function (map, extra) {\n extra.forEach(function forEachExtra(it, i) {\n map.mapTypes.set(String(i), it);\n });\n },\n center: function (map, center) {\n map.setCenter(center);\n },\n clickableIcons: function (map, clickable) {\n map.setClickableIcons(clickable);\n },\n heading: function (map, heading) {\n map.setHeading(heading);\n },\n mapTypeId: function (map, mapTypeId) {\n map.setMapTypeId(mapTypeId);\n },\n options: function (map, options) {\n map.setOptions(options);\n },\n streetView: function (map, streetView) {\n map.setStreetView(streetView);\n },\n tilt: function (map, tilt) {\n map.setTilt(tilt);\n },\n zoom: function (map, zoom) {\n map.setZoom(zoom);\n },\n};\n// TODO: unfinished!\nfunction GoogleMapFunctional(_a) {\n var children = _a.children, options = _a.options, id = _a.id, mapContainerStyle = _a.mapContainerStyle, mapContainerClassName = _a.mapContainerClassName, center = _a.center, \n // clickableIcons,\n // extraMapTypes,\n // heading,\n // mapTypeId,\n onClick = _a.onClick, onDblClick = _a.onDblClick, onDrag = _a.onDrag, onDragEnd = _a.onDragEnd, onDragStart = _a.onDragStart, onMouseMove = _a.onMouseMove, onMouseOut = _a.onMouseOut, onMouseOver = _a.onMouseOver, onMouseDown = _a.onMouseDown, onMouseUp = _a.onMouseUp, onRightClick = _a.onRightClick, \n // onMapTypeIdChanged,\n // onTilesLoaded,\n // onBoundsChanged,\n onCenterChanged = _a.onCenterChanged, \n // onHeadingChanged,\n // onIdle,\n // onProjectionChanged,\n // onResize,\n // onTiltChanged,\n // onZoomChanged,\n onLoad = _a.onLoad, onUnmount = _a.onUnmount;\n var _b = useState(null), map = _b[0], setMap = _b[1];\n var ref = useRef(null);\n // const [extraMapTypesListener, setExtraMapTypesListener] = useState(null)\n var _c = useState(null), centerChangedListener = _c[0], setCenterChangedListener = _c[1];\n var _d = useState(null), dblclickListener = _d[0], setDblclickListener = _d[1];\n var _e = useState(null), dragendListener = _e[0], setDragendListener = _e[1];\n var _f = useState(null), dragstartListener = _f[0], setDragstartListener = _f[1];\n var _g = useState(null), mousedownListener = _g[0], setMousedownListener = _g[1];\n var _h = useState(null), mousemoveListener = _h[0], setMousemoveListener = _h[1];\n var _j = useState(null), mouseoutListener = _j[0], setMouseoutListener = _j[1];\n var _k = useState(null), mouseoverListener = _k[0], setMouseoverListener = _k[1];\n var _l = useState(null), mouseupListener = _l[0], setMouseupListener = _l[1];\n var _m = useState(null), rightclickListener = _m[0], setRightclickListener = _m[1];\n var _o = useState(null), clickListener = _o[0], setClickListener = _o[1];\n var _p = useState(null), dragListener = _p[0], setDragListener = _p[1];\n // Order does matter\n useEffect(function () {\n if (options && map !== null) {\n map.setOptions(options);\n }\n }, [map, options]);\n useEffect(function () {\n if (map !== null && typeof center !== 'undefined') {\n map.setCenter(center);\n }\n }, [map, center]);\n useEffect(function () {\n if (map && onDblClick) {\n if (dblclickListener !== null) {\n google.maps.event.removeListener(dblclickListener);\n }\n setDblclickListener(google.maps.event.addListener(map, 'dblclick', onDblClick));\n }\n }, [onDblClick]);\n useEffect(function () {\n if (map && onDragEnd) {\n if (dragendListener !== null) {\n google.maps.event.removeListener(dragendListener);\n }\n setDragendListener(google.maps.event.addListener(map, 'dragend', onDragEnd));\n }\n }, [onDragEnd]);\n useEffect(function () {\n if (map && onDragStart) {\n if (dragstartListener !== null) {\n google.maps.event.removeListener(dragstartListener);\n }\n setDragstartListener(google.maps.event.addListener(map, 'dragstart', onDragStart));\n }\n }, [onDragStart]);\n useEffect(function () {\n if (map && onMouseDown) {\n if (mousedownListener !== null) {\n google.maps.event.removeListener(mousedownListener);\n }\n setMousedownListener(google.maps.event.addListener(map, 'mousedown', onMouseDown));\n }\n }, [onMouseDown]);\n useEffect(function () {\n if (map && onMouseMove) {\n if (mousemoveListener !== null) {\n google.maps.event.removeListener(mousemoveListener);\n }\n setMousemoveListener(google.maps.event.addListener(map, 'mousemove', onMouseMove));\n }\n }, [onMouseMove]);\n useEffect(function () {\n if (map && onMouseOut) {\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n setMouseoutListener(google.maps.event.addListener(map, 'mouseout', onMouseOut));\n }\n }, [onMouseOut]);\n useEffect(function () {\n if (map && onMouseOver) {\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n setMouseoverListener(google.maps.event.addListener(map, 'mouseover', onMouseOver));\n }\n }, [onMouseOver]);\n useEffect(function () {\n if (map && onMouseUp) {\n if (mouseupListener !== null) {\n google.maps.event.removeListener(mouseupListener);\n }\n setMouseupListener(google.maps.event.addListener(map, 'mouseup', onMouseUp));\n }\n }, [onMouseUp]);\n useEffect(function () {\n if (map && onRightClick) {\n if (rightclickListener !== null) {\n google.maps.event.removeListener(rightclickListener);\n }\n setRightclickListener(google.maps.event.addListener(map, 'rightclick', onRightClick));\n }\n }, [onRightClick]);\n useEffect(function () {\n if (map && onClick) {\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n setClickListener(google.maps.event.addListener(map, 'click', onClick));\n }\n }, [onClick]);\n useEffect(function () {\n if (map && onDrag) {\n if (dragListener !== null) {\n google.maps.event.removeListener(dragListener);\n }\n setDragListener(google.maps.event.addListener(map, 'drag', onDrag));\n }\n }, [onDrag]);\n useEffect(function () {\n if (map && onCenterChanged) {\n if (centerChangedListener !== null) {\n google.maps.event.removeListener(centerChangedListener);\n }\n setCenterChangedListener(google.maps.event.addListener(map, 'center_changed', onCenterChanged));\n }\n }, [onClick]);\n useEffect(function () {\n var map = ref.current === null\n ? null\n : new google.maps.Map(ref.current, options);\n setMap(map);\n if (map !== null && onLoad) {\n onLoad(map);\n }\n return function () {\n if (map !== null) {\n if (onUnmount) {\n onUnmount(map);\n }\n }\n };\n }, []);\n return (jsx(\"div\", { id: id, ref: ref, style: mapContainerStyle, className: mapContainerClassName, children: jsx(MapContext.Provider, { value: map, children: map !== null ? children : null }) }));\n}\nmemo(GoogleMapFunctional);\nvar GoogleMap = /** @class */ (function (_super) {\n __extends(GoogleMap, _super);\n function GoogleMap() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.state = {\n map: null,\n };\n _this.registeredEvents = [];\n _this.mapRef = null;\n _this.getInstance = function () {\n if (_this.mapRef === null) {\n return null;\n }\n return new google.maps.Map(_this.mapRef, _this.props.options);\n };\n _this.panTo = function (latLng) {\n var map = _this.getInstance();\n if (map) {\n map.panTo(latLng);\n }\n };\n _this.setMapCallback = function () {\n if (_this.state.map !== null) {\n if (_this.props.onLoad) {\n _this.props.onLoad(_this.state.map);\n }\n }\n };\n _this.getRef = function (ref) {\n _this.mapRef = ref;\n };\n return _this;\n }\n GoogleMap.prototype.componentDidMount = function () {\n var map = this.getInstance();\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$i,\n eventMap: eventMap$i,\n prevProps: {},\n nextProps: this.props,\n instance: map,\n });\n this.setState(function setMap() {\n return {\n map: map,\n };\n }, this.setMapCallback);\n };\n GoogleMap.prototype.componentDidUpdate = function (prevProps) {\n if (this.state.map !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$i,\n eventMap: eventMap$i,\n prevProps: prevProps,\n nextProps: this.props,\n instance: this.state.map,\n });\n }\n };\n GoogleMap.prototype.componentWillUnmount = function () {\n if (this.state.map !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.map);\n }\n unregisterEvents(this.registeredEvents);\n }\n };\n GoogleMap.prototype.render = function () {\n return (jsx(\"div\", { id: this.props.id, ref: this.getRef, style: this.props.mapContainerStyle, className: this.props.mapContainerClassName, children: jsx(MapContext.Provider, { value: this.state.map, children: this.state.map !== null ? this.props.children : null }) }));\n };\n return GoogleMap;\n}(PureComponent));\n\nvar isBrowser = typeof document !== 'undefined';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction injectScript(_a) {\n var url = _a.url, id = _a.id, nonce = _a.nonce;\n if (!isBrowser) {\n return Promise.reject(new Error('document is undefined'));\n }\n return new Promise(function injectScriptCallback(resolve, reject) {\n var existingScript = document.getElementById(id);\n var windowWithGoogleMap = window;\n if (existingScript) {\n // Same script id/url: keep same script\n var dataStateAttribute = existingScript.getAttribute('data-state');\n if (existingScript.src === url && dataStateAttribute !== 'error') {\n if (dataStateAttribute === 'ready') {\n return resolve(id);\n }\n else {\n var originalInitMap_1 = windowWithGoogleMap.initMap;\n var originalErrorCallback_1 = existingScript.onerror;\n windowWithGoogleMap.initMap = function initMap() {\n if (originalInitMap_1) {\n originalInitMap_1();\n }\n resolve(id);\n };\n existingScript.onerror = function (err) {\n if (originalErrorCallback_1) {\n originalErrorCallback_1(err);\n }\n reject(err);\n };\n return;\n }\n }\n // Same script id, but either\n // 1. requested URL is different\n // 2. script failed to load\n else {\n existingScript.remove();\n }\n }\n var script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = url;\n script.id = id;\n script.async = true;\n script.nonce = nonce || '';\n script.onerror = function onerror(err) {\n script.setAttribute('data-state', 'error');\n reject(err);\n };\n windowWithGoogleMap.initMap = function onload() {\n script.setAttribute('data-state', 'ready');\n resolve(id);\n };\n document.head.appendChild(script);\n }).catch(function (err) {\n console.error('injectScript error: ', err);\n throw err;\n });\n}\n\nfunction isGoogleFontStyle(element) {\n // 'Roboto' or 'Google Sans Text' font download\n var href = element.href;\n if (href && (href.indexOf('https://fonts.googleapis.com/css?family=Roboto') === 0 ||\n href.indexOf('https://fonts.googleapis.com/css?family=Google+Sans+Text') === 0)) {\n return true;\n }\n // font style elements\n if (\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n element.tagName.toLowerCase() === 'style' &&\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n element.styleSheet &&\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n element.styleSheet.cssText &&\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n element.styleSheet.cssText.replace('\\r\\n', '').indexOf('.gm-style') === 0) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n element.styleSheet.cssText = '';\n return true;\n }\n // font style elements for other browsers\n if (\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n element.tagName.toLowerCase() === 'style' &&\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n element.innerHTML &&\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n element.innerHTML.replace('\\r\\n', '').indexOf('.gm-style') === 0) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n element.innerHTML = '';\n return true;\n }\n // when google tries to add empty style\n if (\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n element.tagName.toLowerCase() === 'style' &&\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n !element.styleSheet &&\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n !element.innerHTML) {\n return true;\n }\n return false;\n}\n// Preventing the Google Maps library from downloading an extra font\nfunction preventGoogleFonts() {\n // we override these methods only for one particular head element\n // default methods for other elements are not affected\n var head = document.getElementsByTagName('head')[0];\n if (head) {\n var trueInsertBefore_1 = head.insertBefore.bind(head);\n // TODO: adding return before reflect solves the TS issue\n head.insertBefore = function insertBefore(newElement, referenceElement) {\n if (!isGoogleFontStyle(newElement)) {\n Reflect.apply(trueInsertBefore_1, head, [newElement, referenceElement]);\n }\n return newElement;\n };\n var trueAppend_1 = head.appendChild.bind(head);\n // TODO: adding return before reflect solves the TS issue\n head.appendChild = function appendChild(textNode) {\n if (!isGoogleFontStyle(textNode)) {\n Reflect.apply(trueAppend_1, head, [textNode]);\n }\n return textNode;\n };\n }\n}\n\nfunction makeLoadScriptUrl(_a) {\n var googleMapsApiKey = _a.googleMapsApiKey, googleMapsClientId = _a.googleMapsClientId, _b = _a.version, version = _b === void 0 ? 'weekly' : _b, language = _a.language, region = _a.region, libraries = _a.libraries, channel = _a.channel, mapIds = _a.mapIds, authReferrerPolicy = _a.authReferrerPolicy;\n var params = [];\n invariant$1((googleMapsApiKey && googleMapsClientId) || !(googleMapsApiKey && googleMapsClientId), 'You need to specify either googleMapsApiKey or googleMapsClientId for @react-google-maps/api load script to work. You cannot use both at the same time.');\n if (googleMapsApiKey) {\n params.push(\"key=\".concat(googleMapsApiKey));\n }\n else if (googleMapsClientId) {\n params.push(\"client=\".concat(googleMapsClientId));\n }\n if (version) {\n params.push(\"v=\".concat(version));\n }\n if (language) {\n params.push(\"language=\".concat(language));\n }\n if (region) {\n params.push(\"region=\".concat(region));\n }\n if (libraries && libraries.length) {\n params.push(\"libraries=\".concat(libraries.sort().join(',')));\n }\n if (channel) {\n params.push(\"channel=\".concat(channel));\n }\n if (mapIds && mapIds.length) {\n params.push(\"map_ids=\".concat(mapIds.join(',')));\n }\n if (authReferrerPolicy) {\n params.push(\"auth_referrer_policy=\".concat(authReferrerPolicy));\n }\n params.push('callback=initMap');\n return \"https://maps.googleapis.com/maps/api/js?\".concat(params.join('&'));\n}\n\nvar cleaningUp = false;\nfunction DefaultLoadingElement() {\n return jsx(\"div\", { children: \"Loading...\" });\n}\nvar defaultLoadScriptProps = {\n id: 'script-loader',\n version: 'weekly',\n};\nvar LoadScript = /** @class */ (function (_super) {\n __extends(LoadScript, _super);\n function LoadScript() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.check = createRef();\n _this.state = {\n loaded: false,\n };\n _this.cleanupCallback = function () {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n delete window.google.maps;\n _this.injectScript();\n };\n _this.isCleaningUp = function () { return __awaiter$1(_this, void 0, void 0, function () {\n function promiseCallback(resolve) {\n if (!cleaningUp) {\n resolve();\n }\n else {\n if (isBrowser) {\n var timer_1 = window.setInterval(function interval() {\n if (!cleaningUp) {\n window.clearInterval(timer_1);\n resolve();\n }\n }, 1);\n }\n }\n return;\n }\n return __generator(this, function (_a) {\n return [2 /*return*/, new Promise(promiseCallback)];\n });\n }); };\n _this.cleanup = function () {\n cleaningUp = true;\n var script = document.getElementById(_this.props.id);\n if (script && script.parentNode) {\n script.parentNode.removeChild(script);\n }\n Array.prototype.slice\n .call(document.getElementsByTagName('script'))\n .filter(function filter(script) {\n return typeof script.src === 'string' && script.src.includes('maps.googleapis');\n })\n .forEach(function forEach(script) {\n if (script.parentNode) {\n script.parentNode.removeChild(script);\n }\n });\n Array.prototype.slice\n .call(document.getElementsByTagName('link'))\n .filter(function filter(link) {\n return (link.href === 'https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Google+Sans');\n })\n .forEach(function forEach(link) {\n if (link.parentNode) {\n link.parentNode.removeChild(link);\n }\n });\n Array.prototype.slice\n .call(document.getElementsByTagName('style'))\n .filter(function filter(style) {\n return (style.innerText !== undefined &&\n style.innerText.length > 0 &&\n style.innerText.includes('.gm-'));\n })\n .forEach(function forEach(style) {\n if (style.parentNode) {\n style.parentNode.removeChild(style);\n }\n });\n };\n _this.injectScript = function () {\n if (_this.props.preventGoogleFontsLoading) {\n preventGoogleFonts();\n }\n invariant$1(!!_this.props.id, 'LoadScript requires \"id\" prop to be a string: %s', _this.props.id);\n var injectScriptOptions = {\n id: _this.props.id,\n nonce: _this.props.nonce,\n url: makeLoadScriptUrl(_this.props),\n };\n injectScript(injectScriptOptions)\n .then(function () {\n if (_this.props.onLoad) {\n _this.props.onLoad();\n }\n _this.setState(function setLoaded() {\n return {\n loaded: true,\n };\n });\n return;\n })\n .catch(function (err) {\n if (_this.props.onError) {\n _this.props.onError(err);\n }\n console.error(\"\\n There has been an Error with loading Google Maps API script, please check that you provided correct google API key (\".concat(_this\n .props.googleMapsApiKey || '-', \") or Client ID (\").concat(_this.props.googleMapsClientId ||\n '-', \") to \\n Otherwise it is a Network issue.\\n \"));\n });\n };\n return _this;\n }\n LoadScript.prototype.componentDidMount = function () {\n if (isBrowser) {\n if (window.google && window.google.maps && !cleaningUp) {\n console.error('google api is already presented');\n return;\n }\n this.isCleaningUp()\n .then(this.injectScript)\n .catch(function error(err) {\n console.error('Error at injecting script after cleaning up: ', err);\n });\n }\n };\n LoadScript.prototype.componentDidUpdate = function (prevProps) {\n if (this.props.libraries !== prevProps.libraries) {\n console.warn('Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables');\n }\n if (isBrowser && prevProps.language !== this.props.language) {\n this.cleanup();\n // TODO: refactor to use gDSFP maybe... wait for hooks refactoring.\n this.setState(function setLoaded() {\n return {\n loaded: false,\n };\n }, this.cleanupCallback);\n }\n };\n LoadScript.prototype.componentWillUnmount = function () {\n var _this = this;\n if (isBrowser) {\n this.cleanup();\n var timeoutCallback = function () {\n if (!_this.check.current) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n delete window.google;\n cleaningUp = false;\n }\n };\n window.setTimeout(timeoutCallback, 1);\n if (this.props.onUnmount) {\n this.props.onUnmount();\n }\n }\n };\n LoadScript.prototype.render = function () {\n return (jsxs(Fragment, { children: [jsx(\"div\", { ref: this.check }), this.state.loaded\n ? this.props.children\n : this.props.loadingElement || jsx(DefaultLoadingElement, {})] }));\n };\n LoadScript.defaultProps = defaultLoadScriptProps;\n return LoadScript;\n}(PureComponent));\n\n/* eslint-disable filenames/match-regex */\nvar previouslyLoadedUrl;\nfunction useLoadScript(_a) {\n var _b = _a.id, id = _b === void 0 ? defaultLoadScriptProps.id : _b, _c = _a.version, version = _c === void 0 ? defaultLoadScriptProps.version : _c, nonce = _a.nonce, googleMapsApiKey = _a.googleMapsApiKey, googleMapsClientId = _a.googleMapsClientId, language = _a.language, region = _a.region, libraries = _a.libraries, preventGoogleFontsLoading = _a.preventGoogleFontsLoading, channel = _a.channel, mapIds = _a.mapIds, authReferrerPolicy = _a.authReferrerPolicy;\n var isMounted = useRef(false);\n var _d = useState(false), isLoaded = _d[0], setLoaded = _d[1];\n var _e = useState(undefined), loadError = _e[0], setLoadError = _e[1];\n useEffect(function trackMountedState() {\n isMounted.current = true;\n return function () {\n isMounted.current = false;\n };\n }, []);\n useEffect(function applyPreventGoogleFonts() {\n if (isBrowser && preventGoogleFontsLoading) {\n preventGoogleFonts();\n }\n }, [preventGoogleFontsLoading]);\n useEffect(function validateLoadedState() {\n if (isLoaded) {\n invariant$1(!!window.google, 'useLoadScript was marked as loaded, but window.google is not present. Something went wrong.');\n }\n }, [isLoaded]);\n var url = makeLoadScriptUrl({\n version: version,\n googleMapsApiKey: googleMapsApiKey,\n googleMapsClientId: googleMapsClientId,\n language: language,\n region: region,\n libraries: libraries,\n channel: channel,\n mapIds: mapIds,\n authReferrerPolicy: authReferrerPolicy\n });\n useEffect(function loadScriptAndModifyLoadedState() {\n if (!isBrowser) {\n return;\n }\n function setLoadedIfMounted() {\n if (isMounted.current) {\n setLoaded(true);\n previouslyLoadedUrl = url;\n }\n }\n if (window.google && window.google.maps && previouslyLoadedUrl === url) {\n setLoadedIfMounted();\n return;\n }\n injectScript({ id: id, url: url, nonce: nonce })\n .then(setLoadedIfMounted)\n .catch(function handleInjectError(err) {\n if (isMounted.current) {\n setLoadError(err);\n }\n console.warn(\"\\n There has been an Error with loading Google Maps API script, please check that you provided correct google API key (\".concat(googleMapsApiKey ||\n '-', \") or Client ID (\").concat(googleMapsClientId || '-', \")\\n Otherwise it is a Network issue.\\n \"));\n console.error(err);\n });\n }, [id, url, nonce]);\n var prevLibraries = useRef();\n useEffect(function checkPerformance() {\n if (prevLibraries.current && libraries !== prevLibraries.current) {\n console.warn('Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables');\n }\n prevLibraries.current = libraries;\n }, [libraries]);\n return { isLoaded: isLoaded, loadError: loadError, url: url };\n}\n\nvar defaultLoadingElement = jsx(DefaultLoadingElement, {});\nfunction LoadScriptNext(_a) {\n var loadingElement = _a.loadingElement, onLoad = _a.onLoad, onError = _a.onError, onUnmount = _a.onUnmount, children = _a.children, hookOptions = __rest$1(_a, [\"loadingElement\", \"onLoad\", \"onError\", \"onUnmount\", \"children\"]);\n var _b = useLoadScript(hookOptions), isLoaded = _b.isLoaded, loadError = _b.loadError;\n useEffect(function handleOnLoad() {\n if (isLoaded && typeof onLoad === 'function') {\n onLoad();\n }\n }, [isLoaded, onLoad]);\n useEffect(function handleOnError() {\n if (loadError && typeof onError === 'function') {\n onError(loadError);\n }\n }, [loadError, onError]);\n useEffect(function handleOnUnmount() {\n return function () {\n if (onUnmount) {\n onUnmount();\n }\n };\n }, [onUnmount]);\n return isLoaded ? children : loadingElement || defaultLoadingElement;\n}\nvar LoadScriptNext$1 = memo(LoadScriptNext);\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nfunction __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nvar fastDeepEqual$1 = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n\n/**\n * Copyright 2019 Google LLC. All Rights Reserved.\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 */\nconst DEFAULT_ID = \"__googleMapsScriptId\";\n/**\n * The status of the [[Loader]].\n */\nvar LoaderStatus;\n(function (LoaderStatus) {\n LoaderStatus[LoaderStatus[\"INITIALIZED\"] = 0] = \"INITIALIZED\";\n LoaderStatus[LoaderStatus[\"LOADING\"] = 1] = \"LOADING\";\n LoaderStatus[LoaderStatus[\"SUCCESS\"] = 2] = \"SUCCESS\";\n LoaderStatus[LoaderStatus[\"FAILURE\"] = 3] = \"FAILURE\";\n})(LoaderStatus || (LoaderStatus = {}));\n/**\n * [[Loader]] makes it easier to add Google Maps JavaScript API to your application\n * dynamically using\n * [Promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n * It works by dynamically creating and appending a script node to the the\n * document head and wrapping the callback function so as to return a promise.\n *\n * ```\n * const loader = new Loader({\n * apiKey: \"\",\n * version: \"weekly\",\n * libraries: [\"places\"]\n * });\n *\n * loader.load().then((google) => {\n * const map = new google.maps.Map(...)\n * })\n * ```\n */\nclass Loader {\n /**\n * Creates an instance of Loader using [[LoaderOptions]]. No defaults are set\n * using this library, instead the defaults are set by the Google Maps\n * JavaScript API server.\n *\n * ```\n * const loader = Loader({apiKey, version: 'weekly', libraries: ['places']});\n * ```\n */\n constructor({ apiKey, authReferrerPolicy, channel, client, id = DEFAULT_ID, language, libraries = [], mapIds, nonce, region, retries = 3, url = \"https://maps.googleapis.com/maps/api/js\", version, }) {\n this.callbacks = [];\n this.done = false;\n this.loading = false;\n this.errors = [];\n this.apiKey = apiKey;\n this.authReferrerPolicy = authReferrerPolicy;\n this.channel = channel;\n this.client = client;\n this.id = id || DEFAULT_ID; // Do not allow empty string\n this.language = language;\n this.libraries = libraries;\n this.mapIds = mapIds;\n this.nonce = nonce;\n this.region = region;\n this.retries = retries;\n this.url = url;\n this.version = version;\n if (Loader.instance) {\n if (!fastDeepEqual$1(this.options, Loader.instance.options)) {\n throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(Loader.instance.options)}`);\n }\n return Loader.instance;\n }\n Loader.instance = this;\n }\n get options() {\n return {\n version: this.version,\n apiKey: this.apiKey,\n channel: this.channel,\n client: this.client,\n id: this.id,\n libraries: this.libraries,\n language: this.language,\n region: this.region,\n mapIds: this.mapIds,\n nonce: this.nonce,\n url: this.url,\n authReferrerPolicy: this.authReferrerPolicy,\n };\n }\n get status() {\n if (this.errors.length) {\n return LoaderStatus.FAILURE;\n }\n if (this.done) {\n return LoaderStatus.SUCCESS;\n }\n if (this.loading) {\n return LoaderStatus.LOADING;\n }\n return LoaderStatus.INITIALIZED;\n }\n get failed() {\n return this.done && !this.loading && this.errors.length >= this.retries + 1;\n }\n /**\n * CreateUrl returns the Google Maps JavaScript API script url given the [[LoaderOptions]].\n *\n * @ignore\n * @deprecated\n */\n createUrl() {\n let url = this.url;\n url += `?callback=__googleMapsCallback`;\n if (this.apiKey) {\n url += `&key=${this.apiKey}`;\n }\n if (this.channel) {\n url += `&channel=${this.channel}`;\n }\n if (this.client) {\n url += `&client=${this.client}`;\n }\n if (this.libraries.length > 0) {\n url += `&libraries=${this.libraries.join(\",\")}`;\n }\n if (this.language) {\n url += `&language=${this.language}`;\n }\n if (this.region) {\n url += `®ion=${this.region}`;\n }\n if (this.version) {\n url += `&v=${this.version}`;\n }\n if (this.mapIds) {\n url += `&map_ids=${this.mapIds.join(\",\")}`;\n }\n if (this.authReferrerPolicy) {\n url += `&auth_referrer_policy=${this.authReferrerPolicy}`;\n }\n return url;\n }\n deleteScript() {\n const script = document.getElementById(this.id);\n if (script) {\n script.remove();\n }\n }\n /**\n * Load the Google Maps JavaScript API script and return a Promise.\n * @deprecated, use importLibrary() instead.\n */\n load() {\n return this.loadPromise();\n }\n /**\n * Load the Google Maps JavaScript API script and return a Promise.\n *\n * @ignore\n * @deprecated, use importLibrary() instead.\n */\n loadPromise() {\n return new Promise((resolve, reject) => {\n this.loadCallback((err) => {\n if (!err) {\n resolve(window.google);\n }\n else {\n reject(err.error);\n }\n });\n });\n }\n importLibrary(name) {\n this.execute();\n return google.maps.importLibrary(name);\n }\n /**\n * Load the Google Maps JavaScript API script with a callback.\n * @deprecated, use importLibrary() instead.\n */\n loadCallback(fn) {\n this.callbacks.push(fn);\n this.execute();\n }\n /**\n * Set the script on document.\n */\n setScript() {\n var _a, _b;\n if (document.getElementById(this.id)) {\n // TODO wrap onerror callback for cases where the script was loaded elsewhere\n this.callback();\n return;\n }\n const params = {\n key: this.apiKey,\n channel: this.channel,\n client: this.client,\n libraries: this.libraries.length && this.libraries,\n v: this.version,\n mapIds: this.mapIds,\n language: this.language,\n region: this.region,\n authReferrerPolicy: this.authReferrerPolicy,\n };\n // keep the URL minimal:\n Object.keys(params).forEach(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (key) => !params[key] && delete params[key]);\n if (!((_b = (_a = window === null || window === void 0 ? void 0 : window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.importLibrary)) {\n // tweaked copy of https://developers.google.com/maps/documentation/javascript/load-maps-js-api#dynamic-library-import\n // which also sets the base url, the id, and the nonce\n /* eslint-disable */\n ((g) => {\n // @ts-ignore\n let h, a, k, p = \"The Google Maps JavaScript API\", c = \"google\", l = \"importLibrary\", q = \"__ib__\", m = document, b = window;\n // @ts-ignore\n b = b[c] || (b[c] = {});\n // @ts-ignore\n const d = b.maps || (b.maps = {}), r = new Set(), e = new URLSearchParams(), u = () => \n // @ts-ignore\n h || (h = new Promise((f, n) => __awaiter(this, void 0, void 0, function* () {\n var _a;\n yield (a = m.createElement(\"script\"));\n a.id = this.id;\n e.set(\"libraries\", [...r] + \"\");\n // @ts-ignore\n for (k in g)\n e.set(k.replace(/[A-Z]/g, (t) => \"_\" + t[0].toLowerCase()), g[k]);\n e.set(\"callback\", c + \".maps.\" + q);\n a.src = this.url + `?` + e;\n d[q] = f;\n a.onerror = () => (h = n(Error(p + \" could not load.\")));\n // @ts-ignore\n a.nonce = this.nonce || ((_a = m.querySelector(\"script[nonce]\")) === null || _a === void 0 ? void 0 : _a.nonce) || \"\";\n m.head.append(a);\n })));\n // @ts-ignore\n d[l] ? console.warn(p + \" only loads once. Ignoring:\", g) : (d[l] = (f, ...n) => r.add(f) && u().then(() => d[l](f, ...n)));\n })(params);\n /* eslint-enable */\n }\n // While most libraries populate the global namespace when loaded via bootstrap params,\n // this is not the case for \"marker\" when used with the inline bootstrap loader\n // (and maybe others in the future). So ensure there is an importLibrary for each:\n const libraryPromises = this.libraries.map((library) => this.importLibrary(library));\n // ensure at least one library, to kick off loading...\n if (!libraryPromises.length) {\n libraryPromises.push(this.importLibrary(\"core\"));\n }\n Promise.all(libraryPromises).then(() => this.callback(), (error) => {\n const event = new ErrorEvent(\"error\", { error }); // for backwards compat\n this.loadErrorCallback(event);\n });\n }\n /**\n * Reset the loader state.\n */\n reset() {\n this.deleteScript();\n this.done = false;\n this.loading = false;\n this.errors = [];\n this.onerrorEvent = null;\n }\n resetIfRetryingFailed() {\n if (this.failed) {\n this.reset();\n }\n }\n loadErrorCallback(e) {\n this.errors.push(e);\n if (this.errors.length <= this.retries) {\n const delay = this.errors.length * Math.pow(2, this.errors.length);\n console.error(`Failed to load Google Maps script, retrying in ${delay} ms.`);\n setTimeout(() => {\n this.deleteScript();\n this.setScript();\n }, delay);\n }\n else {\n this.onerrorEvent = e;\n this.callback();\n }\n }\n callback() {\n this.done = true;\n this.loading = false;\n this.callbacks.forEach((cb) => {\n cb(this.onerrorEvent);\n });\n this.callbacks = [];\n }\n execute() {\n this.resetIfRetryingFailed();\n if (this.done) {\n this.callback();\n }\n else {\n // short circuit and warn if google.maps is already loaded\n if (window.google && window.google.maps && window.google.maps.version) {\n console.warn(\"Google Maps already loaded outside @googlemaps/js-api-loader.\" +\n \"This may result in undesirable behavior as options and script parameters may not match.\");\n this.callback();\n return;\n }\n if (this.loading) ;\n else {\n this.loading = true;\n this.setScript();\n }\n }\n }\n}\n\nvar defaultLibraries = ['maps'];\nfunction useJsApiLoader(_a) {\n var _b = _a.id, id = _b === void 0 ? defaultLoadScriptProps.id : _b, _c = _a.version, version = _c === void 0 ? defaultLoadScriptProps.version : _c, nonce = _a.nonce, googleMapsApiKey = _a.googleMapsApiKey, \n // googleMapsClientId,\n language = _a.language, region = _a.region, _d = _a.libraries, libraries = _d === void 0 ? defaultLibraries : _d, preventGoogleFontsLoading = _a.preventGoogleFontsLoading, \n // channel,\n mapIds = _a.mapIds, authReferrerPolicy = _a.authReferrerPolicy;\n var isMounted = useRef(false);\n var _e = useState(false), isLoaded = _e[0], setLoaded = _e[1];\n var _f = useState(undefined), loadError = _f[0], setLoadError = _f[1];\n useEffect(function trackMountedState() {\n isMounted.current = true;\n return function () {\n isMounted.current = false;\n };\n }, []);\n var loader = useMemo(function () {\n return new Loader({\n id: id,\n apiKey: googleMapsApiKey,\n version: version,\n libraries: libraries,\n language: language || 'en',\n region: region || 'US',\n mapIds: mapIds || [],\n nonce: nonce || '',\n authReferrerPolicy: authReferrerPolicy || 'origin',\n });\n }, [id, googleMapsApiKey, version, libraries, language, region, mapIds, nonce, authReferrerPolicy]);\n useEffect(function effect() {\n if (isLoaded) {\n return;\n }\n else {\n loader.load().then(function () {\n if (isMounted.current) {\n setLoaded(true);\n }\n return;\n })\n .catch(function (error) {\n setLoadError(error);\n });\n }\n }, []);\n useEffect(function () {\n if (isBrowser && preventGoogleFontsLoading) {\n preventGoogleFonts();\n }\n }, [preventGoogleFontsLoading]);\n var prevLibraries = useRef();\n useEffect(function () {\n if (prevLibraries.current && libraries !== prevLibraries.current) {\n console.warn('Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables');\n }\n prevLibraries.current = libraries;\n }, [libraries]);\n return { isLoaded: isLoaded, loadError: loadError };\n}\n\nvar eventMap$h = {};\nvar updaterMap$h = {\n options: function (instance, options) {\n instance.setOptions(options);\n },\n};\nfunction TrafficLayerFunctional(_a) {\n var options = _a.options, onLoad = _a.onLoad, onUnmount = _a.onUnmount;\n var map = useContext(MapContext);\n var _b = useState(null), instance = _b[0], setInstance = _b[1];\n // Order does matter\n useEffect(function () {\n if (instance !== null) {\n instance.setMap(map);\n }\n }, [map]);\n useEffect(function () {\n if (options && instance !== null) {\n instance.setOptions(options);\n }\n }, [instance, options]);\n useEffect(function () {\n var trafficLayer = new google.maps.TrafficLayer(__assign(__assign({}, (options || {})), { map: map }));\n setInstance(trafficLayer);\n if (onLoad) {\n onLoad(trafficLayer);\n }\n return function () {\n if (instance !== null) {\n if (onUnmount) {\n onUnmount(instance);\n }\n instance.setMap(null);\n }\n };\n }, []);\n return null;\n}\nvar TrafficLayerF = memo(TrafficLayerFunctional);\nvar TrafficLayer = /** @class */ (function (_super) {\n __extends(TrafficLayer, _super);\n function TrafficLayer() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.state = {\n trafficLayer: null,\n };\n _this.setTrafficLayerCallback = function () {\n if (_this.state.trafficLayer !== null && _this.props.onLoad) {\n _this.props.onLoad(_this.state.trafficLayer);\n }\n };\n _this.registeredEvents = [];\n return _this;\n }\n TrafficLayer.prototype.componentDidMount = function () {\n var trafficLayer = new google.maps.TrafficLayer(__assign(__assign({}, (this.props.options || {})), { map: this.context }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$h,\n eventMap: eventMap$h,\n prevProps: {},\n nextProps: this.props,\n instance: trafficLayer,\n });\n this.setState(function setTrafficLayer() {\n return {\n trafficLayer: trafficLayer,\n };\n }, this.setTrafficLayerCallback);\n };\n TrafficLayer.prototype.componentDidUpdate = function (prevProps) {\n if (this.state.trafficLayer !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$h,\n eventMap: eventMap$h,\n prevProps: prevProps,\n nextProps: this.props,\n instance: this.state.trafficLayer,\n });\n }\n };\n TrafficLayer.prototype.componentWillUnmount = function () {\n if (this.state.trafficLayer !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.trafficLayer);\n }\n unregisterEvents(this.registeredEvents);\n this.state.trafficLayer.setMap(null);\n }\n };\n TrafficLayer.prototype.render = function () {\n return null;\n };\n TrafficLayer.contextType = MapContext;\n return TrafficLayer;\n}(PureComponent));\n\nfunction BicyclingLayerFunctional(_a) {\n var onLoad = _a.onLoad, onUnmount = _a.onUnmount;\n var map = useContext(MapContext);\n var _b = useState(null), instance = _b[0], setInstance = _b[1];\n // Order does matter\n useEffect(function () {\n if (instance !== null) {\n instance.setMap(map);\n }\n }, [map]);\n useEffect(function () {\n var bicyclingLayer = new google.maps.BicyclingLayer();\n setInstance(bicyclingLayer);\n bicyclingLayer.setMap(map);\n if (onLoad) {\n onLoad(bicyclingLayer);\n }\n return function () {\n if (bicyclingLayer !== null) {\n if (onUnmount) {\n onUnmount(bicyclingLayer);\n }\n bicyclingLayer.setMap(null);\n }\n };\n }, []);\n return null;\n}\nvar BicyclingLayerF = memo(BicyclingLayerFunctional);\nvar BicyclingLayer = /** @class */ (function (_super) {\n __extends(BicyclingLayer, _super);\n function BicyclingLayer() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.state = {\n bicyclingLayer: null,\n };\n _this.setBicyclingLayerCallback = function () {\n if (_this.state.bicyclingLayer !== null) {\n _this.state.bicyclingLayer.setMap(_this.context);\n if (_this.props.onLoad) {\n _this.props.onLoad(_this.state.bicyclingLayer);\n }\n }\n };\n return _this;\n }\n BicyclingLayer.prototype.componentDidMount = function () {\n var bicyclingLayer = new google.maps.BicyclingLayer();\n this.setState(function () {\n return {\n bicyclingLayer: bicyclingLayer,\n };\n }, this.setBicyclingLayerCallback);\n };\n BicyclingLayer.prototype.componentWillUnmount = function () {\n if (this.state.bicyclingLayer !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.bicyclingLayer);\n }\n this.state.bicyclingLayer.setMap(null);\n }\n };\n BicyclingLayer.prototype.render = function () {\n return null;\n };\n BicyclingLayer.contextType = MapContext;\n return BicyclingLayer;\n}(PureComponent));\n\nfunction TransitLayerFunctional(_a) {\n var onLoad = _a.onLoad, onUnmount = _a.onUnmount;\n var map = useContext(MapContext);\n var _b = useState(null), instance = _b[0], setInstance = _b[1];\n // Order does matter\n useEffect(function () {\n if (instance !== null) {\n instance.setMap(map);\n }\n }, [map]);\n useEffect(function () {\n var transitLayer = new google.maps.TransitLayer();\n setInstance(transitLayer);\n transitLayer.setMap(map);\n if (onLoad) {\n onLoad(transitLayer);\n }\n return function () {\n if (instance !== null) {\n if (onUnmount) {\n onUnmount(instance);\n }\n instance.setMap(null);\n }\n };\n }, []);\n return null;\n}\nvar TransitLayerF = memo(TransitLayerFunctional);\nvar TransitLayer = /** @class */ (function (_super) {\n __extends(TransitLayer, _super);\n function TransitLayer() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.state = {\n transitLayer: null,\n };\n _this.setTransitLayerCallback = function () {\n if (_this.state.transitLayer !== null) {\n _this.state.transitLayer.setMap(_this.context);\n if (_this.props.onLoad) {\n _this.props.onLoad(_this.state.transitLayer);\n }\n }\n };\n return _this;\n }\n TransitLayer.prototype.componentDidMount = function () {\n var transitLayer = new google.maps.TransitLayer();\n this.setState(function setTransitLayer() {\n return {\n transitLayer: transitLayer,\n };\n }, this.setTransitLayerCallback);\n };\n TransitLayer.prototype.componentWillUnmount = function () {\n if (this.state.transitLayer !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.transitLayer);\n }\n this.state.transitLayer.setMap(null);\n }\n };\n TransitLayer.prototype.render = function () {\n return null;\n };\n TransitLayer.contextType = MapContext;\n return TransitLayer;\n}(PureComponent));\n\nvar eventMap$g = {\n onCircleComplete: 'circlecomplete',\n onMarkerComplete: 'markercomplete',\n onOverlayComplete: 'overlaycomplete',\n onPolygonComplete: 'polygoncomplete',\n onPolylineComplete: 'polylinecomplete',\n onRectangleComplete: 'rectanglecomplete',\n};\nvar updaterMap$g = {\n drawingMode: function (instance, drawingMode) {\n instance.setDrawingMode(drawingMode);\n },\n options: function (instance, options) {\n instance.setOptions(options);\n },\n};\nfunction DrawingManagerFunctional(_a) {\n var options = _a.options, drawingMode = _a.drawingMode, onCircleComplete = _a.onCircleComplete, onMarkerComplete = _a.onMarkerComplete, onOverlayComplete = _a.onOverlayComplete, onPolygonComplete = _a.onPolygonComplete, onPolylineComplete = _a.onPolylineComplete, onRectangleComplete = _a.onRectangleComplete, onLoad = _a.onLoad, onUnmount = _a.onUnmount;\n var map = useContext(MapContext);\n var _b = useState(null), instance = _b[0], setInstance = _b[1];\n var _c = useState(null), circlecompleteListener = _c[0], setCircleCompleteListener = _c[1];\n var _d = useState(null), markercompleteListener = _d[0], setMarkerCompleteListener = _d[1];\n var _e = useState(null), overlaycompleteListener = _e[0], setOverlayCompleteListener = _e[1];\n var _f = useState(null), polygoncompleteListener = _f[0], setPolygonCompleteListener = _f[1];\n var _g = useState(null), polylinecompleteListener = _g[0], setPolylineCompleteListener = _g[1];\n var _h = useState(null), rectanglecompleteListener = _h[0], setRectangleCompleteListener = _h[1];\n // Order does matter\n useEffect(function () {\n if (instance !== null) {\n instance.setMap(map);\n }\n }, [map]);\n useEffect(function () {\n if (options && instance !== null) {\n instance.setOptions(options);\n }\n }, [instance, options]);\n useEffect(function () {\n if (instance !== null) {\n instance.setDrawingMode(drawingMode !== null && drawingMode !== void 0 ? drawingMode : null);\n }\n }, [instance, drawingMode]);\n useEffect(function () {\n if (instance && onCircleComplete) {\n if (circlecompleteListener !== null) {\n google.maps.event.removeListener(circlecompleteListener);\n }\n setCircleCompleteListener(google.maps.event.addListener(instance, 'circlecomplete', onCircleComplete));\n }\n }, [instance, onCircleComplete]);\n useEffect(function () {\n if (instance && onMarkerComplete) {\n if (markercompleteListener !== null) {\n google.maps.event.removeListener(markercompleteListener);\n }\n setMarkerCompleteListener(google.maps.event.addListener(instance, 'markercomplete', onMarkerComplete));\n }\n }, [instance, onMarkerComplete]);\n useEffect(function () {\n if (instance && onOverlayComplete) {\n if (overlaycompleteListener !== null) {\n google.maps.event.removeListener(overlaycompleteListener);\n }\n setOverlayCompleteListener(google.maps.event.addListener(instance, 'overlaycomplete', onOverlayComplete));\n }\n }, [instance, onOverlayComplete]);\n useEffect(function () {\n if (instance && onPolygonComplete) {\n if (polygoncompleteListener !== null) {\n google.maps.event.removeListener(polygoncompleteListener);\n }\n setPolygonCompleteListener(google.maps.event.addListener(instance, 'polygoncomplete', onPolygonComplete));\n }\n }, [instance, onPolygonComplete]);\n useEffect(function () {\n if (instance && onPolylineComplete) {\n if (polylinecompleteListener !== null) {\n google.maps.event.removeListener(polylinecompleteListener);\n }\n setPolylineCompleteListener(google.maps.event.addListener(instance, 'polylinecomplete', onPolylineComplete));\n }\n }, [instance, onPolylineComplete]);\n useEffect(function () {\n if (instance && onRectangleComplete) {\n if (rectanglecompleteListener !== null) {\n google.maps.event.removeListener(rectanglecompleteListener);\n }\n setRectangleCompleteListener(google.maps.event.addListener(instance, 'rectanglecomplete', onRectangleComplete));\n }\n }, [instance, onRectangleComplete]);\n useEffect(function () {\n invariant$1(!!google.maps.drawing, \"Did you include prop libraries={['drawing']} in the URL? %s\", google.maps.drawing);\n var drawingManager = new google.maps.drawing.DrawingManager(__assign(__assign({}, (options || {})), { map: map }));\n if (drawingMode) {\n drawingManager.setDrawingMode(drawingMode);\n }\n if (onCircleComplete) {\n setCircleCompleteListener(google.maps.event.addListener(drawingManager, 'circlecomplete', onCircleComplete));\n }\n if (onMarkerComplete) {\n setMarkerCompleteListener(google.maps.event.addListener(drawingManager, 'markercomplete', onMarkerComplete));\n }\n if (onOverlayComplete) {\n setOverlayCompleteListener(google.maps.event.addListener(drawingManager, 'overlaycomplete', onOverlayComplete));\n }\n if (onPolygonComplete) {\n setPolygonCompleteListener(google.maps.event.addListener(drawingManager, 'polygoncomplete', onPolygonComplete));\n }\n if (onPolylineComplete) {\n setPolylineCompleteListener(google.maps.event.addListener(drawingManager, 'polylinecomplete', onPolylineComplete));\n }\n if (onRectangleComplete) {\n setRectangleCompleteListener(google.maps.event.addListener(drawingManager, 'rectanglecomplete', onRectangleComplete));\n }\n setInstance(drawingManager);\n if (onLoad) {\n onLoad(drawingManager);\n }\n return function () {\n if (instance !== null) {\n if (circlecompleteListener) {\n google.maps.event.removeListener(circlecompleteListener);\n }\n if (markercompleteListener) {\n google.maps.event.removeListener(markercompleteListener);\n }\n if (overlaycompleteListener) {\n google.maps.event.removeListener(overlaycompleteListener);\n }\n if (polygoncompleteListener) {\n google.maps.event.removeListener(polygoncompleteListener);\n }\n if (polylinecompleteListener) {\n google.maps.event.removeListener(polylinecompleteListener);\n }\n if (rectanglecompleteListener) {\n google.maps.event.removeListener(rectanglecompleteListener);\n }\n if (onUnmount) {\n onUnmount(instance);\n }\n instance.setMap(null);\n }\n };\n }, []);\n return null;\n}\nvar DrawingManagerF = memo(DrawingManagerFunctional);\nvar DrawingManager = /** @class */ (function (_super) {\n __extends(DrawingManager, _super);\n function DrawingManager(props) {\n var _this = _super.call(this, props) || this;\n _this.registeredEvents = [];\n _this.state = {\n drawingManager: null,\n };\n _this.setDrawingManagerCallback = function () {\n if (_this.state.drawingManager !== null && _this.props.onLoad) {\n _this.props.onLoad(_this.state.drawingManager);\n }\n };\n invariant$1(!!google.maps.drawing, \"Did you include prop libraries={['drawing']} in the URL? %s\", google.maps.drawing);\n return _this;\n }\n DrawingManager.prototype.componentDidMount = function () {\n var drawingManager = new google.maps.drawing.DrawingManager(__assign(__assign({}, (this.props.options || {})), { map: this.context }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$g,\n eventMap: eventMap$g,\n prevProps: {},\n nextProps: this.props,\n instance: drawingManager,\n });\n this.setState(function setDrawingManager() {\n return {\n drawingManager: drawingManager,\n };\n }, this.setDrawingManagerCallback);\n };\n DrawingManager.prototype.componentDidUpdate = function (prevProps) {\n if (this.state.drawingManager !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$g,\n eventMap: eventMap$g,\n prevProps: prevProps,\n nextProps: this.props,\n instance: this.state.drawingManager,\n });\n }\n };\n DrawingManager.prototype.componentWillUnmount = function () {\n if (this.state.drawingManager !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.drawingManager);\n }\n unregisterEvents(this.registeredEvents);\n this.state.drawingManager.setMap(null);\n }\n };\n DrawingManager.prototype.render = function () {\n return null;\n };\n DrawingManager.contextType = MapContext;\n return DrawingManager;\n}(PureComponent));\n\nvar eventMap$f = {\n onAnimationChanged: 'animation_changed',\n onClick: 'click',\n onClickableChanged: 'clickable_changed',\n onCursorChanged: 'cursor_changed',\n onDblClick: 'dblclick',\n onDrag: 'drag',\n onDragEnd: 'dragend',\n onDraggableChanged: 'draggable_changed',\n onDragStart: 'dragstart',\n onFlatChanged: 'flat_changed',\n onIconChanged: 'icon_changed',\n onMouseDown: 'mousedown',\n onMouseOut: 'mouseout',\n onMouseOver: 'mouseover',\n onMouseUp: 'mouseup',\n onPositionChanged: 'position_changed',\n onRightClick: 'rightclick',\n onShapeChanged: 'shape_changed',\n onTitleChanged: 'title_changed',\n onVisibleChanged: 'visible_changed',\n onZindexChanged: 'zindex_changed',\n};\nvar updaterMap$f = {\n animation: function (instance, animation) {\n instance.setAnimation(animation);\n },\n clickable: function (instance, clickable) {\n instance.setClickable(clickable);\n },\n cursor: function (instance, cursor) {\n instance.setCursor(cursor);\n },\n draggable: function (instance, draggable) {\n instance.setDraggable(draggable);\n },\n icon: function (instance, icon) {\n instance.setIcon(icon);\n },\n label: function (instance, label) {\n instance.setLabel(label);\n },\n map: function (instance, map) {\n instance.setMap(map);\n },\n opacity: function (instance, opacity) {\n instance.setOpacity(opacity);\n },\n options: function (instance, options) {\n instance.setOptions(options);\n },\n position: function (instance, position) {\n instance.setPosition(position);\n },\n shape: function (instance, shape) {\n instance.setShape(shape);\n },\n title: function (instance, title) {\n instance.setTitle(title);\n },\n visible: function (instance, visible) {\n instance.setVisible(visible);\n },\n zIndex: function (instance, zIndex) {\n instance.setZIndex(zIndex);\n },\n};\nvar defaultOptions$5 = {};\nfunction MarkerFunctional(_a) {\n var position = _a.position, options = _a.options, clusterer = _a.clusterer, noClustererRedraw = _a.noClustererRedraw, children = _a.children, draggable = _a.draggable, visible = _a.visible, animation = _a.animation, clickable = _a.clickable, cursor = _a.cursor, icon = _a.icon, label = _a.label, opacity = _a.opacity, shape = _a.shape, title = _a.title, zIndex = _a.zIndex, onClick = _a.onClick, onDblClick = _a.onDblClick, onDrag = _a.onDrag, onDragEnd = _a.onDragEnd, onDragStart = _a.onDragStart, onMouseOut = _a.onMouseOut, onMouseOver = _a.onMouseOver, onMouseUp = _a.onMouseUp, onMouseDown = _a.onMouseDown, onRightClick = _a.onRightClick, onClickableChanged = _a.onClickableChanged, onCursorChanged = _a.onCursorChanged, onAnimationChanged = _a.onAnimationChanged, onDraggableChanged = _a.onDraggableChanged, onFlatChanged = _a.onFlatChanged, onIconChanged = _a.onIconChanged, onPositionChanged = _a.onPositionChanged, onShapeChanged = _a.onShapeChanged, onTitleChanged = _a.onTitleChanged, onVisibleChanged = _a.onVisibleChanged, onZindexChanged = _a.onZindexChanged, onLoad = _a.onLoad, onUnmount = _a.onUnmount;\n var map = useContext(MapContext);\n var _b = useState(null), instance = _b[0], setInstance = _b[1];\n var _c = useState(null), dblclickListener = _c[0], setDblclickListener = _c[1];\n var _d = useState(null), dragendListener = _d[0], setDragendListener = _d[1];\n var _e = useState(null), dragstartListener = _e[0], setDragstartListener = _e[1];\n var _f = useState(null), mousedownListener = _f[0], setMousedownListener = _f[1];\n var _g = useState(null), mouseoutListener = _g[0], setMouseoutListener = _g[1];\n var _h = useState(null), mouseoverListener = _h[0], setMouseoverListener = _h[1];\n var _j = useState(null), mouseupListener = _j[0], setMouseupListener = _j[1];\n var _k = useState(null), rightclickListener = _k[0], setRightclickListener = _k[1];\n var _l = useState(null), clickListener = _l[0], setClickListener = _l[1];\n var _m = useState(null), dragListener = _m[0], setDragListener = _m[1];\n var _o = useState(null), clickableChangedListener = _o[0], setClickableChangedListener = _o[1];\n var _p = useState(null), cursorChangedListener = _p[0], setCursorChangedListener = _p[1];\n var _q = useState(null), animationChangedListener = _q[0], setAnimationChangedListener = _q[1];\n var _r = useState(null), draggableChangedListener = _r[0], setDraggableChangedListener = _r[1];\n var _s = useState(null), flatChangedListener = _s[0], setFlatChangedListener = _s[1];\n var _t = useState(null), iconChangedListener = _t[0], setIconChangedListener = _t[1];\n var _u = useState(null), positionChangedListener = _u[0], setPositionChangedListener = _u[1];\n var _v = useState(null), shapeChangedListener = _v[0], setShapeChangedListener = _v[1];\n var _w = useState(null), titleChangedListener = _w[0], setTitleChangedListener = _w[1];\n var _x = useState(null), visibleChangedListener = _x[0], setVisibleChangedListener = _x[1];\n var _y = useState(null), zIndexChangedListener = _y[0], setZindexChangedListener = _y[1];\n // Order does matter\n useEffect(function () {\n if (instance !== null) {\n instance.setMap(map);\n }\n }, [map]);\n useEffect(function () {\n if (typeof options !== 'undefined' && instance !== null) {\n instance.setOptions(options);\n }\n }, [instance, options]);\n useEffect(function () {\n if (typeof draggable !== 'undefined' && instance !== null) {\n instance.setDraggable(draggable);\n }\n }, [instance, draggable]);\n useEffect(function () {\n if (position && instance !== null) {\n instance.setPosition(position);\n }\n }, [instance, position]);\n useEffect(function () {\n if (typeof visible !== 'undefined' && instance !== null) {\n instance.setVisible(visible);\n }\n }, [instance, visible]);\n useEffect(function () {\n instance === null || instance === void 0 ? void 0 : instance.setAnimation(animation);\n }, [instance, animation]);\n useEffect(function () {\n if (instance && clickable !== undefined) {\n instance.setClickable(clickable);\n }\n }, [instance, clickable]);\n useEffect(function () {\n if (instance && cursor !== undefined) {\n instance.setCursor(cursor);\n }\n }, [instance, cursor]);\n useEffect(function () {\n if (instance && icon !== undefined) {\n instance.setIcon(icon);\n }\n }, [instance, icon]);\n useEffect(function () {\n if (instance && label !== undefined) {\n instance.setLabel(label);\n }\n }, [instance, label]);\n useEffect(function () {\n if (instance && opacity !== undefined) {\n instance.setOpacity(opacity);\n }\n }, [instance, opacity]);\n useEffect(function () {\n if (instance && shape !== undefined) {\n instance.setShape(shape);\n }\n }, [instance, shape]);\n useEffect(function () {\n if (instance && title !== undefined) {\n instance.setTitle(title);\n }\n }, [instance, title]);\n useEffect(function () {\n if (instance && zIndex !== undefined) {\n instance.setZIndex(zIndex);\n }\n }, [instance, zIndex]);\n useEffect(function () {\n if (instance && onDblClick) {\n if (dblclickListener !== null) {\n google.maps.event.removeListener(dblclickListener);\n }\n setDblclickListener(google.maps.event.addListener(instance, 'dblclick', onDblClick));\n }\n }, [onDblClick]);\n useEffect(function () {\n if (instance && onDragEnd) {\n if (dragendListener !== null) {\n google.maps.event.removeListener(dragendListener);\n }\n setDragendListener(google.maps.event.addListener(instance, 'dragend', onDragEnd));\n }\n }, [onDragEnd]);\n useEffect(function () {\n if (instance && onDragStart) {\n if (dragstartListener !== null) {\n google.maps.event.removeListener(dragstartListener);\n }\n setDragstartListener(google.maps.event.addListener(instance, 'dragstart', onDragStart));\n }\n }, [onDragStart]);\n useEffect(function () {\n if (instance && onMouseDown) {\n if (mousedownListener !== null) {\n google.maps.event.removeListener(mousedownListener);\n }\n setMousedownListener(google.maps.event.addListener(instance, 'mousedown', onMouseDown));\n }\n }, [onMouseDown]);\n useEffect(function () {\n if (instance && onMouseOut) {\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n setMouseoutListener(google.maps.event.addListener(instance, 'mouseout', onMouseOut));\n }\n }, [onMouseOut]);\n useEffect(function () {\n if (instance && onMouseOver) {\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n setMouseoverListener(google.maps.event.addListener(instance, 'mouseover', onMouseOver));\n }\n }, [onMouseOver]);\n useEffect(function () {\n if (instance && onMouseUp) {\n if (mouseupListener !== null) {\n google.maps.event.removeListener(mouseupListener);\n }\n setMouseupListener(google.maps.event.addListener(instance, 'mouseup', onMouseUp));\n }\n }, [onMouseUp]);\n useEffect(function () {\n if (instance && onRightClick) {\n if (rightclickListener !== null) {\n google.maps.event.removeListener(rightclickListener);\n }\n setRightclickListener(google.maps.event.addListener(instance, 'rightclick', onRightClick));\n }\n }, [onRightClick]);\n useEffect(function () {\n if (instance && onClick) {\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n setClickListener(google.maps.event.addListener(instance, 'click', onClick));\n }\n }, [onClick]);\n useEffect(function () {\n if (instance && onDrag) {\n if (dragListener !== null) {\n google.maps.event.removeListener(dragListener);\n }\n setDragListener(google.maps.event.addListener(instance, 'drag', onDrag));\n }\n }, [onDrag]);\n useEffect(function () {\n if (instance && onClickableChanged) {\n if (clickableChangedListener !== null) {\n google.maps.event.removeListener(clickableChangedListener);\n }\n setClickableChangedListener(google.maps.event.addListener(instance, 'clickable_changed', onClickableChanged));\n }\n }, [onClickableChanged]);\n useEffect(function () {\n if (instance && onCursorChanged) {\n if (cursorChangedListener !== null) {\n google.maps.event.removeListener(cursorChangedListener);\n }\n setCursorChangedListener(google.maps.event.addListener(instance, 'cursor_changed', onCursorChanged));\n }\n }, [onCursorChanged]);\n useEffect(function () {\n if (instance && onAnimationChanged) {\n if (animationChangedListener !== null) {\n google.maps.event.removeListener(animationChangedListener);\n }\n setAnimationChangedListener(google.maps.event.addListener(instance, 'animation_changed', onAnimationChanged));\n }\n }, [onAnimationChanged]);\n useEffect(function () {\n if (instance && onDraggableChanged) {\n if (draggableChangedListener !== null) {\n google.maps.event.removeListener(draggableChangedListener);\n }\n setDraggableChangedListener(google.maps.event.addListener(instance, 'draggable_changed', onDraggableChanged));\n }\n }, [onDraggableChanged]);\n useEffect(function () {\n if (instance && onFlatChanged) {\n if (flatChangedListener !== null) {\n google.maps.event.removeListener(flatChangedListener);\n }\n setFlatChangedListener(google.maps.event.addListener(instance, 'flat_changed', onFlatChanged));\n }\n }, [onFlatChanged]);\n useEffect(function () {\n if (instance && onIconChanged) {\n if (iconChangedListener !== null) {\n google.maps.event.removeListener(iconChangedListener);\n }\n setIconChangedListener(google.maps.event.addListener(instance, 'icon_changed', onIconChanged));\n }\n }, [onIconChanged]);\n useEffect(function () {\n if (instance && onPositionChanged) {\n if (positionChangedListener !== null) {\n google.maps.event.removeListener(positionChangedListener);\n }\n setPositionChangedListener(google.maps.event.addListener(instance, 'position_changed', onPositionChanged));\n }\n }, [onPositionChanged]);\n useEffect(function () {\n if (instance && onShapeChanged) {\n if (shapeChangedListener !== null) {\n google.maps.event.removeListener(shapeChangedListener);\n }\n setShapeChangedListener(google.maps.event.addListener(instance, 'shape_changed', onShapeChanged));\n }\n }, [onShapeChanged]);\n useEffect(function () {\n if (instance && onTitleChanged) {\n if (titleChangedListener !== null) {\n google.maps.event.removeListener(titleChangedListener);\n }\n setTitleChangedListener(google.maps.event.addListener(instance, 'title_changed', onTitleChanged));\n }\n }, [onTitleChanged]);\n useEffect(function () {\n if (instance && onVisibleChanged) {\n if (visibleChangedListener !== null) {\n google.maps.event.removeListener(visibleChangedListener);\n }\n setVisibleChangedListener(google.maps.event.addListener(instance, 'visible_changed', onVisibleChanged));\n }\n }, [onVisibleChanged]);\n useEffect(function () {\n if (instance && onZindexChanged) {\n if (zIndexChangedListener !== null) {\n google.maps.event.removeListener(zIndexChangedListener);\n }\n setZindexChangedListener(google.maps.event.addListener(instance, 'zindex_changed', onZindexChanged));\n }\n }, [onZindexChanged]);\n useEffect(function () {\n var markerOptions = __assign(__assign(__assign({}, (options || defaultOptions$5)), (clusterer ? defaultOptions$5 : { map: map })), { position: position });\n var marker = new google.maps.Marker(markerOptions);\n if (clusterer) {\n clusterer.addMarker(marker, !!noClustererRedraw);\n }\n else {\n marker.setMap(map);\n }\n if (position) {\n marker.setPosition(position);\n }\n if (typeof visible !== 'undefined') {\n marker.setVisible(visible);\n }\n if (typeof draggable !== 'undefined') {\n marker.setDraggable(draggable);\n }\n if (typeof clickable !== 'undefined') {\n marker.setClickable(clickable);\n }\n if (typeof cursor === 'string') {\n marker.setCursor(cursor);\n }\n if (icon) {\n marker.setIcon(icon);\n }\n if (typeof label !== 'undefined') {\n marker.setLabel(label);\n }\n if (typeof opacity !== 'undefined') {\n marker.setOpacity(opacity);\n }\n if (shape) {\n marker.setShape(shape);\n }\n if (typeof title === 'string') {\n marker.setTitle(title);\n }\n if (typeof zIndex === 'number') {\n marker.setZIndex(zIndex);\n }\n if (onDblClick) {\n setDblclickListener(google.maps.event.addListener(marker, 'dblclick', onDblClick));\n }\n if (onDragEnd) {\n setDragendListener(google.maps.event.addListener(marker, 'dragend', onDragEnd));\n }\n if (onDragStart) {\n setDragstartListener(google.maps.event.addListener(marker, 'dragstart', onDragStart));\n }\n if (onMouseDown) {\n setMousedownListener(google.maps.event.addListener(marker, 'mousedown', onMouseDown));\n }\n if (onMouseOut) {\n setMouseoutListener(google.maps.event.addListener(marker, 'mouseout', onMouseOut));\n }\n if (onMouseOver) {\n setMouseoverListener(google.maps.event.addListener(marker, 'mouseover', onMouseOver));\n }\n if (onMouseUp) {\n setMouseupListener(google.maps.event.addListener(marker, 'mouseup', onMouseUp));\n }\n if (onRightClick) {\n setRightclickListener(google.maps.event.addListener(marker, 'rightclick', onRightClick));\n }\n if (onClick) {\n setClickListener(google.maps.event.addListener(marker, 'click', onClick));\n }\n if (onDrag) {\n setDragListener(google.maps.event.addListener(marker, 'drag', onDrag));\n }\n if (onClickableChanged) {\n setClickableChangedListener(google.maps.event.addListener(marker, 'clickable_changed', onClickableChanged));\n }\n if (onCursorChanged) {\n setCursorChangedListener(google.maps.event.addListener(marker, 'cursor_changed', onCursorChanged));\n }\n if (onAnimationChanged) {\n setAnimationChangedListener(google.maps.event.addListener(marker, 'animation_changed', onAnimationChanged));\n }\n if (onDraggableChanged) {\n setDraggableChangedListener(google.maps.event.addListener(marker, 'draggable_changed', onDraggableChanged));\n }\n if (onFlatChanged) {\n setFlatChangedListener(google.maps.event.addListener(marker, 'flat_changed', onFlatChanged));\n }\n if (onIconChanged) {\n setIconChangedListener(google.maps.event.addListener(marker, 'icon_changed', onIconChanged));\n }\n if (onPositionChanged) {\n setPositionChangedListener(google.maps.event.addListener(marker, 'position_changed', onPositionChanged));\n }\n if (onShapeChanged) {\n setShapeChangedListener(google.maps.event.addListener(marker, 'shape_changed', onShapeChanged));\n }\n if (onTitleChanged) {\n setTitleChangedListener(google.maps.event.addListener(marker, 'title_changed', onTitleChanged));\n }\n if (onVisibleChanged) {\n setVisibleChangedListener(google.maps.event.addListener(marker, 'visible_changed', onVisibleChanged));\n }\n if (onZindexChanged) {\n setZindexChangedListener(google.maps.event.addListener(marker, 'zindex_changed', onZindexChanged));\n }\n setInstance(marker);\n if (onLoad) {\n onLoad(marker);\n }\n return function () {\n if (dblclickListener !== null) {\n google.maps.event.removeListener(dblclickListener);\n }\n if (dragendListener !== null) {\n google.maps.event.removeListener(dragendListener);\n }\n if (dragstartListener !== null) {\n google.maps.event.removeListener(dragstartListener);\n }\n if (mousedownListener !== null) {\n google.maps.event.removeListener(mousedownListener);\n }\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n if (mouseupListener !== null) {\n google.maps.event.removeListener(mouseupListener);\n }\n if (rightclickListener !== null) {\n google.maps.event.removeListener(rightclickListener);\n }\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n if (clickableChangedListener !== null) {\n google.maps.event.removeListener(clickableChangedListener);\n }\n if (cursorChangedListener !== null) {\n google.maps.event.removeListener(cursorChangedListener);\n }\n if (animationChangedListener !== null) {\n google.maps.event.removeListener(animationChangedListener);\n }\n if (draggableChangedListener !== null) {\n google.maps.event.removeListener(draggableChangedListener);\n }\n if (flatChangedListener !== null) {\n google.maps.event.removeListener(flatChangedListener);\n }\n if (iconChangedListener !== null) {\n google.maps.event.removeListener(iconChangedListener);\n }\n if (positionChangedListener !== null) {\n google.maps.event.removeListener(positionChangedListener);\n }\n if (titleChangedListener !== null) {\n google.maps.event.removeListener(titleChangedListener);\n }\n if (visibleChangedListener !== null) {\n google.maps.event.removeListener(visibleChangedListener);\n }\n if (zIndexChangedListener !== null) {\n google.maps.event.removeListener(zIndexChangedListener);\n }\n if (onUnmount) {\n onUnmount(marker);\n }\n if (clusterer) {\n clusterer.removeMarker(marker, !!noClustererRedraw);\n }\n else if (marker) {\n marker.setMap(null);\n }\n };\n }, []);\n var chx = useMemo(function () {\n return children\n ? Children.map(children, function (child) {\n if (!isValidElement(child)) {\n return child;\n }\n var elementChild = child;\n return cloneElement(elementChild, { anchor: instance });\n })\n : null;\n }, [children, instance]);\n return jsx(Fragment, { children: chx }) || null;\n}\nvar MarkerF = memo(MarkerFunctional);\nvar Marker = /** @class */ (function (_super) {\n __extends(Marker, _super);\n function Marker() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.registeredEvents = [];\n return _this;\n }\n Marker.prototype.componentDidMount = function () {\n var markerOptions = __assign(__assign(__assign({}, (this.props.options || defaultOptions$5)), (this.props.clusterer ? defaultOptions$5 : { map: this.context })), { position: this.props.position });\n // Unfortunately we can't just do this in the contstructor, because the\n // `MapContext` might not be filled in yet.\n this.marker = new google.maps.Marker(markerOptions);\n if (this.props.clusterer) {\n this.props.clusterer.addMarker(this.marker, !!this.props.noClustererRedraw);\n }\n else {\n this.marker.setMap(this.context);\n }\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$f,\n eventMap: eventMap$f,\n prevProps: {},\n nextProps: this.props,\n instance: this.marker,\n });\n if (this.props.onLoad) {\n this.props.onLoad(this.marker);\n }\n };\n Marker.prototype.componentDidUpdate = function (prevProps) {\n if (this.marker) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$f,\n eventMap: eventMap$f,\n prevProps: prevProps,\n nextProps: this.props,\n instance: this.marker,\n });\n }\n };\n Marker.prototype.componentWillUnmount = function () {\n if (this.marker) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.marker);\n }\n unregisterEvents(this.registeredEvents);\n if (this.props.clusterer) {\n this.props.clusterer.removeMarker(this.marker, !!this.props.noClustererRedraw);\n }\n else {\n this.marker && this.marker.setMap(null);\n }\n }\n };\n Marker.prototype.render = function () {\n var _this = this;\n var children = null;\n if (this.props.children) {\n children = Children.map(this.props.children, function (child) {\n if (!isValidElement(child)) {\n return child;\n }\n var elementChild = child;\n return cloneElement(elementChild, { anchor: _this.marker });\n });\n }\n return children || null;\n };\n Marker.contextType = MapContext;\n return Marker;\n}(PureComponent));\n\nvar ClusterIcon = /** @class */ (function () {\n function ClusterIcon(cluster, styles) {\n cluster.getClusterer().extend(ClusterIcon, google.maps.OverlayView);\n this.cluster = cluster;\n this.clusterClassName = this.cluster.getClusterer().getClusterClass();\n this.className = this.clusterClassName;\n this.styles = styles;\n this.center = undefined;\n this.div = null;\n this.sums = null;\n this.visible = false;\n this.boundsChangedListener = null;\n this.url = '';\n this.height = 0;\n this.width = 0;\n this.anchorText = [0, 0];\n this.anchorIcon = [0, 0];\n this.textColor = 'black';\n this.textSize = 11;\n this.textDecoration = 'none';\n this.fontWeight = 'bold';\n this.fontStyle = 'normal';\n this.fontFamily = 'Arial,sans-serif';\n this.backgroundPosition = '0 0';\n this.cMouseDownInCluster = null;\n this.cDraggingMapByCluster = null;\n this.timeOut = null;\n this.setMap(cluster.getMap()); // Note: this causes onAdd to be called\n this.onBoundsChanged = this.onBoundsChanged.bind(this);\n this.onMouseDown = this.onMouseDown.bind(this);\n this.onClick = this.onClick.bind(this);\n this.onMouseOver = this.onMouseOver.bind(this);\n this.onMouseOut = this.onMouseOut.bind(this);\n this.onAdd = this.onAdd.bind(this);\n this.onRemove = this.onRemove.bind(this);\n this.draw = this.draw.bind(this);\n this.hide = this.hide.bind(this);\n this.show = this.show.bind(this);\n this.useStyle = this.useStyle.bind(this);\n this.setCenter = this.setCenter.bind(this);\n this.getPosFromLatLng = this.getPosFromLatLng.bind(this);\n }\n ClusterIcon.prototype.onBoundsChanged = function () {\n this.cDraggingMapByCluster = this.cMouseDownInCluster;\n };\n ClusterIcon.prototype.onMouseDown = function () {\n this.cMouseDownInCluster = true;\n this.cDraggingMapByCluster = false;\n };\n ClusterIcon.prototype.onClick = function (event) {\n this.cMouseDownInCluster = false;\n if (!this.cDraggingMapByCluster) {\n var markerClusterer_1 = this.cluster.getClusterer();\n /**\n * This event is fired when a cluster marker is clicked.\n * @name MarkerClusterer#click\n * @param {Cluster} c The cluster that was clicked.\n * @event\n */\n google.maps.event.trigger(markerClusterer_1, 'click', this.cluster);\n google.maps.event.trigger(markerClusterer_1, 'clusterclick', this.cluster); // deprecated name\n // The default click handler follows. Disable it by setting\n // the zoomOnClick property to false.\n if (markerClusterer_1.getZoomOnClick()) {\n // Zoom into the cluster.\n var maxZoom_1 = markerClusterer_1.getMaxZoom();\n var bounds_1 = this.cluster.getBounds();\n var map = markerClusterer_1.getMap();\n if (map !== null && 'fitBounds' in map) {\n map.fitBounds(bounds_1);\n }\n // There is a fix for Issue 170 here:\n this.timeOut = window.setTimeout(function () {\n var map = markerClusterer_1.getMap();\n if (map !== null) {\n if ('fitBounds' in map) {\n map.fitBounds(bounds_1);\n }\n var zoom = map.getZoom() || 0;\n // Don't zoom beyond the max zoom level\n if (maxZoom_1 !== null &&\n zoom > maxZoom_1) {\n map.setZoom(maxZoom_1 + 1);\n }\n }\n }, 100);\n }\n // Prevent event propagation to the map:\n event.cancelBubble = true;\n if (event.stopPropagation) {\n event.stopPropagation();\n }\n }\n };\n ClusterIcon.prototype.onMouseOver = function () {\n /**\n * This event is fired when the mouse moves over a cluster marker.\n * @name MarkerClusterer#mouseover\n * @param {Cluster} c The cluster that the mouse moved over.\n * @event\n */\n google.maps.event.trigger(this.cluster.getClusterer(), 'mouseover', this.cluster);\n };\n ClusterIcon.prototype.onMouseOut = function () {\n /**\n * This event is fired when the mouse moves out of a cluster marker.\n * @name MarkerClusterer#mouseout\n * @param {Cluster} c The cluster that the mouse moved out of.\n * @event\n */\n google.maps.event.trigger(this.cluster.getClusterer(), 'mouseout', this.cluster);\n };\n ClusterIcon.prototype.onAdd = function () {\n var _a;\n this.div = document.createElement('div');\n this.div.className = this.className;\n if (this.visible) {\n this.show();\n }\n (_a = this.getPanes()) === null || _a === void 0 ? void 0 : _a.overlayMouseTarget.appendChild(this.div);\n var map = this.getMap();\n if (map !== null) {\n // Fix for Issue 157\n this.boundsChangedListener = google.maps.event.addListener(map, 'bounds_changed', this.onBoundsChanged);\n this.div.addEventListener('mousedown', this.onMouseDown);\n this.div.addEventListener('click', this.onClick);\n this.div.addEventListener('mouseover', this.onMouseOver);\n this.div.addEventListener('mouseout', this.onMouseOut);\n }\n };\n ClusterIcon.prototype.onRemove = function () {\n if (this.div && this.div.parentNode) {\n this.hide();\n if (this.boundsChangedListener !== null) {\n google.maps.event.removeListener(this.boundsChangedListener);\n }\n this.div.removeEventListener('mousedown', this.onMouseDown);\n this.div.removeEventListener('click', this.onClick);\n this.div.removeEventListener('mouseover', this.onMouseOver);\n this.div.removeEventListener('mouseout', this.onMouseOut);\n this.div.parentNode.removeChild(this.div);\n if (this.timeOut !== null) {\n window.clearTimeout(this.timeOut);\n this.timeOut = null;\n }\n this.div = null;\n }\n };\n ClusterIcon.prototype.draw = function () {\n if (this.visible && this.div !== null && this.center) {\n var pos = this.getPosFromLatLng(this.center);\n this.div.style.top = pos !== null ? \"\".concat(pos.y, \"px\") : '0';\n this.div.style.left = pos !== null ? \"\".concat(pos.x, \"px\") : '0';\n }\n };\n ClusterIcon.prototype.hide = function () {\n if (this.div) {\n this.div.style.display = 'none';\n }\n this.visible = false;\n };\n ClusterIcon.prototype.show = function () {\n var _a, _b, _c, _d, _e, _f;\n if (this.div && this.center) {\n var divTitle = this.sums === null ||\n typeof this.sums.title === 'undefined' ||\n this.sums.title === '' ? this.cluster.getClusterer().getTitle() : this.sums.title;\n // NOTE: values must be specified in px units\n var bp = this.backgroundPosition.split(' ');\n var spriteH = parseInt(((_a = bp[0]) === null || _a === void 0 ? void 0 : _a.replace(/^\\s+|\\s+$/g, '')) || '0', 10);\n var spriteV = parseInt(((_b = bp[1]) === null || _b === void 0 ? void 0 : _b.replace(/^\\s+|\\s+$/g, '')) || '0', 10);\n var pos = this.getPosFromLatLng(this.center);\n this.div.className = this.className;\n this.div.setAttribute('style', \"cursor: pointer; position: absolute; top: \".concat(pos !== null ? \"\".concat(pos.y, \"px\") : '0', \"; left: \").concat(pos !== null ? \"\".concat(pos.x, \"px\") : '0', \"; width: \").concat(this.width, \"px; height: \").concat(this.height, \"px; \"));\n var img = document.createElement('img');\n img.alt = divTitle;\n img.src = this.url;\n img.width = this.width;\n img.height = this.height;\n img.setAttribute('style', \"position: absolute; top: \".concat(spriteV, \"px; left: \").concat(spriteH, \"px\"));\n if (!this.cluster.getClusterer().enableRetinaIcons) {\n img.style.clip = \"rect(-\".concat(spriteV, \"px, -\").concat(spriteH + this.width, \"px, -\").concat(spriteV + this.height, \", -\").concat(spriteH, \")\");\n }\n var textElm = document.createElement('div');\n textElm.setAttribute('style', \"position: absolute; top: \".concat(this.anchorText[0], \"px; left: \").concat(this.anchorText[1], \"px; color: \").concat(this.textColor, \"; font-size: \").concat(this.textSize, \"px; font-family: \").concat(this.fontFamily, \"; font-weight: \").concat(this.fontWeight, \"; fontStyle: \").concat(this.fontStyle, \"; text-decoration: \").concat(this.textDecoration, \"; text-align: center; width: \").concat(this.width, \"px; line-height: \").concat(this.height, \"px\"));\n if ((_c = this.sums) === null || _c === void 0 ? void 0 : _c.text)\n textElm.innerText = \"\".concat((_d = this.sums) === null || _d === void 0 ? void 0 : _d.text);\n if ((_e = this.sums) === null || _e === void 0 ? void 0 : _e.html)\n textElm.innerHTML = \"\".concat((_f = this.sums) === null || _f === void 0 ? void 0 : _f.html);\n this.div.innerHTML = '';\n this.div.appendChild(img);\n this.div.appendChild(textElm);\n this.div.title = divTitle;\n this.div.style.display = '';\n }\n this.visible = true;\n };\n ClusterIcon.prototype.useStyle = function (sums) {\n this.sums = sums;\n var styles = this.cluster.getClusterer().getStyles();\n var style = styles[Math.min(styles.length - 1, Math.max(0, sums.index - 1))];\n if (style) {\n this.url = style.url;\n this.height = style.height;\n this.width = style.width;\n if (style.className) {\n this.className = \"\".concat(this.clusterClassName, \" \").concat(style.className);\n }\n this.anchorText = style.anchorText || [0, 0];\n this.anchorIcon = style.anchorIcon || [this.height / 2, this.width / 2];\n this.textColor = style.textColor || 'black';\n this.textSize = style.textSize || 11;\n this.textDecoration = style.textDecoration || 'none';\n this.fontWeight = style.fontWeight || 'bold';\n this.fontStyle = style.fontStyle || 'normal';\n this.fontFamily = style.fontFamily || 'Arial,sans-serif';\n this.backgroundPosition = style.backgroundPosition || '0 0';\n }\n };\n ClusterIcon.prototype.setCenter = function (center) {\n this.center = center;\n };\n ClusterIcon.prototype.getPosFromLatLng = function (latlng) {\n var pos = this.getProjection().fromLatLngToDivPixel(latlng);\n if (pos !== null) {\n pos.x -= this.anchorIcon[1];\n pos.y -= this.anchorIcon[0];\n }\n return pos;\n };\n return ClusterIcon;\n}());\n\n/* global google */\nvar Cluster$1 = /** @class */ (function () {\n function Cluster(markerClusterer) {\n this.markerClusterer = markerClusterer;\n this.map = this.markerClusterer.getMap();\n this.gridSize = this.markerClusterer.getGridSize();\n this.minClusterSize = this.markerClusterer.getMinimumClusterSize();\n this.averageCenter = this.markerClusterer.getAverageCenter();\n this.markers = [];\n this.center = undefined;\n this.bounds = null;\n this.clusterIcon = new ClusterIcon(this, this.markerClusterer.getStyles());\n this.getSize = this.getSize.bind(this);\n this.getMarkers = this.getMarkers.bind(this);\n this.getCenter = this.getCenter.bind(this);\n this.getMap = this.getMap.bind(this);\n this.getClusterer = this.getClusterer.bind(this);\n this.getBounds = this.getBounds.bind(this);\n this.remove = this.remove.bind(this);\n this.addMarker = this.addMarker.bind(this);\n this.isMarkerInClusterBounds = this.isMarkerInClusterBounds.bind(this);\n this.calculateBounds = this.calculateBounds.bind(this);\n this.updateIcon = this.updateIcon.bind(this);\n this.isMarkerAlreadyAdded = this.isMarkerAlreadyAdded.bind(this);\n }\n Cluster.prototype.getSize = function () {\n return this.markers.length;\n };\n Cluster.prototype.getMarkers = function () {\n return this.markers;\n };\n Cluster.prototype.getCenter = function () {\n return this.center;\n };\n Cluster.prototype.getMap = function () {\n return this.map;\n };\n Cluster.prototype.getClusterer = function () {\n return this.markerClusterer;\n };\n Cluster.prototype.getBounds = function () {\n var bounds = new google.maps.LatLngBounds(this.center, this.center);\n var markers = this.getMarkers();\n for (var _i = 0, markers_1 = markers; _i < markers_1.length; _i++) {\n var marker = markers_1[_i];\n var position = marker.getPosition();\n if (position) {\n bounds.extend(position);\n }\n }\n return bounds;\n };\n Cluster.prototype.remove = function () {\n this.clusterIcon.setMap(null);\n this.markers = [];\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n delete this.markers;\n };\n Cluster.prototype.addMarker = function (marker) {\n var _a;\n if (this.isMarkerAlreadyAdded(marker)) {\n return false;\n }\n if (!this.center) {\n var position = marker.getPosition();\n if (position) {\n this.center = position;\n this.calculateBounds();\n }\n }\n else {\n if (this.averageCenter) {\n var position = marker.getPosition();\n if (position) {\n var length_1 = this.markers.length + 1;\n this.center = new google.maps.LatLng((this.center.lat() * (length_1 - 1) + position.lat()) / length_1, (this.center.lng() * (length_1 - 1) + position.lng()) / length_1);\n this.calculateBounds();\n }\n }\n }\n marker.isAdded = true;\n this.markers.push(marker);\n var mCount = this.markers.length;\n var maxZoom = this.markerClusterer.getMaxZoom();\n var zoom = (_a = this.map) === null || _a === void 0 ? void 0 : _a.getZoom();\n if (maxZoom !== null && typeof zoom !== 'undefined' && zoom > maxZoom) {\n // Zoomed in past max zoom, so show the marker.\n if (marker.getMap() !== this.map) {\n marker.setMap(this.map);\n }\n }\n else if (mCount < this.minClusterSize) {\n // Min cluster size not reached so show the marker.\n if (marker.getMap() !== this.map) {\n marker.setMap(this.map);\n }\n }\n else if (mCount === this.minClusterSize) {\n // Hide the markers that were showing.\n for (var _i = 0, _b = this.markers; _i < _b.length; _i++) {\n var markerElement = _b[_i];\n markerElement.setMap(null);\n }\n }\n else {\n marker.setMap(null);\n }\n return true;\n };\n Cluster.prototype.isMarkerInClusterBounds = function (marker) {\n if (this.bounds !== null) {\n var position = marker.getPosition();\n if (position) {\n return this.bounds.contains(position);\n }\n }\n return false;\n };\n Cluster.prototype.calculateBounds = function () {\n this.bounds = this.markerClusterer.getExtendedBounds(new google.maps.LatLngBounds(this.center, this.center));\n };\n Cluster.prototype.updateIcon = function () {\n var _a;\n var mCount = this.markers.length;\n var maxZoom = this.markerClusterer.getMaxZoom();\n var zoom = (_a = this.map) === null || _a === void 0 ? void 0 : _a.getZoom();\n if (maxZoom !== null && typeof zoom !== 'undefined' && zoom > maxZoom) {\n this.clusterIcon.hide();\n return;\n }\n if (mCount < this.minClusterSize) {\n // Min cluster size not yet reached.\n this.clusterIcon.hide();\n return;\n }\n if (this.center) {\n this.clusterIcon.setCenter(this.center);\n }\n this.clusterIcon.useStyle(this.markerClusterer.getCalculator()(this.markers, this.markerClusterer.getStyles().length));\n this.clusterIcon.show();\n };\n Cluster.prototype.isMarkerAlreadyAdded = function (marker) {\n if (this.markers.includes) {\n return this.markers.includes(marker);\n }\n for (var i = 0; i < this.markers.length; i++) {\n if (marker === this.markers[i]) {\n return true;\n }\n }\n return false;\n };\n return Cluster;\n}());\n\n/* global google */\n/**\n * Supports up to 9007199254740991 (Number.MAX_SAFE_INTEGER) markers\n * which is not a problem as max array length is 4294967296 (2**32)\n */\nfunction CALCULATOR(markers, numStyles) {\n var count = markers.length;\n var numberOfDigits = count.toString().length;\n var index = Math.min(numberOfDigits, numStyles);\n return {\n text: count.toString(),\n index: index,\n title: '',\n };\n}\nvar BATCH_SIZE = 2000;\nvar BATCH_SIZE_IE = 500;\nvar IMAGE_PATH = 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m';\nvar IMAGE_EXTENSION = 'png';\nvar IMAGE_SIZES = [53, 56, 66, 78, 90];\nvar CLUSTERER_CLASS = 'cluster';\nvar Clusterer = /** @class */ (function () {\n function Clusterer(map, optMarkers, optOptions) {\n if (optMarkers === void 0) { optMarkers = []; }\n if (optOptions === void 0) { optOptions = {}; }\n this.getMinimumClusterSize = this.getMinimumClusterSize.bind(this);\n this.setMinimumClusterSize = this.setMinimumClusterSize.bind(this);\n this.getEnableRetinaIcons = this.getEnableRetinaIcons.bind(this);\n this.setEnableRetinaIcons = this.setEnableRetinaIcons.bind(this);\n this.addToClosestCluster = this.addToClosestCluster.bind(this);\n this.getImageExtension = this.getImageExtension.bind(this);\n this.setImageExtension = this.setImageExtension.bind(this);\n this.getExtendedBounds = this.getExtendedBounds.bind(this);\n this.getAverageCenter = this.getAverageCenter.bind(this);\n this.setAverageCenter = this.setAverageCenter.bind(this);\n this.getTotalClusters = this.getTotalClusters.bind(this);\n this.fitMapToMarkers = this.fitMapToMarkers.bind(this);\n this.getIgnoreHidden = this.getIgnoreHidden.bind(this);\n this.setIgnoreHidden = this.setIgnoreHidden.bind(this);\n this.getClusterClass = this.getClusterClass.bind(this);\n this.setClusterClass = this.setClusterClass.bind(this);\n this.getTotalMarkers = this.getTotalMarkers.bind(this);\n this.getZoomOnClick = this.getZoomOnClick.bind(this);\n this.setZoomOnClick = this.setZoomOnClick.bind(this);\n this.getBatchSizeIE = this.getBatchSizeIE.bind(this);\n this.setBatchSizeIE = this.setBatchSizeIE.bind(this);\n this.createClusters = this.createClusters.bind(this);\n this.onZoomChanged = this.onZoomChanged.bind(this);\n this.getImageSizes = this.getImageSizes.bind(this);\n this.setImageSizes = this.setImageSizes.bind(this);\n this.getCalculator = this.getCalculator.bind(this);\n this.setCalculator = this.setCalculator.bind(this);\n this.removeMarkers = this.removeMarkers.bind(this);\n this.resetViewport = this.resetViewport.bind(this);\n this.getImagePath = this.getImagePath.bind(this);\n this.setImagePath = this.setImagePath.bind(this);\n this.pushMarkerTo = this.pushMarkerTo.bind(this);\n this.removeMarker = this.removeMarker.bind(this);\n this.clearMarkers = this.clearMarkers.bind(this);\n this.setupStyles = this.setupStyles.bind(this);\n this.getGridSize = this.getGridSize.bind(this);\n this.setGridSize = this.setGridSize.bind(this);\n this.getClusters = this.getClusters.bind(this);\n this.getMaxZoom = this.getMaxZoom.bind(this);\n this.setMaxZoom = this.setMaxZoom.bind(this);\n this.getMarkers = this.getMarkers.bind(this);\n this.addMarkers = this.addMarkers.bind(this);\n this.getStyles = this.getStyles.bind(this);\n this.setStyles = this.setStyles.bind(this);\n this.addMarker = this.addMarker.bind(this);\n this.onRemove = this.onRemove.bind(this);\n this.getTitle = this.getTitle.bind(this);\n this.setTitle = this.setTitle.bind(this);\n this.repaint = this.repaint.bind(this);\n this.onIdle = this.onIdle.bind(this);\n this.redraw = this.redraw.bind(this);\n this.onAdd = this.onAdd.bind(this);\n this.draw = this.draw.bind(this);\n this.extend = this.extend.bind(this);\n this.extend(Clusterer, google.maps.OverlayView);\n this.markers = [];\n this.clusters = [];\n this.listeners = [];\n this.activeMap = null;\n this.ready = false;\n this.gridSize = optOptions.gridSize || 60;\n this.minClusterSize = optOptions.minimumClusterSize || 2;\n this.maxZoom = optOptions.maxZoom || null;\n this.styles = optOptions.styles || [];\n this.title = optOptions.title || '';\n this.zoomOnClick = true;\n if (optOptions.zoomOnClick !== undefined) {\n this.zoomOnClick = optOptions.zoomOnClick;\n }\n this.averageCenter = false;\n if (optOptions.averageCenter !== undefined) {\n this.averageCenter = optOptions.averageCenter;\n }\n this.ignoreHidden = false;\n if (optOptions.ignoreHidden !== undefined) {\n this.ignoreHidden = optOptions.ignoreHidden;\n }\n this.enableRetinaIcons = false;\n if (optOptions.enableRetinaIcons !== undefined) {\n this.enableRetinaIcons = optOptions.enableRetinaIcons;\n }\n this.imagePath = optOptions.imagePath || IMAGE_PATH;\n this.imageExtension = optOptions.imageExtension || IMAGE_EXTENSION;\n this.imageSizes = optOptions.imageSizes || IMAGE_SIZES;\n this.calculator = optOptions.calculator || CALCULATOR;\n this.batchSize = optOptions.batchSize || BATCH_SIZE;\n this.batchSizeIE = optOptions.batchSizeIE || BATCH_SIZE_IE;\n this.clusterClass = optOptions.clusterClass || CLUSTERER_CLASS;\n if (navigator.userAgent.toLowerCase().indexOf('msie') !== -1) {\n // Try to avoid IE timeout when processing a huge number of markers:\n this.batchSize = this.batchSizeIE;\n }\n this.timerRefStatic = null;\n this.setupStyles();\n this.addMarkers(optMarkers, true);\n this.setMap(map); // Note: this causes onAdd to be called\n }\n Clusterer.prototype.onZoomChanged = function () {\n var _a, _b;\n this.resetViewport(false);\n // Workaround for this Google bug: when map is at level 0 and \"-\" of\n // zoom slider is clicked, a \"zoom_changed\" event is fired even though\n // the map doesn't zoom out any further. In this situation, no \"idle\"\n // event is triggered so the cluster markers that have been removed\n // do not get redrawn. Same goes for a zoom in at maxZoom.\n if (((_a = this.getMap()) === null || _a === void 0 ? void 0 : _a.getZoom()) === (this.get('minZoom') || 0) ||\n ((_b = this.getMap()) === null || _b === void 0 ? void 0 : _b.getZoom()) === this.get('maxZoom')) {\n google.maps.event.trigger(this, 'idle');\n }\n };\n Clusterer.prototype.onIdle = function () {\n this.redraw();\n };\n Clusterer.prototype.onAdd = function () {\n var map = this.getMap();\n this.activeMap = map;\n this.ready = true;\n this.repaint();\n if (map !== null) {\n // Add the map event listeners\n this.listeners = [\n google.maps.event.addListener(map, 'zoom_changed', this.onZoomChanged),\n google.maps.event.addListener(map, 'idle', this.onIdle),\n ];\n }\n };\n Clusterer.prototype.onRemove = function () {\n // Put all the managed markers back on the map:\n for (var _i = 0, _a = this.markers; _i < _a.length; _i++) {\n var marker = _a[_i];\n if (marker.getMap() !== this.activeMap) {\n marker.setMap(this.activeMap);\n }\n }\n // Remove all clusters:\n for (var _b = 0, _c = this.clusters; _b < _c.length; _b++) {\n var cluster = _c[_b];\n cluster.remove();\n }\n this.clusters = [];\n // Remove map event listeners:\n for (var _d = 0, _e = this.listeners; _d < _e.length; _d++) {\n var listener = _e[_d];\n google.maps.event.removeListener(listener);\n }\n this.listeners = [];\n this.activeMap = null;\n this.ready = false;\n };\n Clusterer.prototype.draw = function () { return; };\n Clusterer.prototype.getMap = function () { return null; };\n Clusterer.prototype.getPanes = function () { return null; };\n Clusterer.prototype.getProjection = function () {\n return {\n fromContainerPixelToLatLng: function () { return null; },\n fromDivPixelToLatLng: function () { return null; },\n fromLatLngToContainerPixel: function () { return null; },\n fromLatLngToDivPixel: function () { return null; },\n getVisibleRegion: function () { return null; },\n getWorldWidth: function () { return 0; }\n };\n };\n Clusterer.prototype.setMap = function () { return; };\n Clusterer.prototype.addListener = function () {\n return {\n remove: function () { return; }\n };\n };\n Clusterer.prototype.bindTo = function () { return; };\n Clusterer.prototype.get = function () { return; };\n Clusterer.prototype.notify = function () { return; };\n Clusterer.prototype.set = function () { return; };\n Clusterer.prototype.setValues = function () { return; };\n Clusterer.prototype.unbind = function () { return; };\n Clusterer.prototype.unbindAll = function () { return; };\n Clusterer.prototype.setupStyles = function () {\n if (this.styles.length > 0) {\n return;\n }\n for (var i = 0; i < this.imageSizes.length; i++) {\n this.styles.push({\n url: \"\".concat(this.imagePath + (i + 1), \".\").concat(this.imageExtension),\n height: this.imageSizes[i] || 0,\n width: this.imageSizes[i] || 0,\n });\n }\n };\n Clusterer.prototype.fitMapToMarkers = function () {\n var markers = this.getMarkers();\n var bounds = new google.maps.LatLngBounds();\n for (var _i = 0, markers_1 = markers; _i < markers_1.length; _i++) {\n var marker = markers_1[_i];\n var position = marker.getPosition();\n if (position) {\n bounds.extend(position);\n }\n }\n var map = this.getMap();\n if (map !== null && 'fitBounds' in map) {\n map.fitBounds(bounds);\n }\n };\n Clusterer.prototype.getGridSize = function () {\n return this.gridSize;\n };\n Clusterer.prototype.setGridSize = function (gridSize) {\n this.gridSize = gridSize;\n };\n Clusterer.prototype.getMinimumClusterSize = function () {\n return this.minClusterSize;\n };\n Clusterer.prototype.setMinimumClusterSize = function (minimumClusterSize) {\n this.minClusterSize = minimumClusterSize;\n };\n Clusterer.prototype.getMaxZoom = function () {\n return this.maxZoom;\n };\n Clusterer.prototype.setMaxZoom = function (maxZoom) {\n this.maxZoom = maxZoom;\n };\n Clusterer.prototype.getStyles = function () {\n return this.styles;\n };\n Clusterer.prototype.setStyles = function (styles) {\n this.styles = styles;\n };\n Clusterer.prototype.getTitle = function () {\n return this.title;\n };\n Clusterer.prototype.setTitle = function (title) {\n this.title = title;\n };\n Clusterer.prototype.getZoomOnClick = function () {\n return this.zoomOnClick;\n };\n Clusterer.prototype.setZoomOnClick = function (zoomOnClick) {\n this.zoomOnClick = zoomOnClick;\n };\n Clusterer.prototype.getAverageCenter = function () {\n return this.averageCenter;\n };\n Clusterer.prototype.setAverageCenter = function (averageCenter) {\n this.averageCenter = averageCenter;\n };\n Clusterer.prototype.getIgnoreHidden = function () {\n return this.ignoreHidden;\n };\n Clusterer.prototype.setIgnoreHidden = function (ignoreHidden) {\n this.ignoreHidden = ignoreHidden;\n };\n Clusterer.prototype.getEnableRetinaIcons = function () {\n return this.enableRetinaIcons;\n };\n Clusterer.prototype.setEnableRetinaIcons = function (enableRetinaIcons) {\n this.enableRetinaIcons = enableRetinaIcons;\n };\n Clusterer.prototype.getImageExtension = function () {\n return this.imageExtension;\n };\n Clusterer.prototype.setImageExtension = function (imageExtension) {\n this.imageExtension = imageExtension;\n };\n Clusterer.prototype.getImagePath = function () {\n return this.imagePath;\n };\n Clusterer.prototype.setImagePath = function (imagePath) {\n this.imagePath = imagePath;\n };\n Clusterer.prototype.getImageSizes = function () {\n return this.imageSizes;\n };\n Clusterer.prototype.setImageSizes = function (imageSizes) {\n this.imageSizes = imageSizes;\n };\n Clusterer.prototype.getCalculator = function () {\n return this.calculator;\n };\n Clusterer.prototype.setCalculator = function (calculator) {\n this.calculator = calculator;\n };\n Clusterer.prototype.getBatchSizeIE = function () {\n return this.batchSizeIE;\n };\n Clusterer.prototype.setBatchSizeIE = function (batchSizeIE) {\n this.batchSizeIE = batchSizeIE;\n };\n Clusterer.prototype.getClusterClass = function () {\n return this.clusterClass;\n };\n Clusterer.prototype.setClusterClass = function (clusterClass) {\n this.clusterClass = clusterClass;\n };\n Clusterer.prototype.getMarkers = function () {\n return this.markers;\n };\n Clusterer.prototype.getTotalMarkers = function () {\n return this.markers.length;\n };\n Clusterer.prototype.getClusters = function () {\n return this.clusters;\n };\n Clusterer.prototype.getTotalClusters = function () {\n return this.clusters.length;\n };\n Clusterer.prototype.addMarker = function (marker, optNoDraw) {\n this.pushMarkerTo(marker);\n if (!optNoDraw) {\n this.redraw();\n }\n };\n Clusterer.prototype.addMarkers = function (markers, optNoDraw) {\n for (var key in markers) {\n if (Object.prototype.hasOwnProperty.call(markers, key)) {\n var marker = markers[key];\n if (marker) {\n this.pushMarkerTo(marker);\n }\n }\n }\n if (!optNoDraw) {\n this.redraw();\n }\n };\n Clusterer.prototype.pushMarkerTo = function (marker) {\n var _this = this;\n // If the marker is draggable add a listener so we can update the clusters on the dragend:\n if (marker.getDraggable()) {\n google.maps.event.addListener(marker, 'dragend', function () {\n if (_this.ready) {\n marker.isAdded = false;\n _this.repaint();\n }\n });\n }\n marker.isAdded = false;\n this.markers.push(marker);\n };\n Clusterer.prototype.removeMarker_ = function (marker) {\n var index = -1;\n if (this.markers.indexOf) {\n index = this.markers.indexOf(marker);\n }\n else {\n for (var i = 0; i < this.markers.length; i++) {\n if (marker === this.markers[i]) {\n index = i;\n break;\n }\n }\n }\n if (index === -1) {\n // Marker is not in our list of markers, so do nothing:\n return false;\n }\n marker.setMap(null);\n this.markers.splice(index, 1); // Remove the marker from the list of managed markers\n return true;\n };\n Clusterer.prototype.removeMarker = function (marker, optNoDraw) {\n var removed = this.removeMarker_(marker);\n if (!optNoDraw && removed) {\n this.repaint();\n }\n return removed;\n };\n Clusterer.prototype.removeMarkers = function (markers, optNoDraw) {\n var removed = false;\n for (var _i = 0, markers_2 = markers; _i < markers_2.length; _i++) {\n var marker = markers_2[_i];\n removed = removed || this.removeMarker_(marker);\n }\n if (!optNoDraw && removed) {\n this.repaint();\n }\n return removed;\n };\n Clusterer.prototype.clearMarkers = function () {\n this.resetViewport(true);\n this.markers = [];\n };\n Clusterer.prototype.repaint = function () {\n var oldClusters = this.clusters.slice();\n this.clusters = [];\n this.resetViewport(false);\n this.redraw();\n // Remove the old clusters.\n // Do it in a timeout to prevent blinking effect.\n setTimeout(function timeout() {\n for (var _i = 0, oldClusters_1 = oldClusters; _i < oldClusters_1.length; _i++) {\n var oldCluster = oldClusters_1[_i];\n oldCluster.remove();\n }\n }, 0);\n };\n Clusterer.prototype.getExtendedBounds = function (bounds) {\n var projection = this.getProjection();\n // Convert the points to pixels and the extend out by the grid size.\n var trPix = projection.fromLatLngToDivPixel(\n // Turn the bounds into latlng.\n new google.maps.LatLng(bounds.getNorthEast().lat(), bounds.getNorthEast().lng()));\n if (trPix !== null) {\n trPix.x += this.gridSize;\n trPix.y -= this.gridSize;\n }\n var blPix = projection.fromLatLngToDivPixel(\n // Turn the bounds into latlng.\n new google.maps.LatLng(bounds.getSouthWest().lat(), bounds.getSouthWest().lng()));\n if (blPix !== null) {\n blPix.x -= this.gridSize;\n blPix.y += this.gridSize;\n }\n // Extend the bounds to contain the new bounds.\n if (trPix !== null) {\n // Convert the pixel points back to LatLng nw\n var point1 = projection.fromDivPixelToLatLng(trPix);\n if (point1 !== null) {\n bounds.extend(point1);\n }\n }\n if (blPix !== null) {\n // Convert the pixel points back to LatLng sw\n var point2 = projection.fromDivPixelToLatLng(blPix);\n if (point2 !== null) {\n bounds.extend(point2);\n }\n }\n return bounds;\n };\n Clusterer.prototype.redraw = function () {\n // Redraws all the clusters.\n this.createClusters(0);\n };\n Clusterer.prototype.resetViewport = function (optHide) {\n // Remove all the clusters\n for (var _i = 0, _a = this.clusters; _i < _a.length; _i++) {\n var cluster = _a[_i];\n cluster.remove();\n }\n this.clusters = [];\n // Reset the markers to not be added and to be removed from the map.\n for (var _b = 0, _c = this.markers; _b < _c.length; _b++) {\n var marker = _c[_b];\n marker.isAdded = false;\n if (optHide) {\n marker.setMap(null);\n }\n }\n };\n Clusterer.prototype.distanceBetweenPoints = function (p1, p2) {\n var R = 6371; // Radius of the Earth in km\n var dLat = ((p2.lat() - p1.lat()) * Math.PI) / 180;\n var dLon = ((p2.lng() - p1.lng()) * Math.PI) / 180;\n var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +\n Math.cos((p1.lat() * Math.PI) / 180) *\n Math.cos((p2.lat() * Math.PI) / 180) *\n Math.sin(dLon / 2) *\n Math.sin(dLon / 2);\n return R * (2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)));\n };\n Clusterer.prototype.isMarkerInBounds = function (marker, bounds) {\n var position = marker.getPosition();\n if (position) {\n return bounds.contains(position);\n }\n return false;\n };\n Clusterer.prototype.addToClosestCluster = function (marker) {\n var cluster;\n var distance = 40000; // Some large number\n var clusterToAddTo = null;\n for (var _i = 0, _a = this.clusters; _i < _a.length; _i++) {\n var clusterElement = _a[_i];\n cluster = clusterElement;\n var center = cluster.getCenter();\n var position = marker.getPosition();\n if (center && position) {\n var d = this.distanceBetweenPoints(center, position);\n if (d < distance) {\n distance = d;\n clusterToAddTo = cluster;\n }\n }\n }\n if (clusterToAddTo && clusterToAddTo.isMarkerInClusterBounds(marker)) {\n clusterToAddTo.addMarker(marker);\n }\n else {\n cluster = new Cluster$1(this);\n cluster.addMarker(marker);\n this.clusters.push(cluster);\n }\n };\n Clusterer.prototype.createClusters = function (iFirst) {\n var _this = this;\n if (!this.ready) {\n return;\n }\n // Cancel previous batch processing if we're working on the first batch:\n if (iFirst === 0) {\n /**\n * This event is fired when the Clusterer begins\n * clustering markers.\n * @name Clusterer#clusteringbegin\n * @param {Clusterer} mc The Clusterer whose markers are being clustered.\n * @event\n */\n google.maps.event.trigger(this, 'clusteringbegin', this);\n if (this.timerRefStatic !== null) {\n window.clearTimeout(this.timerRefStatic);\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n delete this.timerRefStatic;\n }\n }\n var map = this.getMap();\n var bounds = map !== null && 'getBounds' in map ? map.getBounds() : null;\n var zoom = (map === null || map === void 0 ? void 0 : map.getZoom()) || 0;\n // Get our current map view bounds.\n // Create a new bounds object so we don't affect the map.\n //\n // See Comments 9 & 11 on Issue 3651 relating to this workaround for a Google Maps bug:\n var mapBounds = zoom > 3\n ? new google.maps.LatLngBounds(bounds === null || bounds === void 0 ? void 0 : bounds.getSouthWest(), bounds === null || bounds === void 0 ? void 0 : bounds.getNorthEast())\n : new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472, -178.48388434375), new google.maps.LatLng(-85.08136444384544, 178.00048865625));\n var extendedMapBounds = this.getExtendedBounds(mapBounds);\n var iLast = Math.min(iFirst + this.batchSize, this.markers.length);\n for (var i = iFirst; i < iLast; i++) {\n var marker = this.markers[i];\n if (marker && !marker.isAdded && this.isMarkerInBounds(marker, extendedMapBounds) && (!this.ignoreHidden || (this.ignoreHidden && marker.getVisible()))) {\n this.addToClosestCluster(marker);\n }\n }\n if (iLast < this.markers.length) {\n this.timerRefStatic = window.setTimeout(function () {\n _this.createClusters(iLast);\n }, 0);\n }\n else {\n this.timerRefStatic = null;\n /**\n * This event is fired when the Clusterer stops\n * clustering markers.\n * @name Clusterer#clusteringend\n * @param {Clusterer} mc The Clusterer whose markers are being clustered.\n * @event\n */\n google.maps.event.trigger(this, 'clusteringend', this);\n for (var _i = 0, _a = this.clusters; _i < _a.length; _i++) {\n var cluster = _a[_i];\n cluster.updateIcon();\n }\n }\n };\n Clusterer.prototype.extend = function (obj1, obj2) {\n return function applyExtend(object) {\n for (var property in object.prototype) {\n // eslint-disable-next-line @typescript-eslint/ban-types\n var prop = property;\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.prototype[prop] = object.prototype[prop];\n }\n return this;\n }.apply(obj1, [obj2]);\n };\n return Clusterer;\n}());\n\nvar eventMap$e = {\n onClick: 'click',\n onClusteringBegin: 'clusteringbegin',\n onClusteringEnd: 'clusteringend',\n onMouseOut: 'mouseout',\n onMouseOver: 'mouseover',\n};\nvar updaterMap$e = {\n averageCenter: function (instance, averageCenter) {\n instance.setAverageCenter(averageCenter);\n },\n batchSizeIE: function (instance, batchSizeIE) {\n instance.setBatchSizeIE(batchSizeIE);\n },\n calculator: function (instance, calculator) {\n instance.setCalculator(calculator);\n },\n clusterClass: function (instance, clusterClass) {\n instance.setClusterClass(clusterClass);\n },\n enableRetinaIcons: function (instance, enableRetinaIcons) {\n instance.setEnableRetinaIcons(enableRetinaIcons);\n },\n gridSize: function (instance, gridSize) {\n instance.setGridSize(gridSize);\n },\n ignoreHidden: function (instance, ignoreHidden) {\n instance.setIgnoreHidden(ignoreHidden);\n },\n imageExtension: function (instance, imageExtension) {\n instance.setImageExtension(imageExtension);\n },\n imagePath: function (instance, imagePath) {\n instance.setImagePath(imagePath);\n },\n imageSizes: function (instance, imageSizes) {\n instance.setImageSizes(imageSizes);\n },\n maxZoom: function (instance, maxZoom) {\n instance.setMaxZoom(maxZoom);\n },\n minimumClusterSize: function (instance, minimumClusterSize) {\n instance.setMinimumClusterSize(minimumClusterSize);\n },\n styles: function (instance, styles) {\n instance.setStyles(styles);\n },\n title: function (instance, title) {\n instance.setTitle(title);\n },\n zoomOnClick: function (instance, zoomOnClick) {\n instance.setZoomOnClick(zoomOnClick);\n },\n};\nvar defaultOptions$4 = {};\nfunction MarkerClustererFunctional(props) {\n var children = props.children, options = props.options, averageCenter = props.averageCenter, batchSizeIE = props.batchSizeIE, calculator = props.calculator, clusterClass = props.clusterClass, enableRetinaIcons = props.enableRetinaIcons, gridSize = props.gridSize, ignoreHidden = props.ignoreHidden, imageExtension = props.imageExtension, imagePath = props.imagePath, imageSizes = props.imageSizes, maxZoom = props.maxZoom, minimumClusterSize = props.minimumClusterSize, styles = props.styles, title = props.title, zoomOnClick = props.zoomOnClick, onClick = props.onClick, onClusteringBegin = props.onClusteringBegin, onClusteringEnd = props.onClusteringEnd, onMouseOver = props.onMouseOver, onMouseOut = props.onMouseOut, onLoad = props.onLoad, onUnmount = props.onUnmount;\n var _a = useState(null), instance = _a[0], setInstance = _a[1];\n var map = useContext(MapContext);\n var _b = useState(null), clickListener = _b[0], setClickListener = _b[1];\n var _c = useState(null), clusteringBeginListener = _c[0], setClusteringBeginListener = _c[1];\n var _d = useState(null), clusteringEndListener = _d[0], setClusteringEndListener = _d[1];\n var _e = useState(null), mouseoutListener = _e[0], setMouseoutListener = _e[1];\n var _f = useState(null), mouseoverListener = _f[0], setMouseoverListener = _f[1];\n useEffect(function () {\n if (instance && onMouseOut) {\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n setMouseoutListener(google.maps.event.addListener(instance, eventMap$e.onMouseOut, onMouseOut));\n }\n }, [onMouseOut]);\n useEffect(function () {\n if (instance && onMouseOver) {\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n setMouseoverListener(google.maps.event.addListener(instance, eventMap$e.onMouseOver, onMouseOver));\n }\n }, [onMouseOver]);\n useEffect(function () {\n if (instance && onClick) {\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n setClickListener(google.maps.event.addListener(instance, eventMap$e.onClick, onClick));\n }\n }, [onClick]);\n useEffect(function () {\n if (instance && onClusteringBegin) {\n if (clusteringBeginListener !== null) {\n google.maps.event.removeListener(clusteringBeginListener);\n }\n setClusteringBeginListener(google.maps.event.addListener(instance, eventMap$e.onClusteringBegin, onClusteringBegin));\n }\n }, [onClusteringBegin]);\n useEffect(function () {\n if (instance && onClusteringEnd) {\n if (clusteringEndListener !== null) {\n google.maps.event.removeListener(clusteringEndListener);\n }\n setClusteringBeginListener(google.maps.event.addListener(instance, eventMap$e.onClusteringEnd, onClusteringEnd));\n }\n }, [onClusteringEnd]);\n useEffect(function () {\n if (typeof averageCenter !== 'undefined' && instance !== null) {\n updaterMap$e.averageCenter(instance, averageCenter);\n }\n }, [instance, averageCenter]);\n useEffect(function () {\n if (typeof batchSizeIE !== 'undefined' && instance !== null) {\n updaterMap$e.batchSizeIE(instance, batchSizeIE);\n }\n }, [instance, batchSizeIE]);\n useEffect(function () {\n if (typeof calculator !== 'undefined' && instance !== null) {\n updaterMap$e.calculator(instance, calculator);\n }\n }, [instance, calculator]);\n useEffect(function () {\n if (typeof clusterClass !== 'undefined' && instance !== null) {\n updaterMap$e.clusterClass(instance, clusterClass);\n }\n }, [instance, clusterClass]);\n useEffect(function () {\n if (typeof enableRetinaIcons !== 'undefined' && instance !== null) {\n updaterMap$e.enableRetinaIcons(instance, enableRetinaIcons);\n }\n }, [instance, enableRetinaIcons]);\n useEffect(function () {\n if (typeof gridSize !== 'undefined' && instance !== null) {\n updaterMap$e.gridSize(instance, gridSize);\n }\n }, [instance, gridSize]);\n useEffect(function () {\n if (typeof ignoreHidden !== 'undefined' && instance !== null) {\n updaterMap$e.ignoreHidden(instance, ignoreHidden);\n }\n }, [instance, ignoreHidden]);\n useEffect(function () {\n if (typeof imageExtension !== 'undefined' && instance !== null) {\n updaterMap$e.imageExtension(instance, imageExtension);\n }\n }, [instance, imageExtension]);\n useEffect(function () {\n if (typeof imagePath !== 'undefined' && instance !== null) {\n updaterMap$e.imagePath(instance, imagePath);\n }\n }, [instance, imagePath]);\n useEffect(function () {\n if (typeof imageSizes !== 'undefined' && instance !== null) {\n updaterMap$e.imageSizes(instance, imageSizes);\n }\n }, [instance, imageSizes]);\n useEffect(function () {\n if (typeof maxZoom !== 'undefined' && instance !== null) {\n updaterMap$e.maxZoom(instance, maxZoom);\n }\n }, [instance, maxZoom]);\n useEffect(function () {\n if (typeof minimumClusterSize !== 'undefined' && instance !== null) {\n updaterMap$e.minimumClusterSize(instance, minimumClusterSize);\n }\n }, [instance, minimumClusterSize]);\n useEffect(function () {\n if (typeof styles !== 'undefined' && instance !== null) {\n updaterMap$e.styles(instance, styles);\n }\n }, [instance, styles]);\n useEffect(function () {\n if (typeof title !== 'undefined' && instance !== null) {\n updaterMap$e.title(instance, title);\n }\n }, [instance, title]);\n useEffect(function () {\n if (typeof zoomOnClick !== 'undefined' && instance !== null) {\n updaterMap$e.zoomOnClick(instance, zoomOnClick);\n }\n }, [instance, zoomOnClick]);\n useEffect(function () {\n if (!map)\n return;\n var clustererOptions = __assign({}, (options || defaultOptions$4));\n var clusterer = new Clusterer(map, [], clustererOptions);\n if (averageCenter) {\n updaterMap$e.averageCenter(clusterer, averageCenter);\n }\n if (batchSizeIE) {\n updaterMap$e.batchSizeIE(clusterer, batchSizeIE);\n }\n if (calculator) {\n updaterMap$e.calculator(clusterer, calculator);\n }\n if (clusterClass) {\n updaterMap$e.clusterClass(clusterer, clusterClass);\n }\n if (enableRetinaIcons) {\n updaterMap$e.enableRetinaIcons(clusterer, enableRetinaIcons);\n }\n if (gridSize) {\n updaterMap$e.gridSize(clusterer, gridSize);\n }\n if (ignoreHidden) {\n updaterMap$e.ignoreHidden(clusterer, ignoreHidden);\n }\n if (imageExtension) {\n updaterMap$e.imageExtension(clusterer, imageExtension);\n }\n if (imagePath) {\n updaterMap$e.imagePath(clusterer, imagePath);\n }\n if (imageSizes) {\n updaterMap$e.imageSizes(clusterer, imageSizes);\n }\n if (maxZoom) {\n updaterMap$e.maxZoom(clusterer, maxZoom);\n }\n if (minimumClusterSize) {\n updaterMap$e.minimumClusterSize(clusterer, minimumClusterSize);\n }\n if (styles) {\n updaterMap$e.styles(clusterer, styles);\n }\n if (title) {\n updaterMap$e.title(clusterer, title);\n }\n if (zoomOnClick) {\n updaterMap$e.zoomOnClick(clusterer, zoomOnClick);\n }\n if (onMouseOut) {\n setMouseoutListener(google.maps.event.addListener(clusterer, eventMap$e.onMouseOut, onMouseOut));\n }\n if (onMouseOver) {\n setMouseoverListener(google.maps.event.addListener(clusterer, eventMap$e.onMouseOver, onMouseOver));\n }\n if (onClick) {\n setClickListener(google.maps.event.addListener(clusterer, eventMap$e.onClick, onClick));\n }\n if (onClusteringBegin) {\n setClusteringBeginListener(google.maps.event.addListener(clusterer, eventMap$e.onClusteringBegin, onClusteringBegin));\n }\n if (onClusteringEnd) {\n setClusteringEndListener(google.maps.event.addListener(clusterer, eventMap$e.onClusteringEnd, onClusteringEnd));\n }\n setInstance(clusterer);\n if (onLoad) {\n onLoad(clusterer);\n }\n return function () {\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n if (clusteringBeginListener !== null) {\n google.maps.event.removeListener(clusteringBeginListener);\n }\n if (clusteringEndListener !== null) {\n google.maps.event.removeListener(clusteringEndListener);\n }\n if (onUnmount) {\n onUnmount(clusterer);\n }\n };\n }, []);\n return instance !== null ? children(instance) || null : null;\n}\nvar MarkerClustererF = memo(MarkerClustererFunctional);\nvar ClustererComponent = /** @class */ (function (_super) {\n __extends(ClustererComponent, _super);\n function ClustererComponent() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.registeredEvents = [];\n _this.state = {\n markerClusterer: null,\n };\n _this.setClustererCallback = function () {\n if (_this.state.markerClusterer !== null && _this.props.onLoad) {\n _this.props.onLoad(_this.state.markerClusterer);\n }\n };\n return _this;\n }\n ClustererComponent.prototype.componentDidMount = function () {\n if (this.context) {\n var markerClusterer_1 = new Clusterer(this.context, [], this.props.options);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$e,\n eventMap: eventMap$e,\n prevProps: {},\n nextProps: this.props,\n instance: markerClusterer_1,\n });\n this.setState(function () {\n return {\n markerClusterer: markerClusterer_1,\n };\n }, this.setClustererCallback);\n }\n };\n ClustererComponent.prototype.componentDidUpdate = function (prevProps) {\n if (this.state.markerClusterer) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$e,\n eventMap: eventMap$e,\n prevProps: prevProps,\n nextProps: this.props,\n instance: this.state.markerClusterer,\n });\n }\n };\n ClustererComponent.prototype.componentWillUnmount = function () {\n if (this.state.markerClusterer !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.markerClusterer);\n }\n unregisterEvents(this.registeredEvents);\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.state.markerClusterer.setMap(null);\n }\n };\n ClustererComponent.prototype.render = function () {\n return this.state.markerClusterer !== null\n ? this.props.children(this.state.markerClusterer)\n : null;\n };\n ClustererComponent.contextType = MapContext;\n return ClustererComponent;\n}(PureComponent));\n\n// This handler prevents an event in the InfoBox from being passed on to the map.\nfunction cancelHandler(event) {\n event.cancelBubble = true;\n if (event.stopPropagation) {\n event.stopPropagation();\n }\n}\nvar InfoBox = /** @class */ (function () {\n function InfoBox(options) {\n if (options === void 0) { options = {}; }\n this.getCloseClickHandler = this.getCloseClickHandler.bind(this);\n this.closeClickHandler = this.closeClickHandler.bind(this);\n this.createInfoBoxDiv = this.createInfoBoxDiv.bind(this);\n this.addClickHandler = this.addClickHandler.bind(this);\n this.getCloseBoxImg = this.getCloseBoxImg.bind(this);\n this.getBoxWidths = this.getBoxWidths.bind(this);\n this.setBoxStyle = this.setBoxStyle.bind(this);\n this.setPosition = this.setPosition.bind(this);\n this.getPosition = this.getPosition.bind(this);\n this.setOptions = this.setOptions.bind(this);\n this.setContent = this.setContent.bind(this);\n this.setVisible = this.setVisible.bind(this);\n this.getContent = this.getContent.bind(this);\n this.getVisible = this.getVisible.bind(this);\n this.setZIndex = this.setZIndex.bind(this);\n this.getZIndex = this.getZIndex.bind(this);\n this.onRemove = this.onRemove.bind(this);\n this.panBox = this.panBox.bind(this);\n this.extend = this.extend.bind(this);\n this.close = this.close.bind(this);\n this.draw = this.draw.bind(this);\n this.show = this.show.bind(this);\n this.hide = this.hide.bind(this);\n this.open = this.open.bind(this);\n this.extend(InfoBox, google.maps.OverlayView);\n // Standard options (in common with google.maps.InfoWindow):\n this.content = options.content || '';\n this.disableAutoPan = options.disableAutoPan || false;\n this.maxWidth = options.maxWidth || 0;\n this.pixelOffset = options.pixelOffset || new google.maps.Size(0, 0);\n this.position = options.position || new google.maps.LatLng(0, 0);\n this.zIndex = options.zIndex || null;\n // Additional options (unique to InfoBox):\n this.boxClass = options.boxClass || 'infoBox';\n this.boxStyle = options.boxStyle || {};\n this.closeBoxMargin = options.closeBoxMargin || '2px';\n this.closeBoxURL = options.closeBoxURL || 'http://www.google.com/intl/en_us/mapfiles/close.gif';\n if (options.closeBoxURL === '') {\n this.closeBoxURL = '';\n }\n this.infoBoxClearance = options.infoBoxClearance || new google.maps.Size(1, 1);\n if (typeof options.visible === 'undefined') {\n if (typeof options.isHidden === 'undefined') {\n options.visible = true;\n }\n else {\n options.visible = !options.isHidden;\n }\n }\n this.isHidden = !options.visible;\n this.alignBottom = options.alignBottom || false;\n this.pane = options.pane || 'floatPane';\n this.enableEventPropagation = options.enableEventPropagation || false;\n this.div = null;\n this.closeListener = null;\n this.moveListener = null;\n this.mapListener = null;\n this.contextListener = null;\n this.eventListeners = null;\n this.fixedWidthSet = null;\n }\n InfoBox.prototype.createInfoBoxDiv = function () {\n var _this = this;\n // This handler ignores the current event in the InfoBox and conditionally prevents\n // the event from being passed on to the map. It is used for the contextmenu event.\n var ignoreHandler = function (event) {\n event.returnValue = false;\n if (event.preventDefault) {\n event.preventDefault();\n }\n if (!_this.enableEventPropagation) {\n cancelHandler(event);\n }\n };\n if (!this.div) {\n this.div = document.createElement('div');\n this.setBoxStyle();\n if (typeof this.content === 'string') {\n this.div.innerHTML = this.getCloseBoxImg() + this.content;\n }\n else {\n this.div.innerHTML = this.getCloseBoxImg();\n this.div.appendChild(this.content);\n }\n var panes = this.getPanes();\n if (panes !== null) {\n panes[this.pane].appendChild(this.div); // Add the InfoBox div to the DOM\n }\n this.addClickHandler();\n if (this.div.style.width) {\n this.fixedWidthSet = true;\n }\n else {\n if (this.maxWidth !== 0 && this.div.offsetWidth > this.maxWidth) {\n this.div.style.width = this.maxWidth + 'px';\n this.fixedWidthSet = true;\n }\n else {\n // The following code is needed to overcome problems with MSIE\n var bw = this.getBoxWidths();\n this.div.style.width = this.div.offsetWidth - bw.left - bw.right + 'px';\n this.fixedWidthSet = false;\n }\n }\n this.panBox(this.disableAutoPan);\n if (!this.enableEventPropagation) {\n this.eventListeners = [];\n // Cancel event propagation.\n // Note: mousemove not included (to resolve Issue 152)\n var events = [\n 'mousedown',\n 'mouseover',\n 'mouseout',\n 'mouseup',\n 'click',\n 'dblclick',\n 'touchstart',\n 'touchend',\n 'touchmove',\n ];\n for (var _i = 0, events_1 = events; _i < events_1.length; _i++) {\n var event_1 = events_1[_i];\n this.eventListeners.push(google.maps.event.addListener(this.div, event_1, cancelHandler));\n }\n // Workaround for Google bug that causes the cursor to change to a pointer\n // when the mouse moves over a marker underneath InfoBox.\n this.eventListeners.push(google.maps.event.addListener(this.div, 'mouseover', function () {\n if (_this.div) {\n _this.div.style.cursor = 'default';\n }\n }));\n }\n this.contextListener = google.maps.event.addListener(this.div, 'contextmenu', ignoreHandler);\n /**\n * This event is fired when the DIV containing the InfoBox's content is attached to the DOM.\n * @name InfoBox#domready\n * @event\n */\n google.maps.event.trigger(this, 'domready');\n }\n };\n InfoBox.prototype.getCloseBoxImg = function () {\n var img = '';\n if (this.closeBoxURL !== '') {\n img = '\"\"';\n\";\n }\n return img;\n };\n InfoBox.prototype.addClickHandler = function () {\n this.closeListener = this.div && this.div.firstChild && this.closeBoxURL !== ''\n ? google.maps.event.addListener(this.div.firstChild, 'click', this.getCloseClickHandler())\n : null;\n };\n InfoBox.prototype.closeClickHandler = function (event) {\n // 1.0.3 fix: Always prevent propagation of a close box click to the map:\n event.cancelBubble = true;\n if (event.stopPropagation) {\n event.stopPropagation();\n }\n /**\n * This event is fired when the InfoBox's close box is clicked.\n * @name InfoBox#closeclick\n * @event\n */\n google.maps.event.trigger(this, 'closeclick');\n this.close();\n };\n InfoBox.prototype.getCloseClickHandler = function () {\n return this.closeClickHandler;\n };\n InfoBox.prototype.panBox = function (disablePan) {\n if (this.div && !disablePan) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n var map = this.getMap();\n // Only pan if attached to map, not panorama\n if (map instanceof google.maps.Map) {\n var xOffset = 0;\n var yOffset = 0;\n var bounds = map.getBounds();\n if (bounds && !bounds.contains(this.position)) {\n // Marker not in visible area of map, so set center\n // of map to the marker position first.\n map.setCenter(this.position);\n }\n var mapDiv = map.getDiv();\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n var mapWidth = mapDiv.offsetWidth;\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n var mapHeight = mapDiv.offsetHeight;\n var iwOffsetX = this.pixelOffset.width;\n var iwOffsetY = this.pixelOffset.height;\n var iwWidth = this.div.offsetWidth;\n var iwHeight = this.div.offsetHeight;\n var padX = this.infoBoxClearance.width;\n var padY = this.infoBoxClearance.height;\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n var projection = this.getProjection();\n var pixPosition = projection.fromLatLngToContainerPixel(this.position);\n if (pixPosition !== null) {\n if (pixPosition.x < -iwOffsetX + padX) {\n xOffset = pixPosition.x + iwOffsetX - padX;\n }\n else if (pixPosition.x + iwWidth + iwOffsetX + padX > mapWidth) {\n xOffset = pixPosition.x + iwWidth + iwOffsetX + padX - mapWidth;\n }\n if (this.alignBottom) {\n if (pixPosition.y < -iwOffsetY + padY + iwHeight) {\n yOffset = pixPosition.y + iwOffsetY - padY - iwHeight;\n }\n else if (pixPosition.y + iwOffsetY + padY > mapHeight) {\n yOffset = pixPosition.y + iwOffsetY + padY - mapHeight;\n }\n }\n else {\n if (pixPosition.y < -iwOffsetY + padY) {\n yOffset = pixPosition.y + iwOffsetY - padY;\n }\n else if (pixPosition.y + iwHeight + iwOffsetY + padY > mapHeight) {\n yOffset = pixPosition.y + iwHeight + iwOffsetY + padY - mapHeight;\n }\n }\n }\n if (!(xOffset === 0 && yOffset === 0)) {\n // Move the map to the shifted center.\n map.panBy(xOffset, yOffset);\n }\n }\n }\n };\n InfoBox.prototype.setBoxStyle = function () {\n if (this.div) {\n // Apply style values from the style sheet defined in the boxClass parameter:\n this.div.className = this.boxClass;\n // Clear existing inline style values:\n this.div.style.cssText = '';\n // Apply style values defined in the boxStyle parameter:\n var boxStyle = this.boxStyle;\n for (var i in boxStyle) {\n if (Object.prototype.hasOwnProperty.call(boxStyle, i)) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.div.style[i] = boxStyle[i];\n }\n }\n // Fix for iOS disappearing InfoBox problem\n // See http://stackoverflow.com/questions/9229535/google-maps-markers-disappear-at-certain-zoom-level-only-on-iphone-ipad\n this.div.style.webkitTransform = 'translateZ(0)';\n // Fix up opacity style for benefit of MSIE\n if (typeof this.div.style.opacity !== 'undefined' && this.div.style.opacity !== '') {\n // See http://www.quirksmode.org/css/opacity.html\n var opacity = parseFloat(this.div.style.opacity || '');\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.div.style.msFilter =\n '\"progid:DXImageTransform.Microsoft.Alpha(Opacity=' + opacity * 100 + ')\"';\n this.div.style.filter = 'alpha(opacity=' + opacity * 100 + ')';\n }\n // Apply required styles\n this.div.style.position = 'absolute';\n this.div.style.visibility = 'hidden';\n if (this.zIndex !== null) {\n this.div.style.zIndex = this.zIndex + '';\n }\n if (!this.div.style.overflow) {\n this.div.style.overflow = 'auto';\n }\n }\n };\n InfoBox.prototype.getBoxWidths = function () {\n var bw = { top: 0, bottom: 0, left: 0, right: 0 };\n if (!this.div) {\n return bw;\n }\n if (document.defaultView) {\n var ownerDocument = this.div.ownerDocument;\n var computedStyle = ownerDocument && ownerDocument.defaultView\n ? ownerDocument.defaultView.getComputedStyle(this.div, '')\n : null;\n if (computedStyle) {\n // The computed styles are always in pixel units (good!)\n bw.top = parseInt(computedStyle.borderTopWidth || '', 10) || 0;\n bw.bottom = parseInt(computedStyle.borderBottomWidth || '', 10) || 0;\n bw.left = parseInt(computedStyle.borderLeftWidth || '', 10) || 0;\n bw.right = parseInt(computedStyle.borderRightWidth || '', 10) || 0;\n }\n }\n else if (\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n document.documentElement.currentStyle // MSIE\n ) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n var currentStyle = this.div.currentStyle;\n if (currentStyle) {\n // The current styles may not be in pixel units, but assume they are (bad!)\n bw.top = parseInt(currentStyle.borderTopWidth || '', 10) || 0;\n bw.bottom = parseInt(currentStyle.borderBottomWidth || '', 10) || 0;\n bw.left = parseInt(currentStyle.borderLeftWidth || '', 10) || 0;\n bw.right = parseInt(currentStyle.borderRightWidth || '', 10) || 0;\n }\n }\n return bw;\n };\n InfoBox.prototype.onRemove = function () {\n if (this.div && this.div.parentNode) {\n this.div.parentNode.removeChild(this.div);\n this.div = null;\n }\n };\n InfoBox.prototype.draw = function () {\n this.createInfoBoxDiv();\n if (this.div) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n var projection = this.getProjection();\n var pixPosition = projection.fromLatLngToDivPixel(this.position);\n if (pixPosition !== null) {\n this.div.style.left = pixPosition.x + this.pixelOffset.width + 'px';\n if (this.alignBottom) {\n this.div.style.bottom = -(pixPosition.y + this.pixelOffset.height) + 'px';\n }\n else {\n this.div.style.top = pixPosition.y + this.pixelOffset.height + 'px';\n }\n }\n if (this.isHidden) {\n this.div.style.visibility = 'hidden';\n }\n else {\n this.div.style.visibility = 'visible';\n }\n }\n };\n InfoBox.prototype.setOptions = function (options) {\n if (options === void 0) { options = {}; }\n if (typeof options.boxClass !== 'undefined') {\n // Must be first\n this.boxClass = options.boxClass;\n this.setBoxStyle();\n }\n if (typeof options.boxStyle !== 'undefined') {\n // Must be second\n this.boxStyle = options.boxStyle;\n this.setBoxStyle();\n }\n if (typeof options.content !== 'undefined') {\n this.setContent(options.content);\n }\n if (typeof options.disableAutoPan !== 'undefined') {\n this.disableAutoPan = options.disableAutoPan;\n }\n if (typeof options.maxWidth !== 'undefined') {\n this.maxWidth = options.maxWidth;\n }\n if (typeof options.pixelOffset !== 'undefined') {\n this.pixelOffset = options.pixelOffset;\n }\n if (typeof options.alignBottom !== 'undefined') {\n this.alignBottom = options.alignBottom;\n }\n if (typeof options.position !== 'undefined') {\n this.setPosition(options.position);\n }\n if (typeof options.zIndex !== 'undefined') {\n this.setZIndex(options.zIndex);\n }\n if (typeof options.closeBoxMargin !== 'undefined') {\n this.closeBoxMargin = options.closeBoxMargin;\n }\n if (typeof options.closeBoxURL !== 'undefined') {\n this.closeBoxURL = options.closeBoxURL;\n }\n if (typeof options.infoBoxClearance !== 'undefined') {\n this.infoBoxClearance = options.infoBoxClearance;\n }\n if (typeof options.isHidden !== 'undefined') {\n this.isHidden = options.isHidden;\n }\n if (typeof options.visible !== 'undefined') {\n this.isHidden = !options.visible;\n }\n if (typeof options.enableEventPropagation !== 'undefined') {\n this.enableEventPropagation = options.enableEventPropagation;\n }\n if (this.div) {\n this.draw();\n }\n };\n InfoBox.prototype.setContent = function (content) {\n this.content = content;\n if (this.div) {\n if (this.closeListener) {\n google.maps.event.removeListener(this.closeListener);\n this.closeListener = null;\n }\n // Odd code required to make things work with MSIE.\n if (!this.fixedWidthSet) {\n this.div.style.width = '';\n }\n if (typeof content === 'string') {\n this.div.innerHTML = this.getCloseBoxImg() + content;\n }\n else {\n this.div.innerHTML = this.getCloseBoxImg();\n this.div.appendChild(content);\n }\n // Perverse code required to make things work with MSIE.\n // (Ensures the close box does, in fact, float to the right.)\n if (!this.fixedWidthSet) {\n this.div.style.width = this.div.offsetWidth + 'px';\n if (typeof content === 'string') {\n this.div.innerHTML = this.getCloseBoxImg() + content;\n }\n else {\n this.div.innerHTML = this.getCloseBoxImg();\n this.div.appendChild(content);\n }\n }\n this.addClickHandler();\n }\n /**\n * This event is fired when the content of the InfoBox changes.\n * @name InfoBox#content_changed\n * @event\n */\n google.maps.event.trigger(this, 'content_changed');\n };\n InfoBox.prototype.setPosition = function (latLng) {\n this.position = latLng;\n if (this.div) {\n this.draw();\n }\n /**\n * This event is fired when the position of the InfoBox changes.\n * @name InfoBox#position_changed\n * @event\n */\n google.maps.event.trigger(this, 'position_changed');\n };\n InfoBox.prototype.setVisible = function (isVisible) {\n this.isHidden = !isVisible;\n if (this.div) {\n this.div.style.visibility = this.isHidden ? 'hidden' : 'visible';\n }\n };\n InfoBox.prototype.setZIndex = function (index) {\n this.zIndex = index;\n if (this.div) {\n this.div.style.zIndex = index + '';\n }\n /**\n * This event is fired when the zIndex of the InfoBox changes.\n * @name InfoBox#zindex_changed\n * @event\n */\n google.maps.event.trigger(this, 'zindex_changed');\n };\n InfoBox.prototype.getContent = function () {\n return this.content;\n };\n InfoBox.prototype.getPosition = function () {\n return this.position;\n };\n InfoBox.prototype.getZIndex = function () {\n return this.zIndex;\n };\n InfoBox.prototype.getVisible = function () {\n var map = this.getMap();\n return typeof map === 'undefined' || map === null ? false : !this.isHidden;\n };\n InfoBox.prototype.show = function () {\n this.isHidden = false;\n if (this.div) {\n this.div.style.visibility = 'visible';\n }\n };\n InfoBox.prototype.hide = function () {\n this.isHidden = true;\n if (this.div) {\n this.div.style.visibility = 'hidden';\n }\n };\n InfoBox.prototype.open = function (map, anchor) {\n var _this = this;\n if (anchor) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.position = anchor.getPosition();\n this.moveListener = google.maps.event.addListener(anchor, 'position_changed', function () {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n var position = anchor.getPosition();\n _this.setPosition(position);\n });\n this.mapListener = google.maps.event.addListener(anchor, 'map_changed', function () {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n _this.setMap(anchor.map);\n });\n }\n this.setMap(map);\n if (this.div) {\n this.panBox();\n }\n };\n InfoBox.prototype.close = function () {\n if (this.closeListener) {\n google.maps.event.removeListener(this.closeListener);\n this.closeListener = null;\n }\n if (this.eventListeners) {\n for (var _i = 0, _a = this.eventListeners; _i < _a.length; _i++) {\n var eventListener = _a[_i];\n google.maps.event.removeListener(eventListener);\n }\n this.eventListeners = null;\n }\n if (this.moveListener) {\n google.maps.event.removeListener(this.moveListener);\n this.moveListener = null;\n }\n if (this.mapListener) {\n google.maps.event.removeListener(this.mapListener);\n this.mapListener = null;\n }\n if (this.contextListener) {\n google.maps.event.removeListener(this.contextListener);\n this.contextListener = null;\n }\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.setMap(null);\n };\n InfoBox.prototype.extend = function (obj1, obj2) {\n return function applyExtend(object) {\n for (var property in object.prototype) {\n if (!Object.prototype.hasOwnProperty.call(this, property)) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.prototype[property] = object.prototype[property];\n }\n }\n return this;\n }.apply(obj1, [obj2]);\n };\n return InfoBox;\n}());\n\nvar eventMap$d = {\n onCloseClick: 'closeclick',\n onContentChanged: 'content_changed',\n onDomReady: 'domready',\n onPositionChanged: 'position_changed',\n onZindexChanged: 'zindex_changed',\n};\nvar updaterMap$d = {\n options: function (instance, options) {\n instance.setOptions(options);\n },\n position: function (instance, position) {\n if (position instanceof google.maps.LatLng) {\n instance.setPosition(position);\n }\n else {\n instance.setPosition(new google.maps.LatLng(position.lat, position.lng));\n }\n },\n visible: function (instance, visible) {\n instance.setVisible(visible);\n },\n zIndex: function (instance, zIndex) {\n instance.setZIndex(zIndex);\n },\n};\nvar defaultOptions$3 = {};\nfunction InfoBoxFunctional(_a) {\n var children = _a.children, anchor = _a.anchor, options = _a.options, position = _a.position, zIndex = _a.zIndex, onCloseClick = _a.onCloseClick, onDomReady = _a.onDomReady, onContentChanged = _a.onContentChanged, onPositionChanged = _a.onPositionChanged, onZindexChanged = _a.onZindexChanged, onLoad = _a.onLoad, onUnmount = _a.onUnmount;\n var map = useContext(MapContext);\n var _b = useState(null), instance = _b[0], setInstance = _b[1];\n var _c = useState(null), closeClickListener = _c[0], setCloseClickListener = _c[1];\n var _d = useState(null), domReadyClickListener = _d[0], setDomReadyClickListener = _d[1];\n var _e = useState(null), contentChangedClickListener = _e[0], setContentChangedClickListener = _e[1];\n var _f = useState(null), positionChangedClickListener = _f[0], setPositionChangedClickListener = _f[1];\n var _g = useState(null), zIndexChangedClickListener = _g[0], setZindexChangedClickListener = _g[1];\n var containerElementRef = useRef(null);\n // Order does matter\n useEffect(function () {\n if (map && instance !== null) {\n instance.close();\n if (anchor) {\n instance.open(map, anchor);\n }\n else if (instance.getPosition()) {\n instance.open(map);\n }\n }\n }, [map, instance, anchor]);\n useEffect(function () {\n if (options && instance !== null) {\n instance.setOptions(options);\n }\n }, [instance, options]);\n useEffect(function () {\n if (position && instance !== null) {\n var positionLatLng = position instanceof google.maps.LatLng\n ? position\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n : new google.maps.LatLng(position.lat, position.lng);\n instance.setPosition(positionLatLng);\n }\n }, [position]);\n useEffect(function () {\n if (typeof zIndex === 'number' && instance !== null) {\n instance.setZIndex(zIndex);\n }\n }, [zIndex]);\n useEffect(function () {\n if (instance && onCloseClick) {\n if (closeClickListener !== null) {\n google.maps.event.removeListener(closeClickListener);\n }\n setCloseClickListener(google.maps.event.addListener(instance, 'closeclick', onCloseClick));\n }\n }, [onCloseClick]);\n useEffect(function () {\n if (instance && onDomReady) {\n if (domReadyClickListener !== null) {\n google.maps.event.removeListener(domReadyClickListener);\n }\n setDomReadyClickListener(google.maps.event.addListener(instance, 'domready', onDomReady));\n }\n }, [onDomReady]);\n useEffect(function () {\n if (instance && onContentChanged) {\n if (contentChangedClickListener !== null) {\n google.maps.event.removeListener(contentChangedClickListener);\n }\n setContentChangedClickListener(google.maps.event.addListener(instance, 'content_changed', onContentChanged));\n }\n }, [onContentChanged]);\n useEffect(function () {\n if (instance && onPositionChanged) {\n if (positionChangedClickListener !== null) {\n google.maps.event.removeListener(positionChangedClickListener);\n }\n setPositionChangedClickListener(google.maps.event.addListener(instance, 'position_changed', onPositionChanged));\n }\n }, [onPositionChanged]);\n useEffect(function () {\n if (instance && onZindexChanged) {\n if (zIndexChangedClickListener !== null) {\n google.maps.event.removeListener(zIndexChangedClickListener);\n }\n setZindexChangedClickListener(google.maps.event.addListener(instance, 'zindex_changed', onZindexChanged));\n }\n }, [onZindexChanged]);\n useEffect(function () {\n if (map) {\n var _a = options || defaultOptions$3, position_1 = _a.position, infoBoxOptions = __rest$1(_a, [\"position\"]);\n var positionLatLng = void 0;\n if (position_1 && !(position_1 instanceof google.maps.LatLng)) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n positionLatLng = new google.maps.LatLng(position_1.lat, position_1.lng);\n }\n var infoBox = new InfoBox(__assign(__assign({}, infoBoxOptions), (positionLatLng ? { position: positionLatLng } : {})));\n containerElementRef.current = document.createElement('div');\n setInstance(infoBox);\n if (onCloseClick) {\n setCloseClickListener(google.maps.event.addListener(infoBox, 'closeclick', onCloseClick));\n }\n if (onDomReady) {\n setDomReadyClickListener(google.maps.event.addListener(infoBox, 'domready', onDomReady));\n }\n if (onContentChanged) {\n setContentChangedClickListener(google.maps.event.addListener(infoBox, 'content_changed', onContentChanged));\n }\n if (onPositionChanged) {\n setPositionChangedClickListener(google.maps.event.addListener(infoBox, 'position_changed', onPositionChanged));\n }\n if (onZindexChanged) {\n setZindexChangedClickListener(google.maps.event.addListener(infoBox, 'zindex_changed', onZindexChanged));\n }\n infoBox.setContent(containerElementRef.current);\n if (anchor) {\n infoBox.open(map, anchor);\n }\n else if (infoBox.getPosition()) {\n infoBox.open(map);\n }\n else {\n invariant$1(false, 'You must provide either an anchor or a position prop for .');\n }\n if (onLoad) {\n onLoad(infoBox);\n }\n }\n return function () {\n if (instance !== null) {\n if (closeClickListener) {\n google.maps.event.removeListener(closeClickListener);\n }\n if (contentChangedClickListener) {\n google.maps.event.removeListener(contentChangedClickListener);\n }\n if (domReadyClickListener) {\n google.maps.event.removeListener(domReadyClickListener);\n }\n if (positionChangedClickListener) {\n google.maps.event.removeListener(positionChangedClickListener);\n }\n if (zIndexChangedClickListener) {\n google.maps.event.removeListener(zIndexChangedClickListener);\n }\n if (onUnmount) {\n onUnmount(instance);\n }\n instance.close();\n }\n };\n }, []);\n return containerElementRef.current ? createPortal(Children.only(children), containerElementRef.current) : null;\n}\nvar InfoBoxF = memo(InfoBoxFunctional);\nvar InfoBoxComponent = /** @class */ (function (_super) {\n __extends(InfoBoxComponent, _super);\n function InfoBoxComponent() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.registeredEvents = [];\n _this.containerElement = null;\n _this.state = {\n infoBox: null,\n };\n _this.open = function (infoBox, anchor) {\n if (anchor) {\n if (_this.context !== null) {\n infoBox.open(_this.context, anchor);\n }\n }\n else if (infoBox.getPosition()) {\n if (_this.context !== null) {\n infoBox.open(_this.context);\n }\n }\n else {\n invariant$1(false, 'You must provide either an anchor or a position prop for .');\n }\n };\n _this.setInfoBoxCallback = function () {\n if (_this.state.infoBox !== null && _this.containerElement !== null) {\n _this.state.infoBox.setContent(_this.containerElement);\n _this.open(_this.state.infoBox, _this.props.anchor);\n if (_this.props.onLoad) {\n _this.props.onLoad(_this.state.infoBox);\n }\n }\n };\n return _this;\n }\n InfoBoxComponent.prototype.componentDidMount = function () {\n var _a = this.props.options || {}, position = _a.position, infoBoxOptions = __rest$1(_a, [\"position\"]);\n var positionLatLng;\n if (position && !(position instanceof google.maps.LatLng)) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n positionLatLng = new google.maps.LatLng(position.lat, position.lng);\n }\n var infoBox = new InfoBox(__assign(__assign({}, infoBoxOptions), (positionLatLng ? { position: positionLatLng } : {})));\n this.containerElement = document.createElement('div');\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$d,\n eventMap: eventMap$d,\n prevProps: {},\n nextProps: this.props,\n instance: infoBox,\n });\n this.setState({ infoBox: infoBox }, this.setInfoBoxCallback);\n };\n InfoBoxComponent.prototype.componentDidUpdate = function (prevProps) {\n var infoBox = this.state.infoBox;\n if (infoBox !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$d,\n eventMap: eventMap$d,\n prevProps: prevProps,\n nextProps: this.props,\n instance: infoBox,\n });\n }\n };\n InfoBoxComponent.prototype.componentWillUnmount = function () {\n var onUnmount = this.props.onUnmount;\n var infoBox = this.state.infoBox;\n if (infoBox !== null) {\n if (onUnmount) {\n onUnmount(infoBox);\n }\n unregisterEvents(this.registeredEvents);\n infoBox.close();\n }\n };\n InfoBoxComponent.prototype.render = function () {\n return this.containerElement ? createPortal(Children.only(this.props.children), this.containerElement) : null;\n };\n InfoBoxComponent.contextType = MapContext;\n return InfoBoxComponent;\n}(PureComponent));\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nvar fastDeepEqual = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n\nvar equal = /*@__PURE__*/getDefaultExportFromCjs(fastDeepEqual);\n\nconst ARRAY_TYPES = [\n Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array,\n Int32Array, Uint32Array, Float32Array, Float64Array\n];\n\n/** @typedef {Int8ArrayConstructor | Uint8ArrayConstructor | Uint8ClampedArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor} TypedArrayConstructor */\n\nconst VERSION = 1; // serialized format version\nconst HEADER_SIZE = 8;\n\nclass KDBush {\n\n /**\n * Creates an index from raw `ArrayBuffer` data.\n * @param {ArrayBuffer} data\n */\n static from(data) {\n if (!(data instanceof ArrayBuffer)) {\n throw new Error('Data must be an instance of ArrayBuffer.');\n }\n const [magic, versionAndType] = new Uint8Array(data, 0, 2);\n if (magic !== 0xdb) {\n throw new Error('Data does not appear to be in a KDBush format.');\n }\n const version = versionAndType >> 4;\n if (version !== VERSION) {\n throw new Error(`Got v${version} data when expected v${VERSION}.`);\n }\n const ArrayType = ARRAY_TYPES[versionAndType & 0x0f];\n if (!ArrayType) {\n throw new Error('Unrecognized array type.');\n }\n const [nodeSize] = new Uint16Array(data, 2, 1);\n const [numItems] = new Uint32Array(data, 4, 1);\n\n return new KDBush(numItems, nodeSize, ArrayType, data);\n }\n\n /**\n * Creates an index that will hold a given number of items.\n * @param {number} numItems\n * @param {number} [nodeSize=64] Size of the KD-tree node (64 by default).\n * @param {TypedArrayConstructor} [ArrayType=Float64Array] The array type used for coordinates storage (`Float64Array` by default).\n * @param {ArrayBuffer} [data] (For internal use only)\n */\n constructor(numItems, nodeSize = 64, ArrayType = Float64Array, data) {\n if (isNaN(numItems) || numItems < 0) throw new Error(`Unpexpected numItems value: ${numItems}.`);\n\n this.numItems = +numItems;\n this.nodeSize = Math.min(Math.max(+nodeSize, 2), 65535);\n this.ArrayType = ArrayType;\n this.IndexArrayType = numItems < 65536 ? Uint16Array : Uint32Array;\n\n const arrayTypeIndex = ARRAY_TYPES.indexOf(this.ArrayType);\n const coordsByteSize = numItems * 2 * this.ArrayType.BYTES_PER_ELEMENT;\n const idsByteSize = numItems * this.IndexArrayType.BYTES_PER_ELEMENT;\n const padCoords = (8 - idsByteSize % 8) % 8;\n\n if (arrayTypeIndex < 0) {\n throw new Error(`Unexpected typed array class: ${ArrayType}.`);\n }\n\n if (data && (data instanceof ArrayBuffer)) { // reconstruct an index from a buffer\n this.data = data;\n this.ids = new this.IndexArrayType(this.data, HEADER_SIZE, numItems);\n this.coords = new this.ArrayType(this.data, HEADER_SIZE + idsByteSize + padCoords, numItems * 2);\n this._pos = numItems * 2;\n this._finished = true;\n } else { // initialize a new index\n this.data = new ArrayBuffer(HEADER_SIZE + coordsByteSize + idsByteSize + padCoords);\n this.ids = new this.IndexArrayType(this.data, HEADER_SIZE, numItems);\n this.coords = new this.ArrayType(this.data, HEADER_SIZE + idsByteSize + padCoords, numItems * 2);\n this._pos = 0;\n this._finished = false;\n\n // set header\n new Uint8Array(this.data, 0, 2).set([0xdb, (VERSION << 4) + arrayTypeIndex]);\n new Uint16Array(this.data, 2, 1)[0] = nodeSize;\n new Uint32Array(this.data, 4, 1)[0] = numItems;\n }\n }\n\n /**\n * Add a point to the index.\n * @param {number} x\n * @param {number} y\n * @returns {number} An incremental index associated with the added item (starting from `0`).\n */\n add(x, y) {\n const index = this._pos >> 1;\n this.ids[index] = index;\n this.coords[this._pos++] = x;\n this.coords[this._pos++] = y;\n return index;\n }\n\n /**\n * Perform indexing of the added points.\n */\n finish() {\n const numAdded = this._pos >> 1;\n if (numAdded !== this.numItems) {\n throw new Error(`Added ${numAdded} items when expected ${this.numItems}.`);\n }\n // kd-sort both arrays for efficient search\n sort(this.ids, this.coords, this.nodeSize, 0, this.numItems - 1, 0);\n\n this._finished = true;\n return this;\n }\n\n /**\n * Search the index for items within a given bounding box.\n * @param {number} minX\n * @param {number} minY\n * @param {number} maxX\n * @param {number} maxY\n * @returns {number[]} An array of indices correponding to the found items.\n */\n range(minX, minY, maxX, maxY) {\n if (!this._finished) throw new Error('Data not yet indexed - call index.finish().');\n\n const {ids, coords, nodeSize} = this;\n const stack = [0, ids.length - 1, 0];\n const result = [];\n\n // recursively search for items in range in the kd-sorted arrays\n while (stack.length) {\n const axis = stack.pop() || 0;\n const right = stack.pop() || 0;\n const left = stack.pop() || 0;\n\n // if we reached \"tree node\", search linearly\n if (right - left <= nodeSize) {\n for (let i = left; i <= right; i++) {\n const x = coords[2 * i];\n const y = coords[2 * i + 1];\n if (x >= minX && x <= maxX && y >= minY && y <= maxY) result.push(ids[i]);\n }\n continue;\n }\n\n // otherwise find the middle index\n const m = (left + right) >> 1;\n\n // include the middle item if it's in range\n const x = coords[2 * m];\n const y = coords[2 * m + 1];\n if (x >= minX && x <= maxX && y >= minY && y <= maxY) result.push(ids[m]);\n\n // queue search in halves that intersect the query\n if (axis === 0 ? minX <= x : minY <= y) {\n stack.push(left);\n stack.push(m - 1);\n stack.push(1 - axis);\n }\n if (axis === 0 ? maxX >= x : maxY >= y) {\n stack.push(m + 1);\n stack.push(right);\n stack.push(1 - axis);\n }\n }\n\n return result;\n }\n\n /**\n * Search the index for items within a given radius.\n * @param {number} qx\n * @param {number} qy\n * @param {number} r Query radius.\n * @returns {number[]} An array of indices correponding to the found items.\n */\n within(qx, qy, r) {\n if (!this._finished) throw new Error('Data not yet indexed - call index.finish().');\n\n const {ids, coords, nodeSize} = this;\n const stack = [0, ids.length - 1, 0];\n const result = [];\n const r2 = r * r;\n\n // recursively search for items within radius in the kd-sorted arrays\n while (stack.length) {\n const axis = stack.pop() || 0;\n const right = stack.pop() || 0;\n const left = stack.pop() || 0;\n\n // if we reached \"tree node\", search linearly\n if (right - left <= nodeSize) {\n for (let i = left; i <= right; i++) {\n if (sqDist(coords[2 * i], coords[2 * i + 1], qx, qy) <= r2) result.push(ids[i]);\n }\n continue;\n }\n\n // otherwise find the middle index\n const m = (left + right) >> 1;\n\n // include the middle item if it's in range\n const x = coords[2 * m];\n const y = coords[2 * m + 1];\n if (sqDist(x, y, qx, qy) <= r2) result.push(ids[m]);\n\n // queue search in halves that intersect the query\n if (axis === 0 ? qx - r <= x : qy - r <= y) {\n stack.push(left);\n stack.push(m - 1);\n stack.push(1 - axis);\n }\n if (axis === 0 ? qx + r >= x : qy + r >= y) {\n stack.push(m + 1);\n stack.push(right);\n stack.push(1 - axis);\n }\n }\n\n return result;\n }\n}\n\n/**\n * @param {Uint16Array | Uint32Array} ids\n * @param {InstanceType} coords\n * @param {number} nodeSize\n * @param {number} left\n * @param {number} right\n * @param {number} axis\n */\nfunction sort(ids, coords, nodeSize, left, right, axis) {\n if (right - left <= nodeSize) return;\n\n const m = (left + right) >> 1; // middle index\n\n // sort ids and coords around the middle index so that the halves lie\n // either left/right or top/bottom correspondingly (taking turns)\n select(ids, coords, m, left, right, axis);\n\n // recursively kd-sort first half and second half on the opposite axis\n sort(ids, coords, nodeSize, left, m - 1, 1 - axis);\n sort(ids, coords, nodeSize, m + 1, right, 1 - axis);\n}\n\n/**\n * Custom Floyd-Rivest selection algorithm: sort ids and coords so that\n * [left..k-1] items are smaller than k-th item (on either x or y axis)\n * @param {Uint16Array | Uint32Array} ids\n * @param {InstanceType} coords\n * @param {number} k\n * @param {number} left\n * @param {number} right\n * @param {number} axis\n */\nfunction select(ids, coords, k, left, right, axis) {\n\n while (right > left) {\n if (right - left > 600) {\n const n = right - left + 1;\n const m = k - left + 1;\n const z = Math.log(n);\n const s = 0.5 * Math.exp(2 * z / 3);\n const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n select(ids, coords, k, newLeft, newRight, axis);\n }\n\n const t = coords[2 * k + axis];\n let i = left;\n let j = right;\n\n swapItem(ids, coords, left, k);\n if (coords[2 * right + axis] > t) swapItem(ids, coords, left, right);\n\n while (i < j) {\n swapItem(ids, coords, i, j);\n i++;\n j--;\n while (coords[2 * i + axis] < t) i++;\n while (coords[2 * j + axis] > t) j--;\n }\n\n if (coords[2 * left + axis] === t) swapItem(ids, coords, left, j);\n else {\n j++;\n swapItem(ids, coords, j, right);\n }\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n}\n\n/**\n * @param {Uint16Array | Uint32Array} ids\n * @param {InstanceType} coords\n * @param {number} i\n * @param {number} j\n */\nfunction swapItem(ids, coords, i, j) {\n swap(ids, i, j);\n swap(coords, 2 * i, 2 * j);\n swap(coords, 2 * i + 1, 2 * j + 1);\n}\n\n/**\n * @param {InstanceType} arr\n * @param {number} i\n * @param {number} j\n */\nfunction swap(arr, i, j) {\n const tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n}\n\n/**\n * @param {number} ax\n * @param {number} ay\n * @param {number} bx\n * @param {number} by\n */\nfunction sqDist(ax, ay, bx, by) {\n const dx = ax - bx;\n const dy = ay - by;\n return dx * dx + dy * dy;\n}\n\nconst defaultOptions$2 = {\n minZoom: 0, // min zoom to generate clusters on\n maxZoom: 16, // max zoom level to cluster the points on\n minPoints: 2, // minimum points to form a cluster\n radius: 40, // cluster radius in pixels\n extent: 512, // tile extent (radius is calculated relative to it)\n nodeSize: 64, // size of the KD-tree leaf node, affects performance\n log: false, // whether to log timing info\n\n // whether to generate numeric ids for input features (in vector tiles)\n generateId: false,\n\n // a reduce function for calculating custom cluster properties\n reduce: null, // (accumulated, props) => { accumulated.sum += props.sum; }\n\n // properties to use for individual points when running the reducer\n map: props => props // props => ({sum: props.my_value})\n};\n\nconst fround = Math.fround || (tmp => ((x) => { tmp[0] = +x; return tmp[0]; }))(new Float32Array(1));\n\nconst OFFSET_ZOOM = 2;\nconst OFFSET_ID = 3;\nconst OFFSET_PARENT = 4;\nconst OFFSET_NUM = 5;\nconst OFFSET_PROP = 6;\n\nclass Supercluster {\n constructor(options) {\n this.options = Object.assign(Object.create(defaultOptions$2), options);\n this.trees = new Array(this.options.maxZoom + 1);\n this.stride = this.options.reduce ? 7 : 6;\n this.clusterProps = [];\n }\n\n load(points) {\n const {log, minZoom, maxZoom} = this.options;\n\n if (log) console.time('total time');\n\n const timerId = `prepare ${ points.length } points`;\n if (log) console.time(timerId);\n\n this.points = points;\n\n // generate a cluster object for each point and index input points into a KD-tree\n const data = [];\n\n for (let i = 0; i < points.length; i++) {\n const p = points[i];\n if (!p.geometry) continue;\n\n const [lng, lat] = p.geometry.coordinates;\n const x = fround(lngX(lng));\n const y = fround(latY(lat));\n // store internal point/cluster data in flat numeric arrays for performance\n data.push(\n x, y, // projected point coordinates\n Infinity, // the last zoom the point was processed at\n i, // index of the source feature in the original input array\n -1, // parent cluster id\n 1 // number of points in a cluster\n );\n if (this.options.reduce) data.push(0); // noop\n }\n let tree = this.trees[maxZoom + 1] = this._createTree(data);\n\n if (log) console.timeEnd(timerId);\n\n // cluster points on max zoom, then cluster the results on previous zoom, etc.;\n // results in a cluster hierarchy across zoom levels\n for (let z = maxZoom; z >= minZoom; z--) {\n const now = +Date.now();\n\n // create a new set of clusters for the zoom and index them with a KD-tree\n tree = this.trees[z] = this._createTree(this._cluster(tree, z));\n\n if (log) console.log('z%d: %d clusters in %dms', z, tree.numItems, +Date.now() - now);\n }\n\n if (log) console.timeEnd('total time');\n\n return this;\n }\n\n getClusters(bbox, zoom) {\n let minLng = ((bbox[0] + 180) % 360 + 360) % 360 - 180;\n const minLat = Math.max(-90, Math.min(90, bbox[1]));\n let maxLng = bbox[2] === 180 ? 180 : ((bbox[2] + 180) % 360 + 360) % 360 - 180;\n const maxLat = Math.max(-90, Math.min(90, bbox[3]));\n\n if (bbox[2] - bbox[0] >= 360) {\n minLng = -180;\n maxLng = 180;\n } else if (minLng > maxLng) {\n const easternHem = this.getClusters([minLng, minLat, 180, maxLat], zoom);\n const westernHem = this.getClusters([-180, minLat, maxLng, maxLat], zoom);\n return easternHem.concat(westernHem);\n }\n\n const tree = this.trees[this._limitZoom(zoom)];\n const ids = tree.range(lngX(minLng), latY(maxLat), lngX(maxLng), latY(minLat));\n const data = tree.data;\n const clusters = [];\n for (const id of ids) {\n const k = this.stride * id;\n clusters.push(data[k + OFFSET_NUM] > 1 ? getClusterJSON(data, k, this.clusterProps) : this.points[data[k + OFFSET_ID]]);\n }\n return clusters;\n }\n\n getChildren(clusterId) {\n const originId = this._getOriginId(clusterId);\n const originZoom = this._getOriginZoom(clusterId);\n const errorMsg = 'No cluster with the specified id.';\n\n const tree = this.trees[originZoom];\n if (!tree) throw new Error(errorMsg);\n\n const data = tree.data;\n if (originId * this.stride >= data.length) throw new Error(errorMsg);\n\n const r = this.options.radius / (this.options.extent * Math.pow(2, originZoom - 1));\n const x = data[originId * this.stride];\n const y = data[originId * this.stride + 1];\n const ids = tree.within(x, y, r);\n const children = [];\n for (const id of ids) {\n const k = id * this.stride;\n if (data[k + OFFSET_PARENT] === clusterId) {\n children.push(data[k + OFFSET_NUM] > 1 ? getClusterJSON(data, k, this.clusterProps) : this.points[data[k + OFFSET_ID]]);\n }\n }\n\n if (children.length === 0) throw new Error(errorMsg);\n\n return children;\n }\n\n getLeaves(clusterId, limit, offset) {\n limit = limit || 10;\n offset = offset || 0;\n\n const leaves = [];\n this._appendLeaves(leaves, clusterId, limit, offset, 0);\n\n return leaves;\n }\n\n getTile(z, x, y) {\n const tree = this.trees[this._limitZoom(z)];\n const z2 = Math.pow(2, z);\n const {extent, radius} = this.options;\n const p = radius / extent;\n const top = (y - p) / z2;\n const bottom = (y + 1 + p) / z2;\n\n const tile = {\n features: []\n };\n\n this._addTileFeatures(\n tree.range((x - p) / z2, top, (x + 1 + p) / z2, bottom),\n tree.data, x, y, z2, tile);\n\n if (x === 0) {\n this._addTileFeatures(\n tree.range(1 - p / z2, top, 1, bottom),\n tree.data, z2, y, z2, tile);\n }\n if (x === z2 - 1) {\n this._addTileFeatures(\n tree.range(0, top, p / z2, bottom),\n tree.data, -1, y, z2, tile);\n }\n\n return tile.features.length ? tile : null;\n }\n\n getClusterExpansionZoom(clusterId) {\n let expansionZoom = this._getOriginZoom(clusterId) - 1;\n while (expansionZoom <= this.options.maxZoom) {\n const children = this.getChildren(clusterId);\n expansionZoom++;\n if (children.length !== 1) break;\n clusterId = children[0].properties.cluster_id;\n }\n return expansionZoom;\n }\n\n _appendLeaves(result, clusterId, limit, offset, skipped) {\n const children = this.getChildren(clusterId);\n\n for (const child of children) {\n const props = child.properties;\n\n if (props && props.cluster) {\n if (skipped + props.point_count <= offset) {\n // skip the whole cluster\n skipped += props.point_count;\n } else {\n // enter the cluster\n skipped = this._appendLeaves(result, props.cluster_id, limit, offset, skipped);\n // exit the cluster\n }\n } else if (skipped < offset) {\n // skip a single point\n skipped++;\n } else {\n // add a single point\n result.push(child);\n }\n if (result.length === limit) break;\n }\n\n return skipped;\n }\n\n _createTree(data) {\n const tree = new KDBush(data.length / this.stride | 0, this.options.nodeSize, Float32Array);\n for (let i = 0; i < data.length; i += this.stride) tree.add(data[i], data[i + 1]);\n tree.finish();\n tree.data = data;\n return tree;\n }\n\n _addTileFeatures(ids, data, x, y, z2, tile) {\n for (const i of ids) {\n const k = i * this.stride;\n const isCluster = data[k + OFFSET_NUM] > 1;\n\n let tags, px, py;\n if (isCluster) {\n tags = getClusterProperties(data, k, this.clusterProps);\n px = data[k];\n py = data[k + 1];\n } else {\n const p = this.points[data[k + OFFSET_ID]];\n tags = p.properties;\n const [lng, lat] = p.geometry.coordinates;\n px = lngX(lng);\n py = latY(lat);\n }\n\n const f = {\n type: 1,\n geometry: [[\n Math.round(this.options.extent * (px * z2 - x)),\n Math.round(this.options.extent * (py * z2 - y))\n ]],\n tags\n };\n\n // assign id\n let id;\n if (isCluster || this.options.generateId) {\n // optionally generate id for points\n id = data[k + OFFSET_ID];\n } else {\n // keep id if already assigned\n id = this.points[data[k + OFFSET_ID]].id;\n }\n\n if (id !== undefined) f.id = id;\n\n tile.features.push(f);\n }\n }\n\n _limitZoom(z) {\n return Math.max(this.options.minZoom, Math.min(Math.floor(+z), this.options.maxZoom + 1));\n }\n\n _cluster(tree, zoom) {\n const {radius, extent, reduce, minPoints} = this.options;\n const r = radius / (extent * Math.pow(2, zoom));\n const data = tree.data;\n const nextData = [];\n const stride = this.stride;\n\n // loop through each point\n for (let i = 0; i < data.length; i += stride) {\n // if we've already visited the point at this zoom level, skip it\n if (data[i + OFFSET_ZOOM] <= zoom) continue;\n data[i + OFFSET_ZOOM] = zoom;\n\n // find all nearby points\n const x = data[i];\n const y = data[i + 1];\n const neighborIds = tree.within(data[i], data[i + 1], r);\n\n const numPointsOrigin = data[i + OFFSET_NUM];\n let numPoints = numPointsOrigin;\n\n // count the number of points in a potential cluster\n for (const neighborId of neighborIds) {\n const k = neighborId * stride;\n // filter out neighbors that are already processed\n if (data[k + OFFSET_ZOOM] > zoom) numPoints += data[k + OFFSET_NUM];\n }\n\n // if there were neighbors to merge, and there are enough points to form a cluster\n if (numPoints > numPointsOrigin && numPoints >= minPoints) {\n let wx = x * numPointsOrigin;\n let wy = y * numPointsOrigin;\n\n let clusterProperties;\n let clusterPropIndex = -1;\n\n // encode both zoom and point index on which the cluster originated -- offset by total length of features\n const id = ((i / stride | 0) << 5) + (zoom + 1) + this.points.length;\n\n for (const neighborId of neighborIds) {\n const k = neighborId * stride;\n\n if (data[k + OFFSET_ZOOM] <= zoom) continue;\n data[k + OFFSET_ZOOM] = zoom; // save the zoom (so it doesn't get processed twice)\n\n const numPoints2 = data[k + OFFSET_NUM];\n wx += data[k] * numPoints2; // accumulate coordinates for calculating weighted center\n wy += data[k + 1] * numPoints2;\n\n data[k + OFFSET_PARENT] = id;\n\n if (reduce) {\n if (!clusterProperties) {\n clusterProperties = this._map(data, i, true);\n clusterPropIndex = this.clusterProps.length;\n this.clusterProps.push(clusterProperties);\n }\n reduce(clusterProperties, this._map(data, k));\n }\n }\n\n data[i + OFFSET_PARENT] = id;\n nextData.push(wx / numPoints, wy / numPoints, Infinity, id, -1, numPoints);\n if (reduce) nextData.push(clusterPropIndex);\n\n } else { // left points as unclustered\n for (let j = 0; j < stride; j++) nextData.push(data[i + j]);\n\n if (numPoints > 1) {\n for (const neighborId of neighborIds) {\n const k = neighborId * stride;\n if (data[k + OFFSET_ZOOM] <= zoom) continue;\n data[k + OFFSET_ZOOM] = zoom;\n for (let j = 0; j < stride; j++) nextData.push(data[k + j]);\n }\n }\n }\n }\n\n return nextData;\n }\n\n // get index of the point from which the cluster originated\n _getOriginId(clusterId) {\n return (clusterId - this.points.length) >> 5;\n }\n\n // get zoom of the point from which the cluster originated\n _getOriginZoom(clusterId) {\n return (clusterId - this.points.length) % 32;\n }\n\n _map(data, i, clone) {\n if (data[i + OFFSET_NUM] > 1) {\n const props = this.clusterProps[data[i + OFFSET_PROP]];\n return clone ? Object.assign({}, props) : props;\n }\n const original = this.points[data[i + OFFSET_ID]].properties;\n const result = this.options.map(original);\n return clone && result === original ? Object.assign({}, result) : result;\n }\n}\n\nfunction getClusterJSON(data, i, clusterProps) {\n return {\n type: 'Feature',\n id: data[i + OFFSET_ID],\n properties: getClusterProperties(data, i, clusterProps),\n geometry: {\n type: 'Point',\n coordinates: [xLng(data[i]), yLat(data[i + 1])]\n }\n };\n}\n\nfunction getClusterProperties(data, i, clusterProps) {\n const count = data[i + OFFSET_NUM];\n const abbrev =\n count >= 10000 ? `${Math.round(count / 1000) }k` :\n count >= 1000 ? `${Math.round(count / 100) / 10 }k` : count;\n const propIndex = data[i + OFFSET_PROP];\n const properties = propIndex === -1 ? {} : Object.assign({}, clusterProps[propIndex]);\n return Object.assign(properties, {\n cluster: true,\n cluster_id: data[i + OFFSET_ID],\n point_count: count,\n point_count_abbreviated: abbrev\n });\n}\n\n// longitude/latitude to spherical mercator in [0..1] range\nfunction lngX(lng) {\n return lng / 360 + 0.5;\n}\nfunction latY(lat) {\n const sin = Math.sin(lat * Math.PI / 180);\n const y = (0.5 - 0.25 * Math.log((1 + sin) / (1 - sin)) / Math.PI);\n return y < 0 ? 0 : y > 1 ? 1 : y;\n}\n\n// spherical mercator to longitude/latitude\nfunction xLng(x) {\n return (x - 0.5) * 360;\n}\nfunction yLat(y) {\n const y2 = (180 - y * 360) * Math.PI / 180;\n return 360 * Math.atan(Math.exp(y2)) / Math.PI - 90;\n}\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\n\n/**\n * Copyright 2023 Google LLC\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/**\n * util class that creates a common set of convenience functions to wrap\n * shared behavior of Advanced Markers and Markers.\n */\nclass MarkerUtils {\n static isAdvancedMarkerAvailable(map) {\n return (google.maps.marker &&\n map.getMapCapabilities().isAdvancedMarkersAvailable === true);\n }\n static isAdvancedMarker(marker) {\n return (google.maps.marker &&\n marker instanceof google.maps.marker.AdvancedMarkerElement);\n }\n static setMap(marker, map) {\n if (this.isAdvancedMarker(marker)) {\n marker.map = map;\n }\n else {\n marker.setMap(map);\n }\n }\n static getPosition(marker) {\n // SuperClusterAlgorithm.calculate expects a LatLng instance so we fake it for Adv Markers\n if (this.isAdvancedMarker(marker)) {\n if (marker.position) {\n if (marker.position instanceof google.maps.LatLng) {\n return marker.position;\n }\n // since we can't cast to LatLngLiteral for reasons =(\n if (marker.position.lat && marker.position.lng) {\n return new google.maps.LatLng(marker.position.lat, marker.position.lng);\n }\n }\n return new google.maps.LatLng(null);\n }\n return marker.getPosition();\n }\n static getVisible(marker) {\n if (this.isAdvancedMarker(marker)) {\n /**\n * Always return true for Advanced Markers because the clusterer\n * uses getVisible as a way to count legacy markers not as an actual\n * indicator of visibility for some reason. Even when markers are hidden\n * Marker.getVisible returns `true` and this is used to set the marker count\n * on the cluster. See the behavior of Cluster.count\n */\n return true;\n }\n return marker.getVisible();\n }\n}\n\n/**\n * Copyright 2021 Google LLC\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 */\nclass Cluster {\n constructor({ markers, position }) {\n this.markers = markers;\n if (position) {\n if (position instanceof google.maps.LatLng) {\n this._position = position;\n }\n else {\n this._position = new google.maps.LatLng(position);\n }\n }\n }\n get bounds() {\n if (this.markers.length === 0 && !this._position) {\n return;\n }\n const bounds = new google.maps.LatLngBounds(this._position, this._position);\n for (const marker of this.markers) {\n bounds.extend(MarkerUtils.getPosition(marker));\n }\n return bounds;\n }\n get position() {\n return this._position || this.bounds.getCenter();\n }\n /**\n * Get the count of **visible** markers.\n */\n get count() {\n return this.markers.filter((m) => MarkerUtils.getVisible(m)).length;\n }\n /**\n * Add a marker to the cluster.\n */\n push(marker) {\n this.markers.push(marker);\n }\n /**\n * Cleanup references and remove marker from map.\n */\n delete() {\n if (this.marker) {\n MarkerUtils.setMap(this.marker, null);\n this.marker = undefined;\n }\n this.markers.length = 0;\n }\n}\n\n/**\n * Copyright 2021 Google LLC\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/**\n * Returns the markers visible in a padded map viewport\n *\n * @param map\n * @param mapCanvasProjection\n * @param markers The list of marker to filter\n * @param viewportPaddingPixels The padding in pixel\n * @returns The list of markers in the padded viewport\n */\nconst filterMarkersToPaddedViewport = (map, mapCanvasProjection, markers, viewportPaddingPixels) => {\n const extendedMapBounds = extendBoundsToPaddedViewport(map.getBounds(), mapCanvasProjection, viewportPaddingPixels);\n return markers.filter((marker) => extendedMapBounds.contains(MarkerUtils.getPosition(marker)));\n};\n/**\n * Extends a bounds by a number of pixels in each direction\n */\nconst extendBoundsToPaddedViewport = (bounds, projection, numPixels) => {\n const { northEast, southWest } = latLngBoundsToPixelBounds(bounds, projection);\n const extendedPixelBounds = extendPixelBounds({ northEast, southWest }, numPixels);\n return pixelBoundsToLatLngBounds(extendedPixelBounds, projection);\n};\n/**\n * Gets the extended bounds as a bbox [westLng, southLat, eastLng, northLat]\n */\nconst getPaddedViewport = (bounds, projection, pixels) => {\n const extended = extendBoundsToPaddedViewport(bounds, projection, pixels);\n const ne = extended.getNorthEast();\n const sw = extended.getSouthWest();\n return [sw.lng(), sw.lat(), ne.lng(), ne.lat()];\n};\n/**\n * Returns the distance between 2 positions.\n *\n * @hidden\n */\nconst distanceBetweenPoints = (p1, p2) => {\n const R = 6371; // Radius of the Earth in km\n const dLat = ((p2.lat - p1.lat) * Math.PI) / 180;\n const dLon = ((p2.lng - p1.lng) * Math.PI) / 180;\n const sinDLat = Math.sin(dLat / 2);\n const sinDLon = Math.sin(dLon / 2);\n const a = sinDLat * sinDLat +\n Math.cos((p1.lat * Math.PI) / 180) *\n Math.cos((p2.lat * Math.PI) / 180) *\n sinDLon *\n sinDLon;\n const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n return R * c;\n};\n/**\n * Converts a LatLng bound to pixels.\n *\n * @hidden\n */\nconst latLngBoundsToPixelBounds = (bounds, projection) => {\n return {\n northEast: projection.fromLatLngToDivPixel(bounds.getNorthEast()),\n southWest: projection.fromLatLngToDivPixel(bounds.getSouthWest()),\n };\n};\n/**\n * Extends a pixel bounds by numPixels in all directions.\n *\n * @hidden\n */\nconst extendPixelBounds = ({ northEast, southWest }, numPixels) => {\n northEast.x += numPixels;\n northEast.y -= numPixels;\n southWest.x -= numPixels;\n southWest.y += numPixels;\n return { northEast, southWest };\n};\n/**\n * @hidden\n */\nconst pixelBoundsToLatLngBounds = ({ northEast, southWest }, projection) => {\n const sw = projection.fromDivPixelToLatLng(southWest);\n const ne = projection.fromDivPixelToLatLng(northEast);\n return new google.maps.LatLngBounds(sw, ne);\n};\n\n/**\n * Copyright 2021 Google LLC\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/**\n * @hidden\n */\nclass AbstractAlgorithm {\n constructor({ maxZoom = 16 }) {\n this.maxZoom = maxZoom;\n }\n /**\n * Helper function to bypass clustering based upon some map state such as\n * zoom, number of markers, etc.\n *\n * ```typescript\n * cluster({markers, map}: AlgorithmInput): Cluster[] {\n * if (shouldBypassClustering(map)) {\n * return this.noop({markers})\n * }\n * }\n * ```\n */\n noop({ markers, }) {\n return noop$1(markers);\n }\n}\n/**\n * Abstract viewport algorithm proves a class to filter markers by a padded\n * viewport. This is a common optimization.\n *\n * @hidden\n */\nclass AbstractViewportAlgorithm extends AbstractAlgorithm {\n constructor(_a) {\n var { viewportPadding = 60 } = _a, options = __rest(_a, [\"viewportPadding\"]);\n super(options);\n this.viewportPadding = 60;\n this.viewportPadding = viewportPadding;\n }\n calculate({ markers, map, mapCanvasProjection, }) {\n if (map.getZoom() >= this.maxZoom) {\n return {\n clusters: this.noop({\n markers,\n }),\n changed: false,\n };\n }\n return {\n clusters: this.cluster({\n markers: filterMarkersToPaddedViewport(map, mapCanvasProjection, markers, this.viewportPadding),\n map,\n mapCanvasProjection,\n }),\n };\n }\n}\n/**\n * @hidden\n */\nconst noop$1 = (markers) => {\n const clusters = markers.map((marker) => new Cluster({\n position: MarkerUtils.getPosition(marker),\n markers: [marker],\n }));\n return clusters;\n};\n\n/**\n * Copyright 2021 Google LLC\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/**\n * The default Grid algorithm historically used in Google Maps marker\n * clustering.\n *\n * The Grid algorithm does not implement caching and markers may flash as the\n * viewport changes. Instead use {@link SuperClusterAlgorithm}.\n */\nclass GridAlgorithm extends AbstractViewportAlgorithm {\n constructor(_a) {\n var { maxDistance = 40000, gridSize = 40 } = _a, options = __rest(_a, [\"maxDistance\", \"gridSize\"]);\n super(options);\n this.clusters = [];\n this.state = { zoom: -1 };\n this.maxDistance = maxDistance;\n this.gridSize = gridSize;\n }\n calculate({ markers, map, mapCanvasProjection, }) {\n const state = { zoom: map.getZoom() };\n let changed = false;\n if (this.state.zoom >= this.maxZoom && state.zoom >= this.maxZoom) ;\n else {\n changed = !equal(this.state, state);\n }\n this.state = state;\n if (map.getZoom() >= this.maxZoom) {\n return {\n clusters: this.noop({\n markers,\n }),\n changed,\n };\n }\n return {\n clusters: this.cluster({\n markers: filterMarkersToPaddedViewport(map, mapCanvasProjection, markers, this.viewportPadding),\n map,\n mapCanvasProjection,\n }),\n };\n }\n cluster({ markers, map, mapCanvasProjection, }) {\n this.clusters = [];\n markers.forEach((marker) => {\n this.addToClosestCluster(marker, map, mapCanvasProjection);\n });\n return this.clusters;\n }\n addToClosestCluster(marker, map, projection) {\n let maxDistance = this.maxDistance; // Some large number\n let cluster = null;\n for (let i = 0; i < this.clusters.length; i++) {\n const candidate = this.clusters[i];\n const distance = distanceBetweenPoints(candidate.bounds.getCenter().toJSON(), MarkerUtils.getPosition(marker).toJSON());\n if (distance < maxDistance) {\n maxDistance = distance;\n cluster = candidate;\n }\n }\n if (cluster &&\n extendBoundsToPaddedViewport(cluster.bounds, projection, this.gridSize).contains(MarkerUtils.getPosition(marker))) {\n cluster.push(marker);\n }\n else {\n const cluster = new Cluster({ markers: [marker] });\n this.clusters.push(cluster);\n }\n }\n}\n\n/**\n * Copyright 2021 Google LLC\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/**\n * Noop algorithm does not generate any clusters or filter markers by the an extended viewport.\n */\nclass NoopAlgorithm extends AbstractAlgorithm {\n constructor(_a) {\n var options = __rest(_a, []);\n super(options);\n }\n calculate({ markers, map, mapCanvasProjection, }) {\n return {\n clusters: this.cluster({ markers, map, mapCanvasProjection }),\n changed: false,\n };\n }\n cluster(input) {\n return this.noop(input);\n }\n}\n\n/**\n * Copyright 2021 Google LLC\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/**\n * A very fast JavaScript algorithm for geospatial point clustering using KD trees.\n *\n * @see https://www.npmjs.com/package/supercluster for more information on options.\n */\nclass SuperClusterAlgorithm extends AbstractAlgorithm {\n constructor(_a) {\n var { maxZoom, radius = 60 } = _a, options = __rest(_a, [\"maxZoom\", \"radius\"]);\n super({ maxZoom });\n this.state = { zoom: -1 };\n this.superCluster = new Supercluster(Object.assign({ maxZoom: this.maxZoom, radius }, options));\n }\n calculate(input) {\n let changed = false;\n const state = { zoom: input.map.getZoom() };\n if (!equal(input.markers, this.markers)) {\n changed = true;\n // TODO use proxy to avoid copy?\n this.markers = [...input.markers];\n const points = this.markers.map((marker) => {\n const position = MarkerUtils.getPosition(marker);\n const coordinates = [position.lng(), position.lat()];\n return {\n type: \"Feature\",\n geometry: {\n type: \"Point\",\n coordinates,\n },\n properties: { marker },\n };\n });\n this.superCluster.load(points);\n }\n if (!changed) {\n if (this.state.zoom <= this.maxZoom || state.zoom <= this.maxZoom) {\n changed = !equal(this.state, state);\n }\n }\n this.state = state;\n if (changed) {\n this.clusters = this.cluster(input);\n }\n return { clusters: this.clusters, changed };\n }\n cluster({ map }) {\n return this.superCluster\n .getClusters([-180, -90, 180, 90], Math.round(map.getZoom()))\n .map((feature) => this.transformCluster(feature));\n }\n transformCluster({ geometry: { coordinates: [lng, lat], }, properties, }) {\n if (properties.cluster) {\n return new Cluster({\n markers: this.superCluster\n .getLeaves(properties.cluster_id, Infinity)\n .map((leaf) => leaf.properties.marker),\n position: { lat, lng },\n });\n }\n const marker = properties.marker;\n return new Cluster({\n markers: [marker],\n position: MarkerUtils.getPosition(marker),\n });\n }\n}\n\n/**\n * Copyright 2021 Google LLC\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/**\n * A very fast JavaScript algorithm for geospatial point clustering using KD trees.\n *\n * @see https://www.npmjs.com/package/supercluster for more information on options.\n */\nclass SuperClusterViewportAlgorithm extends AbstractViewportAlgorithm {\n constructor(_a) {\n var { maxZoom, radius = 60, viewportPadding = 60 } = _a, options = __rest(_a, [\"maxZoom\", \"radius\", \"viewportPadding\"]);\n super({ maxZoom, viewportPadding });\n this.superCluster = new Supercluster(Object.assign({ maxZoom: this.maxZoom, radius }, options));\n this.state = { zoom: -1, view: [0, 0, 0, 0] };\n }\n calculate(input) {\n const state = {\n zoom: Math.round(input.map.getZoom()),\n view: getPaddedViewport(input.map.getBounds(), input.mapCanvasProjection, this.viewportPadding),\n };\n let changed = !equal(this.state, state);\n if (!equal(input.markers, this.markers)) {\n changed = true;\n // TODO use proxy to avoid copy?\n this.markers = [...input.markers];\n const points = this.markers.map((marker) => {\n const position = MarkerUtils.getPosition(marker);\n const coordinates = [position.lng(), position.lat()];\n return {\n type: \"Feature\",\n geometry: {\n type: \"Point\",\n coordinates,\n },\n properties: { marker },\n };\n });\n this.superCluster.load(points);\n }\n if (changed) {\n this.clusters = this.cluster(input);\n this.state = state;\n }\n return { clusters: this.clusters, changed };\n }\n cluster({ map, mapCanvasProjection }) {\n /* recalculate new state because we can't use the cached version. */\n const state = {\n zoom: Math.round(map.getZoom()),\n view: getPaddedViewport(map.getBounds(), mapCanvasProjection, this.viewportPadding),\n };\n return this.superCluster\n .getClusters(state.view, state.zoom)\n .map((feature) => this.transformCluster(feature));\n }\n transformCluster({ geometry: { coordinates: [lng, lat], }, properties, }) {\n if (properties.cluster) {\n return new Cluster({\n markers: this.superCluster\n .getLeaves(properties.cluster_id, Infinity)\n .map((leaf) => leaf.properties.marker),\n position: { lat, lng },\n });\n }\n const marker = properties.marker;\n return new Cluster({\n markers: [marker],\n position: MarkerUtils.getPosition(marker),\n });\n }\n}\n\n/**\n * Copyright 2021 Google LLC\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/**\n * Provides statistics on all clusters in the current render cycle for use in {@link Renderer.render}.\n */\nclass ClusterStats {\n constructor(markers, clusters) {\n this.markers = { sum: markers.length };\n const clusterMarkerCounts = clusters.map((a) => a.count);\n const clusterMarkerSum = clusterMarkerCounts.reduce((a, b) => a + b, 0);\n this.clusters = {\n count: clusters.length,\n markers: {\n mean: clusterMarkerSum / clusters.length,\n sum: clusterMarkerSum,\n min: Math.min(...clusterMarkerCounts),\n max: Math.max(...clusterMarkerCounts),\n },\n };\n }\n}\nclass DefaultRenderer {\n /**\n * The default render function for the library used by {@link MarkerClusterer}.\n *\n * Currently set to use the following:\n *\n * ```typescript\n * // change color if this cluster has more markers than the mean cluster\n * const color =\n * count > Math.max(10, stats.clusters.markers.mean)\n * ? \"#ff0000\"\n * : \"#0000ff\";\n *\n * // create svg url with fill color\n * const svg = window.btoa(`\n * \n * \n * \n * \n * \n * `);\n *\n * // create marker using svg icon\n * return new google.maps.Marker({\n * position,\n * icon: {\n * url: `data:image/svg+xml;base64,${svg}`,\n * scaledSize: new google.maps.Size(45, 45),\n * },\n * label: {\n * text: String(count),\n * color: \"rgba(255,255,255,0.9)\",\n * fontSize: \"12px\",\n * },\n * // adjust zIndex to be above other markers\n * zIndex: 1000 + count,\n * });\n * ```\n */\n render({ count, position }, stats, map) {\n // change color if this cluster has more markers than the mean cluster\n const color = count > Math.max(10, stats.clusters.markers.mean) ? \"#ff0000\" : \"#0000ff\";\n // create svg literal with fill color\n const svg = `\n\n\n\n${count}\n`;\n const title = `Cluster of ${count} markers`, \n // adjust zIndex to be above other markers\n zIndex = Number(google.maps.Marker.MAX_ZINDEX) + count;\n if (MarkerUtils.isAdvancedMarkerAvailable(map)) {\n // create cluster SVG element\n const parser = new DOMParser();\n const svgEl = parser.parseFromString(svg, \"image/svg+xml\").documentElement;\n svgEl.setAttribute(\"transform\", \"translate(0 25)\");\n const clusterOptions = {\n map,\n position,\n zIndex,\n title,\n content: svgEl,\n };\n return new google.maps.marker.AdvancedMarkerElement(clusterOptions);\n }\n const clusterOptions = {\n position,\n zIndex,\n title,\n icon: {\n url: `data:image/svg+xml;base64,${btoa(svg)}`,\n anchor: new google.maps.Point(25, 25),\n },\n };\n return new google.maps.Marker(clusterOptions);\n }\n}\n\n/**\n * Copyright 2019 Google LLC. All Rights Reserved.\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/**\n * Extends an object's prototype by another's.\n *\n * @param type1 The Type to be extended.\n * @param type2 The Type to extend with.\n * @ignore\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction extend(type1, type2) {\n /* istanbul ignore next */\n // eslint-disable-next-line prefer-const\n for (let property in type2.prototype) {\n type1.prototype[property] = type2.prototype[property];\n }\n}\n/**\n * @ignore\n */\nclass OverlayViewSafe {\n constructor() {\n // MarkerClusterer implements google.maps.OverlayView interface. We use the\n // extend function to extend MarkerClusterer with google.maps.OverlayView\n // because it might not always be available when the code is defined so we\n // look for it at the last possible moment. If it doesn't exist now then\n // there is no point going ahead :)\n extend(OverlayViewSafe, google.maps.OverlayView);\n }\n}\n\n/**\n * Copyright 2021 Google LLC\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 */\nvar MarkerClustererEvents;\n(function (MarkerClustererEvents) {\n MarkerClustererEvents[\"CLUSTERING_BEGIN\"] = \"clusteringbegin\";\n MarkerClustererEvents[\"CLUSTERING_END\"] = \"clusteringend\";\n MarkerClustererEvents[\"CLUSTER_CLICK\"] = \"click\";\n})(MarkerClustererEvents || (MarkerClustererEvents = {}));\nconst defaultOnClusterClickHandler = (_, cluster, map) => {\n map.fitBounds(cluster.bounds);\n};\n/**\n * MarkerClusterer creates and manages per-zoom-level clusters for large amounts\n * of markers. See {@link MarkerClustererOptions} for more details.\n *\n */\nclass MarkerClusterer extends OverlayViewSafe {\n constructor({ map, markers = [], algorithmOptions = {}, algorithm = new SuperClusterAlgorithm(algorithmOptions), renderer = new DefaultRenderer(), onClusterClick = defaultOnClusterClickHandler, }) {\n super();\n this.markers = [...markers];\n this.clusters = [];\n this.algorithm = algorithm;\n this.renderer = renderer;\n this.onClusterClick = onClusterClick;\n if (map) {\n this.setMap(map);\n }\n }\n addMarker(marker, noDraw) {\n if (this.markers.includes(marker)) {\n return;\n }\n this.markers.push(marker);\n if (!noDraw) {\n this.render();\n }\n }\n addMarkers(markers, noDraw) {\n markers.forEach((marker) => {\n this.addMarker(marker, true);\n });\n if (!noDraw) {\n this.render();\n }\n }\n removeMarker(marker, noDraw) {\n const index = this.markers.indexOf(marker);\n if (index === -1) {\n // Marker is not in our list of markers, so do nothing:\n return false;\n }\n MarkerUtils.setMap(marker, null);\n this.markers.splice(index, 1); // Remove the marker from the list of managed markers\n if (!noDraw) {\n this.render();\n }\n return true;\n }\n removeMarkers(markers, noDraw) {\n let removed = false;\n markers.forEach((marker) => {\n removed = this.removeMarker(marker, true) || removed;\n });\n if (removed && !noDraw) {\n this.render();\n }\n return removed;\n }\n clearMarkers(noDraw) {\n this.markers.length = 0;\n if (!noDraw) {\n this.render();\n }\n }\n /**\n * Recalculates and draws all the marker clusters.\n */\n render() {\n const map = this.getMap();\n if (map instanceof google.maps.Map && map.getProjection()) {\n google.maps.event.trigger(this, MarkerClustererEvents.CLUSTERING_BEGIN, this);\n const { clusters, changed } = this.algorithm.calculate({\n markers: this.markers,\n map,\n mapCanvasProjection: this.getProjection(),\n });\n // Allow algorithms to return flag on whether the clusters/markers have changed.\n if (changed || changed == undefined) {\n // Accumulate the markers of the clusters composed of a single marker.\n // Those clusters directly use the marker.\n // Clusters with more than one markers use a group marker generated by a renderer.\n const singleMarker = new Set();\n for (const cluster of clusters) {\n if (cluster.markers.length == 1) {\n singleMarker.add(cluster.markers[0]);\n }\n }\n const groupMarkers = [];\n // Iterate the clusters that are currently rendered.\n for (const cluster of this.clusters) {\n if (cluster.marker == null) {\n continue;\n }\n if (cluster.markers.length == 1) {\n if (!singleMarker.has(cluster.marker)) {\n // The marker:\n // - was previously rendered because it is from a cluster with 1 marker,\n // - should no more be rendered as it is not in singleMarker.\n MarkerUtils.setMap(cluster.marker, null);\n }\n }\n else {\n // Delay the removal of old group markers to avoid flickering.\n groupMarkers.push(cluster.marker);\n }\n }\n this.clusters = clusters;\n this.renderClusters();\n // Delayed removal of the markers of the former groups.\n requestAnimationFrame(() => groupMarkers.forEach((marker) => MarkerUtils.setMap(marker, null)));\n }\n google.maps.event.trigger(this, MarkerClustererEvents.CLUSTERING_END, this);\n }\n }\n onAdd() {\n this.idleListener = this.getMap().addListener(\"idle\", this.render.bind(this));\n this.render();\n }\n onRemove() {\n google.maps.event.removeListener(this.idleListener);\n this.reset();\n }\n reset() {\n this.markers.forEach((marker) => MarkerUtils.setMap(marker, null));\n this.clusters.forEach((cluster) => cluster.delete());\n this.clusters = [];\n }\n renderClusters() {\n // Generate stats to pass to renderers.\n const stats = new ClusterStats(this.markers, this.clusters);\n const map = this.getMap();\n this.clusters.forEach((cluster) => {\n if (cluster.markers.length === 1) {\n cluster.marker = cluster.markers[0];\n }\n else {\n // Generate the marker to represent the group.\n cluster.marker = this.renderer.render(cluster, stats, map);\n // Make sure all individual markers are removed from the map.\n cluster.markers.forEach((marker) => MarkerUtils.setMap(marker, null));\n if (this.onClusterClick) {\n cluster.marker.addListener(\"click\", \n /* istanbul ignore next */\n (event) => {\n google.maps.event.trigger(this, MarkerClustererEvents.CLUSTER_CLICK, cluster);\n this.onClusterClick(event, cluster, map);\n });\n }\n }\n MarkerUtils.setMap(cluster.marker, map);\n });\n }\n}\n\nvar index_esm = /*#__PURE__*/Object.freeze({\n __proto__: null,\n AbstractAlgorithm: AbstractAlgorithm,\n AbstractViewportAlgorithm: AbstractViewportAlgorithm,\n Cluster: Cluster,\n ClusterStats: ClusterStats,\n DefaultRenderer: DefaultRenderer,\n GridAlgorithm: GridAlgorithm,\n MarkerClusterer: MarkerClusterer,\n get MarkerClustererEvents () { return MarkerClustererEvents; },\n MarkerUtils: MarkerUtils,\n NoopAlgorithm: NoopAlgorithm,\n SuperClusterAlgorithm: SuperClusterAlgorithm,\n SuperClusterViewportAlgorithm: SuperClusterViewportAlgorithm,\n defaultOnClusterClickHandler: defaultOnClusterClickHandler,\n distanceBetweenPoints: distanceBetweenPoints,\n extendBoundsToPaddedViewport: extendBoundsToPaddedViewport,\n extendPixelBounds: extendPixelBounds,\n filterMarkersToPaddedViewport: filterMarkersToPaddedViewport,\n getPaddedViewport: getPaddedViewport,\n noop: noop$1,\n pixelBoundsToLatLngBounds: pixelBoundsToLatLngBounds\n});\n\nfunction useGoogleMarkerClusterer(options) {\n var map = useGoogleMap();\n var _a = useState(null), markerClusterer = _a[0], setMarkerClusterer = _a[1];\n useEffect(function () {\n if (map && markerClusterer === null) {\n var markerCluster = new MarkerClusterer(__assign(__assign({}, options), { map: map }));\n setMarkerClusterer(markerCluster);\n }\n }, [map]);\n return markerClusterer;\n}\n/** Wrapper around [@googlemaps/markerclusterer](https://github.com/googlemaps/js-markerclusterer)\n *\n * Accepts {@link MarkerClustererOptionsSubset} which is a subset of {@link MarkerClustererOptions}\n */\nfunction GoogleMarkerClusterer(_a) {\n var children = _a.children, options = _a.options;\n var markerClusterer = useGoogleMarkerClusterer(options);\n return markerClusterer !== null ? children(markerClusterer) : null;\n}\nvar GoogleMarkerClusterer$1 = memo(GoogleMarkerClusterer);\n\nvar eventMap$c = {\n onCloseClick: 'closeclick',\n onContentChanged: 'content_changed',\n onDomReady: 'domready',\n onPositionChanged: 'position_changed',\n onZindexChanged: 'zindex_changed',\n};\nvar updaterMap$c = {\n options: function (instance, options) {\n instance.setOptions(options);\n },\n position: function (instance, position) {\n instance.setPosition(position);\n },\n zIndex: function (instance, zIndex) {\n instance.setZIndex(zIndex);\n },\n};\nfunction InfoWindowFunctional(_a) {\n var children = _a.children, anchor = _a.anchor, options = _a.options, position = _a.position, zIndex = _a.zIndex, onCloseClick = _a.onCloseClick, onDomReady = _a.onDomReady, onContentChanged = _a.onContentChanged, onPositionChanged = _a.onPositionChanged, onZindexChanged = _a.onZindexChanged, onLoad = _a.onLoad, onUnmount = _a.onUnmount;\n var map = useContext(MapContext);\n var _b = useState(null), instance = _b[0], setInstance = _b[1];\n var _c = useState(null), closeclickListener = _c[0], setCloseClickListener = _c[1];\n var _d = useState(null), domreadyclickListener = _d[0], setDomReadyClickListener = _d[1];\n var _e = useState(null), contentchangedclickListener = _e[0], setContentChangedClickListener = _e[1];\n var _f = useState(null), positionchangedclickListener = _f[0], setPositionChangedClickListener = _f[1];\n var _g = useState(null), zindexchangedclickListener = _g[0], setZindexChangedClickListener = _g[1];\n var containerElementRef = useRef(null);\n // Order does matter\n useEffect(function () {\n if (instance !== null) {\n instance.close();\n if (anchor) {\n instance.open(map, anchor);\n }\n else if (instance.getPosition()) {\n instance.open(map);\n }\n }\n }, [map, instance, anchor]);\n useEffect(function () {\n if (options && instance !== null) {\n instance.setOptions(options);\n }\n }, [instance, options]);\n useEffect(function () {\n if (position && instance !== null) {\n instance.setPosition(position);\n }\n }, [position]);\n useEffect(function () {\n if (typeof zIndex === 'number' && instance !== null) {\n instance.setZIndex(zIndex);\n }\n }, [zIndex]);\n useEffect(function () {\n if (instance && onCloseClick) {\n if (closeclickListener !== null) {\n google.maps.event.removeListener(closeclickListener);\n }\n setCloseClickListener(google.maps.event.addListener(instance, 'closeclick', onCloseClick));\n }\n }, [onCloseClick]);\n useEffect(function () {\n if (instance && onDomReady) {\n if (domreadyclickListener !== null) {\n google.maps.event.removeListener(domreadyclickListener);\n }\n setDomReadyClickListener(google.maps.event.addListener(instance, 'domready', onDomReady));\n }\n }, [onDomReady]);\n useEffect(function () {\n if (instance && onContentChanged) {\n if (contentchangedclickListener !== null) {\n google.maps.event.removeListener(contentchangedclickListener);\n }\n setContentChangedClickListener(google.maps.event.addListener(instance, 'content_changed', onContentChanged));\n }\n }, [onContentChanged]);\n useEffect(function () {\n if (instance && onPositionChanged) {\n if (positionchangedclickListener !== null) {\n google.maps.event.removeListener(positionchangedclickListener);\n }\n setPositionChangedClickListener(google.maps.event.addListener(instance, 'position_changed', onPositionChanged));\n }\n }, [onPositionChanged]);\n useEffect(function () {\n if (instance && onZindexChanged) {\n if (zindexchangedclickListener !== null) {\n google.maps.event.removeListener(zindexchangedclickListener);\n }\n setZindexChangedClickListener(google.maps.event.addListener(instance, 'zindex_changed', onZindexChanged));\n }\n }, [onZindexChanged]);\n useEffect(function () {\n var infoWindow = new google.maps.InfoWindow(__assign({}, (options || {})));\n setInstance(infoWindow);\n containerElementRef.current = document.createElement('div');\n if (onCloseClick) {\n setCloseClickListener(google.maps.event.addListener(infoWindow, 'closeclick', onCloseClick));\n }\n if (onDomReady) {\n setDomReadyClickListener(google.maps.event.addListener(infoWindow, 'domready', onDomReady));\n }\n if (onContentChanged) {\n setContentChangedClickListener(google.maps.event.addListener(infoWindow, 'content_changed', onContentChanged));\n }\n if (onPositionChanged) {\n setPositionChangedClickListener(google.maps.event.addListener(infoWindow, 'position_changed', onPositionChanged));\n }\n if (onZindexChanged) {\n setZindexChangedClickListener(google.maps.event.addListener(infoWindow, 'zindex_changed', onZindexChanged));\n }\n infoWindow.setContent(containerElementRef.current);\n if (position) {\n infoWindow.setPosition(position);\n }\n if (zIndex) {\n infoWindow.setZIndex(zIndex);\n }\n if (anchor) {\n infoWindow.open(map, anchor);\n }\n else if (infoWindow.getPosition()) {\n infoWindow.open(map);\n }\n else {\n invariant$1(false, \"You must provide either an anchor (typically render it inside a ) or a position props for .\");\n }\n if (onLoad) {\n onLoad(infoWindow);\n }\n return function () {\n if (closeclickListener) {\n google.maps.event.removeListener(closeclickListener);\n }\n if (contentchangedclickListener) {\n google.maps.event.removeListener(contentchangedclickListener);\n }\n if (domreadyclickListener) {\n google.maps.event.removeListener(domreadyclickListener);\n }\n if (positionchangedclickListener) {\n google.maps.event.removeListener(positionchangedclickListener);\n }\n if (zindexchangedclickListener) {\n google.maps.event.removeListener(zindexchangedclickListener);\n }\n if (onUnmount) {\n onUnmount(infoWindow);\n }\n infoWindow.close();\n };\n }, []);\n return containerElementRef.current ? (createPortal(Children.only(children), containerElementRef.current)) : (null);\n}\nvar InfoWindowF = memo(InfoWindowFunctional);\nvar InfoWindow = /** @class */ (function (_super) {\n __extends(InfoWindow, _super);\n function InfoWindow() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.registeredEvents = [];\n _this.containerElement = null;\n _this.state = {\n infoWindow: null,\n };\n _this.open = function (infoWindow, anchor) {\n if (anchor) {\n infoWindow.open(_this.context, anchor);\n }\n else if (infoWindow.getPosition()) {\n infoWindow.open(_this.context);\n }\n else {\n invariant$1(false, \"You must provide either an anchor (typically render it inside a ) or a position props for .\");\n }\n };\n _this.setInfoWindowCallback = function () {\n if (_this.state.infoWindow !== null && _this.containerElement !== null) {\n _this.state.infoWindow.setContent(_this.containerElement);\n _this.open(_this.state.infoWindow, _this.props.anchor);\n if (_this.props.onLoad) {\n _this.props.onLoad(_this.state.infoWindow);\n }\n }\n };\n return _this;\n }\n InfoWindow.prototype.componentDidMount = function () {\n var infoWindow = new google.maps.InfoWindow(__assign({}, (this.props.options || {})));\n this.containerElement = document.createElement('div');\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$c,\n eventMap: eventMap$c,\n prevProps: {},\n nextProps: this.props,\n instance: infoWindow,\n });\n this.setState(function () {\n return {\n infoWindow: infoWindow,\n };\n }, this.setInfoWindowCallback);\n };\n InfoWindow.prototype.componentDidUpdate = function (prevProps) {\n if (this.state.infoWindow !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$c,\n eventMap: eventMap$c,\n prevProps: prevProps,\n nextProps: this.props,\n instance: this.state.infoWindow,\n });\n }\n };\n InfoWindow.prototype.componentWillUnmount = function () {\n if (this.state.infoWindow !== null) {\n unregisterEvents(this.registeredEvents);\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.infoWindow);\n }\n this.state.infoWindow.close();\n }\n };\n InfoWindow.prototype.render = function () {\n return this.containerElement ? (createPortal(Children.only(this.props.children), this.containerElement)) : (null);\n };\n InfoWindow.contextType = MapContext;\n return InfoWindow;\n}(PureComponent));\n\nvar eventMap$b = {\n onClick: 'click',\n onDblClick: 'dblclick',\n onDrag: 'drag',\n onDragEnd: 'dragend',\n onDragStart: 'dragstart',\n onMouseDown: 'mousedown',\n onMouseMove: 'mousemove',\n onMouseOut: 'mouseout',\n onMouseOver: 'mouseover',\n onMouseUp: 'mouseup',\n onRightClick: 'rightclick',\n};\nvar updaterMap$b = {\n draggable: function (instance, draggable) {\n instance.setDraggable(draggable);\n },\n editable: function (instance, editable) {\n instance.setEditable(editable);\n },\n map: function (instance, map) {\n instance.setMap(map);\n },\n options: function (instance, options) {\n instance.setOptions(options);\n },\n path: function (instance, path) {\n instance.setPath(path);\n },\n visible: function (instance, visible) {\n instance.setVisible(visible);\n },\n};\nvar defaultOptions$1 = {};\nfunction PolylineFunctional(_a) {\n var options = _a.options, draggable = _a.draggable, editable = _a.editable, visible = _a.visible, path = _a.path, onDblClick = _a.onDblClick, onDragEnd = _a.onDragEnd, onDragStart = _a.onDragStart, onMouseDown = _a.onMouseDown, onMouseMove = _a.onMouseMove, onMouseOut = _a.onMouseOut, onMouseOver = _a.onMouseOver, onMouseUp = _a.onMouseUp, onRightClick = _a.onRightClick, onClick = _a.onClick, onDrag = _a.onDrag, onLoad = _a.onLoad, onUnmount = _a.onUnmount;\n var map = useContext(MapContext);\n var _b = useState(null), instance = _b[0], setInstance = _b[1];\n var _c = useState(null), dblclickListener = _c[0], setDblclickListener = _c[1];\n var _d = useState(null), dragendListener = _d[0], setDragendListener = _d[1];\n var _e = useState(null), dragstartListener = _e[0], setDragstartListener = _e[1];\n var _f = useState(null), mousedownListener = _f[0], setMousedownListener = _f[1];\n var _g = useState(null), mousemoveListener = _g[0], setMousemoveListener = _g[1];\n var _h = useState(null), mouseoutListener = _h[0], setMouseoutListener = _h[1];\n var _j = useState(null), mouseoverListener = _j[0], setMouseoverListener = _j[1];\n var _k = useState(null), mouseupListener = _k[0], setMouseupListener = _k[1];\n var _l = useState(null), rightclickListener = _l[0], setRightclickListener = _l[1];\n var _m = useState(null), clickListener = _m[0], setClickListener = _m[1];\n var _o = useState(null), dragListener = _o[0], setDragListener = _o[1];\n // Order does matter\n useEffect(function () {\n if (instance !== null) {\n instance.setMap(map);\n }\n }, [map]);\n useEffect(function () {\n if (typeof options !== 'undefined' && instance !== null) {\n instance.setOptions(options);\n }\n }, [instance, options]);\n useEffect(function () {\n if (typeof draggable !== 'undefined' && instance !== null) {\n instance.setDraggable(draggable);\n }\n }, [instance, draggable]);\n useEffect(function () {\n if (typeof editable !== 'undefined' && instance !== null) {\n instance.setEditable(editable);\n }\n }, [instance, editable]);\n useEffect(function () {\n if (typeof visible !== 'undefined' && instance !== null) {\n instance.setVisible(visible);\n }\n }, [instance, visible]);\n useEffect(function () {\n if (typeof path !== 'undefined' && instance !== null) {\n instance.setPath(path);\n }\n }, [instance, path]);\n useEffect(function () {\n if (instance && onDblClick) {\n if (dblclickListener !== null) {\n google.maps.event.removeListener(dblclickListener);\n }\n setDblclickListener(google.maps.event.addListener(instance, 'dblclick', onDblClick));\n }\n }, [onDblClick]);\n useEffect(function () {\n if (instance && onDragEnd) {\n if (dragendListener !== null) {\n google.maps.event.removeListener(dragendListener);\n }\n setDragendListener(google.maps.event.addListener(instance, 'dragend', onDragEnd));\n }\n }, [onDragEnd]);\n useEffect(function () {\n if (instance && onDragStart) {\n if (dragstartListener !== null) {\n google.maps.event.removeListener(dragstartListener);\n }\n setDragstartListener(google.maps.event.addListener(instance, 'dragstart', onDragStart));\n }\n }, [onDragStart]);\n useEffect(function () {\n if (instance && onMouseDown) {\n if (mousedownListener !== null) {\n google.maps.event.removeListener(mousedownListener);\n }\n setMousedownListener(google.maps.event.addListener(instance, 'mousedown', onMouseDown));\n }\n }, [onMouseDown]);\n useEffect(function () {\n if (instance && onMouseMove) {\n if (mousemoveListener !== null) {\n google.maps.event.removeListener(mousemoveListener);\n }\n setMousemoveListener(google.maps.event.addListener(instance, 'mousemove', onMouseMove));\n }\n }, [onMouseMove]);\n useEffect(function () {\n if (instance && onMouseOut) {\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n setMouseoutListener(google.maps.event.addListener(instance, 'mouseout', onMouseOut));\n }\n }, [onMouseOut]);\n useEffect(function () {\n if (instance && onMouseOver) {\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n setMouseoverListener(google.maps.event.addListener(instance, 'mouseover', onMouseOver));\n }\n }, [onMouseOver]);\n useEffect(function () {\n if (instance && onMouseUp) {\n if (mouseupListener !== null) {\n google.maps.event.removeListener(mouseupListener);\n }\n setMouseupListener(google.maps.event.addListener(instance, 'mouseup', onMouseUp));\n }\n }, [onMouseUp]);\n useEffect(function () {\n if (instance && onRightClick) {\n if (rightclickListener !== null) {\n google.maps.event.removeListener(rightclickListener);\n }\n setRightclickListener(google.maps.event.addListener(instance, 'rightclick', onRightClick));\n }\n }, [onRightClick]);\n useEffect(function () {\n if (instance && onClick) {\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n setClickListener(google.maps.event.addListener(instance, 'click', onClick));\n }\n }, [onClick]);\n useEffect(function () {\n if (instance && onDrag) {\n if (dragListener !== null) {\n google.maps.event.removeListener(dragListener);\n }\n setDragListener(google.maps.event.addListener(instance, 'drag', onDrag));\n }\n }, [onDrag]);\n useEffect(function () {\n var polyline = new google.maps.Polyline(__assign(__assign({}, (options || defaultOptions$1)), { map: map }));\n if (path) {\n polyline.setPath(path);\n }\n if (typeof visible !== 'undefined') {\n polyline.setVisible(visible);\n }\n if (typeof editable !== 'undefined') {\n polyline.setEditable(editable);\n }\n if (typeof draggable !== 'undefined') {\n polyline.setDraggable(draggable);\n }\n if (onDblClick) {\n setDblclickListener(google.maps.event.addListener(polyline, 'dblclick', onDblClick));\n }\n if (onDragEnd) {\n setDragendListener(google.maps.event.addListener(polyline, 'dragend', onDragEnd));\n }\n if (onDragStart) {\n setDragstartListener(google.maps.event.addListener(polyline, 'dragstart', onDragStart));\n }\n if (onMouseDown) {\n setMousedownListener(google.maps.event.addListener(polyline, 'mousedown', onMouseDown));\n }\n if (onMouseMove) {\n setMousemoveListener(google.maps.event.addListener(polyline, 'mousemove', onMouseMove));\n }\n if (onMouseOut) {\n setMouseoutListener(google.maps.event.addListener(polyline, 'mouseout', onMouseOut));\n }\n if (onMouseOver) {\n setMouseoverListener(google.maps.event.addListener(polyline, 'mouseover', onMouseOver));\n }\n if (onMouseUp) {\n setMouseupListener(google.maps.event.addListener(polyline, 'mouseup', onMouseUp));\n }\n if (onRightClick) {\n setRightclickListener(google.maps.event.addListener(polyline, 'rightclick', onRightClick));\n }\n if (onClick) {\n setClickListener(google.maps.event.addListener(polyline, 'click', onClick));\n }\n if (onDrag) {\n setDragListener(google.maps.event.addListener(polyline, 'drag', onDrag));\n }\n setInstance(polyline);\n if (onLoad) {\n onLoad(polyline);\n }\n return function () {\n if (dblclickListener !== null) {\n google.maps.event.removeListener(dblclickListener);\n }\n if (dragendListener !== null) {\n google.maps.event.removeListener(dragendListener);\n }\n if (dragstartListener !== null) {\n google.maps.event.removeListener(dragstartListener);\n }\n if (mousedownListener !== null) {\n google.maps.event.removeListener(mousedownListener);\n }\n if (mousemoveListener !== null) {\n google.maps.event.removeListener(mousemoveListener);\n }\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n if (mouseupListener !== null) {\n google.maps.event.removeListener(mouseupListener);\n }\n if (rightclickListener !== null) {\n google.maps.event.removeListener(rightclickListener);\n }\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n if (onUnmount) {\n onUnmount(polyline);\n }\n polyline.setMap(null);\n };\n }, []);\n return null;\n}\nvar PolylineF = memo(PolylineFunctional);\nvar Polyline = /** @class */ (function (_super) {\n __extends(Polyline, _super);\n function Polyline() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.registeredEvents = [];\n _this.state = {\n polyline: null,\n };\n _this.setPolylineCallback = function () {\n if (_this.state.polyline !== null && _this.props.onLoad) {\n _this.props.onLoad(_this.state.polyline);\n }\n };\n return _this;\n }\n Polyline.prototype.componentDidMount = function () {\n var polyline = new google.maps.Polyline(__assign(__assign({}, (this.props.options || {})), { map: this.context }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$b,\n eventMap: eventMap$b,\n prevProps: {},\n nextProps: this.props,\n instance: polyline,\n });\n this.setState(function setPolyline() {\n return {\n polyline: polyline,\n };\n }, this.setPolylineCallback);\n };\n Polyline.prototype.componentDidUpdate = function (prevProps) {\n if (this.state.polyline !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$b,\n eventMap: eventMap$b,\n prevProps: prevProps,\n nextProps: this.props,\n instance: this.state.polyline,\n });\n }\n };\n Polyline.prototype.componentWillUnmount = function () {\n if (this.state.polyline !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.polyline);\n }\n unregisterEvents(this.registeredEvents);\n this.state.polyline.setMap(null);\n }\n };\n Polyline.prototype.render = function () {\n return null;\n };\n Polyline.contextType = MapContext;\n return Polyline;\n}(PureComponent));\n\nvar eventMap$a = {\n onClick: 'click',\n onDblClick: 'dblclick',\n onDrag: 'drag',\n onDragEnd: 'dragend',\n onDragStart: 'dragstart',\n onMouseDown: 'mousedown',\n onMouseMove: 'mousemove',\n onMouseOut: 'mouseout',\n onMouseOver: 'mouseover',\n onMouseUp: 'mouseup',\n onRightClick: 'rightclick',\n};\nvar updaterMap$a = {\n draggable: function (instance, draggable) {\n instance.setDraggable(draggable);\n },\n editable: function (instance, editable) {\n instance.setEditable(editable);\n },\n map: function (instance, map) {\n instance.setMap(map);\n },\n options: function (instance, options) {\n instance.setOptions(options);\n },\n path: function (instance, path) {\n instance.setPath(path);\n },\n paths: function (instance, paths) {\n instance.setPaths(paths);\n },\n visible: function (instance, visible) {\n instance.setVisible(visible);\n },\n};\nfunction PolygonFunctional(_a) {\n var options = _a.options, draggable = _a.draggable, editable = _a.editable, visible = _a.visible, path = _a.path, paths = _a.paths, onDblClick = _a.onDblClick, onDragEnd = _a.onDragEnd, onDragStart = _a.onDragStart, onMouseDown = _a.onMouseDown, onMouseMove = _a.onMouseMove, onMouseOut = _a.onMouseOut, onMouseOver = _a.onMouseOver, onMouseUp = _a.onMouseUp, onRightClick = _a.onRightClick, onClick = _a.onClick, onDrag = _a.onDrag, onLoad = _a.onLoad, onUnmount = _a.onUnmount, onEdit = _a.onEdit;\n var map = useContext(MapContext);\n var _b = useState(null), instance = _b[0], setInstance = _b[1];\n var _c = useState(null), dblclickListener = _c[0], setDblclickListener = _c[1];\n var _d = useState(null), dragendListener = _d[0], setDragendListener = _d[1];\n var _e = useState(null), dragstartListener = _e[0], setDragstartListener = _e[1];\n var _f = useState(null), mousedownListener = _f[0], setMousedownListener = _f[1];\n var _g = useState(null), mousemoveListener = _g[0], setMousemoveListener = _g[1];\n var _h = useState(null), mouseoutListener = _h[0], setMouseoutListener = _h[1];\n var _j = useState(null), mouseoverListener = _j[0], setMouseoverListener = _j[1];\n var _k = useState(null), mouseupListener = _k[0], setMouseupListener = _k[1];\n var _l = useState(null), rightclickListener = _l[0], setRightclickListener = _l[1];\n var _m = useState(null), clickListener = _m[0], setClickListener = _m[1];\n var _o = useState(null), dragListener = _o[0], setDragListener = _o[1];\n // Order does matter\n useEffect(function () {\n if (instance !== null) {\n instance.setMap(map);\n }\n }, [map]);\n useEffect(function () {\n if (typeof options !== 'undefined' && instance !== null) {\n instance.setOptions(options);\n }\n }, [instance, options]);\n useEffect(function () {\n if (typeof draggable !== 'undefined' && instance !== null) {\n instance.setDraggable(draggable);\n }\n }, [instance, draggable]);\n useEffect(function () {\n if (typeof editable !== 'undefined' && instance !== null) {\n instance.setEditable(editable);\n }\n }, [instance, editable]);\n useEffect(function () {\n if (typeof visible !== 'undefined' && instance !== null) {\n instance.setVisible(visible);\n }\n }, [instance, visible]);\n useEffect(function () {\n if (typeof path !== 'undefined' && instance !== null) {\n instance.setPath(path);\n }\n }, [instance, path]);\n useEffect(function () {\n if (typeof paths !== 'undefined' && instance !== null) {\n instance.setPaths(paths);\n }\n }, [instance, paths]);\n useEffect(function () {\n if (instance && onDblClick) {\n if (dblclickListener !== null) {\n google.maps.event.removeListener(dblclickListener);\n }\n setDblclickListener(google.maps.event.addListener(instance, 'dblclick', onDblClick));\n }\n }, [onDblClick]);\n useEffect(function () {\n if (instance) {\n google.maps.event.addListener(instance.getPath(), 'insert_at', function () {\n onEdit === null || onEdit === void 0 ? void 0 : onEdit(instance);\n });\n google.maps.event.addListener(instance.getPath(), 'set_at', function () {\n onEdit === null || onEdit === void 0 ? void 0 : onEdit(instance);\n });\n }\n }, [instance, onEdit]);\n useEffect(function () {\n if (instance && onDragEnd) {\n if (dragendListener !== null) {\n google.maps.event.removeListener(dragendListener);\n }\n setDragendListener(google.maps.event.addListener(instance, 'dragend', onDragEnd));\n }\n }, [onDragEnd]);\n useEffect(function () {\n if (instance && onDragStart) {\n if (dragstartListener !== null) {\n google.maps.event.removeListener(dragstartListener);\n }\n setDragstartListener(google.maps.event.addListener(instance, 'dragstart', onDragStart));\n }\n }, [onDragStart]);\n useEffect(function () {\n if (instance && onMouseDown) {\n if (mousedownListener !== null) {\n google.maps.event.removeListener(mousedownListener);\n }\n setMousedownListener(google.maps.event.addListener(instance, 'mousedown', onMouseDown));\n }\n }, [onMouseDown]);\n useEffect(function () {\n if (instance && onMouseMove) {\n if (mousemoveListener !== null) {\n google.maps.event.removeListener(mousemoveListener);\n }\n setMousemoveListener(google.maps.event.addListener(instance, 'mousemove', onMouseMove));\n }\n }, [onMouseMove]);\n useEffect(function () {\n if (instance && onMouseOut) {\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n setMouseoutListener(google.maps.event.addListener(instance, 'mouseout', onMouseOut));\n }\n }, [onMouseOut]);\n useEffect(function () {\n if (instance && onMouseOver) {\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n setMouseoverListener(google.maps.event.addListener(instance, 'mouseover', onMouseOver));\n }\n }, [onMouseOver]);\n useEffect(function () {\n if (instance && onMouseUp) {\n if (mouseupListener !== null) {\n google.maps.event.removeListener(mouseupListener);\n }\n setMouseupListener(google.maps.event.addListener(instance, 'mouseup', onMouseUp));\n }\n }, [onMouseUp]);\n useEffect(function () {\n if (instance && onRightClick) {\n if (rightclickListener !== null) {\n google.maps.event.removeListener(rightclickListener);\n }\n setRightclickListener(google.maps.event.addListener(instance, 'rightclick', onRightClick));\n }\n }, [onRightClick]);\n useEffect(function () {\n if (instance && onClick) {\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n setClickListener(google.maps.event.addListener(instance, 'click', onClick));\n }\n }, [onClick]);\n useEffect(function () {\n if (instance && onDrag) {\n if (dragListener !== null) {\n google.maps.event.removeListener(dragListener);\n }\n setDragListener(google.maps.event.addListener(instance, 'drag', onDrag));\n }\n }, [onDrag]);\n useEffect(function () {\n var polygon = new google.maps.Polygon(__assign(__assign({}, (options || {})), { map: map }));\n if (path) {\n polygon.setPath(path);\n }\n if (paths) {\n polygon.setPaths(paths);\n }\n if (typeof visible !== 'undefined') {\n polygon.setVisible(visible);\n }\n if (typeof editable !== 'undefined') {\n polygon.setEditable(editable);\n }\n if (typeof draggable !== 'undefined') {\n polygon.setDraggable(draggable);\n }\n if (onDblClick) {\n setDblclickListener(google.maps.event.addListener(polygon, 'dblclick', onDblClick));\n }\n if (onDragEnd) {\n setDragendListener(google.maps.event.addListener(polygon, 'dragend', onDragEnd));\n }\n if (onDragStart) {\n setDragstartListener(google.maps.event.addListener(polygon, 'dragstart', onDragStart));\n }\n if (onMouseDown) {\n setMousedownListener(google.maps.event.addListener(polygon, 'mousedown', onMouseDown));\n }\n if (onMouseMove) {\n setMousemoveListener(google.maps.event.addListener(polygon, 'mousemove', onMouseMove));\n }\n if (onMouseOut) {\n setMouseoutListener(google.maps.event.addListener(polygon, 'mouseout', onMouseOut));\n }\n if (onMouseOver) {\n setMouseoverListener(google.maps.event.addListener(polygon, 'mouseover', onMouseOver));\n }\n if (onMouseUp) {\n setMouseupListener(google.maps.event.addListener(polygon, 'mouseup', onMouseUp));\n }\n if (onRightClick) {\n setRightclickListener(google.maps.event.addListener(polygon, 'rightclick', onRightClick));\n }\n if (onClick) {\n setClickListener(google.maps.event.addListener(polygon, 'click', onClick));\n }\n if (onDrag) {\n setDragListener(google.maps.event.addListener(polygon, 'drag', onDrag));\n }\n setInstance(polygon);\n if (onLoad) {\n onLoad(polygon);\n }\n return function () {\n if (dblclickListener !== null) {\n google.maps.event.removeListener(dblclickListener);\n }\n if (dragendListener !== null) {\n google.maps.event.removeListener(dragendListener);\n }\n if (dragstartListener !== null) {\n google.maps.event.removeListener(dragstartListener);\n }\n if (mousedownListener !== null) {\n google.maps.event.removeListener(mousedownListener);\n }\n if (mousemoveListener !== null) {\n google.maps.event.removeListener(mousemoveListener);\n }\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n if (mouseupListener !== null) {\n google.maps.event.removeListener(mouseupListener);\n }\n if (rightclickListener !== null) {\n google.maps.event.removeListener(rightclickListener);\n }\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n if (onUnmount) {\n onUnmount(polygon);\n }\n polygon.setMap(null);\n };\n }, []);\n return null;\n}\nvar PolygonF = memo(PolygonFunctional);\nvar Polygon = /** @class */ (function (_super) {\n __extends(Polygon, _super);\n function Polygon() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.registeredEvents = [];\n _this.state = {\n polygon: null,\n };\n _this.setPolygonCallback = function () {\n if (_this.state.polygon !== null && _this.props.onLoad) {\n _this.props.onLoad(_this.state.polygon);\n }\n };\n return _this;\n }\n Polygon.prototype.componentDidMount = function () {\n var polygon = new google.maps.Polygon(__assign(__assign({}, (this.props.options || {})), { map: this.context }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$a,\n eventMap: eventMap$a,\n prevProps: {},\n nextProps: this.props,\n instance: polygon,\n });\n this.setState(function setPolygon() {\n return {\n polygon: polygon,\n };\n }, this.setPolygonCallback);\n };\n Polygon.prototype.componentDidUpdate = function (prevProps) {\n if (this.state.polygon !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$a,\n eventMap: eventMap$a,\n prevProps: prevProps,\n nextProps: this.props,\n instance: this.state.polygon,\n });\n }\n };\n Polygon.prototype.componentWillUnmount = function () {\n if (this.state.polygon !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.polygon);\n }\n unregisterEvents(this.registeredEvents);\n this.state.polygon && this.state.polygon.setMap(null);\n }\n };\n Polygon.prototype.render = function () {\n return null;\n };\n Polygon.contextType = MapContext;\n return Polygon;\n}(PureComponent));\n\nvar eventMap$9 = {\n onBoundsChanged: 'bounds_changed',\n onClick: 'click',\n onDblClick: 'dblclick',\n onDrag: 'drag',\n onDragEnd: 'dragend',\n onDragStart: 'dragstart',\n onMouseDown: 'mousedown',\n onMouseMove: 'mousemove',\n onMouseOut: 'mouseout',\n onMouseOver: 'mouseover',\n onMouseUp: 'mouseup',\n onRightClick: 'rightclick',\n};\nvar updaterMap$9 = {\n bounds: function (instance, bounds) {\n instance.setBounds(bounds);\n },\n draggable: function (instance, draggable) {\n instance.setDraggable(draggable);\n },\n editable: function (instance, editable) {\n instance.setEditable(editable);\n },\n map: function (instance, map) {\n instance.setMap(map);\n },\n options: function (instance, options) {\n instance.setOptions(options);\n },\n visible: function (instance, visible) {\n instance.setVisible(visible);\n },\n};\nfunction RectangleFunctional(_a) {\n var options = _a.options, bounds = _a.bounds, draggable = _a.draggable, editable = _a.editable, visible = _a.visible, onDblClick = _a.onDblClick, onDragEnd = _a.onDragEnd, onDragStart = _a.onDragStart, onMouseDown = _a.onMouseDown, onMouseMove = _a.onMouseMove, onMouseOut = _a.onMouseOut, onMouseOver = _a.onMouseOver, onMouseUp = _a.onMouseUp, onRightClick = _a.onRightClick, onClick = _a.onClick, onDrag = _a.onDrag, onBoundsChanged = _a.onBoundsChanged, onLoad = _a.onLoad, onUnmount = _a.onUnmount;\n var map = useContext(MapContext);\n var _b = useState(null), instance = _b[0], setInstance = _b[1];\n var _c = useState(null), dblclickListener = _c[0], setDblclickListener = _c[1];\n var _d = useState(null), dragendListener = _d[0], setDragendListener = _d[1];\n var _e = useState(null), dragstartListener = _e[0], setDragstartListener = _e[1];\n var _f = useState(null), mousedownListener = _f[0], setMousedownListener = _f[1];\n var _g = useState(null), mousemoveListener = _g[0], setMousemoveListener = _g[1];\n var _h = useState(null), mouseoutListener = _h[0], setMouseoutListener = _h[1];\n var _j = useState(null), mouseoverListener = _j[0], setMouseoverListener = _j[1];\n var _k = useState(null), mouseupListener = _k[0], setMouseupListener = _k[1];\n var _l = useState(null), rightClickListener = _l[0], setRightClickListener = _l[1];\n var _m = useState(null), clickListener = _m[0], setClickListener = _m[1];\n var _o = useState(null), dragListener = _o[0], setDragListener = _o[1];\n var _p = useState(null), boundsChangedListener = _p[0], setBoundsChangedListener = _p[1];\n // Order does matter\n useEffect(function () {\n if (instance !== null) {\n instance.setMap(map);\n }\n }, [map]);\n useEffect(function () {\n if (typeof options !== 'undefined' && instance !== null) {\n instance.setOptions(options);\n }\n }, [instance, options]);\n useEffect(function () {\n if (typeof draggable !== 'undefined' && instance !== null) {\n instance.setDraggable(draggable);\n }\n }, [instance, draggable]);\n useEffect(function () {\n if (typeof editable !== 'undefined' && instance !== null) {\n instance.setEditable(editable);\n }\n }, [instance, editable]);\n useEffect(function () {\n if (typeof visible !== 'undefined' && instance !== null) {\n instance.setVisible(visible);\n }\n }, [instance, visible]);\n useEffect(function () {\n if (typeof bounds !== 'undefined' && instance !== null) {\n instance.setBounds(bounds);\n }\n }, [instance, bounds]);\n useEffect(function () {\n if (instance && onDblClick) {\n if (dblclickListener !== null) {\n google.maps.event.removeListener(dblclickListener);\n }\n setDblclickListener(google.maps.event.addListener(instance, 'dblclick', onDblClick));\n }\n }, [onDblClick]);\n useEffect(function () {\n if (instance && onDragEnd) {\n if (dragendListener !== null) {\n google.maps.event.removeListener(dragendListener);\n }\n setDragendListener(google.maps.event.addListener(instance, 'dragend', onDragEnd));\n }\n }, [onDragEnd]);\n useEffect(function () {\n if (instance && onDragStart) {\n if (dragstartListener !== null) {\n google.maps.event.removeListener(dragstartListener);\n }\n setDragstartListener(google.maps.event.addListener(instance, 'dragstart', onDragStart));\n }\n }, [onDragStart]);\n useEffect(function () {\n if (instance && onMouseDown) {\n if (mousedownListener !== null) {\n google.maps.event.removeListener(mousedownListener);\n }\n setMousedownListener(google.maps.event.addListener(instance, 'mousedown', onMouseDown));\n }\n }, [onMouseDown]);\n useEffect(function () {\n if (instance && onMouseMove) {\n if (mousemoveListener !== null) {\n google.maps.event.removeListener(mousemoveListener);\n }\n setMousemoveListener(google.maps.event.addListener(instance, 'mousemove', onMouseMove));\n }\n }, [onMouseMove]);\n useEffect(function () {\n if (instance && onMouseOut) {\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n setMouseoutListener(google.maps.event.addListener(instance, 'mouseout', onMouseOut));\n }\n }, [onMouseOut]);\n useEffect(function () {\n if (instance && onMouseOver) {\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n setMouseoverListener(google.maps.event.addListener(instance, 'mouseover', onMouseOver));\n }\n }, [onMouseOver]);\n useEffect(function () {\n if (instance && onMouseUp) {\n if (mouseupListener !== null) {\n google.maps.event.removeListener(mouseupListener);\n }\n setMouseupListener(google.maps.event.addListener(instance, 'mouseup', onMouseUp));\n }\n }, [onMouseUp]);\n useEffect(function () {\n if (instance && onRightClick) {\n if (rightClickListener !== null) {\n google.maps.event.removeListener(rightClickListener);\n }\n setRightClickListener(google.maps.event.addListener(instance, 'rightclick', onRightClick));\n }\n }, [onRightClick]);\n useEffect(function () {\n if (instance && onClick) {\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n setClickListener(google.maps.event.addListener(instance, 'click', onClick));\n }\n }, [onClick]);\n useEffect(function () {\n if (instance && onDrag) {\n if (dragListener !== null) {\n google.maps.event.removeListener(dragListener);\n }\n setDragListener(google.maps.event.addListener(instance, 'drag', onDrag));\n }\n }, [onDrag]);\n useEffect(function () {\n if (instance && onBoundsChanged) {\n if (boundsChangedListener !== null) {\n google.maps.event.removeListener(boundsChangedListener);\n }\n setBoundsChangedListener(google.maps.event.addListener(instance, 'bounds_changed', onBoundsChanged));\n }\n }, [onBoundsChanged]);\n useEffect(function () {\n var rectangle = new google.maps.Rectangle(__assign(__assign({}, (options || {})), { map: map }));\n if (typeof visible !== 'undefined') {\n rectangle.setVisible(visible);\n }\n if (typeof editable !== 'undefined') {\n rectangle.setEditable(editable);\n }\n if (typeof draggable !== 'undefined') {\n rectangle.setDraggable(draggable);\n }\n if (typeof bounds !== 'undefined') {\n rectangle.setBounds(bounds);\n }\n if (onDblClick) {\n setDblclickListener(google.maps.event.addListener(rectangle, 'dblclick', onDblClick));\n }\n if (onDragEnd) {\n setDragendListener(google.maps.event.addListener(rectangle, 'dragend', onDragEnd));\n }\n if (onDragStart) {\n setDragstartListener(google.maps.event.addListener(rectangle, 'dragstart', onDragStart));\n }\n if (onMouseDown) {\n setMousedownListener(google.maps.event.addListener(rectangle, 'mousedown', onMouseDown));\n }\n if (onMouseMove) {\n setMousemoveListener(google.maps.event.addListener(rectangle, 'mousemove', onMouseMove));\n }\n if (onMouseOut) {\n setMouseoutListener(google.maps.event.addListener(rectangle, 'mouseout', onMouseOut));\n }\n if (onMouseOver) {\n setMouseoverListener(google.maps.event.addListener(rectangle, 'mouseover', onMouseOver));\n }\n if (onMouseUp) {\n setMouseupListener(google.maps.event.addListener(rectangle, 'mouseup', onMouseUp));\n }\n if (onRightClick) {\n setRightClickListener(google.maps.event.addListener(rectangle, 'rightclick', onRightClick));\n }\n if (onClick) {\n setClickListener(google.maps.event.addListener(rectangle, 'click', onClick));\n }\n if (onDrag) {\n setDragListener(google.maps.event.addListener(rectangle, 'drag', onDrag));\n }\n if (onBoundsChanged) {\n setBoundsChangedListener(google.maps.event.addListener(rectangle, 'bounds_changed', onBoundsChanged));\n }\n setInstance(rectangle);\n if (onLoad) {\n onLoad(rectangle);\n }\n return function () {\n if (dblclickListener !== null) {\n google.maps.event.removeListener(dblclickListener);\n }\n if (dragendListener !== null) {\n google.maps.event.removeListener(dragendListener);\n }\n if (dragstartListener !== null) {\n google.maps.event.removeListener(dragstartListener);\n }\n if (mousedownListener !== null) {\n google.maps.event.removeListener(mousedownListener);\n }\n if (mousemoveListener !== null) {\n google.maps.event.removeListener(mousemoveListener);\n }\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n if (mouseupListener !== null) {\n google.maps.event.removeListener(mouseupListener);\n }\n if (rightClickListener !== null) {\n google.maps.event.removeListener(rightClickListener);\n }\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n if (dragListener !== null) {\n google.maps.event.removeListener(dragListener);\n }\n if (boundsChangedListener !== null) {\n google.maps.event.removeListener(boundsChangedListener);\n }\n if (onUnmount) {\n onUnmount(rectangle);\n }\n rectangle.setMap(null);\n };\n }, []);\n return null;\n}\nvar RectangleF = memo(RectangleFunctional);\nvar Rectangle = /** @class */ (function (_super) {\n __extends(Rectangle, _super);\n function Rectangle() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.registeredEvents = [];\n _this.state = {\n rectangle: null,\n };\n _this.setRectangleCallback = function () {\n if (_this.state.rectangle !== null && _this.props.onLoad) {\n _this.props.onLoad(_this.state.rectangle);\n }\n };\n return _this;\n }\n Rectangle.prototype.componentDidMount = function () {\n var rectangle = new google.maps.Rectangle(__assign(__assign({}, (this.props.options || {})), { map: this.context }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$9,\n eventMap: eventMap$9,\n prevProps: {},\n nextProps: this.props,\n instance: rectangle,\n });\n this.setState(function setRectangle() {\n return {\n rectangle: rectangle,\n };\n }, this.setRectangleCallback);\n };\n Rectangle.prototype.componentDidUpdate = function (prevProps) {\n if (this.state.rectangle !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$9,\n eventMap: eventMap$9,\n prevProps: prevProps,\n nextProps: this.props,\n instance: this.state.rectangle,\n });\n }\n };\n Rectangle.prototype.componentWillUnmount = function () {\n if (this.state.rectangle !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.rectangle);\n }\n unregisterEvents(this.registeredEvents);\n this.state.rectangle.setMap(null);\n }\n };\n Rectangle.prototype.render = function () {\n return null;\n };\n Rectangle.contextType = MapContext;\n return Rectangle;\n}(PureComponent));\n\nvar eventMap$8 = {\n onCenterChanged: 'center_changed',\n onRadiusChanged: 'radius_changed',\n onClick: 'click',\n onDblClick: 'dblclick',\n onDrag: 'drag',\n onDragEnd: 'dragend',\n onDragStart: 'dragstart',\n onMouseDown: 'mousedown',\n onMouseMove: 'mousemove',\n onMouseOut: 'mouseout',\n onMouseOver: 'mouseover',\n onMouseUp: 'mouseup',\n onRightClick: 'rightclick',\n};\nvar updaterMap$8 = {\n center: function (instance, center) {\n instance.setCenter(center);\n },\n draggable: function (instance, draggable) {\n instance.setDraggable(draggable);\n },\n editable: function (instance, editable) {\n instance.setEditable(editable);\n },\n map: function (instance, map) {\n instance.setMap(map);\n },\n options: function (instance, options) {\n instance.setOptions(options);\n },\n radius: function (instance, radius) {\n instance.setRadius(radius);\n },\n visible: function (instance, visible) {\n instance.setVisible(visible);\n },\n};\nvar defaultOptions = {};\nfunction CircleFunctional(_a) {\n var options = _a.options, center = _a.center, radius = _a.radius, draggable = _a.draggable, editable = _a.editable, visible = _a.visible, onDblClick = _a.onDblClick, onDragEnd = _a.onDragEnd, onDragStart = _a.onDragStart, onMouseDown = _a.onMouseDown, onMouseMove = _a.onMouseMove, onMouseOut = _a.onMouseOut, onMouseOver = _a.onMouseOver, onMouseUp = _a.onMouseUp, onRightClick = _a.onRightClick, onClick = _a.onClick, onDrag = _a.onDrag, onCenterChanged = _a.onCenterChanged, onRadiusChanged = _a.onRadiusChanged, onLoad = _a.onLoad, onUnmount = _a.onUnmount;\n var map = useContext(MapContext);\n var _b = useState(null), instance = _b[0], setInstance = _b[1];\n var _c = useState(null), dblclickListener = _c[0], setDblclickListener = _c[1];\n var _d = useState(null), dragendListener = _d[0], setDragendListener = _d[1];\n var _e = useState(null), dragstartListener = _e[0], setDragstartListener = _e[1];\n var _f = useState(null), mousedownListener = _f[0], setMousedownListener = _f[1];\n var _g = useState(null), mousemoveListener = _g[0], setMousemoveListener = _g[1];\n var _h = useState(null), mouseoutListener = _h[0], setMouseoutListener = _h[1];\n var _j = useState(null), mouseoverListener = _j[0], setMouseoverListener = _j[1];\n var _k = useState(null), mouseupListener = _k[0], setMouseupListener = _k[1];\n var _l = useState(null), rightclickListener = _l[0], setRightclickListener = _l[1];\n var _m = useState(null), clickListener = _m[0], setClickListener = _m[1];\n var _o = useState(null), dragListener = _o[0], setDragListener = _o[1];\n var _p = useState(null), centerChangedListener = _p[0], setCenterChangedListener = _p[1];\n var _q = useState(null), radiusChangedListener = _q[0], setRadiusChangedListener = _q[1];\n // Order does matter\n useEffect(function () {\n if (instance !== null) {\n instance.setMap(map);\n }\n }, [map]);\n useEffect(function () {\n if (typeof options !== 'undefined' && instance !== null) {\n instance.setOptions(options);\n }\n }, [instance, options]);\n useEffect(function () {\n if (typeof draggable !== 'undefined' && instance !== null) {\n instance.setDraggable(draggable);\n }\n }, [instance, draggable]);\n useEffect(function () {\n if (typeof editable !== 'undefined' && instance !== null) {\n instance.setEditable(editable);\n }\n }, [instance, editable]);\n useEffect(function () {\n if (typeof visible !== 'undefined' && instance !== null) {\n instance.setVisible(visible);\n }\n }, [instance, visible]);\n useEffect(function () {\n if (typeof radius === 'number' && instance !== null) {\n instance.setRadius(radius);\n }\n }, [instance, radius]);\n useEffect(function () {\n if (typeof center !== 'undefined' && instance !== null) {\n instance.setCenter(center);\n }\n }, [instance, center]);\n useEffect(function () {\n if (instance && onDblClick) {\n if (dblclickListener !== null) {\n google.maps.event.removeListener(dblclickListener);\n }\n setDblclickListener(google.maps.event.addListener(instance, 'dblclick', onDblClick));\n }\n }, [onDblClick]);\n useEffect(function () {\n if (instance && onDragEnd) {\n if (dragendListener !== null) {\n google.maps.event.removeListener(dragendListener);\n }\n setDragendListener(google.maps.event.addListener(instance, 'dragend', onDragEnd));\n }\n }, [onDragEnd]);\n useEffect(function () {\n if (instance && onDragStart) {\n if (dragstartListener !== null) {\n google.maps.event.removeListener(dragstartListener);\n }\n setDragstartListener(google.maps.event.addListener(instance, 'dragstart', onDragStart));\n }\n }, [onDragStart]);\n useEffect(function () {\n if (instance && onMouseDown) {\n if (mousedownListener !== null) {\n google.maps.event.removeListener(mousedownListener);\n }\n setMousedownListener(google.maps.event.addListener(instance, 'mousedown', onMouseDown));\n }\n }, [onMouseDown]);\n useEffect(function () {\n if (instance && onMouseMove) {\n if (mousemoveListener !== null) {\n google.maps.event.removeListener(mousemoveListener);\n }\n setMousemoveListener(google.maps.event.addListener(instance, 'mousemove', onMouseMove));\n }\n }, [onMouseMove]);\n useEffect(function () {\n if (instance && onMouseOut) {\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n setMouseoutListener(google.maps.event.addListener(instance, 'mouseout', onMouseOut));\n }\n }, [onMouseOut]);\n useEffect(function () {\n if (instance && onMouseOver) {\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n setMouseoverListener(google.maps.event.addListener(instance, 'mouseover', onMouseOver));\n }\n }, [onMouseOver]);\n useEffect(function () {\n if (instance && onMouseUp) {\n if (mouseupListener !== null) {\n google.maps.event.removeListener(mouseupListener);\n }\n setMouseupListener(google.maps.event.addListener(instance, 'mouseup', onMouseUp));\n }\n }, [onMouseUp]);\n useEffect(function () {\n if (instance && onRightClick) {\n if (rightclickListener !== null) {\n google.maps.event.removeListener(rightclickListener);\n }\n setRightclickListener(google.maps.event.addListener(instance, 'rightclick', onRightClick));\n }\n }, [onRightClick]);\n useEffect(function () {\n if (instance && onClick) {\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n setClickListener(google.maps.event.addListener(instance, 'click', onClick));\n }\n }, [onClick]);\n useEffect(function () {\n if (instance && onDrag) {\n if (dragListener !== null) {\n google.maps.event.removeListener(dragListener);\n }\n setDragListener(google.maps.event.addListener(instance, 'drag', onDrag));\n }\n }, [onDrag]);\n useEffect(function () {\n if (instance && onCenterChanged) {\n if (centerChangedListener !== null) {\n google.maps.event.removeListener(centerChangedListener);\n }\n setCenterChangedListener(google.maps.event.addListener(instance, 'center_changed', onCenterChanged));\n }\n }, [onClick]);\n useEffect(function () {\n if (instance && onRadiusChanged) {\n if (radiusChangedListener !== null) {\n google.maps.event.removeListener(radiusChangedListener);\n }\n setRadiusChangedListener(google.maps.event.addListener(instance, 'radius_changed', onRadiusChanged));\n }\n }, [onRadiusChanged]);\n useEffect(function () {\n var circle = new google.maps.Circle(__assign(__assign({}, (options || defaultOptions)), { map: map }));\n if (typeof radius === 'number') {\n circle.setRadius(radius);\n }\n if (typeof center !== 'undefined') {\n circle.setCenter(center);\n }\n if (typeof radius === 'number') {\n circle.setRadius(radius);\n }\n if (typeof visible !== 'undefined') {\n circle.setVisible(visible);\n }\n if (typeof editable !== 'undefined') {\n circle.setEditable(editable);\n }\n if (typeof draggable !== 'undefined') {\n circle.setDraggable(draggable);\n }\n if (onDblClick) {\n setDblclickListener(google.maps.event.addListener(circle, 'dblclick', onDblClick));\n }\n if (onDragEnd) {\n setDragendListener(google.maps.event.addListener(circle, 'dragend', onDragEnd));\n }\n if (onDragStart) {\n setDragstartListener(google.maps.event.addListener(circle, 'dragstart', onDragStart));\n }\n if (onMouseDown) {\n setMousedownListener(google.maps.event.addListener(circle, 'mousedown', onMouseDown));\n }\n if (onMouseMove) {\n setMousemoveListener(google.maps.event.addListener(circle, 'mousemove', onMouseMove));\n }\n if (onMouseOut) {\n setMouseoutListener(google.maps.event.addListener(circle, 'mouseout', onMouseOut));\n }\n if (onMouseOver) {\n setMouseoverListener(google.maps.event.addListener(circle, 'mouseover', onMouseOver));\n }\n if (onMouseUp) {\n setMouseupListener(google.maps.event.addListener(circle, 'mouseup', onMouseUp));\n }\n if (onRightClick) {\n setRightclickListener(google.maps.event.addListener(circle, 'rightclick', onRightClick));\n }\n if (onClick) {\n setClickListener(google.maps.event.addListener(circle, 'click', onClick));\n }\n if (onDrag) {\n setDragListener(google.maps.event.addListener(circle, 'drag', onDrag));\n }\n if (onCenterChanged) {\n setCenterChangedListener(google.maps.event.addListener(circle, 'center_changed', onCenterChanged));\n }\n if (onRadiusChanged) {\n setRadiusChangedListener(google.maps.event.addListener(circle, 'radius_changed', onRadiusChanged));\n }\n setInstance(circle);\n if (onLoad) {\n onLoad(circle);\n }\n return function () {\n if (dblclickListener !== null) {\n google.maps.event.removeListener(dblclickListener);\n }\n if (dragendListener !== null) {\n google.maps.event.removeListener(dragendListener);\n }\n if (dragstartListener !== null) {\n google.maps.event.removeListener(dragstartListener);\n }\n if (mousedownListener !== null) {\n google.maps.event.removeListener(mousedownListener);\n }\n if (mousemoveListener !== null) {\n google.maps.event.removeListener(mousemoveListener);\n }\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n if (mouseupListener !== null) {\n google.maps.event.removeListener(mouseupListener);\n }\n if (rightclickListener !== null) {\n google.maps.event.removeListener(rightclickListener);\n }\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n if (centerChangedListener !== null) {\n google.maps.event.removeListener(centerChangedListener);\n }\n if (radiusChangedListener !== null) {\n google.maps.event.removeListener(radiusChangedListener);\n }\n if (onUnmount) {\n onUnmount(circle);\n }\n circle.setMap(null);\n };\n }, []);\n return null;\n}\nvar CircleF = memo(CircleFunctional);\nvar Circle = /** @class */ (function (_super) {\n __extends(Circle, _super);\n function Circle() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.registeredEvents = [];\n _this.state = {\n circle: null,\n };\n _this.setCircleCallback = function () {\n if (_this.state.circle !== null && _this.props.onLoad) {\n _this.props.onLoad(_this.state.circle);\n }\n };\n return _this;\n }\n Circle.prototype.componentDidMount = function () {\n var circle = new google.maps.Circle(__assign(__assign({}, (this.props.options || {})), { map: this.context }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$8,\n eventMap: eventMap$8,\n prevProps: {},\n nextProps: this.props,\n instance: circle,\n });\n this.setState(function setCircle() {\n return {\n circle: circle,\n };\n }, this.setCircleCallback);\n };\n Circle.prototype.componentDidUpdate = function (prevProps) {\n if (this.state.circle !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$8,\n eventMap: eventMap$8,\n prevProps: prevProps,\n nextProps: this.props,\n instance: this.state.circle,\n });\n }\n };\n Circle.prototype.componentWillUnmount = function () {\n var _a;\n if (this.state.circle !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.circle);\n }\n unregisterEvents(this.registeredEvents);\n (_a = this.state.circle) === null || _a === void 0 ? void 0 : _a.setMap(null);\n }\n };\n Circle.prototype.render = function () {\n return null;\n };\n Circle.contextType = MapContext;\n return Circle;\n}(PureComponent));\n\nvar eventMap$7 = {\n onClick: 'click',\n onDblClick: 'dblclick',\n onMouseDown: 'mousedown',\n onMouseOut: 'mouseout',\n onMouseOver: 'mouseover',\n onMouseUp: 'mouseup',\n onRightClick: 'rightclick',\n onAddFeature: 'addfeature',\n onRemoveFeature: 'removefeature',\n onRemoveProperty: 'removeproperty',\n onSetGeometry: 'setgeometry',\n onSetProperty: 'setproperty',\n};\nvar updaterMap$7 = {\n add: function (instance, feature) {\n instance.add(feature);\n },\n addgeojson: function (instance, geojson, options) {\n instance.addGeoJson(geojson, options);\n },\n contains: function (instance, feature) {\n instance.contains(feature);\n },\n foreach: function (instance, callback) {\n instance.forEach(callback);\n },\n loadgeojson: function (instance, url, options, callback) {\n instance.loadGeoJson(url, options, callback);\n },\n overridestyle: function (instance, feature, style) {\n instance.overrideStyle(feature, style);\n },\n remove: function (instance, feature) {\n instance.remove(feature);\n },\n revertstyle: function (instance, feature) {\n instance.revertStyle(feature);\n },\n controlposition: function (instance, controlPosition) {\n instance.setControlPosition(controlPosition);\n },\n controls: function (instance, controls) {\n instance.setControls(controls);\n },\n drawingmode: function (instance, mode) {\n instance.setDrawingMode(mode);\n },\n map: function (instance, map) {\n instance.setMap(map);\n },\n style: function (instance, style) {\n instance.setStyle(style);\n },\n togeojson: function (instance, callback) {\n instance.toGeoJson(callback);\n },\n};\nfunction DataFunctional(_a) {\n var options = _a.options, onClick = _a.onClick, onDblClick = _a.onDblClick, onMouseDown = _a.onMouseDown, onMouseMove = _a.onMouseMove, onMouseOut = _a.onMouseOut, onMouseOver = _a.onMouseOver, onMouseUp = _a.onMouseUp, onRightClick = _a.onRightClick, onAddFeature = _a.onAddFeature, onRemoveFeature = _a.onRemoveFeature, onRemoveProperty = _a.onRemoveProperty, onSetGeometry = _a.onSetGeometry, onSetProperty = _a.onSetProperty, onLoad = _a.onLoad, onUnmount = _a.onUnmount;\n var map = useContext(MapContext);\n var _b = useState(null), instance = _b[0], setInstance = _b[1];\n var _c = useState(null), dblclickListener = _c[0], setDblclickListener = _c[1];\n var _d = useState(null), mousedownListener = _d[0], setMousedownListener = _d[1];\n var _e = useState(null), mousemoveListener = _e[0], setMousemoveListener = _e[1];\n var _f = useState(null), mouseoutListener = _f[0], setMouseoutListener = _f[1];\n var _g = useState(null), mouseoverListener = _g[0], setMouseoverListener = _g[1];\n var _h = useState(null), mouseupListener = _h[0], setMouseupListener = _h[1];\n var _j = useState(null), rightclickListener = _j[0], setRightclickListener = _j[1];\n var _k = useState(null), clickListener = _k[0], setClickListener = _k[1];\n var _l = useState(null), addFeatureListener = _l[0], setAddFeatureListener = _l[1];\n var _m = useState(null), removeFeatureListener = _m[0], setRemoveFeatureListener = _m[1];\n var _o = useState(null), removePropertyListener = _o[0], setRemovePropertyListener = _o[1];\n var _p = useState(null), setGeometryListener = _p[0], setSetGeometryListener = _p[1];\n var _q = useState(null), setPropertyListener = _q[0], setSetPropertyListener = _q[1];\n // Order does matter\n useEffect(function () {\n if (instance !== null) {\n instance.setMap(map);\n }\n }, [map]);\n useEffect(function () {\n if (instance && onDblClick) {\n if (dblclickListener !== null) {\n google.maps.event.removeListener(dblclickListener);\n }\n setDblclickListener(google.maps.event.addListener(instance, 'dblclick', onDblClick));\n }\n }, [onDblClick]);\n useEffect(function () {\n if (instance && onMouseDown) {\n if (mousedownListener !== null) {\n google.maps.event.removeListener(mousedownListener);\n }\n setMousedownListener(google.maps.event.addListener(instance, 'mousedown', onMouseDown));\n }\n }, [onMouseDown]);\n useEffect(function () {\n if (instance && onMouseMove) {\n if (mousemoveListener !== null) {\n google.maps.event.removeListener(mousemoveListener);\n }\n setMousemoveListener(google.maps.event.addListener(instance, 'mousemove', onMouseMove));\n }\n }, [onMouseMove]);\n useEffect(function () {\n if (instance && onMouseOut) {\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n setMouseoutListener(google.maps.event.addListener(instance, 'mouseout', onMouseOut));\n }\n }, [onMouseOut]);\n useEffect(function () {\n if (instance && onMouseOver) {\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n setMouseoverListener(google.maps.event.addListener(instance, 'mouseover', onMouseOver));\n }\n }, [onMouseOver]);\n useEffect(function () {\n if (instance && onMouseUp) {\n if (mouseupListener !== null) {\n google.maps.event.removeListener(mouseupListener);\n }\n setMouseupListener(google.maps.event.addListener(instance, 'mouseup', onMouseUp));\n }\n }, [onMouseUp]);\n useEffect(function () {\n if (instance && onRightClick) {\n if (rightclickListener !== null) {\n google.maps.event.removeListener(rightclickListener);\n }\n setRightclickListener(google.maps.event.addListener(instance, 'rightclick', onRightClick));\n }\n }, [onRightClick]);\n useEffect(function () {\n if (instance && onClick) {\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n setClickListener(google.maps.event.addListener(instance, 'click', onClick));\n }\n }, [onClick]);\n useEffect(function () {\n if (instance && onAddFeature) {\n if (addFeatureListener !== null) {\n google.maps.event.removeListener(addFeatureListener);\n }\n setAddFeatureListener(google.maps.event.addListener(instance, 'addfeature', onAddFeature));\n }\n }, [onAddFeature]);\n useEffect(function () {\n if (instance && onRemoveFeature) {\n if (removeFeatureListener !== null) {\n google.maps.event.removeListener(removeFeatureListener);\n }\n setRemoveFeatureListener(google.maps.event.addListener(instance, 'removefeature', onRemoveFeature));\n }\n }, [onRemoveFeature]);\n useEffect(function () {\n if (instance && onRemoveProperty) {\n if (removePropertyListener !== null) {\n google.maps.event.removeListener(removePropertyListener);\n }\n setRemovePropertyListener(google.maps.event.addListener(instance, 'removeproperty', onRemoveProperty));\n }\n }, [onRemoveProperty]);\n useEffect(function () {\n if (instance && onSetGeometry) {\n if (setGeometryListener !== null) {\n google.maps.event.removeListener(setGeometryListener);\n }\n setSetGeometryListener(google.maps.event.addListener(instance, 'setgeometry', onSetGeometry));\n }\n }, [onSetGeometry]);\n useEffect(function () {\n if (instance && onSetProperty) {\n if (setPropertyListener !== null) {\n google.maps.event.removeListener(setPropertyListener);\n }\n setSetPropertyListener(google.maps.event.addListener(instance, 'setproperty', onSetProperty));\n }\n }, [onSetProperty]);\n useEffect(function () {\n if (map !== null) {\n var data = new google.maps.Data(__assign(__assign({}, (options || {})), { map: map }));\n if (onDblClick) {\n setDblclickListener(google.maps.event.addListener(data, 'dblclick', onDblClick));\n }\n if (onMouseDown) {\n setMousedownListener(google.maps.event.addListener(data, 'mousedown', onMouseDown));\n }\n if (onMouseMove) {\n setMousemoveListener(google.maps.event.addListener(data, 'mousemove', onMouseMove));\n }\n if (onMouseOut) {\n setMouseoutListener(google.maps.event.addListener(data, 'mouseout', onMouseOut));\n }\n if (onMouseOver) {\n setMouseoverListener(google.maps.event.addListener(data, 'mouseover', onMouseOver));\n }\n if (onMouseUp) {\n setMouseupListener(google.maps.event.addListener(data, 'mouseup', onMouseUp));\n }\n if (onRightClick) {\n setRightclickListener(google.maps.event.addListener(data, 'rightclick', onRightClick));\n }\n if (onClick) {\n setClickListener(google.maps.event.addListener(data, 'click', onClick));\n }\n if (onAddFeature) {\n setAddFeatureListener(google.maps.event.addListener(data, 'addfeature', onAddFeature));\n }\n if (onRemoveFeature) {\n setRemoveFeatureListener(google.maps.event.addListener(data, 'removefeature', onRemoveFeature));\n }\n if (onRemoveProperty) {\n setRemovePropertyListener(google.maps.event.addListener(data, 'removeproperty', onRemoveProperty));\n }\n if (onSetGeometry) {\n setSetGeometryListener(google.maps.event.addListener(data, 'setgeometry', onSetGeometry));\n }\n if (onSetProperty) {\n setSetPropertyListener(google.maps.event.addListener(data, 'setproperty', onSetProperty));\n }\n setInstance(data);\n if (onLoad) {\n onLoad(data);\n }\n }\n return function () {\n if (instance) {\n if (dblclickListener !== null) {\n google.maps.event.removeListener(dblclickListener);\n }\n if (mousedownListener !== null) {\n google.maps.event.removeListener(mousedownListener);\n }\n if (mousemoveListener !== null) {\n google.maps.event.removeListener(mousemoveListener);\n }\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n if (mouseupListener !== null) {\n google.maps.event.removeListener(mouseupListener);\n }\n if (rightclickListener !== null) {\n google.maps.event.removeListener(rightclickListener);\n }\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n if (addFeatureListener !== null) {\n google.maps.event.removeListener(addFeatureListener);\n }\n if (removeFeatureListener !== null) {\n google.maps.event.removeListener(removeFeatureListener);\n }\n if (removePropertyListener !== null) {\n google.maps.event.removeListener(removePropertyListener);\n }\n if (setGeometryListener !== null) {\n google.maps.event.removeListener(setGeometryListener);\n }\n if (setPropertyListener !== null) {\n google.maps.event.removeListener(setPropertyListener);\n }\n if (onUnmount) {\n onUnmount(instance);\n }\n instance.setMap(null);\n }\n };\n }, []);\n return null;\n}\nvar DataF = memo(DataFunctional);\nvar Data = /** @class */ (function (_super) {\n __extends(Data, _super);\n function Data() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.registeredEvents = [];\n _this.state = {\n data: null,\n };\n _this.setDataCallback = function () {\n if (_this.state.data !== null && _this.props.onLoad) {\n _this.props.onLoad(_this.state.data);\n }\n };\n return _this;\n }\n Data.prototype.componentDidMount = function () {\n if (this.context !== null) {\n var data_1 = new google.maps.Data(__assign(__assign({}, (this.props.options || {})), { map: this.context }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$7,\n eventMap: eventMap$7,\n prevProps: {},\n nextProps: this.props,\n instance: data_1,\n });\n this.setState(function () {\n return {\n data: data_1,\n };\n }, this.setDataCallback);\n }\n };\n Data.prototype.componentDidUpdate = function (prevProps) {\n if (this.state.data !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$7,\n eventMap: eventMap$7,\n prevProps: prevProps,\n nextProps: this.props,\n instance: this.state.data,\n });\n }\n };\n Data.prototype.componentWillUnmount = function () {\n if (this.state.data !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.data);\n }\n unregisterEvents(this.registeredEvents);\n if (this.state.data) {\n this.state.data.setMap(null);\n }\n }\n };\n Data.prototype.render = function () {\n return null;\n };\n Data.contextType = MapContext;\n return Data;\n}(PureComponent));\n\nvar eventMap$6 = {\n onClick: 'click',\n onDefaultViewportChanged: 'defaultviewport_changed',\n onStatusChanged: 'status_changed',\n};\nvar updaterMap$6 = {\n options: function (instance, options) {\n instance.setOptions(options);\n },\n url: function (instance, url) {\n instance.setUrl(url);\n },\n zIndex: function (instance, zIndex) {\n instance.setZIndex(zIndex);\n },\n};\nvar KmlLayer = /** @class */ (function (_super) {\n __extends(KmlLayer, _super);\n function KmlLayer() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.registeredEvents = [];\n _this.state = {\n kmlLayer: null,\n };\n _this.setKmlLayerCallback = function () {\n if (_this.state.kmlLayer !== null && _this.props.onLoad) {\n _this.props.onLoad(_this.state.kmlLayer);\n }\n };\n return _this;\n }\n KmlLayer.prototype.componentDidMount = function () {\n var kmlLayer = new google.maps.KmlLayer(__assign(__assign({}, this.props.options), { map: this.context }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$6,\n eventMap: eventMap$6,\n prevProps: {},\n nextProps: this.props,\n instance: kmlLayer,\n });\n this.setState(function setLmlLayer() {\n return {\n kmlLayer: kmlLayer,\n };\n }, this.setKmlLayerCallback);\n };\n KmlLayer.prototype.componentDidUpdate = function (prevProps) {\n if (this.state.kmlLayer !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$6,\n eventMap: eventMap$6,\n prevProps: prevProps,\n nextProps: this.props,\n instance: this.state.kmlLayer,\n });\n }\n };\n KmlLayer.prototype.componentWillUnmount = function () {\n if (this.state.kmlLayer !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.kmlLayer);\n }\n unregisterEvents(this.registeredEvents);\n this.state.kmlLayer.setMap(null);\n }\n };\n KmlLayer.prototype.render = function () {\n return null;\n };\n KmlLayer.contextType = MapContext;\n return KmlLayer;\n}(PureComponent));\n\nfunction getOffsetOverride(containerElement, getPixelPositionOffset) {\n return typeof getPixelPositionOffset === 'function'\n ? getPixelPositionOffset(containerElement.offsetWidth, containerElement.offsetHeight)\n : {\n x: 0,\n y: 0,\n };\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction createLatLng(inst, Type) { return new Type(inst.lat, inst.lng); }\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction createLatLngBounds(inst, Type) {\n return new Type(new google.maps.LatLng(inst.ne.lat, inst.ne.lng), new google.maps.LatLng(inst.sw.lat, inst.sw.lng));\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction ensureOfType(inst, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfactory\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n) {\n return inst instanceof type ? inst : factory(inst, type);\n}\nfunction ensureOfTypeBounds(inst, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfactory\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n) {\n return inst instanceof type ? inst : factory(inst, type);\n}\nfunction getLayoutStylesByBounds(mapCanvasProjection, offset, bounds) {\n var ne = mapCanvasProjection && mapCanvasProjection.fromLatLngToDivPixel(bounds.getNorthEast());\n var sw = mapCanvasProjection && mapCanvasProjection.fromLatLngToDivPixel(bounds.getSouthWest());\n if (ne && sw) {\n return {\n left: \"\".concat(sw.x + offset.x, \"px\"),\n top: \"\".concat(ne.y + offset.y, \"px\"),\n width: \"\".concat(ne.x - sw.x - offset.x, \"px\"),\n height: \"\".concat(sw.y - ne.y - offset.y, \"px\"),\n };\n }\n return {\n left: '-9999px',\n top: '-9999px',\n };\n}\nfunction getLayoutStylesByPosition(mapCanvasProjection, offset, position) {\n var point = mapCanvasProjection && mapCanvasProjection.fromLatLngToDivPixel(position);\n if (point) {\n var x = point.x, y = point.y;\n return {\n left: \"\".concat(x + offset.x, \"px\"),\n top: \"\".concat(y + offset.y, \"px\"),\n };\n }\n return {\n left: '-9999px',\n top: '-9999px',\n };\n}\nfunction getLayoutStyles(mapCanvasProjection, offset, bounds, position) {\n return bounds !== undefined\n ? getLayoutStylesByBounds(mapCanvasProjection, offset, ensureOfTypeBounds(bounds, google.maps.LatLngBounds, createLatLngBounds))\n : getLayoutStylesByPosition(mapCanvasProjection, offset, ensureOfType(position, google.maps.LatLng, createLatLng));\n}\nfunction arePositionsEqual(currentPosition, previousPosition) {\n return currentPosition.left === previousPosition.left\n && currentPosition.top === previousPosition.top\n && currentPosition.width === previousPosition.height\n && currentPosition.height === previousPosition.height;\n}\n\nfunction createOverlay(container, pane, position, bounds, getPixelPositionOffset) {\n var Overlay = /** @class */ (function (_super) {\n __extends(Overlay, _super);\n function Overlay(container, pane, position, bounds) {\n var _this = _super.call(this) || this;\n _this.container = container;\n _this.pane = pane;\n _this.position = position;\n _this.bounds = bounds;\n return _this;\n }\n Overlay.prototype.onAdd = function () {\n var _a;\n var pane = (_a = this.getPanes()) === null || _a === void 0 ? void 0 : _a[this.pane];\n pane === null || pane === void 0 ? void 0 : pane.appendChild(this.container);\n };\n Overlay.prototype.draw = function () {\n var projection = this.getProjection();\n var offset = __assign({}, (this.container\n ? getOffsetOverride(this.container, getPixelPositionOffset)\n : {\n x: 0,\n y: 0,\n }));\n var layoutStyles = getLayoutStyles(projection, offset, this.bounds, this.position);\n for (var _i = 0, _a = Object.entries(layoutStyles); _i < _a.length; _i++) {\n var _b = _a[_i], key = _b[0], value = _b[1];\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.container.style[key] = value;\n }\n };\n Overlay.prototype.onRemove = function () {\n if (this.container.parentNode !== null) {\n this.container.parentNode.removeChild(this.container);\n }\n };\n return Overlay;\n }(google.maps.OverlayView));\n return new Overlay(container, pane, position, bounds);\n}\n\nfunction convertToLatLngString(latLngLike) {\n if (!latLngLike) {\n return '';\n }\n var latLng = latLngLike instanceof google.maps.LatLng\n ? latLngLike\n : new google.maps.LatLng(latLngLike.lat, latLngLike.lng);\n return latLng + '';\n}\nfunction convertToLatLngBoundsString(latLngBoundsLike) {\n if (!latLngBoundsLike) {\n return '';\n }\n var latLngBounds = latLngBoundsLike instanceof google.maps.LatLngBounds\n ? latLngBoundsLike\n : new google.maps.LatLngBounds(new google.maps.LatLng(latLngBoundsLike.south, latLngBoundsLike.east), new google.maps.LatLng(latLngBoundsLike.north, latLngBoundsLike.west));\n return latLngBounds + '';\n}\nvar FLOAT_PANE = \"floatPane\";\nvar MAP_PANE = \"mapPane\";\nvar MARKER_LAYER = \"markerLayer\";\nvar OVERLAY_LAYER = \"overlayLayer\";\nvar OVERLAY_MOUSE_TARGET = \"overlayMouseTarget\";\nfunction OverlayViewFunctional(_a) {\n var position = _a.position, bounds = _a.bounds, mapPaneName = _a.mapPaneName, zIndex = _a.zIndex, onLoad = _a.onLoad, onUnmount = _a.onUnmount, getPixelPositionOffset = _a.getPixelPositionOffset, children = _a.children;\n var map = useContext(MapContext);\n var container = useMemo(function () {\n var div = document.createElement('div');\n div.style.position = 'absolute';\n return div;\n }, []);\n var overlay = useMemo(function () {\n return createOverlay(container, mapPaneName, position, bounds, getPixelPositionOffset);\n }, [container, mapPaneName, position, bounds]);\n useEffect(function () {\n onLoad === null || onLoad === void 0 ? void 0 : onLoad(overlay);\n overlay === null || overlay === void 0 ? void 0 : overlay.setMap(map);\n return function () {\n onUnmount === null || onUnmount === void 0 ? void 0 : onUnmount(overlay);\n overlay === null || overlay === void 0 ? void 0 : overlay.setMap(null);\n };\n }, [map, overlay]);\n // to move the container to the foreground and background\n useEffect(function () {\n container.style.zIndex = \"\".concat(zIndex);\n }, [zIndex, container]);\n return ReactDOM.createPortal(children, container);\n}\nvar OverlayViewF = memo(OverlayViewFunctional);\nvar OverlayView = /** @class */ (function (_super) {\n __extends(OverlayView, _super);\n function OverlayView(props) {\n var _this = _super.call(this, props) || this;\n _this.state = {\n paneEl: null,\n containerStyle: {\n // set initial position\n position: 'absolute',\n },\n };\n _this.updatePane = function () {\n var mapPaneName = _this.props.mapPaneName;\n // https://developers.google.com/maps/documentation/javascript/3.exp/reference#MapPanes\n var mapPanes = _this.overlayView.getPanes();\n invariant$1(!!mapPaneName, \"OverlayView requires props.mapPaneName but got %s\", mapPaneName);\n if (mapPanes) {\n _this.setState({\n paneEl: mapPanes[mapPaneName],\n });\n }\n else {\n _this.setState({\n paneEl: null,\n });\n }\n };\n _this.onAdd = function () {\n var _a, _b;\n _this.updatePane();\n (_b = (_a = _this.props).onLoad) === null || _b === void 0 ? void 0 : _b.call(_a, _this.overlayView);\n };\n _this.onPositionElement = function () {\n var mapCanvasProjection = _this.overlayView.getProjection();\n var offset = __assign({ x: 0, y: 0 }, (_this.containerRef.current\n ? getOffsetOverride(_this.containerRef.current, _this.props.getPixelPositionOffset)\n : {}));\n var layoutStyles = getLayoutStyles(mapCanvasProjection, offset, _this.props.bounds, _this.props.position);\n var _a = _this.state.containerStyle, left = _a.left, top = _a.top, width = _a.width, height = _a.height;\n if (!arePositionsEqual(layoutStyles, { left: left, top: top, width: width, height: height })) {\n _this.setState({\n containerStyle: {\n top: layoutStyles.top || 0,\n left: layoutStyles.left || 0,\n width: layoutStyles.width || 0,\n height: layoutStyles.height || 0,\n position: 'absolute',\n },\n });\n }\n };\n _this.draw = function () {\n _this.onPositionElement();\n };\n _this.onRemove = function () {\n var _a, _b;\n _this.setState(function () { return ({\n paneEl: null,\n }); });\n (_b = (_a = _this.props).onUnmount) === null || _b === void 0 ? void 0 : _b.call(_a, _this.overlayView);\n };\n _this.containerRef = createRef();\n // You must implement three methods: onAdd(), draw(), and onRemove().\n var overlayView = new google.maps.OverlayView();\n overlayView.onAdd = _this.onAdd;\n overlayView.draw = _this.draw;\n overlayView.onRemove = _this.onRemove;\n _this.overlayView = overlayView;\n return _this;\n }\n OverlayView.prototype.componentDidMount = function () {\n this.overlayView.setMap(this.context);\n };\n OverlayView.prototype.componentDidUpdate = function (prevProps) {\n var prevPositionString = convertToLatLngString(prevProps.position);\n var positionString = convertToLatLngString(this.props.position);\n var prevBoundsString = convertToLatLngBoundsString(prevProps.bounds);\n var boundsString = convertToLatLngBoundsString(this.props.bounds);\n if (prevPositionString !== positionString ||\n prevBoundsString !== boundsString) {\n this.overlayView.draw();\n }\n if (prevProps.mapPaneName !== this.props.mapPaneName) {\n this.updatePane();\n }\n };\n OverlayView.prototype.componentWillUnmount = function () {\n this.overlayView.setMap(null);\n };\n OverlayView.prototype.render = function () {\n var paneEl = this.state.paneEl;\n if (paneEl) {\n return ReactDOM.createPortal(jsx(\"div\", { ref: this.containerRef, style: this.state.containerStyle, children: Children.only(this.props.children) }), paneEl);\n }\n else {\n return null;\n }\n };\n OverlayView.FLOAT_PANE = \"floatPane\";\n OverlayView.MAP_PANE = \"mapPane\";\n OverlayView.MARKER_LAYER = \"markerLayer\";\n OverlayView.OVERLAY_LAYER = \"overlayLayer\";\n OverlayView.OVERLAY_MOUSE_TARGET = \"overlayMouseTarget\";\n OverlayView.contextType = MapContext;\n return OverlayView;\n}(PureComponent));\n\nfunction noop() { return; }\n\nvar eventMap$5 = {\n onDblClick: 'dblclick',\n onClick: 'click',\n};\nvar updaterMap$5 = {\n opacity: function (instance, opacity) {\n instance.setOpacity(opacity);\n },\n};\nfunction GroundOverlayFunctional(_a) {\n var url = _a.url, bounds = _a.bounds, options = _a.options, visible = _a.visible;\n var map = useContext(MapContext);\n var imageBounds = new google.maps.LatLngBounds(new google.maps.LatLng(bounds.south, bounds.west), new google.maps.LatLng(bounds.north, bounds.east));\n var groundOverlay = useMemo(function () {\n var overlay = new google.maps.GroundOverlay(url, imageBounds, __assign({}, options));\n return overlay;\n }, []);\n useEffect(function () {\n if (groundOverlay !== null) {\n groundOverlay.setMap(map);\n }\n }, [map]);\n useEffect(function () {\n if (typeof url !== 'undefined' && groundOverlay !== null) {\n groundOverlay.set(\"url\", url);\n groundOverlay.setMap(map);\n }\n }, [groundOverlay, url]);\n useEffect(function () {\n if (typeof visible !== 'undefined' && groundOverlay !== null) {\n groundOverlay.setOpacity(visible ? 1 : 0);\n }\n }, [groundOverlay, visible]);\n useEffect(function () {\n var newBounds = new google.maps.LatLngBounds(new google.maps.LatLng(bounds.south, bounds.west), new google.maps.LatLng(bounds.north, bounds.east));\n if (typeof bounds !== 'undefined' && groundOverlay !== null) {\n groundOverlay.set(\"bounds\", newBounds);\n groundOverlay.setMap(map);\n }\n }, [groundOverlay, bounds]);\n return null;\n}\nvar GroundOverlayF = memo(GroundOverlayFunctional);\nvar GroundOverlay = /** @class */ (function (_super) {\n __extends(GroundOverlay, _super);\n function GroundOverlay() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.registeredEvents = [];\n _this.state = {\n groundOverlay: null,\n };\n _this.setGroundOverlayCallback = function () {\n if (_this.state.groundOverlay !== null && _this.props.onLoad) {\n _this.props.onLoad(_this.state.groundOverlay);\n }\n };\n return _this;\n }\n GroundOverlay.prototype.componentDidMount = function () {\n invariant$1(!!this.props.url || !!this.props.bounds, \"For GroundOverlay, url and bounds are passed in to constructor and are immutable after instantiated. This is the behavior of Google Maps JavaScript API v3 ( See https://developers.google.com/maps/documentation/javascript/reference#GroundOverlay) Hence, use the corresponding two props provided by `react-google-maps-api`, url and bounds. In some cases, you'll need the GroundOverlay component to reflect the changes of url and bounds. You can leverage the React's key property to remount the component. Typically, just `key={url}` would serve your need. See https://github.com/tomchentw/react-google-maps/issues/655\");\n var groundOverlay = new google.maps.GroundOverlay(this.props.url, this.props.bounds, __assign(__assign({}, this.props.options), { map: this.context }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$5,\n eventMap: eventMap$5,\n prevProps: {},\n nextProps: this.props,\n instance: groundOverlay,\n });\n this.setState(function setGroundOverlay() {\n return {\n groundOverlay: groundOverlay,\n };\n }, this.setGroundOverlayCallback);\n };\n GroundOverlay.prototype.componentDidUpdate = function (prevProps) {\n if (this.state.groundOverlay !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$5,\n eventMap: eventMap$5,\n prevProps: prevProps,\n nextProps: this.props,\n instance: this.state.groundOverlay,\n });\n }\n };\n GroundOverlay.prototype.componentWillUnmount = function () {\n if (this.state.groundOverlay) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.groundOverlay);\n }\n this.state.groundOverlay.setMap(null);\n }\n };\n GroundOverlay.prototype.render = function () {\n return null;\n };\n GroundOverlay.defaultProps = {\n onLoad: noop,\n };\n GroundOverlay.contextType = MapContext;\n return GroundOverlay;\n}(PureComponent));\n\nvar eventMap$4 = {};\nvar updaterMap$4 = {\n data: function (instance, data) {\n instance.setData(data);\n },\n map: function (instance, map) {\n instance.setMap(map);\n },\n options: function (instance, options) {\n instance.setOptions(options);\n },\n};\nfunction HeatmapLayerFunctional(_a) {\n var data = _a.data, onLoad = _a.onLoad, onUnmount = _a.onUnmount, options = _a.options;\n var map = useContext(MapContext);\n var _b = useState(null), instance = _b[0], setInstance = _b[1];\n useEffect(function () {\n if (!google.maps.visualization) {\n invariant$1(!!google.maps.visualization, 'Did you include prop libraries={[\"visualization\"]} in useJsApiScript? %s', google.maps.visualization);\n }\n }, []);\n useEffect(function () {\n invariant$1(!!data, 'data property is required in HeatmapLayer %s', data);\n }, [data]);\n // Order does matter\n useEffect(function () {\n if (instance !== null) {\n instance.setMap(map);\n }\n }, [map]);\n useEffect(function () {\n if (options && instance !== null) {\n instance.setOptions(options);\n }\n }, [instance, options]);\n useEffect(function () {\n var heatmapLayer = new google.maps.visualization.HeatmapLayer(__assign(__assign({}, (options || {})), { data: data, map: map }));\n setInstance(heatmapLayer);\n if (onLoad) {\n onLoad(heatmapLayer);\n }\n return function () {\n if (instance !== null) {\n if (onUnmount) {\n onUnmount(instance);\n }\n instance.setMap(null);\n }\n };\n }, []);\n return null;\n}\nvar HeatmapLayerF = memo(HeatmapLayerFunctional);\nvar HeatmapLayer = /** @class */ (function (_super) {\n __extends(HeatmapLayer, _super);\n function HeatmapLayer() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.registeredEvents = [];\n _this.state = {\n heatmapLayer: null,\n };\n _this.setHeatmapLayerCallback = function () {\n if (_this.state.heatmapLayer !== null && _this.props.onLoad) {\n _this.props.onLoad(_this.state.heatmapLayer);\n }\n };\n return _this;\n }\n HeatmapLayer.prototype.componentDidMount = function () {\n invariant$1(!!google.maps.visualization, 'Did you include prop libraries={[\"visualization\"]} to ? %s', google.maps.visualization);\n invariant$1(!!this.props.data, 'data property is required in HeatmapLayer %s', this.props.data);\n var heatmapLayer = new google.maps.visualization.HeatmapLayer(__assign(__assign({}, (this.props.options || {})), { data: this.props.data, map: this.context }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$4,\n eventMap: eventMap$4,\n prevProps: {},\n nextProps: this.props,\n instance: heatmapLayer,\n });\n this.setState(function setHeatmapLayer() {\n return {\n heatmapLayer: heatmapLayer,\n };\n }, this.setHeatmapLayerCallback);\n };\n HeatmapLayer.prototype.componentDidUpdate = function (prevProps) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$4,\n eventMap: eventMap$4,\n prevProps: prevProps,\n nextProps: this.props,\n instance: this.state.heatmapLayer,\n });\n };\n HeatmapLayer.prototype.componentWillUnmount = function () {\n if (this.state.heatmapLayer !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.heatmapLayer);\n }\n unregisterEvents(this.registeredEvents);\n this.state.heatmapLayer.setMap(null);\n }\n };\n HeatmapLayer.prototype.render = function () {\n return null;\n };\n HeatmapLayer.contextType = MapContext;\n return HeatmapLayer;\n}(PureComponent));\n\nvar eventMap$3 = {\n onCloseClick: 'closeclick',\n onPanoChanged: 'pano_changed',\n onPositionChanged: 'position_changed',\n onPovChanged: 'pov_changed',\n onResize: 'resize',\n onStatusChanged: 'status_changed',\n onVisibleChanged: 'visible_changed',\n onZoomChanged: 'zoom_changed',\n};\nvar updaterMap$3 = {\n register: function (instance, provider, options) {\n instance.registerPanoProvider(provider, options);\n },\n links: function (instance, links) {\n instance.setLinks(links);\n },\n motionTracking: function (instance, motionTracking) {\n instance.setMotionTracking(motionTracking);\n },\n options: function (instance, options) {\n instance.setOptions(options);\n },\n pano: function (instance, pano) {\n instance.setPano(pano);\n },\n position: function (instance, position) {\n instance.setPosition(position);\n },\n pov: function (instance, pov) {\n instance.setPov(pov);\n },\n visible: function (instance, visible) {\n instance.setVisible(visible);\n },\n zoom: function (instance, zoom) {\n instance.setZoom(zoom);\n },\n};\nvar StreetViewPanorama = /** @class */ (function (_super) {\n __extends(StreetViewPanorama, _super);\n function StreetViewPanorama() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.registeredEvents = [];\n _this.state = {\n streetViewPanorama: null,\n };\n _this.setStreetViewPanoramaCallback = function () {\n if (_this.state.streetViewPanorama !== null && _this.props.onLoad) {\n _this.props.onLoad(_this.state.streetViewPanorama);\n }\n };\n return _this;\n }\n StreetViewPanorama.prototype.componentDidMount = function () {\n var _a, _b;\n var streetViewPanorama = (_b = (_a = this.context) === null || _a === void 0 ? void 0 : _a.getStreetView()) !== null && _b !== void 0 ? _b : null;\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$3,\n eventMap: eventMap$3,\n prevProps: {},\n nextProps: this.props,\n instance: streetViewPanorama,\n });\n this.setState(function () {\n return {\n streetViewPanorama: streetViewPanorama,\n };\n }, this.setStreetViewPanoramaCallback);\n };\n StreetViewPanorama.prototype.componentDidUpdate = function (prevProps) {\n if (this.state.streetViewPanorama !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$3,\n eventMap: eventMap$3,\n prevProps: prevProps,\n nextProps: this.props,\n instance: this.state.streetViewPanorama,\n });\n }\n };\n StreetViewPanorama.prototype.componentWillUnmount = function () {\n if (this.state.streetViewPanorama !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.streetViewPanorama);\n }\n unregisterEvents(this.registeredEvents);\n this.state.streetViewPanorama.setVisible(false);\n }\n };\n StreetViewPanorama.prototype.render = function () {\n return null;\n };\n StreetViewPanorama.contextType = MapContext;\n return StreetViewPanorama;\n}(PureComponent));\n\nvar StreetViewService = /** @class */ (function (_super) {\n __extends(StreetViewService, _super);\n function StreetViewService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.state = {\n streetViewService: null,\n };\n _this.setStreetViewServiceCallback = function () {\n if (_this.state.streetViewService !== null && _this.props.onLoad) {\n _this.props.onLoad(_this.state.streetViewService);\n }\n };\n return _this;\n }\n StreetViewService.prototype.componentDidMount = function () {\n var streetViewService = new google.maps.StreetViewService();\n this.setState(function setStreetViewService() {\n return {\n streetViewService: streetViewService,\n };\n }, this.setStreetViewServiceCallback);\n };\n StreetViewService.prototype.componentWillUnmount = function () {\n if (this.state.streetViewService !== null && this.props.onUnmount) {\n this.props.onUnmount(this.state.streetViewService);\n }\n };\n StreetViewService.prototype.render = function () {\n return null;\n };\n StreetViewService.contextType = MapContext;\n return StreetViewService;\n}(PureComponent));\n\nvar DirectionsService = /** @class */ (function (_super) {\n __extends(DirectionsService, _super);\n function DirectionsService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.state = {\n directionsService: null,\n };\n _this.setDirectionsServiceCallback = function () {\n if (_this.state.directionsService !== null && _this.props.onLoad) {\n _this.props.onLoad(_this.state.directionsService);\n }\n };\n return _this;\n }\n DirectionsService.prototype.componentDidMount = function () {\n invariant$1(!!this.props.options, 'DirectionsService expected options object as parameter, but got %s', this.props.options);\n var directionsService = new google.maps.DirectionsService();\n this.setState(function setDirectionsService() {\n return {\n directionsService: directionsService,\n };\n }, this.setDirectionsServiceCallback);\n };\n DirectionsService.prototype.componentDidUpdate = function () {\n if (this.state.directionsService !== null) {\n this.state.directionsService.route(this.props.options, this.props.callback);\n }\n };\n DirectionsService.prototype.componentWillUnmount = function () {\n if (this.state.directionsService !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.directionsService);\n }\n }\n };\n DirectionsService.prototype.render = function () {\n return null;\n };\n return DirectionsService;\n}(PureComponent));\n\nvar eventMap$2 = {\n onDirectionsChanged: 'directions_changed',\n};\nvar updaterMap$2 = {\n directions: function (instance, directions) {\n instance.setDirections(directions);\n },\n map: function (instance, map) {\n instance.setMap(map);\n },\n options: function (instance, options) {\n instance.setOptions(options);\n },\n panel: function (instance, panel) {\n instance.setPanel(panel);\n },\n routeIndex: function (instance, routeIndex) {\n instance.setRouteIndex(routeIndex);\n },\n};\nvar DirectionsRenderer = /** @class */ (function (_super) {\n __extends(DirectionsRenderer, _super);\n function DirectionsRenderer() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.registeredEvents = [];\n _this.state = {\n directionsRenderer: null,\n };\n _this.setDirectionsRendererCallback = function () {\n if (_this.state.directionsRenderer !== null) {\n _this.state.directionsRenderer.setMap(_this.context);\n if (_this.props.onLoad) {\n _this.props.onLoad(_this.state.directionsRenderer);\n }\n }\n };\n return _this;\n }\n DirectionsRenderer.prototype.componentDidMount = function () {\n var directionsRenderer = new google.maps.DirectionsRenderer(this.props.options);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$2,\n eventMap: eventMap$2,\n prevProps: {},\n nextProps: this.props,\n instance: directionsRenderer,\n });\n this.setState(function setDirectionsRenderer() {\n return {\n directionsRenderer: directionsRenderer,\n };\n }, this.setDirectionsRendererCallback);\n };\n DirectionsRenderer.prototype.componentDidUpdate = function (prevProps) {\n if (this.state.directionsRenderer !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$2,\n eventMap: eventMap$2,\n prevProps: prevProps,\n nextProps: this.props,\n instance: this.state.directionsRenderer,\n });\n }\n };\n DirectionsRenderer.prototype.componentWillUnmount = function () {\n if (this.state.directionsRenderer !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.directionsRenderer);\n }\n unregisterEvents(this.registeredEvents);\n if (this.state.directionsRenderer) {\n this.state.directionsRenderer.setMap(null);\n }\n }\n };\n DirectionsRenderer.prototype.render = function () {\n return jsx(Fragment, {});\n };\n DirectionsRenderer.contextType = MapContext;\n return DirectionsRenderer;\n}(PureComponent));\n\nvar DistanceMatrixService = /** @class */ (function (_super) {\n __extends(DistanceMatrixService, _super);\n function DistanceMatrixService() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.state = {\n distanceMatrixService: null,\n };\n _this.setDistanceMatrixServiceCallback = function () {\n if (_this.state.distanceMatrixService !== null && _this.props.onLoad) {\n _this.props.onLoad(_this.state.distanceMatrixService);\n }\n };\n return _this;\n }\n DistanceMatrixService.prototype.componentDidMount = function () {\n invariant$1(!!this.props.options, 'DistanceMatrixService expected options object as parameter, but go %s', this.props.options);\n var distanceMatrixService = new google.maps.DistanceMatrixService();\n this.setState(function setDistanceMatrixService() {\n return {\n distanceMatrixService: distanceMatrixService,\n };\n }, this.setDistanceMatrixServiceCallback);\n };\n DistanceMatrixService.prototype.componentDidUpdate = function () {\n if (this.state.distanceMatrixService !== null) {\n this.state.distanceMatrixService.getDistanceMatrix(this.props.options, this.props.callback);\n }\n };\n DistanceMatrixService.prototype.componentWillUnmount = function () {\n if (this.state.distanceMatrixService !== null && this.props.onUnmount) {\n this.props.onUnmount(this.state.distanceMatrixService);\n }\n };\n DistanceMatrixService.prototype.render = function () {\n return null;\n };\n return DistanceMatrixService;\n}(PureComponent));\n\nvar eventMap$1 = {\n onPlacesChanged: 'places_changed',\n};\nvar updaterMap$1 = {\n bounds: function (instance, bounds) {\n instance.setBounds(bounds);\n },\n};\nvar StandaloneSearchBox = /** @class */ (function (_super) {\n __extends(StandaloneSearchBox, _super);\n function StandaloneSearchBox() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.registeredEvents = [];\n _this.containerElement = createRef();\n _this.state = {\n searchBox: null,\n };\n _this.setSearchBoxCallback = function () {\n if (_this.state.searchBox !== null && _this.props.onLoad) {\n _this.props.onLoad(_this.state.searchBox);\n }\n };\n return _this;\n }\n StandaloneSearchBox.prototype.componentDidMount = function () {\n invariant$1(!!google.maps.places, 'You need to provide libraries={[\"places\"]} prop to component %s', google.maps.places);\n if (this.containerElement !== null && this.containerElement.current !== null) {\n var input = this.containerElement.current.querySelector('input');\n if (input !== null) {\n var searchBox_1 = new google.maps.places.SearchBox(input, this.props.options);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$1,\n eventMap: eventMap$1,\n prevProps: {},\n nextProps: this.props,\n instance: searchBox_1,\n });\n this.setState(function setSearchBox() {\n return {\n searchBox: searchBox_1,\n };\n }, this.setSearchBoxCallback);\n }\n }\n };\n StandaloneSearchBox.prototype.componentDidUpdate = function (prevProps) {\n if (this.state.searchBox !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$1,\n eventMap: eventMap$1,\n prevProps: prevProps,\n nextProps: this.props,\n instance: this.state.searchBox,\n });\n }\n };\n StandaloneSearchBox.prototype.componentWillUnmount = function () {\n if (this.state.searchBox !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.searchBox);\n }\n unregisterEvents(this.registeredEvents);\n }\n };\n StandaloneSearchBox.prototype.render = function () {\n return jsx(\"div\", { ref: this.containerElement, children: Children.only(this.props.children) });\n };\n StandaloneSearchBox.contextType = MapContext;\n return StandaloneSearchBox;\n}(PureComponent));\n\nvar eventMap = {\n onPlaceChanged: 'place_changed',\n};\nvar updaterMap = {\n bounds: function (instance, bounds) {\n instance.setBounds(bounds);\n },\n restrictions: function (instance, restrictions) {\n instance.setComponentRestrictions(restrictions);\n },\n fields: function (instance, fields) {\n instance.setFields(fields);\n },\n options: function (instance, options) {\n instance.setOptions(options);\n },\n types: function (instance, types) {\n instance.setTypes(types);\n },\n};\nvar Autocomplete = /** @class */ (function (_super) {\n __extends(Autocomplete, _super);\n function Autocomplete() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.registeredEvents = [];\n _this.containerElement = createRef();\n _this.state = {\n autocomplete: null,\n };\n _this.setAutocompleteCallback = function () {\n if (_this.state.autocomplete !== null && _this.props.onLoad) {\n _this.props.onLoad(_this.state.autocomplete);\n }\n };\n return _this;\n }\n Autocomplete.prototype.componentDidMount = function () {\n var _a;\n invariant$1(!!google.maps.places, 'You need to provide libraries={[\"places\"]} prop to component %s', google.maps.places);\n // TODO: why current could be equal null?\n var input = (_a = this.containerElement.current) === null || _a === void 0 ? void 0 : _a.querySelector('input');\n if (input) {\n var autocomplete_1 = new google.maps.places.Autocomplete(input, this.props.options);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap,\n eventMap: eventMap,\n prevProps: {},\n nextProps: this.props,\n instance: autocomplete_1,\n });\n this.setState(function () {\n return {\n autocomplete: autocomplete_1,\n };\n }, this.setAutocompleteCallback);\n }\n };\n Autocomplete.prototype.componentDidUpdate = function (prevProps) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap,\n eventMap: eventMap,\n prevProps: prevProps,\n nextProps: this.props,\n instance: this.state.autocomplete,\n });\n };\n Autocomplete.prototype.componentWillUnmount = function () {\n if (this.state.autocomplete !== null) {\n unregisterEvents(this.registeredEvents);\n }\n };\n Autocomplete.prototype.render = function () {\n return jsx(\"div\", { ref: this.containerElement, className: this.props.className, children: Children.only(this.props.children) });\n };\n Autocomplete.defaultProps = {\n className: ''\n };\n Autocomplete.contextType = MapContext;\n return Autocomplete;\n}(PureComponent));\n\nexport { Autocomplete, BicyclingLayer, BicyclingLayerF, Circle, CircleF, Data, DataF, DirectionsRenderer, DirectionsService, DistanceMatrixService, DrawingManager, DrawingManagerF, FLOAT_PANE, GoogleMap, index_esm as GoogleMapsMarkerClusterer, GoogleMarkerClusterer$1 as GoogleMarkerClusterer, GroundOverlay, GroundOverlayF, HeatmapLayer, HeatmapLayerF, InfoBoxComponent as InfoBox, InfoBoxF, InfoWindow, InfoWindowF, KmlLayer, LoadScript, LoadScriptNext$1 as LoadScriptNext, MAP_PANE, MARKER_LAYER, MapContext, Marker, ClustererComponent as MarkerClusterer, MarkerClustererF, MarkerF, OVERLAY_LAYER, OVERLAY_MOUSE_TARGET, OverlayView, OverlayViewF, Polygon, PolygonF, Polyline, PolylineF, Rectangle, RectangleF, StandaloneSearchBox, StreetViewPanorama, StreetViewService, TrafficLayer, TrafficLayerF, TransitLayer, TransitLayerF, useGoogleMap, useJsApiLoader, useLoadScript };\n//# sourceMappingURL=esm.js.map\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\n\r\nfunction __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\ntypeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\n\nfunction getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nvar fastDeepEqual = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n\nvar isEqual = /*@__PURE__*/getDefaultExportFromCjs(fastDeepEqual);\n\n/**\n * Copyright 2019 Google LLC. All Rights Reserved.\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 */\nconst DEFAULT_ID = \"__googleMapsScriptId\";\n/**\n * The status of the [[Loader]].\n */\nvar LoaderStatus;\n(function (LoaderStatus) {\n LoaderStatus[LoaderStatus[\"INITIALIZED\"] = 0] = \"INITIALIZED\";\n LoaderStatus[LoaderStatus[\"LOADING\"] = 1] = \"LOADING\";\n LoaderStatus[LoaderStatus[\"SUCCESS\"] = 2] = \"SUCCESS\";\n LoaderStatus[LoaderStatus[\"FAILURE\"] = 3] = \"FAILURE\";\n})(LoaderStatus || (LoaderStatus = {}));\n/**\n * [[Loader]] makes it easier to add Google Maps JavaScript API to your application\n * dynamically using\n * [Promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n * It works by dynamically creating and appending a script node to the the\n * document head and wrapping the callback function so as to return a promise.\n *\n * ```\n * const loader = new Loader({\n * apiKey: \"\",\n * version: \"weekly\",\n * libraries: [\"places\"]\n * });\n *\n * loader.load().then((google) => {\n * const map = new google.maps.Map(...)\n * })\n * ```\n */\nclass Loader {\n /**\n * Creates an instance of Loader using [[LoaderOptions]]. No defaults are set\n * using this library, instead the defaults are set by the Google Maps\n * JavaScript API server.\n *\n * ```\n * const loader = Loader({apiKey, version: 'weekly', libraries: ['places']});\n * ```\n */\n constructor({ apiKey, authReferrerPolicy, channel, client, id = DEFAULT_ID, language, libraries = [], mapIds, nonce, region, retries = 3, url = \"https://maps.googleapis.com/maps/api/js\", version, }) {\n this.callbacks = [];\n this.done = false;\n this.loading = false;\n this.errors = [];\n this.apiKey = apiKey;\n this.authReferrerPolicy = authReferrerPolicy;\n this.channel = channel;\n this.client = client;\n this.id = id || DEFAULT_ID; // Do not allow empty string\n this.language = language;\n this.libraries = libraries;\n this.mapIds = mapIds;\n this.nonce = nonce;\n this.region = region;\n this.retries = retries;\n this.url = url;\n this.version = version;\n if (Loader.instance) {\n if (!isEqual(this.options, Loader.instance.options)) {\n throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(Loader.instance.options)}`);\n }\n return Loader.instance;\n }\n Loader.instance = this;\n }\n get options() {\n return {\n version: this.version,\n apiKey: this.apiKey,\n channel: this.channel,\n client: this.client,\n id: this.id,\n libraries: this.libraries,\n language: this.language,\n region: this.region,\n mapIds: this.mapIds,\n nonce: this.nonce,\n url: this.url,\n authReferrerPolicy: this.authReferrerPolicy,\n };\n }\n get status() {\n if (this.errors.length) {\n return LoaderStatus.FAILURE;\n }\n if (this.done) {\n return LoaderStatus.SUCCESS;\n }\n if (this.loading) {\n return LoaderStatus.LOADING;\n }\n return LoaderStatus.INITIALIZED;\n }\n get failed() {\n return this.done && !this.loading && this.errors.length >= this.retries + 1;\n }\n /**\n * CreateUrl returns the Google Maps JavaScript API script url given the [[LoaderOptions]].\n *\n * @ignore\n * @deprecated\n */\n createUrl() {\n let url = this.url;\n url += `?callback=__googleMapsCallback&loading=async`;\n if (this.apiKey) {\n url += `&key=${this.apiKey}`;\n }\n if (this.channel) {\n url += `&channel=${this.channel}`;\n }\n if (this.client) {\n url += `&client=${this.client}`;\n }\n if (this.libraries.length > 0) {\n url += `&libraries=${this.libraries.join(\",\")}`;\n }\n if (this.language) {\n url += `&language=${this.language}`;\n }\n if (this.region) {\n url += `®ion=${this.region}`;\n }\n if (this.version) {\n url += `&v=${this.version}`;\n }\n if (this.mapIds) {\n url += `&map_ids=${this.mapIds.join(\",\")}`;\n }\n if (this.authReferrerPolicy) {\n url += `&auth_referrer_policy=${this.authReferrerPolicy}`;\n }\n return url;\n }\n deleteScript() {\n const script = document.getElementById(this.id);\n if (script) {\n script.remove();\n }\n }\n /**\n * Load the Google Maps JavaScript API script and return a Promise.\n * @deprecated, use importLibrary() instead.\n */\n load() {\n return this.loadPromise();\n }\n /**\n * Load the Google Maps JavaScript API script and return a Promise.\n *\n * @ignore\n * @deprecated, use importLibrary() instead.\n */\n loadPromise() {\n return new Promise((resolve, reject) => {\n this.loadCallback((err) => {\n if (!err) {\n resolve(window.google);\n }\n else {\n reject(err.error);\n }\n });\n });\n }\n importLibrary(name) {\n this.execute();\n return google.maps.importLibrary(name);\n }\n /**\n * Load the Google Maps JavaScript API script with a callback.\n * @deprecated, use importLibrary() instead.\n */\n loadCallback(fn) {\n this.callbacks.push(fn);\n this.execute();\n }\n /**\n * Set the script on document.\n */\n setScript() {\n var _a, _b;\n if (document.getElementById(this.id)) {\n // TODO wrap onerror callback for cases where the script was loaded elsewhere\n this.callback();\n return;\n }\n const params = {\n key: this.apiKey,\n channel: this.channel,\n client: this.client,\n libraries: this.libraries.length && this.libraries,\n v: this.version,\n mapIds: this.mapIds,\n language: this.language,\n region: this.region,\n authReferrerPolicy: this.authReferrerPolicy,\n };\n // keep the URL minimal:\n Object.keys(params).forEach(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (key) => !params[key] && delete params[key]);\n if (!((_b = (_a = window === null || window === void 0 ? void 0 : window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.importLibrary)) {\n // tweaked copy of https://developers.google.com/maps/documentation/javascript/load-maps-js-api#dynamic-library-import\n // which also sets the base url, the id, and the nonce\n /* eslint-disable */\n ((g) => {\n // @ts-ignore\n let h, a, k, p = \"The Google Maps JavaScript API\", c = \"google\", l = \"importLibrary\", q = \"__ib__\", m = document, b = window;\n // @ts-ignore\n b = b[c] || (b[c] = {});\n // @ts-ignore\n const d = b.maps || (b.maps = {}), r = new Set(), e = new URLSearchParams(), u = () => \n // @ts-ignore\n h || (h = new Promise((f, n) => __awaiter(this, void 0, void 0, function* () {\n var _a;\n yield (a = m.createElement(\"script\"));\n a.id = this.id;\n e.set(\"libraries\", [...r] + \"\");\n // @ts-ignore\n for (k in g)\n e.set(k.replace(/[A-Z]/g, (t) => \"_\" + t[0].toLowerCase()), g[k]);\n e.set(\"callback\", c + \".maps.\" + q);\n a.src = this.url + `?` + e;\n d[q] = f;\n a.onerror = () => (h = n(Error(p + \" could not load.\")));\n // @ts-ignore\n a.nonce = this.nonce || ((_a = m.querySelector(\"script[nonce]\")) === null || _a === void 0 ? void 0 : _a.nonce) || \"\";\n m.head.append(a);\n })));\n // @ts-ignore\n d[l] ? console.warn(p + \" only loads once. Ignoring:\", g) : (d[l] = (f, ...n) => r.add(f) && u().then(() => d[l](f, ...n)));\n })(params);\n /* eslint-enable */\n }\n // While most libraries populate the global namespace when loaded via bootstrap params,\n // this is not the case for \"marker\" when used with the inline bootstrap loader\n // (and maybe others in the future). So ensure there is an importLibrary for each:\n const libraryPromises = this.libraries.map((library) => this.importLibrary(library));\n // ensure at least one library, to kick off loading...\n if (!libraryPromises.length) {\n libraryPromises.push(this.importLibrary(\"core\"));\n }\n Promise.all(libraryPromises).then(() => this.callback(), (error) => {\n const event = new ErrorEvent(\"error\", { error }); // for backwards compat\n this.loadErrorCallback(event);\n });\n }\n /**\n * Reset the loader state.\n */\n reset() {\n this.deleteScript();\n this.done = false;\n this.loading = false;\n this.errors = [];\n this.onerrorEvent = null;\n }\n resetIfRetryingFailed() {\n if (this.failed) {\n this.reset();\n }\n }\n loadErrorCallback(e) {\n this.errors.push(e);\n if (this.errors.length <= this.retries) {\n const delay = this.errors.length * Math.pow(2, this.errors.length);\n console.error(`Failed to load Google Maps script, retrying in ${delay} ms.`);\n setTimeout(() => {\n this.deleteScript();\n this.setScript();\n }, delay);\n }\n else {\n this.onerrorEvent = e;\n this.callback();\n }\n }\n callback() {\n this.done = true;\n this.loading = false;\n this.callbacks.forEach((cb) => {\n cb(this.onerrorEvent);\n });\n this.callbacks = [];\n }\n execute() {\n this.resetIfRetryingFailed();\n if (this.loading) {\n // do nothing but wait\n return;\n }\n if (this.done) {\n this.callback();\n }\n else {\n // short circuit and warn if google.maps is already loaded\n if (window.google && window.google.maps && window.google.maps.version) {\n console.warn(\"Google Maps already loaded outside @googlemaps/js-api-loader. \" +\n \"This may result in undesirable behavior as options and script parameters may not match.\");\n this.callback();\n return;\n }\n this.loading = true;\n this.setScript();\n }\n }\n}\n\nexport { DEFAULT_ID, Loader, LoaderStatus };\n//# sourceMappingURL=index.mjs.map\n","import e,{Component as t}from\"react\";import o from\"prop-types\";import n from\"react-dom\";import r from\"eventemitter3\";import{Loader as i}from\"@googlemaps/js-api-loader\";import s from\"@mapbox/point-geometry\";function a(){return(a=Object.assign?Object.assign.bind():function(e){for(var t=1;t-1){var n='\"callback\" key in bootstrapURLKeys is not allowed,\\n use onGoogleApiLoaded property instead';throw console.error(n),new Error(n)}if(\"undefined\"==typeof window)throw new Error(\"google map cannot be loaded outside browser env\");var r=e.key,s=function(e,t){if(null==e)return{};var o,n,r={},i=Object.keys(e);for(n=0;n=0||(r[o]=e[o]);return r}(e,D);return w||(w=new i(a({apiKey:r||\"\"},s,{libraries:o}))),L=w.load().then(function(){return b(window.google.maps),window.google.maps}),b(L),L};function k(e,t,o){var n=o-t;return e===o?e:((e-t)%n+n)%n+t}var x=function(){function e(e,t){if(isNaN(e)||isNaN(t))throw new Error(\"Invalid LatLng object: (\"+e+\", \"+t+\")\");this.lat=+e,this.lng=+t}return e.prototype.wrap=function(){return new e(this.lat,k(this.lng,-180,180))},e}();x.convert=function(e){return e instanceof x?e:Array.isArray(e)?new x(e[0],e[1]):\"lng\"in e&&\"lat\"in e?new x(e.lat,e.lng):e};var S=function(){function e(e,t,o){this.tileSize=e||512,this._minZoom=t||0,this._maxZoom=o||52,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this.zoom=0,this.center=new x(0,0),this.angle=0}var t,o,n=e.prototype;return n.zoomScale=function(e){return Math.pow(2,e)},n.scaleZoom=function(e){return Math.log(e)/Math.LN2},n.project=function(e,t){return new s(this.lngX(e.lng,t),this.latY(e.lat,t))},n.unproject=function(e,t){return new x(this.yLat(e.y,t),this.xLng(e.x,t))},n.lngX=function(e,t){return(180+e)*(t||this.worldSize)/360},n.latY=function(e,t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))*(t||this.worldSize)/360},n.xLng=function(e,t){return 360*e/(t||this.worldSize)-180},n.yLat=function(e,t){return 360/Math.PI*Math.atan(Math.exp((180-360*e/(t||this.worldSize))*Math.PI/180))-90},n.locationPoint=function(e){var t=this.project(e);return this.centerPoint._sub(this.point._sub(t)._rotate(this.angle))},n.pointLocation=function(e){var t=this.centerPoint._sub(e)._rotate(-this.angle);return this.unproject(this.point.sub(t))},t=e,(o=[{key:\"minZoom\",get:function(){return this._minZoom},set:function(e){this._minZoom=e,this.zoom=Math.max(this.zoom,e)}},{key:\"maxZoom\",get:function(){return this._maxZoom},set:function(e){this._maxZoom=e,this.zoom=Math.min(this.zoom,e)}},{key:\"worldSize\",get:function(){return this.tileSize*this.scale}},{key:\"centerPoint\",get:function(){return new s(0,0)}},{key:\"size\",get:function(){return new s(this.width,this.height)}},{key:\"bearing\",get:function(){return-this.angle/Math.PI*180},set:function(e){this.angle=-k(e,-180,180)*Math.PI/180}},{key:\"zoom\",get:function(){return this._zoom},set:function(e){var t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom=t,this.scale=this.zoomScale(t),this.tileZoom=Math.floor(t),this.zoomFraction=t-this.tileZoom}},{key:\"x\",get:function(){return this.lngX(this.center.lng)}},{key:\"y\",get:function(){return this.latY(this.center.lat)}},{key:\"point\",get:function(){return new s(this.x,this.y)}}])&&function(e,t){for(var o=0;o0&&this.getHeight()-o-r>0){var a=this.transform_.pointLocation(s.convert({x:i-this.getWidth()/2,y:o-this.getHeight()/2})),p=this.transform_.pointLocation(s.convert({x:this.getWidth()/2-n,y:this.getHeight()/2-r})),l=[a.lat,a.lng,p.lat,p.lng,p.lat,a.lng,a.lat,p.lng];return t&&(l=l.map(function(e){return Math.round(e*t)/t})),l}return[0,0,0,0]},e}();function E(e){if(window.requestAnimationFrame)return window.requestAnimationFrame(e);var t=window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame;return t?t(e):window.setTimeout(e,1e3/60)}var P=Math.log2?Math.log2:function(e){return Math.log(e)/Math.LN2};function A(e,t){return Object.keys(e).reduce(function(o,n){return t(e[n])&&(o[n]=e[n]),o},{})}var I=function(e){if(null!==e&&\"object\"==typeof e){if(0===Object.keys(e).length)return!0}else if(null==e||\"\"===e)return!0;return!1},N=Object.prototype.toString;function Z(e){return\"number\"==typeof e||function(e){return!!e&&\"object\"==typeof e}(e)&&\"[object Number]\"===N.call(e)}var j=null;function U(){if(j)return j;if(\"undefined\"!=typeof navigator){var e=navigator.userAgent.indexOf(\"MSIE\")>-1,t=navigator.userAgent.indexOf(\"Firefox\")>-1,o=navigator.userAgent.toLowerCase().indexOf(\"op\")>-1,n=navigator.userAgent.indexOf(\"Chrome\")>-1,r=navigator.userAgent.indexOf(\"Safari\")>-1;return n&&r&&(r=!1),n&&o&&(n=!1),j={isExplorer:e,isFirefox:t,isOpera:o,isChrome:n,isSafari:r}}return j={isChrome:!0,isExplorer:!1,isFirefox:!1,isOpera:!1,isSafari:!1}}var H=function(e){return Function.prototype.toString.call(e)};function K(e){if(!e||\"object\"!=typeof e)return!1;var t=\"function\"==typeof e.constructor?Object.getPrototypeOf(e):Object.prototype;if(null===t)return!0;var o=t.constructor;return\"function\"==typeof o&&o instanceof o&&H(o)===H(Object)}function R(e,t,o,n){e.addEventListener(t,o,function(){var e=!1;try{var t=Object.defineProperty({},\"passive\",{get:function(){e=!0}});window.addEventListener(\"test\",t,t),window.removeEventListener(\"test\",t,t)}catch(t){e=!1}return e}()?{capture:n,passive:!0}:n)}var G,B=!(\"undefined\"==typeof window||!window.document||!window.document.createElement);G=B?window:\"undefined\"!=typeof self?self:void 0;var W,V=\"undefined\"!=typeof document&&document.attachEvent,F=!1;if(B&&!V){var $=function(){var e=G.requestAnimationFrame||G.mozRequestAnimationFrame||G.webkitRequestAnimationFrame||function(e){return G.setTimeout(e,20)};return function(t){return e(t)}}(),q=(W=G.cancelAnimationFrame||G.mozCancelAnimationFrame||G.webkitCancelAnimationFrame||G.clearTimeout,function(e){return W(e)}),Y=function(e){var t=e.__resizeTriggers__,o=t.firstElementChild,n=t.lastElementChild,r=o.firstElementChild;n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight,r.style.width=o.offsetWidth+1+\"px\",r.style.height=o.offsetHeight+1+\"px\",o.scrollLeft=o.scrollWidth,o.scrollTop=o.scrollHeight},X=function(e){var t=this;Y(this),this.__resizeRAF__&&q(this.__resizeRAF__),this.__resizeRAF__=$(function(){(function(e){return e.offsetWidth!=e.__resizeLast__.width||e.offsetHeight!=e.__resizeLast__.height})(t)&&(t.__resizeLast__.width=t.offsetWidth,t.__resizeLast__.height=t.offsetHeight,t.__resizeListeners__.forEach(function(o){o.call(t,e)}))})},J=!1,Q=\"\",ee=\"animationstart\",te=\"Webkit Moz O ms\".split(\" \"),oe=\"webkitAnimationStart animationstart oAnimationStart MSAnimationStart\".split(\" \");if(B){var ne=document.createElement(\"fakeelement\");if(void 0!==ne.style.animationName&&(J=!0),!1===J)for(var re=0;re0||r.geoService_.getHeight()>0){var e=Math.ceil(r.geoService_.getWidth()/256)+2,t=Math.ceil(r.geoService_.getHeight()/256)+2,o=Math.max(e,t);return Math.ceil(P(o))}return 3},r._computeMinZoom=function(e){return I(e)?r._getMinZoom():e},r._mapDomResizeCallback=function(){if(r.resetSizeOnIdle_=!0,r.maps_){var e=r.props.center||r.props.defaultCenter,t=r.map_.getCenter();r.maps_.event.trigger(r.map_,\"resize\"),r.map_.setCenter(r.props.resetBoundsOnResize?e:t)}},r._setLayers=function(e){e.forEach(function(e){r.layers_[e]=new r.maps_[e],r.layers_[e].setMap(r.map_)})},r._renderPortal=function(){return e.createElement(M,{experimental:r.props.experimental,onChildClick:r._onChildClick,onChildMouseDown:r._onChildMouseDown,onChildMouseEnter:r._onChildMouseEnter,onChildMouseLeave:r._onChildMouseLeave,geoService:r.geoService_,insideMapPanes:!0,distanceToMouse:r.props.distanceToMouse,getHoverDistance:r._getHoverDistance,dispatcher:r.markersDispatcher_})},r._initMap=function(){if(!r.initialized_){r.initialized_=!0;var e=ue(r.props.center||r.props.defaultCenter);r.geoService_.setView(e,r.props.zoom||r.props.defaultZoom,0),r._onBoundsChanged();var t=a({},r.props.apiKey&&{key:r.props.apiKey},r.props.bootstrapURLKeys);r.props.googleMapLoader(t,r.props.heatmapLibrary).then(function(e){if(r.mounted_){var t,o,i=r.geoService_.getCenter(),s={zoom:r.props.zoom||r.props.defaultZoom,center:new e.LatLng(i.lat,i.lng)};r.props.heatmap.positions&&(Object.assign(l(r),{heatmap:(t=e,o=r.props.heatmap,new t.visualization.HeatmapLayer({data:o.positions.reduce(function(e,o){var n=o.weight,r=void 0===n?1:n;return e.push({location:new t.LatLng(o.lat,o.lng),weight:r}),e},[])}))}),function(e,t){var o=t.options,n=void 0===o?{}:o;Object.keys(n).map(function(t){return e.set(t,n[t])})}(r.heatmap,r.props.heatmap));var p=A(e,K),u=\"function\"==typeof r.props.options?r.props.options(p):r.props.options,h=!I(r.props.draggable)&&{draggable:r.props.draggable},c=r._computeMinZoom(u.minZoom);r.minZoom_=c;var d=a({},{overviewMapControl:!1,streetViewControl:!1,rotateControl:!0,mapTypeControl:!1,styles:[{featureType:\"poi\",elementType:\"labels\",stylers:[{visibility:\"off\"}]}],minZoom:3},{minZoom:c},u,s);r.defaultDraggableOption_=I(d.draggable)?r.defaultDraggableOption_:d.draggable;var m=a({},d,h);m.minZoom=he(m.minZoom,c);var g=new e.Map(n.findDOMNode(r.googleMapDom_),m);r.map_=g,r.maps_=e,r._setLayers(r.props.layerTypes);var _=e.version.match(/^3\\.(\\d+)\\./),f=_&&Number(_[1]),v=l(r),M=Object.assign(new e.OverlayView,{onAdd:function(){var t=\"undefined\"!=typeof screen?screen.width+\"px\":\"2000px\",o=\"undefined\"!=typeof screen?screen.height+\"px\":\"2000px\",n=document.createElement(\"div\");if(n.style.backgroundColor=\"transparent\",n.style.position=\"absolute\",n.style.left=\"0px\",n.style.top=\"0px\",n.style.width=t,n.style.height=o,v.props.overlayViewDivStyle){var r=v.props.overlayViewDivStyle;\"object\"==typeof r&&Object.keys(r).forEach(function(e){n.style[e]=r[e]})}this.getPanes().overlayMouseTarget.appendChild(n),v.geoService_.setMapCanvasProjection(e,M.getProjection()),pe?v.setState({overlay:n}):le(v,v._renderPortal(),n,function(){return v.setState({overlay:n})})},onRemove:function(){var e=v.state.overlay;e&&!pe&&n.unmountComponentAtNode(e),v.setState({overlay:null})},draw:function(){if(v.updateCounter_++,v._onBoundsChanged(g,e,!v.props.debounced),v.googleApiLoadedCalled_||(v._onGoogleApiLoaded({map:g,maps:e,ref:v.googleMapDom_}),v.googleApiLoadedCalled_=!0),v.mouse_){var t=v.geoService_.fromContainerPixelToLatLng(v.mouse_);v.mouse_.lat=t.lat,v.mouse_.lng=t.lng}v._onChildMouseMove(),v.markersDispatcher_&&(v.markersDispatcher_.emit(\"kON_CHANGE\"),v.fireMouseEventOnIdle_&&v.markersDispatcher_.emit(\"kON_MOUSE_POSITION_CHANGE\"))}});r.overlay_=M,M.setMap(g),r.props.heatmap.positions&&r.heatmap.setMap(g),r.props.onTilesLoaded&&e.event.addListener(g,\"tilesloaded\",function(){v._onTilesLoaded()}),e.event.addListener(g,\"zoom_changed\",function(){v.geoService_.getZoom()!==g.getZoom()&&(v.zoomAnimationInProgress_||(v.zoomAnimationInProgress_=!0,v._onZoomAnimationStart(g.zoom)),f<32)&&((new Date).getTime()-r.zoomControlClickTime_<300?E(function(){return E(function(){v.updateCounter_++,v._onBoundsChanged(g,e)})}):(v.updateCounter_++,v._onBoundsChanged(g,e)))}),e.event.addListener(g,\"idle\",function(){if(r.resetSizeOnIdle_){r._setViewSize();var t=r._computeMinZoom(u.minZoom);t!==r.minZoom_&&(r.minZoom_=t,g.setOptions({minZoom:t})),r.resetSizeOnIdle_=!1}v.zoomAnimationInProgress_&&(v.zoomAnimationInProgress_=!1,v._onZoomAnimationEnd(g.zoom)),v.updateCounter_++,v._onBoundsChanged(g,e),v.dragTime_=0,v.markersDispatcher_&&v.markersDispatcher_.emit(\"kON_CHANGE\")}),e.event.addListener(g,\"mouseover\",function(){v.mouseInMap_=!0}),e.event.addListener(g,\"click\",function(){v.mouseInMap_=!0}),e.event.addListener(g,\"mouseout\",function(){v.mouseInMap_=!1,v.mouse_=null,v.markersDispatcher_.emit(\"kON_MOUSE_POSITION_CHANGE\")}),e.event.addListener(g,\"drag\",function(){v.dragTime_=(new Date).getTime(),v._onDrag(g)}),e.event.addListener(g,\"dragend\",function(){var t=e.event.addListener(g,\"idle\",function(){e.event.removeListener(t),v._onDragEnd(g)})}),e.event.addListener(g,\"maptypeid_changed\",function(){v._onMapTypeIdChange(g.getMapTypeId())})}}).catch(function(e){throw r._onGoogleApiLoaded({map:null,maps:null,ref:r.googleMapDom_}),console.error(e),e})}},r._onGoogleApiLoaded=function(){var e;r.props.onGoogleApiLoaded&&(\"production\"!==process.env.NODE_ENV&&!0!==r.props.yesIWantToUseGoogleMapApiInternals&&console.warn(\"GoogleMap: Usage of internal api objects is dangerous and can cause a lot of issues.\\nTo hide this warning add yesIWantToUseGoogleMapApiInternals={true} to 50&&(r.boundingRect_=e.currentTarget.getBoundingClientRect()),r.mouseMoveTime_=t;var o=e.clientX-r.boundingRect_.left,n=e.clientY-r.boundingRect_.top;r.mouse_||(r.mouse_={x:0,y:0,lat:0,lng:0}),r.mouse_.x=o,r.mouse_.y=n;var i=r.geoService_.fromContainerPixelToLatLng(r.mouse_);r.mouse_.lat=i.lat,r.mouse_.lng=i.lng,r._onChildMouseMove(),t-r.dragTime_<100?r.fireMouseEventOnIdle_=!0:(r.markersDispatcher_.emit(\"kON_MOUSE_POSITION_CHANGE\"),r.fireMouseEventOnIdle_=!1)}},r._onClick=function(){var e;return r.props.onClick&&!r.childMouseDownArgs_&&(new Date).getTime()-r.childMouseUpTime_>300&&0===r.dragTime_&&(e=r.props).onClick.apply(e,arguments)},r._onMapClick=function(e){r.markersDispatcher_&&(r._onMapMouseMove(e),(new Date).getTime()-r.dragTime_>100&&(r.mouse_&&r._onClick(a({},r.mouse_,{event:e})),r.markersDispatcher_.emit(\"kON_CLICK\",e)))},r._onMapMouseDownNative=function(e){r.mouseInMap_&&r._onMapMouseDown(e)},r._onMapMouseDown=function(e){r.markersDispatcher_&&(new Date).getTime()-r.dragTime_>100&&(r._onMapMouseMove(e),r.markersDispatcher_.emit(\"kON_MDOWN\",e))},r._onMapMouseDownCapture=function(){U().isChrome&&(r.zoomControlClickTime_=(new Date).getTime())},r._onKeyDownCapture=function(){U().isChrome&&(r.zoomControlClickTime_=(new Date).getTime())},r._isCenterDefined=function(e){return e&&(K(e)&&Z(e.lat)&&Z(e.lng)||2===e.length&&Z(e[0])&&Z(e[1]))},r._onBoundsChanged=function(e,t,o){if(e){var n=e.getCenter();r.geoService_.setView([n.lat(),n.lng()],e.getZoom(),0)}if((r.props.onChange||r.props.onBoundsChange)&&r.geoService_.canProject()){var i=r.geoService_.getZoom(),s=r.geoService_.getBounds(),p=r.geoService_.getCenter();if(!function(e,t,o){if(e&&t){for(var n=0;n!==e.length;++n)if(Math.abs(e[n]-t[n])>1e-5)return!1;return!0}return!1}(s,r.prevBounds_)&&!1!==o){var l=r.geoService_.getBounds(r.props.margin);r.props.onBoundsChange&&r.props.onBoundsChange(r.centerIsObject_?a({},p):[p.lat,p.lng],i,s,l),r.props.onChange&&r.props.onChange({center:a({},p),zoom:i,bounds:{nw:{lat:s[0],lng:s[1]},se:{lat:s[2],lng:s[3]},sw:{lat:s[4],lng:s[5]},ne:{lat:s[6],lng:s[7]}},marginBounds:{nw:{lat:l[0],lng:l[1]},se:{lat:l[2],lng:l[3]},sw:{lat:l[4],lng:l[5]},ne:{lat:l[6],lng:l[7]}},size:r.geoService_.hasSize()?{width:r.geoService_.getWidth(),height:r.geoService_.getHeight()}:{width:0,height:0}}),r.prevBounds_=s}}},r._registerChild=function(e){r.googleMapDom_=e},r.mounted_=!1,r.initialized_=!1,r.googleApiLoadedCalled_=!1,r.map_=null,r.maps_=null,r.prevBounds_=null,r.heatmap=null,r.layers_={},r.mouse_=null,r.mouseMoveTime_=0,r.boundingRect_=null,r.mouseInMap_=!0,r.dragTime_=0,r.fireMouseEventOnIdle_=!1,r.updateCounter_=0,r.markersDispatcher_=new c(l(r)),r.geoService_=new T(256),r.centerIsObject_=K(r.props.center),r.minZoom_=3,r.defaultDraggableOption_=!0,r.zoomControlClickTime_=0,r.childMouseDownArgs_=null,r.childMouseUpTime_=0,r.googleMapDom_=null,\"production\"!==process.env.NODE_ENV&&(r.props.apiKey&&console.warn(\"GoogleMap: apiKey is deprecated, use bootstrapURLKeys={{key: YOUR_API_KEY}} instead.\"),r.props.onBoundsChange&&console.warn(\"GoogleMap: onBoundsChange is deprecated, use onChange({center, zoom, bounds, ...other}) instead.\"),I(r.props.center)&&I(r.props.defaultCenter)&&console.warn(\"GoogleMap: center or defaultCenter property must be defined\"),I(r.props.zoom)&&I(r.props.defaultZoom)&&console.warn(\"GoogleMap: zoom or defaultZoom property must be defined\")),r._isCenterDefined(r.props.center||r.props.defaultCenter)){var i=ue(r.props.center||r.props.defaultCenter);r.geoService_.setView(i,r.props.zoom||r.props.defaultZoom,0)}return r.zoomAnimationInProgress_=!1,r.state={overlay:null},r}p(o,t);var r=o.prototype;return r.componentDidMount=function(){var e=this;this.mounted_=!0,this.markersDispatcher_=new c(this),R(window,\"resize\",this._onWindowResize,!1),R(window,\"keydown\",this._onKeyDownCapture,!0);var t=n.findDOMNode(this.googleMapDom_);t&&R(t,\"mousedown\",this._onMapMouseDownNative,!0),R(window,\"mouseup\",this._onChildMouseUp,!1);var o=a({},this.props.apiKey&&{key:this.props.apiKey},this.props.bootstrapURLKeys);this.props.googleMapLoader(o,this.props.heatmapLibrary),setTimeout(function(){e._setViewSize(),e._isCenterDefined(e.props.center||e.props.defaultCenter)&&e._initMap()},0,this),this.props.resetBoundsOnResize&&function(e,t){if(void 0===e.parentNode){var o=document.createElement(\"div\");e.parentNode=o}e=e.parentNode,V?e.attachEvent(\"onresize\",t):(e.__resizeTriggers__||(\"static\"==getComputedStyle(e).position&&(e.style.position=\"relative\"),function(){if(!F){var e=(se||\"\")+\".resize-triggers { \"+(ae||\"\")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: \" \"; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',t=document.head||document.getElementsByTagName(\"head\")[0],o=document.createElement(\"style\");o.type=\"text/css\",o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e)),t.appendChild(o),F=!0}}(),e.__resizeLast__={},e.__resizeListeners__=[],(e.__resizeTriggers__=document.createElement(\"div\")).className=\"resize-triggers\",e.__resizeTriggers__.innerHTML='
',e.appendChild(e.__resizeTriggers__),Y(e),R(e,\"scroll\",X,!0),ee&&e.__resizeTriggers__.addEventListener(ee,function(t){t.animationName==ie&&Y(e)})),e.__resizeListeners__.push(t))}(t,this._mapDomResizeCallback)},r.shouldComponentUpdate=function(e,t){return!_(d(this.props,[\"draggable\"]),d(e,[\"draggable\"]))||!_(this.state,t)},r.componentDidUpdate=function(e){var t=this;if(\"production\"!==process.env.NODE_ENV&&(_(e.defaultCenter,this.props.defaultCenter)||console.warn(\"GoogleMap: defaultCenter prop changed. You can't change default props.\"),_(e.defaultZoom,this.props.defaultZoom)||console.warn(\"GoogleMap: defaultZoom prop changed. You can't change default props.\")),!this._isCenterDefined(e.center)&&this._isCenterDefined(this.props.center)&&setTimeout(function(){return t._initMap()},0),this.map_){var o=this.geoService_.getCenter();if(this._isCenterDefined(this.props.center)){var n=ue(this.props.center),r=this._isCenterDefined(e.center)?ue(e.center):null;(!r||Math.abs(n.lat-r.lat)+Math.abs(n.lng-r.lng)>1e-5)&&Math.abs(n.lat-o.lat)+Math.abs(n.lng-o.lng)>1e-5&&this.map_.panTo({lat:n.lat,lng:n.lng})}if(I(this.props.zoom)||Math.abs(this.props.zoom-e.zoom)>0&&this.map_.setZoom(this.props.zoom),!I(e.draggable)&&I(this.props.draggable)?this.map_.setOptions({draggable:this.defaultDraggableOption_}):_(e.draggable,this.props.draggable)||this.map_.setOptions({draggable:this.props.draggable}),!I(this.props.options)&&!_(e.options,this.props.options)){var i=A(this.maps_,K),s=\"function\"==typeof this.props.options?this.props.options(i):this.props.options;if(\"minZoom\"in(s=d(s,[\"zoom\",\"center\",\"draggable\"]))){var a=this._computeMinZoom(s.minZoom);s.minZoom=he(s.minZoom,a)}this.map_.setOptions(s)}_(this.props.layerTypes,e.layerTypes)||(Object.keys(this.layers_).forEach(function(e){t.layers_[e].setMap(null),delete t.layers_[e]}),this._setLayers(this.props.layerTypes)),this.heatmap&&!_(this.props.heatmap.positions,e.heatmap.positions)&&this.heatmap.setData(this.props.heatmap.positions.map(function(e){return{location:new t.maps_.LatLng(e.lat,e.lng),weight:e.weight}})),this.heatmap&&!_(this.props.heatmap.options,e.heatmap.options)&&Object.keys(this.props.heatmap.options).forEach(function(e){t.heatmap.set(e,t.props.heatmap.options[e])})}this.markersDispatcher_.emit(\"kON_CHANGE\"),_(this.props.hoverDistance,e.hoverDistance)||this.markersDispatcher_.emit(\"kON_MOUSE_POSITION_CHANGE\")},r.componentWillUnmount=function(){this.mounted_=!1;var e,t,o=n.findDOMNode(this.googleMapDom_);o&&o.removeEventListener(\"mousedown\",this._onMapMouseDownNative,!0),window.removeEventListener(\"resize\",this._onWindowResize),window.removeEventListener(\"keydown\",this._onKeyDownCapture),window.removeEventListener(\"mouseup\",this._onChildMouseUp,!1),this.props.resetBoundsOnResize&&(t=this._mapDomResizeCallback,e=(e=o).parentNode,V?e.detachEvent(\"onresize\",t):(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),e.__resizeListeners__.length||(e.removeEventListener(\"scroll\",X),e.__resizeTriggers__=!e.removeChild(e.__resizeTriggers__)))),this.overlay_&&this.overlay_.setMap(null),this.maps_&&this.map_&&this.props.shouldUnregisterMapOnUnmount&&(this.map_.setOptions({scrollwheel:!1}),this.maps_.event.clearInstanceListeners(this.map_)),this.props.shouldUnregisterMapOnUnmount&&(this.map_=null,this.maps_=null),this.markersDispatcher_.dispose(),this.resetSizeOnIdle_=!1,this.props.shouldUnregisterMapOnUnmount&&(delete this.map_,delete this.markersDispatcher_)},r.render=function(){var t=this.state.overlay,o=t?null:e.createElement(C,{experimental:this.props.experimental,onChildClick:this._onChildClick,onChildMouseDown:this._onChildMouseDown,onChildMouseEnter:this._onChildMouseEnter,onChildMouseLeave:this._onChildMouseLeave,geoService:this.geoService_,insideMapPanes:!1,distanceToMouse:this.props.distanceToMouse,getHoverDistance:this._getHoverDistance,dispatcher:this.markersDispatcher_});return e.createElement(\"div\",{style:this.props.style,onMouseMove:this._onMapMouseMove,onMouseDownCapture:this._onMapMouseDownCapture,onClick:this._onMapClick},e.createElement(h,{registerChild:this._registerChild}),pe&&t&&le(this._renderPortal(),t),o)},o}(t);function de(e){var t=e.lng,o=Math.sin(e.lat*Math.PI/180),n=t/360+.5,r=.5-.25*Math.log((1+o)/(1-o))/Math.PI;return{x:n,y:r=r<0?0:r>1?1:r}}function me(e){var t=e.x,o=Math.PI-2*Math.PI*e.y;return{lat:180/Math.PI*Math.atan(.5*(Math.exp(o)-Math.exp(-o))),lng:360*t-180}}function ge(e,t,o,n){var r=de(e),i=de(t),s=r.x0?.5*(r.x+i.x-1):.5*(1+r.x+i.x),y:.5*(r.y+i.y)},c=Math.pow(2,u),d=o/c/256/2,m=n/c/256/2,g=me({x:h.x-d,y:h.y-m}),_=me({x:h.x+d,y:h.y+m});return{center:me(h),zoom:u,newBounds:{nw:g,se:_}}}function _e(e){var t=e.ne,o=e.sw;return{nw:{lat:t.lat,lng:o.lng},se:{lat:o.lat,lng:t.lng}}}function fe(e){var t=e.nw,o=e.se;return{ne:{lat:t.lat,lng:o.lng},sw:{lat:o.lat,lng:t.lng}}}function ve(e,t){var o,n=e.nw,r=e.se,i=e.ne,s=e.sw,p=t.width,l=t.height;if(n&&r)o=ge(n,r,p,l);else{var u=_e({ne:i,sw:s});o=ge(u.nw,u.se,p,l)}return a({},o,{newBounds:a({},o.newBounds,fe(o.newBounds))})}function Me(e,t,o){var n=function(e,t){var o=function(e,t){var o,n=t.lat,r=t.lng,i=(o=n*Math.PI/180,{metersPerLatDegree:111132.92-559.82*Math.cos(2*o)+1.175*Math.cos(4*o)-.0023*Math.cos(6*o),metersPerLngDegree:111412.84*Math.cos(o)-93.5*Math.cos(3*o)+.118*Math.cos(5*o)}),s=.5*e/i.metersPerLatDegree,a=.5*e/i.metersPerLngDegree;return{nw:{lat:n-s,lng:r-a},se:{lat:n+s,lng:r+a}}}(e,{lat:t.lat,lng:t.lng}),n=o.se,r=de(o.nw),i=de(n);return{w:Math.abs(i.x-r.x),h:Math.abs(i.y-r.y)}}(e,{lat:t.lat,lng:t.lng}),r=n.w,i=n.h,s=Math.pow(2,o);return{w:r*s*256,h:i*s*256}}function ye(e,t){var o=e.x,n=Math.PI-2*Math.PI*e.y/Math.pow(2,t);return{lat:180/Math.PI*Math.atan(.5*(Math.exp(n)-Math.exp(-n))),lng:o/Math.pow(2,t)*360-180}}function Ce(e,t){var o=de({lat:e.lat,lng:e.lng}),n=Math.pow(2,t);return{x:Math.floor(o.x*n),y:Math.floor(o.y*n)}}function we(e,t){for(var o=e.from,n=e.to,r=Math.pow(2,t),i=[],s=o.x;s!==(n.x+1)%r;s=(s+1)%r)for(var a=o.y;a!==(n.y+1)%r;a=(a+1)%r)i.push([t,s,a]);return i}ce.propTypes={apiKey:o.string,bootstrapURLKeys:o.any,defaultCenter:o.oneOfType([o.array,o.shape({lat:o.number,lng:o.number})]),center:o.oneOfType([o.array,o.shape({lat:o.number,lng:o.number})]),defaultZoom:o.number,zoom:o.number,onBoundsChange:o.func,onChange:o.func,onClick:o.func,onChildClick:o.func,onChildMouseDown:o.func,onChildMouseUp:o.func,onChildMouseMove:o.func,onChildMouseEnter:o.func,onChildMouseLeave:o.func,onZoomAnimationStart:o.func,onZoomAnimationEnd:o.func,onDrag:o.func,onDragEnd:o.func,onMapTypeIdChange:o.func,onTilesLoaded:o.func,options:o.any,distanceToMouse:o.func,hoverDistance:o.number,debounced:o.bool,margin:o.array,googleMapLoader:o.any,onGoogleApiLoaded:o.func,yesIWantToUseGoogleMapApiInternals:o.bool,draggable:o.bool,style:o.any,resetBoundsOnResize:o.bool,layerTypes:o.arrayOf(o.string),shouldUnregisterMapOnUnmount:o.bool},ce.defaultProps={distanceToMouse:function(e,t){return Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y))},hoverDistance:30,debounced:!0,options:function(){return{overviewMapControl:!1,streetViewControl:!1,rotateControl:!0,mapTypeControl:!1,styles:[{featureType:\"poi\",elementType:\"labels\",stylers:[{visibility:\"off\"}]}],minZoom:3}},googleMapLoader:O,yesIWantToUseGoogleMapApiInternals:!1,style:{width:\"100%\",height:\"100%\",margin:0,padding:0,position:\"relative\"},layerTypes:[],heatmap:{},heatmapLibrary:!1,shouldUnregisterMapOnUnmount:!0},ce.googleMapLoader=O;export default ce;export{_e as convertNeSwToNwSe,fe as convertNwSeToNeSw,ve as fitBounds,we as getTilesIds,Ce as latLng2Tile,Me as meters2ScreenPixels,ye as tile2LatLng};\n//# sourceMappingURL=index.modern.js.map\n","var safeIsNaN = Number.isNaN ||\n function ponyfill(value) {\n return typeof value === 'number' && value !== value;\n };\nfunction isEqual(first, second) {\n if (first === second) {\n return true;\n }\n if (safeIsNaN(first) && safeIsNaN(second)) {\n return true;\n }\n return false;\n}\nfunction areInputsEqual(newInputs, lastInputs) {\n if (newInputs.length !== lastInputs.length) {\n return false;\n }\n for (var i = 0; i < newInputs.length; i++) {\n if (!isEqual(newInputs[i], lastInputs[i])) {\n return false;\n }\n }\n return true;\n}\n\nfunction memoizeOne(resultFn, isEqual) {\n if (isEqual === void 0) { isEqual = areInputsEqual; }\n var cache = null;\n function memoized() {\n var newArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n newArgs[_i] = arguments[_i];\n }\n if (cache && cache.lastThis === this && isEqual(newArgs, cache.lastArgs)) {\n return cache.lastResult;\n }\n var lastResult = resultFn.apply(this, newArgs);\n cache = {\n lastResult: lastResult,\n lastArgs: newArgs,\n lastThis: this,\n };\n return lastResult;\n }\n memoized.clear = function clear() {\n cache = null;\n };\n return memoized;\n}\n\nexport { memoizeOne as default };\n","import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';\nimport _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';\nimport _typeof from '@babel/runtime/helpers/esm/typeof';\nimport _classCallCheck from '@babel/runtime/helpers/esm/classCallCheck';\nimport _createClass from '@babel/runtime/helpers/esm/createClass';\nimport _callSuper from '@babel/runtime/helpers/esm/callSuper';\nimport _inherits from '@babel/runtime/helpers/esm/inherits';\nimport _slicedToArray from '@babel/runtime/helpers/esm/slicedToArray';\nimport React, { useEffect, useLayoutEffect, useRef, createRef, Component, useMemo, useState, useCallback } from 'react';\nimport { uncontrollable } from 'uncontrollable';\nimport clsx from 'clsx';\nimport PropTypes from 'prop-types';\nimport invariant from 'invariant';\nimport * as dates from 'date-arithmetic';\nimport { inRange as inRange$1, lt, lte, gt, gte, eq, neq, startOf, endOf, add, min, max, minutes } from 'date-arithmetic';\nimport _defineProperty from '@babel/runtime/helpers/esm/defineProperty';\nimport _toConsumableArray from '@babel/runtime/helpers/esm/toConsumableArray';\nimport chunk from 'lodash/chunk';\nimport getPosition$1 from 'dom-helpers/position';\nimport * as animationFrame from 'dom-helpers/animationFrame';\nimport { Overlay } from 'react-overlays';\nimport getOffset from 'dom-helpers/offset';\nimport isEqual$1 from 'lodash/isEqual';\nimport getHeight from 'dom-helpers/height';\nimport qsa from 'dom-helpers/querySelectorAll';\nimport contains from 'dom-helpers/contains';\nimport closest from 'dom-helpers/closest';\nimport listen from 'dom-helpers/listen';\nimport findIndex from 'lodash/findIndex';\nimport range$1 from 'lodash/range';\nimport memoize from 'memoize-one';\nimport sortBy from 'lodash/sortBy';\nimport scrollbarSize from 'dom-helpers/scrollbarSize';\nimport getWidth from 'dom-helpers/width';\nimport _toArray from '@babel/runtime/helpers/esm/toArray';\nimport addClass from 'dom-helpers/addClass';\nimport removeClass from 'dom-helpers/removeClass';\nimport omit from 'lodash/omit';\nimport defaults from 'lodash/defaults';\nimport transform from 'lodash/transform';\nimport mapValues from 'lodash/mapValues';\nimport isBetween from 'dayjs/plugin/isBetween';\nimport isSameOrAfter from 'dayjs/plugin/isSameOrAfter';\nimport isSameOrBefore from 'dayjs/plugin/isSameOrBefore';\nimport localeData from 'dayjs/plugin/localeData';\nimport localizedFormat from 'dayjs/plugin/localizedFormat';\nimport minMax from 'dayjs/plugin/minMax';\nimport utc from 'dayjs/plugin/utc';\n\nfunction NoopWrapper(props) {\n return props.children;\n}\n\nvar navigate = {\n PREVIOUS: 'PREV',\n NEXT: 'NEXT',\n TODAY: 'TODAY',\n DATE: 'DATE'\n};\nvar views = {\n MONTH: 'month',\n WEEK: 'week',\n WORK_WEEK: 'work_week',\n DAY: 'day',\n AGENDA: 'agenda'\n};\n\nvar viewNames$1 = Object.keys(views).map(function (k) {\n return views[k];\n});\nPropTypes.oneOfType([PropTypes.string, PropTypes.func]);\nPropTypes.any;\nPropTypes.func;\n\n/**\n * accepts either an array of builtin view names:\n *\n * ```\n * views={['month', 'day', 'agenda']}\n * ```\n *\n * or an object hash of the view name and the component (or boolean for builtin)\n *\n * ```\n * views={{\n * month: true,\n * week: false,\n * workweek: WorkWeekViewComponent,\n * }}\n * ```\n */\n\nPropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOf(viewNames$1)), PropTypes.objectOf(function (prop, key) {\n var isBuiltinView = viewNames$1.indexOf(key) !== -1 && typeof prop[key] === 'boolean';\n if (isBuiltinView) {\n return null;\n } else {\n for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n args[_key - 2] = arguments[_key];\n }\n return PropTypes.elementType.apply(PropTypes, [prop, key].concat(args));\n }\n})]);\nPropTypes.oneOfType([PropTypes.oneOf(['overlap', 'no-overlap']), PropTypes.func]);\n\nfunction notify(handler, args) {\n handler && handler.apply(null, [].concat(args));\n}\n\n/* eslint no-fallthrough: off */\nvar MILLI = {\n seconds: 1000,\n minutes: 1000 * 60,\n hours: 1000 * 60 * 60,\n day: 1000 * 60 * 60 * 24\n};\nfunction firstVisibleDay(date, localizer) {\n var firstOfMonth = dates.startOf(date, 'month');\n return dates.startOf(firstOfMonth, 'week', localizer.startOfWeek());\n}\nfunction lastVisibleDay(date, localizer) {\n var endOfMonth = dates.endOf(date, 'month');\n return dates.endOf(endOfMonth, 'week', localizer.startOfWeek());\n}\nfunction visibleDays(date, localizer) {\n var current = firstVisibleDay(date, localizer),\n last = lastVisibleDay(date, localizer),\n days = [];\n while (dates.lte(current, last, 'day')) {\n days.push(current);\n current = dates.add(current, 1, 'day');\n }\n return days;\n}\nfunction ceil(date, unit) {\n var floor = dates.startOf(date, unit);\n return dates.eq(floor, date) ? floor : dates.add(floor, 1, unit);\n}\nfunction range(start, end) {\n var unit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'day';\n var current = start,\n days = [];\n while (dates.lte(current, end, unit)) {\n days.push(current);\n current = dates.add(current, 1, unit);\n }\n return days;\n}\nfunction merge(date, time) {\n if (time == null && date == null) return null;\n if (time == null) time = new Date();\n if (date == null) date = new Date();\n date = dates.startOf(date, 'day');\n date = dates.hours(date, dates.hours(time));\n date = dates.minutes(date, dates.minutes(time));\n date = dates.seconds(date, dates.seconds(time));\n return dates.milliseconds(date, dates.milliseconds(time));\n}\nfunction isJustDate(date) {\n return dates.hours(date) === 0 && dates.minutes(date) === 0 && dates.seconds(date) === 0 && dates.milliseconds(date) === 0;\n}\nfunction duration(start, end, unit, firstOfWeek) {\n if (unit === 'day') unit = 'date';\n return Math.abs(\n // eslint-disable-next-line import/namespace\n dates[unit](start, undefined, firstOfWeek) -\n // eslint-disable-next-line import/namespace\n dates[unit](end, undefined, firstOfWeek));\n}\nfunction diff(dateA, dateB, unit) {\n if (!unit || unit === 'milliseconds') return Math.abs(+dateA - +dateB);\n\n // the .round() handles an edge case\n // with DST where the total won't be exact\n // since one day in the range may be shorter/longer by an hour\n return Math.round(Math.abs(+dates.startOf(dateA, unit) / MILLI[unit] - +dates.startOf(dateB, unit) / MILLI[unit]));\n}\n\nvar localePropType = PropTypes.oneOfType([PropTypes.string, PropTypes.func]);\nfunction _format(localizer, formatter, value, format, culture) {\n var result = typeof format === 'function' ? format(value, culture, localizer) : formatter.call(localizer, value, format, culture);\n invariant(result == null || typeof result === 'string', '`localizer format(..)` must return a string, null, or undefined');\n return result;\n}\n\n/**\n * This date conversion was moved out of TimeSlots.js, to\n * allow for localizer override\n * @param {Date} dt - The date to start from\n * @param {Number} minutesFromMidnight\n * @param {Number} offset\n * @returns {Date}\n */\nfunction getSlotDate(dt, minutesFromMidnight, offset) {\n return new Date(dt.getFullYear(), dt.getMonth(), dt.getDate(), 0, minutesFromMidnight + offset, 0, 0);\n}\nfunction getDstOffset(start, end) {\n return start.getTimezoneOffset() - end.getTimezoneOffset();\n}\n\n// if the start is on a DST-changing day but *after* the moment of DST\n// transition we need to add those extra minutes to our minutesFromMidnight\nfunction getTotalMin(start, end) {\n return diff(start, end, 'minutes') + getDstOffset(start, end);\n}\nfunction getMinutesFromMidnight(start) {\n var daystart = startOf(start, 'day');\n return diff(daystart, start, 'minutes') + getDstOffset(daystart, start);\n}\n\n// These two are used by DateSlotMetrics\nfunction continuesPrior(start, first) {\n return lt(start, first, 'day');\n}\nfunction continuesAfter(start, end, last) {\n var singleDayDuration = eq(start, end, 'minutes');\n return singleDayDuration ? gte(end, last, 'minutes') : gt(end, last, 'minutes');\n}\nfunction daySpan(start, end) {\n return duration(start, end, 'day');\n}\n\n// These two are used by eventLevels\nfunction sortEvents$1(_ref) {\n var _ref$evtA = _ref.evtA,\n aStart = _ref$evtA.start,\n aEnd = _ref$evtA.end,\n aAllDay = _ref$evtA.allDay,\n _ref$evtB = _ref.evtB,\n bStart = _ref$evtB.start,\n bEnd = _ref$evtB.end,\n bAllDay = _ref$evtB.allDay;\n var startSort = +startOf(aStart, 'day') - +startOf(bStart, 'day');\n var durA = daySpan(aStart, aEnd);\n var durB = daySpan(bStart, bEnd);\n return startSort ||\n // sort by start Day first\n durB - durA ||\n // events spanning multiple days go first\n !!bAllDay - !!aAllDay ||\n // then allDay single day events\n +aStart - +bStart ||\n // then sort by start time\n +aEnd - +bEnd // then sort by end time\n ;\n}\nfunction inEventRange(_ref2) {\n var _ref2$event = _ref2.event,\n start = _ref2$event.start,\n end = _ref2$event.end,\n _ref2$range = _ref2.range,\n rangeStart = _ref2$range.start,\n rangeEnd = _ref2$range.end;\n var eStart = startOf(start, 'day');\n var startsBeforeEnd = lte(eStart, rangeEnd, 'day');\n // when the event is zero duration we need to handle a bit differently\n var sameMin = neq(eStart, end, 'minutes');\n var endsAfterStart = sameMin ? gt(end, rangeStart, 'minutes') : gte(end, rangeStart, 'minutes');\n return startsBeforeEnd && endsAfterStart;\n}\n\n// other localizers treats 'day' and 'date' equality very differently, so we\n// abstract the change the 'localizer.eq(date1, date2, 'day') into this\n// new method, where they can be treated correctly by the localizer overrides\nfunction isSameDate(date1, date2) {\n return eq(date1, date2, 'day');\n}\nfunction startAndEndAreDateOnly(start, end) {\n return isJustDate(start) && isJustDate(end);\n}\nvar DateLocalizer = /*#__PURE__*/_createClass(function DateLocalizer(spec) {\n var _this = this;\n _classCallCheck(this, DateLocalizer);\n invariant(typeof spec.format === 'function', 'date localizer `format(..)` must be a function');\n invariant(typeof spec.firstOfWeek === 'function', 'date localizer `firstOfWeek(..)` must be a function');\n this.propType = spec.propType || localePropType;\n this.formats = spec.formats;\n this.format = function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return _format.apply(void 0, [_this, spec.format].concat(args));\n };\n // These date arithmetic methods can be overriden by the localizer\n this.startOfWeek = spec.firstOfWeek;\n this.merge = spec.merge || merge;\n this.inRange = spec.inRange || inRange$1;\n this.lt = spec.lt || lt;\n this.lte = spec.lte || lte;\n this.gt = spec.gt || gt;\n this.gte = spec.gte || gte;\n this.eq = spec.eq || eq;\n this.neq = spec.neq || neq;\n this.startOf = spec.startOf || startOf;\n this.endOf = spec.endOf || endOf;\n this.add = spec.add || add;\n this.range = spec.range || range;\n this.diff = spec.diff || diff;\n this.ceil = spec.ceil || ceil;\n this.min = spec.min || min;\n this.max = spec.max || max;\n this.minutes = spec.minutes || minutes;\n this.daySpan = spec.daySpan || daySpan;\n this.firstVisibleDay = spec.firstVisibleDay || firstVisibleDay;\n this.lastVisibleDay = spec.lastVisibleDay || lastVisibleDay;\n this.visibleDays = spec.visibleDays || visibleDays;\n this.getSlotDate = spec.getSlotDate || getSlotDate;\n this.getTimezoneOffset = spec.getTimezoneOffset || function (value) {\n return value.getTimezoneOffset();\n };\n this.getDstOffset = spec.getDstOffset || getDstOffset;\n this.getTotalMin = spec.getTotalMin || getTotalMin;\n this.getMinutesFromMidnight = spec.getMinutesFromMidnight || getMinutesFromMidnight;\n this.continuesPrior = spec.continuesPrior || continuesPrior;\n this.continuesAfter = spec.continuesAfter || continuesAfter;\n this.sortEvents = spec.sortEvents || sortEvents$1;\n this.inEventRange = spec.inEventRange || inEventRange;\n this.isSameDate = spec.isSameDate || isSameDate;\n this.startAndEndAreDateOnly = spec.startAndEndAreDateOnly || startAndEndAreDateOnly;\n this.segmentOffset = spec.browserTZOffset ? spec.browserTZOffset() : 0;\n});\nfunction mergeWithDefaults(localizer, culture, formatOverrides, messages) {\n var formats = _objectSpread(_objectSpread({}, localizer.formats), formatOverrides);\n return _objectSpread(_objectSpread({}, localizer), {}, {\n messages: messages,\n startOfWeek: function startOfWeek() {\n return localizer.startOfWeek(culture);\n },\n format: function format(value, _format2) {\n return localizer.format(value, formats[_format2] || _format2, culture);\n }\n });\n}\n\nvar defaultMessages = {\n date: 'Date',\n time: 'Time',\n event: 'Event',\n allDay: 'All Day',\n week: 'Week',\n work_week: 'Work Week',\n day: 'Day',\n month: 'Month',\n previous: 'Back',\n next: 'Next',\n yesterday: 'Yesterday',\n tomorrow: 'Tomorrow',\n today: 'Today',\n agenda: 'Agenda',\n noEventsInRange: 'There are no events in this range.',\n showMore: function showMore(total) {\n return \"+\".concat(total, \" more\");\n }\n};\nfunction messages(msgs) {\n return _objectSpread(_objectSpread({}, defaultMessages), msgs);\n}\n\nfunction useClickOutside(_ref) {\n var ref = _ref.ref,\n callback = _ref.callback;\n useEffect(function () {\n var handleClickOutside = function handleClickOutside(e) {\n if (ref.current && !ref.current.contains(e.target)) {\n callback();\n }\n };\n document.addEventListener('mousedown', handleClickOutside);\n return function () {\n document.removeEventListener('mousedown', handleClickOutside);\n };\n }, [ref, callback]);\n}\n\nvar _excluded$7 = [\"style\", \"className\", \"event\", \"selected\", \"isAllDay\", \"onSelect\", \"onDoubleClick\", \"onKeyPress\", \"localizer\", \"continuesPrior\", \"continuesAfter\", \"accessors\", \"getters\", \"children\", \"components\", \"slotStart\", \"slotEnd\"];\nvar EventCell = /*#__PURE__*/function (_React$Component) {\n function EventCell() {\n _classCallCheck(this, EventCell);\n return _callSuper(this, EventCell, arguments);\n }\n _inherits(EventCell, _React$Component);\n return _createClass(EventCell, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n style = _this$props.style,\n className = _this$props.className,\n event = _this$props.event,\n selected = _this$props.selected,\n isAllDay = _this$props.isAllDay,\n onSelect = _this$props.onSelect,\n _onDoubleClick = _this$props.onDoubleClick,\n onKeyPress = _this$props.onKeyPress,\n localizer = _this$props.localizer,\n continuesPrior = _this$props.continuesPrior,\n continuesAfter = _this$props.continuesAfter,\n accessors = _this$props.accessors,\n getters = _this$props.getters,\n children = _this$props.children,\n _this$props$component = _this$props.components,\n Event = _this$props$component.event,\n EventWrapper = _this$props$component.eventWrapper,\n slotStart = _this$props.slotStart,\n slotEnd = _this$props.slotEnd,\n props = _objectWithoutProperties(_this$props, _excluded$7);\n delete props.resizable;\n var title = accessors.title(event);\n var tooltip = accessors.tooltip(event);\n var end = accessors.end(event);\n var start = accessors.start(event);\n var allDay = accessors.allDay(event);\n var showAsAllDay = isAllDay || allDay || localizer.diff(start, localizer.ceil(end, 'day'), 'day') > 1;\n var userProps = getters.eventProp(event, start, end, selected);\n var content = /*#__PURE__*/React.createElement(\"div\", {\n className: \"rbc-event-content\",\n title: tooltip || undefined\n }, Event ? /*#__PURE__*/React.createElement(Event, {\n event: event,\n continuesPrior: continuesPrior,\n continuesAfter: continuesAfter,\n title: title,\n isAllDay: allDay,\n localizer: localizer,\n slotStart: slotStart,\n slotEnd: slotEnd\n }) : title);\n return /*#__PURE__*/React.createElement(EventWrapper, Object.assign({}, this.props, {\n type: \"date\"\n }), /*#__PURE__*/React.createElement(\"div\", Object.assign({}, props, {\n style: _objectSpread(_objectSpread({}, userProps.style), style),\n className: clsx('rbc-event', className, userProps.className, {\n 'rbc-selected': selected,\n 'rbc-event-allday': showAsAllDay,\n 'rbc-event-continues-prior': continuesPrior,\n 'rbc-event-continues-after': continuesAfter\n }),\n onClick: function onClick(e) {\n return onSelect && onSelect(event, e);\n },\n onDoubleClick: function onDoubleClick(e) {\n return _onDoubleClick && _onDoubleClick(event, e);\n },\n onKeyDown: function onKeyDown(e) {\n return onKeyPress && onKeyPress(event, e);\n }\n }), typeof children === 'function' ? children(content) : content));\n }\n }]);\n}(React.Component);\n\nfunction isSelected(event, selected) {\n if (!event || selected == null) return false;\n return isEqual$1(event, selected);\n}\nfunction slotWidth(rowBox, slots) {\n var rowWidth = rowBox.right - rowBox.left;\n var cellWidth = rowWidth / slots;\n return cellWidth;\n}\nfunction getSlotAtX(rowBox, x, rtl, slots) {\n var cellWidth = slotWidth(rowBox, slots);\n return rtl ? slots - 1 - Math.floor((x - rowBox.left) / cellWidth) : Math.floor((x - rowBox.left) / cellWidth);\n}\nfunction pointInBox(box, _ref) {\n var x = _ref.x,\n y = _ref.y;\n return y >= box.top && y <= box.bottom && x >= box.left && x <= box.right;\n}\nfunction dateCellSelection(start, rowBox, box, slots, rtl) {\n var startIdx = -1;\n var endIdx = -1;\n var lastSlotIdx = slots - 1;\n var cellWidth = slotWidth(rowBox, slots);\n\n // cell under the mouse\n var currentSlot = getSlotAtX(rowBox, box.x, rtl, slots);\n\n // Identify row as either the initial row\n // or the row under the current mouse point\n var isCurrentRow = rowBox.top < box.y && rowBox.bottom > box.y;\n var isStartRow = rowBox.top < start.y && rowBox.bottom > start.y;\n\n // this row's position relative to the start point\n var isAboveStart = start.y > rowBox.bottom;\n var isBelowStart = rowBox.top > start.y;\n var isBetween = box.top < rowBox.top && box.bottom > rowBox.bottom;\n\n // this row is between the current and start rows, so entirely selected\n if (isBetween) {\n startIdx = 0;\n endIdx = lastSlotIdx;\n }\n if (isCurrentRow) {\n if (isBelowStart) {\n startIdx = 0;\n endIdx = currentSlot;\n } else if (isAboveStart) {\n startIdx = currentSlot;\n endIdx = lastSlotIdx;\n }\n }\n if (isStartRow) {\n // select the cell under the initial point\n startIdx = endIdx = rtl ? lastSlotIdx - Math.floor((start.x - rowBox.left) / cellWidth) : Math.floor((start.x - rowBox.left) / cellWidth);\n if (isCurrentRow) {\n if (currentSlot < startIdx) startIdx = currentSlot;else endIdx = currentSlot; //select current range\n } else if (start.y < box.y) {\n // the current row is below start row\n // select cells to the right of the start cell\n endIdx = lastSlotIdx;\n } else {\n // select cells to the left of the start cell\n startIdx = 0;\n }\n }\n return {\n startIdx: startIdx,\n endIdx: endIdx\n };\n}\n\n/**\n * Changes to react-overlays cause issue with auto positioning,\n * so we need to manually calculate the position of the popper,\n * and constrain it to the Month container.\n */\nfunction getPosition(_ref) {\n var target = _ref.target,\n offset = _ref.offset,\n container = _ref.container,\n box = _ref.box;\n var _getOffset = getOffset(target),\n top = _getOffset.top,\n left = _getOffset.left,\n width = _getOffset.width,\n height = _getOffset.height;\n var _getOffset2 = getOffset(container),\n cTop = _getOffset2.top,\n cLeft = _getOffset2.left,\n cWidth = _getOffset2.width,\n cHeight = _getOffset2.height;\n var _getOffset3 = getOffset(box),\n bWidth = _getOffset3.width,\n bHeight = _getOffset3.height;\n var viewBottom = cTop + cHeight;\n var viewRight = cLeft + cWidth;\n var bottom = top + bHeight;\n var right = left + bWidth;\n var x = offset.x,\n y = offset.y;\n var topOffset = bottom > viewBottom ? top - bHeight - y : top + y + height;\n var leftOffset = right > viewRight ? left + x - bWidth + width : left + x;\n return {\n topOffset: topOffset,\n leftOffset: leftOffset\n };\n}\nfunction Pop(_ref2) {\n var containerRef = _ref2.containerRef,\n accessors = _ref2.accessors,\n getters = _ref2.getters,\n selected = _ref2.selected,\n components = _ref2.components,\n localizer = _ref2.localizer,\n position = _ref2.position,\n show = _ref2.show,\n events = _ref2.events,\n slotStart = _ref2.slotStart,\n slotEnd = _ref2.slotEnd,\n onSelect = _ref2.onSelect,\n onDoubleClick = _ref2.onDoubleClick,\n onKeyPress = _ref2.onKeyPress,\n handleDragStart = _ref2.handleDragStart,\n popperRef = _ref2.popperRef,\n target = _ref2.target,\n offset = _ref2.offset;\n useClickOutside({\n ref: popperRef,\n callback: show\n });\n useLayoutEffect(function () {\n var _getPosition = getPosition({\n target: target,\n offset: offset,\n container: containerRef.current,\n box: popperRef.current\n }),\n topOffset = _getPosition.topOffset,\n leftOffset = _getPosition.leftOffset;\n popperRef.current.style.top = \"\".concat(topOffset, \"px\");\n popperRef.current.style.left = \"\".concat(leftOffset, \"px\");\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [offset.x, offset.y, target]);\n var width = position.width;\n var style = {\n minWidth: width + width / 2\n };\n return /*#__PURE__*/React.createElement(\"div\", {\n style: style,\n className: \"rbc-overlay\",\n ref: popperRef\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"rbc-overlay-header\"\n }, localizer.format(slotStart, 'dayHeaderFormat')), events.map(function (event, idx) {\n return /*#__PURE__*/React.createElement(EventCell, {\n key: idx,\n type: \"popup\",\n localizer: localizer,\n event: event,\n getters: getters,\n onSelect: onSelect,\n accessors: accessors,\n components: components,\n onDoubleClick: onDoubleClick,\n onKeyPress: onKeyPress,\n continuesPrior: localizer.lt(accessors.end(event), slotStart, 'day'),\n continuesAfter: localizer.gte(accessors.start(event), slotEnd, 'day'),\n slotStart: slotStart,\n slotEnd: slotEnd,\n selected: isSelected(event, selected),\n draggable: true,\n onDragStart: function onDragStart() {\n return handleDragStart(event);\n },\n onDragEnd: function onDragEnd() {\n return show();\n }\n });\n }));\n}\nvar Popup = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(Pop, Object.assign({}, props, {\n popperRef: ref\n }));\n});\nPopup.propTypes = {\n accessors: PropTypes.object.isRequired,\n getters: PropTypes.object.isRequired,\n selected: PropTypes.object,\n components: PropTypes.object.isRequired,\n localizer: PropTypes.object.isRequired,\n position: PropTypes.object.isRequired,\n show: PropTypes.func.isRequired,\n events: PropTypes.array.isRequired,\n slotStart: PropTypes.instanceOf(Date).isRequired,\n slotEnd: PropTypes.instanceOf(Date),\n onSelect: PropTypes.func,\n onDoubleClick: PropTypes.func,\n onKeyPress: PropTypes.func,\n handleDragStart: PropTypes.func,\n style: PropTypes.object,\n offset: PropTypes.shape({\n x: PropTypes.number,\n y: PropTypes.number\n })\n};\n\nfunction CalOverlay(_ref) {\n var containerRef = _ref.containerRef,\n _ref$popupOffset = _ref.popupOffset,\n popupOffset = _ref$popupOffset === void 0 ? 5 : _ref$popupOffset,\n overlay = _ref.overlay,\n accessors = _ref.accessors,\n localizer = _ref.localizer,\n components = _ref.components,\n getters = _ref.getters,\n selected = _ref.selected,\n handleSelectEvent = _ref.handleSelectEvent,\n handleDoubleClickEvent = _ref.handleDoubleClickEvent,\n handleKeyPressEvent = _ref.handleKeyPressEvent,\n handleDragStart = _ref.handleDragStart,\n onHide = _ref.onHide,\n overlayDisplay = _ref.overlayDisplay;\n var popperRef = useRef(null);\n if (!overlay.position) return null;\n var offset = popupOffset;\n if (!isNaN(popupOffset)) {\n offset = {\n x: popupOffset,\n y: popupOffset\n };\n }\n var position = overlay.position,\n events = overlay.events,\n date = overlay.date,\n end = overlay.end;\n return /*#__PURE__*/React.createElement(Overlay, {\n rootClose: true,\n flip: true,\n show: true,\n placement: \"bottom\",\n onHide: onHide,\n target: overlay.target\n }, function (_ref2) {\n var props = _ref2.props;\n return /*#__PURE__*/React.createElement(Popup, Object.assign({}, props, {\n containerRef: containerRef,\n ref: popperRef,\n target: overlay.target,\n offset: offset,\n accessors: accessors,\n getters: getters,\n selected: selected,\n components: components,\n localizer: localizer,\n position: position,\n show: overlayDisplay,\n events: events,\n slotStart: date,\n slotEnd: end,\n onSelect: handleSelectEvent,\n onDoubleClick: handleDoubleClickEvent,\n onKeyPress: handleKeyPressEvent,\n handleDragStart: handleDragStart\n }));\n });\n}\nvar PopOverlay = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(CalOverlay, Object.assign({}, props, {\n containerRef: ref\n }));\n});\nPopOverlay.propTypes = {\n popupOffset: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({\n x: PropTypes.number,\n y: PropTypes.number\n })]),\n overlay: PropTypes.shape({\n position: PropTypes.object,\n events: PropTypes.array,\n date: PropTypes.instanceOf(Date),\n end: PropTypes.instanceOf(Date)\n }),\n accessors: PropTypes.object.isRequired,\n localizer: PropTypes.object.isRequired,\n components: PropTypes.object.isRequired,\n getters: PropTypes.object.isRequired,\n selected: PropTypes.object,\n handleSelectEvent: PropTypes.func,\n handleDoubleClickEvent: PropTypes.func,\n handleKeyPressEvent: PropTypes.func,\n handleDragStart: PropTypes.func,\n onHide: PropTypes.func,\n overlayDisplay: PropTypes.func\n};\n\nfunction addEventListener(type, handler) {\n var target = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : document;\n return listen(target, type, handler, {\n passive: false\n });\n}\nfunction isOverContainer(container, x, y) {\n return !container || contains(container, document.elementFromPoint(x, y));\n}\nfunction getEventNodeFromPoint(node, _ref) {\n var clientX = _ref.clientX,\n clientY = _ref.clientY;\n var target = document.elementFromPoint(clientX, clientY);\n return closest(target, '.rbc-event', node);\n}\nfunction getShowMoreNodeFromPoint(node, _ref2) {\n var clientX = _ref2.clientX,\n clientY = _ref2.clientY;\n var target = document.elementFromPoint(clientX, clientY);\n return closest(target, '.rbc-show-more', node);\n}\nfunction isEvent(node, bounds) {\n return !!getEventNodeFromPoint(node, bounds);\n}\nfunction isShowMore(node, bounds) {\n return !!getShowMoreNodeFromPoint(node, bounds);\n}\nfunction getEventCoordinates(e) {\n var target = e;\n if (e.touches && e.touches.length) {\n target = e.touches[0];\n }\n return {\n clientX: target.clientX,\n clientY: target.clientY,\n pageX: target.pageX,\n pageY: target.pageY\n };\n}\nvar clickTolerance = 5;\nvar clickInterval = 250;\nvar Selection = /*#__PURE__*/function () {\n function Selection(node) {\n var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref3$global = _ref3.global,\n global = _ref3$global === void 0 ? false : _ref3$global,\n _ref3$longPressThresh = _ref3.longPressThreshold,\n longPressThreshold = _ref3$longPressThresh === void 0 ? 250 : _ref3$longPressThresh,\n _ref3$validContainers = _ref3.validContainers,\n validContainers = _ref3$validContainers === void 0 ? [] : _ref3$validContainers;\n _classCallCheck(this, Selection);\n this._initialEvent = null;\n this.selecting = false;\n this.isDetached = false;\n this.container = node;\n this.globalMouse = !node || global;\n this.longPressThreshold = longPressThreshold;\n this.validContainers = validContainers;\n this._listeners = Object.create(null);\n this._handleInitialEvent = this._handleInitialEvent.bind(this);\n this._handleMoveEvent = this._handleMoveEvent.bind(this);\n this._handleTerminatingEvent = this._handleTerminatingEvent.bind(this);\n this._keyListener = this._keyListener.bind(this);\n this._dropFromOutsideListener = this._dropFromOutsideListener.bind(this);\n this._dragOverFromOutsideListener = this._dragOverFromOutsideListener.bind(this);\n\n // Fixes an iOS 10 bug where scrolling could not be prevented on the window.\n // https://github.com/metafizzy/flickity/issues/457#issuecomment-254501356\n this._removeTouchMoveWindowListener = addEventListener('touchmove', function () {}, window);\n this._removeKeyDownListener = addEventListener('keydown', this._keyListener);\n this._removeKeyUpListener = addEventListener('keyup', this._keyListener);\n this._removeDropFromOutsideListener = addEventListener('drop', this._dropFromOutsideListener);\n this._removeDragOverFromOutsideListener = addEventListener('dragover', this._dragOverFromOutsideListener);\n this._addInitialEventListener();\n }\n return _createClass(Selection, [{\n key: \"on\",\n value: function on(type, handler) {\n var handlers = this._listeners[type] || (this._listeners[type] = []);\n handlers.push(handler);\n return {\n remove: function remove() {\n var idx = handlers.indexOf(handler);\n if (idx !== -1) handlers.splice(idx, 1);\n }\n };\n }\n }, {\n key: \"emit\",\n value: function emit(type) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n var result;\n var handlers = this._listeners[type] || [];\n handlers.forEach(function (fn) {\n if (result === undefined) result = fn.apply(void 0, args);\n });\n return result;\n }\n }, {\n key: \"teardown\",\n value: function teardown() {\n this._initialEvent = null;\n this._initialEventData = null;\n this._selectRect = null;\n this.selecting = false;\n this._lastClickData = null;\n this.isDetached = true;\n this._listeners = Object.create(null);\n this._removeTouchMoveWindowListener && this._removeTouchMoveWindowListener();\n this._removeInitialEventListener && this._removeInitialEventListener();\n this._removeEndListener && this._removeEndListener();\n this._onEscListener && this._onEscListener();\n this._removeMoveListener && this._removeMoveListener();\n this._removeKeyUpListener && this._removeKeyUpListener();\n this._removeKeyDownListener && this._removeKeyDownListener();\n this._removeDropFromOutsideListener && this._removeDropFromOutsideListener();\n this._removeDragOverFromOutsideListener && this._removeDragOverFromOutsideListener();\n }\n }, {\n key: \"isSelected\",\n value: function isSelected(node) {\n var box = this._selectRect;\n if (!box || !this.selecting) return false;\n return objectsCollide(box, getBoundsForNode(node));\n }\n }, {\n key: \"filter\",\n value: function filter(items) {\n var box = this._selectRect;\n\n //not selecting\n if (!box || !this.selecting) return [];\n return items.filter(this.isSelected, this);\n }\n\n // Adds a listener that will call the handler only after the user has pressed on the screen\n // without moving their finger for 250ms.\n }, {\n key: \"_addLongPressListener\",\n value: function _addLongPressListener(handler, initialEvent) {\n var _this = this;\n var timer = null;\n var removeTouchMoveListener = null;\n var removeTouchEndListener = null;\n var handleTouchStart = function handleTouchStart(initialEvent) {\n timer = setTimeout(function () {\n cleanup();\n handler(initialEvent);\n }, _this.longPressThreshold);\n removeTouchMoveListener = addEventListener('touchmove', function () {\n return cleanup();\n });\n removeTouchEndListener = addEventListener('touchend', function () {\n return cleanup();\n });\n };\n var removeTouchStartListener = addEventListener('touchstart', handleTouchStart);\n var cleanup = function cleanup() {\n if (timer) {\n clearTimeout(timer);\n }\n if (removeTouchMoveListener) {\n removeTouchMoveListener();\n }\n if (removeTouchEndListener) {\n removeTouchEndListener();\n }\n timer = null;\n removeTouchMoveListener = null;\n removeTouchEndListener = null;\n };\n if (initialEvent) {\n handleTouchStart(initialEvent);\n }\n return function () {\n cleanup();\n removeTouchStartListener();\n };\n }\n\n // Listen for mousedown and touchstart events. When one is received, disable the other and setup\n // future event handling based on the type of event.\n }, {\n key: \"_addInitialEventListener\",\n value: function _addInitialEventListener() {\n var _this2 = this;\n var removeMouseDownListener = addEventListener('mousedown', function (e) {\n _this2._removeInitialEventListener();\n _this2._handleInitialEvent(e);\n _this2._removeInitialEventListener = addEventListener('mousedown', _this2._handleInitialEvent);\n });\n var removeTouchStartListener = addEventListener('touchstart', function (e) {\n _this2._removeInitialEventListener();\n _this2._removeInitialEventListener = _this2._addLongPressListener(_this2._handleInitialEvent, e);\n });\n this._removeInitialEventListener = function () {\n removeMouseDownListener();\n removeTouchStartListener();\n };\n }\n }, {\n key: \"_dropFromOutsideListener\",\n value: function _dropFromOutsideListener(e) {\n var _getEventCoordinates = getEventCoordinates(e),\n pageX = _getEventCoordinates.pageX,\n pageY = _getEventCoordinates.pageY,\n clientX = _getEventCoordinates.clientX,\n clientY = _getEventCoordinates.clientY;\n this.emit('dropFromOutside', {\n x: pageX,\n y: pageY,\n clientX: clientX,\n clientY: clientY\n });\n e.preventDefault();\n }\n }, {\n key: \"_dragOverFromOutsideListener\",\n value: function _dragOverFromOutsideListener(e) {\n var _getEventCoordinates2 = getEventCoordinates(e),\n pageX = _getEventCoordinates2.pageX,\n pageY = _getEventCoordinates2.pageY,\n clientX = _getEventCoordinates2.clientX,\n clientY = _getEventCoordinates2.clientY;\n this.emit('dragOverFromOutside', {\n x: pageX,\n y: pageY,\n clientX: clientX,\n clientY: clientY\n });\n e.preventDefault();\n }\n }, {\n key: \"_handleInitialEvent\",\n value: function _handleInitialEvent(e) {\n this._initialEvent = e;\n if (this.isDetached) {\n return;\n }\n var _getEventCoordinates3 = getEventCoordinates(e),\n clientX = _getEventCoordinates3.clientX,\n clientY = _getEventCoordinates3.clientY,\n pageX = _getEventCoordinates3.pageX,\n pageY = _getEventCoordinates3.pageY;\n var node = this.container(),\n collides,\n offsetData;\n\n // Right clicks\n if (e.which === 3 || e.button === 2 || !isOverContainer(node, clientX, clientY)) return;\n if (!this.globalMouse && node && !contains(node, e.target)) {\n var _normalizeDistance = normalizeDistance(0),\n top = _normalizeDistance.top,\n left = _normalizeDistance.left,\n bottom = _normalizeDistance.bottom,\n right = _normalizeDistance.right;\n offsetData = getBoundsForNode(node);\n collides = objectsCollide({\n top: offsetData.top - top,\n left: offsetData.left - left,\n bottom: offsetData.bottom + bottom,\n right: offsetData.right + right\n }, {\n top: pageY,\n left: pageX\n });\n if (!collides) return;\n }\n var result = this.emit('beforeSelect', this._initialEventData = {\n isTouch: /^touch/.test(e.type),\n x: pageX,\n y: pageY,\n clientX: clientX,\n clientY: clientY\n });\n if (result === false) return;\n switch (e.type) {\n case 'mousedown':\n this._removeEndListener = addEventListener('mouseup', this._handleTerminatingEvent);\n this._onEscListener = addEventListener('keydown', this._handleTerminatingEvent);\n this._removeMoveListener = addEventListener('mousemove', this._handleMoveEvent);\n break;\n case 'touchstart':\n this._handleMoveEvent(e);\n this._removeEndListener = addEventListener('touchend', this._handleTerminatingEvent);\n this._removeMoveListener = addEventListener('touchmove', this._handleMoveEvent);\n break;\n }\n }\n\n // Check whether provided event target element\n // - is contained within a valid container\n }, {\n key: \"_isWithinValidContainer\",\n value: function _isWithinValidContainer(e) {\n var eventTarget = e.target;\n var containers = this.validContainers;\n if (!containers || !containers.length || !eventTarget) {\n return true;\n }\n return containers.some(function (target) {\n return !!eventTarget.closest(target);\n });\n }\n }, {\n key: \"_handleTerminatingEvent\",\n value: function _handleTerminatingEvent(e) {\n var selecting = this.selecting;\n var bounds = this._selectRect;\n // If it's not in selecting state, it's a click event\n if (!selecting && e.type.includes('key')) {\n e = this._initialEvent;\n }\n this.selecting = false;\n this._removeEndListener && this._removeEndListener();\n this._removeMoveListener && this._removeMoveListener();\n this._selectRect = null;\n this._initialEvent = null;\n this._initialEventData = null;\n if (!e) return;\n var inRoot = !this.container || contains(this.container(), e.target);\n var isWithinValidContainer = this._isWithinValidContainer(e);\n if (e.key === 'Escape' || !isWithinValidContainer) {\n return this.emit('reset');\n }\n if (!selecting && inRoot) {\n return this._handleClickEvent(e);\n }\n\n // User drag-clicked in the Selectable area\n if (selecting) return this.emit('select', bounds);\n return this.emit('reset');\n }\n }, {\n key: \"_handleClickEvent\",\n value: function _handleClickEvent(e) {\n var _getEventCoordinates4 = getEventCoordinates(e),\n pageX = _getEventCoordinates4.pageX,\n pageY = _getEventCoordinates4.pageY,\n clientX = _getEventCoordinates4.clientX,\n clientY = _getEventCoordinates4.clientY;\n var now = new Date().getTime();\n if (this._lastClickData && now - this._lastClickData.timestamp < clickInterval) {\n // Double click event\n this._lastClickData = null;\n return this.emit('doubleClick', {\n x: pageX,\n y: pageY,\n clientX: clientX,\n clientY: clientY\n });\n }\n\n // Click event\n this._lastClickData = {\n timestamp: now\n };\n return this.emit('click', {\n x: pageX,\n y: pageY,\n clientX: clientX,\n clientY: clientY\n });\n }\n }, {\n key: \"_handleMoveEvent\",\n value: function _handleMoveEvent(e) {\n if (this._initialEventData === null || this.isDetached) {\n return;\n }\n var _this$_initialEventDa = this._initialEventData,\n x = _this$_initialEventDa.x,\n y = _this$_initialEventDa.y;\n var _getEventCoordinates5 = getEventCoordinates(e),\n pageX = _getEventCoordinates5.pageX,\n pageY = _getEventCoordinates5.pageY;\n var w = Math.abs(x - pageX);\n var h = Math.abs(y - pageY);\n var left = Math.min(pageX, x),\n top = Math.min(pageY, y),\n old = this.selecting;\n var click = this.isClick(pageX, pageY);\n // Prevent emitting selectStart event until mouse is moved.\n // in Chrome on Windows, mouseMove event may be fired just after mouseDown event.\n if (click && !old && !(w || h)) {\n return;\n }\n if (!old && !click) {\n this.emit('selectStart', this._initialEventData);\n }\n if (!click) {\n this.selecting = true;\n this._selectRect = {\n top: top,\n left: left,\n x: pageX,\n y: pageY,\n right: left + w,\n bottom: top + h\n };\n this.emit('selecting', this._selectRect);\n }\n e.preventDefault();\n }\n }, {\n key: \"_keyListener\",\n value: function _keyListener(e) {\n this.ctrl = e.metaKey || e.ctrlKey;\n }\n }, {\n key: \"isClick\",\n value: function isClick(pageX, pageY) {\n var _this$_initialEventDa2 = this._initialEventData,\n x = _this$_initialEventDa2.x,\n y = _this$_initialEventDa2.y,\n isTouch = _this$_initialEventDa2.isTouch;\n return !isTouch && Math.abs(pageX - x) <= clickTolerance && Math.abs(pageY - y) <= clickTolerance;\n }\n }]);\n}();\n/**\n * Resolve the disance prop from either an Int or an Object\n * @return {Object}\n */\nfunction normalizeDistance() {\n var distance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n if (_typeof(distance) !== 'object') distance = {\n top: distance,\n left: distance,\n right: distance,\n bottom: distance\n };\n return distance;\n}\n\n/**\n * Given two objects containing \"top\", \"left\", \"offsetWidth\" and \"offsetHeight\"\n * properties, determine if they collide.\n * @param {Object|HTMLElement} a\n * @param {Object|HTMLElement} b\n * @return {bool}\n */\nfunction objectsCollide(nodeA, nodeB) {\n var tolerance = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var _getBoundsForNode = getBoundsForNode(nodeA),\n aTop = _getBoundsForNode.top,\n aLeft = _getBoundsForNode.left,\n _getBoundsForNode$rig = _getBoundsForNode.right,\n aRight = _getBoundsForNode$rig === void 0 ? aLeft : _getBoundsForNode$rig,\n _getBoundsForNode$bot = _getBoundsForNode.bottom,\n aBottom = _getBoundsForNode$bot === void 0 ? aTop : _getBoundsForNode$bot;\n var _getBoundsForNode2 = getBoundsForNode(nodeB),\n bTop = _getBoundsForNode2.top,\n bLeft = _getBoundsForNode2.left,\n _getBoundsForNode2$ri = _getBoundsForNode2.right,\n bRight = _getBoundsForNode2$ri === void 0 ? bLeft : _getBoundsForNode2$ri,\n _getBoundsForNode2$bo = _getBoundsForNode2.bottom,\n bBottom = _getBoundsForNode2$bo === void 0 ? bTop : _getBoundsForNode2$bo;\n return !(\n // 'a' bottom doesn't touch 'b' top\n\n aBottom - tolerance < bTop ||\n // 'a' top doesn't touch 'b' bottom\n aTop + tolerance > bBottom ||\n // 'a' right doesn't touch 'b' left\n aRight - tolerance < bLeft ||\n // 'a' left doesn't touch 'b' right\n aLeft + tolerance > bRight);\n}\n\n/**\n * Given a node, get everything needed to calculate its boundaries\n * @param {HTMLElement} node\n * @return {Object}\n */\nfunction getBoundsForNode(node) {\n if (!node.getBoundingClientRect) return node;\n var rect = node.getBoundingClientRect(),\n left = rect.left + pageOffset('left'),\n top = rect.top + pageOffset('top');\n return {\n top: top,\n left: left,\n right: (node.offsetWidth || 0) + left,\n bottom: (node.offsetHeight || 0) + top\n };\n}\nfunction pageOffset(dir) {\n if (dir === 'left') return window.pageXOffset || document.body.scrollLeft || 0;\n if (dir === 'top') return window.pageYOffset || document.body.scrollTop || 0;\n}\n\nvar BackgroundCells = /*#__PURE__*/function (_React$Component) {\n function BackgroundCells(props, context) {\n var _this;\n _classCallCheck(this, BackgroundCells);\n _this = _callSuper(this, BackgroundCells, [props, context]);\n _this.state = {\n selecting: false\n };\n _this.containerRef = /*#__PURE__*/createRef();\n return _this;\n }\n _inherits(BackgroundCells, _React$Component);\n return _createClass(BackgroundCells, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.props.selectable && this._selectable();\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this._teardownSelectable();\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n if (!prevProps.selectable && this.props.selectable) this._selectable();\n if (prevProps.selectable && !this.props.selectable) this._teardownSelectable();\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n range = _this$props.range,\n getNow = _this$props.getNow,\n getters = _this$props.getters,\n currentDate = _this$props.date,\n Wrapper = _this$props.components.dateCellWrapper,\n localizer = _this$props.localizer;\n var _this$state = this.state,\n selecting = _this$state.selecting,\n startIdx = _this$state.startIdx,\n endIdx = _this$state.endIdx;\n var current = getNow();\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"rbc-row-bg\",\n ref: this.containerRef\n }, range.map(function (date, index) {\n var selected = selecting && index >= startIdx && index <= endIdx;\n var _getters$dayProp = getters.dayProp(date),\n className = _getters$dayProp.className,\n style = _getters$dayProp.style;\n return /*#__PURE__*/React.createElement(Wrapper, {\n key: index,\n value: date,\n range: range\n }, /*#__PURE__*/React.createElement(\"div\", {\n style: style,\n className: clsx('rbc-day-bg', className, selected && 'rbc-selected-cell', localizer.isSameDate(date, current) && 'rbc-today', currentDate && localizer.neq(currentDate, date, 'month') && 'rbc-off-range-bg')\n }));\n }));\n }\n }, {\n key: \"_selectable\",\n value: function _selectable() {\n var _this2 = this;\n var node = this.containerRef.current;\n var selector = this._selector = new Selection(this.props.container, {\n longPressThreshold: this.props.longPressThreshold\n });\n var selectorClicksHandler = function selectorClicksHandler(point, actionType) {\n if (!isEvent(node, point) && !isShowMore(node, point)) {\n var rowBox = getBoundsForNode(node);\n var _this2$props = _this2.props,\n range = _this2$props.range,\n rtl = _this2$props.rtl;\n if (pointInBox(rowBox, point)) {\n var currentCell = getSlotAtX(rowBox, point.x, rtl, range.length);\n _this2._selectSlot({\n startIdx: currentCell,\n endIdx: currentCell,\n action: actionType,\n box: point\n });\n }\n }\n _this2._initial = {};\n _this2.setState({\n selecting: false\n });\n };\n selector.on('selecting', function (box) {\n var _this2$props2 = _this2.props,\n range = _this2$props2.range,\n rtl = _this2$props2.rtl;\n var startIdx = -1;\n var endIdx = -1;\n if (!_this2.state.selecting) {\n notify(_this2.props.onSelectStart, [box]);\n _this2._initial = {\n x: box.x,\n y: box.y\n };\n }\n if (selector.isSelected(node)) {\n var nodeBox = getBoundsForNode(node);\n var _dateCellSelection = dateCellSelection(_this2._initial, nodeBox, box, range.length, rtl);\n startIdx = _dateCellSelection.startIdx;\n endIdx = _dateCellSelection.endIdx;\n }\n _this2.setState({\n selecting: true,\n startIdx: startIdx,\n endIdx: endIdx\n });\n });\n selector.on('beforeSelect', function (box) {\n if (_this2.props.selectable !== 'ignoreEvents') return;\n return !isEvent(_this2.containerRef.current, box);\n });\n selector.on('click', function (point) {\n return selectorClicksHandler(point, 'click');\n });\n selector.on('doubleClick', function (point) {\n return selectorClicksHandler(point, 'doubleClick');\n });\n selector.on('select', function (bounds) {\n _this2._selectSlot(_objectSpread(_objectSpread({}, _this2.state), {}, {\n action: 'select',\n bounds: bounds\n }));\n _this2._initial = {};\n _this2.setState({\n selecting: false\n });\n notify(_this2.props.onSelectEnd, [_this2.state]);\n });\n }\n }, {\n key: \"_teardownSelectable\",\n value: function _teardownSelectable() {\n if (!this._selector) return;\n this._selector.teardown();\n this._selector = null;\n }\n }, {\n key: \"_selectSlot\",\n value: function _selectSlot(_ref) {\n var endIdx = _ref.endIdx,\n startIdx = _ref.startIdx,\n action = _ref.action,\n bounds = _ref.bounds,\n box = _ref.box;\n if (endIdx !== -1 && startIdx !== -1) this.props.onSelectSlot && this.props.onSelectSlot({\n start: startIdx,\n end: endIdx,\n action: action,\n bounds: bounds,\n box: box,\n resourceId: this.props.resourceId\n });\n }\n }]);\n}(React.Component);\n\n/* eslint-disable react/prop-types */\nvar EventRowMixin = {\n propTypes: {\n slotMetrics: PropTypes.object.isRequired,\n selected: PropTypes.object,\n isAllDay: PropTypes.bool,\n accessors: PropTypes.object.isRequired,\n localizer: PropTypes.object.isRequired,\n components: PropTypes.object.isRequired,\n getters: PropTypes.object.isRequired,\n onSelect: PropTypes.func,\n onDoubleClick: PropTypes.func,\n onKeyPress: PropTypes.func\n },\n defaultProps: {\n segments: [],\n selected: {}\n },\n renderEvent: function renderEvent(props, event) {\n var selected = props.selected;\n props.isAllDay;\n var accessors = props.accessors,\n getters = props.getters,\n onSelect = props.onSelect,\n onDoubleClick = props.onDoubleClick,\n onKeyPress = props.onKeyPress,\n localizer = props.localizer,\n slotMetrics = props.slotMetrics,\n components = props.components,\n resizable = props.resizable;\n var continuesPrior = slotMetrics.continuesPrior(event);\n var continuesAfter = slotMetrics.continuesAfter(event);\n return /*#__PURE__*/React.createElement(EventCell, {\n event: event,\n getters: getters,\n localizer: localizer,\n accessors: accessors,\n components: components,\n onSelect: onSelect,\n onDoubleClick: onDoubleClick,\n onKeyPress: onKeyPress,\n continuesPrior: continuesPrior,\n continuesAfter: continuesAfter,\n slotStart: slotMetrics.first,\n slotEnd: slotMetrics.last,\n selected: isSelected(event, selected),\n resizable: resizable\n });\n },\n renderSpan: function renderSpan(slots, len, key) {\n var content = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ' ';\n var per = Math.abs(len) / slots * 100 + '%';\n return /*#__PURE__*/React.createElement(\"div\", {\n key: key,\n className: \"rbc-row-segment\"\n // IE10/11 need max-width. flex-basis doesn't respect box-sizing\n ,\n style: {\n WebkitFlexBasis: per,\n flexBasis: per,\n maxWidth: per\n }\n }, content);\n }\n};\n\nvar EventRow = /*#__PURE__*/function (_React$Component) {\n function EventRow() {\n _classCallCheck(this, EventRow);\n return _callSuper(this, EventRow, arguments);\n }\n _inherits(EventRow, _React$Component);\n return _createClass(EventRow, [{\n key: \"render\",\n value: function render() {\n var _this = this;\n var _this$props = this.props,\n segments = _this$props.segments,\n slots = _this$props.slotMetrics.slots,\n className = _this$props.className;\n var lastEnd = 1;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: clsx(className, 'rbc-row')\n }, segments.reduce(function (row, _ref, li) {\n var event = _ref.event,\n left = _ref.left,\n right = _ref.right,\n span = _ref.span;\n var key = '_lvl_' + li;\n var gap = left - lastEnd;\n var content = EventRowMixin.renderEvent(_this.props, event);\n if (gap) row.push(EventRowMixin.renderSpan(slots, gap, \"\".concat(key, \"_gap\")));\n row.push(EventRowMixin.renderSpan(slots, span, key, content));\n lastEnd = right + 1;\n return row;\n }, []));\n }\n }]);\n}(React.Component);\nEventRow.defaultProps = _objectSpread({}, EventRowMixin.defaultProps);\n\nfunction endOfRange(_ref) {\n var dateRange = _ref.dateRange,\n _ref$unit = _ref.unit,\n unit = _ref$unit === void 0 ? 'day' : _ref$unit,\n localizer = _ref.localizer;\n return {\n first: dateRange[0],\n last: localizer.add(dateRange[dateRange.length - 1], 1, unit)\n };\n}\n\n// properly calculating segments requires working with dates in\n// the timezone we're working with, so we use the localizer\nfunction eventSegments(event, range, accessors, localizer) {\n var _endOfRange = endOfRange({\n dateRange: range,\n localizer: localizer\n }),\n first = _endOfRange.first,\n last = _endOfRange.last;\n var slots = localizer.diff(first, last, 'day');\n var start = localizer.max(localizer.startOf(accessors.start(event), 'day'), first);\n var end = localizer.min(localizer.ceil(accessors.end(event), 'day'), last);\n var padding = findIndex(range, function (x) {\n return localizer.isSameDate(x, start);\n });\n var span = localizer.diff(start, end, 'day');\n span = Math.min(span, slots);\n // The segmentOffset is necessary when adjusting for timezones\n // ahead of the browser timezone\n span = Math.max(span - localizer.segmentOffset, 1);\n return {\n event: event,\n span: span,\n left: padding + 1,\n right: Math.max(padding + span, 1)\n };\n}\nfunction eventLevels(rowSegments) {\n var limit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;\n var i,\n j,\n seg,\n levels = [],\n extra = [];\n for (i = 0; i < rowSegments.length; i++) {\n seg = rowSegments[i];\n for (j = 0; j < levels.length; j++) if (!segsOverlap(seg, levels[j])) break;\n if (j >= limit) {\n extra.push(seg);\n } else {\n (levels[j] || (levels[j] = [])).push(seg);\n }\n }\n for (i = 0; i < levels.length; i++) {\n levels[i].sort(function (a, b) {\n return a.left - b.left;\n }); //eslint-disable-line\n }\n return {\n levels: levels,\n extra: extra\n };\n}\nfunction inRange(e, start, end, accessors, localizer) {\n var event = {\n start: accessors.start(e),\n end: accessors.end(e)\n };\n var range = {\n start: start,\n end: end\n };\n return localizer.inEventRange({\n event: event,\n range: range\n });\n}\nfunction segsOverlap(seg, otherSegs) {\n return otherSegs.some(function (otherSeg) {\n return otherSeg.left <= seg.right && otherSeg.right >= seg.left;\n });\n}\nfunction sortWeekEvents(events, accessors, localizer) {\n var base = _toConsumableArray(events);\n var multiDayEvents = [];\n var standardEvents = [];\n base.forEach(function (event) {\n var startCheck = accessors.start(event);\n var endCheck = accessors.end(event);\n if (localizer.daySpan(startCheck, endCheck) > 1) {\n multiDayEvents.push(event);\n } else {\n standardEvents.push(event);\n }\n });\n var multiSorted = multiDayEvents.sort(function (a, b) {\n return sortEvents(a, b, accessors, localizer);\n });\n var standardSorted = standardEvents.sort(function (a, b) {\n return sortEvents(a, b, accessors, localizer);\n });\n return [].concat(_toConsumableArray(multiSorted), _toConsumableArray(standardSorted));\n}\nfunction sortEvents(eventA, eventB, accessors, localizer) {\n var evtA = {\n start: accessors.start(eventA),\n end: accessors.end(eventA),\n allDay: accessors.allDay(eventA)\n };\n var evtB = {\n start: accessors.start(eventB),\n end: accessors.end(eventB),\n allDay: accessors.allDay(eventB)\n };\n return localizer.sortEvents({\n evtA: evtA,\n evtB: evtB\n });\n}\n\nvar isSegmentInSlot$1 = function isSegmentInSlot(seg, slot) {\n return seg.left <= slot && seg.right >= slot;\n};\nvar eventsInSlot = function eventsInSlot(segments, slot) {\n return segments.filter(function (seg) {\n return isSegmentInSlot$1(seg, slot);\n }).map(function (seg) {\n return seg.event;\n });\n};\nvar EventEndingRow = /*#__PURE__*/function (_React$Component) {\n function EventEndingRow() {\n _classCallCheck(this, EventEndingRow);\n return _callSuper(this, EventEndingRow, arguments);\n }\n _inherits(EventEndingRow, _React$Component);\n return _createClass(EventEndingRow, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n segments = _this$props.segments,\n slots = _this$props.slotMetrics.slots;\n var rowSegments = eventLevels(segments).levels[0];\n var current = 1,\n lastEnd = 1,\n row = [];\n while (current <= slots) {\n var key = '_lvl_' + current;\n var _ref = rowSegments.filter(function (seg) {\n return isSegmentInSlot$1(seg, current);\n })[0] || {},\n event = _ref.event,\n left = _ref.left,\n right = _ref.right,\n span = _ref.span; //eslint-disable-line\n\n if (!event) {\n current++;\n continue;\n }\n var gap = Math.max(0, left - lastEnd);\n if (this.canRenderSlotEvent(left, span)) {\n var content = EventRowMixin.renderEvent(this.props, event);\n if (gap) {\n row.push(EventRowMixin.renderSpan(slots, gap, key + '_gap'));\n }\n row.push(EventRowMixin.renderSpan(slots, span, key, content));\n lastEnd = current = right + 1;\n } else {\n if (gap) {\n row.push(EventRowMixin.renderSpan(slots, gap, key + '_gap'));\n }\n row.push(EventRowMixin.renderSpan(slots, 1, key, this.renderShowMore(segments, current)));\n lastEnd = current = current + 1;\n }\n }\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"rbc-row\"\n }, row);\n }\n }, {\n key: \"canRenderSlotEvent\",\n value: function canRenderSlotEvent(slot, span) {\n var segments = this.props.segments;\n return range$1(slot, slot + span).every(function (s) {\n var count = eventsInSlot(segments, s).length;\n return count === 1;\n });\n }\n }, {\n key: \"renderShowMore\",\n value: function renderShowMore(segments, slot) {\n var _this = this;\n var _this$props2 = this.props,\n localizer = _this$props2.localizer,\n slotMetrics = _this$props2.slotMetrics,\n components = _this$props2.components;\n var events = slotMetrics.getEventsForSlot(slot);\n var remainingEvents = eventsInSlot(segments, slot);\n var count = remainingEvents.length;\n if (components !== null && components !== void 0 && components.showMore) {\n var ShowMore = components.showMore;\n // The received slot seems to be 1-based, but the range we use to pull the date is 0-based\n var slotDate = slotMetrics.getDateForSlot(slot - 1);\n return count ? /*#__PURE__*/React.createElement(ShowMore, {\n localizer: localizer,\n slotDate: slotDate,\n slot: slot,\n count: count,\n events: events,\n remainingEvents: remainingEvents\n }) : false;\n }\n return count ? /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n key: 'sm_' + slot,\n className: clsx('rbc-button-link', 'rbc-show-more'),\n onClick: function onClick(e) {\n return _this.showMore(slot, e);\n }\n }, localizer.messages.showMore(count, remainingEvents, events)) : false;\n }\n }, {\n key: \"showMore\",\n value: function showMore(slot, e) {\n e.preventDefault();\n e.stopPropagation();\n this.props.onShowMore(slot, e.target);\n }\n }]);\n}(React.Component);\nEventEndingRow.defaultProps = _objectSpread({}, EventRowMixin.defaultProps);\n\nvar ScrollableWeekWrapper = function ScrollableWeekWrapper(_ref) {\n var children = _ref.children;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"rbc-row-content-scroll-container\"\n }, children);\n};\n\nvar isSegmentInSlot = function isSegmentInSlot(seg, slot) {\n return seg.left <= slot && seg.right >= slot;\n};\nvar isEqual = function isEqual(a, b) {\n return a[0].range === b[0].range && a[0].events === b[0].events;\n};\nfunction getSlotMetrics$1() {\n return memoize(function (options) {\n var range = options.range,\n events = options.events,\n maxRows = options.maxRows,\n minRows = options.minRows,\n accessors = options.accessors,\n localizer = options.localizer;\n var _endOfRange = endOfRange({\n dateRange: range,\n localizer: localizer\n }),\n first = _endOfRange.first,\n last = _endOfRange.last;\n var segments = events.map(function (evt) {\n return eventSegments(evt, range, accessors, localizer);\n });\n var _eventLevels = eventLevels(segments, Math.max(maxRows - 1, 1)),\n levels = _eventLevels.levels,\n extra = _eventLevels.extra;\n // Subtract 1 from minRows to not include showMore button row when\n // it would be rendered\n var minEventRows = extra.length > 0 ? minRows - 1 : minRows;\n while (levels.length < minEventRows) levels.push([]);\n return {\n first: first,\n last: last,\n levels: levels,\n extra: extra,\n range: range,\n slots: range.length,\n clone: function clone(args) {\n var metrics = getSlotMetrics$1();\n return metrics(_objectSpread(_objectSpread({}, options), args));\n },\n getDateForSlot: function getDateForSlot(slotNumber) {\n return range[slotNumber];\n },\n getSlotForDate: function getSlotForDate(date) {\n return range.find(function (r) {\n return localizer.isSameDate(r, date);\n });\n },\n getEventsForSlot: function getEventsForSlot(slot) {\n return segments.filter(function (seg) {\n return isSegmentInSlot(seg, slot);\n }).map(function (seg) {\n return seg.event;\n });\n },\n continuesPrior: function continuesPrior(event) {\n return localizer.continuesPrior(accessors.start(event), first);\n },\n continuesAfter: function continuesAfter(event) {\n var start = accessors.start(event);\n var end = accessors.end(event);\n return localizer.continuesAfter(start, end, last);\n }\n };\n }, isEqual);\n}\n\nvar DateContentRow = /*#__PURE__*/function (_React$Component) {\n function DateContentRow() {\n var _this;\n _classCallCheck(this, DateContentRow);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _callSuper(this, DateContentRow, [].concat(args));\n _this.handleSelectSlot = function (slot) {\n var _this$props = _this.props,\n range = _this$props.range,\n onSelectSlot = _this$props.onSelectSlot;\n onSelectSlot(range.slice(slot.start, slot.end + 1), slot);\n };\n _this.handleShowMore = function (slot, target) {\n var _this$props2 = _this.props,\n range = _this$props2.range,\n onShowMore = _this$props2.onShowMore;\n var metrics = _this.slotMetrics(_this.props);\n var row = qsa(_this.containerRef.current, '.rbc-row-bg')[0];\n var cell;\n if (row) cell = row.children[slot - 1];\n var events = metrics.getEventsForSlot(slot);\n onShowMore(events, range[slot - 1], cell, slot, target);\n };\n _this.getContainer = function () {\n var container = _this.props.container;\n return container ? container() : _this.containerRef.current;\n };\n _this.renderHeadingCell = function (date, index) {\n var _this$props3 = _this.props,\n renderHeader = _this$props3.renderHeader,\n getNow = _this$props3.getNow,\n localizer = _this$props3.localizer;\n return renderHeader({\n date: date,\n key: \"header_\".concat(index),\n className: clsx('rbc-date-cell', localizer.isSameDate(date, getNow()) && 'rbc-now')\n });\n };\n _this.renderDummy = function () {\n var _this$props4 = _this.props,\n className = _this$props4.className,\n range = _this$props4.range,\n renderHeader = _this$props4.renderHeader,\n showAllEvents = _this$props4.showAllEvents;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: className,\n ref: _this.containerRef\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: clsx('rbc-row-content', showAllEvents && 'rbc-row-content-scrollable')\n }, renderHeader && /*#__PURE__*/React.createElement(\"div\", {\n className: \"rbc-row\",\n ref: _this.headingRowRef\n }, range.map(_this.renderHeadingCell)), /*#__PURE__*/React.createElement(\"div\", {\n className: \"rbc-row\",\n ref: _this.eventRowRef\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"rbc-row-segment\"\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"rbc-event\"\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"rbc-event-content\"\n }, \"\\xA0\"))))));\n };\n _this.containerRef = /*#__PURE__*/createRef();\n _this.headingRowRef = /*#__PURE__*/createRef();\n _this.eventRowRef = /*#__PURE__*/createRef();\n _this.slotMetrics = getSlotMetrics$1();\n return _this;\n }\n _inherits(DateContentRow, _React$Component);\n return _createClass(DateContentRow, [{\n key: \"getRowLimit\",\n value: function getRowLimit() {\n var _this$headingRowRef;\n /* Guessing this only gets called on the dummyRow */\n var eventHeight = getHeight(this.eventRowRef.current);\n var headingHeight = (_this$headingRowRef = this.headingRowRef) !== null && _this$headingRowRef !== void 0 && _this$headingRowRef.current ? getHeight(this.headingRowRef.current) : 0;\n var eventSpace = getHeight(this.containerRef.current) - headingHeight;\n return Math.max(Math.floor(eventSpace / eventHeight), 1);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props5 = this.props,\n date = _this$props5.date,\n rtl = _this$props5.rtl,\n range = _this$props5.range,\n className = _this$props5.className,\n selected = _this$props5.selected,\n selectable = _this$props5.selectable,\n renderForMeasure = _this$props5.renderForMeasure,\n accessors = _this$props5.accessors,\n getters = _this$props5.getters,\n components = _this$props5.components,\n getNow = _this$props5.getNow,\n renderHeader = _this$props5.renderHeader,\n onSelect = _this$props5.onSelect,\n localizer = _this$props5.localizer,\n onSelectStart = _this$props5.onSelectStart,\n onSelectEnd = _this$props5.onSelectEnd,\n onDoubleClick = _this$props5.onDoubleClick,\n onKeyPress = _this$props5.onKeyPress,\n resourceId = _this$props5.resourceId,\n longPressThreshold = _this$props5.longPressThreshold,\n isAllDay = _this$props5.isAllDay,\n resizable = _this$props5.resizable,\n showAllEvents = _this$props5.showAllEvents;\n if (renderForMeasure) return this.renderDummy();\n var metrics = this.slotMetrics(this.props);\n var levels = metrics.levels,\n extra = metrics.extra;\n var ScrollableWeekComponent = showAllEvents ? ScrollableWeekWrapper : NoopWrapper;\n var WeekWrapper = components.weekWrapper;\n var eventRowProps = {\n selected: selected,\n accessors: accessors,\n getters: getters,\n localizer: localizer,\n components: components,\n onSelect: onSelect,\n onDoubleClick: onDoubleClick,\n onKeyPress: onKeyPress,\n resourceId: resourceId,\n slotMetrics: metrics,\n resizable: resizable\n };\n return /*#__PURE__*/React.createElement(\"div\", {\n className: className,\n role: \"rowgroup\",\n ref: this.containerRef\n }, /*#__PURE__*/React.createElement(BackgroundCells, {\n localizer: localizer,\n date: date,\n getNow: getNow,\n rtl: rtl,\n range: range,\n selectable: selectable,\n container: this.getContainer,\n getters: getters,\n onSelectStart: onSelectStart,\n onSelectEnd: onSelectEnd,\n onSelectSlot: this.handleSelectSlot,\n components: components,\n longPressThreshold: longPressThreshold,\n resourceId: resourceId\n }), /*#__PURE__*/React.createElement(\"div\", {\n className: clsx('rbc-row-content', showAllEvents && 'rbc-row-content-scrollable'),\n role: \"row\"\n }, renderHeader && /*#__PURE__*/React.createElement(\"div\", {\n className: \"rbc-row \",\n ref: this.headingRowRef\n }, range.map(this.renderHeadingCell)), /*#__PURE__*/React.createElement(ScrollableWeekComponent, null, /*#__PURE__*/React.createElement(WeekWrapper, Object.assign({\n isAllDay: isAllDay\n }, eventRowProps, {\n rtl: this.props.rtl\n }), levels.map(function (segs, idx) {\n return /*#__PURE__*/React.createElement(EventRow, Object.assign({\n key: idx,\n segments: segs\n }, eventRowProps));\n }), !!extra.length && /*#__PURE__*/React.createElement(EventEndingRow, Object.assign({\n segments: extra,\n onShowMore: this.handleShowMore\n }, eventRowProps))))));\n }\n }]);\n}(React.Component);\nDateContentRow.defaultProps = {\n minRows: 0,\n maxRows: Infinity\n};\n\nvar Header = function Header(_ref) {\n var label = _ref.label;\n return /*#__PURE__*/React.createElement(\"span\", {\n role: \"columnheader\",\n \"aria-sort\": \"none\"\n }, label);\n};\n\nvar DateHeader = function DateHeader(_ref) {\n var label = _ref.label,\n drilldownView = _ref.drilldownView,\n onDrillDown = _ref.onDrillDown;\n if (!drilldownView) {\n return /*#__PURE__*/React.createElement(\"span\", null, label);\n }\n return /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n className: \"rbc-button-link\",\n onClick: onDrillDown,\n role: \"cell\"\n }, label);\n};\n\nvar _excluded$6 = [\"date\", \"className\"];\nvar eventsForWeek = function eventsForWeek(evts, start, end, accessors, localizer) {\n return evts.filter(function (e) {\n return inRange(e, start, end, accessors, localizer);\n });\n};\nvar MonthView = /*#__PURE__*/function (_React$Component) {\n function MonthView() {\n var _this;\n _classCallCheck(this, MonthView);\n for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {\n _args[_key] = arguments[_key];\n }\n _this = _callSuper(this, MonthView, [].concat(_args));\n _this.getContainer = function () {\n return _this.containerRef.current;\n };\n _this.renderWeek = function (week, weekIdx) {\n var _this$props = _this.props,\n events = _this$props.events,\n components = _this$props.components,\n selectable = _this$props.selectable,\n getNow = _this$props.getNow,\n selected = _this$props.selected,\n date = _this$props.date,\n localizer = _this$props.localizer,\n longPressThreshold = _this$props.longPressThreshold,\n accessors = _this$props.accessors,\n getters = _this$props.getters,\n showAllEvents = _this$props.showAllEvents;\n var _this$state = _this.state,\n needLimitMeasure = _this$state.needLimitMeasure,\n rowLimit = _this$state.rowLimit;\n\n // let's not mutate props\n var weeksEvents = eventsForWeek(_toConsumableArray(events), week[0], week[week.length - 1], accessors, localizer);\n var sorted = sortWeekEvents(weeksEvents, accessors, localizer);\n return /*#__PURE__*/React.createElement(DateContentRow, {\n key: weekIdx,\n ref: weekIdx === 0 ? _this.slotRowRef : undefined,\n container: _this.getContainer,\n className: \"rbc-month-row\",\n getNow: getNow,\n date: date,\n range: week,\n events: sorted,\n maxRows: showAllEvents ? Infinity : rowLimit,\n selected: selected,\n selectable: selectable,\n components: components,\n accessors: accessors,\n getters: getters,\n localizer: localizer,\n renderHeader: _this.readerDateHeading,\n renderForMeasure: needLimitMeasure,\n onShowMore: _this.handleShowMore,\n onSelect: _this.handleSelectEvent,\n onDoubleClick: _this.handleDoubleClickEvent,\n onKeyPress: _this.handleKeyPressEvent,\n onSelectSlot: _this.handleSelectSlot,\n longPressThreshold: longPressThreshold,\n rtl: _this.props.rtl,\n resizable: _this.props.resizable,\n showAllEvents: showAllEvents\n });\n };\n _this.readerDateHeading = function (_ref) {\n var date = _ref.date,\n className = _ref.className,\n props = _objectWithoutProperties(_ref, _excluded$6);\n var _this$props2 = _this.props,\n currentDate = _this$props2.date,\n getDrilldownView = _this$props2.getDrilldownView,\n localizer = _this$props2.localizer;\n var isOffRange = localizer.neq(date, currentDate, 'month');\n var isCurrent = localizer.isSameDate(date, currentDate);\n var drilldownView = getDrilldownView(date);\n var label = localizer.format(date, 'dateFormat');\n var DateHeaderComponent = _this.props.components.dateHeader || DateHeader;\n return /*#__PURE__*/React.createElement(\"div\", Object.assign({}, props, {\n className: clsx(className, isOffRange && 'rbc-off-range', isCurrent && 'rbc-current'),\n role: \"cell\"\n }), /*#__PURE__*/React.createElement(DateHeaderComponent, {\n label: label,\n date: date,\n drilldownView: drilldownView,\n isOffRange: isOffRange,\n onDrillDown: function onDrillDown(e) {\n return _this.handleHeadingClick(date, drilldownView, e);\n }\n }));\n };\n _this.handleSelectSlot = function (range, slotInfo) {\n _this._pendingSelection = _this._pendingSelection.concat(range);\n clearTimeout(_this._selectTimer);\n _this._selectTimer = setTimeout(function () {\n return _this.selectDates(slotInfo);\n });\n };\n _this.handleHeadingClick = function (date, view, e) {\n e.preventDefault();\n _this.clearSelection();\n notify(_this.props.onDrillDown, [date, view]);\n };\n _this.handleSelectEvent = function () {\n _this.clearSelection();\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n notify(_this.props.onSelectEvent, args);\n };\n _this.handleDoubleClickEvent = function () {\n _this.clearSelection();\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n notify(_this.props.onDoubleClickEvent, args);\n };\n _this.handleKeyPressEvent = function () {\n _this.clearSelection();\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n notify(_this.props.onKeyPressEvent, args);\n };\n _this.handleShowMore = function (events, date, cell, slot, target) {\n var _this$props3 = _this.props,\n popup = _this$props3.popup,\n onDrillDown = _this$props3.onDrillDown,\n onShowMore = _this$props3.onShowMore,\n getDrilldownView = _this$props3.getDrilldownView,\n doShowMoreDrillDown = _this$props3.doShowMoreDrillDown;\n //cancel any pending selections so only the event click goes through.\n _this.clearSelection();\n if (popup) {\n var position = getPosition$1(cell, _this.containerRef.current);\n _this.setState({\n overlay: {\n date: date,\n events: events,\n position: position,\n target: target\n }\n });\n } else if (doShowMoreDrillDown) {\n notify(onDrillDown, [date, getDrilldownView(date) || views.DAY]);\n }\n notify(onShowMore, [events, date, slot]);\n };\n _this.overlayDisplay = function () {\n _this.setState({\n overlay: null\n });\n };\n _this.state = {\n rowLimit: 5,\n needLimitMeasure: true,\n date: null\n };\n _this.containerRef = /*#__PURE__*/createRef();\n _this.slotRowRef = /*#__PURE__*/createRef();\n _this._bgRows = [];\n _this._pendingSelection = [];\n return _this;\n }\n _inherits(MonthView, _React$Component);\n return _createClass(MonthView, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this;\n var running;\n if (this.state.needLimitMeasure) this.measureRowLimit(this.props);\n window.addEventListener('resize', this._resizeListener = function () {\n if (!running) {\n animationFrame.request(function () {\n running = false;\n _this2.setState({\n needLimitMeasure: true\n }); //eslint-disable-line\n });\n }\n }, false);\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n if (this.state.needLimitMeasure) this.measureRowLimit(this.props);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n window.removeEventListener('resize', this._resizeListener, false);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props4 = this.props,\n date = _this$props4.date,\n localizer = _this$props4.localizer,\n className = _this$props4.className,\n month = localizer.visibleDays(date, localizer),\n weeks = chunk(month, 7);\n this._weekCount = weeks.length;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: clsx('rbc-month-view', className),\n role: \"table\",\n \"aria-label\": \"Month View\",\n ref: this.containerRef\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"rbc-row rbc-month-header\",\n role: \"row\"\n }, this.renderHeaders(weeks[0])), weeks.map(this.renderWeek), this.props.popup && this.renderOverlay());\n }\n }, {\n key: \"renderHeaders\",\n value: function renderHeaders(row) {\n var _this$props5 = this.props,\n localizer = _this$props5.localizer,\n components = _this$props5.components;\n var first = row[0];\n var last = row[row.length - 1];\n var HeaderComponent = components.header || Header;\n return localizer.range(first, last, 'day').map(function (day, idx) {\n return /*#__PURE__*/React.createElement(\"div\", {\n key: 'header_' + idx,\n className: \"rbc-header\"\n }, /*#__PURE__*/React.createElement(HeaderComponent, {\n date: day,\n localizer: localizer,\n label: localizer.format(day, 'weekdayFormat')\n }));\n });\n }\n }, {\n key: \"renderOverlay\",\n value: function renderOverlay() {\n var _this$state$overlay,\n _this$state2,\n _this3 = this;\n var overlay = (_this$state$overlay = (_this$state2 = this.state) === null || _this$state2 === void 0 ? void 0 : _this$state2.overlay) !== null && _this$state$overlay !== void 0 ? _this$state$overlay : {};\n var _this$props6 = this.props,\n accessors = _this$props6.accessors,\n localizer = _this$props6.localizer,\n components = _this$props6.components,\n getters = _this$props6.getters,\n selected = _this$props6.selected,\n popupOffset = _this$props6.popupOffset,\n handleDragStart = _this$props6.handleDragStart;\n var onHide = function onHide() {\n return _this3.setState({\n overlay: null\n });\n };\n return /*#__PURE__*/React.createElement(PopOverlay, {\n overlay: overlay,\n accessors: accessors,\n localizer: localizer,\n components: components,\n getters: getters,\n selected: selected,\n popupOffset: popupOffset,\n ref: this.containerRef,\n handleKeyPressEvent: this.handleKeyPressEvent,\n handleSelectEvent: this.handleSelectEvent,\n handleDoubleClickEvent: this.handleDoubleClickEvent,\n handleDragStart: handleDragStart,\n show: !!overlay.position,\n overlayDisplay: this.overlayDisplay,\n onHide: onHide\n });\n\n /* return (\n this.setState({ overlay: null })}\n target={() => overlay.target}\n >\n {({ props }) => (\n \n )}\n \n ) */\n }\n }, {\n key: \"measureRowLimit\",\n value: function measureRowLimit() {\n this.setState({\n needLimitMeasure: false,\n rowLimit: this.slotRowRef.current.getRowLimit()\n });\n }\n }, {\n key: \"selectDates\",\n value: function selectDates(slotInfo) {\n var slots = this._pendingSelection.slice();\n this._pendingSelection = [];\n slots.sort(function (a, b) {\n return +a - +b;\n });\n var start = new Date(slots[0]);\n var end = new Date(slots[slots.length - 1]);\n end.setDate(slots[slots.length - 1].getDate() + 1);\n notify(this.props.onSelectSlot, {\n slots: slots,\n start: start,\n end: end,\n action: slotInfo.action,\n bounds: slotInfo.bounds,\n box: slotInfo.box\n });\n }\n }, {\n key: \"clearSelection\",\n value: function clearSelection() {\n clearTimeout(this._selectTimer);\n this._pendingSelection = [];\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(_ref2, state) {\n var date = _ref2.date,\n localizer = _ref2.localizer;\n return {\n date: date,\n needLimitMeasure: localizer.neq(date, state.date, 'month')\n };\n }\n }]);\n}(React.Component);\nMonthView.range = function (date, _ref3) {\n var localizer = _ref3.localizer;\n var start = localizer.firstVisibleDay(date, localizer);\n var end = localizer.lastVisibleDay(date, localizer);\n return {\n start: start,\n end: end\n };\n};\nMonthView.navigate = function (date, action, _ref4) {\n var localizer = _ref4.localizer;\n switch (action) {\n case navigate.PREVIOUS:\n return localizer.add(date, -1, 'month');\n case navigate.NEXT:\n return localizer.add(date, 1, 'month');\n default:\n return date;\n }\n};\nMonthView.title = function (date, _ref5) {\n var localizer = _ref5.localizer;\n return localizer.format(date, 'monthHeaderFormat');\n};\n\nvar getKey = function getKey(_ref) {\n var min = _ref.min,\n max = _ref.max,\n step = _ref.step,\n slots = _ref.slots,\n localizer = _ref.localizer;\n return \"\".concat(+localizer.startOf(min, 'minutes')) + \"\".concat(+localizer.startOf(max, 'minutes')) + \"\".concat(step, \"-\").concat(slots);\n};\nfunction getSlotMetrics(_ref2) {\n var start = _ref2.min,\n end = _ref2.max,\n step = _ref2.step,\n timeslots = _ref2.timeslots,\n localizer = _ref2.localizer;\n var key = getKey({\n start: start,\n end: end,\n step: step,\n timeslots: timeslots,\n localizer: localizer\n });\n\n // DST differences are handled inside the localizer\n var totalMin = 1 + localizer.getTotalMin(start, end);\n var minutesFromMidnight = localizer.getMinutesFromMidnight(start);\n var numGroups = Math.ceil((totalMin - 1) / (step * timeslots));\n var numSlots = numGroups * timeslots;\n var groups = new Array(numGroups);\n var slots = new Array(numSlots);\n // Each slot date is created from \"zero\", instead of adding `step` to\n // the previous one, in order to avoid DST oddities\n for (var grp = 0; grp < numGroups; grp++) {\n groups[grp] = new Array(timeslots);\n for (var slot = 0; slot < timeslots; slot++) {\n var slotIdx = grp * timeslots + slot;\n var minFromStart = slotIdx * step;\n // A date with total minutes calculated from the start of the day\n slots[slotIdx] = groups[grp][slot] = localizer.getSlotDate(start, minutesFromMidnight, minFromStart);\n }\n }\n\n // Necessary to be able to select up until the last timeslot in a day\n var lastSlotMinFromStart = slots.length * step;\n slots.push(localizer.getSlotDate(start, minutesFromMidnight, lastSlotMinFromStart));\n function positionFromDate(date) {\n var diff = localizer.diff(start, date, 'minutes') + localizer.getDstOffset(start, date);\n return Math.min(diff, totalMin);\n }\n return {\n groups: groups,\n update: function update(args) {\n if (getKey(args) !== key) return getSlotMetrics(args);\n return this;\n },\n dateIsInGroup: function dateIsInGroup(date, groupIndex) {\n var nextGroup = groups[groupIndex + 1];\n return localizer.inRange(date, groups[groupIndex][0], nextGroup ? nextGroup[0] : end, 'minutes');\n },\n nextSlot: function nextSlot(slot) {\n // We cannot guarantee that the slot object must be in slots,\n // because after each update, a new slots array will be created.\n var next = slots[Math.min(slots.findIndex(function (s) {\n return s === slot || localizer.eq(s, slot);\n }) + 1, slots.length - 1)];\n // in the case of the last slot we won't a long enough range so manually get it\n if (localizer.eq(next, slot)) next = localizer.add(slot, step, 'minutes');\n return next;\n },\n closestSlotToPosition: function closestSlotToPosition(percent) {\n var slot = Math.min(slots.length - 1, Math.max(0, Math.floor(percent * numSlots)));\n return slots[slot];\n },\n closestSlotFromPoint: function closestSlotFromPoint(point, boundaryRect) {\n var range = Math.abs(boundaryRect.top - boundaryRect.bottom);\n return this.closestSlotToPosition((point.y - boundaryRect.top) / range);\n },\n closestSlotFromDate: function closestSlotFromDate(date) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n if (localizer.lt(date, start, 'minutes')) return slots[0];\n if (localizer.gt(date, end, 'minutes')) return slots[slots.length - 1];\n var diffMins = localizer.diff(start, date, 'minutes');\n return slots[(diffMins - diffMins % step) / step + offset];\n },\n startsBeforeDay: function startsBeforeDay(date) {\n return localizer.lt(date, start, 'day');\n },\n startsAfterDay: function startsAfterDay(date) {\n return localizer.gt(date, end, 'day');\n },\n startsBefore: function startsBefore(date) {\n return localizer.lt(localizer.merge(start, date), start, 'minutes');\n },\n startsAfter: function startsAfter(date) {\n return localizer.gt(localizer.merge(end, date), end, 'minutes');\n },\n getRange: function getRange(rangeStart, rangeEnd, ignoreMin, ignoreMax) {\n if (!ignoreMin) rangeStart = localizer.min(end, localizer.max(start, rangeStart));\n if (!ignoreMax) rangeEnd = localizer.min(end, localizer.max(start, rangeEnd));\n var rangeStartMin = positionFromDate(rangeStart);\n var rangeEndMin = positionFromDate(rangeEnd);\n var top = rangeEndMin > step * numSlots && !localizer.eq(end, rangeEnd) ? (rangeStartMin - step) / (step * numSlots) * 100 : rangeStartMin / (step * numSlots) * 100;\n return {\n top: top,\n height: rangeEndMin / (step * numSlots) * 100 - top,\n start: positionFromDate(rangeStart),\n startDate: rangeStart,\n end: positionFromDate(rangeEnd),\n endDate: rangeEnd\n };\n },\n getCurrentTimePosition: function getCurrentTimePosition(rangeStart) {\n var rangeStartMin = positionFromDate(rangeStart);\n var top = rangeStartMin / (step * numSlots) * 100;\n return top;\n }\n };\n}\n\nvar Event = /*#__PURE__*/function () {\n function Event(data, _ref) {\n var accessors = _ref.accessors,\n slotMetrics = _ref.slotMetrics;\n _classCallCheck(this, Event);\n var _slotMetrics$getRange = slotMetrics.getRange(accessors.start(data), accessors.end(data)),\n start = _slotMetrics$getRange.start,\n startDate = _slotMetrics$getRange.startDate,\n end = _slotMetrics$getRange.end,\n endDate = _slotMetrics$getRange.endDate,\n top = _slotMetrics$getRange.top,\n height = _slotMetrics$getRange.height;\n this.start = start;\n this.end = end;\n this.startMs = +startDate;\n this.endMs = +endDate;\n this.top = top;\n this.height = height;\n this.data = data;\n }\n\n /**\n * The event's width without any overlap.\n */\n return _createClass(Event, [{\n key: \"_width\",\n get: function get() {\n // The container event's width is determined by the maximum number of\n // events in any of its rows.\n if (this.rows) {\n var columns = this.rows.reduce(function (max, row) {\n return Math.max(max, row.leaves.length + 1);\n },\n // add itself\n 0) + 1; // add the container\n\n return 100 / columns;\n }\n\n // The row event's width is the space left by the container, divided\n // among itself and its leaves.\n if (this.leaves) {\n var availableWidth = 100 - this.container._width;\n return availableWidth / (this.leaves.length + 1);\n }\n\n // The leaf event's width is determined by its row's width\n return this.row._width;\n }\n\n /**\n * The event's calculated width, possibly with extra width added for\n * overlapping effect.\n */\n }, {\n key: \"width\",\n get: function get() {\n var noOverlap = this._width;\n var overlap = Math.min(100, this._width * 1.7);\n\n // Containers can always grow.\n if (this.rows) {\n return overlap;\n }\n\n // Rows can grow if they have leaves.\n if (this.leaves) {\n return this.leaves.length > 0 ? overlap : noOverlap;\n }\n\n // Leaves can grow unless they're the last item in a row.\n var leaves = this.row.leaves;\n var index = leaves.indexOf(this);\n return index === leaves.length - 1 ? noOverlap : overlap;\n }\n }, {\n key: \"xOffset\",\n get: function get() {\n // Containers have no offset.\n if (this.rows) return 0;\n\n // Rows always start where their container ends.\n if (this.leaves) return this.container._width;\n\n // Leaves are spread out evenly on the space left by its row.\n var _this$row = this.row,\n leaves = _this$row.leaves,\n xOffset = _this$row.xOffset,\n _width = _this$row._width;\n var index = leaves.indexOf(this) + 1;\n return xOffset + index * _width;\n }\n }]);\n}();\n/**\n * Return true if event a and b is considered to be on the same row.\n */\nfunction onSameRow(a, b, minimumStartDifference) {\n return (\n // Occupies the same start slot.\n Math.abs(b.start - a.start) < minimumStartDifference ||\n // A's start slot overlaps with b's end slot.\n b.start > a.start && b.start < a.end\n );\n}\nfunction sortByRender(events) {\n var sortedByTime = sortBy(events, ['startMs', function (e) {\n return -e.endMs;\n }]);\n var sorted = [];\n while (sortedByTime.length > 0) {\n var event = sortedByTime.shift();\n sorted.push(event);\n for (var i = 0; i < sortedByTime.length; i++) {\n var test = sortedByTime[i];\n\n // Still inside this event, look for next.\n if (event.endMs > test.startMs) continue;\n\n // We've found the first event of the next event group.\n // If that event is not right next to our current event, we have to\n // move it here.\n if (i > 0) {\n var _event = sortedByTime.splice(i, 1)[0];\n sorted.push(_event);\n }\n\n // We've already found the next event group, so stop looking.\n break;\n }\n }\n return sorted;\n}\nfunction getStyledEvents$1(_ref2) {\n var events = _ref2.events,\n minimumStartDifference = _ref2.minimumStartDifference,\n slotMetrics = _ref2.slotMetrics,\n accessors = _ref2.accessors;\n // Create proxy events and order them so that we don't have\n // to fiddle with z-indexes.\n var proxies = events.map(function (event) {\n return new Event(event, {\n slotMetrics: slotMetrics,\n accessors: accessors\n });\n });\n var eventsInRenderOrder = sortByRender(proxies);\n\n // Group overlapping events, while keeping order.\n // Every event is always one of: container, row or leaf.\n // Containers can contain rows, and rows can contain leaves.\n var containerEvents = [];\n var _loop = function _loop() {\n var event = eventsInRenderOrder[i];\n\n // Check if this event can go into a container event.\n var container = containerEvents.find(function (c) {\n return c.end > event.start || Math.abs(event.start - c.start) < minimumStartDifference;\n });\n\n // Couldn't find a container — that means this event is a container.\n if (!container) {\n event.rows = [];\n containerEvents.push(event);\n return 1; // continue\n }\n\n // Found a container for the event.\n event.container = container;\n\n // Check if the event can be placed in an existing row.\n // Start looking from behind.\n var row = null;\n for (var j = container.rows.length - 1; !row && j >= 0; j--) {\n if (onSameRow(container.rows[j], event, minimumStartDifference)) {\n row = container.rows[j];\n }\n }\n if (row) {\n // Found a row, so add it.\n row.leaves.push(event);\n event.row = row;\n } else {\n // Couldn't find a row – that means this event is a row.\n event.leaves = [];\n container.rows.push(event);\n }\n };\n for (var i = 0; i < eventsInRenderOrder.length; i++) {\n if (_loop()) continue;\n }\n\n // Return the original events, along with their styles.\n return eventsInRenderOrder.map(function (event) {\n return {\n event: event.data,\n style: {\n top: event.top,\n height: event.height,\n width: event.width,\n xOffset: Math.max(0, event.xOffset)\n }\n };\n });\n}\n\nfunction getMaxIdxDFS(node, maxIdx, visited) {\n for (var i = 0; i < node.friends.length; ++i) {\n if (visited.indexOf(node.friends[i]) > -1) continue;\n maxIdx = maxIdx > node.friends[i].idx ? maxIdx : node.friends[i].idx;\n // TODO : trace it by not object but kinda index or something for performance\n visited.push(node.friends[i]);\n var newIdx = getMaxIdxDFS(node.friends[i], maxIdx, visited);\n maxIdx = maxIdx > newIdx ? maxIdx : newIdx;\n }\n return maxIdx;\n}\nfunction noOverlap (_ref) {\n var events = _ref.events,\n minimumStartDifference = _ref.minimumStartDifference,\n slotMetrics = _ref.slotMetrics,\n accessors = _ref.accessors;\n var styledEvents = getStyledEvents$1({\n events: events,\n minimumStartDifference: minimumStartDifference,\n slotMetrics: slotMetrics,\n accessors: accessors\n });\n styledEvents.sort(function (a, b) {\n a = a.style;\n b = b.style;\n if (a.top !== b.top) return a.top > b.top ? 1 : -1;else if (a.height !== b.height) return a.top + a.height < b.top + b.height ? 1 : -1;else return 0;\n });\n for (var i = 0; i < styledEvents.length; ++i) {\n styledEvents[i].friends = [];\n delete styledEvents[i].style.left;\n delete styledEvents[i].style.left;\n delete styledEvents[i].idx;\n delete styledEvents[i].size;\n }\n for (var _i2 = 0; _i2 < styledEvents.length - 1; ++_i2) {\n var se1 = styledEvents[_i2];\n var y1 = se1.style.top;\n var y2 = se1.style.top + se1.style.height;\n for (var j = _i2 + 1; j < styledEvents.length; ++j) {\n var se2 = styledEvents[j];\n var y3 = se2.style.top;\n var y4 = se2.style.top + se2.style.height;\n if (y3 >= y1 && y4 <= y2 || y4 > y1 && y4 <= y2 || y3 >= y1 && y3 < y2) {\n // TODO : hashmap would be effective for performance\n se1.friends.push(se2);\n se2.friends.push(se1);\n }\n }\n }\n for (var _i4 = 0; _i4 < styledEvents.length; ++_i4) {\n var se = styledEvents[_i4];\n var bitmap = [];\n for (var _j2 = 0; _j2 < 100; ++_j2) bitmap.push(1); // 1 means available\n\n for (var _j4 = 0; _j4 < se.friends.length; ++_j4) if (se.friends[_j4].idx !== undefined) bitmap[se.friends[_j4].idx] = 0; // 0 means reserved\n\n se.idx = bitmap.indexOf(1);\n }\n for (var _i6 = 0; _i6 < styledEvents.length; ++_i6) {\n var size = 0;\n if (styledEvents[_i6].size) continue;\n var allFriends = [];\n var maxIdx = getMaxIdxDFS(styledEvents[_i6], 0, allFriends);\n size = 100 / (maxIdx + 1);\n styledEvents[_i6].size = size;\n for (var _j6 = 0; _j6 < allFriends.length; ++_j6) allFriends[_j6].size = size;\n }\n for (var _i8 = 0; _i8 < styledEvents.length; ++_i8) {\n var e = styledEvents[_i8];\n e.style.left = e.idx * e.size;\n\n // stretch to maximum\n var _maxIdx = 0;\n for (var _j8 = 0; _j8 < e.friends.length; ++_j8) {\n var idx = e.friends[_j8].idx;\n _maxIdx = _maxIdx > idx ? _maxIdx : idx;\n }\n if (_maxIdx <= e.idx) e.size = 100 - e.idx * e.size;\n\n // padding between events\n // for this feature, `width` is not percentage based unit anymore\n // it will be used with calc()\n var padding = e.idx === 0 ? 0 : 3;\n e.style.width = \"calc(\".concat(e.size, \"% - \").concat(padding, \"px)\");\n e.style.height = \"calc(\".concat(e.style.height, \"% - 2px)\");\n e.style.xOffset = \"calc(\".concat(e.style.left, \"% + \").concat(padding, \"px)\");\n }\n return styledEvents;\n}\n\n/*eslint no-unused-vars: \"off\"*/\n\nvar DefaultAlgorithms = {\n overlap: getStyledEvents$1,\n 'no-overlap': noOverlap\n};\nfunction isFunction(a) {\n return !!(a && a.constructor && a.call && a.apply);\n}\n\n//\nfunction getStyledEvents(_ref) {\n _ref.events;\n _ref.minimumStartDifference;\n _ref.slotMetrics;\n _ref.accessors;\n var dayLayoutAlgorithm = _ref.dayLayoutAlgorithm;\n var algorithm = dayLayoutAlgorithm;\n if (dayLayoutAlgorithm in DefaultAlgorithms) algorithm = DefaultAlgorithms[dayLayoutAlgorithm];\n if (!isFunction(algorithm)) {\n // invalid algorithm\n return [];\n }\n return algorithm.apply(this, arguments);\n}\n\nvar TimeSlotGroup = /*#__PURE__*/function (_Component) {\n function TimeSlotGroup() {\n _classCallCheck(this, TimeSlotGroup);\n return _callSuper(this, TimeSlotGroup, arguments);\n }\n _inherits(TimeSlotGroup, _Component);\n return _createClass(TimeSlotGroup, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n renderSlot = _this$props.renderSlot,\n resource = _this$props.resource,\n group = _this$props.group,\n getters = _this$props.getters,\n _this$props$component = _this$props.components,\n _this$props$component2 = _this$props$component === void 0 ? {} : _this$props$component,\n _this$props$component3 = _this$props$component2.timeSlotWrapper,\n Wrapper = _this$props$component3 === void 0 ? NoopWrapper : _this$props$component3;\n var groupProps = getters ? getters.slotGroupProp(group) : {};\n return /*#__PURE__*/React.createElement(\"div\", Object.assign({\n className: \"rbc-timeslot-group\"\n }, groupProps), group.map(function (value, idx) {\n var slotProps = getters ? getters.slotProp(value, resource) : {};\n return /*#__PURE__*/React.createElement(Wrapper, {\n key: idx,\n value: value,\n resource: resource\n }, /*#__PURE__*/React.createElement(\"div\", Object.assign({}, slotProps, {\n className: clsx('rbc-time-slot', slotProps.className)\n }), renderSlot && renderSlot(value, idx)));\n }));\n }\n }]);\n}(Component);\n\nfunction stringifyPercent(v) {\n return typeof v === 'string' ? v : v + '%';\n}\n\n/* eslint-disable react/prop-types */\nfunction TimeGridEvent(props) {\n var style = props.style,\n className = props.className,\n event = props.event,\n accessors = props.accessors,\n rtl = props.rtl,\n selected = props.selected,\n label = props.label,\n continuesPrior = props.continuesPrior,\n continuesAfter = props.continuesAfter,\n getters = props.getters,\n onClick = props.onClick,\n onDoubleClick = props.onDoubleClick,\n isBackgroundEvent = props.isBackgroundEvent,\n onKeyPress = props.onKeyPress,\n _props$components = props.components,\n Event = _props$components.event,\n EventWrapper = _props$components.eventWrapper;\n var title = accessors.title(event);\n var tooltip = accessors.tooltip(event);\n var end = accessors.end(event);\n var start = accessors.start(event);\n var userProps = getters.eventProp(event, start, end, selected);\n var inner = [/*#__PURE__*/React.createElement(\"div\", {\n key: \"1\",\n className: \"rbc-event-label\"\n }, label), /*#__PURE__*/React.createElement(\"div\", {\n key: \"2\",\n className: \"rbc-event-content\"\n }, Event ? /*#__PURE__*/React.createElement(Event, {\n event: event,\n title: title\n }) : title)];\n var height = style.height,\n top = style.top,\n width = style.width,\n xOffset = style.xOffset;\n var eventStyle = _objectSpread(_objectSpread({}, userProps.style), {}, _defineProperty({\n top: stringifyPercent(top),\n height: stringifyPercent(height),\n width: stringifyPercent(width)\n }, rtl ? 'right' : 'left', stringifyPercent(xOffset)));\n return /*#__PURE__*/React.createElement(EventWrapper, Object.assign({\n type: \"time\"\n }, props), /*#__PURE__*/React.createElement(\"div\", {\n role: \"button\",\n tabIndex: 0,\n onClick: onClick,\n onDoubleClick: onDoubleClick,\n style: eventStyle,\n onKeyDown: onKeyPress,\n title: tooltip ? (typeof label === 'string' ? label + ': ' : '') + tooltip : undefined,\n className: clsx(isBackgroundEvent ? 'rbc-background-event' : 'rbc-event', className, userProps.className, {\n 'rbc-selected': selected,\n 'rbc-event-continues-earlier': continuesPrior,\n 'rbc-event-continues-later': continuesAfter\n })\n }, inner));\n}\n\nvar DayColumnWrapper = function DayColumnWrapper(_ref) {\n var children = _ref.children,\n className = _ref.className,\n style = _ref.style,\n innerRef = _ref.innerRef;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: className,\n style: style,\n ref: innerRef\n }, children);\n};\nvar DayColumnWrapper$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(DayColumnWrapper, Object.assign({}, props, {\n innerRef: ref\n }));\n});\n\nvar _excluded$5 = [\"dayProp\"],\n _excluded2$1 = [\"eventContainerWrapper\"];\nvar DayColumn = /*#__PURE__*/function (_React$Component) {\n function DayColumn() {\n var _this;\n _classCallCheck(this, DayColumn);\n for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {\n _args[_key] = arguments[_key];\n }\n _this = _callSuper(this, DayColumn, [].concat(_args));\n _this.state = {\n selecting: false,\n timeIndicatorPosition: null\n };\n _this.intervalTriggered = false;\n _this.renderEvents = function (_ref) {\n var events = _ref.events,\n isBackgroundEvent = _ref.isBackgroundEvent;\n var _this$props = _this.props,\n rtl = _this$props.rtl,\n selected = _this$props.selected,\n accessors = _this$props.accessors,\n localizer = _this$props.localizer,\n getters = _this$props.getters,\n components = _this$props.components,\n step = _this$props.step,\n timeslots = _this$props.timeslots,\n dayLayoutAlgorithm = _this$props.dayLayoutAlgorithm,\n resizable = _this$props.resizable;\n var _this2 = _this,\n slotMetrics = _this2.slotMetrics;\n var messages = localizer.messages;\n var styledEvents = getStyledEvents({\n events: events,\n accessors: accessors,\n slotMetrics: slotMetrics,\n minimumStartDifference: Math.ceil(step * timeslots / 2),\n dayLayoutAlgorithm: dayLayoutAlgorithm\n });\n return styledEvents.map(function (_ref2, idx) {\n var event = _ref2.event,\n style = _ref2.style;\n var end = accessors.end(event);\n var start = accessors.start(event);\n var format = 'eventTimeRangeFormat';\n var label;\n var startsBeforeDay = slotMetrics.startsBeforeDay(start);\n var startsAfterDay = slotMetrics.startsAfterDay(end);\n if (startsBeforeDay) format = 'eventTimeRangeEndFormat';else if (startsAfterDay) format = 'eventTimeRangeStartFormat';\n if (startsBeforeDay && startsAfterDay) label = messages.allDay;else label = localizer.format({\n start: start,\n end: end\n }, format);\n var continuesPrior = startsBeforeDay || slotMetrics.startsBefore(start);\n var continuesAfter = startsAfterDay || slotMetrics.startsAfter(end);\n return /*#__PURE__*/React.createElement(TimeGridEvent, {\n style: style,\n event: event,\n label: label,\n key: 'evt_' + idx,\n getters: getters,\n rtl: rtl,\n components: components,\n continuesPrior: continuesPrior,\n continuesAfter: continuesAfter,\n accessors: accessors,\n resource: _this.props.resource,\n selected: isSelected(event, selected),\n onClick: function onClick(e) {\n return _this._select(_objectSpread(_objectSpread(_objectSpread({}, event), _this.props.resource && {\n sourceResource: _this.props.resource\n }), isBackgroundEvent && {\n isBackgroundEvent: true\n }), e);\n },\n onDoubleClick: function onDoubleClick(e) {\n return _this._doubleClick(event, e);\n },\n isBackgroundEvent: isBackgroundEvent,\n onKeyPress: function onKeyPress(e) {\n return _this._keyPress(event, e);\n },\n resizable: resizable\n });\n });\n };\n _this._selectable = function () {\n var node = _this.containerRef.current;\n var _this$props2 = _this.props,\n longPressThreshold = _this$props2.longPressThreshold,\n localizer = _this$props2.localizer;\n var selector = _this._selector = new Selection(function () {\n return node;\n }, {\n longPressThreshold: longPressThreshold\n });\n var maybeSelect = function maybeSelect(box) {\n var onSelecting = _this.props.onSelecting;\n var current = _this.state || {};\n var state = selectionState(box);\n var start = state.startDate,\n end = state.endDate;\n if (onSelecting) {\n if (localizer.eq(current.startDate, start, 'minutes') && localizer.eq(current.endDate, end, 'minutes') || onSelecting({\n start: start,\n end: end,\n resourceId: _this.props.resource\n }) === false) return;\n }\n if (_this.state.start !== state.start || _this.state.end !== state.end || _this.state.selecting !== state.selecting) {\n _this.setState(state);\n }\n };\n var selectionState = function selectionState(point) {\n var currentSlot = _this.slotMetrics.closestSlotFromPoint(point, getBoundsForNode(node));\n if (!_this.state.selecting) {\n _this._initialSlot = currentSlot;\n }\n var initialSlot = _this._initialSlot;\n if (localizer.lte(initialSlot, currentSlot)) {\n currentSlot = _this.slotMetrics.nextSlot(currentSlot);\n } else if (localizer.gt(initialSlot, currentSlot)) {\n initialSlot = _this.slotMetrics.nextSlot(initialSlot);\n }\n var selectRange = _this.slotMetrics.getRange(localizer.min(initialSlot, currentSlot), localizer.max(initialSlot, currentSlot));\n return _objectSpread(_objectSpread({}, selectRange), {}, {\n selecting: true,\n top: \"\".concat(selectRange.top, \"%\"),\n height: \"\".concat(selectRange.height, \"%\")\n });\n };\n var selectorClicksHandler = function selectorClicksHandler(box, actionType) {\n if (!isEvent(_this.containerRef.current, box)) {\n var _selectionState = selectionState(box),\n startDate = _selectionState.startDate,\n endDate = _selectionState.endDate;\n _this._selectSlot({\n startDate: startDate,\n endDate: endDate,\n action: actionType,\n box: box\n });\n }\n _this.setState({\n selecting: false\n });\n };\n selector.on('selecting', maybeSelect);\n selector.on('selectStart', maybeSelect);\n selector.on('beforeSelect', function (box) {\n if (_this.props.selectable !== 'ignoreEvents') return;\n return !isEvent(_this.containerRef.current, box);\n });\n selector.on('click', function (box) {\n return selectorClicksHandler(box, 'click');\n });\n selector.on('doubleClick', function (box) {\n return selectorClicksHandler(box, 'doubleClick');\n });\n selector.on('select', function (bounds) {\n if (_this.state.selecting) {\n _this._selectSlot(_objectSpread(_objectSpread({}, _this.state), {}, {\n action: 'select',\n bounds: bounds\n }));\n _this.setState({\n selecting: false\n });\n }\n });\n selector.on('reset', function () {\n if (_this.state.selecting) {\n _this.setState({\n selecting: false\n });\n }\n });\n };\n _this._teardownSelectable = function () {\n if (!_this._selector) return;\n _this._selector.teardown();\n _this._selector = null;\n };\n _this._selectSlot = function (_ref3) {\n var startDate = _ref3.startDate,\n endDate = _ref3.endDate,\n action = _ref3.action,\n bounds = _ref3.bounds,\n box = _ref3.box;\n var current = startDate,\n slots = [];\n while (_this.props.localizer.lte(current, endDate)) {\n slots.push(current);\n current = new Date(+current + _this.props.step * 60 * 1000); // using Date ensures not to create an endless loop the day DST begins\n }\n notify(_this.props.onSelectSlot, {\n slots: slots,\n start: startDate,\n end: endDate,\n resourceId: _this.props.resource,\n action: action,\n bounds: bounds,\n box: box\n });\n };\n _this._select = function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n notify(_this.props.onSelectEvent, args);\n };\n _this._doubleClick = function () {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n notify(_this.props.onDoubleClickEvent, args);\n };\n _this._keyPress = function () {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n notify(_this.props.onKeyPressEvent, args);\n };\n _this.slotMetrics = getSlotMetrics(_this.props);\n _this.containerRef = /*#__PURE__*/createRef();\n return _this;\n }\n _inherits(DayColumn, _React$Component);\n return _createClass(DayColumn, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.props.selectable && this._selectable();\n if (this.props.isNow) {\n this.setTimeIndicatorPositionUpdateInterval();\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this._teardownSelectable();\n this.clearTimeIndicatorInterval();\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, prevState) {\n if (this.props.selectable && !prevProps.selectable) this._selectable();\n if (!this.props.selectable && prevProps.selectable) this._teardownSelectable();\n var _this$props3 = this.props,\n getNow = _this$props3.getNow,\n isNow = _this$props3.isNow,\n localizer = _this$props3.localizer,\n date = _this$props3.date,\n min = _this$props3.min,\n max = _this$props3.max;\n var getNowChanged = localizer.neq(prevProps.getNow(), getNow(), 'minutes');\n if (prevProps.isNow !== isNow || getNowChanged) {\n this.clearTimeIndicatorInterval();\n if (isNow) {\n var tail = !getNowChanged && localizer.eq(prevProps.date, date, 'minutes') && prevState.timeIndicatorPosition === this.state.timeIndicatorPosition;\n this.setTimeIndicatorPositionUpdateInterval(tail);\n }\n } else if (isNow && (localizer.neq(prevProps.min, min, 'minutes') || localizer.neq(prevProps.max, max, 'minutes'))) {\n this.positionTimeIndicator();\n }\n }\n\n /**\n * @param tail {Boolean} - whether `positionTimeIndicator` call should be\n * deferred or called upon setting interval (`true` - if deferred);\n */\n }, {\n key: \"setTimeIndicatorPositionUpdateInterval\",\n value: function setTimeIndicatorPositionUpdateInterval() {\n var _this3 = this;\n var tail = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n if (!this.intervalTriggered && !tail) {\n this.positionTimeIndicator();\n }\n this._timeIndicatorTimeout = window.setTimeout(function () {\n _this3.intervalTriggered = true;\n _this3.positionTimeIndicator();\n _this3.setTimeIndicatorPositionUpdateInterval();\n }, 60000);\n }\n }, {\n key: \"clearTimeIndicatorInterval\",\n value: function clearTimeIndicatorInterval() {\n this.intervalTriggered = false;\n window.clearTimeout(this._timeIndicatorTimeout);\n }\n }, {\n key: \"positionTimeIndicator\",\n value: function positionTimeIndicator() {\n var _this$props4 = this.props,\n min = _this$props4.min,\n max = _this$props4.max,\n getNow = _this$props4.getNow;\n var current = getNow();\n if (current >= min && current <= max) {\n var top = this.slotMetrics.getCurrentTimePosition(current);\n this.intervalTriggered = true;\n this.setState({\n timeIndicatorPosition: top\n });\n } else {\n this.clearTimeIndicatorInterval();\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props5 = this.props,\n date = _this$props5.date,\n max = _this$props5.max,\n rtl = _this$props5.rtl,\n isNow = _this$props5.isNow,\n resource = _this$props5.resource,\n accessors = _this$props5.accessors,\n localizer = _this$props5.localizer,\n _this$props5$getters = _this$props5.getters,\n dayProp = _this$props5$getters.dayProp,\n getters = _objectWithoutProperties(_this$props5$getters, _excluded$5),\n _this$props5$componen = _this$props5.components,\n EventContainer = _this$props5$componen.eventContainerWrapper,\n components = _objectWithoutProperties(_this$props5$componen, _excluded2$1);\n this.slotMetrics = this.slotMetrics.update(this.props);\n var slotMetrics = this.slotMetrics;\n var _this$state = this.state,\n selecting = _this$state.selecting,\n top = _this$state.top,\n height = _this$state.height,\n startDate = _this$state.startDate,\n endDate = _this$state.endDate;\n var selectDates = {\n start: startDate,\n end: endDate\n };\n var _dayProp = dayProp(max, resource),\n className = _dayProp.className,\n style = _dayProp.style;\n var DayColumnWrapperComponent = components.dayColumnWrapper || DayColumnWrapper$1;\n return /*#__PURE__*/React.createElement(DayColumnWrapperComponent, {\n ref: this.containerRef,\n date: date,\n style: style,\n className: clsx(className, 'rbc-day-slot', 'rbc-time-column', isNow && 'rbc-now', isNow && 'rbc-today',\n // WHY\n selecting && 'rbc-slot-selecting'),\n slotMetrics: slotMetrics,\n resource: resource\n }, slotMetrics.groups.map(function (grp, idx) {\n return /*#__PURE__*/React.createElement(TimeSlotGroup, {\n key: idx,\n group: grp,\n resource: resource,\n getters: getters,\n components: components\n });\n }), /*#__PURE__*/React.createElement(EventContainer, {\n localizer: localizer,\n resource: resource,\n accessors: accessors,\n getters: getters,\n components: components,\n slotMetrics: slotMetrics\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: clsx('rbc-events-container', rtl && 'rtl')\n }, this.renderEvents({\n events: this.props.backgroundEvents,\n isBackgroundEvent: true\n }), this.renderEvents({\n events: this.props.events\n }))), selecting && /*#__PURE__*/React.createElement(\"div\", {\n className: \"rbc-slot-selection\",\n style: {\n top: top,\n height: height\n }\n }, /*#__PURE__*/React.createElement(\"span\", null, localizer.format(selectDates, 'selectRangeFormat'))), isNow && this.intervalTriggered && /*#__PURE__*/React.createElement(\"div\", {\n className: \"rbc-current-time-indicator\",\n style: {\n top: \"\".concat(this.state.timeIndicatorPosition, \"%\")\n }\n }));\n }\n }]);\n}(React.Component);\nDayColumn.defaultProps = {\n dragThroughEvents: true,\n timeslots: 2\n};\n\n/**\n * Since the TimeGutter only displays the 'times' of slots in a day, and is separate\n * from the Day Columns themselves, we check to see if the range contains an offset difference\n * and, if so, change the beginning and end 'date' by a day to properly display the slots times\n * used.\n */\nfunction adjustForDST(_ref) {\n var min = _ref.min,\n max = _ref.max,\n localizer = _ref.localizer;\n if (localizer.getTimezoneOffset(min) !== localizer.getTimezoneOffset(max)) {\n return {\n start: localizer.add(min, -1, 'day'),\n end: localizer.add(max, -1, 'day')\n };\n }\n return {\n start: min,\n end: max\n };\n}\nvar TimeGutter = function TimeGutter(_ref2) {\n var min = _ref2.min,\n max = _ref2.max,\n timeslots = _ref2.timeslots,\n step = _ref2.step,\n localizer = _ref2.localizer,\n getNow = _ref2.getNow,\n resource = _ref2.resource,\n components = _ref2.components,\n getters = _ref2.getters,\n gutterRef = _ref2.gutterRef;\n var TimeGutterWrapper = components.timeGutterWrapper;\n var _useMemo = useMemo(function () {\n return adjustForDST({\n min: min,\n max: max,\n localizer: localizer\n });\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [min === null || min === void 0 ? void 0 : min.toISOString(), max === null || max === void 0 ? void 0 : max.toISOString(), localizer]),\n start = _useMemo.start,\n end = _useMemo.end;\n var _useState = useState(getSlotMetrics({\n min: start,\n max: end,\n timeslots: timeslots,\n step: step,\n localizer: localizer\n })),\n _useState2 = _slicedToArray(_useState, 2),\n slotMetrics = _useState2[0],\n setSlotMetrics = _useState2[1];\n useEffect(function () {\n if (slotMetrics) {\n setSlotMetrics(slotMetrics.update({\n min: start,\n max: end,\n timeslots: timeslots,\n step: step,\n localizer: localizer\n }));\n }\n /**\n * We don't want this to fire when slotMetrics is updated as it would recursively bomb\n */\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [start === null || start === void 0 ? void 0 : start.toISOString(), end === null || end === void 0 ? void 0 : end.toISOString(), timeslots, step]);\n var renderSlot = useCallback(function (value, idx) {\n if (idx) return null; // don't return the first (0) idx\n\n var isNow = slotMetrics.dateIsInGroup(getNow(), idx);\n return /*#__PURE__*/React.createElement(\"span\", {\n className: clsx('rbc-label', isNow && 'rbc-now')\n }, localizer.format(value, 'timeGutterFormat'));\n }, [slotMetrics, localizer, getNow]);\n return /*#__PURE__*/React.createElement(TimeGutterWrapper, {\n slotMetrics: slotMetrics\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"rbc-time-gutter rbc-time-column\",\n ref: gutterRef\n }, slotMetrics.groups.map(function (grp, idx) {\n return /*#__PURE__*/React.createElement(TimeSlotGroup, {\n key: idx,\n group: grp,\n resource: resource,\n components: components,\n renderSlot: renderSlot,\n getters: getters\n });\n })));\n};\nvar TimeGutter$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(TimeGutter, Object.assign({\n gutterRef: ref\n }, props));\n});\n\nvar ResourceHeader = function ResourceHeader(_ref) {\n var label = _ref.label;\n return /*#__PURE__*/React.createElement(React.Fragment, null, label);\n};\n\nvar TimeGridHeader = /*#__PURE__*/function (_React$Component) {\n function TimeGridHeader() {\n var _this;\n _classCallCheck(this, TimeGridHeader);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _callSuper(this, TimeGridHeader, [].concat(args));\n _this.handleHeaderClick = function (date, view, e) {\n e.preventDefault();\n notify(_this.props.onDrillDown, [date, view]);\n };\n _this.renderRow = function (resource) {\n var _this$props = _this.props,\n events = _this$props.events,\n rtl = _this$props.rtl,\n selectable = _this$props.selectable,\n getNow = _this$props.getNow,\n range = _this$props.range,\n getters = _this$props.getters,\n localizer = _this$props.localizer,\n accessors = _this$props.accessors,\n components = _this$props.components,\n resizable = _this$props.resizable;\n var resourceId = accessors.resourceId(resource);\n var eventsToDisplay = resource ? events.filter(function (event) {\n return accessors.resource(event) === resourceId;\n }) : events;\n return /*#__PURE__*/React.createElement(DateContentRow, {\n isAllDay: true,\n rtl: rtl,\n getNow: getNow,\n minRows: 2\n // Add +1 to include showMore button row in the row limit\n ,\n maxRows: _this.props.allDayMaxRows + 1,\n range: range,\n events: eventsToDisplay,\n resourceId: resourceId,\n className: \"rbc-allday-cell\",\n selectable: selectable,\n selected: _this.props.selected,\n components: components,\n accessors: accessors,\n getters: getters,\n localizer: localizer,\n onSelect: _this.props.onSelectEvent,\n onShowMore: _this.props.onShowMore,\n onDoubleClick: _this.props.onDoubleClickEvent,\n onKeyPress: _this.props.onKeyPressEvent,\n onSelectSlot: _this.props.onSelectSlot,\n longPressThreshold: _this.props.longPressThreshold,\n resizable: resizable\n });\n };\n return _this;\n }\n _inherits(TimeGridHeader, _React$Component);\n return _createClass(TimeGridHeader, [{\n key: \"renderHeaderCells\",\n value: function renderHeaderCells(range) {\n var _this2 = this;\n var _this$props2 = this.props,\n localizer = _this$props2.localizer,\n getDrilldownView = _this$props2.getDrilldownView,\n getNow = _this$props2.getNow,\n dayProp = _this$props2.getters.dayProp,\n _this$props2$componen = _this$props2.components.header,\n HeaderComponent = _this$props2$componen === void 0 ? Header : _this$props2$componen;\n var today = getNow();\n return range.map(function (date, i) {\n var drilldownView = getDrilldownView(date);\n var label = localizer.format(date, 'dayFormat');\n var _dayProp = dayProp(date),\n className = _dayProp.className,\n style = _dayProp.style;\n var header = /*#__PURE__*/React.createElement(HeaderComponent, {\n date: date,\n label: label,\n localizer: localizer\n });\n return /*#__PURE__*/React.createElement(\"div\", {\n key: i,\n style: style,\n className: clsx('rbc-header', className, localizer.isSameDate(date, today) && 'rbc-today')\n }, drilldownView ? /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n className: \"rbc-button-link\",\n onClick: function onClick(e) {\n return _this2.handleHeaderClick(date, drilldownView, e);\n }\n }, header) : /*#__PURE__*/React.createElement(\"span\", null, header));\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this3 = this;\n var _this$props3 = this.props,\n width = _this$props3.width,\n rtl = _this$props3.rtl,\n resources = _this$props3.resources,\n range = _this$props3.range,\n events = _this$props3.events,\n getNow = _this$props3.getNow,\n accessors = _this$props3.accessors,\n selectable = _this$props3.selectable,\n components = _this$props3.components,\n getters = _this$props3.getters,\n scrollRef = _this$props3.scrollRef,\n localizer = _this$props3.localizer,\n isOverflowing = _this$props3.isOverflowing,\n _this$props3$componen = _this$props3.components,\n TimeGutterHeader = _this$props3$componen.timeGutterHeader,\n _this$props3$componen2 = _this$props3$componen.resourceHeader,\n ResourceHeaderComponent = _this$props3$componen2 === void 0 ? ResourceHeader : _this$props3$componen2,\n resizable = _this$props3.resizable;\n var style = {};\n if (isOverflowing) {\n style[rtl ? 'marginLeft' : 'marginRight'] = \"\".concat(scrollbarSize() - 1, \"px\");\n }\n var groupedEvents = resources.groupEvents(events);\n return /*#__PURE__*/React.createElement(\"div\", {\n style: style,\n ref: scrollRef,\n className: clsx('rbc-time-header', isOverflowing && 'rbc-overflowing')\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"rbc-label rbc-time-header-gutter\",\n style: {\n width: width,\n minWidth: width,\n maxWidth: width\n }\n }, TimeGutterHeader && /*#__PURE__*/React.createElement(TimeGutterHeader, null)), resources.map(function (_ref, idx) {\n var _ref2 = _slicedToArray(_ref, 2),\n id = _ref2[0],\n resource = _ref2[1];\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"rbc-time-header-content\",\n key: id || idx\n }, resource && /*#__PURE__*/React.createElement(\"div\", {\n className: \"rbc-row rbc-row-resource\",\n key: \"resource_\".concat(idx)\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"rbc-header\"\n }, /*#__PURE__*/React.createElement(ResourceHeaderComponent, {\n index: idx,\n label: accessors.resourceTitle(resource),\n resource: resource\n }))), /*#__PURE__*/React.createElement(\"div\", {\n className: \"rbc-row rbc-time-header-cell\".concat(range.length <= 1 ? ' rbc-time-header-cell-single-day' : '')\n }, _this3.renderHeaderCells(range)), /*#__PURE__*/React.createElement(DateContentRow, {\n isAllDay: true,\n rtl: rtl,\n getNow: getNow,\n minRows: 2\n // Add +1 to include showMore button row in the row limit\n ,\n maxRows: _this3.props.allDayMaxRows + 1,\n range: range,\n events: groupedEvents.get(id) || [],\n resourceId: resource && id,\n className: \"rbc-allday-cell\",\n selectable: selectable,\n selected: _this3.props.selected,\n components: components,\n accessors: accessors,\n getters: getters,\n localizer: localizer,\n onSelect: _this3.props.onSelectEvent,\n onShowMore: _this3.props.onShowMore,\n onDoubleClick: _this3.props.onDoubleClickEvent,\n onKeyDown: _this3.props.onKeyPressEvent,\n onSelectSlot: _this3.props.onSelectSlot,\n longPressThreshold: _this3.props.longPressThreshold,\n resizable: resizable\n }));\n }));\n }\n }]);\n}(React.Component);\n\nvar NONE = {};\nfunction Resources(resources, accessors) {\n return {\n map: function map(fn) {\n if (!resources) return [fn([NONE, null], 0)];\n return resources.map(function (resource, idx) {\n return fn([accessors.resourceId(resource), resource], idx);\n });\n },\n groupEvents: function groupEvents(events) {\n var eventsByResource = new Map();\n if (!resources) {\n // Return all events if resources are not provided\n eventsByResource.set(NONE, events);\n return eventsByResource;\n }\n events.forEach(function (event) {\n var id = accessors.resource(event) || NONE;\n if (Array.isArray(id)) {\n id.forEach(function (item) {\n var resourceEvents = eventsByResource.get(item) || [];\n resourceEvents.push(event);\n eventsByResource.set(item, resourceEvents);\n });\n } else {\n var resourceEvents = eventsByResource.get(id) || [];\n resourceEvents.push(event);\n eventsByResource.set(id, resourceEvents);\n }\n });\n return eventsByResource;\n }\n };\n}\n\nvar TimeGrid = /*#__PURE__*/function (_Component) {\n function TimeGrid(props) {\n var _this;\n _classCallCheck(this, TimeGrid);\n _this = _callSuper(this, TimeGrid, [props]);\n _this.handleScroll = function (e) {\n if (_this.scrollRef.current) {\n _this.scrollRef.current.scrollLeft = e.target.scrollLeft;\n }\n };\n _this.handleResize = function () {\n animationFrame.cancel(_this.rafHandle);\n _this.rafHandle = animationFrame.request(_this.checkOverflow);\n };\n _this.handleKeyPressEvent = function () {\n _this.clearSelection();\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n notify(_this.props.onKeyPressEvent, args);\n };\n _this.handleSelectEvent = function () {\n //cancel any pending selections so only the event click goes through.\n _this.clearSelection();\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n notify(_this.props.onSelectEvent, args);\n };\n _this.handleDoubleClickEvent = function () {\n _this.clearSelection();\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n notify(_this.props.onDoubleClickEvent, args);\n };\n _this.handleShowMore = function (events, date, cell, slot, target) {\n var _this$props = _this.props,\n popup = _this$props.popup,\n onDrillDown = _this$props.onDrillDown,\n onShowMore = _this$props.onShowMore,\n getDrilldownView = _this$props.getDrilldownView,\n doShowMoreDrillDown = _this$props.doShowMoreDrillDown;\n _this.clearSelection();\n if (popup) {\n var position = getPosition$1(cell, _this.containerRef.current);\n _this.setState({\n overlay: {\n date: date,\n events: events,\n position: _objectSpread(_objectSpread({}, position), {}, {\n width: '200px'\n }),\n target: target\n }\n });\n } else if (doShowMoreDrillDown) {\n notify(onDrillDown, [date, getDrilldownView(date) || views.DAY]);\n }\n notify(onShowMore, [events, date, slot]);\n };\n _this.handleSelectAllDaySlot = function (slots, slotInfo) {\n var onSelectSlot = _this.props.onSelectSlot;\n var start = new Date(slots[0]);\n var end = new Date(slots[slots.length - 1]);\n end.setDate(slots[slots.length - 1].getDate() + 1);\n notify(onSelectSlot, {\n slots: slots,\n start: start,\n end: end,\n action: slotInfo.action,\n resourceId: slotInfo.resourceId\n });\n };\n _this.overlayDisplay = function () {\n _this.setState({\n overlay: null\n });\n };\n _this.checkOverflow = function () {\n if (_this._updatingOverflow) return;\n var content = _this.contentRef.current;\n if (!(content !== null && content !== void 0 && content.scrollHeight)) return;\n var isOverflowing = content.scrollHeight > content.clientHeight;\n if (_this.state.isOverflowing !== isOverflowing) {\n _this._updatingOverflow = true;\n _this.setState({\n isOverflowing: isOverflowing\n }, function () {\n _this._updatingOverflow = false;\n });\n }\n };\n _this.memoizedResources = memoize(function (resources, accessors) {\n return Resources(resources, accessors);\n });\n _this.state = {\n gutterWidth: undefined,\n isOverflowing: null\n };\n _this.scrollRef = /*#__PURE__*/React.createRef();\n _this.contentRef = /*#__PURE__*/React.createRef();\n _this.containerRef = /*#__PURE__*/React.createRef();\n _this._scrollRatio = null;\n _this.gutterRef = /*#__PURE__*/createRef();\n return _this;\n }\n _inherits(TimeGrid, _Component);\n return _createClass(TimeGrid, [{\n key: \"getSnapshotBeforeUpdate\",\n value: function getSnapshotBeforeUpdate() {\n this.checkOverflow();\n return null;\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n if (this.props.width == null) {\n this.measureGutter();\n }\n this.calculateScroll();\n this.applyScroll();\n window.addEventListener('resize', this.handleResize);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n window.removeEventListener('resize', this.handleResize);\n animationFrame.cancel(this.rafHandle);\n if (this.measureGutterAnimationFrameRequest) {\n window.cancelAnimationFrame(this.measureGutterAnimationFrameRequest);\n }\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n this.applyScroll();\n }\n }, {\n key: \"renderEvents\",\n value: function renderEvents(range, events, backgroundEvents, now) {\n var _this2 = this;\n var _this$props2 = this.props,\n min = _this$props2.min,\n max = _this$props2.max,\n components = _this$props2.components,\n accessors = _this$props2.accessors,\n localizer = _this$props2.localizer,\n dayLayoutAlgorithm = _this$props2.dayLayoutAlgorithm;\n var resources = this.memoizedResources(this.props.resources, accessors);\n var groupedEvents = resources.groupEvents(events);\n var groupedBackgroundEvents = resources.groupEvents(backgroundEvents);\n return resources.map(function (_ref, i) {\n var _ref2 = _slicedToArray(_ref, 2),\n id = _ref2[0],\n resource = _ref2[1];\n return range.map(function (date, jj) {\n var daysEvents = (groupedEvents.get(id) || []).filter(function (event) {\n return localizer.inRange(date, accessors.start(event), accessors.end(event), 'day');\n });\n var daysBackgroundEvents = (groupedBackgroundEvents.get(id) || []).filter(function (event) {\n return localizer.inRange(date, accessors.start(event), accessors.end(event), 'day');\n });\n return /*#__PURE__*/React.createElement(DayColumn, Object.assign({}, _this2.props, {\n localizer: localizer,\n min: localizer.merge(date, min),\n max: localizer.merge(date, max),\n resource: resource && id,\n components: components,\n isNow: localizer.isSameDate(date, now),\n key: i + '-' + jj,\n date: date,\n events: daysEvents,\n backgroundEvents: daysBackgroundEvents,\n dayLayoutAlgorithm: dayLayoutAlgorithm\n }));\n });\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props$allDayMax;\n var _this$props3 = this.props,\n events = _this$props3.events,\n backgroundEvents = _this$props3.backgroundEvents,\n range = _this$props3.range,\n width = _this$props3.width,\n rtl = _this$props3.rtl,\n selected = _this$props3.selected,\n getNow = _this$props3.getNow,\n resources = _this$props3.resources,\n components = _this$props3.components,\n accessors = _this$props3.accessors,\n getters = _this$props3.getters,\n localizer = _this$props3.localizer,\n min = _this$props3.min,\n max = _this$props3.max,\n showMultiDayTimes = _this$props3.showMultiDayTimes,\n longPressThreshold = _this$props3.longPressThreshold,\n resizable = _this$props3.resizable;\n width = width || this.state.gutterWidth;\n var start = range[0],\n end = range[range.length - 1];\n this.slots = range.length;\n var allDayEvents = [],\n rangeEvents = [],\n rangeBackgroundEvents = [];\n events.forEach(function (event) {\n if (inRange(event, start, end, accessors, localizer)) {\n var eStart = accessors.start(event),\n eEnd = accessors.end(event);\n if (accessors.allDay(event) || localizer.startAndEndAreDateOnly(eStart, eEnd) || !showMultiDayTimes && !localizer.isSameDate(eStart, eEnd)) {\n allDayEvents.push(event);\n } else {\n rangeEvents.push(event);\n }\n }\n });\n backgroundEvents.forEach(function (event) {\n if (inRange(event, start, end, accessors, localizer)) {\n rangeBackgroundEvents.push(event);\n }\n });\n allDayEvents.sort(function (a, b) {\n return sortEvents(a, b, accessors, localizer);\n });\n return /*#__PURE__*/React.createElement(\"div\", {\n className: clsx('rbc-time-view', resources && 'rbc-time-view-resources'),\n ref: this.containerRef\n }, /*#__PURE__*/React.createElement(TimeGridHeader, {\n range: range,\n events: allDayEvents,\n width: width,\n rtl: rtl,\n getNow: getNow,\n localizer: localizer,\n selected: selected,\n allDayMaxRows: this.props.showAllEvents ? Infinity : (_this$props$allDayMax = this.props.allDayMaxRows) !== null && _this$props$allDayMax !== void 0 ? _this$props$allDayMax : Infinity,\n resources: this.memoizedResources(resources, accessors),\n selectable: this.props.selectable,\n accessors: accessors,\n getters: getters,\n components: components,\n scrollRef: this.scrollRef,\n isOverflowing: this.state.isOverflowing,\n longPressThreshold: longPressThreshold,\n onSelectSlot: this.handleSelectAllDaySlot,\n onSelectEvent: this.handleSelectEvent,\n onShowMore: this.handleShowMore,\n onDoubleClickEvent: this.props.onDoubleClickEvent,\n onKeyPressEvent: this.props.onKeyPressEvent,\n onDrillDown: this.props.onDrillDown,\n getDrilldownView: this.props.getDrilldownView,\n resizable: resizable\n }), this.props.popup && this.renderOverlay(), /*#__PURE__*/React.createElement(\"div\", {\n ref: this.contentRef,\n className: \"rbc-time-content\",\n onScroll: this.handleScroll\n }, /*#__PURE__*/React.createElement(TimeGutter$1, {\n date: start,\n ref: this.gutterRef,\n localizer: localizer,\n min: localizer.merge(start, min),\n max: localizer.merge(start, max),\n step: this.props.step,\n getNow: this.props.getNow,\n timeslots: this.props.timeslots,\n components: components,\n className: \"rbc-time-gutter\",\n getters: getters\n }), this.renderEvents(range, rangeEvents, rangeBackgroundEvents, getNow())));\n }\n }, {\n key: \"renderOverlay\",\n value: function renderOverlay() {\n var _this$state$overlay,\n _this$state,\n _this3 = this;\n var overlay = (_this$state$overlay = (_this$state = this.state) === null || _this$state === void 0 ? void 0 : _this$state.overlay) !== null && _this$state$overlay !== void 0 ? _this$state$overlay : {};\n var _this$props4 = this.props,\n accessors = _this$props4.accessors,\n localizer = _this$props4.localizer,\n components = _this$props4.components,\n getters = _this$props4.getters,\n selected = _this$props4.selected,\n popupOffset = _this$props4.popupOffset,\n handleDragStart = _this$props4.handleDragStart;\n var onHide = function onHide() {\n return _this3.setState({\n overlay: null\n });\n };\n return /*#__PURE__*/React.createElement(PopOverlay, {\n overlay: overlay,\n accessors: accessors,\n localizer: localizer,\n components: components,\n getters: getters,\n selected: selected,\n popupOffset: popupOffset,\n ref: this.containerRef,\n handleKeyPressEvent: this.handleKeyPressEvent,\n handleSelectEvent: this.handleSelectEvent,\n handleDoubleClickEvent: this.handleDoubleClickEvent,\n handleDragStart: handleDragStart,\n show: !!overlay.position,\n overlayDisplay: this.overlayDisplay,\n onHide: onHide\n });\n }\n }, {\n key: \"clearSelection\",\n value: function clearSelection() {\n clearTimeout(this._selectTimer);\n this._pendingSelection = [];\n }\n }, {\n key: \"measureGutter\",\n value: function measureGutter() {\n var _this4 = this;\n if (this.measureGutterAnimationFrameRequest) {\n window.cancelAnimationFrame(this.measureGutterAnimationFrameRequest);\n }\n this.measureGutterAnimationFrameRequest = window.requestAnimationFrame(function () {\n var _this4$gutterRef;\n var width = (_this4$gutterRef = _this4.gutterRef) !== null && _this4$gutterRef !== void 0 && _this4$gutterRef.current ? getWidth(_this4.gutterRef.current) : undefined;\n if (width && _this4.state.gutterWidth !== width) {\n _this4.setState({\n gutterWidth: width\n });\n }\n });\n }\n }, {\n key: \"applyScroll\",\n value: function applyScroll() {\n // If auto-scroll is disabled, we don't actually apply the scroll\n if (this._scrollRatio != null && this.props.enableAutoScroll === true) {\n var content = this.contentRef.current;\n content.scrollTop = content.scrollHeight * this._scrollRatio;\n // Only do this once\n this._scrollRatio = null;\n }\n }\n }, {\n key: \"calculateScroll\",\n value: function calculateScroll() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props;\n var min = props.min,\n max = props.max,\n scrollToTime = props.scrollToTime,\n localizer = props.localizer;\n var diffMillis = localizer.diff(localizer.merge(scrollToTime, min), scrollToTime, 'milliseconds');\n var totalMillis = localizer.diff(min, max, 'milliseconds');\n this._scrollRatio = diffMillis / totalMillis;\n }\n }]);\n}(Component);\nTimeGrid.defaultProps = {\n step: 30,\n timeslots: 2\n};\n\nvar _excluded$4 = [\"date\", \"localizer\", \"min\", \"max\", \"scrollToTime\", \"enableAutoScroll\"];\nvar Day = /*#__PURE__*/function (_React$Component) {\n function Day() {\n _classCallCheck(this, Day);\n return _callSuper(this, Day, arguments);\n }\n _inherits(Day, _React$Component);\n return _createClass(Day, [{\n key: \"render\",\n value: function render() {\n /**\n * This allows us to default min, max, and scrollToTime\n * using our localizer. This is necessary until such time\n * as TODO: TimeGrid is converted to a functional component.\n */\n var _this$props = this.props,\n date = _this$props.date,\n localizer = _this$props.localizer,\n _this$props$min = _this$props.min,\n min = _this$props$min === void 0 ? localizer.startOf(new Date(), 'day') : _this$props$min,\n _this$props$max = _this$props.max,\n max = _this$props$max === void 0 ? localizer.endOf(new Date(), 'day') : _this$props$max,\n _this$props$scrollToT = _this$props.scrollToTime,\n scrollToTime = _this$props$scrollToT === void 0 ? localizer.startOf(new Date(), 'day') : _this$props$scrollToT,\n _this$props$enableAut = _this$props.enableAutoScroll,\n enableAutoScroll = _this$props$enableAut === void 0 ? true : _this$props$enableAut,\n props = _objectWithoutProperties(_this$props, _excluded$4);\n var range = Day.range(date, {\n localizer: localizer\n });\n return /*#__PURE__*/React.createElement(TimeGrid, Object.assign({}, props, {\n range: range,\n eventOffset: 10,\n localizer: localizer,\n min: min,\n max: max,\n scrollToTime: scrollToTime,\n enableAutoScroll: enableAutoScroll\n }));\n }\n }]);\n}(React.Component);\nDay.range = function (date, _ref) {\n var localizer = _ref.localizer;\n return [localizer.startOf(date, 'day')];\n};\nDay.navigate = function (date, action, _ref2) {\n var localizer = _ref2.localizer;\n switch (action) {\n case navigate.PREVIOUS:\n return localizer.add(date, -1, 'day');\n case navigate.NEXT:\n return localizer.add(date, 1, 'day');\n default:\n return date;\n }\n};\nDay.title = function (date, _ref3) {\n var localizer = _ref3.localizer;\n return localizer.format(date, 'dayHeaderFormat');\n};\n\nvar _excluded$3 = [\"date\", \"localizer\", \"min\", \"max\", \"scrollToTime\", \"enableAutoScroll\"];\nvar Week = /*#__PURE__*/function (_React$Component) {\n function Week() {\n _classCallCheck(this, Week);\n return _callSuper(this, Week, arguments);\n }\n _inherits(Week, _React$Component);\n return _createClass(Week, [{\n key: \"render\",\n value: function render() {\n /**\n * This allows us to default min, max, and scrollToTime\n * using our localizer. This is necessary until such time\n * as TimeGrid is converted to a functional component.\n */\n var _this$props = this.props,\n date = _this$props.date,\n localizer = _this$props.localizer,\n _this$props$min = _this$props.min,\n min = _this$props$min === void 0 ? localizer.startOf(new Date(), 'day') : _this$props$min,\n _this$props$max = _this$props.max,\n max = _this$props$max === void 0 ? localizer.endOf(new Date(), 'day') : _this$props$max,\n _this$props$scrollToT = _this$props.scrollToTime,\n scrollToTime = _this$props$scrollToT === void 0 ? localizer.startOf(new Date(), 'day') : _this$props$scrollToT,\n _this$props$enableAut = _this$props.enableAutoScroll,\n enableAutoScroll = _this$props$enableAut === void 0 ? true : _this$props$enableAut,\n props = _objectWithoutProperties(_this$props, _excluded$3);\n var range = Week.range(date, this.props);\n return /*#__PURE__*/React.createElement(TimeGrid, Object.assign({}, props, {\n range: range,\n eventOffset: 15,\n localizer: localizer,\n min: min,\n max: max,\n scrollToTime: scrollToTime,\n enableAutoScroll: enableAutoScroll\n }));\n }\n }]);\n}(React.Component);\nWeek.defaultProps = TimeGrid.defaultProps;\nWeek.navigate = function (date, action, _ref) {\n var localizer = _ref.localizer;\n switch (action) {\n case navigate.PREVIOUS:\n return localizer.add(date, -1, 'week');\n case navigate.NEXT:\n return localizer.add(date, 1, 'week');\n default:\n return date;\n }\n};\nWeek.range = function (date, _ref2) {\n var localizer = _ref2.localizer;\n var firstOfWeek = localizer.startOfWeek();\n var start = localizer.startOf(date, 'week', firstOfWeek);\n var end = localizer.endOf(date, 'week', firstOfWeek);\n return localizer.range(start, end);\n};\nWeek.title = function (date, _ref3) {\n var localizer = _ref3.localizer;\n var _Week$range = Week.range(date, {\n localizer: localizer\n }),\n _Week$range2 = _toArray(_Week$range),\n start = _Week$range2[0],\n rest = _Week$range2.slice(1);\n return localizer.format({\n start: start,\n end: rest.pop()\n }, 'dayRangeHeaderFormat');\n};\n\nvar _excluded$2 = [\"date\", \"localizer\", \"min\", \"max\", \"scrollToTime\", \"enableAutoScroll\"];\nfunction workWeekRange(date, options) {\n return Week.range(date, options).filter(function (d) {\n return [6, 0].indexOf(d.getDay()) === -1;\n });\n}\nvar WorkWeek = /*#__PURE__*/function (_React$Component) {\n function WorkWeek() {\n _classCallCheck(this, WorkWeek);\n return _callSuper(this, WorkWeek, arguments);\n }\n _inherits(WorkWeek, _React$Component);\n return _createClass(WorkWeek, [{\n key: \"render\",\n value: function render() {\n /**\n * This allows us to default min, max, and scrollToTime\n * using our localizer. This is necessary until such time\n * as TimeGrid is converted to a functional component.\n */\n var _this$props = this.props,\n date = _this$props.date,\n localizer = _this$props.localizer,\n _this$props$min = _this$props.min,\n min = _this$props$min === void 0 ? localizer.startOf(new Date(), 'day') : _this$props$min,\n _this$props$max = _this$props.max,\n max = _this$props$max === void 0 ? localizer.endOf(new Date(), 'day') : _this$props$max,\n _this$props$scrollToT = _this$props.scrollToTime,\n scrollToTime = _this$props$scrollToT === void 0 ? localizer.startOf(new Date(), 'day') : _this$props$scrollToT,\n _this$props$enableAut = _this$props.enableAutoScroll,\n enableAutoScroll = _this$props$enableAut === void 0 ? true : _this$props$enableAut,\n props = _objectWithoutProperties(_this$props, _excluded$2);\n var range = workWeekRange(date, this.props);\n return /*#__PURE__*/React.createElement(TimeGrid, Object.assign({}, props, {\n range: range,\n eventOffset: 15,\n localizer: localizer,\n min: min,\n max: max,\n scrollToTime: scrollToTime,\n enableAutoScroll: enableAutoScroll\n }));\n }\n }]);\n}(React.Component);\nWorkWeek.defaultProps = TimeGrid.defaultProps;\nWorkWeek.range = workWeekRange;\nWorkWeek.navigate = Week.navigate;\nWorkWeek.title = function (date, _ref) {\n var localizer = _ref.localizer;\n var _workWeekRange = workWeekRange(date, {\n localizer: localizer\n }),\n _workWeekRange2 = _toArray(_workWeekRange),\n start = _workWeekRange2[0],\n rest = _workWeekRange2.slice(1);\n return localizer.format({\n start: start,\n end: rest.pop()\n }, 'dayRangeHeaderFormat');\n};\n\nvar DEFAULT_LENGTH = 30;\nfunction Agenda(_ref) {\n var accessors = _ref.accessors,\n components = _ref.components,\n date = _ref.date,\n events = _ref.events,\n getters = _ref.getters,\n _ref$length = _ref.length,\n length = _ref$length === void 0 ? DEFAULT_LENGTH : _ref$length,\n localizer = _ref.localizer,\n onDoubleClickEvent = _ref.onDoubleClickEvent,\n onSelectEvent = _ref.onSelectEvent,\n selected = _ref.selected;\n var headerRef = useRef(null);\n var dateColRef = useRef(null);\n var timeColRef = useRef(null);\n var contentRef = useRef(null);\n var tbodyRef = useRef(null);\n useEffect(function () {\n _adjustHeader();\n });\n var renderDay = function renderDay(day, events, dayKey) {\n var Event = components.event,\n AgendaDate = components.date;\n events = events.filter(function (e) {\n return inRange(e, localizer.startOf(day, 'day'), localizer.endOf(day, 'day'), accessors, localizer);\n });\n return events.map(function (event, idx) {\n var title = accessors.title(event);\n var end = accessors.end(event);\n var start = accessors.start(event);\n var userProps = getters.eventProp(event, start, end, isSelected(event, selected));\n var dateLabel = idx === 0 && localizer.format(day, 'agendaDateFormat');\n var first = idx === 0 ? /*#__PURE__*/React.createElement(\"td\", {\n rowSpan: events.length,\n className: \"rbc-agenda-date-cell\"\n }, AgendaDate ? /*#__PURE__*/React.createElement(AgendaDate, {\n day: day,\n label: dateLabel\n }) : dateLabel) : false;\n return /*#__PURE__*/React.createElement(\"tr\", {\n key: dayKey + '_' + idx,\n className: userProps.className,\n style: userProps.style\n }, first, /*#__PURE__*/React.createElement(\"td\", {\n className: \"rbc-agenda-time-cell\"\n }, timeRangeLabel(day, event)), /*#__PURE__*/React.createElement(\"td\", {\n className: \"rbc-agenda-event-cell\",\n onClick: function onClick(e) {\n return onSelectEvent && onSelectEvent(event, e);\n },\n onDoubleClick: function onDoubleClick(e) {\n return onDoubleClickEvent && onDoubleClickEvent(event, e);\n }\n }, Event ? /*#__PURE__*/React.createElement(Event, {\n event: event,\n title: title\n }) : title));\n }, []);\n };\n var timeRangeLabel = function timeRangeLabel(day, event) {\n var labelClass = '',\n TimeComponent = components.time,\n label = localizer.messages.allDay;\n var end = accessors.end(event);\n var start = accessors.start(event);\n if (!accessors.allDay(event)) {\n if (localizer.eq(start, end)) {\n label = localizer.format(start, 'agendaTimeFormat');\n } else if (localizer.isSameDate(start, end)) {\n label = localizer.format({\n start: start,\n end: end\n }, 'agendaTimeRangeFormat');\n } else if (localizer.isSameDate(day, start)) {\n label = localizer.format(start, 'agendaTimeFormat');\n } else if (localizer.isSameDate(day, end)) {\n label = localizer.format(end, 'agendaTimeFormat');\n }\n }\n if (localizer.gt(day, start, 'day')) labelClass = 'rbc-continues-prior';\n if (localizer.lt(day, end, 'day')) labelClass += ' rbc-continues-after';\n return /*#__PURE__*/React.createElement(\"span\", {\n className: labelClass.trim()\n }, TimeComponent ? /*#__PURE__*/React.createElement(TimeComponent, {\n event: event,\n day: day,\n label: label\n }) : label);\n };\n var _adjustHeader = function _adjustHeader() {\n if (!tbodyRef.current) return;\n var header = headerRef.current;\n var firstRow = tbodyRef.current.firstChild;\n if (!firstRow) return;\n var isOverflowing = contentRef.current.scrollHeight > contentRef.current.clientHeight;\n var _widths = [];\n var widths = _widths;\n _widths = [getWidth(firstRow.children[0]), getWidth(firstRow.children[1])];\n if (widths[0] !== _widths[0] || widths[1] !== _widths[1]) {\n dateColRef.current.style.width = _widths[0] + 'px';\n timeColRef.current.style.width = _widths[1] + 'px';\n }\n if (isOverflowing) {\n addClass(header, 'rbc-header-overflowing');\n header.style.marginRight = scrollbarSize() + 'px';\n } else {\n removeClass(header, 'rbc-header-overflowing');\n }\n };\n var messages = localizer.messages;\n var end = localizer.add(date, length, 'day');\n var range = localizer.range(date, end, 'day');\n events = events.filter(function (event) {\n return inRange(event, localizer.startOf(date, 'day'), localizer.endOf(end, 'day'), accessors, localizer);\n });\n events.sort(function (a, b) {\n return +accessors.start(a) - +accessors.start(b);\n });\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"rbc-agenda-view\"\n }, events.length !== 0 ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"table\", {\n ref: headerRef,\n className: \"rbc-agenda-table\"\n }, /*#__PURE__*/React.createElement(\"thead\", null, /*#__PURE__*/React.createElement(\"tr\", null, /*#__PURE__*/React.createElement(\"th\", {\n className: \"rbc-header\",\n ref: dateColRef\n }, messages.date), /*#__PURE__*/React.createElement(\"th\", {\n className: \"rbc-header\",\n ref: timeColRef\n }, messages.time), /*#__PURE__*/React.createElement(\"th\", {\n className: \"rbc-header\"\n }, messages.event)))), /*#__PURE__*/React.createElement(\"div\", {\n className: \"rbc-agenda-content\",\n ref: contentRef\n }, /*#__PURE__*/React.createElement(\"table\", {\n className: \"rbc-agenda-table\"\n }, /*#__PURE__*/React.createElement(\"tbody\", {\n ref: tbodyRef\n }, range.map(function (day, idx) {\n return renderDay(day, events, idx);\n }))))) : /*#__PURE__*/React.createElement(\"span\", {\n className: \"rbc-agenda-empty\"\n }, messages.noEventsInRange));\n}\nAgenda.range = function (start, _ref2) {\n var _ref2$length = _ref2.length,\n length = _ref2$length === void 0 ? DEFAULT_LENGTH : _ref2$length,\n localizer = _ref2.localizer;\n var end = localizer.add(start, length, 'day');\n return {\n start: start,\n end: end\n };\n};\nAgenda.navigate = function (date, action, _ref3) {\n var _ref3$length = _ref3.length,\n length = _ref3$length === void 0 ? DEFAULT_LENGTH : _ref3$length,\n localizer = _ref3.localizer;\n switch (action) {\n case navigate.PREVIOUS:\n return localizer.add(date, -length, 'day');\n case navigate.NEXT:\n return localizer.add(date, length, 'day');\n default:\n return date;\n }\n};\nAgenda.title = function (start, _ref4) {\n var _ref4$length = _ref4.length,\n length = _ref4$length === void 0 ? DEFAULT_LENGTH : _ref4$length,\n localizer = _ref4.localizer;\n var end = localizer.add(start, length, 'day');\n return localizer.format({\n start: start,\n end: end\n }, 'agendaHeaderFormat');\n};\n\nvar VIEWS = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, views.MONTH, MonthView), views.WEEK, Week), views.WORK_WEEK, WorkWeek), views.DAY, Day), views.AGENDA, Agenda);\n\nvar _excluded$1 = [\"action\", \"date\", \"today\"];\nfunction moveDate(View, _ref) {\n var action = _ref.action,\n date = _ref.date,\n today = _ref.today,\n props = _objectWithoutProperties(_ref, _excluded$1);\n View = typeof View === 'string' ? VIEWS[View] : View;\n switch (action) {\n case navigate.TODAY:\n date = today || new Date();\n break;\n case navigate.DATE:\n break;\n default:\n invariant(View && typeof View.navigate === 'function', 'Calendar View components must implement a static `.navigate(date, action)` method.s');\n date = View.navigate(date, action, props);\n }\n return date;\n}\n\nvar Toolbar = /*#__PURE__*/function (_React$Component) {\n function Toolbar() {\n var _this;\n _classCallCheck(this, Toolbar);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _callSuper(this, Toolbar, [].concat(args));\n _this.navigate = function (action) {\n _this.props.onNavigate(action);\n };\n _this.view = function (view) {\n _this.props.onView(view);\n };\n return _this;\n }\n _inherits(Toolbar, _React$Component);\n return _createClass(Toolbar, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n messages = _this$props.localizer.messages,\n label = _this$props.label;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"rbc-toolbar\"\n }, /*#__PURE__*/React.createElement(\"span\", {\n className: \"rbc-btn-group\"\n }, /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n onClick: this.navigate.bind(null, navigate.TODAY)\n }, messages.today), /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n onClick: this.navigate.bind(null, navigate.PREVIOUS)\n }, messages.previous), /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n onClick: this.navigate.bind(null, navigate.NEXT)\n }, messages.next)), /*#__PURE__*/React.createElement(\"span\", {\n className: \"rbc-toolbar-label\"\n }, label), /*#__PURE__*/React.createElement(\"span\", {\n className: \"rbc-btn-group\"\n }, this.viewNamesGroup(messages)));\n }\n }, {\n key: \"viewNamesGroup\",\n value: function viewNamesGroup(messages) {\n var _this2 = this;\n var viewNames = this.props.views;\n var view = this.props.view;\n if (viewNames.length > 1) {\n return viewNames.map(function (name) {\n return /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n key: name,\n className: clsx({\n 'rbc-active': view === name\n }),\n onClick: _this2.view.bind(null, name)\n }, messages[name]);\n });\n }\n }\n }]);\n}(React.Component);\n\n/**\n * Retrieve via an accessor-like property\n *\n * accessor(obj, 'name') // => retrieves obj['name']\n * accessor(data, func) // => retrieves func(data)\n * ... otherwise null\n */\nfunction accessor(data, field) {\n var value = null;\n if (typeof field === 'function') value = field(data);else if (typeof field === 'string' && _typeof(data) === 'object' && data != null && field in data) value = data[field];\n return value;\n}\nvar wrapAccessor = function wrapAccessor(acc) {\n return function (data) {\n return accessor(data, acc);\n };\n};\n\nvar _excluded = [\"view\", \"date\", \"getNow\", \"onNavigate\"],\n _excluded2 = [\"view\", \"toolbar\", \"events\", \"backgroundEvents\", \"style\", \"className\", \"elementProps\", \"date\", \"getNow\", \"length\", \"showMultiDayTimes\", \"onShowMore\", \"doShowMoreDrillDown\", \"components\", \"formats\", \"messages\", \"culture\"];\nfunction viewNames(_views) {\n if (Array.isArray(_views)) {\n return _views;\n }\n var views = [];\n for (var _i = 0, _Object$entries = Object.entries(_views); _i < _Object$entries.length; _i++) {\n var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),\n key = _Object$entries$_i[0],\n value = _Object$entries$_i[1];\n if (value) {\n views.push(key);\n }\n }\n return views;\n}\nfunction isValidView(view, _ref) {\n var _views = _ref.views;\n var names = viewNames(_views);\n return names.indexOf(view) !== -1;\n}\nvar Calendar = /*#__PURE__*/function (_React$Component) {\n function Calendar() {\n var _this;\n _classCallCheck(this, Calendar);\n for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {\n _args[_key] = arguments[_key];\n }\n _this = _callSuper(this, Calendar, [].concat(_args));\n _this.getViews = function () {\n var views = _this.props.views;\n if (Array.isArray(views)) {\n return transform(views, function (obj, name) {\n return obj[name] = VIEWS[name];\n }, {});\n }\n if (_typeof(views) === 'object') {\n return mapValues(views, function (value, key) {\n if (value === true) {\n return VIEWS[key];\n }\n return value;\n });\n }\n return VIEWS;\n };\n _this.getView = function () {\n var views = _this.getViews();\n return views[_this.props.view];\n };\n _this.getDrilldownView = function (date) {\n var _this$props = _this.props,\n view = _this$props.view,\n drilldownView = _this$props.drilldownView,\n getDrilldownView = _this$props.getDrilldownView;\n if (!getDrilldownView) return drilldownView;\n return getDrilldownView(date, view, Object.keys(_this.getViews()));\n };\n /**\n *\n * @param date\n * @param viewComponent\n * @param {'month'|'week'|'work_week'|'day'|'agenda'} [view] - optional\n * parameter. It appears when range change on view changing. It could be handy\n * when you need to have both: range and view type at once, i.e. for manage rbc\n * state via url\n */\n _this.handleRangeChange = function (date, viewComponent, view) {\n var _this$props2 = _this.props,\n onRangeChange = _this$props2.onRangeChange,\n localizer = _this$props2.localizer;\n if (onRangeChange) {\n if (viewComponent.range) {\n onRangeChange(viewComponent.range(date, {\n localizer: localizer\n }), view);\n } else {\n if (process.env.NODE_ENV !== 'production') {\n console.error('onRangeChange prop not supported for this view');\n }\n }\n }\n };\n _this.handleNavigate = function (action, newDate) {\n var _this$props3 = _this.props,\n view = _this$props3.view,\n date = _this$props3.date,\n getNow = _this$props3.getNow,\n onNavigate = _this$props3.onNavigate,\n props = _objectWithoutProperties(_this$props3, _excluded);\n var ViewComponent = _this.getView();\n var today = getNow();\n date = moveDate(ViewComponent, _objectSpread(_objectSpread({}, props), {}, {\n action: action,\n date: newDate || date || today,\n today: today\n }));\n onNavigate(date, view, action);\n _this.handleRangeChange(date, ViewComponent);\n };\n _this.handleViewChange = function (view) {\n if (view !== _this.props.view && isValidView(view, _this.props)) {\n _this.props.onView(view);\n }\n var views = _this.getViews();\n _this.handleRangeChange(_this.props.date || _this.props.getNow(), views[view], view);\n };\n _this.handleSelectEvent = function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n notify(_this.props.onSelectEvent, args);\n };\n _this.handleDoubleClickEvent = function () {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n notify(_this.props.onDoubleClickEvent, args);\n };\n _this.handleKeyPressEvent = function () {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n notify(_this.props.onKeyPressEvent, args);\n };\n _this.handleSelectSlot = function (slotInfo) {\n notify(_this.props.onSelectSlot, slotInfo);\n };\n _this.handleDrillDown = function (date, view) {\n var onDrillDown = _this.props.onDrillDown;\n if (onDrillDown) {\n onDrillDown(date, view, _this.drilldownView);\n return;\n }\n if (view) _this.handleViewChange(view);\n _this.handleNavigate(navigate.DATE, date);\n };\n _this.state = {\n context: Calendar.getContext(_this.props)\n };\n return _this;\n }\n _inherits(Calendar, _React$Component);\n return _createClass(Calendar, [{\n key: \"render\",\n value: function render() {\n var _this$props4 = this.props,\n view = _this$props4.view,\n toolbar = _this$props4.toolbar,\n events = _this$props4.events,\n backgroundEvents = _this$props4.backgroundEvents,\n style = _this$props4.style,\n className = _this$props4.className,\n elementProps = _this$props4.elementProps,\n current = _this$props4.date,\n getNow = _this$props4.getNow,\n length = _this$props4.length,\n showMultiDayTimes = _this$props4.showMultiDayTimes,\n onShowMore = _this$props4.onShowMore,\n doShowMoreDrillDown = _this$props4.doShowMoreDrillDown;\n _this$props4.components;\n _this$props4.formats;\n _this$props4.messages;\n _this$props4.culture;\n var props = _objectWithoutProperties(_this$props4, _excluded2);\n current = current || getNow();\n var View = this.getView();\n var _this$state$context = this.state.context,\n accessors = _this$state$context.accessors,\n components = _this$state$context.components,\n getters = _this$state$context.getters,\n localizer = _this$state$context.localizer,\n viewNames = _this$state$context.viewNames;\n var CalToolbar = components.toolbar || Toolbar;\n var label = View.title(current, {\n localizer: localizer,\n length: length\n });\n return /*#__PURE__*/React.createElement(\"div\", Object.assign({}, elementProps, {\n className: clsx(className, 'rbc-calendar', props.rtl && 'rbc-rtl'),\n style: style\n }), toolbar && /*#__PURE__*/React.createElement(CalToolbar, {\n date: current,\n view: view,\n views: viewNames,\n label: label,\n onView: this.handleViewChange,\n onNavigate: this.handleNavigate,\n localizer: localizer\n }), /*#__PURE__*/React.createElement(View, Object.assign({}, props, {\n events: events,\n backgroundEvents: backgroundEvents,\n date: current,\n getNow: getNow,\n length: length,\n localizer: localizer,\n getters: getters,\n components: components,\n accessors: accessors,\n showMultiDayTimes: showMultiDayTimes,\n getDrilldownView: this.getDrilldownView,\n onNavigate: this.handleNavigate,\n onDrillDown: this.handleDrillDown,\n onSelectEvent: this.handleSelectEvent,\n onDoubleClickEvent: this.handleDoubleClickEvent,\n onKeyPressEvent: this.handleKeyPressEvent,\n onSelectSlot: this.handleSelectSlot,\n onShowMore: onShowMore,\n doShowMoreDrillDown: doShowMoreDrillDown\n })));\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps) {\n return {\n context: Calendar.getContext(nextProps)\n };\n }\n }, {\n key: \"getContext\",\n value: function getContext(_ref2) {\n var startAccessor = _ref2.startAccessor,\n endAccessor = _ref2.endAccessor,\n allDayAccessor = _ref2.allDayAccessor,\n tooltipAccessor = _ref2.tooltipAccessor,\n titleAccessor = _ref2.titleAccessor,\n resourceAccessor = _ref2.resourceAccessor,\n resourceIdAccessor = _ref2.resourceIdAccessor,\n resourceTitleAccessor = _ref2.resourceTitleAccessor,\n eventPropGetter = _ref2.eventPropGetter,\n backgroundEventPropGetter = _ref2.backgroundEventPropGetter,\n slotPropGetter = _ref2.slotPropGetter,\n slotGroupPropGetter = _ref2.slotGroupPropGetter,\n dayPropGetter = _ref2.dayPropGetter,\n view = _ref2.view,\n views = _ref2.views,\n localizer = _ref2.localizer,\n culture = _ref2.culture,\n _ref2$messages = _ref2.messages,\n messages$1 = _ref2$messages === void 0 ? {} : _ref2$messages,\n _ref2$components = _ref2.components,\n components = _ref2$components === void 0 ? {} : _ref2$components,\n _ref2$formats = _ref2.formats,\n formats = _ref2$formats === void 0 ? {} : _ref2$formats;\n var names = viewNames(views);\n var msgs = messages(messages$1);\n return {\n viewNames: names,\n localizer: mergeWithDefaults(localizer, culture, formats, msgs),\n getters: {\n eventProp: function eventProp() {\n return eventPropGetter && eventPropGetter.apply(void 0, arguments) || {};\n },\n backgroundEventProp: function backgroundEventProp() {\n return backgroundEventPropGetter && backgroundEventPropGetter.apply(void 0, arguments) || {};\n },\n slotProp: function slotProp() {\n return slotPropGetter && slotPropGetter.apply(void 0, arguments) || {};\n },\n slotGroupProp: function slotGroupProp() {\n return slotGroupPropGetter && slotGroupPropGetter.apply(void 0, arguments) || {};\n },\n dayProp: function dayProp() {\n return dayPropGetter && dayPropGetter.apply(void 0, arguments) || {};\n }\n },\n components: defaults(components[view] || {}, omit(components, names), {\n eventWrapper: NoopWrapper,\n backgroundEventWrapper: NoopWrapper,\n eventContainerWrapper: NoopWrapper,\n dateCellWrapper: NoopWrapper,\n weekWrapper: NoopWrapper,\n timeSlotWrapper: NoopWrapper,\n timeGutterWrapper: NoopWrapper\n }),\n accessors: {\n start: wrapAccessor(startAccessor),\n end: wrapAccessor(endAccessor),\n allDay: wrapAccessor(allDayAccessor),\n tooltip: wrapAccessor(tooltipAccessor),\n title: wrapAccessor(titleAccessor),\n resource: wrapAccessor(resourceAccessor),\n resourceId: wrapAccessor(resourceIdAccessor),\n resourceTitle: wrapAccessor(resourceTitleAccessor)\n }\n };\n }\n }]);\n}(React.Component);\nCalendar.defaultProps = {\n events: [],\n backgroundEvents: [],\n elementProps: {},\n popup: false,\n toolbar: true,\n view: views.MONTH,\n views: [views.MONTH, views.WEEK, views.DAY, views.AGENDA],\n step: 30,\n length: 30,\n allDayMaxRows: Infinity,\n doShowMoreDrillDown: true,\n drilldownView: views.DAY,\n titleAccessor: 'title',\n tooltipAccessor: 'title',\n allDayAccessor: 'allDay',\n startAccessor: 'start',\n endAccessor: 'end',\n resourceAccessor: 'resourceId',\n resourceIdAccessor: 'id',\n resourceTitleAccessor: 'title',\n longPressThreshold: 250,\n getNow: function getNow() {\n return new Date();\n },\n dayLayoutAlgorithm: 'overlap'\n};\nvar Calendar$1 = uncontrollable(Calendar, {\n view: 'onView',\n date: 'onNavigate',\n selected: 'onSelectEvent'\n});\n\nvar weekRangeFormat$5 = function weekRangeFormat(_ref, culture, local) {\n var start = _ref.start,\n end = _ref.end;\n return local.format(start, 'MMMM DD', culture) + ' – ' +\n // updated to use this localizer 'eq()' method\n local.format(end, local.eq(start, end, 'month') ? 'DD' : 'MMMM DD', culture);\n};\nvar dateRangeFormat$5 = function dateRangeFormat(_ref2, culture, local) {\n var start = _ref2.start,\n end = _ref2.end;\n return local.format(start, 'L', culture) + ' – ' + local.format(end, 'L', culture);\n};\nvar timeRangeFormat$5 = function timeRangeFormat(_ref3, culture, local) {\n var start = _ref3.start,\n end = _ref3.end;\n return local.format(start, 'LT', culture) + ' – ' + local.format(end, 'LT', culture);\n};\nvar timeRangeStartFormat$5 = function timeRangeStartFormat(_ref4, culture, local) {\n var start = _ref4.start;\n return local.format(start, 'LT', culture) + ' – ';\n};\nvar timeRangeEndFormat$5 = function timeRangeEndFormat(_ref5, culture, local) {\n var end = _ref5.end;\n return ' – ' + local.format(end, 'LT', culture);\n};\nvar formats$5 = {\n dateFormat: 'DD',\n dayFormat: 'DD ddd',\n weekdayFormat: 'ddd',\n selectRangeFormat: timeRangeFormat$5,\n eventTimeRangeFormat: timeRangeFormat$5,\n eventTimeRangeStartFormat: timeRangeStartFormat$5,\n eventTimeRangeEndFormat: timeRangeEndFormat$5,\n timeGutterFormat: 'LT',\n monthHeaderFormat: 'MMMM YYYY',\n dayHeaderFormat: 'dddd MMM DD',\n dayRangeHeaderFormat: weekRangeFormat$5,\n agendaHeaderFormat: dateRangeFormat$5,\n agendaDateFormat: 'ddd MMM DD',\n agendaTimeFormat: 'LT',\n agendaTimeRangeFormat: timeRangeFormat$5\n};\nfunction fixUnit$2(unit) {\n var datePart = unit ? unit.toLowerCase() : unit;\n if (datePart === 'FullYear') {\n datePart = 'year';\n } else if (!datePart) {\n datePart = undefined;\n }\n return datePart;\n}\nfunction moment (moment) {\n var locale = function locale(m, c) {\n return c ? m.locale(c) : m;\n };\n function getTimezoneOffset(date) {\n // ensures this gets cast to timezone\n return moment(date).toDate().getTimezoneOffset();\n }\n function getDstOffset(start, end) {\n var _st$_z$name, _st$_z;\n // convert to moment, in case\n // Calculate the offset in the timezone of the Events (local)\n // not in the timezone of the calendar (moment.tz)\n var st = moment(start).local();\n var ed = moment(end).local();\n // if not using moment timezone\n if (!moment.tz) {\n return st.toDate().getTimezoneOffset() - ed.toDate().getTimezoneOffset();\n }\n /**\n * If using moment-timezone, and a timezone has been applied, then\n * use this to get the proper timezone offset, otherwise default\n * the timezone to the browser local\n */\n var tzName = (_st$_z$name = st === null || st === void 0 ? void 0 : (_st$_z = st._z) === null || _st$_z === void 0 ? void 0 : _st$_z.name) !== null && _st$_z$name !== void 0 ? _st$_z$name : moment.tz.guess();\n var startOffset = moment.tz.zone(tzName).utcOffset(+st);\n var endOffset = moment.tz.zone(tzName).utcOffset(+ed);\n return startOffset - endOffset;\n }\n function getDayStartDstOffset(start) {\n var dayStart = moment(start).startOf('day');\n return getDstOffset(dayStart, start);\n }\n\n /*** BEGIN localized date arithmetic methods with moment ***/\n function defineComparators(a, b, unit) {\n var datePart = fixUnit$2(unit);\n var dtA = datePart ? moment(a).startOf(datePart) : moment(a);\n var dtB = datePart ? moment(b).startOf(datePart) : moment(b);\n return [dtA, dtB, datePart];\n }\n function startOf() {\n var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n var unit = arguments.length > 1 ? arguments[1] : undefined;\n var datePart = fixUnit$2(unit);\n if (datePart) {\n return moment(date).startOf(datePart).toDate();\n }\n return moment(date).toDate();\n }\n function endOf() {\n var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n var unit = arguments.length > 1 ? arguments[1] : undefined;\n var datePart = fixUnit$2(unit);\n if (datePart) {\n return moment(date).endOf(datePart).toDate();\n }\n return moment(date).toDate();\n }\n\n // moment comparison operations *always* convert both sides to moment objects\n // prior to running the comparisons\n function eq(a, b, unit) {\n var _defineComparators = defineComparators(a, b, unit),\n _defineComparators2 = _slicedToArray(_defineComparators, 3),\n dtA = _defineComparators2[0],\n dtB = _defineComparators2[1],\n datePart = _defineComparators2[2];\n return dtA.isSame(dtB, datePart);\n }\n function neq(a, b, unit) {\n return !eq(a, b, unit);\n }\n function gt(a, b, unit) {\n var _defineComparators3 = defineComparators(a, b, unit),\n _defineComparators4 = _slicedToArray(_defineComparators3, 3),\n dtA = _defineComparators4[0],\n dtB = _defineComparators4[1],\n datePart = _defineComparators4[2];\n return dtA.isAfter(dtB, datePart);\n }\n function lt(a, b, unit) {\n var _defineComparators5 = defineComparators(a, b, unit),\n _defineComparators6 = _slicedToArray(_defineComparators5, 3),\n dtA = _defineComparators6[0],\n dtB = _defineComparators6[1],\n datePart = _defineComparators6[2];\n return dtA.isBefore(dtB, datePart);\n }\n function gte(a, b, unit) {\n var _defineComparators7 = defineComparators(a, b, unit),\n _defineComparators8 = _slicedToArray(_defineComparators7, 3),\n dtA = _defineComparators8[0],\n dtB = _defineComparators8[1],\n datePart = _defineComparators8[2];\n return dtA.isSameOrBefore(dtB, datePart);\n }\n function lte(a, b, unit) {\n var _defineComparators9 = defineComparators(a, b, unit),\n _defineComparators10 = _slicedToArray(_defineComparators9, 3),\n dtA = _defineComparators10[0],\n dtB = _defineComparators10[1],\n datePart = _defineComparators10[2];\n return dtA.isSameOrBefore(dtB, datePart);\n }\n function inRange(day, min, max) {\n var unit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'day';\n var datePart = fixUnit$2(unit);\n var mDay = moment(day);\n var mMin = moment(min);\n var mMax = moment(max);\n return mDay.isBetween(mMin, mMax, datePart, '[]');\n }\n function min(dateA, dateB) {\n var dtA = moment(dateA);\n var dtB = moment(dateB);\n var minDt = moment.min(dtA, dtB);\n return minDt.toDate();\n }\n function max(dateA, dateB) {\n var dtA = moment(dateA);\n var dtB = moment(dateB);\n var maxDt = moment.max(dtA, dtB);\n return maxDt.toDate();\n }\n function merge(date, time) {\n if (!date && !time) return null;\n var tm = moment(time).format('HH:mm:ss');\n var dt = moment(date).startOf('day').format('MM/DD/YYYY');\n // We do it this way to avoid issues when timezone switching\n return moment(\"\".concat(dt, \" \").concat(tm), 'MM/DD/YYYY HH:mm:ss').toDate();\n }\n function add(date, adder, unit) {\n var datePart = fixUnit$2(unit);\n return moment(date).add(adder, datePart).toDate();\n }\n function range(start, end) {\n var unit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'day';\n var datePart = fixUnit$2(unit);\n // because the add method will put these in tz, we have to start that way\n var current = moment(start).toDate();\n var days = [];\n while (lte(current, end)) {\n days.push(current);\n current = add(current, 1, datePart);\n }\n return days;\n }\n function ceil(date, unit) {\n var datePart = fixUnit$2(unit);\n var floor = startOf(date, datePart);\n return eq(floor, date) ? floor : add(floor, 1, datePart);\n }\n function diff(a, b) {\n var unit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'day';\n var datePart = fixUnit$2(unit);\n // don't use 'defineComparators' here, as we don't want to mutate the values\n var dtA = moment(a);\n var dtB = moment(b);\n return dtB.diff(dtA, datePart);\n }\n function minutes(date) {\n var dt = moment(date);\n return dt.minutes();\n }\n function firstOfWeek(culture) {\n var data = culture ? moment.localeData(culture) : moment.localeData();\n return data ? data.firstDayOfWeek() : 0;\n }\n function firstVisibleDay(date) {\n return moment(date).startOf('month').startOf('week').toDate();\n }\n function lastVisibleDay(date) {\n return moment(date).endOf('month').endOf('week').toDate();\n }\n function visibleDays(date) {\n var current = firstVisibleDay(date);\n var last = lastVisibleDay(date);\n var days = [];\n while (lte(current, last)) {\n days.push(current);\n current = add(current, 1, 'd');\n }\n return days;\n }\n /*** END localized date arithmetic methods with moment ***/\n\n /**\n * Moved from TimeSlots.js, this method overrides the method of the same name\n * in the localizer.js, using moment to construct the js Date\n * @param {Date} dt - date to start with\n * @param {Number} minutesFromMidnight\n * @param {Number} offset\n * @returns {Date}\n */\n function getSlotDate(dt, minutesFromMidnight, offset) {\n return moment(dt).startOf('day').minute(minutesFromMidnight + offset).toDate();\n }\n\n // moment will automatically handle DST differences in it's calculations\n function getTotalMin(start, end) {\n return diff(start, end, 'minutes');\n }\n function getMinutesFromMidnight(start) {\n var dayStart = moment(start).startOf('day');\n var day = moment(start);\n return day.diff(dayStart, 'minutes') + getDayStartDstOffset(start);\n }\n\n // These two are used by DateSlotMetrics\n function continuesPrior(start, first) {\n var mStart = moment(start);\n var mFirst = moment(first);\n return mStart.isBefore(mFirst, 'day');\n }\n function continuesAfter(start, end, last) {\n var mEnd = moment(end);\n var mLast = moment(last);\n return mEnd.isSameOrAfter(mLast, 'minutes');\n }\n function daySpan(start, end) {\n var mStart = moment(start);\n var mEnd = moment(end);\n var dur = moment.duration(mEnd.diff(mStart));\n return dur.days();\n }\n\n // These two are used by eventLevels\n function sortEvents(_ref6) {\n var _ref6$evtA = _ref6.evtA,\n aStart = _ref6$evtA.start,\n aEnd = _ref6$evtA.end,\n aAllDay = _ref6$evtA.allDay,\n _ref6$evtB = _ref6.evtB,\n bStart = _ref6$evtB.start,\n bEnd = _ref6$evtB.end,\n bAllDay = _ref6$evtB.allDay;\n var startSort = +startOf(aStart, 'day') - +startOf(bStart, 'day');\n var durA = daySpan(aStart, aEnd);\n var durB = daySpan(bStart, bEnd);\n return startSort ||\n // sort by start Day first\n durB - durA ||\n // events spanning multiple days go first\n !!bAllDay - !!aAllDay ||\n // then allDay single day events\n +aStart - +bStart ||\n // then sort by start time *don't need moment conversion here\n +aEnd - +bEnd // then sort by end time *don't need moment conversion here either\n ;\n }\n function inEventRange(_ref7) {\n var _ref7$event = _ref7.event,\n start = _ref7$event.start,\n end = _ref7$event.end,\n _ref7$range = _ref7.range,\n rangeStart = _ref7$range.start,\n rangeEnd = _ref7$range.end;\n var startOfDay = moment(start).startOf('day');\n var eEnd = moment(end);\n var rStart = moment(rangeStart);\n var rEnd = moment(rangeEnd);\n var startsBeforeEnd = startOfDay.isSameOrBefore(rEnd, 'day');\n // when the event is zero duration we need to handle a bit differently\n var sameMin = !startOfDay.isSame(eEnd, 'minutes');\n var endsAfterStart = sameMin ? eEnd.isAfter(rStart, 'minutes') : eEnd.isSameOrAfter(rStart, 'minutes');\n return startsBeforeEnd && endsAfterStart;\n }\n function isSameDate(date1, date2) {\n var dt = moment(date1);\n var dt2 = moment(date2);\n return dt.isSame(dt2, 'day');\n }\n\n /**\n * This method, called once in the localizer constructor, is used by eventLevels\n * 'eventSegments()' to assist in determining the 'span' of the event in the display,\n * specifically when using a timezone that is greater than the browser native timezone.\n * @returns number\n */\n function browserTZOffset() {\n /**\n * Date.prototype.getTimezoneOffset horrifically flips the positive/negative from\n * what you see in it's string, so we have to jump through some hoops to get a value\n * we can actually compare.\n */\n var dt = new Date();\n var neg = /-/.test(dt.toString()) ? '-' : '';\n var dtOffset = dt.getTimezoneOffset();\n var comparator = Number(\"\".concat(neg).concat(Math.abs(dtOffset)));\n // moment correctly provides positive/negative offset, as expected\n var mtOffset = moment().utcOffset();\n return mtOffset > comparator ? 1 : 0;\n }\n return new DateLocalizer({\n formats: formats$5,\n firstOfWeek: firstOfWeek,\n firstVisibleDay: firstVisibleDay,\n lastVisibleDay: lastVisibleDay,\n visibleDays: visibleDays,\n format: function format(value, _format, culture) {\n return locale(moment(value), culture).format(_format);\n },\n lt: lt,\n lte: lte,\n gt: gt,\n gte: gte,\n eq: eq,\n neq: neq,\n merge: merge,\n inRange: inRange,\n startOf: startOf,\n endOf: endOf,\n range: range,\n add: add,\n diff: diff,\n ceil: ceil,\n min: min,\n max: max,\n minutes: minutes,\n getSlotDate: getSlotDate,\n getTimezoneOffset: getTimezoneOffset,\n getDstOffset: getDstOffset,\n getTotalMin: getTotalMin,\n getMinutesFromMidnight: getMinutesFromMidnight,\n continuesPrior: continuesPrior,\n continuesAfter: continuesAfter,\n sortEvents: sortEvents,\n inEventRange: inEventRange,\n isSameDate: isSameDate,\n daySpan: daySpan,\n browserTZOffset: browserTZOffset\n });\n}\n\nfunction pluralizeUnit(unit) {\n return /s$/.test(unit) ? unit : unit + 's';\n}\nvar weekRangeFormat$4 = function weekRangeFormat(_ref, culture, local) {\n var start = _ref.start,\n end = _ref.end;\n return local.format(start, 'MMMM dd', culture) + ' – ' +\n // updated to use this localizer 'eq()' method\n local.format(end, local.eq(start, end, 'month') ? 'dd' : 'MMMM dd', culture);\n};\nvar dateRangeFormat$4 = function dateRangeFormat(_ref2, culture, local) {\n var start = _ref2.start,\n end = _ref2.end;\n return local.format(start, 'D', culture) + ' – ' + local.format(end, 'D', culture);\n};\nvar timeRangeFormat$4 = function timeRangeFormat(_ref3, culture, local) {\n var start = _ref3.start,\n end = _ref3.end;\n return local.format(start, 't', culture) + ' – ' + local.format(end, 't', culture);\n};\nvar timeRangeStartFormat$4 = function timeRangeStartFormat(_ref4, culture, local) {\n var start = _ref4.start;\n return local.format(start, 't', culture) + ' – ';\n};\nvar timeRangeEndFormat$4 = function timeRangeEndFormat(_ref5, culture, local) {\n var end = _ref5.end;\n return ' – ' + local.format(end, 't', culture);\n};\nvar formats$4 = {\n dateFormat: 'dd',\n dayFormat: 'dd EEE',\n weekdayFormat: 'EEE',\n selectRangeFormat: timeRangeFormat$4,\n eventTimeRangeFormat: timeRangeFormat$4,\n eventTimeRangeStartFormat: timeRangeStartFormat$4,\n eventTimeRangeEndFormat: timeRangeEndFormat$4,\n timeGutterFormat: 't',\n monthHeaderFormat: 'MMMM yyyy',\n dayHeaderFormat: 'EEEE MMM dd',\n dayRangeHeaderFormat: weekRangeFormat$4,\n agendaHeaderFormat: dateRangeFormat$4,\n agendaDateFormat: 'EEE MMM dd',\n agendaTimeFormat: 't',\n agendaTimeRangeFormat: timeRangeFormat$4\n};\nfunction fixUnit$1(unit) {\n var datePart = unit ? pluralizeUnit(unit.toLowerCase()) : unit;\n if (datePart === 'FullYear') {\n datePart = 'year';\n } else if (!datePart) {\n datePart = undefined;\n }\n return datePart;\n}\n\n// Luxon does not currently have weekInfo by culture\n// Luxon uses 1 based values for month and weekday\n// So we default to Sunday (7)\nfunction luxon (DateTime) {\n var _ref6 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref6$firstDayOfWeek = _ref6.firstDayOfWeek,\n firstDayOfWeek = _ref6$firstDayOfWeek === void 0 ? 7 : _ref6$firstDayOfWeek;\n function formatDate(value, format) {\n return DateTime.fromJSDate(value).toFormat(format);\n }\n function formatDateWithCulture(value, culture, format) {\n return DateTime.fromJSDate(value).setLocale(culture).toFormat(format);\n }\n\n /*** BEGIN localized date arithmetic methods with Luxon ***/\n function defineComparators(a, b, unit) {\n var datePart = fixUnit$1(unit);\n var dtA = datePart ? DateTime.fromJSDate(a).startOf(datePart) : DateTime.fromJSDate(a);\n var dtB = datePart ? DateTime.fromJSDate(b).startOf(datePart) : DateTime.fromJSDate(b);\n return [dtA, dtB, datePart];\n }\n\n // Since Luxon (and current Intl API) has no support\n // for culture based weekInfo, we need to handle\n // the start of the week differently\n // depending on locale, the firstDayOfWeek could also be Saturday, Sunday or Monday\n function startOfDTWeek(dtObj) {\n var weekday = dtObj.weekday;\n if (weekday === firstDayOfWeek) {\n return dtObj.startOf('day'); // already beginning of week\n } else if (firstDayOfWeek === 1) {\n return dtObj.startOf('week'); // fow is Monday, which is Luxon default\n }\n var diff = firstDayOfWeek === 7 ? weekday : weekday + (7 - firstDayOfWeek);\n return dtObj.minus({\n day: diff\n }).startOf('day');\n }\n function endOfDTWeek(dtObj) {\n var weekday = dtObj.weekday;\n var eow = firstDayOfWeek === 1 ? 7 : firstDayOfWeek - 1;\n if (weekday === eow) {\n return dtObj.endOf('day'); // already last day of the week\n } else if (firstDayOfWeek === 1) {\n return dtObj.endOf('week'); // use Luxon default (Sunday)\n }\n var fromDate = firstDayOfWeek > eow ? dtObj.plus({\n day: firstDayOfWeek - eow\n }) : dtObj;\n return fromDate.set({\n weekday: eow\n }).endOf('day');\n }\n\n // This returns a DateTime instance\n function startOfDT() {\n var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();\n var unit = arguments.length > 1 ? arguments[1] : undefined;\n var datePart = fixUnit$1(unit);\n if (datePart) {\n var dt = DateTime.fromJSDate(date);\n return datePart.includes('week') ? startOfDTWeek(dt) : dt.startOf(datePart);\n }\n return DateTime.fromJSDate(date);\n }\n function firstOfWeek() {\n return firstDayOfWeek;\n }\n\n // This returns a JS Date from a DateTime instance\n function startOf() {\n var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();\n var unit = arguments.length > 1 ? arguments[1] : undefined;\n return startOfDT(date, unit).toJSDate();\n }\n\n // This returns a DateTime instance\n function endOfDT() {\n var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();\n var unit = arguments.length > 1 ? arguments[1] : undefined;\n var datePart = fixUnit$1(unit);\n if (datePart) {\n var dt = DateTime.fromJSDate(date);\n return datePart.includes('week') ? endOfDTWeek(dt) : dt.endOf(datePart);\n }\n return DateTime.fromJSDate(date);\n }\n function endOf() {\n var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();\n var unit = arguments.length > 1 ? arguments[1] : undefined;\n return endOfDT(date, unit).toJSDate();\n }\n function eq(a, b, unit) {\n var _defineComparators = defineComparators(a, b, unit),\n _defineComparators2 = _slicedToArray(_defineComparators, 2),\n dtA = _defineComparators2[0],\n dtB = _defineComparators2[1];\n return +dtA == +dtB;\n }\n function neq(a, b, unit) {\n return !eq(a, b, unit);\n }\n function gt(a, b, unit) {\n var _defineComparators3 = defineComparators(a, b, unit),\n _defineComparators4 = _slicedToArray(_defineComparators3, 2),\n dtA = _defineComparators4[0],\n dtB = _defineComparators4[1];\n return +dtA > +dtB;\n }\n function lt(a, b, unit) {\n var _defineComparators5 = defineComparators(a, b, unit),\n _defineComparators6 = _slicedToArray(_defineComparators5, 2),\n dtA = _defineComparators6[0],\n dtB = _defineComparators6[1];\n return +dtA < +dtB;\n }\n function gte(a, b, unit) {\n var _defineComparators7 = defineComparators(a, b, unit),\n _defineComparators8 = _slicedToArray(_defineComparators7, 2),\n dtA = _defineComparators8[0],\n dtB = _defineComparators8[1];\n return +dtA >= +dtB;\n }\n function lte(a, b, unit) {\n var _defineComparators9 = defineComparators(a, b, unit),\n _defineComparators10 = _slicedToArray(_defineComparators9, 2),\n dtA = _defineComparators10[0],\n dtB = _defineComparators10[1];\n return +dtA <= +dtB;\n }\n function inRange(day, min, max) {\n var unit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'day';\n var datePart = fixUnit$1(unit);\n var mDay = startOfDT(day, datePart);\n var mMin = startOfDT(min, datePart);\n var mMax = startOfDT(max, datePart);\n return +mDay >= +mMin && +mDay <= +mMax;\n }\n function min(dateA, dateB) {\n var dtA = DateTime.fromJSDate(dateA);\n var dtB = DateTime.fromJSDate(dateB);\n var minDt = DateTime.min(dtA, dtB);\n return minDt.toJSDate();\n }\n function max(dateA, dateB) {\n var dtA = DateTime.fromJSDate(dateA);\n var dtB = DateTime.fromJSDate(dateB);\n var maxDt = DateTime.max(dtA, dtB);\n return maxDt.toJSDate();\n }\n function merge(date, time) {\n if (!date && !time) return null;\n var tm = DateTime.fromJSDate(time);\n var dt = startOfDT(date, 'day');\n return dt.set({\n hour: tm.hour,\n minute: tm.minute,\n second: tm.second,\n millisecond: tm.millisecond\n }).toJSDate();\n }\n function add(date, adder, unit) {\n var datePart = fixUnit$1(unit);\n return DateTime.fromJSDate(date).plus(_defineProperty({}, datePart, adder)).toJSDate();\n }\n function range(start, end) {\n var unit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'day';\n var datePart = fixUnit$1(unit);\n var current = DateTime.fromJSDate(start).toJSDate(); // this is to get it to tz\n var days = [];\n while (lte(current, end)) {\n days.push(current);\n current = add(current, 1, datePart);\n }\n return days;\n }\n function ceil(date, unit) {\n var datePart = fixUnit$1(unit);\n var floor = startOf(date, datePart);\n return eq(floor, date) ? floor : add(floor, 1, datePart);\n }\n function diff(a, b) {\n var unit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'day';\n var datePart = fixUnit$1(unit);\n // don't use 'defineComparators' here, as we don't want to mutate the values\n var dtA = DateTime.fromJSDate(a);\n var dtB = DateTime.fromJSDate(b);\n return Math.floor(dtB.diff(dtA, datePart, {\n conversionAccuracy: 'longterm'\n }).toObject()[datePart]);\n }\n function firstVisibleDay(date) {\n var startOfMonth = startOfDT(date, 'month');\n return startOfDTWeek(startOfMonth).toJSDate();\n }\n function lastVisibleDay(date) {\n var endOfMonth = endOfDT(date, 'month');\n return endOfDTWeek(endOfMonth).toJSDate();\n }\n function visibleDays(date) {\n var current = firstVisibleDay(date);\n var last = lastVisibleDay(date);\n var days = [];\n while (lte(current, last)) {\n days.push(current);\n current = add(current, 1, 'day');\n }\n return days;\n }\n /*** END localized date arithmetic methods with moment ***/\n\n /**\n * Moved from TimeSlots.js, this method overrides the method of the same name\n * in the localizer.js, using moment to construct the js Date\n * @param {Date} dt - date to start with\n * @param {Number} minutesFromMidnight\n * @param {Number} offset\n * @returns {Date}\n */\n function getSlotDate(dt, minutesFromMidnight, offset) {\n return startOfDT(dt, 'day').set({\n minutes: minutesFromMidnight + offset\n }).toJSDate();\n }\n\n // Luxon will automatically handle DST differences in it's calculations\n function getTotalMin(start, end) {\n return diff(start, end, 'minutes');\n }\n function getMinutesFromMidnight(start) {\n var dayStart = startOfDT(start, 'day');\n var day = DateTime.fromJSDate(start);\n return Math.round(day.diff(dayStart, 'minutes', {\n conversionAccuracy: 'longterm'\n }).toObject().minutes);\n }\n\n // These two are used by DateSlotMetrics\n function continuesPrior(start, first) {\n return lt(start, first);\n }\n function continuesAfter(start, end, last) {\n return gte(end, last);\n }\n function daySpan(start, end) {\n var dtStart = DateTime.fromJSDate(start);\n var dtEnd = DateTime.fromJSDate(end);\n return dtEnd.diff(dtStart).as('days');\n }\n\n // These two are used by eventLevels\n function sortEvents(_ref7) {\n var _ref7$evtA = _ref7.evtA,\n aStart = _ref7$evtA.start,\n aEnd = _ref7$evtA.end,\n aAllDay = _ref7$evtA.allDay,\n _ref7$evtB = _ref7.evtB,\n bStart = _ref7$evtB.start,\n bEnd = _ref7$evtB.end,\n bAllDay = _ref7$evtB.allDay;\n var startSort = +startOf(aStart, 'day') - +startOf(bStart, 'day');\n var durA = daySpan(aStart, aEnd);\n var durB = daySpan(bStart, bEnd);\n return startSort ||\n // sort by start Day first\n durB - durA ||\n // events spanning multiple days go first\n !!bAllDay - !!aAllDay ||\n // then allDay single day events\n +aStart - +bStart ||\n // then sort by start time *don't need moment conversion here\n +aEnd - +bEnd // then sort by end time *don't need moment conversion here either\n ;\n }\n function inEventRange(_ref8) {\n var _ref8$event = _ref8.event,\n start = _ref8$event.start,\n end = _ref8$event.end,\n _ref8$range = _ref8.range,\n rangeStart = _ref8$range.start,\n rangeEnd = _ref8$range.end;\n var eStart = startOf(start, 'day');\n var startsBeforeEnd = lte(eStart, rangeEnd, 'day');\n // when the event is zero duration we need to handle a bit differently\n var sameMin = neq(eStart, end, 'minutes');\n var endsAfterStart = sameMin ? gt(end, rangeStart, 'minutes') : gte(end, rangeStart, 'minutes');\n return startsBeforeEnd && endsAfterStart;\n }\n\n // moment treats 'day' and 'date' equality very different\n // moment(date1).isSame(date2, 'day') would test that they were both the same day of the week\n // moment(date1).isSame(date2, 'date') would test that they were both the same date of the month of the year\n function isSameDate(date1, date2) {\n var dt = DateTime.fromJSDate(date1);\n var dt2 = DateTime.fromJSDate(date2);\n return dt.hasSame(dt2, 'day');\n }\n\n /**\n * This method, called once in the localizer constructor, is used by eventLevels\n * 'eventSegments()' to assist in determining the 'span' of the event in the display,\n * specifically when using a timezone that is greater than the browser native timezone.\n * @returns number\n */\n function browserTZOffset() {\n /**\n * Date.prototype.getTimezoneOffset horrifically flips the positive/negative from\n * what you see in it's string, so we have to jump through some hoops to get a value\n * we can actually compare.\n */\n var dt = new Date();\n var neg = /-/.test(dt.toString()) ? '-' : '';\n var dtOffset = dt.getTimezoneOffset();\n var comparator = Number(\"\".concat(neg).concat(Math.abs(dtOffset)));\n // moment correctly provides positive/negative offset, as expected\n var mtOffset = DateTime.local().offset;\n return mtOffset > comparator ? 1 : 0;\n }\n return new DateLocalizer({\n format: function format(value, _format, culture) {\n if (culture) {\n return formatDateWithCulture(value, culture, _format);\n }\n return formatDate(value, _format);\n },\n formats: formats$4,\n firstOfWeek: firstOfWeek,\n firstVisibleDay: firstVisibleDay,\n lastVisibleDay: lastVisibleDay,\n visibleDays: visibleDays,\n lt: lt,\n lte: lte,\n gt: gt,\n gte: gte,\n eq: eq,\n neq: neq,\n merge: merge,\n inRange: inRange,\n startOf: startOf,\n endOf: endOf,\n range: range,\n add: add,\n diff: diff,\n ceil: ceil,\n min: min,\n max: max,\n getSlotDate: getSlotDate,\n getTotalMin: getTotalMin,\n getMinutesFromMidnight: getMinutesFromMidnight,\n continuesPrior: continuesPrior,\n continuesAfter: continuesAfter,\n sortEvents: sortEvents,\n inEventRange: inEventRange,\n isSameDate: isSameDate,\n daySpan: daySpan,\n browserTZOffset: browserTZOffset\n });\n}\n\nvar dateRangeFormat$3 = function dateRangeFormat(_ref, culture, local) {\n var start = _ref.start,\n end = _ref.end;\n return local.format(start, 'd', culture) + ' – ' + local.format(end, 'd', culture);\n};\nvar timeRangeFormat$3 = function timeRangeFormat(_ref2, culture, local) {\n var start = _ref2.start,\n end = _ref2.end;\n return local.format(start, 't', culture) + ' – ' + local.format(end, 't', culture);\n};\nvar timeRangeStartFormat$3 = function timeRangeStartFormat(_ref3, culture, local) {\n var start = _ref3.start;\n return local.format(start, 't', culture) + ' – ';\n};\nvar timeRangeEndFormat$3 = function timeRangeEndFormat(_ref4, culture, local) {\n var end = _ref4.end;\n return ' – ' + local.format(end, 't', culture);\n};\nvar weekRangeFormat$3 = function weekRangeFormat(_ref5, culture, local) {\n var start = _ref5.start,\n end = _ref5.end;\n return local.format(start, 'MMM dd', culture) + ' – ' + local.format(end, eq(start, end, 'month') ? 'dd' : 'MMM dd', culture);\n};\nvar formats$3 = {\n dateFormat: 'dd',\n dayFormat: 'ddd dd/MM',\n weekdayFormat: 'ddd',\n selectRangeFormat: timeRangeFormat$3,\n eventTimeRangeFormat: timeRangeFormat$3,\n eventTimeRangeStartFormat: timeRangeStartFormat$3,\n eventTimeRangeEndFormat: timeRangeEndFormat$3,\n timeGutterFormat: 't',\n monthHeaderFormat: 'Y',\n dayHeaderFormat: 'dddd MMM dd',\n dayRangeHeaderFormat: weekRangeFormat$3,\n agendaHeaderFormat: dateRangeFormat$3,\n agendaDateFormat: 'ddd MMM dd',\n agendaTimeFormat: 't',\n agendaTimeRangeFormat: timeRangeFormat$3\n};\nfunction oldGlobalize (globalize) {\n function getCulture(culture) {\n return culture ? globalize.findClosestCulture(culture) : globalize.culture();\n }\n function firstOfWeek(culture) {\n culture = getCulture(culture);\n return culture && culture.calendar.firstDay || 0;\n }\n return new DateLocalizer({\n firstOfWeek: firstOfWeek,\n formats: formats$3,\n format: function format(value, _format, culture) {\n return globalize.format(value, _format, culture);\n }\n });\n}\n\n// TODO: fix the globalizeLocalizer to work with globalize 1.x\n\nvar dateRangeFormat$2 = function dateRangeFormat(_ref, culture, local) {\n var start = _ref.start,\n end = _ref.end;\n return local.format(start, {\n date: 'short'\n }, culture) + ' – ' + local.format(end, {\n date: 'short'\n }, culture);\n};\nvar timeRangeFormat$2 = function timeRangeFormat(_ref2, culture, local) {\n var start = _ref2.start,\n end = _ref2.end;\n return local.format(start, {\n time: 'short'\n }, culture) + ' – ' + local.format(end, {\n time: 'short'\n }, culture);\n};\nvar timeRangeStartFormat$2 = function timeRangeStartFormat(_ref3, culture, local) {\n var start = _ref3.start;\n return local.format(start, {\n time: 'short'\n }, culture) + ' – ';\n};\nvar timeRangeEndFormat$2 = function timeRangeEndFormat(_ref4, culture, local) {\n var end = _ref4.end;\n return ' – ' + local.format(end, {\n time: 'short'\n }, culture);\n};\nvar weekRangeFormat$2 = function weekRangeFormat(_ref5, culture, local) {\n var start = _ref5.start,\n end = _ref5.end;\n return local.format(start, 'MMM dd', culture) + ' – ' + local.format(end, eq(start, end, 'month') ? 'dd' : 'MMM dd', culture);\n};\nvar formats$2 = {\n dateFormat: 'dd',\n dayFormat: 'eee dd/MM',\n weekdayFormat: 'eee',\n selectRangeFormat: timeRangeFormat$2,\n eventTimeRangeFormat: timeRangeFormat$2,\n eventTimeRangeStartFormat: timeRangeStartFormat$2,\n eventTimeRangeEndFormat: timeRangeEndFormat$2,\n timeGutterFormat: {\n time: 'short'\n },\n monthHeaderFormat: 'MMMM yyyy',\n dayHeaderFormat: 'eeee MMM dd',\n dayRangeHeaderFormat: weekRangeFormat$2,\n agendaHeaderFormat: dateRangeFormat$2,\n agendaDateFormat: 'eee MMM dd',\n agendaTimeFormat: {\n time: 'short'\n },\n agendaTimeRangeFormat: timeRangeFormat$2\n};\nfunction globalize (globalize) {\n var locale = function locale(culture) {\n return culture ? globalize(culture) : globalize;\n };\n\n // return the first day of the week from the locale data. Defaults to 'world'\n // territory if no territory is derivable from CLDR.\n // Failing to use CLDR supplemental (not loaded?), revert to the original\n // method of getting first day of week.\n function firstOfWeek(culture) {\n try {\n var days = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];\n var cldr = locale(culture).cldr;\n var territory = cldr.attributes.territory;\n var weekData = cldr.get('supplemental').weekData;\n var firstDay = weekData.firstDay[territory || '001'];\n return days.indexOf(firstDay);\n } catch (e) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Failed to accurately determine first day of the week.' + ' Is supplemental data loaded into CLDR?');\n }\n // maybe cldr supplemental is not loaded? revert to original method\n var date = new Date();\n //cldr-data doesn't seem to be zero based\n var localeDay = Math.max(parseInt(locale(culture).formatDate(date, {\n raw: 'e'\n }), 10) - 1, 0);\n return Math.abs(date.getDay() - localeDay);\n }\n }\n if (!globalize.load) return oldGlobalize(globalize);\n return new DateLocalizer({\n firstOfWeek: firstOfWeek,\n formats: formats$2,\n format: function format(value, _format, culture) {\n _format = typeof _format === 'string' ? {\n raw: _format\n } : _format;\n return locale(culture).formatDate(value, _format);\n }\n });\n}\n\nvar dateRangeFormat$1 = function dateRangeFormat(_ref, culture, local) {\n var start = _ref.start,\n end = _ref.end;\n return \"\".concat(local.format(start, 'P', culture), \" \\u2013 \").concat(local.format(end, 'P', culture));\n};\nvar timeRangeFormat$1 = function timeRangeFormat(_ref2, culture, local) {\n var start = _ref2.start,\n end = _ref2.end;\n return \"\".concat(local.format(start, 'p', culture), \" \\u2013 \").concat(local.format(end, 'p', culture));\n};\nvar timeRangeStartFormat$1 = function timeRangeStartFormat(_ref3, culture, local) {\n var start = _ref3.start;\n return \"\".concat(local.format(start, 'h:mma', culture), \" \\u2013 \");\n};\nvar timeRangeEndFormat$1 = function timeRangeEndFormat(_ref4, culture, local) {\n var end = _ref4.end;\n return \" \\u2013 \".concat(local.format(end, 'h:mma', culture));\n};\nvar weekRangeFormat$1 = function weekRangeFormat(_ref5, culture, local) {\n var start = _ref5.start,\n end = _ref5.end;\n return \"\".concat(local.format(start, 'MMMM dd', culture), \" \\u2013 \").concat(local.format(end, eq(start, end, 'month') ? 'dd' : 'MMMM dd', culture));\n};\nvar formats$1 = {\n dateFormat: 'dd',\n dayFormat: 'dd eee',\n weekdayFormat: 'cccc',\n selectRangeFormat: timeRangeFormat$1,\n eventTimeRangeFormat: timeRangeFormat$1,\n eventTimeRangeStartFormat: timeRangeStartFormat$1,\n eventTimeRangeEndFormat: timeRangeEndFormat$1,\n timeGutterFormat: 'p',\n monthHeaderFormat: 'MMMM yyyy',\n dayHeaderFormat: 'cccc MMM dd',\n dayRangeHeaderFormat: weekRangeFormat$1,\n agendaHeaderFormat: dateRangeFormat$1,\n agendaDateFormat: 'ccc MMM dd',\n agendaTimeFormat: 'p',\n agendaTimeRangeFormat: timeRangeFormat$1\n};\nvar dateFnsLocalizer = function dateFnsLocalizer(_ref6) {\n var startOfWeek = _ref6.startOfWeek,\n getDay = _ref6.getDay,\n _format = _ref6.format,\n locales = _ref6.locales;\n return new DateLocalizer({\n formats: formats$1,\n firstOfWeek: function firstOfWeek(culture) {\n return getDay(startOfWeek(new Date(), {\n locale: locales[culture]\n }));\n },\n format: function format(value, formatString, culture) {\n return _format(new Date(value), formatString, {\n locale: locales[culture]\n });\n }\n });\n};\n\nvar weekRangeFormat = function weekRangeFormat(_ref, culture, local) {\n var start = _ref.start,\n end = _ref.end;\n return local.format(start, 'MMMM DD', culture) + ' – ' +\n // updated to use this localizer 'eq()' method\n local.format(end, local.eq(start, end, 'month') ? 'DD' : 'MMMM DD', culture);\n};\nvar dateRangeFormat = function dateRangeFormat(_ref2, culture, local) {\n var start = _ref2.start,\n end = _ref2.end;\n return local.format(start, 'L', culture) + ' – ' + local.format(end, 'L', culture);\n};\nvar timeRangeFormat = function timeRangeFormat(_ref3, culture, local) {\n var start = _ref3.start,\n end = _ref3.end;\n return local.format(start, 'LT', culture) + ' – ' + local.format(end, 'LT', culture);\n};\nvar timeRangeStartFormat = function timeRangeStartFormat(_ref4, culture, local) {\n var start = _ref4.start;\n return local.format(start, 'LT', culture) + ' – ';\n};\nvar timeRangeEndFormat = function timeRangeEndFormat(_ref5, culture, local) {\n var end = _ref5.end;\n return ' – ' + local.format(end, 'LT', culture);\n};\nvar formats = {\n dateFormat: 'DD',\n dayFormat: 'DD ddd',\n weekdayFormat: 'ddd',\n selectRangeFormat: timeRangeFormat,\n eventTimeRangeFormat: timeRangeFormat,\n eventTimeRangeStartFormat: timeRangeStartFormat,\n eventTimeRangeEndFormat: timeRangeEndFormat,\n timeGutterFormat: 'LT',\n monthHeaderFormat: 'MMMM YYYY',\n dayHeaderFormat: 'dddd MMM DD',\n dayRangeHeaderFormat: weekRangeFormat,\n agendaHeaderFormat: dateRangeFormat,\n agendaDateFormat: 'ddd MMM DD',\n agendaTimeFormat: 'LT',\n agendaTimeRangeFormat: timeRangeFormat\n};\nfunction fixUnit(unit) {\n var datePart = unit ? unit.toLowerCase() : unit;\n if (datePart === 'FullYear') {\n datePart = 'year';\n } else if (!datePart) {\n datePart = undefined;\n }\n return datePart;\n}\nfunction dayjs (dayjsLib) {\n // load dayjs plugins\n dayjsLib.extend(isBetween);\n dayjsLib.extend(isSameOrAfter);\n dayjsLib.extend(isSameOrBefore);\n dayjsLib.extend(localeData);\n dayjsLib.extend(localizedFormat);\n dayjsLib.extend(minMax);\n dayjsLib.extend(utc);\n var locale = function locale(dj, c) {\n return c ? dj.locale(c) : dj;\n };\n\n // if the timezone plugin is loaded,\n // then use the timezone aware version\n var dayjs = dayjsLib.tz ? dayjsLib.tz : dayjsLib;\n function getTimezoneOffset(date) {\n // ensures this gets cast to timezone\n return dayjs(date).toDate().getTimezoneOffset();\n }\n function getDstOffset(start, end) {\n var _st$tz$$x$$timezone;\n // convert to dayjs, in case\n var st = dayjs(start);\n var ed = dayjs(end);\n // if not using the dayjs timezone plugin\n if (!dayjs.tz) {\n return st.toDate().getTimezoneOffset() - ed.toDate().getTimezoneOffset();\n }\n /**\n * If a default timezone has been applied, then\n * use this to get the proper timezone offset, otherwise default\n * the timezone to the browser local\n */\n var tzName = (_st$tz$$x$$timezone = st.tz().$x.$timezone) !== null && _st$tz$$x$$timezone !== void 0 ? _st$tz$$x$$timezone : dayjsLib.tz.guess();\n // invert offsets to be inline with moment.js\n var startOffset = -dayjs.tz(+st, tzName).utcOffset();\n var endOffset = -dayjs.tz(+ed, tzName).utcOffset();\n return startOffset - endOffset;\n }\n function getDayStartDstOffset(start) {\n var dayStart = dayjs(start).startOf('day');\n return getDstOffset(dayStart, start);\n }\n\n /*** BEGIN localized date arithmetic methods with dayjs ***/\n function defineComparators(a, b, unit) {\n var datePart = fixUnit(unit);\n var dtA = datePart ? dayjs(a).startOf(datePart) : dayjs(a);\n var dtB = datePart ? dayjs(b).startOf(datePart) : dayjs(b);\n return [dtA, dtB, datePart];\n }\n function startOf() {\n var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n var unit = arguments.length > 1 ? arguments[1] : undefined;\n var datePart = fixUnit(unit);\n if (datePart) {\n return dayjs(date).startOf(datePart).toDate();\n }\n return dayjs(date).toDate();\n }\n function endOf() {\n var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n var unit = arguments.length > 1 ? arguments[1] : undefined;\n var datePart = fixUnit(unit);\n if (datePart) {\n return dayjs(date).endOf(datePart).toDate();\n }\n return dayjs(date).toDate();\n }\n\n // dayjs comparison operations *always* convert both sides to dayjs objects\n // prior to running the comparisons\n function eq(a, b, unit) {\n var _defineComparators = defineComparators(a, b, unit),\n _defineComparators2 = _slicedToArray(_defineComparators, 3),\n dtA = _defineComparators2[0],\n dtB = _defineComparators2[1],\n datePart = _defineComparators2[2];\n return dtA.isSame(dtB, datePart);\n }\n function neq(a, b, unit) {\n return !eq(a, b, unit);\n }\n function gt(a, b, unit) {\n var _defineComparators3 = defineComparators(a, b, unit),\n _defineComparators4 = _slicedToArray(_defineComparators3, 3),\n dtA = _defineComparators4[0],\n dtB = _defineComparators4[1],\n datePart = _defineComparators4[2];\n return dtA.isAfter(dtB, datePart);\n }\n function lt(a, b, unit) {\n var _defineComparators5 = defineComparators(a, b, unit),\n _defineComparators6 = _slicedToArray(_defineComparators5, 3),\n dtA = _defineComparators6[0],\n dtB = _defineComparators6[1],\n datePart = _defineComparators6[2];\n return dtA.isBefore(dtB, datePart);\n }\n function gte(a, b, unit) {\n var _defineComparators7 = defineComparators(a, b, unit),\n _defineComparators8 = _slicedToArray(_defineComparators7, 3),\n dtA = _defineComparators8[0],\n dtB = _defineComparators8[1],\n datePart = _defineComparators8[2];\n return dtA.isSameOrBefore(dtB, datePart);\n }\n function lte(a, b, unit) {\n var _defineComparators9 = defineComparators(a, b, unit),\n _defineComparators10 = _slicedToArray(_defineComparators9, 3),\n dtA = _defineComparators10[0],\n dtB = _defineComparators10[1],\n datePart = _defineComparators10[2];\n return dtA.isSameOrBefore(dtB, datePart);\n }\n function inRange(day, min, max) {\n var unit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'day';\n var datePart = fixUnit(unit);\n var djDay = dayjs(day);\n var djMin = dayjs(min);\n var djMax = dayjs(max);\n return djDay.isBetween(djMin, djMax, datePart, '[]');\n }\n function min(dateA, dateB) {\n var dtA = dayjs(dateA);\n var dtB = dayjs(dateB);\n var minDt = dayjsLib.min(dtA, dtB);\n return minDt.toDate();\n }\n function max(dateA, dateB) {\n var dtA = dayjs(dateA);\n var dtB = dayjs(dateB);\n var maxDt = dayjsLib.max(dtA, dtB);\n return maxDt.toDate();\n }\n function merge(date, time) {\n if (!date && !time) return null;\n var tm = dayjs(time).format('HH:mm:ss');\n var dt = dayjs(date).startOf('day').format('MM/DD/YYYY');\n // We do it this way to avoid issues when timezone switching\n return dayjsLib(\"\".concat(dt, \" \").concat(tm), 'MM/DD/YYYY HH:mm:ss').toDate();\n }\n function add(date, adder, unit) {\n var datePart = fixUnit(unit);\n return dayjs(date).add(adder, datePart).toDate();\n }\n function range(start, end) {\n var unit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'day';\n var datePart = fixUnit(unit);\n // because the add method will put these in tz, we have to start that way\n var current = dayjs(start).toDate();\n var days = [];\n while (lte(current, end)) {\n days.push(current);\n current = add(current, 1, datePart);\n }\n return days;\n }\n function ceil(date, unit) {\n var datePart = fixUnit(unit);\n var floor = startOf(date, datePart);\n return eq(floor, date) ? floor : add(floor, 1, datePart);\n }\n function diff(a, b) {\n var unit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'day';\n var datePart = fixUnit(unit);\n // don't use 'defineComparators' here, as we don't want to mutate the values\n var dtA = dayjs(a);\n var dtB = dayjs(b);\n return dtB.diff(dtA, datePart);\n }\n function minutes(date) {\n var dt = dayjs(date);\n return dt.minutes();\n }\n function firstOfWeek(culture) {\n var data = culture ? dayjsLib.localeData(culture) : dayjsLib.localeData();\n return data ? data.firstDayOfWeek() : 0;\n }\n function firstVisibleDay(date) {\n return dayjs(date).startOf('month').startOf('week').toDate();\n }\n function lastVisibleDay(date) {\n return dayjs(date).endOf('month').endOf('week').toDate();\n }\n function visibleDays(date) {\n var current = firstVisibleDay(date);\n var last = lastVisibleDay(date);\n var days = [];\n while (lte(current, last)) {\n days.push(current);\n current = add(current, 1, 'd');\n }\n return days;\n }\n /*** END localized date arithmetic methods with dayjs ***/\n\n /**\n * Moved from TimeSlots.js, this method overrides the method of the same name\n * in the localizer.js, using dayjs to construct the js Date\n * @param {Date} dt - date to start with\n * @param {Number} minutesFromMidnight\n * @param {Number} offset\n * @returns {Date}\n */\n function getSlotDate(dt, minutesFromMidnight, offset) {\n return dayjs(dt).startOf('day').minute(minutesFromMidnight + offset).toDate();\n }\n\n // dayjs will automatically handle DST differences in it's calculations\n function getTotalMin(start, end) {\n return diff(start, end, 'minutes');\n }\n function getMinutesFromMidnight(start) {\n var dayStart = dayjs(start).startOf('day');\n var day = dayjs(start);\n return day.diff(dayStart, 'minutes') + getDayStartDstOffset(start);\n }\n\n // These two are used by DateSlotMetrics\n function continuesPrior(start, first) {\n var djStart = dayjs(start);\n var djFirst = dayjs(first);\n return djStart.isBefore(djFirst, 'day');\n }\n function continuesAfter(start, end, last) {\n var djEnd = dayjs(end);\n var djLast = dayjs(last);\n return djEnd.isSameOrAfter(djLast, 'minutes');\n }\n function daySpan(start, end) {\n var startDay = dayjs(start);\n var endDay = dayjs(end);\n return endDay.diff(startDay, 'day');\n }\n\n // These two are used by eventLevels\n function sortEvents(_ref6) {\n var _ref6$evtA = _ref6.evtA,\n aStart = _ref6$evtA.start,\n aEnd = _ref6$evtA.end,\n aAllDay = _ref6$evtA.allDay,\n _ref6$evtB = _ref6.evtB,\n bStart = _ref6$evtB.start,\n bEnd = _ref6$evtB.end,\n bAllDay = _ref6$evtB.allDay;\n var startSort = +startOf(aStart, 'day') - +startOf(bStart, 'day');\n var durA = daySpan(aStart, aEnd);\n var durB = daySpan(bStart, bEnd);\n return startSort ||\n // sort by start Day first\n durB - durA ||\n // events spanning multiple days go first\n !!bAllDay - !!aAllDay ||\n // then allDay single day events\n +aStart - +bStart ||\n // then sort by start time *don't need dayjs conversion here\n +aEnd - +bEnd // then sort by end time *don't need dayjs conversion here either\n ;\n }\n function inEventRange(_ref7) {\n var _ref7$event = _ref7.event,\n start = _ref7$event.start,\n end = _ref7$event.end,\n _ref7$range = _ref7.range,\n rangeStart = _ref7$range.start,\n rangeEnd = _ref7$range.end;\n var startOfDay = dayjs(start).startOf('day');\n var eEnd = dayjs(end);\n var rStart = dayjs(rangeStart);\n var rEnd = dayjs(rangeEnd);\n var startsBeforeEnd = startOfDay.isSameOrBefore(rEnd, 'day');\n // when the event is zero duration we need to handle a bit differently\n var sameMin = !startOfDay.isSame(eEnd, 'minutes');\n var endsAfterStart = sameMin ? eEnd.isAfter(rStart, 'minutes') : eEnd.isSameOrAfter(rStart, 'minutes');\n return startsBeforeEnd && endsAfterStart;\n }\n function isSameDate(date1, date2) {\n var dt = dayjs(date1);\n var dt2 = dayjs(date2);\n return dt.isSame(dt2, 'day');\n }\n\n /**\n * This method, called once in the localizer constructor, is used by eventLevels\n * 'eventSegments()' to assist in determining the 'span' of the event in the display,\n * specifically when using a timezone that is greater than the browser native timezone.\n * @returns number\n */\n function browserTZOffset() {\n /**\n * Date.prototype.getTimezoneOffset horrifically flips the positive/negative from\n * what you see in it's string, so we have to jump through some hoops to get a value\n * we can actually compare.\n */\n var dt = new Date();\n var neg = /-/.test(dt.toString()) ? '-' : '';\n var dtOffset = dt.getTimezoneOffset();\n var comparator = Number(\"\".concat(neg).concat(Math.abs(dtOffset)));\n // dayjs correctly provides positive/negative offset, as expected\n var mtOffset = dayjs().utcOffset();\n return mtOffset > comparator ? 1 : 0;\n }\n return new DateLocalizer({\n formats: formats,\n firstOfWeek: firstOfWeek,\n firstVisibleDay: firstVisibleDay,\n lastVisibleDay: lastVisibleDay,\n visibleDays: visibleDays,\n format: function format(value, _format, culture) {\n return locale(dayjs(value), culture).format(_format);\n },\n lt: lt,\n lte: lte,\n gt: gt,\n gte: gte,\n eq: eq,\n neq: neq,\n merge: merge,\n inRange: inRange,\n startOf: startOf,\n endOf: endOf,\n range: range,\n add: add,\n diff: diff,\n ceil: ceil,\n min: min,\n max: max,\n minutes: minutes,\n getSlotDate: getSlotDate,\n getTimezoneOffset: getTimezoneOffset,\n getDstOffset: getDstOffset,\n getTotalMin: getTotalMin,\n getMinutesFromMidnight: getMinutesFromMidnight,\n continuesPrior: continuesPrior,\n continuesAfter: continuesAfter,\n sortEvents: sortEvents,\n inEventRange: inEventRange,\n isSameDate: isSameDate,\n browserTZOffset: browserTZOffset\n });\n}\n\nvar components = {\n eventWrapper: NoopWrapper,\n timeSlotWrapper: NoopWrapper,\n dateCellWrapper: NoopWrapper\n};\n\nexport { Calendar$1 as Calendar, DateLocalizer, navigate as Navigate, views as Views, components, dateFnsLocalizer, dayjs as dayjsLocalizer, globalize as globalizeLocalizer, luxon as luxonLocalizer, moment as momentLocalizer, moveDate as move };\n","!function(V,e){if(\"object\"===typeof exports&&\"object\"===typeof module)module.exports=e(require(\"react\"));else if(\"function\"===typeof define&&define.amd)define([\"react\"],e);else{var t=e(\"object\"===typeof exports?require(\"react\"):V.react);for(var n in t)(\"object\"===typeof exports?exports:V)[n]=t[n]}}(this,function(V){return function(V){function e(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return V[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var t={};return e.m=V,e.c=t,e.d=function(V,t,n){e.o(V,t)||Object.defineProperty(V,t,{configurable:!1,enumerable:!0,get:n})},e.n=function(V){var t=V&&V.__esModule?function(){return V.default}:function(){return V};return e.d(t,\"a\",t),t},e.o=function(V,e){return Object.prototype.hasOwnProperty.call(V,e)},e.p=\"\",e(e.s=3)}([function(e,t){e.exports=V},function(V,e,t){V.exports=t(7)()},function(V,e,t){!function(e,t){V.exports=t()}(0,function(){return function(V){function e(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return V[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var t={};return e.m=V,e.c=t,e.d=function(V,t,n){e.o(V,t)||Object.defineProperty(V,t,{configurable:!1,enumerable:!0,get:n})},e.n=function(V){var t=V&&V.__esModule?function(){return V.default}:function(){return V};return e.d(t,\"a\",t),t},e.o=function(V,e){return Object.prototype.hasOwnProperty.call(V,e)},e.p=\"\",e(e.s=1)}([function(V,e,t){\"use strict\";function n(V,e,t){return e in V?Object.defineProperty(V,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):V[e]=t,V}t.d(e,\"e\",function(){return i}),t.d(e,\"a\",function(){return o}),t.d(e,\"f\",function(){return a}),t.d(e,\"c\",function(){return A}),t.d(e,\"b\",function(){return c}),t.d(e,\"d\",function(){return u});var r,i=[\"user\",\"environment\"],o={USER:\"user\",ENVIRONMENT:\"environment\"},a=[\"jpg\",\"png\"],A={PNG:\"png\",JPG:\"jpg\"},c=(r={},n(r,\"jpg\",\"image/jpeg\"),n(r,\"png\",\"image/png\"),r),u={audio:!1,video:!0}},function(V,e,t){V.exports=t(2)},function(V,e,t){\"use strict\";function n(V,e){if(!(V instanceof e))throw new TypeError(\"Cannot call a class as a function\")}Object.defineProperty(e,\"__esModule\",{value:!0}),t.d(e,\"FACING_MODES\",function(){return c}),t.d(e,\"IMAGE_TYPES\",function(){return u});var r=t(3),i=t(5),o=function(){function V(V,e){for(var t=0;t0&&e[0].getSettings&&(this.settings=e[0].getSettings())}},{key:\"_getInputVideoDeviceInfosPromise\",value:function(){var V=this;return new Promise(function(e,t){var n=[];V.mediaDevices.enumerateDevices().then(function(V){V.forEach(function(V){\"videoinput\"===V.kind&&n.push(V)}),e(n)}).catch(function(V){t(V)})})}},{key:\"_gotStream\",value:function(V){this.stream=V,this._setSettings(V),this._setVideoSrc(V)}},{key:\"getCameraSettings\",value:function(){return this.settings}},{key:\"getInputVideoDeviceInfos\",value:function(){return this.inputVideoDeviceInfos}},{key:\"startCamera\",value:function(V,e){var t=this;return this.stopCamera().then(function(){}).catch(function(){}).then(function(){return t._getStreamDevice(V,e)})}},{key:\"startCameraMaxResolution\",value:function(){var V=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.stopCamera().then(function(){}).catch(function(){}).then(function(){return V._getStreamDeviceMaxResolution(e)})}},{key:\"getDataUri\",value:function(V){var e={sizeFactor:void 0===V.sizeFactor?i.c:V.sizeFactor,imageType:void 0===V.imageType?a:V.imageType,imageCompression:void 0===V.imageCompression?i.a:V.imageCompression,isImageMirror:void 0===V.isImageMirror?i.b:V.isImageMirror};return r.a.getDataUri(this.videoElement,e)}},{key:\"stopCamera\",value:function(){var V=this;return new Promise(function(e,t){V.stream&&(V.stream.getTracks().forEach(function(V){V.stop()}),V.videoElement.src=\"\",V.stream=null,V._setSettings(null),e()),t(Error(\"no stream to stop!\"))})}}]),V}(),c=r.a.FACING_MODES,u=r.a.IMAGE_TYPES;e.default=A},function(V,e,t){\"use strict\";function n(V,e){if(!(V instanceof e))throw new TypeError(\"Cannot call a class as a function\")}var r=t(4),i=t(0),o=function(){function V(V,e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1],n=V.getIdealConstraints(e),r=n.video.facingMode,i=[{width:{min:640},ideal:{facingMode:r}},{width:{min:800},ideal:{facingMode:r}},{width:{min:900},ideal:{facingMode:r}},{width:{min:1024},ideal:{facingMode:r}},{width:{min:1080},ideal:{facingMode:r}},{width:{min:1280},ideal:{facingMode:r}},{width:{min:1920},ideal:{facingMode:r}},{width:{min:2560},ideal:{facingMode:r}},{width:{min:3840},ideal:{facingMode:r}}];if(t>=i.length)return null;var o=i.slice(0,-t);return n.video.advanced=o,n}},{key:\"FACING_MODES\",get:function(){return i.a}},{key:\"IMAGE_TYPES\",get:function(){return i.c}}]),V}();e.a=a},function(V,e,t){\"use strict\";function n(V,e){if(!(e>=0&&e<=1))throw new Error(e+\" is invalid imageCompression, choose between: [0, 1]\");if(!c.f.includes(V))throw new Error(V+\" is invalid imageType, choose between: \"+c.f.join(\", \"));return!0}function r(V,e){var t={};try{n(V,e),t.imageType=V,t.imageCompression=e}catch(V){console.error(V),console.error(\"default value of \"+c.c.PNG+\" is used\"),t.imageType=c.c.PNG,t.imageCompression=null}return t}function i(V,e,t){var n=V*parseFloat(t);return{imageWidth:n,imageHeight:e/(V/n)}}function o(V,e,t){return r(e,t).imageType===c.c.JPG?t?V.toDataURL(c.b[c.c.JPG],t):V.toDataURL(c.b[c.c.JPG]):V.toDataURL(c.b[e])}function a(V){if(\"object\"===(\"undefined\"===typeof V?\"undefined\":u(V)))for(var e in V)if(V.hasOwnProperty(e))return!1;return!0}function A(V,e){return!(V||e&&!a(e))}e.b=i,e.a=o,e.c=A;var c=t(0),u=\"function\"===typeof Symbol&&\"symbol\"===typeof Symbol.iterator?function(V){return typeof V}:function(V){return V&&\"function\"===typeof Symbol&&V.constructor===Symbol&&V!==Symbol.prototype?\"symbol\":typeof V}},function(V,e,t){\"use strict\";t.d(e,\"c\",function(){return n}),t.d(e,\"a\",function(){return r}),t.d(e,\"b\",function(){return i});var n=1,r=null,i=!1}])})},function(V,e,t){V.exports=t(4)},function(V,e,t){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var n=t(5);t.d(e,\"Camera\",function(){return n.c}),t.d(e,\"FACING_MODES\",function(){return n.a}),t.d(e,\"IMAGE_TYPES\",function(){return n.b}),e.default=n.c},function(V,e,t){\"use strict\";var n=t(6);t.d(e,\"a\",function(){return n.a}),t.d(e,\"b\",function(){return n.b}),e.c=n.c},function(V,e,t){\"use strict\";function n(V){function e(){d&&clearTimeout(d)}function t(){var t={sizeFactor:V.sizeFactor,imageType:V.imageType,imageCompression:V.imageCompression,isImageMirror:V.isImageMirror},n=j(t);V.isSilentMode||Object(l.c)(),\"function\"===typeof V.onTakePhoto&&V.onTakePhoto(n),A(n),v(!1),e(),d=setTimeout(function(){v(!0),\"function\"===typeof V.onTakePhotoAnimationDone&&V.onTakePhotoAnimationDone(n)},900)}var n=Object(r.useState)(\"\"),o=p(n,2),a=o[0],A=o[1],h=Object(r.useState)(!0),g=p(h,2),m=g[0],v=g[1],y=Object(r.useState)(\"\"),k=p(y,2),b=k[0],E=k[1],w=Object(r.useRef)(null),C=Object(c.a)(w,V.idealFacingMode,V.idealResolution,V.isMaxResolution),I=p(C,4),U=I[0],S=I[1],x=I[2],j=I[3];Object(r.useEffect)(function(){U?\"function\"===typeof V.onCameraStart&&V.onCameraStart(U):\"function\"===typeof V.onCameraStop&&V.onCameraStop()},[U]),Object(r.useEffect)(function(){S&&(E(S.name+\" \"+S.message),\"function\"===typeof V.onCameraError&&V.onCameraError(S))},[S]),Object(r.useEffect)(function(){x&&Object(l.d)(x.message)},[x]);var T=Object(l.b)(m,V.isImageMirror),R=Object(l.a)(!m),L=V.isFullscreen?\"react-html5-camera-photo-fullscreen\":\"\";return i.a.createElement(\"div\",{className:\"react-html5-camera-photo \"+L},i.a.createElement(f.a,{cssClass:\"display-error\",isDisplayError:V.isDisplayStartCameraError,errorMsg:b}),i.a.createElement(s.a,{isShowWhiteFlash:!m}),i.a.createElement(\"img\",{style:R,alt:\"camera\",src:a}),i.a.createElement(\"video\",{style:T,ref:w,autoPlay:!0,muted:\"muted\",playsInline:!0}),i.a.createElement(u.a,{isClicked:!m,onClick:t}))}var r=t(0),i=t.n(r),o=t(1),a=t.n(o),A=t(2),c=(t.n(A),t(9)),u=t(13),s=t(15),f=t(17),l=t(19),h=t(21);t.n(h);t.o(A,\"FACING_MODES\")&&t.d(e,\"a\",function(){return A.FACING_MODES}),t.o(A,\"IMAGE_TYPES\")&&t.d(e,\"b\",function(){return A.IMAGE_TYPES});var p=function(){function V(V,e){var t=[],n=!0,r=!1,i=void 0;try{for(var o,a=V[Symbol.iterator]();!(n=(o=a.next()).done)&&(t.push(o.value),!e||t.length!==e);n=!0);}catch(V){r=!0,i=V}finally{try{!n&&a.return&&a.return()}finally{if(r)throw i}}return t}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return V(e,t);throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}}(),d=null;e.c=n,n.propTypes={onTakePhoto:a.a.func,onTakePhotoAnimationDone:a.a.func,onCameraError:a.a.func,idealFacingMode:a.a.string,idealResolution:a.a.object,imageType:a.a.string,isImageMirror:a.a.bool,isSilentMode:a.a.bool,isDisplayStartCameraError:a.a.bool,imageCompression:a.a.number,isMaxResolution:a.a.bool,isFullscreen:a.a.bool,sizeFactor:a.a.number,onCameraStart:a.a.func,onCameraStop:a.a.func},n.defaultProps={isImageMirror:!0,isDisplayStartCameraError:!0}},function(V,e,t){\"use strict\";function n(){}function r(){}var i=t(8);r.resetWarningCache=n,V.exports=function(){function V(V,e,t,n,r,o){if(o!==i){var a=new Error(\"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types\");throw a.name=\"Invariant Violation\",a}}function e(){return V}V.isRequired=V;var t={array:V,bool:V,func:V,number:V,object:V,string:V,symbol:V,any:V,arrayOf:e,element:V,elementType:V,instanceOf:e,node:V,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:r,resetWarningCache:n};return t.PropTypes=t,t}},function(V,e,t){\"use strict\";V.exports=\"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED\"},function(V,e,t){\"use strict\";function n(V){return function(){var e=V.apply(this,arguments);return new Promise(function(V,t){function n(r,i){try{var o=e[r](i),a=o.value}catch(V){return void t(V)}if(!o.done)return Promise.resolve(a).then(function(V){n(\"next\",V)},function(V){n(\"throw\",V)});V(a)}return n(\"next\")})}}function r(V,e,t,r){function i(V){return s.getDataUri(V)}var A=Object(a.useState)(null),l=u(A,2),h=l[0],p=l[1],d=Object(a.useState)(null),g=u(d,2),m=g[0],v=g[1],y=Object(a.useState)(null),k=u(y,2),b=k[0],E=k[1];return Object(a.useEffect)(function(){V&&V.current&&(s=new c.a(V.current))},[V]),Object(a.useEffect)(function(){var i=function(){var V=n(o.a.mark(function V(){var n;return o.a.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:if(f=!0,V.prev=1,n=null,!r){V.next=9;break}return V.next=6,s.startCameraMaxResolution(e);case 6:n=V.sent,V.next=12;break;case 9:return V.next=11,s.startCamera(e,t);case 11:n=V.sent;case 12:p(n),v(null),V.next=19;break;case 16:V.prev=16,V.t0=V.catch(1),v(V.t0);case 19:case\"end\":return V.stop()}},V,this,[[1,16]])}));return function(){return V.apply(this,arguments)}}();if(h)return function(){function e(){return t.apply(this,arguments)}var t=n(o.a.mark(function e(){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!f){e.next=5;break}return f=!1,e.next=5,s.stopCamera();case 5:V&&V.current&&(p(null),E(null)),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),E(e.t0);case 11:case\"end\":return e.stop()}},e,this,[[0,8]])}));return e}();i()},[V,h,e,t,r]),[h,m,b,i]}e.a=r;var i=t(10),o=t.n(i),a=t(0),A=(t.n(a),t(2)),c=t.n(A),u=function(){function V(V,e){var t=[],n=!0,r=!1,i=void 0;try{for(var o,a=V[Symbol.iterator]();!(n=(o=a.next()).done)&&(t.push(o.value),!e||t.length!==e);n=!0);}catch(V){r=!0,i=V}finally{try{!n&&a.return&&a.return()}finally{if(r)throw i}}return t}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return V(e,t);throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}}(),s=null,f=!1},function(V,e,t){V.exports=t(11)},function(V,e,t){var n=function(){return this}()||Function(\"return this\")(),r=n.regeneratorRuntime&&Object.getOwnPropertyNames(n).indexOf(\"regeneratorRuntime\")>=0,i=r&&n.regeneratorRuntime;if(n.regeneratorRuntime=void 0,V.exports=t(12),r)n.regeneratorRuntime=i;else try{delete n.regeneratorRuntime}catch(V){n.regeneratorRuntime=void 0}},function(V,e){!function(e){\"use strict\";function t(V,e,t,n){var i=e&&e.prototype instanceof r?e:r,o=Object.create(i.prototype),a=new l(n||[]);return o._invoke=c(V,t,a),o}function n(V,e,t){try{return{type:\"normal\",arg:V.call(e,t)}}catch(V){return{type:\"throw\",arg:V}}}function r(){}function i(){}function o(){}function a(V){[\"next\",\"throw\",\"return\"].forEach(function(e){V[e]=function(V){return this._invoke(e,V)}})}function A(V){function e(t,r,i,o){var a=n(V[t],V,r);if(\"throw\"!==a.type){var A=a.arg,c=A.value;return c&&\"object\"===typeof c&&m.call(c,\"__await\")?Promise.resolve(c.__await).then(function(V){e(\"next\",V,i,o)},function(V){e(\"throw\",V,i,o)}):Promise.resolve(c).then(function(V){A.value=V,i(A)},o)}o(a.arg)}function t(V,t){function n(){return new Promise(function(n,r){e(V,t,n,r)})}return r=r?r.then(n,n):n()}var r;this._invoke=t}function c(V,e,t){var r=C;return function(i,o){if(r===U)throw new Error(\"Generator is already running\");if(r===S){if(\"throw\"===i)throw o;return p()}for(t.method=i,t.arg=o;;){var a=t.delegate;if(a){var A=u(a,t);if(A){if(A===x)continue;return A}}if(\"next\"===t.method)t.sent=t._sent=t.arg;else if(\"throw\"===t.method){if(r===C)throw r=S,t.arg;t.dispatchException(t.arg)}else\"return\"===t.method&&t.abrupt(\"return\",t.arg);r=U;var c=n(V,e,t);if(\"normal\"===c.type){if(r=t.done?S:I,c.arg===x)continue;return{value:c.arg,done:t.done}}\"throw\"===c.type&&(r=S,t.method=\"throw\",t.arg=c.arg)}}}function u(V,e){var t=V.iterator[e.method];if(t===d){if(e.delegate=null,\"throw\"===e.method){if(V.iterator.return&&(e.method=\"return\",e.arg=d,u(V,e),\"throw\"===e.method))return x;e.method=\"throw\",e.arg=new TypeError(\"The iterator does not provide a 'throw' method\")}return x}var r=n(t,V.iterator,e.arg);if(\"throw\"===r.type)return e.method=\"throw\",e.arg=r.arg,e.delegate=null,x;var i=r.arg;return i?i.done?(e[V.resultName]=i.value,e.next=V.nextLoc,\"return\"!==e.method&&(e.method=\"next\",e.arg=d),e.delegate=null,x):i:(e.method=\"throw\",e.arg=new TypeError(\"iterator result is not an object\"),e.delegate=null,x)}function s(V){var e={tryLoc:V[0]};1 in V&&(e.catchLoc=V[1]),2 in V&&(e.finallyLoc=V[2],e.afterLoc=V[3]),this.tryEntries.push(e)}function f(V){var e=V.completion||{};e.type=\"normal\",delete e.arg,V.completion=e}function l(V){this.tryEntries=[{tryLoc:\"root\"}],V.forEach(s,this),this.reset(!0)}function h(V){if(V){var e=V[y];if(e)return e.call(V);if(\"function\"===typeof V.next)return V;if(!isNaN(V.length)){var t=-1,n=function e(){for(;++t=0;--n){var r=this.tryEntries[n],i=r.completion;if(\"root\"===r.tryLoc)return e(\"end\");if(r.tryLoc<=this.prev){var o=m.call(r,\"catchLoc\"),a=m.call(r,\"finallyLoc\");if(o&&a){if(this.prev=0;--t){var n=this.tryEntries[t];if(n.tryLoc<=this.prev&&m.call(n,\"finallyLoc\")&&this.prev=0;--e){var t=this.tryEntries[e];if(t.finallyLoc===V)return this.complete(t.completion,t.afterLoc),f(t),x}},catch:function(V){for(var e=this.tryEntries.length-1;e>=0;--e){var t=this.tryEntries[e];if(t.tryLoc===V){var n=t.completion;if(\"throw\"===n.type){var r=n.arg;f(t)}return r}}throw new Error(\"illegal catch attempt\")},delegateYield:function(V,e,t){return this.delegate={iterator:h(V),resultName:e,nextLoc:t},\"next\"===this.method&&(this.arg=d),x}}}(function(){return this}()||Function(\"return this\")())},function(V,e,t){\"use strict\";var n=t(0),r=t.n(n),i=t(1),o=t.n(i),a=t(14),A=(t.n(a),function(V){var e=V.onClick,t=V.isClicked,n=t?\"is-clicked\":\"\";return r.a.createElement(\"div\",{id:\"container-circles\"},r.a.createElement(\"div\",{id:\"outer-circle\",onClick:function(V){t||e()}},r.a.createElement(\"div\",{id:\"inner-circle\",className:n})))});A.propTypes={onClick:o.a.func.isRequired,isClicked:o.a.bool.isRequired},e.a=A},function(V,e){},function(V,e,t){\"use strict\";var n=t(0),r=t.n(n),i=t(1),o=t.n(i),a=t(16),A=(t.n(a),function(V){var e=V.isShowWhiteFlash,t=e?\"do-transition\":\"\",n=t+\" normal\";return r.a.createElement(\"div\",{id:\"white-flash\",className:n})});A.propTypes={isShowWhiteFlash:o.a.bool.isRequired},e.a=A},function(V,e){},function(V,e,t){\"use strict\";function n(V,e){return V&&e&&e.length>0}var r=t(0),i=t.n(r),o=t(1),a=t.n(o),A=t(18),c=(t.n(A),function(V){var e=V.isDisplayError,t=V.errorMsg,r=V.cssClass;return n(e,t)?(console.log(\"cssClass\",r),i.a.createElement(\"div\",{className:r,id:\"display-error\"},i.a.createElement(\"h1\",null,\"Camera error: \",t))):null});c.propTypes={isDisplayError:a.a.bool,errorMsg:a.a.string,cssClass:a.a.string},e.a=c},function(V,e){},function(V,e,t){\"use strict\";function n(V){return V?{display:\"inline-block\"}:{display:\"none\"}}function r(V){return V?{transform:\"rotateY(180deg)\"}:{transform:\"none\"}}function i(V,e){return Object.assign({},r(e),n(V))}function o(){new Audio(\"data:audio/mp3;base64,\"+c.a.base64).play()}function a(V){console.info(\"react-html5-camera-photo info:\",V)}e.a=n,e.b=i,e.c=o,e.d=a;var A=t(20),c=t.n(A)},function(V,e){V.exports={base64:\"SUQzBAAAAAAASVRQRTEAAAAcAAADU291bmRKYXkuY29tIFNvdW5kIEVmZmVjdHMAVFNTRQAAAA8AAANMYXZmNTcuNzIuMTAxAAAAAAAAAAAAAAD/+1QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABJbmZvAAAADwAAAB0AACxAAA0NDRUVFR4eHh4nJycvLy8vODg4QUFBQUlJSVJSUlJbW1tjY2NsbGxsdXV1fX19fYaGho+Pj4+Xl5egoKCgqampsbGxurq6usPDw8vLy8vU1NTd3d3d5eXl7u7u7vf39////wAAAABMYXZjNTcuOTMAAAAAAAAAAAAAAAAkAkAAAAAAAAAsQC+b5ZH/+5RkAA/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAAR4RBEitS0FLUmhcO1TSK1JoJrUtC4dpmkUlLQTQUtC4dpqkUkVoJoJpxcO01KKSK1JoJoRcO01i0kUlLGJkCdw7Skpaho4aHGJkCZkO0pIrDBxw0OGHoEzD3aUkVhg4wMHDD0E4tjjUkUgw8YPDhloJxbSaSRSGhxg8YpaCcW00kRSRWpNBOxZ/1VVFlv/9LLLqu//VVVUW//WWWWXd/6VVVVd/+qsssGH/ZZZVVUDt+1VVlli1dIxZZVUDI0RhaqqyzX9GLLLKq/+QtVVGgCAACMZAAY0NkBDHeIlc0SIVc0Kpu8Sudc0SucfQq+iRCd4hOlc0SubvEJ3NHiE76FErnCr13iE74d4hO8Q0SuaJUSuaJXKvEJ330Su8Q0KuaFUJ3iVzcWaJQ7wWYBHSMAgAD4xjjeYxjZ35znnO/zkJOfqQhKnO6B88jTnnOd0IRjhwUZTnO85///znkD/+5Rkrg7gAABpAAAACAAADSAAAAEQ2Y50IITAARuAEEgQjXnhDgIHCKc53IHxdyEbnOehCEkJ+pCelSMp4gHBRQ4HG5CSE8hJCN/U7oIBwONJAAAAABzNHNlZ0RgQYz9Z7iGTHEB/80BaFYCuiQxoNtAsgAYQaVXEGCOw1eAQwscAnqCA4wbgC2AfcLWgsjQU2SxNkDIOQcAICYDsC/QfJunpFwYwiBPhc4QIMLhqQFyQQMafSYToaBt4ucd4uQQUAgwyMNQQuQItic+ghuLAQdlkELTqJsxICMaQ4UERZT0KbbSURTRUOZYcwcwY5MiwoENUDJjGFslwwOn609SlqYXIK0HgXO8XPcbKThcIPIuUVoQiSyXYhB9OtX////+MF0v////zWIAICAEKgAB/mXJmPHgWEBgPOgZOlaYsIFBP+AQ4QLHrqkMPcPAKKBZ7ZFyAhl8AcIGyALmsoLqwDiCwCxhv4aX8i47Q9MOXKIXAEgKFDAxNenFnkHFkEQb/+5RE9QADBV+6LQRgAltMZtWglABa0gEKuaiAC3vAoeM1MAAWYQILzHIICTw5nW7RcBUEpjnkHEoDmA3lH0Xw/cQVFJCxdNqCh2E2Xy+dJs3JsiossdgrUcoTkRIc5t++OWO8ToPJNi5D0XIXSYEJxaidDVAy5PlocIZPW62fVpyLigBQBAHrIuVrJOFrg5pLCcSAkokPocwjSNHPHN0//////////+QhCj7qaGYVYmpqaAAAGq7AwgBlh8VBaQtGWez8jOC40Cs8QWdoEoqxgWS1OGgVhKDhH+mSYIkesyxKFQLAOJPHUkiRlkHQGoXY9YwWxnKGEht1WcAxxbxjowl8ZZOpjMoTFYLhMp1UWNzTcRKlEThVyzRJ9C5JpucTzZNnKasIvafZ4+7b8Nv83+Mazrf1JvUKBJrxNz2pLmfWWKB/Cz8x/7RM5/1Ce/+L76+P5VVv//Of/6N7Pce0F4fxJEPU6bWE3FR6oN5kpCbjkeTdixgeMWuvWJWbPnn/+5RkagAFn1nIzmXgAoEqWPDHsABTQW8/uPeACTkOaPcYsABbsyzEjbu+fchSvlqOGJ9HCWDt1LSxKyl8Ukl5ZzCMTzuj69ziub5eq/GI1/jU05e/Vyef+sLP2UOTjPezyH/2pWN3Kd+UX7tbbLmTSNimTrrEzKqWI82ZXEVz/f+APYQWsTYAFgsDYkDgbEotLbToGU/zJZiBhooccZojHRxKjGTDmIYgELVTQ6I2QqDhXYc7gxAUg/WKLpvmqB/Aa3CjVqNWDqJq6FkPVCvUdaazrdNQLVgv4+X93OD48uq7h+33naGTRWem5b5x8/PzbP34OY+8UeZuq839/vV6xL5/9b/XgaviJ9X39eff////zE3/////R5XdMx9Zlv5kMT+fb+7lKgBsvQwB1JIZFR4wVnWT2FlJ/9ydOZTEtzzjSMAwIrF0HW4nk9iLot6Z7fXzZ9ce865weBD+l9AJVqCZJWiEQsTcMVtf+2qtxuAtqJsBk0mAUCkVg8GmyjH/+5RkCQADSzRfbjFgBDyCa4/GlACMzGFh/PMACSAXa/+SUACjoDx0SmqACERx/bjtG4yJBsfEURAKyS7HTNFQ7ithQtedceTij5ucmkWN8luex6UdfP/y85Ma9PZExfX7fX5N6mDZIDUU5B4GFjoqoho+gmvcXDwfOFEQBAJAImIAIgAEBgoCAACgBWBb6r87R1ptBJTt9CIxPHoSUlxjgK9m/SEj3c159dg8LocfP5dBMH0/+r8bNvCqREJgBAo3AsBPzmJsdpUPjpXS9g9FMzKZrbNwgKTOuEDqnHmTRomLkbR2pd3RDi2Tznwzv//7otGijIoTEh2G3Q46FAgGDpWjmXd5f7f/7jYhgVdpAWecCrcCQt2IrHuQFiFFHxnaDIwAAJAFyyJGMwQlgONtlkI6kliXEWGr3/aI4kBnKOqNM539ilaUrLMZH/lUzP+ubGjlo8qZtgiBDTywUCohJd1f/r7rKml6giMBAAJEqYxixGCLCoy4k/LilUWoA4T/+5RkDIIDKhvW+ekyIkcDiu8kYoQMtHVX56UMiSmMKrj0jJnnxKuJignB5BdoZW+9uSWOWnCfrsssUm7dsQBie/NwY8W5Mcwd2coQYLGa4lTralcVA1UmoIyYTV/+2yAhmrb2/n/usGNZ7WlQTff6IlqcUUhEAJEqA8DKDVVREeIr8esjOrIUkuirufCdazjA811RD9N4LbvbaQCrw4dHvhMDz5A2w6KgoASjBS/Z+oFXtQIWF1JaIlkIxIAVMLauzmL6Rl2Q88yap03k8jXbwTjyBATEib0nyZFm3bJLlisBM01260qLqxtjRyN3m+oeF0gaslaUUUQ+FPb3T5AmE9qgnWRkokRC7/ODQPHdJPvq//9E2/SxEVK8v8htbsiCAAAgWWvTAjwQFpoiNLhYgE54RXwYLM+nGalvD2YxIJBjCwcqYng0c1/O3ts1SX8vgE9ZFUddfs8VPyCUwUA1wwzDBe2/+arbfpkEAAkBTABB0BwGgTAGdBCwAkBHJh7/+5RkDAADMxjUaYxJwkuiap8xIygM4G9Tp5kQmQkTrXzAmmOsHqFdAdFFCiEr5yxbLwZtWEEdVovOs23MAvAStVLKV8IXKgKrT8ncmLedi7bB/cA3VbAaKlqOq5/HaA4InbPz5nmuucADoe6xcBNt7tSPMuqIZAAAJBShDfodhw8JW8ZZJHhUwH3Fw7/DalLuM1CoAAQXCh4QvMhMrHIu0JKhUHpigUiESAQcKQCBYuIlFAIIUGgiPNQr+3/qOciRRBARJTh8shKgNIuRVKUxSdti8UYsSmgfCmU53r4EGDk9h+UaQORLKigsxpCqsGqz2zQThjt29fjfjzCmksKQOfPf4ErnOwvcZIT9DQVP/9TFYZiYuyTT96/zSiWVZKgcauvX/Fd2hVVUNhuyQBJGdRxhU4uKqjyBE8rLjlmFbTMFLMEjhIDHv6NmRNmf/x/F/5cxOiRvEoLByWYmOhp3cSRgUq/7/qoYV0MBAAAAIAdHYSUB4FLQkP5cCxrCATz/+5RkDAADcxrQ+e8ackTCep8wwjpL4TlL56RsgQ2T6HjEiTjmdytbVp+p2hSvFX/J3siqX5Wp2r5mJhZB/SmifjK/QQ4ShGCxzKeZDGcp/kktH8kDWWOSZDARPRv7gK6He3vFplnf/ISQ4UblSirr/7W5uvEVbi7d/41VMOCGZhBRugHYuN2QEgAmo6plMR15BTDpS6GyW+h+zjhlE8LMf//ITt//LrTQsNbb/J9Zyp169ismbG93VWFmoE0ymLyzqiiAgAXG5uD/P1BnCX472hAoSyXQ5JvjJEp2tNIkZx/G6bBA1KGgQYzpIzGm5IWHFI3Mrnvebeakn//f8j/pWaH1rsSqWc2dp0jnbn3/7JmdV7+rm4jPHhXFE1r0tJiYoAAAAigB0SlA5VjmyuiQgE4EkySaHa9QarZQzE+i/c44HSRySJ4CDjRhoytL7p/+PEeSed2CYQgcEgTaIoDtrrpKeaNEABAKbd2LYYyuPAvgvmUzBhOEiQkCUASwM4n/+5RkDwACrRjR+eZCQEOC2f4x5jYL0TlD56RriN8N7HyXiJ54Gw8X6M1cW+MDfWrsKucJQ0gMq/komUNiAq4FSIwOpfEowi0zG6KleQCSwEHCweBskbbnvsRfcri9EggAAUkBeGC1nNGwSq4XGArmaGnlPGbIccshyzql3zEm2iXAZItfIUAwLCoVDYKxffIQWDp2wsVDAJDsKevOnvQcxkqRgBAKSS4GO+X2ZRCBlqF/QtpvneXKjA4qgriVakmnNLSUvMmiVGtept5SCQ5tDuocjzRsk/bPpezir/nVJu2kc4xlwvbaEtJd6zQ6R3eZfPv/ZJ9m7oiBSzn3SsPUuzAigOuJgJs0MnJOxdG1Hos5k5GjucbkewcqlX//d9egcowOwg72yIVFgeHHACCQIp/9PT01NnhGAQAAAknKA6Tbgw7HGWOAnUc4qlQxWxVTQozhF1NqtN4r5ZNzwrSNPp7VsAAhMNBEATOaL/+InKoczbIhOQm8yucxCbkEwBj/+5RkJQACy03O+eEWUj8Cqd0kI2JK7FM957BJCP8LZrDEjRj7MQQulP8iNv1ZQ4OWjvqHfxoAAAVtoBJyKgSboha50SOlHFNhEvo0yk1IDQILHJd8pzLwyCCFsP8b6IUbJYLXxxLBnDxp1STleWZlv/9Kz3aKJGABkluAYT6bKlJ0SsMEFQhDZNG46mJhXjMyWnaEijV2W3UQQjhJ2y0PbgCxKEv/f+ooiGu9UlKa1tKv4sNhxYveU5D+e9J/2/3u9i4YA5osaQqZV7oIAAVOEC1I9By09EwqKkMtLA2RufTbvi1rZ3AWUsGCwYCCGdpMJPBVQLQqxvFCAWEaRqjziYSr/tU5CgK2lSZ5l0MQIByXbAOUTklQFwOgfB8rh4B4jOlhhg7ZuucQTkGoy6+ZAqKKQ6gWMbPkZmZ9al/+kwJlkVSkI3uaVC2PdDdkO2QyMxaaVttL+yKt1NKxBTFCCAVrowyW2stA1KFv0hbLb65ETygHpTFEK1a04Ng4gIb/+5RkOwAC0k7O+YMUUj6BiiwFgg3KmJ8zphhtQRKNZGBmJRA3zVydPlFXGVS////puxqodg5reZNm7/MndWf/JPWm/zFfXM98bBIBmkEAqijiJIAzdzxAOh6LS9CEgB3NmijZQuE95VFuWutlsK2FVMstBJuVY76LLWembjBBYkSAGFCwCSE1Ppa8UNIPf/rQVegNg4JAcJFg6bBbQAIAMCuSFKdNYIqoIFhkZHZCSAvBs6hSPpInc9z4qA4OHAHPHf+l0aFJ/6EAAV2ArBonPBCu1MQoShTe7XNf9XsZ9qpd+AAP+gZLrd1p3akdlU8FYXUqpYXEkAAVGvN3ewT7cvODAwWv/t31+k+EtuUdesnV7G0KUzixLoR06olmbZdiqiqzv7N7ttT6aftruhpizihYWJqUcutcZKiaIBXJKbYkBix6RiszxMK5sJ3Ztcpka/ndJlS85HzhllK4TzomBkODyvw6MKWqB1yAbBMTKNvY95k+RrRGFkLBABAgI4n/+5RkT4QSok5JyeYT4kUDee0Z40mKUJ8YyLypwOeOZChhDhBy6cO3WizCTU0ThVTKhLA6LJCj9VhvNbUxMr572iZ6pVQhrx7L5n3lEWWQSMJMsqkMdU/2ogTDpQ1LUgDmIw0+xSPp8q74NAETGx7fpCHkBgwgHtJJbfdIBQ2Ei9iiS4Fg8HgwECBAIpSoj4KVspVh+KNAkISWq9gdCp655vAt6qxRINC8/20T9M/zI5/3sr5eevDsXTYoZDpVDe4LaAc3X7C+k/mRXV/V5vK5X/MCgvHUGw6tbfym3UZ9VRnJVEgkcSR3dZmtOt37p7dv6f/T6V/5QuVKCHLFJbd+mxP/FHcjQI+/uXECJ7zhGKxohM9ZXlY1KlYdgNDNEOUMYLMaFMiPhVqvdmtZbF0KohuyOtfX+j/+n/xVc7/7fut6xwOQ9a6vx5ougb49A6BJJiQoymSK5RLTnwaC0KFVw9GzUl1d/2ZWq5kZlbpVkQ4EZ1WpHor+uT365V/7vT//+5Rkao9yt1FEAeY+EEBoWIAk4pQJATkOBZhRAQuSIZBzCXDoq+3/8Y3/2M/FBCAObWqHRAAtBiifAQCA1BRpVb52s2S5LI2Dq/8pdzkc9Eo10eK9QbhdwiNCt85vHP1ouZJ3FHtp77tE/0fZHon7N6oJwACADvQx9SohjjDiuogvjxhWFb55pURta2RhcxRyGZ73J0P0VvoiQ4ZlVaNv1djz1ZmtRGX9aKt2/33+1vszag1xXTcAbOWQBd6nCJkAAAwE50ngeCHKFx4NgkajxyDQGDg8gbAB82lgNsldzF0/I1VXDWjZv6losVd/pjqv+mkYxQAgLAqKmFTMqgPTSAlvGL6vsVEwoP4QoNGxYoxifXxK5OK3E9Raod2Xk6CZV263XWvqrscMz9Fa3b0ATfVXh3tQen8E8aMctpDNFg+tKkvaxhtKRI5UCFQOo+ei5Y3ApV5GBuyyL3V5hL1tIrGwRIlHhIqrvQBtZxSWLjrVaqwMSGQ1hqCNaJDGiFH/+5RkhwBSYU3DQUYS4DThKHsAIgQHeGkNgIhqgQQJ4NQAjCJAlFF/+Pt02b8lSSXzdgtLH4ihpv64/LHJp/ekvx66X+Hd5lMVFew/KbF2/CeuO7/xf903H92Cr0eRG0lKHlls5APGEG0b1MrTN/Pxtf92++3b1/ZC7yOuo1L/fUJr99PmOau1+DczWWohH8L0eh/nWTbo8/OvyZ/ccZuEf/+Rn/l/L/M//+ZEqKpH+ZFToqJ+iqi+i/yoi+ip9yhgYMh27OZUWpgoIEd1ITFaxUllRQWcDAaskNCYwCgJAlEQaBsJgsBQSlREGgbCYLBUBAUSiINB2dKnUZK3kSJ1948Y9LNCn/I9c763Wf1AVct8rUxBTUUzLjk5LjVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5REtg5yOQ+/ACAYIkLiWBAEIy5G6UjKQIBcAPWAH5ARjShVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVACCU025+ZGfywyOy3//ksyP+XMmstIyNWCggQNHI1ls////WWRyMmVgYME6GTLJZ///2WWxyNWWSoZGrWyzL/9WVqCBOhkyhgYMI6GrBQUqFpoVFP9bDILCzOLiv/rFRYk//qF+LCrDKm/4o2sVFtbP6hdmLCsyoXUxBTUUzLjk5LjVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5Rkjg/ygl8ruCAaQiiABWAAAAAAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjk5LjVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5RkUY/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjk5LjVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5RkUY/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjk5LjVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5RkUY/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjk5LjVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5RkUY/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjk5LjVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5RkUY/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjk5LjVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5RkUY/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjk5LjVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5RkUY/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjk5LjVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5RkUY/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjk5LjVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5RkUY/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjk5LjVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5RkUY/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjk5LjVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5RkUY/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjk5LjVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5RkUY/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjk5LjVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+5RkUY/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVU=\"}},function(V,e){}])});\n//# sourceMappingURL=index.js.map","\"use strict\";\"production\"===process.env.NODE_ENV?module.exports=require(\"./js/react-notifications.prod.js\"):module.exports=require(\"./js/react-notifications.dev.js\");","module.exports=function(t){var i={};function e(n){if(i[n])return i[n].exports;var o=i[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=i,e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{enumerable:!0,get:n})},e.r=function(t){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},e.t=function(t,i){if(1&i&&(t=e(t)),8&i)return t;if(4&i&&\"object\"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:t}),2&i&&\"string\"!=typeof t)for(var o in t)e.d(n,o,function(i){return t[i]}.bind(null,o));return n},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,\"a\",i),i},e.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},e.p=\"\",e(e.s=2)}([function(t,i){t.exports=require(\"react\")},function(t,i,e){},function(t,i,e){\"use strict\";e.r(i),e.d(i,\"store\",(function(){return m}));var n=e(0),o=e.n(n);const s=!0,a=768,r=325,c=\"notification__item\";var l,h,u,d;!function(t){t.BOTTOM_LEFT=\"bottom-left\",t.BOTTOM_RIGHT=\"bottom-right\",t.BOTTOM_CENTER=\"bottom-center\",t.TOP_LEFT=\"top-left\",t.TOP_RIGHT=\"top-right\",t.TOP_CENTER=\"top-center\",t.CENTER=\"center\",t.TOP_FULL=\"top-full\",t.BOTTOM_FULL=\"bottom-full\"}(l||(l={})),function(t){t.TOP=\"top\",t.BOTTOM=\"bottom\"}(h||(h={})),function(t){t.SUCCESS=\"success\",t.DANGER=\"danger\",t.INFO=\"info\",t.DEFAULT=\"default\",t.WARNING=\"warning\"}(u||(u={})),function(t){t.TIMEOUT=\"timeout\",t.CLICK=\"click\",t.TOUCH=\"touch\",t.MANUAL=\"manual\"}(d||(d={}));var m=new class{constructor(){this.incrementCounter=()=>this.counter+=1,this.getCounter=()=>this.counter,this.counter=0,this.add=null}addNotification(t){this.incrementCounter();const i=function(t,i,e){const n=t,{id:o,type:s,insert:a,content:r,container:c,animationIn:l,animationOut:h,slidingEnter:d,slidingExit:p,touchRevert:E,touchSlidingExit:T,dismiss:N,width:O,onRemoval:g}=n;n.id=o||m.getCounter().toString(),n.type=r?null:s.toLowerCase(),i&&!r&&(n.userDefinedTypes=function(t,i){const{content:e,type:n}=t;if(e)return;if(n===u.SUCCESS||n===u.DANGER||n===u.INFO||n===u.DEFAULT||n===u.WARNING||!i)return;return i}(n,i));n.width=f(O)?e:O,n.container=c.toLowerCase(),n.insert=(a||\"top\").toLowerCase(),n.dismiss=function(t){const i=t,e={duration:0,click:!0,touch:!0,onScreen:!1,pauseOnHover:!1,waitForAnimation:!1,showIcon:!1};if(!i)return e;return Object.keys(e).forEach(t=>{f(i[t])&&(i[t]=e[t])}),i}(N),n.animationIn=l||[],n.animationOut=h||[],n.onRemoval=g||(()=>{});const b=(t,i,e)=>({duration:t,timingFunction:i,delay:e});n.slidingEnter=v(d,b(600,\"linear\",0)),n.slidingExit=v(p,b(600,\"linear\",0)),n.touchRevert=v(E,b(600,\"linear\",0));const S=T||{},y=S.swipe||{},_=S.fade||{};return n.touchSlidingExit=S,n.touchSlidingExit.swipe=v(y,b(600,\"linear\",0)),n.touchSlidingExit.fade=v(_,b(300,\"linear\",0)),n}(t,this.types,this.defaultNotificationWidth);return this.add(i)}register(t){const{addNotification:i,removeNotification:e,removeAllNotifications:n,types:o,defaultNotificationWidth:s}=t;this.add=i,this.removeNotification=e,this.removeAllNotifications=n,this.defaultNotificationWidth=s,this.types=o}};const f=t=>null==t;function p(t){return t===l.BOTTOM_FULL||t===l.BOTTOM_LEFT||t===l.BOTTOM_RIGHT||t===l.BOTTOM_CENTER}function E(t){return t===l.TOP_FULL||t===l.TOP_LEFT||t===l.TOP_RIGHT||t===l.TOP_CENTER}function T(t){const{type:i,content:e,userDefinedTypes:n}=t,o=[c];if(e)return o;if(f(n))return function(t){switch(t){case u.DEFAULT:return[c,\"notification__item--default\"];case u.SUCCESS:return[c,\"notification__item--success\"];case u.DANGER:return[c,\"notification__item--danger\"];case u.WARNING:return[c,\"notification__item--warning\"];case u.INFO:return[c,\"notification__item--info\"];default:return[c]}}(i);const s=n.find(t=>t.name===i);return o.concat(s.htmlClasses)}function N({duration:t,timingFunction:i,delay:e},n){return`${t}ms ${n} ${i} ${e}ms`}function v(t,{duration:i,timingFunction:e,delay:n}){const o=t||{};return f(o.duration)&&(o.duration=i),f(o.timingFunction)&&(o.timingFunction=e),f(o.delay)&&(o.delay=n),o}class O{constructor(t,i){this.callback=t,this.remaining=i,this.resume()}pause(){clearTimeout(this.timerId),this.remaining-=Date.now()-this.start}resume(){this.start=Date.now(),clearTimeout(this.timerId),this.timerId=setTimeout(this.callback,this.remaining)}clear(){clearTimeout(this.timerId)}}class g extends o.a.Component{constructor(t){super(t),this.onClick=()=>{const{notification:{dismiss:t}}=this.props;(t.click||t.showIcon)&&this.removeNotification(d.CLICK)},this.onTouchStart=t=>{const{pageX:i}=t.touches[0];this.setState(({parentStyle:t})=>({startX:i,currentX:i,parentStyle:Object.assign(Object.assign({},t),{position:\"relative\"})}))},this.onTouchMove=t=>{const{pageX:i}=t.touches[0],{startX:e}=this.state,{toggleRemoval:n,notification:{id:o,onRemoval:s,slidingExit:a,touchSlidingExit:{swipe:r,fade:c}}}=this.props,l=i-e,{offsetWidth:h}=this.rootElementRef.current,u=window.innerWidth+h,m=(i-e>=0?u:-u)+\"px\";if(function(t,i){return Math.abs(t)>=.4*i}(l,h)){const t=N(r,\"left\"),i=N(c,\"opacity\"),e=()=>{n(o,()=>s(o,d.TOUCH))};return this.setState(({parentStyle:n})=>({touchEnabled:!1,parentStyle:Object.assign(Object.assign({},n),{left:m,opacity:0,transition:`${t}, ${i}`}),onTransitionEnd:()=>{this.setState(({parentStyle:t})=>({parentStyle:Object.assign(Object.assign({},t),{height:\"0px\",overflow:\"hidden\",transition:N(a,\"height\")}),onTransitionEnd:e}))}}))}return this.setState(({parentStyle:t})=>({currentX:i,parentStyle:Object.assign(Object.assign({},t),{left:0+l+\"px\"})}))},this.onTouchEnd=()=>{const{notification:{touchRevert:t}}=this.props;this.setState(({parentStyle:i})=>({parentStyle:Object.assign(Object.assign({},i),{left:0,transition:N(t,\"left\")})}))},this.onMouseEnter=()=>{this.timer?this.timer.pause():this.setState({animationPlayState:\"paused\"})},this.onMouseLeave=()=>{this.timer?this.timer.resume():this.setState({animationPlayState:\"running\"})},this.rootElementRef=o.a.createRef();const{defaultNotificationWidth:i,notification:e,isMobile:n}=t,{width:s,container:a}=e;this.state={parentStyle:{height:\"0px\",overflow:\"hidden\",width:(s||i)+\"px\"},htmlClassList:T(e),animationPlayState:\"running\",touchEnabled:!0};const r=-1!==[l.TOP_FULL,l.BOTTOM_FULL,l.TOP_CENTER,l.BOTTOM_CENTER,l.CENTER].indexOf(a);(n||r)&&(this.state.parentStyle.width=\"100%\")}componentWillUnmount(){this.timer&&this.timer.clear()}componentDidMount(){const{notification:t,notificationsCount:i}=this.props,{dismiss:{duration:e,onScreen:n}}=t,o=function(t,i){return!(i<=1)&&i>1&&(t.insert===h.TOP&&E(t.container)||t.insert===h.BOTTOM&&p(t.container)||t.container===l.CENTER)}(t,i),{scrollHeight:s}=this.rootElementRef.current,a=()=>{if(!e||n)return;this.timer=new O(()=>this.removeNotification(d.TIMEOUT),e)};this.setState(({parentStyle:{width:i}})=>({parentStyle:{width:i,height:s+\"px\",transition:o?N(t.slidingEnter,\"height\"):\"10ms height\"},onTransitionEnd:a}),()=>{requestAnimationFrame(()=>{this.setState(i=>({htmlClassList:[...t.animationIn,...i.htmlClassList]}))})})}componentDidUpdate({hasBeenRemoved:t}){this.props.hasBeenRemoved&&!t&&this.removeNotification(d.MANUAL)}removeNotification(t){const{notification:i,toggleRemoval:e}=this.props,{id:n,onRemoval:o,dismiss:{waitForAnimation:s}}=i,a=[...i.animationOut,...T(i)],r=()=>e(n,()=>o(n,t)),c={height:\"0px\",overflow:\"hidden\",transition:N(i.slidingExit,\"height\")};return s?this.setState(({parentStyle:{width:t}})=>({htmlClassList:a,onAnimationEnd:()=>{this.setState({parentStyle:Object.assign({width:t},c),onTransitionEnd:r})}})):this.setState(({parentStyle:{width:t}})=>({parentStyle:Object.assign({width:t},c),onTransitionEnd:r,htmlClassList:a}))}renderTimer(){const{notification:{dismiss:t}}=this.props,{duration:i,onScreen:e}=t,{animationPlayState:n}=this.state;if(!i||!e)return;const s={animationName:\"timer\",animationDuration:i+\"ms\",animationTimingFunction:\"linear\",animationFillMode:\"forwards\",animationDelay:\"0\",animationPlayState:n};return o.a.createElement(\"div\",{className:\"notification__timer\"},o.a.createElement(\"div\",{className:\"notification__timer-filler\",onAnimationEnd:()=>this.removeNotification(d.TIMEOUT),style:s}))}renderCustomContent(){const{htmlClassList:t}=this.state,{notification:{id:i,content:e,dismiss:{duration:n,pauseOnHover:s}}}=this.props,a=n>0&&s;return o.a.createElement(\"div\",{className:\"\"+[...t].join(\" \"),onMouseEnter:a?this.onMouseEnter:null,onMouseLeave:a?this.onMouseLeave:null},o.a.isValidElement(e)?e:o.a.createElement(e,Object.assign({},{id:i})))}renderNotification(){const{notification:{title:t,message:i,dismiss:{showIcon:e,duration:n,pauseOnHover:s}}}=this.props,{htmlClassList:a}=this.state,r=n>0&&s;return o.a.createElement(\"div\",{className:\"\"+[...a].join(\" \"),onMouseEnter:r?this.onMouseEnter:null,onMouseLeave:r?this.onMouseLeave:null},o.a.createElement(\"div\",{className:\"notification__content\"},e&&o.a.createElement(\"div\",{className:\"notification__close\",onClick:this.onClick}),t&&o.a.createElement(\"div\",{className:\"notification__title\"},t),o.a.createElement(\"div\",{className:\"notification__message\"},i),this.renderTimer()))}render(){const{notification:{content:t,dismiss:{click:i}}}=this.props,{parentStyle:e,onAnimationEnd:n,onTransitionEnd:s,touchEnabled:a}=this.state;return o.a.createElement(\"div\",{ref:this.rootElementRef,onClick:i?this.onClick:null,className:\"notification\",style:e,onAnimationEnd:n,onTransitionEnd:s,onTouchStart:a?this.onTouchStart:null,onTouchMove:a?this.onTouchMove:null,onTouchEnd:a?this.onTouchEnd:null},t?this.renderCustomContent():this.renderNotification())}}var b=g;e(1);class S extends o.a.Component{constructor(t){super(t),this.handleResize=()=>{this.setState({windowWidth:window.innerWidth})},this.add=t=>(this.setState(({notifications:i})=>({notifications:\"top\"===t.insert?[t,...i]:[...i,t]})),t.id),this.remove=t=>{this.setState(({notifications:i})=>({notifications:i.map(i=>(i.id===t&&(i.hasBeenRemoved=!0),i))}))},this.removeAllNotifications=()=>{this.setState({notifications:this.state.notifications.map(t=>Object.assign(Object.assign({},t),{hasBeenRemoved:!0}))})},this.toggleRemoval=(t,i)=>{this.setState(({notifications:i})=>({notifications:i.filter(({id:i})=>i!==t)}),i)},this.state={isMobile:f(t.isMobile)?s:t.isMobile,breakpoint:f(t.breakpoint)?a:t.breakpoint,notifications:[],windowWidth:void 0}}componentDidMount(){const{types:t,defaultNotificationWidth:i}=this.props;m.register({addNotification:this.add,removeNotification:this.remove,removeAllNotifications:this.removeAllNotifications,defaultNotificationWidth:i||r,types:t}),this.setState({windowWidth:window.innerWidth}),window.addEventListener(\"resize\",this.handleResize)}componentWillUnmount(){window.removeEventListener(\"resize\",this.handleResize)}renderNotifications(t,i){return t.map(e=>o.a.createElement(b,{id:e.id,key:e.id,isMobile:i,defaultNotificationWidth:this.props.defaultNotificationWidth,notification:e,toggleRemoval:this.toggleRemoval,notificationsCount:t.length,hasBeenRemoved:e.hasBeenRemoved}))}renderMobileNotifications(t){const{className:i,id:e}=t,{notifications:n}=this.state,s=function(t){const i=[],e=[];return t.forEach(t=>{const{container:n}=t,{CENTER:o}=l;E(n)||n===o?i.push(t):p(n)&&e.push(t)}),{top:i,bottom:e}}(n),a=this.renderNotifications(s.top,!0),r=this.renderNotifications(s.bottom,!0);return o.a.createElement(\"div\",{id:e,key:\"mobile\",className:\"notifications-component \"+(i||\"\")},o.a.createElement(\"div\",{className:\"notification-container--mobile-top\"},a),o.a.createElement(\"div\",{className:\"notification-container--mobile-bottom\"},r))}renderScreenNotifications(t){const{className:i,id:e}=t,{notifications:n}=this.state,s=function(t){const i=[],e=[],n=[],o=[],s=[],a=[],r=[],c=[],h=[];return t.forEach(t=>{const{container:u}=t;u===l.TOP_FULL?c.push(t):u===l.BOTTOM_FULL?h.push(t):u===l.TOP_LEFT?i.push(t):u===l.TOP_RIGHT?e.push(t):u===l.TOP_CENTER?n.push(t):u===l.BOTTOM_LEFT?o.push(t):u===l.BOTTOM_RIGHT?s.push(t):u===l.BOTTOM_CENTER?a.push(t):u===l.CENTER&&r.push(t)}),{topFull:c,bottomFull:h,topLeft:i,topRight:e,topCenter:n,bottomLeft:o,bottomRight:s,bottomCenter:a,center:r}}(n),a=this.renderNotifications(s.topFull,!1),r=this.renderNotifications(s.bottomFull,!1),c=this.renderNotifications(s.topLeft,!1),h=this.renderNotifications(s.topRight,!1),u=this.renderNotifications(s.topCenter,!1),d=this.renderNotifications(s.bottomLeft,!1),m=this.renderNotifications(s.bottomRight,!1),f=this.renderNotifications(s.bottomCenter,!1),p=this.renderNotifications(s.center,!1);return o.a.createElement(\"div\",{id:e,key:\"screen\",className:\"notifications-component \"+(i||\"\")},o.a.createElement(\"div\",{className:\"notification-container--top-full\"},a),o.a.createElement(\"div\",{className:\"notification-container--bottom-full\"},r),o.a.createElement(\"div\",{className:\"notification-container--top-left\"},c),o.a.createElement(\"div\",{className:\"notification-container--top-right\"},h),o.a.createElement(\"div\",{className:\"notification-container--bottom-left\"},d),o.a.createElement(\"div\",{className:\"notification-container--bottom-right\"},m),o.a.createElement(\"div\",{className:\"notification-container--top-center\"},u),o.a.createElement(\"div\",{className:\"notification-container--center\"},o.a.createElement(\"div\",{className:\"flex-center\"},p)),o.a.createElement(\"div\",{className:\"notification-container--bottom-center\"},f))}render(){const{isMobile:t}=this.props,{windowWidth:i,breakpoint:e}=this.state;return t&&i<=e?this.renderMobileNotifications(this.props):this.renderScreenNotifications(this.props)}}var y=S;i.default=y}]);\n//# sourceMappingURL=react-notifications.prod.js.map","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _lodash = require('lodash.debounce');\n\nvar _lodash2 = _interopRequireDefault(_lodash);\n\nvar _helpers = require('./helpers');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Copyright (c) 2016-present, Ken Hibino.\n * Licensed under the MIT License (MIT).\n * See https://kenny-hibino.github.io/react-places-autocomplete\n */\n\n// transform snake_case to camelCase\nvar formattedSuggestion = function formattedSuggestion(structured_formatting) {\n return {\n mainText: structured_formatting.main_text,\n secondaryText: structured_formatting.secondary_text\n };\n};\n\nvar PlacesAutocomplete = function (_React$Component) {\n _inherits(PlacesAutocomplete, _React$Component);\n\n function PlacesAutocomplete(props) {\n _classCallCheck(this, PlacesAutocomplete);\n\n var _this = _possibleConstructorReturn(this, (PlacesAutocomplete.__proto__ || Object.getPrototypeOf(PlacesAutocomplete)).call(this, props));\n\n _this.init = function () {\n if (!window.google) {\n throw new Error('[react-places-autocomplete]: Google Maps JavaScript API library must be loaded. See: https://github.com/kenny-hibino/react-places-autocomplete#load-google-library');\n }\n\n if (!window.google.maps.places) {\n throw new Error('[react-places-autocomplete]: Google Maps Places library must be loaded. Please add `libraries=places` to the src URL. See: https://github.com/kenny-hibino/react-places-autocomplete#load-google-library');\n }\n\n _this.autocompleteService = new window.google.maps.places.AutocompleteService();\n _this.autocompleteOK = window.google.maps.places.PlacesServiceStatus.OK;\n _this.setState(function (state) {\n if (state.ready) {\n return null;\n } else {\n return { ready: true };\n }\n });\n };\n\n _this.autocompleteCallback = function (predictions, status) {\n _this.setState({ loading: false });\n if (status !== _this.autocompleteOK) {\n _this.props.onError(status, _this.clearSuggestions);\n return;\n }\n var highlightFirstSuggestion = _this.props.highlightFirstSuggestion;\n\n _this.setState({\n suggestions: predictions.map(function (p, idx) {\n return {\n id: p.id,\n description: p.description,\n placeId: p.place_id,\n active: highlightFirstSuggestion && idx === 0 ? true : false,\n index: idx,\n formattedSuggestion: formattedSuggestion(p.structured_formatting),\n matchedSubstrings: p.matched_substrings,\n terms: p.terms,\n types: p.types\n };\n })\n });\n };\n\n _this.fetchPredictions = function () {\n var value = _this.props.value;\n\n if (value.length) {\n _this.setState({ loading: true });\n _this.autocompleteService.getPlacePredictions(_extends({}, _this.props.searchOptions, {\n input: value\n }), _this.autocompleteCallback);\n }\n };\n\n _this.clearSuggestions = function () {\n _this.setState({ suggestions: [] });\n };\n\n _this.clearActive = function () {\n _this.setState({\n suggestions: _this.state.suggestions.map(function (suggestion) {\n return _extends({}, suggestion, {\n active: false\n });\n })\n });\n };\n\n _this.handleSelect = function (address, placeId, suggestion) {\n _this.clearSuggestions();\n if (_this.props.onSelect) {\n _this.props.onSelect(address, placeId, suggestion);\n } else {\n _this.props.onChange(address);\n }\n };\n\n _this.getActiveSuggestion = function () {\n return _this.state.suggestions.find(function (suggestion) {\n return suggestion.active;\n });\n };\n\n _this.selectActiveAtIndex = function (index) {\n var activeName = _this.state.suggestions.find(function (suggestion) {\n return suggestion.index === index;\n }).description;\n _this.setActiveAtIndex(index);\n _this.props.onChange(activeName);\n };\n\n _this.selectUserInputValue = function () {\n _this.clearActive();\n _this.props.onChange(_this.state.userInputValue);\n };\n\n _this.handleEnterKey = function () {\n var activeSuggestion = _this.getActiveSuggestion();\n if (activeSuggestion === undefined) {\n _this.handleSelect(_this.props.value, null, null);\n } else {\n _this.handleSelect(activeSuggestion.description, activeSuggestion.placeId, activeSuggestion);\n }\n };\n\n _this.handleDownKey = function () {\n if (_this.state.suggestions.length === 0) {\n return;\n }\n\n var activeSuggestion = _this.getActiveSuggestion();\n if (activeSuggestion === undefined) {\n _this.selectActiveAtIndex(0);\n } else if (activeSuggestion.index === _this.state.suggestions.length - 1) {\n _this.selectUserInputValue();\n } else {\n _this.selectActiveAtIndex(activeSuggestion.index + 1);\n }\n };\n\n _this.handleUpKey = function () {\n if (_this.state.suggestions.length === 0) {\n return;\n }\n\n var activeSuggestion = _this.getActiveSuggestion();\n if (activeSuggestion === undefined) {\n _this.selectActiveAtIndex(_this.state.suggestions.length - 1);\n } else if (activeSuggestion.index === 0) {\n _this.selectUserInputValue();\n } else {\n _this.selectActiveAtIndex(activeSuggestion.index - 1);\n }\n };\n\n _this.handleInputKeyDown = function (event) {\n /* eslint-disable indent */\n switch (event.key) {\n case 'Enter':\n event.preventDefault();\n _this.handleEnterKey();\n break;\n case 'ArrowDown':\n event.preventDefault(); // prevent the cursor from moving\n _this.handleDownKey();\n break;\n case 'ArrowUp':\n event.preventDefault(); // prevent the cursor from moving\n _this.handleUpKey();\n break;\n case 'Escape':\n _this.clearSuggestions();\n break;\n }\n /* eslint-enable indent */\n };\n\n _this.setActiveAtIndex = function (index) {\n _this.setState({\n suggestions: _this.state.suggestions.map(function (suggestion, idx) {\n if (idx === index) {\n return _extends({}, suggestion, { active: true });\n } else {\n return _extends({}, suggestion, { active: false });\n }\n })\n });\n };\n\n _this.handleInputChange = function (event) {\n var value = event.target.value;\n\n _this.props.onChange(value);\n _this.setState({ userInputValue: value });\n if (!value) {\n _this.clearSuggestions();\n return;\n }\n if (_this.props.shouldFetchSuggestions) {\n _this.debouncedFetchPredictions();\n }\n };\n\n _this.handleInputOnBlur = function () {\n if (!_this.mousedownOnSuggestion) {\n _this.clearSuggestions();\n }\n };\n\n _this.getActiveSuggestionId = function () {\n var activeSuggestion = _this.getActiveSuggestion();\n return activeSuggestion ? 'PlacesAutocomplete__suggestion-' + activeSuggestion.placeId : undefined;\n };\n\n _this.getIsExpanded = function () {\n return _this.state.suggestions.length > 0;\n };\n\n _this.getInputProps = function () {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n if (options.hasOwnProperty('value')) {\n throw new Error('[react-places-autocomplete]: getInputProps does not accept `value`. Use `value` prop instead');\n }\n\n if (options.hasOwnProperty('onChange')) {\n throw new Error('[react-places-autocomplete]: getInputProps does not accept `onChange`. Use `onChange` prop instead');\n }\n\n var defaultInputProps = {\n type: 'text',\n autoComplete: 'off',\n role: 'combobox',\n 'aria-autocomplete': 'list',\n 'aria-expanded': _this.getIsExpanded(),\n 'aria-activedescendant': _this.getActiveSuggestionId(),\n disabled: !_this.state.ready\n };\n\n return _extends({}, defaultInputProps, options, {\n onKeyDown: (0, _helpers.compose)(_this.handleInputKeyDown, options.onKeyDown),\n onBlur: (0, _helpers.compose)(_this.handleInputOnBlur, options.onBlur),\n value: _this.props.value,\n onChange: function onChange(event) {\n _this.handleInputChange(event);\n }\n });\n };\n\n _this.getSuggestionItemProps = function (suggestion) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var handleSuggestionMouseEnter = _this.handleSuggestionMouseEnter.bind(_this, suggestion.index);\n var handleSuggestionClick = _this.handleSuggestionClick.bind(_this, suggestion);\n\n return _extends({}, options, {\n key: suggestion.id,\n id: _this.getActiveSuggestionId(),\n role: 'option',\n onMouseEnter: (0, _helpers.compose)(handleSuggestionMouseEnter, options.onMouseEnter),\n onMouseLeave: (0, _helpers.compose)(_this.handleSuggestionMouseLeave, options.onMouseLeave),\n onMouseDown: (0, _helpers.compose)(_this.handleSuggestionMouseDown, options.onMouseDown),\n onMouseUp: (0, _helpers.compose)(_this.handleSuggestionMouseUp, options.onMouseUp),\n onTouchStart: (0, _helpers.compose)(_this.handleSuggestionTouchStart, options.onTouchStart),\n onTouchEnd: (0, _helpers.compose)(_this.handleSuggestionMouseUp, options.onTouchEnd),\n onClick: (0, _helpers.compose)(handleSuggestionClick, options.onClick)\n });\n };\n\n _this.handleSuggestionMouseEnter = function (index) {\n _this.setActiveAtIndex(index);\n };\n\n _this.handleSuggestionMouseLeave = function () {\n _this.mousedownOnSuggestion = false;\n _this.clearActive();\n };\n\n _this.handleSuggestionMouseDown = function (event) {\n event.preventDefault();\n _this.mousedownOnSuggestion = true;\n };\n\n _this.handleSuggestionTouchStart = function () {\n _this.mousedownOnSuggestion = true;\n };\n\n _this.handleSuggestionMouseUp = function () {\n _this.mousedownOnSuggestion = false;\n };\n\n _this.handleSuggestionClick = function (suggestion, event) {\n if (event && event.preventDefault) {\n event.preventDefault();\n }\n var description = suggestion.description,\n placeId = suggestion.placeId;\n\n _this.handleSelect(description, placeId, suggestion);\n setTimeout(function () {\n _this.mousedownOnSuggestion = false;\n });\n };\n\n _this.state = {\n loading: false,\n suggestions: [],\n userInputValue: props.value,\n ready: !props.googleCallbackName\n };\n\n _this.debouncedFetchPredictions = (0, _lodash2.default)(_this.fetchPredictions, props.debounce);\n return _this;\n }\n\n _createClass(PlacesAutocomplete, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var googleCallbackName = this.props.googleCallbackName;\n\n if (googleCallbackName) {\n var isPlacesLoaded = window.google && window.google.maps && window.google.maps.places;\n if (!isPlacesLoaded) {\n window[googleCallbackName] = this.init;\n } else {\n this.init();\n }\n } else {\n this.init();\n }\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n var googleCallbackName = this.props.googleCallbackName;\n\n if (googleCallbackName && window[googleCallbackName]) {\n delete window[googleCallbackName];\n }\n }\n }, {\n key: 'render',\n value: function render() {\n return this.props.children({\n getInputProps: this.getInputProps,\n getSuggestionItemProps: this.getSuggestionItemProps,\n loading: this.state.loading,\n suggestions: this.state.suggestions\n });\n }\n }]);\n\n return PlacesAutocomplete;\n}(_react2.default.Component);\n\nPlacesAutocomplete.propTypes = {\n onChange: _propTypes2.default.func.isRequired,\n value: _propTypes2.default.string.isRequired,\n children: _propTypes2.default.func.isRequired,\n onError: _propTypes2.default.func,\n onSelect: _propTypes2.default.func,\n searchOptions: _propTypes2.default.shape({\n bounds: _propTypes2.default.object,\n componentRestrictions: _propTypes2.default.object,\n location: _propTypes2.default.object,\n offset: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string]),\n radius: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string]),\n types: _propTypes2.default.array\n }),\n debounce: _propTypes2.default.number,\n highlightFirstSuggestion: _propTypes2.default.bool,\n shouldFetchSuggestions: _propTypes2.default.bool,\n googleCallbackName: _propTypes2.default.string\n};\n\nPlacesAutocomplete.defaultProps = {\n /* eslint-disable no-unused-vars, no-console */\n onError: function onError(status, _clearSuggestions) {\n return console.error('[react-places-autocomplete]: error happened when fetching data from Google Maps API.\\nPlease check the docs here (https://developers.google.com/maps/documentation/javascript/places#place_details_responses)\\nStatus: ', status);\n },\n /* eslint-enable no-unused-vars, no-console */\n searchOptions: {},\n debounce: 200,\n highlightFirstSuggestion: false,\n shouldFetchSuggestions: true\n};\n\nexports.default = PlacesAutocomplete;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar compose = exports.compose = function compose() {\n for (var _len = arguments.length, fns = Array(_len), _key = 0; _key < _len; _key++) {\n fns[_key] = arguments[_key];\n }\n\n return function () {\n for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n fns.forEach(function (fn) {\n return fn && fn.apply(undefined, args);\n });\n };\n};\n\nvar pick = exports.pick = function pick(obj) {\n for (var _len3 = arguments.length, props = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n props[_key3 - 1] = arguments[_key3];\n }\n\n return props.reduce(function (newObj, prop) {\n if (obj && obj.hasOwnProperty(prop)) {\n newObj[prop] = obj[prop];\n }\n return newObj;\n }, {});\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getLatLng = exports.geocodeByPlaceId = exports.geocodeByAddress = undefined;\n\nvar _PlacesAutocomplete = require('./PlacesAutocomplete');\n\nvar _PlacesAutocomplete2 = _interopRequireDefault(_PlacesAutocomplete);\n\nvar _utils = require('./utils');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.geocodeByAddress = _utils.geocodeByAddress;\nexports.geocodeByPlaceId = _utils.geocodeByPlaceId;\nexports.getLatLng = _utils.getLatLng;\nexports.default = _PlacesAutocomplete2.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar geocodeByAddress = exports.geocodeByAddress = function geocodeByAddress(address) {\n var geocoder = new window.google.maps.Geocoder();\n var OK = window.google.maps.GeocoderStatus.OK;\n\n return new Promise(function (resolve, reject) {\n geocoder.geocode({ address: address }, function (results, status) {\n if (status !== OK) {\n reject(status);\n }\n resolve(results);\n });\n });\n};\n\nvar getLatLng = exports.getLatLng = function getLatLng(result) {\n return new Promise(function (resolve, reject) {\n try {\n var latLng = {\n lat: result.geometry.location.lat(),\n lng: result.geometry.location.lng()\n };\n resolve(latLng);\n } catch (e) {\n reject(e);\n }\n });\n};\n\nvar geocodeByPlaceId = exports.geocodeByPlaceId = function geocodeByPlaceId(placeId) {\n var geocoder = new window.google.maps.Geocoder();\n var OK = window.google.maps.GeocoderStatus.OK;\n\n return new Promise(function (resolve, reject) {\n geocoder.geocode({ placeId: placeId }, function (results, status) {\n if (status !== OK) {\n reject(status);\n }\n resolve(results);\n });\n });\n};","\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nvar _reactFastCompare = _interopRequireDefault(require(\"react-fast-compare\"));\n\nvar _props = require(\"./props\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _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\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar SEEK_ON_PLAY_EXPIRY = 5000;\n\nvar Player = /*#__PURE__*/function (_Component) {\n _inherits(Player, _Component);\n\n var _super = _createSuper(Player);\n\n function Player() {\n var _this;\n\n _classCallCheck(this, Player);\n\n for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {\n _args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(_args));\n\n _defineProperty(_assertThisInitialized(_this), \"mounted\", false);\n\n _defineProperty(_assertThisInitialized(_this), \"isReady\", false);\n\n _defineProperty(_assertThisInitialized(_this), \"isPlaying\", false);\n\n _defineProperty(_assertThisInitialized(_this), \"isLoading\", true);\n\n _defineProperty(_assertThisInitialized(_this), \"loadOnReady\", null);\n\n _defineProperty(_assertThisInitialized(_this), \"startOnPlay\", true);\n\n _defineProperty(_assertThisInitialized(_this), \"seekOnPlay\", null);\n\n _defineProperty(_assertThisInitialized(_this), \"onDurationCalled\", false);\n\n _defineProperty(_assertThisInitialized(_this), \"handlePlayerMount\", function (player) {\n _this.player = player;\n\n _this.player.load(_this.props.url);\n\n _this.progress();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"getInternalPlayer\", function (key) {\n if (!_this.player) return null;\n return _this.player[key];\n });\n\n _defineProperty(_assertThisInitialized(_this), \"progress\", function () {\n if (_this.props.url && _this.player && _this.isReady) {\n var playedSeconds = _this.getCurrentTime() || 0;\n\n var loadedSeconds = _this.getSecondsLoaded();\n\n var duration = _this.getDuration();\n\n if (duration) {\n var progress = {\n playedSeconds: playedSeconds,\n played: playedSeconds / duration\n };\n\n if (loadedSeconds !== null) {\n progress.loadedSeconds = loadedSeconds;\n progress.loaded = loadedSeconds / duration;\n } // Only call onProgress if values have changed\n\n\n if (progress.playedSeconds !== _this.prevPlayed || progress.loadedSeconds !== _this.prevLoaded) {\n _this.props.onProgress(progress);\n }\n\n _this.prevPlayed = progress.playedSeconds;\n _this.prevLoaded = progress.loadedSeconds;\n }\n }\n\n _this.progressTimeout = setTimeout(_this.progress, _this.props.progressFrequency || _this.props.progressInterval);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleReady\", function () {\n if (!_this.mounted) return;\n _this.isReady = true;\n _this.isLoading = false;\n var _this$props = _this.props,\n onReady = _this$props.onReady,\n playing = _this$props.playing,\n volume = _this$props.volume,\n muted = _this$props.muted;\n onReady();\n\n if (!muted && volume !== null) {\n _this.player.setVolume(volume);\n }\n\n if (_this.loadOnReady) {\n _this.player.load(_this.loadOnReady, true);\n\n _this.loadOnReady = null;\n } else if (playing) {\n _this.player.play();\n }\n\n _this.handleDurationCheck();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handlePlay\", function () {\n _this.isPlaying = true;\n _this.isLoading = false;\n var _this$props2 = _this.props,\n onStart = _this$props2.onStart,\n onPlay = _this$props2.onPlay,\n playbackRate = _this$props2.playbackRate;\n\n if (_this.startOnPlay) {\n if (_this.player.setPlaybackRate && playbackRate !== 1) {\n _this.player.setPlaybackRate(playbackRate);\n }\n\n onStart();\n _this.startOnPlay = false;\n }\n\n onPlay();\n\n if (_this.seekOnPlay) {\n _this.seekTo(_this.seekOnPlay);\n\n _this.seekOnPlay = null;\n }\n\n _this.handleDurationCheck();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handlePause\", function (e) {\n _this.isPlaying = false;\n\n if (!_this.isLoading) {\n _this.props.onPause(e);\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleEnded\", function () {\n var _this$props3 = _this.props,\n activePlayer = _this$props3.activePlayer,\n loop = _this$props3.loop,\n onEnded = _this$props3.onEnded;\n\n if (activePlayer.loopOnEnded && loop) {\n _this.seekTo(0);\n }\n\n if (!loop) {\n _this.isPlaying = false;\n onEnded();\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleError\", function () {\n var _this$props4;\n\n _this.isLoading = false;\n\n (_this$props4 = _this.props).onError.apply(_this$props4, arguments);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleDurationCheck\", function () {\n clearTimeout(_this.durationCheckTimeout);\n\n var duration = _this.getDuration();\n\n if (duration) {\n if (!_this.onDurationCalled) {\n _this.props.onDuration(duration);\n\n _this.onDurationCalled = true;\n }\n } else {\n _this.durationCheckTimeout = setTimeout(_this.handleDurationCheck, 100);\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleLoaded\", function () {\n // Sometimes we know loading has stopped but onReady/onPlay are never called\n // so this provides a way for players to avoid getting stuck\n _this.isLoading = false;\n });\n\n return _this;\n }\n\n _createClass(Player, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.mounted = true;\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n clearTimeout(this.progressTimeout);\n clearTimeout(this.durationCheckTimeout);\n\n if (this.isReady && this.props.stopOnUnmount) {\n this.player.stop();\n\n if (this.player.disablePIP) {\n this.player.disablePIP();\n }\n }\n\n this.mounted = false;\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n var _this2 = this;\n\n // If there isn’t a player available, don’t do anything\n if (!this.player) {\n return;\n } // Invoke player methods based on changed props\n\n\n var _this$props5 = this.props,\n url = _this$props5.url,\n playing = _this$props5.playing,\n volume = _this$props5.volume,\n muted = _this$props5.muted,\n playbackRate = _this$props5.playbackRate,\n pip = _this$props5.pip,\n loop = _this$props5.loop,\n activePlayer = _this$props5.activePlayer;\n\n if (!(0, _reactFastCompare[\"default\"])(prevProps.url, url)) {\n if (this.isLoading && !activePlayer.forceLoad) {\n console.warn(\"ReactPlayer: the attempt to load \".concat(url, \" is being deferred until the player has loaded\"));\n this.loadOnReady = url;\n return;\n }\n\n this.isLoading = true;\n this.startOnPlay = true;\n this.onDurationCalled = false;\n this.player.load(url, this.isReady);\n }\n\n if (!prevProps.playing && playing && !this.isPlaying) {\n this.player.play();\n }\n\n if (prevProps.playing && !playing && this.isPlaying) {\n this.player.pause();\n }\n\n if (!prevProps.pip && pip && this.player.enablePIP) {\n this.player.enablePIP();\n }\n\n if (prevProps.pip && !pip && this.player.disablePIP) {\n this.player.disablePIP();\n }\n\n if (prevProps.volume !== volume && volume !== null) {\n this.player.setVolume(volume);\n }\n\n if (prevProps.muted !== muted) {\n if (muted) {\n this.player.mute();\n } else {\n this.player.unmute();\n\n if (volume !== null) {\n // Set volume next tick to fix a bug with DailyMotion\n setTimeout(function () {\n return _this2.player.setVolume(volume);\n });\n }\n }\n }\n\n if (prevProps.playbackRate !== playbackRate && this.player.setPlaybackRate) {\n this.player.setPlaybackRate(playbackRate);\n }\n\n if (prevProps.loop !== loop && this.player.setLoop) {\n this.player.setLoop(loop);\n }\n }\n }, {\n key: \"getDuration\",\n value: function getDuration() {\n if (!this.isReady) return null;\n return this.player.getDuration();\n }\n }, {\n key: \"getCurrentTime\",\n value: function getCurrentTime() {\n if (!this.isReady) return null;\n return this.player.getCurrentTime();\n }\n }, {\n key: \"getSecondsLoaded\",\n value: function getSecondsLoaded() {\n if (!this.isReady) return null;\n return this.player.getSecondsLoaded();\n }\n }, {\n key: \"seekTo\",\n value: function seekTo(amount, type) {\n var _this3 = this;\n\n // When seeking before player is ready, store value and seek later\n if (!this.isReady && amount !== 0) {\n this.seekOnPlay = amount;\n setTimeout(function () {\n _this3.seekOnPlay = null;\n }, SEEK_ON_PLAY_EXPIRY);\n return;\n }\n\n var isFraction = !type ? amount > 0 && amount < 1 : type === 'fraction';\n\n if (isFraction) {\n // Convert fraction to seconds based on duration\n var duration = this.player.getDuration();\n\n if (!duration) {\n console.warn('ReactPlayer: could not seek using fraction – duration not yet available');\n return;\n }\n\n this.player.seekTo(duration * amount);\n return;\n }\n\n this.player.seekTo(amount);\n }\n }, {\n key: \"render\",\n value: function render() {\n var Player = this.props.activePlayer;\n\n if (!Player) {\n return null;\n }\n\n return /*#__PURE__*/_react[\"default\"].createElement(Player, _extends({}, this.props, {\n onMount: this.handlePlayerMount,\n onReady: this.handleReady,\n onPlay: this.handlePlay,\n onPause: this.handlePause,\n onEnded: this.handleEnded,\n onLoaded: this.handleLoaded,\n onError: this.handleError\n }));\n }\n }]);\n\n return Player;\n}(_react.Component);\n\nexports[\"default\"] = Player;\n\n_defineProperty(Player, \"displayName\", 'Player');\n\n_defineProperty(Player, \"propTypes\", _props.propTypes);\n\n_defineProperty(Player, \"defaultProps\", _props.defaultProps);","\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar ICON_SIZE = '64px';\nvar cache = {};\n\nvar Preview = /*#__PURE__*/function (_Component) {\n _inherits(Preview, _Component);\n\n var _super = _createSuper(Preview);\n\n function Preview() {\n var _this;\n\n _classCallCheck(this, Preview);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n\n _defineProperty(_assertThisInitialized(_this), \"mounted\", false);\n\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n image: null\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleKeyPress\", function (e) {\n if (e.key === 'Enter' || e.key === ' ') {\n _this.props.onClick();\n }\n });\n\n return _this;\n }\n\n _createClass(Preview, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.mounted = true;\n this.fetchImage(this.props);\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n var _this$props = this.props,\n url = _this$props.url,\n light = _this$props.light;\n\n if (prevProps.url !== url || prevProps.light !== light) {\n this.fetchImage(this.props);\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.mounted = false;\n }\n }, {\n key: \"fetchImage\",\n value: function fetchImage(_ref) {\n var _this2 = this;\n\n var url = _ref.url,\n light = _ref.light;\n\n if (typeof light === 'string') {\n this.setState({\n image: light\n });\n return;\n }\n\n if (cache[url]) {\n this.setState({\n image: cache[url]\n });\n return;\n }\n\n this.setState({\n image: null\n });\n return window.fetch(\"https://noembed.com/embed?url=\".concat(url)).then(function (response) {\n return response.json();\n }).then(function (data) {\n if (data.thumbnail_url && _this2.mounted) {\n var image = data.thumbnail_url.replace('height=100', 'height=480');\n\n _this2.setState({\n image: image\n });\n\n cache[url] = image;\n }\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n onClick = _this$props2.onClick,\n playIcon = _this$props2.playIcon,\n previewTabIndex = _this$props2.previewTabIndex;\n var image = this.state.image;\n var flexCenter = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center'\n };\n var styles = {\n preview: _objectSpread({\n width: '100%',\n height: '100%',\n backgroundImage: image ? \"url(\".concat(image, \")\") : undefined,\n backgroundSize: 'cover',\n backgroundPosition: 'center',\n cursor: 'pointer'\n }, flexCenter),\n shadow: _objectSpread({\n background: 'radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)',\n borderRadius: ICON_SIZE,\n width: ICON_SIZE,\n height: ICON_SIZE\n }, flexCenter),\n playIcon: {\n borderStyle: 'solid',\n borderWidth: '16px 0 16px 26px',\n borderColor: 'transparent transparent transparent white',\n marginLeft: '7px'\n }\n };\n\n var defaultPlayIcon = /*#__PURE__*/_react[\"default\"].createElement(\"div\", {\n style: styles.shadow,\n className: \"react-player__shadow\"\n }, /*#__PURE__*/_react[\"default\"].createElement(\"div\", {\n style: styles.playIcon,\n className: \"react-player__play-icon\"\n }));\n\n return /*#__PURE__*/_react[\"default\"].createElement(\"div\", {\n style: styles.preview,\n className: \"react-player__preview\",\n onClick: onClick,\n tabIndex: previewTabIndex,\n onKeyPress: this.handleKeyPress\n }, playIcon || defaultPlayIcon);\n }\n }]);\n\n return Preview;\n}(_react.Component);\n\nexports[\"default\"] = Preview;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.createReactPlayer = void 0;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nvar _deepmerge = _interopRequireDefault(require(\"deepmerge\"));\n\nvar _memoizeOne = _interopRequireDefault(require(\"memoize-one\"));\n\nvar _reactFastCompare = _interopRequireDefault(require(\"react-fast-compare\"));\n\nvar _props = require(\"./props\");\n\nvar _utils = require(\"./utils\");\n\nvar _Player3 = _interopRequireDefault(require(\"./Player\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nvar Preview = /*#__PURE__*/(0, _react.lazy)(function () {\n return Promise.resolve().then(function () {\n return _interopRequireWildcard(require('./Preview'));\n });\n});\nvar IS_BROWSER = typeof window !== 'undefined' && window.document;\nvar IS_GLOBAL = typeof global !== 'undefined' && global.window && global.window.document;\nvar SUPPORTED_PROPS = Object.keys(_props.propTypes); // Return null when rendering on the server\n// as Suspense is not supported yet\n\nvar UniversalSuspense = IS_BROWSER || IS_GLOBAL ? _react.Suspense : function () {\n return null;\n};\nvar customPlayers = [];\n\nvar createReactPlayer = function createReactPlayer(players, fallback) {\n var _class, _temp;\n\n return _temp = _class = /*#__PURE__*/function (_Component) {\n _inherits(ReactPlayer, _Component);\n\n var _super = _createSuper(ReactPlayer);\n\n function ReactPlayer() {\n var _this;\n\n _classCallCheck(this, ReactPlayer);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n showPreview: !!_this.props.light\n });\n\n _defineProperty(_assertThisInitialized(_this), \"references\", {\n wrapper: function wrapper(_wrapper) {\n _this.wrapper = _wrapper;\n },\n player: function player(_player) {\n _this.player = _player;\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleClickPreview\", function (e) {\n _this.setState({\n showPreview: false\n });\n\n _this.props.onClickPreview(e);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"showPreview\", function () {\n _this.setState({\n showPreview: true\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"getDuration\", function () {\n if (!_this.player) return null;\n return _this.player.getDuration();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"getCurrentTime\", function () {\n if (!_this.player) return null;\n return _this.player.getCurrentTime();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"getSecondsLoaded\", function () {\n if (!_this.player) return null;\n return _this.player.getSecondsLoaded();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"getInternalPlayer\", function () {\n var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'player';\n if (!_this.player) return null;\n return _this.player.getInternalPlayer(key);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"seekTo\", function (fraction, type) {\n if (!_this.player) return null;\n\n _this.player.seekTo(fraction, type);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleReady\", function () {\n _this.props.onReady(_assertThisInitialized(_this));\n });\n\n _defineProperty(_assertThisInitialized(_this), \"getActivePlayer\", (0, _memoizeOne[\"default\"])(function (url) {\n for (var _i = 0, _arr = [].concat(customPlayers, _toConsumableArray(players)); _i < _arr.length; _i++) {\n var player = _arr[_i];\n\n if (player.canPlay(url)) {\n return player;\n }\n }\n\n if (fallback) {\n return fallback;\n }\n\n return null;\n }));\n\n _defineProperty(_assertThisInitialized(_this), \"getConfig\", (0, _memoizeOne[\"default\"])(function (url, key) {\n var config = _this.props.config;\n return _deepmerge[\"default\"].all([_props.defaultProps.config, _props.defaultProps.config[key] || {}, config, config[key] || {}]);\n }));\n\n _defineProperty(_assertThisInitialized(_this), \"getAttributes\", (0, _memoizeOne[\"default\"])(function (url) {\n return (0, _utils.omit)(_this.props, SUPPORTED_PROPS);\n }));\n\n _defineProperty(_assertThisInitialized(_this), \"renderActivePlayer\", function (url) {\n if (!url) return null;\n\n var player = _this.getActivePlayer(url);\n\n if (!player) return null;\n\n var config = _this.getConfig(url, player.key);\n\n return /*#__PURE__*/_react[\"default\"].createElement(_Player3[\"default\"], _extends({}, _this.props, {\n key: player.key,\n ref: _this.references.player,\n config: config,\n activePlayer: player.lazyPlayer || player,\n onReady: _this.handleReady\n }));\n });\n\n return _this;\n }\n\n _createClass(ReactPlayer, [{\n key: \"shouldComponentUpdate\",\n value: function shouldComponentUpdate(nextProps, nextState) {\n return !(0, _reactFastCompare[\"default\"])(this.props, nextProps) || !(0, _reactFastCompare[\"default\"])(this.state, nextState);\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n var light = this.props.light;\n\n if (!prevProps.light && light) {\n this.setState({\n showPreview: true\n });\n }\n\n if (prevProps.light && !light) {\n this.setState({\n showPreview: false\n });\n }\n }\n }, {\n key: \"renderPreview\",\n value: function renderPreview(url) {\n if (!url) return null;\n var _this$props = this.props,\n light = _this$props.light,\n playIcon = _this$props.playIcon,\n previewTabIndex = _this$props.previewTabIndex;\n return /*#__PURE__*/_react[\"default\"].createElement(Preview, {\n url: url,\n light: light,\n playIcon: playIcon,\n previewTabIndex: previewTabIndex,\n onClick: this.handleClickPreview\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n url = _this$props2.url,\n style = _this$props2.style,\n width = _this$props2.width,\n height = _this$props2.height,\n fallback = _this$props2.fallback,\n Wrapper = _this$props2.wrapper;\n var showPreview = this.state.showPreview;\n var attributes = this.getAttributes(url);\n return /*#__PURE__*/_react[\"default\"].createElement(Wrapper, _extends({\n ref: this.references.wrapper,\n style: _objectSpread(_objectSpread({}, style), {}, {\n width: width,\n height: height\n })\n }, attributes), /*#__PURE__*/_react[\"default\"].createElement(UniversalSuspense, {\n fallback: fallback\n }, showPreview ? this.renderPreview(url) : this.renderActivePlayer(url)));\n }\n }]);\n\n return ReactPlayer;\n }(_react.Component), _defineProperty(_class, \"displayName\", 'ReactPlayer'), _defineProperty(_class, \"propTypes\", _props.propTypes), _defineProperty(_class, \"defaultProps\", _props.defaultProps), _defineProperty(_class, \"addCustomPlayer\", function (player) {\n customPlayers.push(player);\n }), _defineProperty(_class, \"removeCustomPlayers\", function () {\n customPlayers.length = 0;\n }), _defineProperty(_class, \"canPlay\", function (url) {\n for (var _i2 = 0, _arr2 = [].concat(customPlayers, _toConsumableArray(players)); _i2 < _arr2.length; _i2++) {\n var _Player = _arr2[_i2];\n\n if (_Player.canPlay(url)) {\n return true;\n }\n }\n\n return false;\n }), _defineProperty(_class, \"canEnablePIP\", function (url) {\n for (var _i3 = 0, _arr3 = [].concat(customPlayers, _toConsumableArray(players)); _i3 < _arr3.length; _i3++) {\n var _Player2 = _arr3[_i3];\n\n if (_Player2.canEnablePIP && _Player2.canEnablePIP(url)) {\n return true;\n }\n }\n\n return false;\n }), _temp;\n};\n\nexports.createReactPlayer = createReactPlayer;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nvar _players = _interopRequireDefault(require(\"./players\"));\n\nvar _ReactPlayer = require(\"./ReactPlayer\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\n// Fall back to FilePlayer if nothing else can play the URL\nvar fallback = _players[\"default\"][_players[\"default\"].length - 1];\n\nvar _default = (0, _ReactPlayer.createReactPlayer)(_players[\"default\"], fallback);\n\nexports[\"default\"] = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.canPlay = exports.FLV_EXTENSIONS = exports.DASH_EXTENSIONS = exports.HLS_EXTENSIONS = exports.VIDEO_EXTENSIONS = exports.AUDIO_EXTENSIONS = exports.MATCH_URL_KALTURA = exports.MATCH_URL_VIDYARD = exports.MATCH_URL_MIXCLOUD = exports.MATCH_URL_DAILYMOTION = exports.MATCH_URL_TWITCH_CHANNEL = exports.MATCH_URL_TWITCH_VIDEO = exports.MATCH_URL_WISTIA = exports.MATCH_URL_STREAMABLE = exports.MATCH_URL_FACEBOOK_WATCH = exports.MATCH_URL_FACEBOOK = exports.MATCH_URL_VIMEO = exports.MATCH_URL_SOUNDCLOUD = exports.MATCH_URL_YOUTUBE = void 0;\n\nvar _utils = require(\"./utils\");\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nvar MATCH_URL_YOUTUBE = /(?:youtu\\.be\\/|youtube(?:-nocookie)?\\.com\\/(?:embed\\/|v\\/|watch\\/|watch\\?v=|watch\\?.+&v=))((\\w|-){11})|youtube\\.com\\/playlist\\?list=|youtube\\.com\\/user\\//;\nexports.MATCH_URL_YOUTUBE = MATCH_URL_YOUTUBE;\nvar MATCH_URL_SOUNDCLOUD = /(?:soundcloud\\.com|snd\\.sc)\\/[^.]+$/;\nexports.MATCH_URL_SOUNDCLOUD = MATCH_URL_SOUNDCLOUD;\nvar MATCH_URL_VIMEO = /vimeo\\.com\\/.+/;\nexports.MATCH_URL_VIMEO = MATCH_URL_VIMEO;\nvar MATCH_URL_FACEBOOK = /^https?:\\/\\/(www\\.)?facebook\\.com.*\\/(video(s)?|watch|story)(\\.php?|\\/).+$/;\nexports.MATCH_URL_FACEBOOK = MATCH_URL_FACEBOOK;\nvar MATCH_URL_FACEBOOK_WATCH = /^https?:\\/\\/fb\\.watch\\/.+$/;\nexports.MATCH_URL_FACEBOOK_WATCH = MATCH_URL_FACEBOOK_WATCH;\nvar MATCH_URL_STREAMABLE = /streamable\\.com\\/([a-z0-9]+)$/;\nexports.MATCH_URL_STREAMABLE = MATCH_URL_STREAMABLE;\nvar MATCH_URL_WISTIA = /(?:wistia\\.(?:com|net)|wi\\.st)\\/(?:medias|embed)\\/(?:iframe\\/)?(.*)$/;\nexports.MATCH_URL_WISTIA = MATCH_URL_WISTIA;\nvar MATCH_URL_TWITCH_VIDEO = /(?:www\\.|go\\.)?twitch\\.tv\\/videos\\/(\\d+)($|\\?)/;\nexports.MATCH_URL_TWITCH_VIDEO = MATCH_URL_TWITCH_VIDEO;\nvar MATCH_URL_TWITCH_CHANNEL = /(?:www\\.|go\\.)?twitch\\.tv\\/([a-zA-Z0-9_]+)($|\\?)/;\nexports.MATCH_URL_TWITCH_CHANNEL = MATCH_URL_TWITCH_CHANNEL;\nvar MATCH_URL_DAILYMOTION = /^(?:(?:https?):)?(?:\\/\\/)?(?:www\\.)?(?:(?:dailymotion\\.com(?:\\/embed)?\\/video)|dai\\.ly)\\/([a-zA-Z0-9]+)(?:_[\\w_-]+)?$/;\nexports.MATCH_URL_DAILYMOTION = MATCH_URL_DAILYMOTION;\nvar MATCH_URL_MIXCLOUD = /mixcloud\\.com\\/([^/]+\\/[^/]+)/;\nexports.MATCH_URL_MIXCLOUD = MATCH_URL_MIXCLOUD;\nvar MATCH_URL_VIDYARD = /vidyard.com\\/(?:watch\\/)?([a-zA-Z0-9-]+)/;\nexports.MATCH_URL_VIDYARD = MATCH_URL_VIDYARD;\nvar MATCH_URL_KALTURA = /^https?:\\/\\/[a-zA-Z]+\\.kaltura.(com|org)\\/p\\/([0-9]+)\\/sp\\/([0-9]+)00\\/embedIframeJs\\/uiconf_id\\/([0-9]+)\\/partner_id\\/([0-9]+)(.*)entry_id.([a-zA-Z0-9-_]+)$/;\nexports.MATCH_URL_KALTURA = MATCH_URL_KALTURA;\nvar AUDIO_EXTENSIONS = /\\.(m4a|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\\?)/i;\nexports.AUDIO_EXTENSIONS = AUDIO_EXTENSIONS;\nvar VIDEO_EXTENSIONS = /\\.(mp4|og[gv]|webm|mov|m4v)($|\\?)/i;\nexports.VIDEO_EXTENSIONS = VIDEO_EXTENSIONS;\nvar HLS_EXTENSIONS = /\\.(m3u8)($|\\?)/i;\nexports.HLS_EXTENSIONS = HLS_EXTENSIONS;\nvar DASH_EXTENSIONS = /\\.(mpd)($|\\?)/i;\nexports.DASH_EXTENSIONS = DASH_EXTENSIONS;\nvar FLV_EXTENSIONS = /\\.(flv)($|\\?)/i;\nexports.FLV_EXTENSIONS = FLV_EXTENSIONS;\n\nvar canPlayFile = function canPlayFile(url) {\n if (url instanceof Array) {\n var _iterator = _createForOfIteratorHelper(url),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var item = _step.value;\n\n if (typeof item === 'string' && canPlayFile(item)) {\n return true;\n }\n\n if (canPlayFile(item.src)) {\n return true;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return false;\n }\n\n if ((0, _utils.isMediaStream)(url) || (0, _utils.isBlobUrl)(url)) {\n return true;\n }\n\n return AUDIO_EXTENSIONS.test(url) || VIDEO_EXTENSIONS.test(url) || HLS_EXTENSIONS.test(url) || DASH_EXTENSIONS.test(url) || FLV_EXTENSIONS.test(url);\n};\n\nvar canPlay = {\n youtube: function youtube(url) {\n if (url instanceof Array) {\n return url.every(function (item) {\n return MATCH_URL_YOUTUBE.test(item);\n });\n }\n\n return MATCH_URL_YOUTUBE.test(url);\n },\n soundcloud: function soundcloud(url) {\n return MATCH_URL_SOUNDCLOUD.test(url) && !AUDIO_EXTENSIONS.test(url);\n },\n vimeo: function vimeo(url) {\n return MATCH_URL_VIMEO.test(url) && !VIDEO_EXTENSIONS.test(url) && !HLS_EXTENSIONS.test(url);\n },\n facebook: function facebook(url) {\n return MATCH_URL_FACEBOOK.test(url) || MATCH_URL_FACEBOOK_WATCH.test(url);\n },\n streamable: function streamable(url) {\n return MATCH_URL_STREAMABLE.test(url);\n },\n wistia: function wistia(url) {\n return MATCH_URL_WISTIA.test(url);\n },\n twitch: function twitch(url) {\n return MATCH_URL_TWITCH_VIDEO.test(url) || MATCH_URL_TWITCH_CHANNEL.test(url);\n },\n dailymotion: function dailymotion(url) {\n return MATCH_URL_DAILYMOTION.test(url);\n },\n mixcloud: function mixcloud(url) {\n return MATCH_URL_MIXCLOUD.test(url);\n },\n vidyard: function vidyard(url) {\n return MATCH_URL_VIDYARD.test(url);\n },\n kaltura: function kaltura(url) {\n return MATCH_URL_KALTURA.test(url);\n },\n file: canPlayFile\n};\nexports.canPlay = canPlay;","\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nvar _utils = require(\"../utils\");\n\nvar _patterns = require(\"../patterns\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar SDK_URL = 'https://api.dmcdn.net/all.js';\nvar SDK_GLOBAL = 'DM';\nvar SDK_GLOBAL_READY = 'dmAsyncInit';\n\nvar DailyMotion = /*#__PURE__*/function (_Component) {\n _inherits(DailyMotion, _Component);\n\n var _super = _createSuper(DailyMotion);\n\n function DailyMotion() {\n var _this;\n\n _classCallCheck(this, DailyMotion);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n\n _defineProperty(_assertThisInitialized(_this), \"callPlayer\", _utils.callPlayer);\n\n _defineProperty(_assertThisInitialized(_this), \"onDurationChange\", function () {\n var duration = _this.getDuration();\n\n _this.props.onDuration(duration);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"mute\", function () {\n _this.callPlayer('setMuted', true);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"unmute\", function () {\n _this.callPlayer('setMuted', false);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"ref\", function (container) {\n _this.container = container;\n });\n\n return _this;\n }\n\n _createClass(DailyMotion, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.props.onMount && this.props.onMount(this);\n }\n }, {\n key: \"load\",\n value: function load(url) {\n var _this2 = this;\n\n var _this$props = this.props,\n controls = _this$props.controls,\n config = _this$props.config,\n onError = _this$props.onError,\n playing = _this$props.playing;\n\n var _url$match = url.match(_patterns.MATCH_URL_DAILYMOTION),\n _url$match2 = _slicedToArray(_url$match, 2),\n id = _url$match2[1];\n\n if (this.player) {\n this.player.load(id, {\n start: (0, _utils.parseStartTime)(url),\n autoplay: playing\n });\n return;\n }\n\n (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY, function (DM) {\n return DM.player;\n }).then(function (DM) {\n if (!_this2.container) return;\n var Player = DM.player;\n _this2.player = new Player(_this2.container, {\n width: '100%',\n height: '100%',\n video: id,\n params: _objectSpread({\n controls: controls,\n autoplay: _this2.props.playing,\n mute: _this2.props.muted,\n start: (0, _utils.parseStartTime)(url),\n origin: window.location.origin\n }, config.params),\n events: {\n apiready: _this2.props.onReady,\n seeked: function seeked() {\n return _this2.props.onSeek(_this2.player.currentTime);\n },\n video_end: _this2.props.onEnded,\n durationchange: _this2.onDurationChange,\n pause: _this2.props.onPause,\n playing: _this2.props.onPlay,\n waiting: _this2.props.onBuffer,\n error: function error(event) {\n return onError(event);\n }\n }\n });\n }, onError);\n }\n }, {\n key: \"play\",\n value: function play() {\n this.callPlayer('play');\n }\n }, {\n key: \"pause\",\n value: function pause() {\n this.callPlayer('pause');\n }\n }, {\n key: \"stop\",\n value: function stop() {// Nothing to do\n }\n }, {\n key: \"seekTo\",\n value: function seekTo(seconds) {\n this.callPlayer('seek', seconds);\n }\n }, {\n key: \"setVolume\",\n value: function setVolume(fraction) {\n this.callPlayer('setVolume', fraction);\n }\n }, {\n key: \"getDuration\",\n value: function getDuration() {\n return this.player.duration || null;\n }\n }, {\n key: \"getCurrentTime\",\n value: function getCurrentTime() {\n return this.player.currentTime;\n }\n }, {\n key: \"getSecondsLoaded\",\n value: function getSecondsLoaded() {\n return this.player.bufferedTime;\n }\n }, {\n key: \"render\",\n value: function render() {\n var display = this.props.display;\n var style = {\n width: '100%',\n height: '100%',\n display: display\n };\n return /*#__PURE__*/_react[\"default\"].createElement(\"div\", {\n style: style\n }, /*#__PURE__*/_react[\"default\"].createElement(\"div\", {\n ref: this.ref\n }));\n }\n }]);\n\n return DailyMotion;\n}(_react.Component);\n\nexports[\"default\"] = DailyMotion;\n\n_defineProperty(DailyMotion, \"displayName\", 'DailyMotion');\n\n_defineProperty(DailyMotion, \"canPlay\", _patterns.canPlay.dailymotion);\n\n_defineProperty(DailyMotion, \"loopOnEnded\", true);","\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nvar _utils = require(\"../utils\");\n\nvar _patterns = require(\"../patterns\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _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\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar SDK_URL = 'https://connect.facebook.net/en_US/sdk.js';\nvar SDK_GLOBAL = 'FB';\nvar SDK_GLOBAL_READY = 'fbAsyncInit';\nvar PLAYER_ID_PREFIX = 'facebook-player-';\n\nvar Facebook = /*#__PURE__*/function (_Component) {\n _inherits(Facebook, _Component);\n\n var _super = _createSuper(Facebook);\n\n function Facebook() {\n var _this;\n\n _classCallCheck(this, Facebook);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n\n _defineProperty(_assertThisInitialized(_this), \"callPlayer\", _utils.callPlayer);\n\n _defineProperty(_assertThisInitialized(_this), \"playerID\", _this.props.config.playerId || \"\".concat(PLAYER_ID_PREFIX).concat((0, _utils.randomString)()));\n\n _defineProperty(_assertThisInitialized(_this), \"mute\", function () {\n _this.callPlayer('mute');\n });\n\n _defineProperty(_assertThisInitialized(_this), \"unmute\", function () {\n _this.callPlayer('unmute');\n });\n\n return _this;\n }\n\n _createClass(Facebook, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.props.onMount && this.props.onMount(this);\n }\n }, {\n key: \"load\",\n value: function load(url, isReady) {\n var _this2 = this;\n\n if (isReady) {\n (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY).then(function (FB) {\n return FB.XFBML.parse();\n });\n return;\n }\n\n (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY).then(function (FB) {\n FB.init({\n appId: _this2.props.config.appId,\n xfbml: true,\n version: _this2.props.config.version\n });\n FB.Event.subscribe('xfbml.render', function (msg) {\n // Here we know the SDK has loaded, even if onReady/onPlay\n // is not called due to a video that cannot be embedded\n _this2.props.onLoaded();\n });\n FB.Event.subscribe('xfbml.ready', function (msg) {\n if (msg.type === 'video' && msg.id === _this2.playerID) {\n _this2.player = msg.instance;\n\n _this2.player.subscribe('startedPlaying', _this2.props.onPlay);\n\n _this2.player.subscribe('paused', _this2.props.onPause);\n\n _this2.player.subscribe('finishedPlaying', _this2.props.onEnded);\n\n _this2.player.subscribe('startedBuffering', _this2.props.onBuffer);\n\n _this2.player.subscribe('finishedBuffering', _this2.props.onBufferEnd);\n\n _this2.player.subscribe('error', _this2.props.onError);\n\n if (_this2.props.muted) {\n _this2.callPlayer('mute');\n } else {\n _this2.callPlayer('unmute');\n }\n\n _this2.props.onReady(); // For some reason Facebook have added `visibility: hidden`\n // to the iframe when autoplay fails, so here we set it back\n\n\n document.getElementById(_this2.playerID).querySelector('iframe').style.visibility = 'visible';\n }\n });\n });\n }\n }, {\n key: \"play\",\n value: function play() {\n this.callPlayer('play');\n }\n }, {\n key: \"pause\",\n value: function pause() {\n this.callPlayer('pause');\n }\n }, {\n key: \"stop\",\n value: function stop() {// Nothing to do\n }\n }, {\n key: \"seekTo\",\n value: function seekTo(seconds) {\n this.callPlayer('seek', seconds);\n }\n }, {\n key: \"setVolume\",\n value: function setVolume(fraction) {\n this.callPlayer('setVolume', fraction);\n }\n }, {\n key: \"getDuration\",\n value: function getDuration() {\n return this.callPlayer('getDuration');\n }\n }, {\n key: \"getCurrentTime\",\n value: function getCurrentTime() {\n return this.callPlayer('getCurrentPosition');\n }\n }, {\n key: \"getSecondsLoaded\",\n value: function getSecondsLoaded() {\n return null;\n }\n }, {\n key: \"render\",\n value: function render() {\n var attributes = this.props.config.attributes;\n var style = {\n width: '100%',\n height: '100%'\n };\n return /*#__PURE__*/_react[\"default\"].createElement(\"div\", _extends({\n style: style,\n id: this.playerID,\n className: \"fb-video\",\n \"data-href\": this.props.url,\n \"data-autoplay\": this.props.playing ? 'true' : 'false',\n \"data-allowfullscreen\": \"true\",\n \"data-controls\": this.props.controls ? 'true' : 'false'\n }, attributes));\n }\n }]);\n\n return Facebook;\n}(_react.Component);\n\nexports[\"default\"] = Facebook;\n\n_defineProperty(Facebook, \"displayName\", 'Facebook');\n\n_defineProperty(Facebook, \"canPlay\", _patterns.canPlay.facebook);\n\n_defineProperty(Facebook, \"loopOnEnded\", true);","\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nvar _utils = require(\"../utils\");\n\nvar _patterns = require(\"../patterns\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _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\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar HAS_NAVIGATOR = typeof navigator !== 'undefined';\nvar IS_IPAD_PRO = HAS_NAVIGATOR && navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1;\nvar IS_IOS = HAS_NAVIGATOR && (/iPad|iPhone|iPod/.test(navigator.userAgent) || IS_IPAD_PRO) && !window.MSStream;\nvar HLS_SDK_URL = 'https://cdn.jsdelivr.net/npm/hls.js@VERSION/dist/hls.min.js';\nvar HLS_GLOBAL = 'Hls';\nvar DASH_SDK_URL = 'https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js';\nvar DASH_GLOBAL = 'dashjs';\nvar FLV_SDK_URL = 'https://cdn.jsdelivr.net/npm/flv.js@VERSION/dist/flv.min.js';\nvar FLV_GLOBAL = 'flvjs';\nvar MATCH_DROPBOX_URL = /www\\.dropbox\\.com\\/.+/;\nvar MATCH_CLOUDFLARE_STREAM = /https:\\/\\/watch\\.cloudflarestream\\.com\\/([a-z0-9]+)/;\nvar REPLACE_CLOUDFLARE_STREAM = 'https://videodelivery.net/{id}/manifest/video.m3u8';\n\nvar FilePlayer = /*#__PURE__*/function (_Component) {\n _inherits(FilePlayer, _Component);\n\n var _super = _createSuper(FilePlayer);\n\n function FilePlayer() {\n var _this;\n\n _classCallCheck(this, FilePlayer);\n\n for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {\n _args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(_args));\n\n _defineProperty(_assertThisInitialized(_this), \"onReady\", function () {\n var _this$props;\n\n return (_this$props = _this.props).onReady.apply(_this$props, arguments);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onPlay\", function () {\n var _this$props2;\n\n return (_this$props2 = _this.props).onPlay.apply(_this$props2, arguments);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onBuffer\", function () {\n var _this$props3;\n\n return (_this$props3 = _this.props).onBuffer.apply(_this$props3, arguments);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onBufferEnd\", function () {\n var _this$props4;\n\n return (_this$props4 = _this.props).onBufferEnd.apply(_this$props4, arguments);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onPause\", function () {\n var _this$props5;\n\n return (_this$props5 = _this.props).onPause.apply(_this$props5, arguments);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onEnded\", function () {\n var _this$props6;\n\n return (_this$props6 = _this.props).onEnded.apply(_this$props6, arguments);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onError\", function () {\n var _this$props7;\n\n return (_this$props7 = _this.props).onError.apply(_this$props7, arguments);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onEnablePIP\", function () {\n var _this$props8;\n\n return (_this$props8 = _this.props).onEnablePIP.apply(_this$props8, arguments);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onDisablePIP\", function (e) {\n var _this$props9 = _this.props,\n onDisablePIP = _this$props9.onDisablePIP,\n playing = _this$props9.playing;\n onDisablePIP(e);\n\n if (playing) {\n _this.play();\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onPresentationModeChange\", function (e) {\n if (_this.player && (0, _utils.supportsWebKitPresentationMode)(_this.player)) {\n var webkitPresentationMode = _this.player.webkitPresentationMode;\n\n if (webkitPresentationMode === 'picture-in-picture') {\n _this.onEnablePIP(e);\n } else if (webkitPresentationMode === 'inline') {\n _this.onDisablePIP(e);\n }\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onSeek\", function (e) {\n _this.props.onSeek(e.target.currentTime);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"mute\", function () {\n _this.player.muted = true;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"unmute\", function () {\n _this.player.muted = false;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"renderSourceElement\", function (source, index) {\n if (typeof source === 'string') {\n return /*#__PURE__*/_react[\"default\"].createElement(\"source\", {\n key: index,\n src: source\n });\n }\n\n return /*#__PURE__*/_react[\"default\"].createElement(\"source\", _extends({\n key: index\n }, source));\n });\n\n _defineProperty(_assertThisInitialized(_this), \"renderTrack\", function (track, index) {\n return /*#__PURE__*/_react[\"default\"].createElement(\"track\", _extends({\n key: index\n }, track));\n });\n\n _defineProperty(_assertThisInitialized(_this), \"ref\", function (player) {\n if (_this.player) {\n // Store previous player to be used by removeListeners()\n _this.prevPlayer = _this.player;\n }\n\n _this.player = player;\n });\n\n return _this;\n }\n\n _createClass(FilePlayer, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.props.onMount && this.props.onMount(this);\n this.addListeners(this.player);\n\n if (IS_IOS) {\n this.player.load();\n }\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n if (this.shouldUseAudio(this.props) !== this.shouldUseAudio(prevProps)) {\n this.removeListeners(this.prevPlayer, prevProps.url);\n this.addListeners(this.player);\n }\n\n if (this.props.url !== prevProps.url && !(0, _utils.isMediaStream)(this.props.url)) {\n this.player.srcObject = null;\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.removeListeners(this.player);\n\n if (this.hls) {\n this.hls.destroy();\n }\n }\n }, {\n key: \"addListeners\",\n value: function addListeners(player) {\n var _this$props10 = this.props,\n url = _this$props10.url,\n playsinline = _this$props10.playsinline;\n player.addEventListener('play', this.onPlay);\n player.addEventListener('waiting', this.onBuffer);\n player.addEventListener('playing', this.onBufferEnd);\n player.addEventListener('pause', this.onPause);\n player.addEventListener('seeked', this.onSeek);\n player.addEventListener('ended', this.onEnded);\n player.addEventListener('error', this.onError);\n player.addEventListener('enterpictureinpicture', this.onEnablePIP);\n player.addEventListener('leavepictureinpicture', this.onDisablePIP);\n player.addEventListener('webkitpresentationmodechanged', this.onPresentationModeChange);\n\n if (!this.shouldUseHLS(url)) {\n // onReady is handled by hls.js\n player.addEventListener('canplay', this.onReady);\n }\n\n if (playsinline) {\n player.setAttribute('playsinline', '');\n player.setAttribute('webkit-playsinline', '');\n player.setAttribute('x5-playsinline', '');\n }\n }\n }, {\n key: \"removeListeners\",\n value: function removeListeners(player, url) {\n player.removeEventListener('canplay', this.onReady);\n player.removeEventListener('play', this.onPlay);\n player.removeEventListener('waiting', this.onBuffer);\n player.removeEventListener('playing', this.onBufferEnd);\n player.removeEventListener('pause', this.onPause);\n player.removeEventListener('seeked', this.onSeek);\n player.removeEventListener('ended', this.onEnded);\n player.removeEventListener('error', this.onError);\n player.removeEventListener('enterpictureinpicture', this.onEnablePIP);\n player.removeEventListener('leavepictureinpicture', this.onDisablePIP);\n player.removeEventListener('webkitpresentationmodechanged', this.onPresentationModeChange);\n\n if (!this.shouldUseHLS(url)) {\n // onReady is handled by hls.js\n player.removeEventListener('canplay', this.onReady);\n }\n } // Proxy methods to prevent listener leaks\n\n }, {\n key: \"shouldUseAudio\",\n value: function shouldUseAudio(props) {\n if (props.config.forceVideo) {\n return false;\n }\n\n if (props.config.attributes.poster) {\n return false; // Use