waygo-maps 1.0.28 → 1.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundle.js CHANGED
@@ -581,7 +581,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
581
581
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
582
582
 
583
583
  "use strict";
584
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _components_ContentPlacementView_ContentDetails__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/ContentPlacementView/ContentDetails */ \"./src/components/ContentPlacementView/ContentDetails.js\");\n/* harmony import */ var _core_Control__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/Control */ \"./src/core/Control.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _superPropGet(t, e, r, o) { var p = _get(_getPrototypeOf(1 & o ? t.prototype : t), e, r); return 2 & o ? function (t) { return p.apply(r, t); } : p; }\nfunction _get() { return _get = \"undefined\" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }\nfunction _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\nvar ContentPlacementControl = /*#__PURE__*/function (_Control) {\n function ContentPlacementControl() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, ContentPlacementControl);\n _this = _callSuper(this, ContentPlacementControl, [options]);\n _this.map = null;\n _this.contentPlacementIds = [];\n _this.currentContentPlacement = null;\n _this.contentPlacementView = null;\n // this.contentPlacementView = new ContentDetails();\n return _this;\n }\n _inherits(ContentPlacementControl, _Control);\n return _createClass(ContentPlacementControl, [{\n key: \"onAdd\",\n value: function onAdd(map) {\n this.map = map;\n this.container = document.createElement('div');\n this.container.className = 'content-details-control-container';\n this.initializeEventListeners();\n this._attachResizeListener();\n this._initialize();\n this.hide();\n return this.container;\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n _superPropGet(ContentPlacementControl, \"onRemove\", this, 3)([]);\n }\n }, {\n key: \"initializeEventListeners\",\n value: function initializeEventListeners() {\n this.map.on('state:default', this._handleDefaultState.bind(this));\n this.map.on('state:search', this._handleSearchState.bind(this));\n this.map.on('state:selectedContent', this._handleSelectedContentState.bind(this));\n this.map.on('state:directions', this._handleDirectionsState.bind(this));\n this.map.on('initiate:back', this._handleMapInitiateBack.bind(this));\n }\n }, {\n key: \"_renderDesktopView\",\n value: function _renderDesktopView() {\n if (!this.contentPlacementView) {\n return;\n }\n var element = this.contentPlacementView.getElement();\n this.container.appendChild(element);\n this.container.classList.remove('mobile-view');\n this.container.classList.add('desktop-view');\n console.log('rendering search results DESKTOP');\n }\n }, {\n key: \"_renderMobileView\",\n value: function _renderMobileView() {\n if (!this.contentPlacementView) {\n return;\n }\n var element = this.contentPlacementView.getElement();\n this.container.appendChild(element);\n this.container.classList.remove('desktop-view');\n this.container.classList.add('mobile-view');\n console.log('rendering search results MOBILE');\n }\n }, {\n key: \"_handleMapInitiateBack\",\n value: function _handleMapInitiateBack() {\n var currentState = this.map._stateCoordinator.state;\n if (currentState === 'selectedContent') {\n if (this.contentPlacementIds.length === 0) return;else if (this.contentPlacementIds.length === 1) {\n var stateHistory = this.map._stateCoordinator.stateHistory;\n var previousMapState = stateHistory[stateHistory.length - 2];\n stateHistory.pop();\n stateHistory.pop();\n if (previousMapState === 'search') {\n this.map.initiateSetToSearchState();\n } else {\n this.map.setToDefaultState();\n }\n } else {\n this.contentPlacementIds.pop();\n this.map.setToSelectedContentState(this.contentPlacementIds);\n }\n } else if (currentState === 'directions') {\n console.log(\"THIS IS BACK IN DIRECTIONS STATE:\", this.contentPlacementIds.length);\n this.map.setToSelectedContentState(this.contentPlacementIds);\n }\n }\n }, {\n key: \"_handleSelectChildContentPlacement\",\n value: function _handleSelectChildContentPlacement(data) {\n console.log(\"SELECT CHILD\", data);\n var placementId = data.placementId;\n this.contentPlacementIds.push(placementId);\n console.log(\"1. Ssssssssssss in control for select child\", this.contentPlacementIds, placementId);\n this.map.setToSelectedContentState(this.contentPlacementIds);\n }\n }, {\n key: \"_handleDefaultState\",\n value: function _handleDefaultState() {\n this.hide();\n this.contentPlacementIds = [];\n this.currentContentPlacement = null;\n this._clearViews();\n }\n }, {\n key: \"_handleSearchState\",\n value: function _handleSearchState(_) {\n // const { query, results } = data;\n this.hide();\n this.contentPlacementIds = [];\n this.currentContentPlacement = null;\n this._clearViews();\n }\n }, {\n key: \"_handleSelectedContentState\",\n value: function _handleSelectedContentState(data) {\n var contentPlacementIds = data.contentPlacementIds,\n selectedContentPlacement = data.selectedContentPlacement;\n this.contentPlacementIds = contentPlacementIds;\n this.currentContentPlacement = selectedContentPlacement;\n console.log(\"SELECTED\", selectedContentPlacement);\n this._updateContentViews();\n this.show();\n }\n }, {\n key: \"_handleDirectionsState\",\n value: function _handleDirectionsState(_) {\n // console.log(\"handling directions state in content placement control\");\n this.hide();\n // this.contentPlacementIds = [];\n // this.currentContentPlacement = null;\n // this._clearViews();\n }\n }, {\n key: \"_handleSelectDirectionsButton\",\n value: function () {\n var _handleSelectDirectionsButton2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {\n var placementId;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n placementId = data.placementId;\n _context.next = 3;\n return this.map.setToDirectionsState(null, placementId);\n case 3:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function _handleSelectDirectionsButton(_x) {\n return _handleSelectDirectionsButton2.apply(this, arguments);\n }\n return _handleSelectDirectionsButton;\n }()\n }, {\n key: \"_handleSelectShareButton\",\n value: function () {\n var _handleSelectShareButton2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data) {\n var _this2 = this;\n var placementId, accountId, mapId, mapViewId, textToCopy;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n placementId = data.placementId;\n accountId = this.map.mapData.account_id;\n mapId = this.map.mapData.map_id;\n mapViewId = this.map.mapData.map_view_id;\n textToCopy = \"https://maps.waygomaps.com/\".concat(accountId, \"/\").concat(mapId, \"/\").concat(mapViewId, \"/selected-content/\").concat(placementId, \"/0.0,0.0,14.5,0,0\");\n navigator.clipboard.writeText(textToCopy).then(function () {\n _this2.contentPlacementView.showCopyPopup();\n })[\"catch\"](function (err) {\n return console.error('Failed to copy text:', err);\n });\n case 6:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function _handleSelectShareButton(_x2) {\n return _handleSelectShareButton2.apply(this, arguments);\n }\n return _handleSelectShareButton;\n }()\n }, {\n key: \"_updateContentViews\",\n value: function _updateContentViews() {\n this._clearViews();\n this._render();\n }\n }, {\n key: \"_render\",\n value: function _render() {\n console.log(\"HERE IS NUMBER OF CONTENT PLACEMENTS:\", this.contentPlacementIds.length);\n if (this.contentPlacementIds.length === 0 || this.currentContentPlacement === null) return;\n this.contentPlacementView = new _components_ContentPlacementView_ContentDetails__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n this.contentPlacementView.updateView(this.currentContentPlacement);\n this.contentPlacementView.on('selectChildContentPlacement', this._handleSelectChildContentPlacement.bind(this));\n this.contentPlacementView.on('selectDirectionsButton', this._handleSelectDirectionsButton.bind(this));\n this.contentPlacementView.on('selectShareButton', this._handleSelectShareButton.bind(this));\n\n // this.container.appendChild(this.contentPlacementView.getElement());\n\n this._initialize();\n\n // this._initialize();\n }\n\n // _clearViews() {\n // while (this.container.firstChild) {\n // this.container.removeChild(this.container.firstChild);\n // }\n // }\n\n // show() {\n // this.container.classList.add('visible');\n // }\n\n // hide() {\n // this.container.classList.remove('visible');\n // }\n }]);\n}(_core_Control__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ContentPlacementControl);\n\n// class ContentPlacementControl extends Control {\n// constructor(options = {}) {\n// super(options);\n// this.map = null;\n// this.contentPlacementStack = [];\n// this.searchApi = waygoMaps.getSearchApi();\n\n// this.currentView = null;\n// }\n\n// onAdd(map) {\n// this.map = map;\n\n// this.container = document.createElement('div');\n// this.container.className = 'content-details-control-container';\n\n// this.initializeEventListeners();\n// this._attachResizeListener();\n// this.hide();\n// this._initialize();\n// return this.container;\n// }\n\n// onRemove() {\n// super.onRemove();\n// }\n\n// _initialize() {\n// const containerWidth = this.map.mapContainer.offsetWidth;\n// this._configureView(containerWidth);\n// }\n\n// _configureView(width) {\n// if (width > 767) {\n// this._setViewForDesktop();\n// } else {\n// this._setViewForMobile();\n// }\n// } \n\n// _setViewForDesktop() {\n// console.log(\"SET VIEW FOR DESKTOP\");\n// this.currentView = 'desktop';\n// this._updateContentViews();\n// }\n\n// _setViewForMobile() {\n// console.log(\"SET VIEW FOR MOBILE\");\n// this.currentView = 'mobile';\n// this._updateContentViews();\n// }\n\n// _attachResizeListener() {\n// window.addEventListener('resize', () => {\n// const newWidth = this.map.mapContainer.offsetWidth;\n// // console.log(\"WIDTH\", newWidth);\n// this._configureView(newWidth); // Reconfigure based on new width\n// });\n// }\n\n// initializeEventListeners() {\n// this.map.on('setToSearchState', this._handleSearchState.bind(this));\n// this.map.on('setToDefaultState', this._handleDefaultState.bind(this));\n// this.map.on('setToSelectedContentState', this._handleSelectedContentState.bind(this));\n// }\n\n// async _handleSelectChildContentPlacement(data) {\n// const { placementId } = data;\n// const contentPlacement = await this.map.getContentPlacementDetails(placementId);\n// this.contentPlacementStack.push(contentPlacement);\n// console.log(this.contentPlacementStack);\n// this._updateContentViews();\n// }\n\n// // STATE METHODS\n// _handleDefaultState() {\n// this.hide();\n// // Should clear them too!\n// }\n\n// _handleSearchState(data) {\n// const { query, results } = data;\n// this.hide();\n// }\n\n// _handleSelectedContentState(data) {\n// const { contentPlacement } = data;\n// this.contentPlacementStack = [contentPlacement];\n// this._updateContentViews();\n// this.show();\n\n// // if (this.contentPlacementView && this.container.lastChild) {\n// // this.container.removeChild(this.container.lastChild);\n// // }\n\n// // this.contentPlacementView = new ContentDetails();\n// // this.contentPlacementView.updateView(contentPlacement);\n// // this.contentPlacementView.on('selectChildContentPlacement', this._handleSelectChildContentPlacement.bind(this));\n// // this.container.appendChild(this.contentPlacementView.getElement());\n\n// // NEED TO USE this.contentPlacementStack and CURRENT WIDTH TO APPRORIATELY SET VIEWS\n// }\n\n// _updateContentViews() {\n// this._clearViews();\n\n// if (this.currentView === 'desktop') {\n// this._renderDesktopView();\n// } else {\n// this._renderMobileView();\n// }\n// }\n\n// _renderDesktopView() {\n// if (this.contentPlacementStack.length === 0) return;\n\n// const firstPlacement = this.contentPlacementStack[0];\n// const lastPlacement = this.contentPlacementStack[this.contentPlacementStack.length - 1];\n\n// const leftContentPlacementView = new ContentDetails();\n// leftContentPlacementView.on('selectChildContentPlacement', this._handleSelectChildContentPlacement.bind(this));\n// leftContentPlacementView.updateView(firstPlacement);\n// this.container.appendChild(leftContentPlacementView.getElement());\n\n// if (this.contentPlacementStack.length > 1) {\n// const rightContentPlacementView = new ContentDetails();\n// rightContentPlacementView.on('selectChildContentPlacement', this._handleSelectChildContentPlacement.bind(this));\n// rightContentPlacementView.updateView(lastPlacement);\n// this.container.appendChild(rightContentPlacementView.getElement());\n// }\n// }\n\n// _renderMobileView() {\n// if (this.contentPlacementStack.length === 0) return;\n\n// const lastPlacement = this.contentPlacementStack[this.contentPlacementStack.length - 1];\n\n// const mobileContentPlacementView = new ContentDetails();\n// mobileContentPlacementView.on('selectChildContentPlacement', this._handleSelectChildContentPlacement.bind(this));\n// mobileContentPlacementView.updateView(lastPlacement);\n// this.container.appendChild(mobileContentPlacementView.getElement());\n// }\n\n// _clearViews() {\n// while (this.container.firstChild) {\n// this.container.removeChild(this.container.firstChild);\n// }\n// }\n\n// // HIDE/SHOW METHODS\n// show() {\n// this.container.classList.add('visible');\n// }\n\n// hide() {\n// this.container.classList.remove('visible');\n// }\n// }\n\n// export default ContentPlacementControl;\n\n//# sourceURL=webpack://waygomaps/./src/Controls/ContentPlacementControl.js?");
584
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _components_ContentPlacementView_ContentDetails__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/ContentPlacementView/ContentDetails */ \"./src/components/ContentPlacementView/ContentDetails.js\");\n/* harmony import */ var _core_Control__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/Control */ \"./src/core/Control.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _superPropGet(t, e, r, o) { var p = _get(_getPrototypeOf(1 & o ? t.prototype : t), e, r); return 2 & o ? function (t) { return p.apply(r, t); } : p; }\nfunction _get() { return _get = \"undefined\" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }\nfunction _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\nvar ContentPlacementControl = /*#__PURE__*/function (_Control) {\n function ContentPlacementControl() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, ContentPlacementControl);\n _this = _callSuper(this, ContentPlacementControl, [options]);\n _this.map = null;\n _this.contentPlacementIds = [];\n _this.currentContentPlacement = null;\n _this.contentPlacementView = null;\n // this.contentPlacementView = new ContentDetails();\n return _this;\n }\n _inherits(ContentPlacementControl, _Control);\n return _createClass(ContentPlacementControl, [{\n key: \"onAdd\",\n value: function onAdd(map) {\n this.map = map;\n this.container = document.createElement('div');\n this.container.className = 'content-details-control-container';\n this.initializeEventListeners();\n this._attachResizeListener();\n this._initialize();\n this.hide();\n return this.container;\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n _superPropGet(ContentPlacementControl, \"onRemove\", this, 3)([]);\n }\n }, {\n key: \"initializeEventListeners\",\n value: function initializeEventListeners() {\n this.map.on('state:default', this._handleDefaultState.bind(this));\n this.map.on('state:search', this._handleSearchState.bind(this));\n this.map.on('state:selectedContent', this._handleSelectedContentState.bind(this));\n this.map.on('state:directions', this._handleDirectionsState.bind(this));\n this.map.on('initiate:back', this._handleMapInitiateBack.bind(this));\n }\n }, {\n key: \"_renderDesktopView\",\n value: function _renderDesktopView() {\n if (!this.contentPlacementView) {\n return;\n }\n var element = this.contentPlacementView.getElement();\n this.container.appendChild(element);\n this.container.classList.remove('mobile-view');\n this.container.classList.add('desktop-view');\n console.log('rendering search results DESKTOP');\n }\n }, {\n key: \"_renderMobileView\",\n value: function _renderMobileView() {\n if (!this.contentPlacementView) {\n return;\n }\n var element = this.contentPlacementView.getElement();\n this.container.appendChild(element);\n this.container.classList.remove('desktop-view');\n this.container.classList.add('mobile-view');\n console.log('rendering search results MOBILE');\n }\n }, {\n key: \"_handleMapInitiateBack\",\n value: function _handleMapInitiateBack() {\n var currentState = this.map._stateCoordinator.state;\n if (currentState === 'selectedContent') {\n if (this.contentPlacementIds.length === 0) return;else if (this.contentPlacementIds.length === 1) {\n var stateHistory = this.map._stateCoordinator.stateHistory;\n var previousMapState = stateHistory[stateHistory.length - 2];\n stateHistory.pop();\n stateHistory.pop();\n if (previousMapState === 'search') {\n this.map.initiateSetToSearchState();\n } else {\n this.map.setToDefaultState();\n }\n } else {\n this.contentPlacementIds.pop();\n this.map.setToSelectedContentState(this.contentPlacementIds);\n }\n } else if (currentState === 'directions') {\n console.log(\"THIS IS BACK IN DIRECTIONS STATE:\", this.contentPlacementIds.length);\n this.map.setToSelectedContentState(this.contentPlacementIds);\n }\n }\n }, {\n key: \"_handleSelectChildContentPlacement\",\n value: function _handleSelectChildContentPlacement(data) {\n console.log(\"SELECT CHILD\", data);\n var placementId = data.placementId;\n this.contentPlacementIds.push(placementId);\n console.log(\"1. Ssssssssssss in control for select child\", this.contentPlacementIds, placementId);\n this.map.setToSelectedContentState(this.contentPlacementIds);\n }\n }, {\n key: \"_handleDefaultState\",\n value: function _handleDefaultState() {\n this.hide();\n this.contentPlacementIds = [];\n this.currentContentPlacement = null;\n this._clearViews();\n }\n }, {\n key: \"_handleSearchState\",\n value: function _handleSearchState(_) {\n // const { query, results } = data;\n this.hide();\n this.contentPlacementIds = [];\n this.currentContentPlacement = null;\n this._clearViews();\n }\n }, {\n key: \"_handleSelectedContentState\",\n value: function _handleSelectedContentState(data) {\n var contentPlacementIds = data.contentPlacementIds,\n selectedContentPlacement = data.selectedContentPlacement;\n this.contentPlacementIds = contentPlacementIds;\n this.currentContentPlacement = selectedContentPlacement;\n console.log(\"SELECTED\", selectedContentPlacement);\n this._updateContentViews();\n this.show();\n }\n }, {\n key: \"_handleDirectionsState\",\n value: function _handleDirectionsState(_) {\n // console.log(\"handling directions state in content placement control\");\n this.hide();\n // this.contentPlacementIds = [];\n // this.currentContentPlacement = null;\n // this._clearViews();\n }\n }, {\n key: \"_handleSelectDirectionsButton\",\n value: function () {\n var _handleSelectDirectionsButton2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {\n var placementId;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n placementId = data.placementId;\n _context.next = 3;\n return this.map.setToDirectionsState(null, placementId);\n case 3:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function _handleSelectDirectionsButton(_x) {\n return _handleSelectDirectionsButton2.apply(this, arguments);\n }\n return _handleSelectDirectionsButton;\n }()\n }, {\n key: \"_handleSelectShareButton\",\n value: function () {\n var _handleSelectShareButton2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data) {\n var _this2 = this;\n var placementId, accountId, mapId, mapViewId, textToCopy;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n placementId = data.placementId;\n accountId = this.map.mapData.account_id;\n mapId = this.map.mapData.map_id;\n mapViewId = this.map.mapData.map_view_id;\n textToCopy = \"https://maps.waygomaps.com/\".concat(accountId, \"/\").concat(mapId, \"/\").concat(mapViewId, \"/selected-content/\").concat(placementId, \"/0.0,0.0,14.2,45.0,-37.0\");\n navigator.clipboard.writeText(textToCopy).then(function () {\n _this2.contentPlacementView.showCopyPopup();\n })[\"catch\"](function (err) {\n return console.error('Failed to copy text:', err);\n });\n case 6:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function _handleSelectShareButton(_x2) {\n return _handleSelectShareButton2.apply(this, arguments);\n }\n return _handleSelectShareButton;\n }()\n }, {\n key: \"_updateContentViews\",\n value: function _updateContentViews() {\n this._clearViews();\n this._render();\n }\n }, {\n key: \"_render\",\n value: function _render() {\n console.log(\"HERE IS NUMBER OF CONTENT PLACEMENTS:\", this.contentPlacementIds.length);\n if (this.contentPlacementIds.length === 0 || this.currentContentPlacement === null) return;\n this.contentPlacementView = new _components_ContentPlacementView_ContentDetails__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n this.contentPlacementView.updateView(this.currentContentPlacement);\n this.contentPlacementView.on('selectChildContentPlacement', this._handleSelectChildContentPlacement.bind(this));\n this.contentPlacementView.on('selectDirectionsButton', this._handleSelectDirectionsButton.bind(this));\n this.contentPlacementView.on('selectShareButton', this._handleSelectShareButton.bind(this));\n\n // this.container.appendChild(this.contentPlacementView.getElement());\n\n this._initialize();\n\n // this._initialize();\n }\n\n // _clearViews() {\n // while (this.container.firstChild) {\n // this.container.removeChild(this.container.firstChild);\n // }\n // }\n\n // show() {\n // this.container.classList.add('visible');\n // }\n\n // hide() {\n // this.container.classList.remove('visible');\n // }\n }]);\n}(_core_Control__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ContentPlacementControl);\n\n// class ContentPlacementControl extends Control {\n// constructor(options = {}) {\n// super(options);\n// this.map = null;\n// this.contentPlacementStack = [];\n// this.searchApi = waygoMaps.getSearchApi();\n\n// this.currentView = null;\n// }\n\n// onAdd(map) {\n// this.map = map;\n\n// this.container = document.createElement('div');\n// this.container.className = 'content-details-control-container';\n\n// this.initializeEventListeners();\n// this._attachResizeListener();\n// this.hide();\n// this._initialize();\n// return this.container;\n// }\n\n// onRemove() {\n// super.onRemove();\n// }\n\n// _initialize() {\n// const containerWidth = this.map.mapContainer.offsetWidth;\n// this._configureView(containerWidth);\n// }\n\n// _configureView(width) {\n// if (width > 767) {\n// this._setViewForDesktop();\n// } else {\n// this._setViewForMobile();\n// }\n// } \n\n// _setViewForDesktop() {\n// console.log(\"SET VIEW FOR DESKTOP\");\n// this.currentView = 'desktop';\n// this._updateContentViews();\n// }\n\n// _setViewForMobile() {\n// console.log(\"SET VIEW FOR MOBILE\");\n// this.currentView = 'mobile';\n// this._updateContentViews();\n// }\n\n// _attachResizeListener() {\n// window.addEventListener('resize', () => {\n// const newWidth = this.map.mapContainer.offsetWidth;\n// // console.log(\"WIDTH\", newWidth);\n// this._configureView(newWidth); // Reconfigure based on new width\n// });\n// }\n\n// initializeEventListeners() {\n// this.map.on('setToSearchState', this._handleSearchState.bind(this));\n// this.map.on('setToDefaultState', this._handleDefaultState.bind(this));\n// this.map.on('setToSelectedContentState', this._handleSelectedContentState.bind(this));\n// }\n\n// async _handleSelectChildContentPlacement(data) {\n// const { placementId } = data;\n// const contentPlacement = await this.map.getContentPlacementDetails(placementId);\n// this.contentPlacementStack.push(contentPlacement);\n// console.log(this.contentPlacementStack);\n// this._updateContentViews();\n// }\n\n// // STATE METHODS\n// _handleDefaultState() {\n// this.hide();\n// // Should clear them too!\n// }\n\n// _handleSearchState(data) {\n// const { query, results } = data;\n// this.hide();\n// }\n\n// _handleSelectedContentState(data) {\n// const { contentPlacement } = data;\n// this.contentPlacementStack = [contentPlacement];\n// this._updateContentViews();\n// this.show();\n\n// // if (this.contentPlacementView && this.container.lastChild) {\n// // this.container.removeChild(this.container.lastChild);\n// // }\n\n// // this.contentPlacementView = new ContentDetails();\n// // this.contentPlacementView.updateView(contentPlacement);\n// // this.contentPlacementView.on('selectChildContentPlacement', this._handleSelectChildContentPlacement.bind(this));\n// // this.container.appendChild(this.contentPlacementView.getElement());\n\n// // NEED TO USE this.contentPlacementStack and CURRENT WIDTH TO APPRORIATELY SET VIEWS\n// }\n\n// _updateContentViews() {\n// this._clearViews();\n\n// if (this.currentView === 'desktop') {\n// this._renderDesktopView();\n// } else {\n// this._renderMobileView();\n// }\n// }\n\n// _renderDesktopView() {\n// if (this.contentPlacementStack.length === 0) return;\n\n// const firstPlacement = this.contentPlacementStack[0];\n// const lastPlacement = this.contentPlacementStack[this.contentPlacementStack.length - 1];\n\n// const leftContentPlacementView = new ContentDetails();\n// leftContentPlacementView.on('selectChildContentPlacement', this._handleSelectChildContentPlacement.bind(this));\n// leftContentPlacementView.updateView(firstPlacement);\n// this.container.appendChild(leftContentPlacementView.getElement());\n\n// if (this.contentPlacementStack.length > 1) {\n// const rightContentPlacementView = new ContentDetails();\n// rightContentPlacementView.on('selectChildContentPlacement', this._handleSelectChildContentPlacement.bind(this));\n// rightContentPlacementView.updateView(lastPlacement);\n// this.container.appendChild(rightContentPlacementView.getElement());\n// }\n// }\n\n// _renderMobileView() {\n// if (this.contentPlacementStack.length === 0) return;\n\n// const lastPlacement = this.contentPlacementStack[this.contentPlacementStack.length - 1];\n\n// const mobileContentPlacementView = new ContentDetails();\n// mobileContentPlacementView.on('selectChildContentPlacement', this._handleSelectChildContentPlacement.bind(this));\n// mobileContentPlacementView.updateView(lastPlacement);\n// this.container.appendChild(mobileContentPlacementView.getElement());\n// }\n\n// _clearViews() {\n// while (this.container.firstChild) {\n// this.container.removeChild(this.container.firstChild);\n// }\n// }\n\n// // HIDE/SHOW METHODS\n// show() {\n// this.container.classList.add('visible');\n// }\n\n// hide() {\n// this.container.classList.remove('visible');\n// }\n// }\n\n// export default ContentPlacementControl;\n\n//# sourceURL=webpack://waygomaps/./src/Controls/ContentPlacementControl.js?");
585
585
 
586
586
  /***/ }),
587
587
 
@@ -603,7 +603,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
603
603
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
604
604
 
605
605
  "use strict";
606
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _core_Control__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/Control */ \"./src/core/Control.js\");\n/* harmony import */ var _utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/coordinateSystems */ \"./src/utils/coordinateSystems.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _superPropGet(t, e, r, o) { var p = _get(_getPrototypeOf(1 & o ? t.prototype : t), e, r); return 2 & o ? function (t) { return p.apply(r, t); } : p; }\nfunction _get() { return _get = \"undefined\" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }\nfunction _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\nvar InteractionControl = /*#__PURE__*/function (_Control) {\n function InteractionControl() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, InteractionControl);\n _this = _callSuper(this, InteractionControl, [options]);\n _this.map = null;\n _this.previouslySelectedFeature = null;\n _this.previouslySelectedIcon = null;\n _this.previouslySelectedTextColor = null;\n _this.previouslySelectedTextOffset = null;\n // this.previouslyHoveredTextColor = null;\n _this.previouslyHoveredFeature = null;\n _this.originalTextColor = null;\n _this.textColorReference = {};\n _this.currentView = null; // Can be set to 'desktop' or 'mobile'\n\n _this.selectedTextColor = '#BE2E28';\n return _this;\n }\n _inherits(InteractionControl, _Control);\n return _createClass(InteractionControl, [{\n key: \"onAdd\",\n value: function onAdd(map) {\n this.map = map;\n this.container = document.createElement('div');\n this.container.className = 'interaction-control-container';\n this.initializeEventListeners();\n this._attachResizeListener();\n this._initialize();\n this.createHighlightedContentLayer();\n this.createSelectedContentLayer();\n this.storeTextColorReferences();\n this.applyHoverEffectToAllSymbolLayers();\n return this.container;\n }\n }, {\n key: \"_initialize\",\n value: function _initialize() {\n var containerWidth = this.map.mapContainer.offsetWidth;\n this._configureView(containerWidth);\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n _superPropGet(InteractionControl, \"onRemove\", this, 3)([]);\n }\n }, {\n key: \"_attachResizeListener\",\n value: function _attachResizeListener() {\n var _this2 = this;\n window.addEventListener('resize', function () {\n var newWidth = _this2.map.mapContainer.offsetWidth;\n _this2._configureView(newWidth);\n });\n }\n }, {\n key: \"_configureView\",\n value: function _configureView(width) {\n if (width > 767) {\n this._setViewForDesktop();\n } else {\n this._setViewForMobile();\n }\n }\n }, {\n key: \"_setViewForDesktop\",\n value: function _setViewForDesktop() {\n this.currentView = 'desktop';\n }\n }, {\n key: \"_setViewForMobile\",\n value: function _setViewForMobile() {\n this.currentView = 'mobile';\n }\n }, {\n key: \"initializeEventListeners\",\n value: function initializeEventListeners() {\n var _this3 = this;\n this.map.map.on('styleimagemissing', function (e) {\n var missingImage = e.id;\n console.warn(\"Image \\\"\".concat(missingImage, \"\\\" could not be loaded.\"));\n });\n this.map.map.on('click', function (e) {\n _this3._handleClick(e);\n });\n this.map.on('state:default', this._handleDefaultState.bind(this));\n this.map.on('state:search', this._handleSearchState.bind(this));\n this.map.on('state:selectedContent', this._handleSelectedContentState.bind(this));\n this.map.on('state:directions', this._handleDirectionsState.bind(this));\n this.map.on('additionalSearchResults', this._handleAdditionalSearch.bind(this));\n this.map.on('hoverSearchResult', this._handleHoverSearchResult.bind(this));\n this.map.on('hoverEndSearchResult', this._handleHoverEndSearchResult.bind(this));\n }\n }, {\n key: \"storeTextColorReferences\",\n value: function storeTextColorReferences() {\n var _this4 = this;\n var layers = this.map.map.getStyle().layers;\n layers.forEach(function (layer) {\n if (layer.type === 'symbol') {\n var textColor = _this4.map.map.getPaintProperty(layer.id, 'text-color');\n if (textColor !== undefined) {\n _this4.textColorReference[layer.id] = textColor; // Store the text color reference using the layer ID as the key\n }\n }\n });\n }\n }, {\n key: \"createSelectedContentLayer\",\n value: function createSelectedContentLayer() {\n this.map.map.addSource('selected-content', {\n 'type': 'geojson',\n 'data': {\n 'type': 'FeatureCollection',\n 'features': [] // Initially empty, you will add features dynamically\n }\n });\n\n // Add a layer that references this GeoJSON source and matches the styling in your Mapbox Studio project\n this.map.map.addLayer({\n 'id': 'selected-content-layer',\n 'type': 'symbol',\n // Or 'fill', 'line', etc. based on your needs\n 'source': 'selected-content',\n 'layout': {\n 'text-field': ['get', 'name'],\n 'text-font': ['Inter Medium'],\n 'text-size': 14,\n 'text-justify': 'left',\n 'text-anchor': 'bottom-left',\n 'text-offset': [1.3, -1],\n 'icon-image': 'selected-pin',\n 'icon-size': 0.5,\n 'icon-offset': [0, -5],\n 'icon-anchor': 'bottom',\n 'symbol-z-elevate': true,\n 'text-padding': 10,\n 'icon-padding': 5\n },\n 'paint': {\n 'text-color': '#BE2E28',\n 'text-halo-color': '#ffffff',\n 'text-halo-width': 1\n }\n });\n }\n }, {\n key: \"createHighlightedContentLayer\",\n value: function createHighlightedContentLayer() {\n this.map.map.addSource('highlighted-content', {\n 'type': 'geojson',\n 'data': {\n 'type': 'FeatureCollection',\n 'features': []\n }\n });\n this.map.map.addLayer({\n 'id': 'highlighted-content-layer',\n 'type': 'symbol',\n 'source': 'highlighted-content',\n 'layout': {\n 'text-field': ['get', 'name'],\n 'text-font': ['Inter Medium'],\n 'text-size': 14,\n 'text-justify': 'left',\n 'text-anchor': 'bottom-left',\n 'text-offset': [1.2, -0.6],\n 'icon-image': 'highlightedPin',\n 'icon-size': 0.5,\n 'icon-offset': [0, -5],\n 'icon-anchor': 'bottom',\n 'symbol-z-elevate': true,\n 'text-padding': 5,\n 'icon-padding': 5\n },\n 'paint': {\n 'text-color': '#1E1E1E',\n 'text-halo-color': '#ffffff',\n 'text-halo-width': 1\n }\n });\n }\n }, {\n key: \"clearSelectedContentLayer\",\n value: function clearSelectedContentLayer() {\n this.map.map.getSource('selected-content').setData({\n 'type': 'FeatureCollection',\n 'features': []\n });\n }\n }, {\n key: \"clearHighlightedContentLayer\",\n value: function clearHighlightedContentLayer() {\n this.map.map.getSource('highlighted-content').setData({\n 'type': 'FeatureCollection',\n 'features': []\n });\n }\n }, {\n key: \"addSelectedFeature\",\n value: function addSelectedFeature(coordinates, properties) {\n var source = this.map.map.getSource('selected-content');\n var currentData = source._data;\n var newFeature = {\n 'type': 'Feature',\n 'geometry': {\n 'type': 'Point',\n 'coordinates': coordinates\n },\n 'properties': properties\n };\n currentData.features.push(newFeature);\n source.setData(currentData);\n }\n }, {\n key: \"addHighlightedFeature\",\n value: function addHighlightedFeature(coordinates, properties) {\n var source = this.map.map.getSource('highlighted-content');\n var currentData = source._data;\n var newFeature = {\n 'type': 'Feature',\n 'geometry': {\n 'type': 'Point',\n 'coordinates': coordinates\n },\n 'properties': properties\n };\n currentData.features.push(newFeature);\n source.setData(currentData);\n return newFeature;\n }\n }, {\n key: \"_handleDefaultState\",\n value: function _handleDefaultState() {\n this.clearHighlightedContentLayer();\n this.clearSelectedContentLayer();\n this.showSymbolLayers();\n }\n }, {\n key: \"_handleSearchState\",\n value: function _handleSearchState(data) {\n var query = data.query,\n results = data.results;\n this.hideSymbolLayers();\n this.clearSelectedContentLayer();\n this.updateLabelsForSearchResults(results);\n }\n }, {\n key: \"_handleAdditionalSearch\",\n value: function _handleAdditionalSearch(data) {\n var results = data.results;\n // console.log(\"--> HERE ARE ADDITIONAL RESULTS:\", results);\n this.updateLabelsForSearchResults(results, false);\n }\n }, {\n key: \"_handleHoverSearchResult\",\n value: function _handleHoverSearchResult(data) {\n var result = data.result;\n // console.log(\"--> HERE IS HOVERED RESULT:\", result);\n this.updateLabelForSelectedContentPlacement(result, false);\n }\n }, {\n key: \"_handleHoverEndSearchResult\",\n value: function _handleHoverEndSearchResult() {\n // const { result } = data;\n // console.log(\"--> HERE IS HOVERED RESULT:\", result);\n // this.updateLabelForSelectedContentPlacement(result);\n this.clearSelectedContentLayer();\n }\n }, {\n key: \"_handleSelectedContentState\",\n value: function _handleSelectedContentState(data) {\n var contentPlacementIds = data.contentPlacementIds,\n selectedContentPlacement = data.selectedContentPlacement;\n console.log('adding selected content pin', selectedContentPlacement);\n this.updateLabelForSelectedContentPlacement(selectedContentPlacement);\n }\n }, {\n key: \"_handleDirectionsState\",\n value: function _handleDirectionsState(data) {\n console.log(\"handling directions state in interaction control\");\n }\n }, {\n key: \"hideSymbolLayers\",\n value: function hideSymbolLayers() {\n var _this5 = this;\n var layers = this.map.map.getStyle().layers;\n layers.forEach(function (layer) {\n // Check if the layer is a symbol layer and not 'selected' or 'highlighted'\n if (layer.type === 'symbol' && layer.id !== 'selected-content-layer' && layer.id !== 'highlighted-content-layer') {\n _this5.map.map.setLayoutProperty(layer.id, 'visibility', 'none');\n }\n });\n }\n }, {\n key: \"showSymbolLayers\",\n value: function showSymbolLayers() {\n var _this6 = this;\n var layers = this.map.map.getStyle().layers;\n layers.forEach(function (layer) {\n if (layer.type === 'symbol') {\n _this6.map.map.setLayoutProperty(layer.id, 'visibility', 'visible');\n }\n });\n }\n }, {\n key: \"updateLabelsForSearchResults\",\n value: function updateLabelsForSearchResults(results) {\n var _this7 = this;\n var animate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n this.clearHighlightedContentLayer();\n var features = [];\n results.forEach(function (result) {\n // console.log(\"RESULT:\", result);\n\n var coordinates = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_1__.convertVerticesToCoordinates)([result.location], null, 10.0);\n // console.log(\"pls\", coordinates[0]);\n var coordinate = coordinates[0];\n var feature = _this7.addHighlightedFeature(coordinate, result);\n features.push(feature);\n\n // const placementId = result.placement_id;\n // const feature = this.map._findFeatureByPlacementId(placementId);\n // if (feature) {\n // const coorindates = feature.geometry.coordinates;\n // const properties = feature.properties;\n // console.log(\"HERE\", feature);\n // this.addHighlightedFeature(coorindates, properties);\n // features.push(feature);\n // }\n });\n if (features.length && animate) {\n // console.log('chek');\n var bounds = new mapboxgl.LngLatBounds();\n // console.log('chekk', bounds);\n features.forEach(function (feature) {\n // console.log('chekkk', feature.geometry.coordinates);\n bounds.extend(feature.geometry.coordinates);\n });\n if (this.currentView === 'desktop') {\n this.map.map.fitBounds(bounds, {\n padding: {\n top: 200,\n bottom: 200,\n left: 550,\n right: 200\n },\n maxZoom: 15,\n duration: 1000\n });\n } else if (this.currentView === 'mobile') {\n var mapHeight = this.map.mapContainer.offsetHeight;\n var mapWidth = this.map.mapContainer.offsetWidth;\n var bottomPaddingPercent = 55;\n var sidePaddingPercent = 30;\n var bottomPaddingInPixels = mapHeight * (bottomPaddingPercent / 100);\n var sidePaddingInPixels = mapWidth * (sidePaddingPercent / 100);\n this.map.map.fitBounds(bounds, {\n padding: {\n top: 200,\n bottom: bottomPaddingInPixels,\n left: sidePaddingInPixels,\n right: sidePaddingInPixels\n },\n maxZoom: 15,\n duration: 1000\n });\n }\n }\n }\n }, {\n key: \"updateLabelForSelectedContentPlacement\",\n value: function updateLabelForSelectedContentPlacement(result) {\n var animate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n // const placementId = contentPlacement.placement_id;\n // const position = contentPlacement.position; // Should eventually use this, with scaling!\n this.clearSelectedContentLayer();\n\n // const features = this.map.map.queryRenderedFeatures({\n // // Use a filter to find the feature with the matching placementId\n // filter: ['==', ['get', 'placement_id'], placementId]\n // });\n\n var coordinates = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_1__.convertVerticesToCoordinates)([result.location], null, 10.0);\n var coordinate = coordinates[0];\n var feature = this.addHighlightedFeature(coordinate, result);\n // features.push(feature);\n\n if (!result.name) {\n console.log(\"no name\");\n if (result.content) {\n console.log(\"content:\", result.content);\n if (result.content.title_key) {\n console.log(\"title key:\", result.content.title_key);\n var titleKey = result.content.title_key;\n var title = result.content.data[titleKey];\n result.name = title;\n }\n }\n }\n\n // if (features.length !== 0) {\n // const feature = features[0]\n // const coorindates = feature.geometry.coordinates;\n // const properties = feature.properties;\n\n this.addSelectedFeature(coordinate, result);\n if (animate) {\n if (this.currentView === 'desktop') {\n this.map.map.easeTo({\n center: coordinate,\n padding: {\n top: 0,\n bottom: 0,\n left: 330,\n right: 0\n },\n // zoom: 12, // Optional: Desired zoom level\n duration: 1000 // Optional: Duration of the animation in milliseconds\n });\n } else if (this.currentView === 'mobile') {\n var mapHeight = this.map.mapContainer.offsetHeight;\n var bottomPaddingPercent = 35;\n var bottomPaddingInPixels = mapHeight * (bottomPaddingPercent / 100);\n this.map.map.easeTo({\n center: coordinate,\n padding: {\n top: 0,\n bottom: bottomPaddingInPixels,\n left: 0,\n right: 0\n },\n // zoom: 12, // Optional: Desired zoom level\n duration: 1000 // Optional: Duration of the animation in milliseconds\n });\n }\n }\n // }\n }\n }, {\n key: \"applyHoverEffectToAllSymbolLayers\",\n value: function applyHoverEffectToAllSymbolLayers() {\n var _this8 = this;\n var layers = this.map.map.getStyle().layers;\n layers.forEach(function (layer) {\n if (layer.type === 'symbol') {\n var layerId = layer.id;\n var defaultTextColor = _this8.textColorReference[layerId];\n _this8.map.map.on('mouseenter', layerId, function (e) {\n var feature = e.features[0];\n var placementId = feature.properties.placement_id;\n\n // this.originalTextColor = null;\n if (!_this8.previouslySelectedFeature || _this8.previouslySelectedFeature.layer.id !== feature.layer.id) {\n _this8.originalTextColor = _this8.map.map.getPaintProperty(layerId, 'text-color');\n _this8.map.map.setPaintProperty(layerId, 'text-color', ['case', ['==', ['get', 'placement_id'], placementId], '#4B90F7', defaultTextColor //this.originalTextColor\n ]);\n } else {\n _this8.originalTextColor = _this8.previouslySelectedTextColor;\n var previouslySelectedPlacementId = _this8.previouslySelectedFeature.properties.placement_id;\n _this8.map.map.setPaintProperty(layerId, 'text-color', ['case', ['==', ['get', 'placement_id'], placementId], '#4B90F7', ['==', ['get', 'placement_id'], previouslySelectedPlacementId], _this8.selectedTextColor, defaultTextColor //this.originalTextColor\n ]);\n }\n _this8.map.map.getCanvas().style.cursor = 'pointer';\n });\n _this8.map.map.on('mouseleave', layerId, function () {\n if (!_this8.previouslySelectedFeature) {\n _this8.map.map.setPaintProperty(layerId, 'text-color', defaultTextColor); //this.originalTextColor);\n } else {\n // If a feature is selected, maintain its selected color\n var previouslySelectedPlacementId = _this8.previouslySelectedFeature.properties.placement_id;\n _this8.map.map.setPaintProperty(layerId, 'text-color', ['case', ['==', ['get', 'placement_id'], previouslySelectedPlacementId], _this8.selectedTextColor, defaultTextColor //this.originalTextColor\n ]);\n }\n _this8.map.map.getCanvas().style.cursor = 'default';\n });\n }\n });\n }\n }, {\n key: \"_handleClick\",\n value: function _handleClick(e) {\n var features = this.map.map.queryRenderedFeatures(e.point);\n var symbolFeatures = features.filter(function (feature) {\n return feature.layer.type === 'symbol';\n });\n if (symbolFeatures.length > 0) {\n var placementId = symbolFeatures[0].properties.placement_id;\n this.map.setToSelectedContentState([placementId]);\n }\n }\n\n // removeCurrentSelectedFeatureStyling() {\n // console.log('Remove styling for selected placement');\n\n // if (this.previouslySelectedFeature) {\n // this.map.map.setLayoutProperty(this.previouslySelectedFeature.layer.id, 'icon-image', this.previouslySelectedIcon);\n // this.map.map.setPaintProperty(this.previouslySelectedFeature.layer.id, 'text-color', this.previouslySelectedTextColor);\n // this.map.map.setLayoutProperty(this.previouslySelectedFeature.layer.id, 'text-offset', this.previouslySelectedTextOffset);\n\n // this.previouslySelectedFeature = null;\n // }\n // }\n\n // addStylingForSelectedPlacement(placementId) {\n // console.log('Adding styling for selected placement');\n\n // const feature = this.map._findFeatureByPlacementId(placementId);\n // const layerId = feature.layer.id;\n\n // this.previouslySelectedFeature = feature;\n // this.previouslySelectedIcon = this.map.map.getLayoutProperty(layerId, 'icon-image');\n // // this.previouslySelectedTextColor = this.map.map.getPaintProperty(layerId, 'text-color');\n // this.previouslySelectedTextColor = this.originalTextColor;\n // this.previouslySelectedTextOffset = this.map.map.getLayoutProperty(layerId, 'text-offset');\n\n // this.map.map.setLayoutProperty(layerId, 'icon-image', [\n // 'case',\n // ['==', ['get', 'placement_id'], placementId], 'selected-pin1',\n // this.previouslySelectedIcon\n // ]);\n\n // // this.map.map.setPaintProperty(layerId, 'text-color', [\n // // 'case',\n // // ['==', ['get', 'placement_id'], placementId], this.selectedTextColor,\n // // this.previouslySelectedTextColor\n // // ]);\n // this.map.map.setPaintProperty(layerId, 'text-color', [\n // 'case',\n // ['==', ['get', 'placement_id'], placementId], this.selectedTextColor,\n // this.previouslySelectedTextColor\n // ]);\n\n // console.log(\"HEHE\", this.previouslySelectedTextColor, this.originalTextColor);\n\n // this.map.map.setLayoutProperty(layerId, 'text-offset', [\n // 'case',\n // ['==', ['get', 'placement_id'], placementId], [1.3, -1.0],\n // this.previouslySelectedTextOffset\n // ]);\n\n // }\n }]);\n}(_core_Control__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InteractionControl);\n\n//# sourceURL=webpack://waygomaps/./src/Controls/InteractionControl.js?");
606
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _core_Control__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/Control */ \"./src/core/Control.js\");\n/* harmony import */ var _utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/coordinateSystems */ \"./src/utils/coordinateSystems.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _superPropGet(t, e, r, o) { var p = _get(_getPrototypeOf(1 & o ? t.prototype : t), e, r); return 2 & o ? function (t) { return p.apply(r, t); } : p; }\nfunction _get() { return _get = \"undefined\" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }\nfunction _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\nvar InteractionControl = /*#__PURE__*/function (_Control) {\n function InteractionControl() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, InteractionControl);\n _this = _callSuper(this, InteractionControl, [options]);\n _this.map = null;\n _this.previouslySelectedFeature = null;\n _this.previouslySelectedIcon = null;\n _this.previouslySelectedTextColor = null;\n _this.previouslySelectedTextOffset = null;\n // this.previouslyHoveredTextColor = null;\n _this.previouslyHoveredFeature = null;\n _this.originalTextColor = null;\n _this.textColorReference = {};\n _this.currentView = null; // Can be set to 'desktop' or 'mobile'\n\n _this.selectedTextColor = '#BE2E28';\n return _this;\n }\n _inherits(InteractionControl, _Control);\n return _createClass(InteractionControl, [{\n key: \"onAdd\",\n value: function onAdd(map) {\n this.map = map;\n this.container = document.createElement('div');\n this.container.className = 'interaction-control-container';\n this.initializeEventListeners();\n this._attachResizeListener();\n this._initialize();\n this.createHighlightedContentLayer();\n this.createSelectedContentLayer();\n this.storeTextColorReferences();\n this.applyHoverEffectToAllSymbolLayers();\n return this.container;\n }\n }, {\n key: \"_initialize\",\n value: function _initialize() {\n var containerWidth = this.map.mapContainer.offsetWidth;\n this._configureView(containerWidth);\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n _superPropGet(InteractionControl, \"onRemove\", this, 3)([]);\n }\n }, {\n key: \"_attachResizeListener\",\n value: function _attachResizeListener() {\n var _this2 = this;\n window.addEventListener('resize', function () {\n var newWidth = _this2.map.mapContainer.offsetWidth;\n _this2._configureView(newWidth);\n });\n }\n }, {\n key: \"_configureView\",\n value: function _configureView(width) {\n if (width > 767) {\n this._setViewForDesktop();\n } else {\n this._setViewForMobile();\n }\n }\n }, {\n key: \"_setViewForDesktop\",\n value: function _setViewForDesktop() {\n this.currentView = 'desktop';\n }\n }, {\n key: \"_setViewForMobile\",\n value: function _setViewForMobile() {\n this.currentView = 'mobile';\n }\n }, {\n key: \"initializeEventListeners\",\n value: function initializeEventListeners() {\n var _this3 = this;\n this.map.map.on('styleimagemissing', function (e) {\n var missingImage = e.id;\n console.warn(\"Image \\\"\".concat(missingImage, \"\\\" could not be loaded.\"));\n });\n this.map.map.on('click', function (e) {\n _this3._handleClick(e);\n });\n this.map.on('state:default', this._handleDefaultState.bind(this));\n this.map.on('state:search', this._handleSearchState.bind(this));\n this.map.on('state:selectedContent', this._handleSelectedContentState.bind(this));\n this.map.on('state:directions', this._handleDirectionsState.bind(this));\n this.map.on('additionalSearchResults', this._handleAdditionalSearch.bind(this));\n this.map.on('hoverSearchResult', this._handleHoverSearchResult.bind(this));\n this.map.on('hoverEndSearchResult', this._handleHoverEndSearchResult.bind(this));\n }\n }, {\n key: \"storeTextColorReferences\",\n value: function storeTextColorReferences() {\n var _this4 = this;\n var layers = this.map.map.getStyle().layers;\n layers.forEach(function (layer) {\n if (layer.type === 'symbol') {\n var textColor = _this4.map.map.getPaintProperty(layer.id, 'text-color');\n if (textColor !== undefined) {\n _this4.textColorReference[layer.id] = textColor; // Store the text color reference using the layer ID as the key\n }\n }\n });\n }\n }, {\n key: \"createSelectedContentLayer\",\n value: function createSelectedContentLayer() {\n this.map.map.addSource('selected-content', {\n 'type': 'geojson',\n 'data': {\n 'type': 'FeatureCollection',\n 'features': [] // Initially empty, you will add features dynamically\n }\n });\n\n // Add a layer that references this GeoJSON source and matches the styling in your Mapbox Studio project\n this.map.map.addLayer({\n 'id': 'selected-content-layer',\n 'type': 'symbol',\n // Or 'fill', 'line', etc. based on your needs\n 'source': 'selected-content',\n 'layout': {\n 'text-field': ['get', 'name'],\n 'text-font': ['Inter Medium'],\n 'text-size': 14,\n 'text-justify': 'left',\n 'text-anchor': 'bottom-left',\n 'text-offset': [1.3, -1],\n 'icon-image': 'selected-pin',\n 'icon-size': 0.5,\n 'icon-offset': [0, -5],\n 'icon-anchor': 'bottom',\n 'symbol-z-elevate': true,\n 'text-padding': 10,\n 'icon-padding': 5\n },\n 'paint': {\n 'text-color': '#BE2E28',\n 'text-halo-color': '#ffffff',\n 'text-halo-width': 1\n }\n });\n }\n }, {\n key: \"createHighlightedContentLayer\",\n value: function createHighlightedContentLayer() {\n this.map.map.addSource('highlighted-content', {\n 'type': 'geojson',\n 'data': {\n 'type': 'FeatureCollection',\n 'features': []\n }\n });\n this.map.map.addLayer({\n 'id': 'highlighted-content-layer',\n 'type': 'symbol',\n 'source': 'highlighted-content',\n 'layout': {\n 'text-field': ['get', 'name'],\n 'text-font': ['Inter Medium'],\n 'text-size': 14,\n 'text-justify': 'left',\n 'text-anchor': 'bottom-left',\n 'text-offset': [1.2, -0.6],\n 'icon-image': 'highlightedPin',\n 'icon-size': 0.5,\n 'icon-offset': [0, -5],\n 'icon-anchor': 'bottom',\n 'symbol-z-elevate': true,\n 'text-padding': 5,\n 'icon-padding': 5\n },\n 'paint': {\n 'text-color': '#1E1E1E',\n 'text-halo-color': '#ffffff',\n 'text-halo-width': 1\n }\n });\n }\n }, {\n key: \"clearSelectedContentLayer\",\n value: function clearSelectedContentLayer() {\n this.map.map.getSource('selected-content').setData({\n 'type': 'FeatureCollection',\n 'features': []\n });\n }\n }, {\n key: \"clearHighlightedContentLayer\",\n value: function clearHighlightedContentLayer() {\n this.map.map.getSource('highlighted-content').setData({\n 'type': 'FeatureCollection',\n 'features': []\n });\n }\n }, {\n key: \"addSelectedFeature\",\n value: function addSelectedFeature(coordinates, properties) {\n var source = this.map.map.getSource('selected-content');\n var currentData = source._data;\n var newFeature = {\n 'type': 'Feature',\n 'geometry': {\n 'type': 'Point',\n 'coordinates': coordinates\n },\n 'properties': properties\n };\n currentData.features.push(newFeature);\n source.setData(currentData);\n }\n }, {\n key: \"addHighlightedFeature\",\n value: function addHighlightedFeature(coordinates, properties) {\n var source = this.map.map.getSource('highlighted-content');\n var currentData = source._data;\n var newFeature = {\n 'type': 'Feature',\n 'geometry': {\n 'type': 'Point',\n 'coordinates': coordinates\n },\n 'properties': properties\n };\n currentData.features.push(newFeature);\n source.setData(currentData);\n return newFeature;\n }\n }, {\n key: \"_handleDefaultState\",\n value: function _handleDefaultState() {\n this.clearHighlightedContentLayer();\n this.clearSelectedContentLayer();\n this.showSymbolLayers();\n }\n }, {\n key: \"_handleSearchState\",\n value: function _handleSearchState(data) {\n var query = data.query,\n results = data.results;\n this.hideSymbolLayers();\n this.clearSelectedContentLayer();\n this.updateLabelsForSearchResults(results);\n }\n }, {\n key: \"_handleAdditionalSearch\",\n value: function _handleAdditionalSearch(data) {\n var results = data.results;\n // console.log(\"--> HERE ARE ADDITIONAL RESULTS:\", results);\n this.updateLabelsForSearchResults(results, false);\n }\n }, {\n key: \"_handleHoverSearchResult\",\n value: function _handleHoverSearchResult(data) {\n var result = data.result;\n // console.log(\"--> HERE IS HOVERED RESULT:\", result);\n this.updateLabelForSelectedContentPlacement(result, false);\n }\n }, {\n key: \"_handleHoverEndSearchResult\",\n value: function _handleHoverEndSearchResult() {\n // const { result } = data;\n // console.log(\"--> HERE IS HOVERED RESULT:\", result);\n // this.updateLabelForSelectedContentPlacement(result);\n this.clearSelectedContentLayer();\n }\n }, {\n key: \"_handleSelectedContentState\",\n value: function _handleSelectedContentState(data) {\n var contentPlacementIds = data.contentPlacementIds,\n selectedContentPlacement = data.selectedContentPlacement;\n console.log('adding selected content pin', selectedContentPlacement);\n this.updateLabelForSelectedContentPlacement(selectedContentPlacement);\n }\n }, {\n key: \"_handleDirectionsState\",\n value: function _handleDirectionsState(data) {\n console.log(\"handling directions state in interaction control\");\n }\n }, {\n key: \"hideSymbolLayers\",\n value: function hideSymbolLayers() {\n var _this5 = this;\n var layers = this.map.map.getStyle().layers;\n layers.forEach(function (layer) {\n // Check if the layer is a symbol layer and not 'selected' or 'highlighted'\n if (layer.type === 'symbol' && layer.id !== 'selected-content-layer' && layer.id !== 'highlighted-content-layer') {\n _this5.map.map.setLayoutProperty(layer.id, 'visibility', 'none');\n }\n });\n }\n }, {\n key: \"showSymbolLayers\",\n value: function showSymbolLayers() {\n var _this6 = this;\n var layers = this.map.map.getStyle().layers;\n layers.forEach(function (layer) {\n if (layer.type === 'symbol') {\n _this6.map.map.setLayoutProperty(layer.id, 'visibility', 'visible');\n }\n });\n }\n }, {\n key: \"updateLabelsForSearchResults\",\n value: function updateLabelsForSearchResults(results) {\n var _this7 = this;\n var animate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n this.clearHighlightedContentLayer();\n var features = [];\n results.forEach(function (result) {\n // console.log(\"RESULT:\", result);\n\n var coordinates = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_1__.convertVerticesToCoordinates)([result.location], null, 10.0);\n // console.log(\"pls\", coordinates[0]);\n var coordinate = coordinates[0];\n var feature = _this7.addHighlightedFeature(coordinate, result);\n features.push(feature);\n\n // const placementId = result.placement_id;\n // const feature = this.map._findFeatureByPlacementId(placementId);\n // if (feature) {\n // const coorindates = feature.geometry.coordinates;\n // const properties = feature.properties;\n // console.log(\"HERE\", feature);\n // this.addHighlightedFeature(coorindates, properties);\n // features.push(feature);\n // }\n });\n if (features.length && animate) {\n // console.log('chek');\n var bounds = new mapboxgl.LngLatBounds();\n // console.log('chekk', bounds);\n features.forEach(function (feature) {\n // console.log('chekkk', feature.geometry.coordinates);\n bounds.extend(feature.geometry.coordinates);\n });\n if (this.currentView === 'desktop') {\n var camera = this.map.map.cameraForBounds(bounds, {\n // padding: {\n // top: 200,\n // bottom: 200,\n // left: 550,\n // right: 200\n // },\n padding: {\n top: 200,\n bottom: 400,\n left: 800,\n right: 200\n },\n maxZoom: 14\n });\n this.map.map.easeTo(_objectSpread(_objectSpread({}, camera), {}, {\n // Use the calculated camera position to keep the bounds and padding\n pitch: 45,\n // Set pitch\n bearing: -37,\n // Set bearing\n duration: 1000 // Animation duration\n }));\n\n // this.map.map.flyTo({\n // center: bounds.getCenter(), // Center of the bounds\n // zoom: this.map.map.getZoom(), // Keep the current zoom level from `fitBounds`\n // pitch: 45, // Target pitch\n // bearing: -37, // Target bearing\n // duration: 1000 // Animation duration for the pitch/bearing transition\n // });\n // this.map.map.fitBounds(bounds, {\n // padding: {\n // top: 200,\n // bottom: 200,\n // left: 550,\n // right: 200\n // },\n // maxZoom: 15,\n // duration: 1000\n // });\n\n // setTimeout(() => {\n // this.map.map.flyTo({\n // center: bounds.getCenter(), // Center of the bounds\n // zoom: this.map.map.getZoom(), // Keep the current zoom level from `fitBounds`\n // pitch: 60, // Target pitch\n // bearing: 30, // Target bearing\n // duration: 1000 // Animation duration for the pitch/bearing transition\n // });\n // }, 1000);\n // this.map.map.setPitch(60);\n // this.map.map.setBearing(60);\n } else if (this.currentView === 'mobile') {\n var mapHeight = this.map.mapContainer.offsetHeight;\n var mapWidth = this.map.mapContainer.offsetWidth;\n var bottomPaddingPercent = 55;\n var sidePaddingPercent = 30;\n var bottomPaddingInPixels = mapHeight * (bottomPaddingPercent / 100);\n var sidePaddingInPixels = mapWidth * (sidePaddingPercent / 100);\n this.map.map.fitBounds(bounds, {\n padding: {\n top: 200,\n bottom: bottomPaddingInPixels,\n left: sidePaddingInPixels,\n right: sidePaddingInPixels\n },\n maxZoom: 15,\n duration: 1000\n });\n }\n }\n }\n }, {\n key: \"updateLabelForSelectedContentPlacement\",\n value: function updateLabelForSelectedContentPlacement(result) {\n var animate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n // const placementId = contentPlacement.placement_id;\n // const position = contentPlacement.position; // Should eventually use this, with scaling!\n this.clearSelectedContentLayer();\n\n // const features = this.map.map.queryRenderedFeatures({\n // // Use a filter to find the feature with the matching placementId\n // filter: ['==', ['get', 'placement_id'], placementId]\n // });\n\n var coordinates = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_1__.convertVerticesToCoordinates)([result.location], null, 10.0);\n var coordinate = coordinates[0];\n var feature = this.addHighlightedFeature(coordinate, result);\n // features.push(feature);\n\n if (!result.name) {\n console.log(\"no name\");\n if (result.content) {\n console.log(\"content:\", result.content);\n if (result.content.title_key) {\n console.log(\"title key:\", result.content.title_key);\n var titleKey = result.content.title_key;\n var title = result.content.data[titleKey];\n result.name = title;\n }\n }\n }\n\n // if (features.length !== 0) {\n // const feature = features[0]\n // const coorindates = feature.geometry.coordinates;\n // const properties = feature.properties;\n\n this.addSelectedFeature(coordinate, result);\n if (animate) {\n if (this.currentView === 'desktop') {\n this.map.map.easeTo({\n center: coordinate,\n padding: {\n top: 0,\n bottom: 0,\n left: 330,\n right: 0\n },\n // zoom: 12, // Optional: Desired zoom level\n duration: 1000 // Optional: Duration of the animation in milliseconds\n });\n } else if (this.currentView === 'mobile') {\n var mapHeight = this.map.mapContainer.offsetHeight;\n var bottomPaddingPercent = 35;\n var bottomPaddingInPixels = mapHeight * (bottomPaddingPercent / 100);\n this.map.map.easeTo({\n center: coordinate,\n padding: {\n top: 0,\n bottom: bottomPaddingInPixels,\n left: 0,\n right: 0\n },\n // zoom: 12, // Optional: Desired zoom level\n duration: 1000 // Optional: Duration of the animation in milliseconds\n });\n }\n }\n // }\n }\n }, {\n key: \"applyHoverEffectToAllSymbolLayers\",\n value: function applyHoverEffectToAllSymbolLayers() {\n var _this8 = this;\n var layers = this.map.map.getStyle().layers;\n layers.forEach(function (layer) {\n if (layer.type === 'symbol') {\n var layerId = layer.id;\n var defaultTextColor = _this8.textColorReference[layerId];\n _this8.map.map.on('mouseenter', layerId, function (e) {\n var feature = e.features[0];\n var placementId = feature.properties.placement_id;\n\n // this.originalTextColor = null;\n if (!_this8.previouslySelectedFeature || _this8.previouslySelectedFeature.layer.id !== feature.layer.id) {\n _this8.originalTextColor = _this8.map.map.getPaintProperty(layerId, 'text-color');\n _this8.map.map.setPaintProperty(layerId, 'text-color', ['case', ['==', ['get', 'placement_id'], placementId], '#4B90F7', defaultTextColor //this.originalTextColor\n ]);\n } else {\n _this8.originalTextColor = _this8.previouslySelectedTextColor;\n var previouslySelectedPlacementId = _this8.previouslySelectedFeature.properties.placement_id;\n _this8.map.map.setPaintProperty(layerId, 'text-color', ['case', ['==', ['get', 'placement_id'], placementId], '#4B90F7', ['==', ['get', 'placement_id'], previouslySelectedPlacementId], _this8.selectedTextColor, defaultTextColor //this.originalTextColor\n ]);\n }\n _this8.map.map.getCanvas().style.cursor = 'pointer';\n });\n _this8.map.map.on('mouseleave', layerId, function () {\n if (!_this8.previouslySelectedFeature) {\n _this8.map.map.setPaintProperty(layerId, 'text-color', defaultTextColor); //this.originalTextColor);\n } else {\n // If a feature is selected, maintain its selected color\n var previouslySelectedPlacementId = _this8.previouslySelectedFeature.properties.placement_id;\n _this8.map.map.setPaintProperty(layerId, 'text-color', ['case', ['==', ['get', 'placement_id'], previouslySelectedPlacementId], _this8.selectedTextColor, defaultTextColor //this.originalTextColor\n ]);\n }\n _this8.map.map.getCanvas().style.cursor = 'default';\n });\n }\n });\n }\n }, {\n key: \"_handleClick\",\n value: function _handleClick(e) {\n var features = this.map.map.queryRenderedFeatures(e.point);\n var symbolFeatures = features.filter(function (feature) {\n return feature.layer.type === 'symbol';\n });\n if (symbolFeatures.length > 0) {\n var placementId = symbolFeatures[0].properties.placement_id;\n this.map.setToSelectedContentState([placementId]);\n }\n }\n\n // removeCurrentSelectedFeatureStyling() {\n // console.log('Remove styling for selected placement');\n\n // if (this.previouslySelectedFeature) {\n // this.map.map.setLayoutProperty(this.previouslySelectedFeature.layer.id, 'icon-image', this.previouslySelectedIcon);\n // this.map.map.setPaintProperty(this.previouslySelectedFeature.layer.id, 'text-color', this.previouslySelectedTextColor);\n // this.map.map.setLayoutProperty(this.previouslySelectedFeature.layer.id, 'text-offset', this.previouslySelectedTextOffset);\n\n // this.previouslySelectedFeature = null;\n // }\n // }\n\n // addStylingForSelectedPlacement(placementId) {\n // console.log('Adding styling for selected placement');\n\n // const feature = this.map._findFeatureByPlacementId(placementId);\n // const layerId = feature.layer.id;\n\n // this.previouslySelectedFeature = feature;\n // this.previouslySelectedIcon = this.map.map.getLayoutProperty(layerId, 'icon-image');\n // // this.previouslySelectedTextColor = this.map.map.getPaintProperty(layerId, 'text-color');\n // this.previouslySelectedTextColor = this.originalTextColor;\n // this.previouslySelectedTextOffset = this.map.map.getLayoutProperty(layerId, 'text-offset');\n\n // this.map.map.setLayoutProperty(layerId, 'icon-image', [\n // 'case',\n // ['==', ['get', 'placement_id'], placementId], 'selected-pin1',\n // this.previouslySelectedIcon\n // ]);\n\n // // this.map.map.setPaintProperty(layerId, 'text-color', [\n // // 'case',\n // // ['==', ['get', 'placement_id'], placementId], this.selectedTextColor,\n // // this.previouslySelectedTextColor\n // // ]);\n // this.map.map.setPaintProperty(layerId, 'text-color', [\n // 'case',\n // ['==', ['get', 'placement_id'], placementId], this.selectedTextColor,\n // this.previouslySelectedTextColor\n // ]);\n\n // console.log(\"HEHE\", this.previouslySelectedTextColor, this.originalTextColor);\n\n // this.map.map.setLayoutProperty(layerId, 'text-offset', [\n // 'case',\n // ['==', ['get', 'placement_id'], placementId], [1.3, -1.0],\n // this.previouslySelectedTextOffset\n // ]);\n\n // }\n }]);\n}(_core_Control__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InteractionControl);\n\n//# sourceURL=webpack://waygomaps/./src/Controls/InteractionControl.js?");
607
607
 
608
608
  /***/ }),
609
609
 
@@ -680,7 +680,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
680
680
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
681
681
 
682
682
  "use strict";
683
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var _WaygoMaps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../WaygoMaps */ \"./src/WaygoMaps.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n// src/ApiManager.js\n\n\nvar ApiManager = /*#__PURE__*/function () {\n function ApiManager(baseURL) {\n _classCallCheck(this, ApiManager);\n this.client = axios__WEBPACK_IMPORTED_MODULE_1__[\"default\"].create({\n baseURL: baseURL\n // headers: {\n // 'Content-Type': 'application/json',\n\n // },\n // withCredentials: true,\n });\n this.client.interceptors.request.use(function (config) {\n var apiKey = _WaygoMaps__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getApiKey();\n var accountId = _WaygoMaps__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getAccountId();\n console.log(\"intercepted request, api key: \".concat(apiKey));\n if (!apiKey) {\n console.error(\"Must include API key using waygomaps.setApiKey('YOUR-API-KEY'):\");\n return Promise.reject(new Error(\"API key is missing\"));\n }\n config.headers['Waygo-API-Key'] = apiKey;\n if (accountId) {\n config.headers['Waygo-Account'] = accountId;\n }\n if (['post', 'put'].includes(config.method)) {\n config.headers['Content-Type'] = 'application/json';\n } else {\n delete config.headers['Content-Type'];\n }\n console.log(\"here are headers:\", config.headers);\n return config;\n });\n }\n return _createClass(ApiManager, [{\n key: \"get\",\n value: function () {\n var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(endpoint) {\n var params,\n response,\n _args = arguments;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n params = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};\n _context.prev = 1;\n _context.next = 4;\n return this.client.get(endpoint, {\n params: params\n });\n case 4:\n response = _context.sent;\n return _context.abrupt(\"return\", response.data);\n case 8:\n _context.prev = 8;\n _context.t0 = _context[\"catch\"](1);\n throw new Error(\"GET \".concat(endpoint, \" failed: \").concat(_context.t0.message));\n case 11:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this, [[1, 8]]);\n }));\n function get(_x) {\n return _get.apply(this, arguments);\n }\n return get;\n }()\n }, {\n key: \"post\",\n value: function () {\n var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(endpoint, data) {\n var response;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.prev = 0;\n _context2.next = 3;\n return this.client.post(endpoint, data);\n case 3:\n response = _context2.sent;\n return _context2.abrupt(\"return\", response.data);\n case 7:\n _context2.prev = 7;\n _context2.t0 = _context2[\"catch\"](0);\n throw new Error(\"POST \".concat(endpoint, \" failed: \").concat(_context2.t0.message));\n case 10:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this, [[0, 7]]);\n }));\n function post(_x2, _x3) {\n return _post.apply(this, arguments);\n }\n return post;\n }()\n }, {\n key: \"put\",\n value: function () {\n var _put = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(endpoint, data) {\n var response;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.prev = 0;\n _context3.next = 3;\n return this.client.put(endpoint, data);\n case 3:\n response = _context3.sent;\n return _context3.abrupt(\"return\", response.data);\n case 7:\n _context3.prev = 7;\n _context3.t0 = _context3[\"catch\"](0);\n throw new Error(\"PUT \".concat(endpoint, \" failed: \").concat(_context3.t0.message));\n case 10:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this, [[0, 7]]);\n }));\n function put(_x4, _x5) {\n return _put.apply(this, arguments);\n }\n return put;\n }()\n }, {\n key: \"delete\",\n value: function () {\n var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(endpoint) {\n var params,\n response,\n _args4 = arguments;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n params = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};\n _context4.prev = 1;\n _context4.next = 4;\n return this.client[\"delete\"](endpoint, {\n params: params\n });\n case 4:\n response = _context4.sent;\n return _context4.abrupt(\"return\", response.data);\n case 8:\n _context4.prev = 8;\n _context4.t0 = _context4[\"catch\"](1);\n throw new Error(\"DELETE \".concat(endpoint, \" failed: \").concat(_context4.t0.message));\n case 11:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this, [[1, 8]]);\n }));\n function _delete(_x6) {\n return _delete2.apply(this, arguments);\n }\n return _delete;\n }()\n }]);\n}();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ApiManager);\n\n//# sourceURL=webpack://waygomaps/./src/api/apiManager.js?");
683
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var _WaygoMaps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../WaygoMaps */ \"./src/WaygoMaps.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n// src/ApiManager.js\n\n\nvar ApiManager = /*#__PURE__*/function () {\n function ApiManager(baseURL) {\n _classCallCheck(this, ApiManager);\n this.client = axios__WEBPACK_IMPORTED_MODULE_1__[\"default\"].create({\n baseURL: baseURL\n // headers: {\n // },\n // withCredentials: true,\n });\n this.client.interceptors.request.use(function (config) {\n var apiKey = _WaygoMaps__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getApiKey();\n var accountId = _WaygoMaps__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getAccountId();\n console.log(\"intercepted request, api key: \".concat(apiKey));\n if (!apiKey) {\n console.error(\"Must include API key using waygomaps.setApiKey('YOUR-API-KEY'):\");\n return Promise.reject(new Error(\"API key is missing\"));\n }\n config.headers['Waygo-API-Key'] = apiKey;\n if (accountId) {\n config.headers['Waygo-Account'] = accountId;\n }\n if (['post', 'put'].includes(config.method)) {\n config.headers['Content-Type'] = 'application/json';\n } else {\n delete config.headers['Content-Type'];\n }\n console.log(\"here are headers:\", config.headers);\n return config;\n });\n }\n return _createClass(ApiManager, [{\n key: \"get\",\n value: function () {\n var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(endpoint) {\n var params,\n response,\n _args = arguments;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n params = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};\n _context.prev = 1;\n _context.next = 4;\n return this.client.get(endpoint, {\n params: params\n });\n case 4:\n response = _context.sent;\n return _context.abrupt(\"return\", response.data);\n case 8:\n _context.prev = 8;\n _context.t0 = _context[\"catch\"](1);\n throw new Error(\"GET \".concat(endpoint, \" failed: \").concat(_context.t0.message));\n case 11:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this, [[1, 8]]);\n }));\n function get(_x) {\n return _get.apply(this, arguments);\n }\n return get;\n }()\n }, {\n key: \"post\",\n value: function () {\n var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(endpoint, data) {\n var response;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.prev = 0;\n _context2.next = 3;\n return this.client.post(endpoint, data);\n case 3:\n response = _context2.sent;\n return _context2.abrupt(\"return\", response.data);\n case 7:\n _context2.prev = 7;\n _context2.t0 = _context2[\"catch\"](0);\n throw new Error(\"POST \".concat(endpoint, \" failed: \").concat(_context2.t0.message));\n case 10:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this, [[0, 7]]);\n }));\n function post(_x2, _x3) {\n return _post.apply(this, arguments);\n }\n return post;\n }()\n }, {\n key: \"put\",\n value: function () {\n var _put = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(endpoint, data) {\n var response;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.prev = 0;\n _context3.next = 3;\n return this.client.put(endpoint, data);\n case 3:\n response = _context3.sent;\n return _context3.abrupt(\"return\", response.data);\n case 7:\n _context3.prev = 7;\n _context3.t0 = _context3[\"catch\"](0);\n throw new Error(\"PUT \".concat(endpoint, \" failed: \").concat(_context3.t0.message));\n case 10:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this, [[0, 7]]);\n }));\n function put(_x4, _x5) {\n return _put.apply(this, arguments);\n }\n return put;\n }()\n }, {\n key: \"delete\",\n value: function () {\n var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(endpoint) {\n var params,\n response,\n _args4 = arguments;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n params = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};\n _context4.prev = 1;\n _context4.next = 4;\n return this.client[\"delete\"](endpoint, {\n params: params\n });\n case 4:\n response = _context4.sent;\n return _context4.abrupt(\"return\", response.data);\n case 8:\n _context4.prev = 8;\n _context4.t0 = _context4[\"catch\"](1);\n throw new Error(\"DELETE \".concat(endpoint, \" failed: \").concat(_context4.t0.message));\n case 11:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this, [[1, 8]]);\n }));\n function _delete(_x6) {\n return _delete2.apply(this, arguments);\n }\n return _delete;\n }()\n }]);\n}();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ApiManager);\n\n//# sourceURL=webpack://waygomaps/./src/api/apiManager.js?");
684
684
 
685
685
  /***/ }),
686
686
 
package/dist/style.css CHANGED
@@ -975,12 +975,14 @@ body {
975
975
  }
976
976
 
977
977
  .copy-popup {
978
- padding: 8px 12px;
979
- background-color: #333;
978
+ padding: 8px 16px;
979
+ background-color: #171717;
980
980
  color: #fff;
981
- border-radius: 4px;
981
+ border-radius: 20px;
982
982
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
983
983
  font-size: 12px;
984
+ font-weight: 400;
985
+ font-family: "Inter", "sans-serif";
984
986
  text-align: center;
985
987
  opacity: 1;
986
988
  transition: opacity 0.5s;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waygo-maps",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "main": "dist/bundle.js",
5
5
  "files": [
6
6
  "dist/bundle.js",