waygo-maps 1.1.103 → 1.1.104
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 +2 -2
- package/dist/style.css +12 -0
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
|
@@ -592,7 +592,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
592
592
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
593
593
|
|
|
594
594
|
"use strict";
|
|
595
|
-
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 _components_DirectionsView_DirectionsView__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/DirectionsView/DirectionsView */ \"./src/components/DirectionsView/DirectionsView.js\");\n/* harmony import */ var _WaygoMaps__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../WaygoMaps */ \"./src/WaygoMaps.js\");\n/* harmony import */ var _components_DirectionsView_StepsView__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/DirectionsView/StepsView */ \"./src/components/DirectionsView/StepsView.js\");\n/* harmony import */ var _components_QRCodeView_QRCodeView__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../components/QRCodeView/QRCodeView */ \"./src/components/QRCodeView/QRCodeView.js\");\n/* harmony import */ var _components_GpsFallbackPopup_GpsFallbackPopup__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../components/GpsFallbackPopup/GpsFallbackPopup */ \"./src/components/GpsFallbackPopup/GpsFallbackPopup.js\");\n/* harmony import */ var _utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/coordinateSystems */ \"./src/utils/coordinateSystems.js\");\n/* harmony import */ var _assets_qrCodeIcon_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../assets/qrCodeIcon.svg */ \"./src/assets/qrCodeIcon.svg\");\n/* harmony import */ var _assets_cancel_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../assets/cancel.svg */ \"./src/assets/cancel.svg\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.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 _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 _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\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\n\n\n\n\n\n\n\n\nvar DirectionsControl = /*#__PURE__*/function (_Control) {\n function DirectionsControl() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, DirectionsControl);\n _this = _callSuper(this, DirectionsControl, [options]);\n _this.directionsView = null;\n _this.stepsView = null;\n _this.map = null;\n _this.searchApi = _WaygoMaps__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getSearchApi();\n _this.startContentPlacement = null;\n _this.endContentPlacement = null;\n _this.fromLocation = false;\n _this.qrCodeView = null;\n _this.qrCodeButton = null;\n _this.pathData = null;\n return _this;\n }\n _inherits(DirectionsControl, _Control);\n return _createClass(DirectionsControl, [{\n key: \"onAdd\",\n value: function onAdd(map) {\n var _this$map$mapData;\n console.log('🔵 DirectionsControl: onAdd called');\n this.map = map;\n this.container = document.createElement('div');\n this.container.className = 'directions-control-container';\n this.directionsView = new _components_DirectionsView_DirectionsView__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n this.stepsView = new _components_DirectionsView_StepsView__WEBPACK_IMPORTED_MODULE_3__[\"default\"]([], {\n floorData: ((_this$map$mapData = this.map.mapData) === null || _this$map$mapData === void 0 ? void 0 : _this$map$mapData.floors) || []\n });\n this.qrCodeView = new _components_QRCodeView_QRCodeView__WEBPACK_IMPORTED_MODULE_4__[\"default\"]();\n this.container.appendChild(this.directionsView.getElement());\n this.initializeEventListeners();\n this.createDirectionsLineLayer();\n this._attachResizeListener();\n this._initialize();\n this.hide();\n return this.container;\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n _superPropGet(DirectionsControl, \"onRemove\", this, 3)([]);\n }\n }, {\n key: \"initializeEventListeners\",\n value: function initializeEventListeners() {\n var _this2 = this;\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('state:setup', this._handleSetupState.bind(this));\n this.map.on('initiate:findPath', this._handleIntiateFindPath.bind(this));\n this.map.on('initiate:findPathFromLocation', this._handleInitiateFindPathFromLocation.bind(this));\n this.map.on('gps:fallback', this._handleGpsFallback.bind(this));\n // this.map.on('initiate:back', this._handleMapInitiateBack.bind(this));\n\n this.directionsView.on('getStartSuggestions', this._handleGettingStartSearchBarSuggestions.bind(this));\n this.directionsView.on('getEndSuggestions', this._handleGettingEndSearchBarSuggestions.bind(this));\n this.directionsView.on('initiate:findPath', function (data) {\n return _this2.map.initiateFindPath(data.startContentPlacementId, data.endContentPlacementId);\n });\n this.directionsView.on('initiate:findPathFromLocation', function (data) {\n return _this2.map.initiateFindPathFromLocation(data.endContentPlacement);\n });\n // this.directionsView.on('initiate:changeLeg', this._handleLegChange.bind(this));\n this.directionsView.on('selectedStartContentPlacement', this._handleStartContentPlacementSelected.bind(this));\n this.directionsView.on('selectedEndContentPlacement', this._handleEndContentPlacementSelected.bind(this));\n this.directionsView.on('selectGpsCurrentLocation', this._handleSelectGpsCurrentLocation.bind(this));\n this.stepsView.on('legSelect', this._handleLegChange.bind(this));\n }\n }, {\n key: \"_handleEndContentPlacementSelected\",\n value: function _handleEndContentPlacementSelected(data) {\n var _this$map$mapData2, _this$map$mapData3;\n var endContentPlacement = data.endContentPlacement;\n this.endContentPlacement = endContentPlacement;\n var referenceCoordinate = ((_this$map$mapData2 = this.map.mapData) === null || _this$map$mapData2 === void 0 ? void 0 : _this$map$mapData2.reference_coordinate) || [0.0, 0.0];\n var scaleFactor = ((_this$map$mapData3 = this.map.mapData) === null || _this$map$mapData3 === void 0 ? void 0 : _this$map$mapData3.coordinate_scaling_multiplier) || 30.0;\n var _convertVertexToCoord = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_6__.convertVertexToCoordinate)(endContentPlacement.location, referenceCoordinate, scaleFactor),\n lat = _convertVertexToCoord.lat,\n lon = _convertVertexToCoord.lon;\n var coordinate = [lon, lat];\n if (!endContentPlacement.name) {\n if (endContentPlacement.catalog && endContentPlacement.content) {\n var titleKey = endContentPlacement.catalog.content_title_key;\n if (titleKey) {\n // const titleKey = endContentPlacement.content.title_key;\n var title = endContentPlacement.content.data[titleKey];\n endContentPlacement.name = title;\n }\n }\n }\n endContentPlacement._floor = endContentPlacement.floor;\n this.map.addSelectedFeature(coordinate, endContentPlacement);\n }\n }, {\n key: \"_handleStartContentPlacementSelected\",\n value: function _handleStartContentPlacementSelected(data) {\n var _this$map$mapData4, _this$map$mapData5;\n var startContentPlacement = data.startContentPlacement;\n this.startContentPlacement = startContentPlacement;\n var referenceCoordinate = ((_this$map$mapData4 = this.map.mapData) === null || _this$map$mapData4 === void 0 ? void 0 : _this$map$mapData4.reference_coordinate) || [0.0, 0.0];\n var scaleFactor = ((_this$map$mapData5 = this.map.mapData) === null || _this$map$mapData5 === void 0 ? void 0 : _this$map$mapData5.coordinate_scaling_multiplier) || 30.0;\n var _convertVertexToCoord2 = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_6__.convertVertexToCoordinate)(startContentPlacement.location, referenceCoordinate, scaleFactor),\n lat = _convertVertexToCoord2.lat,\n lon = _convertVertexToCoord2.lon;\n var coordinate = [lon, lat];\n if (!startContentPlacement.name) {\n if (startContentPlacement.catalog && startContentPlacement.content) {\n var titleKey = startContentPlacement.catalog.content_title_key;\n if (titleKey) {\n // const titleKey = startContentPlacement.content.title_key;\n var title = startContentPlacement.content.data[titleKey];\n startContentPlacement.name = title;\n }\n }\n }\n startContentPlacement._floor = startContentPlacement.floor;\n this.map.clearHighlightedContentLayer();\n this.map.addHighlightedFeature(coordinate, startContentPlacement);\n }\n }, {\n key: \"_handleLegChange\",\n value: function _handleLegChange(data) {\n var index = data.index;\n if (!this.directionsView || !this.pathData) {\n return;\n }\n this.updateMapForPathLeg(this.pathData.legs[index]);\n }\n }, {\n key: \"_handleGettingStartSearchBarSuggestions\",\n value: function () {\n var _handleGettingStartSearchBarSuggestions2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {\n var query, currentSearch, skip, limit, results;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (this.directionsView) {\n _context.next = 2;\n break;\n }\n return _context.abrupt(\"return\");\n case 2:\n query = data.query;\n currentSearch = ++this.directionsView.startSearchBox.searchCount;\n if (!(query === '')) {\n _context.next = 7;\n break;\n }\n this.directionsView.startSearchBox.searchBarSuggestionsView.updateResults([]);\n return _context.abrupt(\"return\");\n case 7:\n if (this.map.mapData) {\n _context.next = 9;\n break;\n }\n return _context.abrupt(\"return\");\n case 9:\n skip = 0;\n limit = 5;\n _context.prev = 11;\n _context.next = 14;\n return this.searchApi.search(this.map.mapData.map_id, this.map.mapData.map_view_id, query, skip, limit);\n case 14:\n results = _context.sent;\n if (currentSearch === this.directionsView.startSearchBox.searchCount) {\n this.directionsView.startSearchBox.searchBarSuggestionsView.updateResults(results);\n }\n _context.next = 21;\n break;\n case 18:\n _context.prev = 18;\n _context.t0 = _context[\"catch\"](11);\n if (axios__WEBPACK_IMPORTED_MODULE_9__[\"default\"].isCancel(_context.t0)) {\n console.error('Request canceled:', _context.t0.message);\n } else {\n console.error('Search error:', _context.t0);\n }\n case 21:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this, [[11, 18]]);\n }));\n function _handleGettingStartSearchBarSuggestions(_x) {\n return _handleGettingStartSearchBarSuggestions2.apply(this, arguments);\n }\n return _handleGettingStartSearchBarSuggestions;\n }()\n }, {\n key: \"_handleGettingEndSearchBarSuggestions\",\n value: function () {\n var _handleGettingEndSearchBarSuggestions2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data) {\n var query, currentSearch, skip, limit, results;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n if (this.directionsView) {\n _context2.next = 2;\n break;\n }\n return _context2.abrupt(\"return\");\n case 2:\n query = data.query;\n currentSearch = ++this.directionsView.endSearchBox.searchCount;\n if (!(query === '')) {\n _context2.next = 7;\n break;\n }\n this.directionsView.endSearchBox.searchBarSuggestionsView.updateResults([]);\n return _context2.abrupt(\"return\");\n case 7:\n if (this.map.mapData) {\n _context2.next = 9;\n break;\n }\n return _context2.abrupt(\"return\");\n case 9:\n skip = 0;\n limit = 5;\n _context2.prev = 11;\n _context2.next = 14;\n return this.searchApi.search(this.map.mapData.map_id, this.map.mapData.map_view_id, query, skip, limit);\n case 14:\n results = _context2.sent;\n if (currentSearch === this.directionsView.endSearchBox.searchCount) {\n this.directionsView.endSearchBox.searchBarSuggestionsView.updateResults(results);\n }\n _context2.next = 21;\n break;\n case 18:\n _context2.prev = 18;\n _context2.t0 = _context2[\"catch\"](11);\n if (axios__WEBPACK_IMPORTED_MODULE_9__[\"default\"].isCancel(_context2.t0)) {\n console.error('Request canceled:', _context2.t0.message);\n } else {\n console.error('Search error:', _context2.t0);\n }\n case 21:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this, [[11, 18]]);\n }));\n function _handleGettingEndSearchBarSuggestions(_x2) {\n return _handleGettingEndSearchBarSuggestions2.apply(this, arguments);\n }\n return _handleGettingEndSearchBarSuggestions;\n }()\n }, {\n key: \"_renderDesktopView\",\n value: function _renderDesktopView() {\n console.log('🔵 DirectionsControl: _renderDesktopView called');\n if (!this.directionsView) {\n console.warn('⚠️ DirectionsControl: directionsView is null');\n return;\n }\n this.container.innerHTML = \"\";\n var element = this.directionsView.getElement();\n this.container.appendChild(element);\n this.container.classList.remove('mobile-view');\n this.container.classList.add('desktop-view');\n\n // Add QR code button if in kiosk mode and path exists\n if (this._shouldShowQRCodeButton()) {\n if (!this.qrCodeButton || !this.qrCodeButton.parentNode) {\n this._createQRCodeButton();\n }\n this.container.appendChild(this.qrCodeButton);\n } else if (this.qrCodeButton && this.qrCodeButton.parentNode) {\n this.qrCodeButton.parentNode.removeChild(this.qrCodeButton);\n }\n this.container.appendChild(this.stepsView.getElement());\n }\n }, {\n key: \"_renderMobileView\",\n value: function _renderMobileView() {\n console.log('🔵 DirectionsControl: _renderMobileView called');\n if (!this.directionsView) {\n console.warn('⚠️ DirectionsControl: directionsView is null');\n return;\n }\n this.container.innerHTML = \"\";\n var element = this.directionsView.getElement();\n this.container.appendChild(element);\n this.container.classList.remove('desktop-view');\n this.container.classList.add('mobile-view');\n\n // Add QR code button if in kiosk mode and path exists\n if (this._shouldShowQRCodeButton()) {\n if (!this.qrCodeButton || !this.qrCodeButton.parentNode) {\n this._createQRCodeButton();\n }\n this.container.appendChild(this.qrCodeButton);\n } else if (this.qrCodeButton && this.qrCodeButton.parentNode) {\n this.qrCodeButton.parentNode.removeChild(this.qrCodeButton);\n }\n this.container.appendChild(this.stepsView.getElement());\n }\n }, {\n key: \"createDirectionsLineLayer\",\n value: function createDirectionsLineLayer() {\n this.map.map.addSource('directionsLineSource', {\n 'type': 'geojson',\n 'data': {\n 'type': 'Feature',\n 'properties': {},\n 'geometry': {\n 'type': 'LineString',\n 'coordinates': []\n }\n }\n });\n\n // Add a new layer for the line\n this.map.map.addLayer({\n 'id': 'directionsLineLayer',\n 'type': 'line',\n 'source': 'directionsLineSource',\n 'layout': {\n 'line-join': 'round',\n 'line-cap': 'round'\n },\n 'paint': {\n 'line-color': '#333333',\n 'line-width': 8\n // 'line-blur': 0.9\n }\n });\n\n // this.map.map.moveLayer('directionsLineLayer', 'off-limits');\n // this.map.map.moveLayer('directionsLineLayer', '0-tertiary-area');\n this.map.map.moveLayer('directionsLineLayer', 'FIRST_ELEVATED_FEATURE');\n }\n }, {\n key: \"updateMapForPathLeg\",\n value: function updateMapForPathLeg(leg) {\n var _this$map$mapData6, _this$map$mapData7;\n this.clearLineData();\n var points = [];\n leg.steps.forEach(function (step, index) {\n points.push.apply(points, _toConsumableArray(index === 0 ? step.path : step.path.slice(1)));\n });\n var referenceCoordinate = ((_this$map$mapData6 = this.map.mapData) === null || _this$map$mapData6 === void 0 ? void 0 : _this$map$mapData6.reference_coordinate) || [0.0, 0.0];\n var scaleFactor = ((_this$map$mapData7 = this.map.mapData) === null || _this$map$mapData7 === void 0 ? void 0 : _this$map$mapData7.coordinate_scaling_multiplier) || 30.0;\n var coordinates = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_6__.convertVerticesToCoordinates)(points, referenceCoordinate, scaleFactor);\n this._updateMapLineData(coordinates, leg.floor);\n var currentFloor = this.map.getCurrentFloor();\n if (currentFloor !== leg.floor) {\n this.map.updateFloor(leg.floor, false);\n }\n }\n }, {\n key: \"_updateMapLineData\",\n value: function _updateMapLineData(newCoordinates, floor) {\n this.map.map.getSource('directionsLineSource').setData({\n 'type': 'Feature',\n 'properties': {\n '_floor': floor\n },\n 'geometry': {\n 'type': 'LineString',\n 'coordinates': newCoordinates\n }\n });\n var bounds = new mapboxgl.LngLatBounds();\n newCoordinates.forEach(function (coordinate) {\n bounds.extend(coordinate);\n });\n if (this.currentViewType === 'desktop') {\n this.map.map.fitBounds(bounds, _defineProperty(_defineProperty(_defineProperty({\n padding: 200\n }, \"padding\", {\n top: 200,\n bottom: 200,\n left: 500,\n right: 150\n }), \"maxZoom\", 18), \"duration\", 1000));\n } else {\n this.map.map.fitBounds(bounds, {\n // padding: 200, // Add padding around the edges of the map\n padding: {\n top: 350,\n bottom: 60,\n left: 80,\n right: 100\n },\n maxZoom: 18,\n // Optional: Limit the maximum zoom level\n duration: 1000 // Optional: Animation duration in milliseconds\n });\n }\n }\n }, {\n key: \"clearLineData\",\n value: function clearLineData() {\n this.map.map.getSource('directionsLineSource').setData({\n 'type': 'Feature',\n 'properties': {},\n 'geometry': {\n 'type': 'LineString',\n 'coordinates': []\n }\n });\n }\n }, {\n key: \"_handleDefaultState\",\n value: function _handleDefaultState() {\n this.hide();\n // this.clearLineData();\n this.clearData();\n }\n }, {\n key: \"_handleSearchState\",\n value: function _handleSearchState(data) {\n var query = data.query,\n results = data.results;\n this.hide();\n // this.clearLineData();\n this.clearData();\n }\n }, {\n key: \"_handleSelectedContentState\",\n value: function _handleSelectedContentState(data) {\n var contentPlacementIds = data.contentPlacementIds,\n selectedContentPlacement = data.selectedContentPlacement;\n this.hide();\n this.directionsView.updateView(null, null);\n // this.clearLineData();\n this.clearData();\n // this.map.clearSelectedContentLayer();\n this.map.clearHighlightedContentLayer();\n }\n }, {\n key: \"_handleSetupState\",\n value: function _handleSetupState() {\n this.hide();\n }\n }, {\n key: \"clearData\",\n value: function clearData() {\n this.pathData = null;\n this.clearLineData();\n this.stepsView.clear();\n if (this.qrCodeButton && this.qrCodeButton.parentNode) {\n this.qrCodeButton.parentNode.removeChild(this.qrCodeButton);\n }\n }\n }, {\n key: \"_handleDirectionsState\",\n value: function () {\n var _handleDirectionsState2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(data) {\n var _this3 = this,\n _this$map$mapData8,\n _this$map$mapData9;\n var startContentPlacement, endContentPlacement, startNodeId, showGpsCell, referenceCoordinate, scaleFactor, _convertVertexToCoord3, lat, lon, coordinate, titleKey, title, _convertVertexToCoord4, _lat, _lon, _coordinate, _titleKey, _title, nodeIdToUse, firstLocation, _convertVertexToCoord5, _lat2, _lon2, _coordinate2;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n console.log('🔵 DirectionsControl: _handleDirectionsState called', data);\n startContentPlacement = data.startContentPlacement, endContentPlacement = data.endContentPlacement, startNodeId = data.startNodeId;\n this.clearData();\n\n // Re-render the view to ensure all elements are in the DOM\n console.log('🔵 DirectionsControl: Current view type:', this.currentViewType);\n if (this.currentViewType === 'desktop') {\n this._renderDesktopView();\n } else {\n this._renderMobileView();\n }\n this.show();\n this.startContentPlacement = startContentPlacement;\n this.endContentPlacement = endContentPlacement;\n this.directionsView.updateView(startContentPlacement, endContentPlacement);\n\n // GPS \"Use current location\" cell handling\n showGpsCell = this.map.shouldShowGpsCell && this.map.shouldShowGpsCell() && !startContentPlacement && !startNodeId && endContentPlacement;\n if (showGpsCell) {\n this.directionsView.enableGpsStartCell();\n setTimeout(function () {\n return _this3.directionsView.focusStartInput();\n }, 50);\n } else {\n this.directionsView.disableGpsStartCell();\n }\n referenceCoordinate = ((_this$map$mapData8 = this.map.mapData) === null || _this$map$mapData8 === void 0 ? void 0 : _this$map$mapData8.reference_coordinate) || [0.0, 0.0];\n scaleFactor = ((_this$map$mapData9 = this.map.mapData) === null || _this$map$mapData9 === void 0 ? void 0 : _this$map$mapData9.coordinate_scaling_multiplier) || 30.0;\n if (startContentPlacement) {\n _convertVertexToCoord3 = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_6__.convertVertexToCoordinate)(startContentPlacement.location, referenceCoordinate, scaleFactor), lat = _convertVertexToCoord3.lat, lon = _convertVertexToCoord3.lon;\n coordinate = [lon, lat];\n if (!startContentPlacement.name) {\n if (startContentPlacement.catalog && startContentPlacement.content) {\n titleKey = startContentPlacement.catalog.content_title_key;\n if (titleKey) {\n title = startContentPlacement.content.data[titleKey];\n startContentPlacement.name = title;\n }\n }\n }\n startContentPlacement._floor = startContentPlacement.floor;\n this.map.clearHighlightedContentLayer();\n this.map.addHighlightedFeature(coordinate, startContentPlacement);\n }\n if (!endContentPlacement) {\n _context3.next = 32;\n break;\n }\n _convertVertexToCoord4 = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_6__.convertVertexToCoordinate)(endContentPlacement.location, referenceCoordinate, scaleFactor), _lat = _convertVertexToCoord4.lat, _lon = _convertVertexToCoord4.lon;\n _coordinate = [_lon, _lat];\n if (!endContentPlacement.name) {\n if (endContentPlacement.catalog && endContentPlacement.content) {\n _titleKey = endContentPlacement.catalog.content_title_key;\n if (_titleKey) {\n _title = endContentPlacement.content.data[_titleKey];\n endContentPlacement.name = _title;\n }\n }\n }\n endContentPlacement._floor = endContentPlacement.floor;\n this.map.addSelectedFeature(_coordinate, endContentPlacement);\n\n // Determine which node ID to use: prioritize startNodeId if provided\n nodeIdToUse = null;\n if (startNodeId != null && startNodeId !== '') {\n // Explicitly provided node ID takes priority\n nodeIdToUse = startNodeId;\n console.log('�� DirectionsControl: Using provided startNodeId:', startNodeId);\n } else if (this.map.location && !startContentPlacement) {\n // Fall back to map.location if no startContentPlacement\n nodeIdToUse = this.map.location;\n console.log('�� DirectionsControl: Using map.location:', this.map.location);\n }\n if (!nodeIdToUse) {\n _context3.next = 31;\n break;\n }\n console.log('�� DirectionsControl: Finding path from node to end placement, nodeId:', nodeIdToUse);\n // Find path from node to the end placement\n _context3.next = 26;\n return this.map.findPathFromNodeToPlacement(nodeIdToUse, endContentPlacement.placement_id);\n case 26:\n this.pathData = _context3.sent;\n console.log('�� DirectionsControl: Path data received:', !!this.pathData);\n if (this.pathData) {\n this.fromLocation = true;\n this.directionsView.setNewPath(this.pathData, true);\n firstLocation = this.pathData.legs[0].steps[0].path[0];\n _convertVertexToCoord5 = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_6__.convertVertexToCoordinate)(firstLocation, referenceCoordinate, scaleFactor), _lat2 = _convertVertexToCoord5.lat, _lon2 = _convertVertexToCoord5.lon;\n _coordinate2 = [_lon2, _lat2];\n this.map.addHighlightedFeature(_coordinate2, {\n '_floor': this.pathData.legs[0].floor,\n 'name': 'Start'\n });\n if (this.currentViewType === 'mobile') {\n this.stepsView.setNewPath(this.pathData, false, this.map.mapData.floors);\n } else {\n this.stepsView.setNewPath(this.pathData, true, this.map.mapData.floors);\n }\n this.updateMapForPathLeg(this.pathData.legs[0]);\n\n // Re-render to show QR code button if applicable\n if (this.currentViewType === 'desktop') {\n this._renderDesktopView();\n } else {\n this._renderMobileView();\n }\n } else {\n console.warn('⚠️ DirectionsControl: No path data returned');\n }\n _context3.next = 32;\n break;\n case 31:\n console.log('🔵 DirectionsControl: Not finding path from node. startNodeId?', startNodeId, 'map.location?', !!this.map.location, 'startContentPlacement?', !!startContentPlacement);\n case 32:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function _handleDirectionsState(_x3) {\n return _handleDirectionsState2.apply(this, arguments);\n }\n return _handleDirectionsState;\n }()\n }, {\n key: \"_handleInitiateFindPathFromLocation\",\n value: function () {\n var _handleInitiateFindPathFromLocation2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(data) {\n var endContentPlacement;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n console.log('�� DirectionsControl: _handleInitiateFindPathFromLocation called', data);\n endContentPlacement = data.endContentPlacement;\n if (!(this.map.location && endContentPlacement)) {\n _context4.next = 7;\n break;\n }\n _context4.next = 5;\n return this.map.findPathFromNodeToPlacement(this.map.location, endContentPlacement.placement_id);\n case 5:\n this.pathData = _context4.sent;\n if (this.pathData) {\n this.fromLocation = true;\n this.directionsView.setNewPath(this.pathData, true);\n if (this.currentViewType === 'mobile') {\n this.stepsView.setNewPath(this.pathData, false, this.map.mapData.floors);\n } else {\n this.stepsView.setNewPath(this.pathData, true, this.map.mapData.floors);\n }\n this.updateMapForPathLeg(this.pathData.legs[0]);\n\n // Re-render to show QR code button if applicable\n if (this.currentViewType === 'desktop') {\n this._renderDesktopView();\n } else {\n this._renderMobileView();\n }\n }\n case 7:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function _handleInitiateFindPathFromLocation(_x4) {\n return _handleInitiateFindPathFromLocation2.apply(this, arguments);\n }\n return _handleInitiateFindPathFromLocation;\n }() // async _handleInitiateFindNodeToPlacementPath(data) {\n // const { startNodeId, endContentPlacementId } = data;\n // this.pathData = await this.map.findPathNodeToPlacement(startNodeId, endContentPlacementId);\n // }\n }, {\n key: \"_handleIntiateFindPath\",\n value: function () {\n var _handleIntiateFindPath2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(data) {\n var startContentPlacementId, endContentPlacementId;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n console.log('🔵 DirectionsControl: _handleIntiateFindPath called', data);\n startContentPlacementId = data.startContentPlacementId, endContentPlacementId = data.endContentPlacementId;\n _context5.next = 4;\n return this.map.findPath(startContentPlacementId, endContentPlacementId);\n case 4:\n this.pathData = _context5.sent;\n this.fromLocation = false;\n this.directionsView.setNewPath(this.pathData);\n if (this.currentViewType === 'mobile') {\n this.stepsView.setNewPath(this.pathData, false, this.map.mapData.floors);\n } else {\n this.stepsView.setNewPath(this.pathData, true, this.map.mapData.floors);\n }\n this.updateMapForPathLeg(this.pathData.legs[0]);\n\n // Re-render to show QR code button if applicable\n if (this.currentViewType === 'desktop') {\n this._renderDesktopView();\n } else {\n this._renderMobileView();\n }\n case 10:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function _handleIntiateFindPath(_x5) {\n return _handleIntiateFindPath2.apply(this, arguments);\n }\n return _handleIntiateFindPath;\n }()\n }, {\n key: \"_handleSelectDirectionsButton\",\n value: function _handleSelectDirectionsButton(data) {\n var placementId = data.placementId;\n }\n }, {\n key: \"_handleSelectGpsCurrentLocation\",\n value: function () {\n var _handleSelectGpsCurrentLocation2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {\n return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n if (this.endContentPlacement) {\n _context6.next = 3;\n break;\n }\n console.warn('⚠️ DirectionsControl: GPS cell selected but no end placement set');\n return _context6.abrupt(\"return\");\n case 3:\n _context6.next = 5;\n return this.map.useCurrentLocation(this.endContentPlacement.placement_id);\n case 5:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6, this);\n }));\n function _handleSelectGpsCurrentLocation() {\n return _handleSelectGpsCurrentLocation2.apply(this, arguments);\n }\n return _handleSelectGpsCurrentLocation;\n }()\n }, {\n key: \"_handleGpsFallback\",\n value: function _handleGpsFallback(data) {\n var _this4 = this;\n var reason = data.reason;\n if (!this.gpsFallbackPopup) {\n this.gpsFallbackPopup = new _components_GpsFallbackPopup_GpsFallbackPopup__WEBPACK_IMPORTED_MODULE_5__[\"default\"]();\n }\n this.gpsFallbackPopup.show(this.map, reason, function () {\n if (_this4.map.shouldShowGpsCell && _this4.map.shouldShowGpsCell()) {\n setTimeout(function () {\n return _this4.directionsView.focusStartInput();\n }, 50);\n } else {\n _this4.directionsView.disableGpsStartCell();\n }\n });\n }\n }, {\n key: \"_render\",\n value: function _render() {\n return;\n }\n }, {\n key: \"_shouldShowQRCodeButton\",\n value: function _shouldShowQRCodeButton() {\n // Only show in kiosk mode (not setup state)\n if (!this.map.location) {\n return false;\n }\n\n // Check if feature is enabled\n if (this.map.options.showQRCodeInKioskMode === false) {\n return false;\n }\n\n // Only show when path data exists\n if (!this.pathData) {\n return false;\n }\n\n // Only show when we have end placement\n if (!this.endContentPlacement) {\n return false;\n }\n return true;\n }\n }, {\n key: \"_createQRCodeButton\",\n value: function _createQRCodeButton() {\n this.qrCodeButton = document.createElement('button');\n this.qrCodeButton.className = 'qr-code-button';\n var iconContainer = document.createElement('div');\n iconContainer.className = 'qr-code-button-icon';\n var icon = document.createElement('img');\n icon.src = _assets_qrCodeIcon_svg__WEBPACK_IMPORTED_MODULE_7__[\"default\"];\n icon.alt = 'QR Code';\n iconContainer.appendChild(icon);\n var textContainer = document.createElement('div');\n textContainer.className = 'qr-code-button-text';\n textContainer.textContent = 'Continue on your phone ->';\n this.qrCodeButton.appendChild(iconContainer);\n this.qrCodeButton.appendChild(textContainer);\n this.qrCodeButton.addEventListener('click', this._showQRCodeModal.bind(this));\n }\n }, {\n key: \"_generateQRCodeURL\",\n value: function _generateQRCodeURL() {\n if (!this.map.mapData || !this.endContentPlacement) {\n return null;\n }\n var mapId = this.map.mapData.map_id;\n var mapViewId = this.map.mapData.map_view_id;\n var endPlacementId = this.endContentPlacement.placement_id;\n var startPlacementId;\n if (this.fromLocation) {\n // Use the node ID when path starts from kiosk location\n startPlacementId = this.map.location;\n } else if (this.startContentPlacement) {\n // Use the placement ID when path starts from a content placement\n startPlacementId = this.startContentPlacement.placement_id;\n } else {\n return null;\n }\n var url = \"https://maps.waygomaps.com/\".concat(mapId, \"/\").concat(mapViewId, \"/directions/\").concat(startPlacementId, \"/\").concat(endPlacementId);\n return url;\n }\n }, {\n key: \"_showQRCodeModal\",\n value: function () {\n var _showQRCodeModal2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {\n var _this5 = this,\n _this$map$modalContai;\n var url, modalContent, closeButton, closeIcon, modalContentWrapper;\n return _regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n url = this._generateQRCodeURL();\n if (url) {\n _context7.next = 4;\n break;\n }\n console.warn('⚠️ DirectionsControl: No URL generated for QR code');\n return _context7.abrupt(\"return\");\n case 4:\n // Create modal content wrapper\n modalContent = document.createElement('div');\n modalContent.className = 'qr-code-modal-card';\n\n // Create close button\n closeButton = document.createElement('button');\n closeButton.className = 'qr-code-modal-close';\n closeIcon = document.createElement('img');\n closeIcon.src = _assets_cancel_svg__WEBPACK_IMPORTED_MODULE_8__[\"default\"];\n closeIcon.alt = 'Close';\n closeButton.appendChild(closeIcon);\n closeButton.addEventListener('click', function () {\n _this5.map.hideModal();\n });\n modalContent.appendChild(closeButton);\n\n // Update and add QR code view\n _context7.next = 16;\n return this.qrCodeView.updateQRCode(url, 250);\n case 16:\n modalContent.appendChild(this.qrCodeView.getElement());\n\n // Show modal and adjust modal content styling for QR code\n this.map.showModal(modalContent);\n\n // Adjust modal content wrapper styling for QR code card\n modalContentWrapper = (_this$map$modalContai = this.map.modalContainer) === null || _this$map$modalContai === void 0 ? void 0 : _this$map$modalContai.querySelector('.waygo-map-modal-content');\n if (modalContentWrapper) {\n modalContentWrapper.style.backgroundColor = 'transparent';\n modalContentWrapper.style.width = 'auto';\n modalContentWrapper.style.height = 'auto';\n modalContentWrapper.style.maxWidth = 'none';\n modalContentWrapper.style.maxHeight = 'none';\n }\n case 20:\n case \"end\":\n return _context7.stop();\n }\n }, _callee7, this);\n }));\n function _showQRCodeModal() {\n return _showQRCodeModal2.apply(this, arguments);\n }\n return _showQRCodeModal;\n }()\n }]);\n}(_core_Control__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DirectionsControl);\n\n//# sourceURL=webpack://waygomaps/./src/Controls/DirectionsControl.js?");
|
|
595
|
+
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 _components_DirectionsView_DirectionsView__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/DirectionsView/DirectionsView */ \"./src/components/DirectionsView/DirectionsView.js\");\n/* harmony import */ var _WaygoMaps__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../WaygoMaps */ \"./src/WaygoMaps.js\");\n/* harmony import */ var _components_DirectionsView_StepsView__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/DirectionsView/StepsView */ \"./src/components/DirectionsView/StepsView.js\");\n/* harmony import */ var _components_QRCodeView_QRCodeView__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../components/QRCodeView/QRCodeView */ \"./src/components/QRCodeView/QRCodeView.js\");\n/* harmony import */ var _components_GpsFallbackPopup_GpsFallbackPopup__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../components/GpsFallbackPopup/GpsFallbackPopup */ \"./src/components/GpsFallbackPopup/GpsFallbackPopup.js\");\n/* harmony import */ var _utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/coordinateSystems */ \"./src/utils/coordinateSystems.js\");\n/* harmony import */ var _assets_qrCodeIcon_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../assets/qrCodeIcon.svg */ \"./src/assets/qrCodeIcon.svg\");\n/* harmony import */ var _assets_cancel_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../assets/cancel.svg */ \"./src/assets/cancel.svg\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.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 _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 _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\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\n\n\n\n\n\n\n\n\nvar DirectionsControl = /*#__PURE__*/function (_Control) {\n function DirectionsControl() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, DirectionsControl);\n _this = _callSuper(this, DirectionsControl, [options]);\n _this.directionsView = null;\n _this.stepsView = null;\n _this.map = null;\n _this.searchApi = _WaygoMaps__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getSearchApi();\n _this.startContentPlacement = null;\n _this.endContentPlacement = null;\n _this.fromLocation = false;\n _this.qrCodeView = null;\n _this.qrCodeButton = null;\n _this.pathData = null;\n return _this;\n }\n _inherits(DirectionsControl, _Control);\n return _createClass(DirectionsControl, [{\n key: \"onAdd\",\n value: function onAdd(map) {\n var _this$map$mapData;\n this.map = map;\n this.container = document.createElement('div');\n this.container.className = 'directions-control-container';\n this.directionsView = new _components_DirectionsView_DirectionsView__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n this.stepsView = new _components_DirectionsView_StepsView__WEBPACK_IMPORTED_MODULE_3__[\"default\"]([], {\n floorData: ((_this$map$mapData = this.map.mapData) === null || _this$map$mapData === void 0 ? void 0 : _this$map$mapData.floors) || []\n });\n this.qrCodeView = new _components_QRCodeView_QRCodeView__WEBPACK_IMPORTED_MODULE_4__[\"default\"]();\n this.container.appendChild(this.directionsView.getElement());\n this.initializeEventListeners();\n this.createDirectionsLineLayer();\n this._attachResizeListener();\n this._initialize();\n this.hide();\n return this.container;\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n _superPropGet(DirectionsControl, \"onRemove\", this, 3)([]);\n }\n }, {\n key: \"initializeEventListeners\",\n value: function initializeEventListeners() {\n var _this2 = this;\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('state:setup', this._handleSetupState.bind(this));\n this.map.on('initiate:findPath', this._handleIntiateFindPath.bind(this));\n this.map.on('initiate:findPathFromLocation', this._handleInitiateFindPathFromLocation.bind(this));\n this.map.on('gps:fallback', this._handleGpsFallback.bind(this));\n // this.map.on('initiate:back', this._handleMapInitiateBack.bind(this));\n\n this.directionsView.on('getStartSuggestions', this._handleGettingStartSearchBarSuggestions.bind(this));\n this.directionsView.on('getEndSuggestions', this._handleGettingEndSearchBarSuggestions.bind(this));\n this.directionsView.on('initiate:findPath', function (data) {\n return _this2.map.initiateFindPath(data.startContentPlacementId, data.endContentPlacementId);\n });\n this.directionsView.on('initiate:findPathFromLocation', function (data) {\n return _this2.map.initiateFindPathFromLocation(data.endContentPlacement);\n });\n // this.directionsView.on('initiate:changeLeg', this._handleLegChange.bind(this));\n this.directionsView.on('selectedStartContentPlacement', this._handleStartContentPlacementSelected.bind(this));\n this.directionsView.on('selectedEndContentPlacement', this._handleEndContentPlacementSelected.bind(this));\n this.directionsView.on('selectGpsCurrentLocation', this._handleSelectGpsCurrentLocation.bind(this));\n this.stepsView.on('legSelect', this._handleLegChange.bind(this));\n }\n }, {\n key: \"_handleEndContentPlacementSelected\",\n value: function _handleEndContentPlacementSelected(data) {\n var _this$map$mapData2, _this$map$mapData3;\n var endContentPlacement = data.endContentPlacement;\n this.endContentPlacement = endContentPlacement;\n var referenceCoordinate = ((_this$map$mapData2 = this.map.mapData) === null || _this$map$mapData2 === void 0 ? void 0 : _this$map$mapData2.reference_coordinate) || [0.0, 0.0];\n var scaleFactor = ((_this$map$mapData3 = this.map.mapData) === null || _this$map$mapData3 === void 0 ? void 0 : _this$map$mapData3.coordinate_scaling_multiplier) || 30.0;\n var _convertVertexToCoord = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_6__.convertVertexToCoordinate)(endContentPlacement.location, referenceCoordinate, scaleFactor),\n lat = _convertVertexToCoord.lat,\n lon = _convertVertexToCoord.lon;\n var coordinate = [lon, lat];\n if (!endContentPlacement.name) {\n if (endContentPlacement.catalog && endContentPlacement.content) {\n var titleKey = endContentPlacement.catalog.content_title_key;\n if (titleKey) {\n // const titleKey = endContentPlacement.content.title_key;\n var title = endContentPlacement.content.data[titleKey];\n endContentPlacement.name = title;\n }\n }\n }\n endContentPlacement._floor = endContentPlacement.floor;\n this.map.addSelectedFeature(coordinate, endContentPlacement);\n }\n }, {\n key: \"_handleStartContentPlacementSelected\",\n value: function _handleStartContentPlacementSelected(data) {\n var _this$map$mapData4, _this$map$mapData5;\n var startContentPlacement = data.startContentPlacement;\n this.startContentPlacement = startContentPlacement;\n var referenceCoordinate = ((_this$map$mapData4 = this.map.mapData) === null || _this$map$mapData4 === void 0 ? void 0 : _this$map$mapData4.reference_coordinate) || [0.0, 0.0];\n var scaleFactor = ((_this$map$mapData5 = this.map.mapData) === null || _this$map$mapData5 === void 0 ? void 0 : _this$map$mapData5.coordinate_scaling_multiplier) || 30.0;\n var _convertVertexToCoord2 = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_6__.convertVertexToCoordinate)(startContentPlacement.location, referenceCoordinate, scaleFactor),\n lat = _convertVertexToCoord2.lat,\n lon = _convertVertexToCoord2.lon;\n var coordinate = [lon, lat];\n if (!startContentPlacement.name) {\n if (startContentPlacement.catalog && startContentPlacement.content) {\n var titleKey = startContentPlacement.catalog.content_title_key;\n if (titleKey) {\n // const titleKey = startContentPlacement.content.title_key;\n var title = startContentPlacement.content.data[titleKey];\n startContentPlacement.name = title;\n }\n }\n }\n startContentPlacement._floor = startContentPlacement.floor;\n this.map.clearHighlightedContentLayer();\n this.map.addHighlightedFeature(coordinate, startContentPlacement);\n }\n }, {\n key: \"_handleLegChange\",\n value: function _handleLegChange(data) {\n var index = data.index;\n if (!this.directionsView || !this.pathData) {\n return;\n }\n this.updateMapForPathLeg(this.pathData.legs[index]);\n }\n }, {\n key: \"_handleGettingStartSearchBarSuggestions\",\n value: function () {\n var _handleGettingStartSearchBarSuggestions2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {\n var query, currentSearch, skip, limit, results;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (this.directionsView) {\n _context.next = 2;\n break;\n }\n return _context.abrupt(\"return\");\n case 2:\n query = data.query;\n currentSearch = ++this.directionsView.startSearchBox.searchCount;\n if (!(query === '')) {\n _context.next = 7;\n break;\n }\n this.directionsView.startSearchBox.searchBarSuggestionsView.updateResults([]);\n return _context.abrupt(\"return\");\n case 7:\n if (this.map.mapData) {\n _context.next = 9;\n break;\n }\n return _context.abrupt(\"return\");\n case 9:\n skip = 0;\n limit = 5;\n _context.prev = 11;\n _context.next = 14;\n return this.searchApi.search(this.map.mapData.map_id, this.map.mapData.map_view_id, query, skip, limit);\n case 14:\n results = _context.sent;\n if (currentSearch === this.directionsView.startSearchBox.searchCount) {\n this.directionsView.startSearchBox.searchBarSuggestionsView.updateResults(results);\n }\n _context.next = 21;\n break;\n case 18:\n _context.prev = 18;\n _context.t0 = _context[\"catch\"](11);\n if (axios__WEBPACK_IMPORTED_MODULE_9__[\"default\"].isCancel(_context.t0)) {\n console.error('Request canceled:', _context.t0.message);\n } else {\n console.error('Search error:', _context.t0);\n }\n case 21:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this, [[11, 18]]);\n }));\n function _handleGettingStartSearchBarSuggestions(_x) {\n return _handleGettingStartSearchBarSuggestions2.apply(this, arguments);\n }\n return _handleGettingStartSearchBarSuggestions;\n }()\n }, {\n key: \"_handleGettingEndSearchBarSuggestions\",\n value: function () {\n var _handleGettingEndSearchBarSuggestions2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data) {\n var query, currentSearch, skip, limit, results;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n if (this.directionsView) {\n _context2.next = 2;\n break;\n }\n return _context2.abrupt(\"return\");\n case 2:\n query = data.query;\n currentSearch = ++this.directionsView.endSearchBox.searchCount;\n if (!(query === '')) {\n _context2.next = 7;\n break;\n }\n this.directionsView.endSearchBox.searchBarSuggestionsView.updateResults([]);\n return _context2.abrupt(\"return\");\n case 7:\n if (this.map.mapData) {\n _context2.next = 9;\n break;\n }\n return _context2.abrupt(\"return\");\n case 9:\n skip = 0;\n limit = 5;\n _context2.prev = 11;\n _context2.next = 14;\n return this.searchApi.search(this.map.mapData.map_id, this.map.mapData.map_view_id, query, skip, limit);\n case 14:\n results = _context2.sent;\n if (currentSearch === this.directionsView.endSearchBox.searchCount) {\n this.directionsView.endSearchBox.searchBarSuggestionsView.updateResults(results);\n }\n _context2.next = 21;\n break;\n case 18:\n _context2.prev = 18;\n _context2.t0 = _context2[\"catch\"](11);\n if (axios__WEBPACK_IMPORTED_MODULE_9__[\"default\"].isCancel(_context2.t0)) {\n console.error('Request canceled:', _context2.t0.message);\n } else {\n console.error('Search error:', _context2.t0);\n }\n case 21:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this, [[11, 18]]);\n }));\n function _handleGettingEndSearchBarSuggestions(_x2) {\n return _handleGettingEndSearchBarSuggestions2.apply(this, arguments);\n }\n return _handleGettingEndSearchBarSuggestions;\n }()\n }, {\n key: \"_renderDesktopView\",\n value: function _renderDesktopView() {\n if (!this.directionsView) {\n console.warn('⚠️ DirectionsControl: directionsView is null');\n return;\n }\n this.container.innerHTML = \"\";\n var element = this.directionsView.getElement();\n this.container.appendChild(element);\n this.container.classList.remove('mobile-view');\n this.container.classList.add('desktop-view');\n\n // Add QR code button if in kiosk mode and path exists\n if (this._shouldShowQRCodeButton()) {\n if (!this.qrCodeButton || !this.qrCodeButton.parentNode) {\n this._createQRCodeButton();\n }\n this.container.appendChild(this.qrCodeButton);\n } else if (this.qrCodeButton && this.qrCodeButton.parentNode) {\n this.qrCodeButton.parentNode.removeChild(this.qrCodeButton);\n }\n this.container.appendChild(this.stepsView.getElement());\n }\n }, {\n key: \"_renderMobileView\",\n value: function _renderMobileView() {\n if (!this.directionsView) {\n console.warn('⚠️ DirectionsControl: directionsView is null');\n return;\n }\n this.container.innerHTML = \"\";\n var element = this.directionsView.getElement();\n this.container.appendChild(element);\n this.container.classList.remove('desktop-view');\n this.container.classList.add('mobile-view');\n\n // Add QR code button if in kiosk mode and path exists\n if (this._shouldShowQRCodeButton()) {\n if (!this.qrCodeButton || !this.qrCodeButton.parentNode) {\n this._createQRCodeButton();\n }\n this.container.appendChild(this.qrCodeButton);\n } else if (this.qrCodeButton && this.qrCodeButton.parentNode) {\n this.qrCodeButton.parentNode.removeChild(this.qrCodeButton);\n }\n this.container.appendChild(this.stepsView.getElement());\n }\n }, {\n key: \"createDirectionsLineLayer\",\n value: function createDirectionsLineLayer() {\n this.map.map.addSource('directionsLineSource', {\n 'type': 'geojson',\n 'data': {\n 'type': 'Feature',\n 'properties': {},\n 'geometry': {\n 'type': 'LineString',\n 'coordinates': []\n }\n }\n });\n\n // Add a new layer for the line\n this.map.map.addLayer({\n 'id': 'directionsLineLayer',\n 'type': 'line',\n 'source': 'directionsLineSource',\n 'layout': {\n 'line-join': 'round',\n 'line-cap': 'round'\n },\n 'paint': {\n 'line-color': '#333333',\n 'line-width': 8\n // 'line-blur': 0.9\n }\n });\n\n // this.map.map.moveLayer('directionsLineLayer', 'off-limits');\n // this.map.map.moveLayer('directionsLineLayer', '0-tertiary-area');\n this.map.map.moveLayer('directionsLineLayer', 'FIRST_ELEVATED_FEATURE');\n }\n }, {\n key: \"updateMapForPathLeg\",\n value: function updateMapForPathLeg(leg) {\n var _this$map$mapData6, _this$map$mapData7;\n this.clearLineData();\n var points = [];\n leg.steps.forEach(function (step, index) {\n points.push.apply(points, _toConsumableArray(index === 0 ? step.path : step.path.slice(1)));\n });\n var referenceCoordinate = ((_this$map$mapData6 = this.map.mapData) === null || _this$map$mapData6 === void 0 ? void 0 : _this$map$mapData6.reference_coordinate) || [0.0, 0.0];\n var scaleFactor = ((_this$map$mapData7 = this.map.mapData) === null || _this$map$mapData7 === void 0 ? void 0 : _this$map$mapData7.coordinate_scaling_multiplier) || 30.0;\n var coordinates = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_6__.convertVerticesToCoordinates)(points, referenceCoordinate, scaleFactor);\n this._updateMapLineData(coordinates, leg.floor);\n var currentFloor = this.map.getCurrentFloor();\n if (currentFloor !== leg.floor) {\n this.map.updateFloor(leg.floor, false);\n }\n }\n }, {\n key: \"_updateMapLineData\",\n value: function _updateMapLineData(newCoordinates, floor) {\n this.map.map.getSource('directionsLineSource').setData({\n 'type': 'Feature',\n 'properties': {\n '_floor': floor\n },\n 'geometry': {\n 'type': 'LineString',\n 'coordinates': newCoordinates\n }\n });\n var bounds = new mapboxgl.LngLatBounds();\n newCoordinates.forEach(function (coordinate) {\n bounds.extend(coordinate);\n });\n if (this.currentViewType === 'desktop') {\n this.map.map.fitBounds(bounds, _defineProperty(_defineProperty(_defineProperty({\n padding: 200\n }, \"padding\", {\n top: 200,\n bottom: 200,\n left: 500,\n right: 150\n }), \"maxZoom\", 18), \"duration\", 1000));\n } else {\n this.map.map.fitBounds(bounds, {\n // padding: 200, // Add padding around the edges of the map\n padding: {\n top: 350,\n bottom: 60,\n left: 80,\n right: 100\n },\n maxZoom: 18,\n // Optional: Limit the maximum zoom level\n duration: 1000 // Optional: Animation duration in milliseconds\n });\n }\n }\n }, {\n key: \"clearLineData\",\n value: function clearLineData() {\n this.map.map.getSource('directionsLineSource').setData({\n 'type': 'Feature',\n 'properties': {},\n 'geometry': {\n 'type': 'LineString',\n 'coordinates': []\n }\n });\n }\n }, {\n key: \"_handleDefaultState\",\n value: function _handleDefaultState() {\n this.hide();\n // this.clearLineData();\n this.clearData();\n }\n }, {\n key: \"_handleSearchState\",\n value: function _handleSearchState(data) {\n var query = data.query,\n results = data.results;\n this.hide();\n // this.clearLineData();\n this.clearData();\n }\n }, {\n key: \"_handleSelectedContentState\",\n value: function _handleSelectedContentState(data) {\n var contentPlacementIds = data.contentPlacementIds,\n selectedContentPlacement = data.selectedContentPlacement;\n this.hide();\n this.directionsView.updateView(null, null);\n // this.clearLineData();\n this.clearData();\n // this.map.clearSelectedContentLayer();\n this.map.clearHighlightedContentLayer();\n }\n }, {\n key: \"_handleSetupState\",\n value: function _handleSetupState() {\n this.hide();\n }\n }, {\n key: \"clearData\",\n value: function clearData() {\n this.pathData = null;\n this.clearLineData();\n this.stepsView.clear();\n if (this.qrCodeButton && this.qrCodeButton.parentNode) {\n this.qrCodeButton.parentNode.removeChild(this.qrCodeButton);\n }\n }\n }, {\n key: \"_handleDirectionsState\",\n value: function () {\n var _handleDirectionsState2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(data) {\n var _this3 = this,\n _this$map$mapData8,\n _this$map$mapData9;\n var startContentPlacement, endContentPlacement, startNodeId, showGpsCell, referenceCoordinate, scaleFactor, _convertVertexToCoord3, lat, lon, coordinate, titleKey, title, _convertVertexToCoord4, _lat, _lon, _coordinate, _titleKey, _title, nodeIdToUse, firstLocation, _convertVertexToCoord5, _lat2, _lon2, _coordinate2;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n startContentPlacement = data.startContentPlacement, endContentPlacement = data.endContentPlacement, startNodeId = data.startNodeId;\n this.clearData();\n\n // Re-render the view to ensure all elements are in the DOM\n if (this.currentViewType === 'desktop') {\n this._renderDesktopView();\n } else {\n this._renderMobileView();\n }\n this.show();\n this.startContentPlacement = startContentPlacement;\n this.endContentPlacement = endContentPlacement;\n this.directionsView.updateView(startContentPlacement, endContentPlacement);\n\n // GPS \"Use current location\" cell handling\n showGpsCell = this.map.shouldShowGpsCell && this.map.shouldShowGpsCell() && !startContentPlacement && !startNodeId && endContentPlacement;\n if (showGpsCell) {\n this.directionsView.enableGpsStartCell();\n setTimeout(function () {\n return _this3.directionsView.focusStartInput();\n }, 50);\n } else {\n this.directionsView.disableGpsStartCell();\n }\n referenceCoordinate = ((_this$map$mapData8 = this.map.mapData) === null || _this$map$mapData8 === void 0 ? void 0 : _this$map$mapData8.reference_coordinate) || [0.0, 0.0];\n scaleFactor = ((_this$map$mapData9 = this.map.mapData) === null || _this$map$mapData9 === void 0 ? void 0 : _this$map$mapData9.coordinate_scaling_multiplier) || 30.0;\n if (startContentPlacement) {\n _convertVertexToCoord3 = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_6__.convertVertexToCoordinate)(startContentPlacement.location, referenceCoordinate, scaleFactor), lat = _convertVertexToCoord3.lat, lon = _convertVertexToCoord3.lon;\n coordinate = [lon, lat];\n if (!startContentPlacement.name) {\n if (startContentPlacement.catalog && startContentPlacement.content) {\n titleKey = startContentPlacement.catalog.content_title_key;\n if (titleKey) {\n title = startContentPlacement.content.data[titleKey];\n startContentPlacement.name = title;\n }\n }\n }\n startContentPlacement._floor = startContentPlacement.floor;\n this.map.clearHighlightedContentLayer();\n this.map.addHighlightedFeature(coordinate, startContentPlacement);\n }\n if (!endContentPlacement) {\n _context3.next = 27;\n break;\n }\n _convertVertexToCoord4 = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_6__.convertVertexToCoordinate)(endContentPlacement.location, referenceCoordinate, scaleFactor), _lat = _convertVertexToCoord4.lat, _lon = _convertVertexToCoord4.lon;\n _coordinate = [_lon, _lat];\n if (!endContentPlacement.name) {\n if (endContentPlacement.catalog && endContentPlacement.content) {\n _titleKey = endContentPlacement.catalog.content_title_key;\n if (_titleKey) {\n _title = endContentPlacement.content.data[_titleKey];\n endContentPlacement.name = _title;\n }\n }\n }\n endContentPlacement._floor = endContentPlacement.floor;\n this.map.addSelectedFeature(_coordinate, endContentPlacement);\n\n // Determine which node ID to use: prioritize startNodeId if provided\n nodeIdToUse = null;\n if (startNodeId != null && startNodeId !== '') {\n // Explicitly provided node ID takes priority\n nodeIdToUse = startNodeId;\n console.log('�� DirectionsControl: Using provided startNodeId:', startNodeId);\n } else if (this.map.location && !startContentPlacement) {\n // Fall back to map.location if no startContentPlacement\n nodeIdToUse = this.map.location;\n console.log('�� DirectionsControl: Using map.location:', this.map.location);\n }\n if (!nodeIdToUse) {\n _context3.next = 27;\n break;\n }\n console.log('�� DirectionsControl: Finding path from node to end placement, nodeId:', nodeIdToUse);\n // Find path from node to the end placement\n _context3.next = 24;\n return this.map.findPathFromNodeToPlacement(nodeIdToUse, endContentPlacement.placement_id);\n case 24:\n this.pathData = _context3.sent;\n console.log('�� DirectionsControl: Path data received:', !!this.pathData);\n if (this.pathData) {\n this.fromLocation = true;\n this.directionsView.setNewPath(this.pathData, true);\n firstLocation = this.pathData.legs[0].steps[0].path[0];\n _convertVertexToCoord5 = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_6__.convertVertexToCoordinate)(firstLocation, referenceCoordinate, scaleFactor), _lat2 = _convertVertexToCoord5.lat, _lon2 = _convertVertexToCoord5.lon;\n _coordinate2 = [_lon2, _lat2];\n this.map.addHighlightedFeature(_coordinate2, {\n '_floor': this.pathData.legs[0].floor,\n 'name': 'Start'\n });\n if (this.currentViewType === 'mobile') {\n this.stepsView.setNewPath(this.pathData, false, this.map.mapData.floors);\n } else {\n this.stepsView.setNewPath(this.pathData, true, this.map.mapData.floors);\n }\n this.updateMapForPathLeg(this.pathData.legs[0]);\n\n // Re-render to show QR code button if applicable\n if (this.currentViewType === 'desktop') {\n this._renderDesktopView();\n } else {\n this._renderMobileView();\n }\n } else {\n console.warn('⚠️ DirectionsControl: No path data returned');\n }\n case 27:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function _handleDirectionsState(_x3) {\n return _handleDirectionsState2.apply(this, arguments);\n }\n return _handleDirectionsState;\n }()\n }, {\n key: \"_handleInitiateFindPathFromLocation\",\n value: function () {\n var _handleInitiateFindPathFromLocation2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(data) {\n var endContentPlacement;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n console.log('�� DirectionsControl: _handleInitiateFindPathFromLocation called', data);\n endContentPlacement = data.endContentPlacement;\n if (!(this.map.location && endContentPlacement)) {\n _context4.next = 7;\n break;\n }\n _context4.next = 5;\n return this.map.findPathFromNodeToPlacement(this.map.location, endContentPlacement.placement_id);\n case 5:\n this.pathData = _context4.sent;\n if (this.pathData) {\n this.fromLocation = true;\n this.directionsView.setNewPath(this.pathData, true);\n if (this.currentViewType === 'mobile') {\n this.stepsView.setNewPath(this.pathData, false, this.map.mapData.floors);\n } else {\n this.stepsView.setNewPath(this.pathData, true, this.map.mapData.floors);\n }\n this.updateMapForPathLeg(this.pathData.legs[0]);\n\n // Re-render to show QR code button if applicable\n if (this.currentViewType === 'desktop') {\n this._renderDesktopView();\n } else {\n this._renderMobileView();\n }\n }\n case 7:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function _handleInitiateFindPathFromLocation(_x4) {\n return _handleInitiateFindPathFromLocation2.apply(this, arguments);\n }\n return _handleInitiateFindPathFromLocation;\n }() // async _handleInitiateFindNodeToPlacementPath(data) {\n // const { startNodeId, endContentPlacementId } = data;\n // this.pathData = await this.map.findPathNodeToPlacement(startNodeId, endContentPlacementId);\n // }\n }, {\n key: \"_handleIntiateFindPath\",\n value: function () {\n var _handleIntiateFindPath2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(data) {\n var startContentPlacementId, endContentPlacementId;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n startContentPlacementId = data.startContentPlacementId, endContentPlacementId = data.endContentPlacementId;\n _context5.next = 3;\n return this.map.findPath(startContentPlacementId, endContentPlacementId);\n case 3:\n this.pathData = _context5.sent;\n this.fromLocation = false;\n this.directionsView.setNewPath(this.pathData);\n if (this.currentViewType === 'mobile') {\n this.stepsView.setNewPath(this.pathData, false, this.map.mapData.floors);\n } else {\n this.stepsView.setNewPath(this.pathData, true, this.map.mapData.floors);\n }\n this.updateMapForPathLeg(this.pathData.legs[0]);\n\n // Re-render to show QR code button if applicable\n if (this.currentViewType === 'desktop') {\n this._renderDesktopView();\n } else {\n this._renderMobileView();\n }\n case 9:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function _handleIntiateFindPath(_x5) {\n return _handleIntiateFindPath2.apply(this, arguments);\n }\n return _handleIntiateFindPath;\n }()\n }, {\n key: \"_handleSelectDirectionsButton\",\n value: function _handleSelectDirectionsButton(data) {\n var placementId = data.placementId;\n }\n }, {\n key: \"_handleSelectGpsCurrentLocation\",\n value: function () {\n var _handleSelectGpsCurrentLocation2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {\n return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n if (this.endContentPlacement) {\n _context6.next = 3;\n break;\n }\n console.warn('⚠️ DirectionsControl: GPS cell selected but no end placement set');\n return _context6.abrupt(\"return\");\n case 3:\n _context6.next = 5;\n return this.map.useCurrentLocation(this.endContentPlacement.placement_id);\n case 5:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6, this);\n }));\n function _handleSelectGpsCurrentLocation() {\n return _handleSelectGpsCurrentLocation2.apply(this, arguments);\n }\n return _handleSelectGpsCurrentLocation;\n }()\n }, {\n key: \"_handleGpsFallback\",\n value: function _handleGpsFallback(data) {\n var _this4 = this;\n var reason = data.reason;\n if (!this.gpsFallbackPopup) {\n this.gpsFallbackPopup = new _components_GpsFallbackPopup_GpsFallbackPopup__WEBPACK_IMPORTED_MODULE_5__[\"default\"]();\n }\n this.gpsFallbackPopup.show(this.map, reason, function () {\n if (_this4.map.shouldShowGpsCell && _this4.map.shouldShowGpsCell()) {\n setTimeout(function () {\n return _this4.directionsView.focusStartInput();\n }, 50);\n } else {\n _this4.directionsView.disableGpsStartCell();\n }\n });\n }\n }, {\n key: \"_render\",\n value: function _render() {\n return;\n }\n }, {\n key: \"_shouldShowQRCodeButton\",\n value: function _shouldShowQRCodeButton() {\n // Only show in kiosk mode (not setup state)\n if (!this.map.location) {\n return false;\n }\n\n // Check if feature is enabled\n if (this.map.options.showQRCodeInKioskMode === false) {\n return false;\n }\n\n // Only show when path data exists\n if (!this.pathData) {\n return false;\n }\n\n // Only show when we have end placement\n if (!this.endContentPlacement) {\n return false;\n }\n return true;\n }\n }, {\n key: \"_createQRCodeButton\",\n value: function _createQRCodeButton() {\n this.qrCodeButton = document.createElement('button');\n this.qrCodeButton.className = 'qr-code-button';\n var iconContainer = document.createElement('div');\n iconContainer.className = 'qr-code-button-icon';\n var icon = document.createElement('img');\n icon.src = _assets_qrCodeIcon_svg__WEBPACK_IMPORTED_MODULE_7__[\"default\"];\n icon.alt = 'QR Code';\n iconContainer.appendChild(icon);\n var textContainer = document.createElement('div');\n textContainer.className = 'qr-code-button-text';\n textContainer.textContent = 'Continue on your phone ->';\n this.qrCodeButton.appendChild(iconContainer);\n this.qrCodeButton.appendChild(textContainer);\n this.qrCodeButton.addEventListener('click', this._showQRCodeModal.bind(this));\n }\n }, {\n key: \"_generateQRCodeURL\",\n value: function _generateQRCodeURL() {\n if (!this.map.mapData || !this.endContentPlacement) {\n return null;\n }\n var mapId = this.map.mapData.map_id;\n var mapViewId = this.map.mapData.map_view_id;\n var endPlacementId = this.endContentPlacement.placement_id;\n var startPlacementId;\n if (this.fromLocation) {\n // Use the node ID when path starts from kiosk location\n startPlacementId = this.map.location;\n } else if (this.startContentPlacement) {\n // Use the placement ID when path starts from a content placement\n startPlacementId = this.startContentPlacement.placement_id;\n } else {\n return null;\n }\n var url = \"https://maps.waygomaps.com/\".concat(mapId, \"/\").concat(mapViewId, \"/directions/\").concat(startPlacementId, \"/\").concat(endPlacementId);\n return url;\n }\n }, {\n key: \"_showQRCodeModal\",\n value: function () {\n var _showQRCodeModal2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {\n var _this5 = this,\n _this$map$modalContai;\n var url, modalContent, closeButton, closeIcon, modalContentWrapper;\n return _regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n url = this._generateQRCodeURL();\n if (url) {\n _context7.next = 4;\n break;\n }\n console.warn('⚠️ DirectionsControl: No URL generated for QR code');\n return _context7.abrupt(\"return\");\n case 4:\n // Create modal content wrapper\n modalContent = document.createElement('div');\n modalContent.className = 'qr-code-modal-card';\n\n // Create close button\n closeButton = document.createElement('button');\n closeButton.className = 'qr-code-modal-close';\n closeIcon = document.createElement('img');\n closeIcon.src = _assets_cancel_svg__WEBPACK_IMPORTED_MODULE_8__[\"default\"];\n closeIcon.alt = 'Close';\n closeButton.appendChild(closeIcon);\n closeButton.addEventListener('click', function () {\n _this5.map.hideModal();\n });\n modalContent.appendChild(closeButton);\n\n // Update and add QR code view\n _context7.next = 16;\n return this.qrCodeView.updateQRCode(url, 250);\n case 16:\n modalContent.appendChild(this.qrCodeView.getElement());\n\n // Show modal and adjust modal content styling for QR code\n this.map.showModal(modalContent);\n\n // Adjust modal content wrapper styling for QR code card\n modalContentWrapper = (_this$map$modalContai = this.map.modalContainer) === null || _this$map$modalContai === void 0 ? void 0 : _this$map$modalContai.querySelector('.waygo-map-modal-content');\n if (modalContentWrapper) {\n modalContentWrapper.style.backgroundColor = 'transparent';\n modalContentWrapper.style.width = 'auto';\n modalContentWrapper.style.height = 'auto';\n modalContentWrapper.style.maxWidth = 'none';\n modalContentWrapper.style.maxHeight = 'none';\n }\n case 20:\n case \"end\":\n return _context7.stop();\n }\n }, _callee7, this);\n }));\n function _showQRCodeModal() {\n return _showQRCodeModal2.apply(this, arguments);\n }\n return _showQRCodeModal;\n }()\n }]);\n}(_core_Control__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DirectionsControl);\n\n//# sourceURL=webpack://waygomaps/./src/Controls/DirectionsControl.js?");
|
|
596
596
|
|
|
597
597
|
/***/ }),
|
|
598
598
|
|
|
@@ -713,7 +713,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
713
713
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
714
714
|
|
|
715
715
|
"use strict";
|
|
716
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ContentChildButton: () => (/* binding */ ContentChildButton),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.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 _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\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 _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\nvar ContentChildButton = /*#__PURE__*/function (_Component) {\n function ContentChildButton(childPlacement) {\n var _this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, ContentChildButton);\n _this = _callSuper(this, ContentChildButton, [options]);\n _this.childPlacement = childPlacement;\n _this.maxValueLength = 50;\n _this.maxEntriesToShow = 3;\n _this._initialize();\n return _this;\n }\n _inherits(ContentChildButton, _Component);\n return _createClass(ContentChildButton, [{\n key: \"_initialize\",\n value: function _initialize() {\n this.element = document.createElement('button');\n this.element.className = 'content-details-child-view';\n this.titleElement = document.createElement('div');\n this.titleElement.className = 'content-details-child-view-title';\n var titleKey = this.childPlacement.catalog.content_title_key;\n var titleValue = this.childPlacement.content.data[titleKey];\n this.titleElement.textContent = \"\".concat(titleValue);\n this._render();\n }\n }, {\n key: \"_truncateText\",\n value: function _truncateText(text, maxLength) {\n if (text.length > maxLength) {\n return text.slice(0, maxLength - 3) + '...'; // Truncate and append \"...\"\n }\n return text;\n }\n }, {\n key: \"
|
|
716
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ContentChildButton: () => (/* binding */ ContentChildButton),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.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 _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\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 _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\nvar ContentChildButton = /*#__PURE__*/function (_Component) {\n function ContentChildButton(childPlacement) {\n var _this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, ContentChildButton);\n _this = _callSuper(this, ContentChildButton, [options]);\n _this.childPlacement = childPlacement;\n _this.maxValueLength = 50;\n _this.maxEntriesToShow = 3;\n _this._initialize();\n return _this;\n }\n _inherits(ContentChildButton, _Component);\n return _createClass(ContentChildButton, [{\n key: \"_initialize\",\n value: function _initialize() {\n this.element = document.createElement('button');\n this.element.className = 'content-details-child-view';\n this.titleElement = document.createElement('div');\n this.titleElement.className = 'content-details-child-view-title';\n var titleKey = this.childPlacement.catalog.content_title_key;\n var titleValue = this.childPlacement.content.data[titleKey];\n this.titleElement.textContent = \"\".concat(titleValue);\n this._render();\n }\n }, {\n key: \"_truncateText\",\n value: function _truncateText(text, maxLength) {\n if (text.length > maxLength) {\n return text.slice(0, maxLength - 3) + '...'; // Truncate and append \"...\"\n }\n return text;\n }\n\n /**\n * Preview rows follow catalog.data_schema key order (same as ContentDetails.findViableAdditionalData).\n * Values come from content.data; only keys present in the schema are considered.\n */\n }, {\n key: \"findViableDataEntriesInSchemaOrder\",\n value: function findViableDataEntriesInSchemaOrder(contentPlacement) {\n var data = contentPlacement.content.data || {};\n var schema = contentPlacement.catalog.data_schema || {};\n var titleKey = contentPlacement.catalog.content_title_key;\n var excludedKeys = contentPlacement.excluded_child_fields || [];\n var entries = [];\n for (var _i = 0, _Object$entries = Object.entries(schema); _i < _Object$entries.length; _i++) {\n var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),\n key = _Object$entries$_i[0],\n fieldType = _Object$entries$_i[1];\n if (fieldType === 'image' || fieldType === 'url' || key === titleKey || excludedKeys.includes(key)) {\n continue;\n }\n var raw = data[key];\n if (raw === null || raw === undefined || raw === '') {\n continue;\n }\n var displayValue = void 0;\n if (typeof raw === 'string') {\n displayValue = raw.trim();\n if (displayValue === '') {\n continue;\n }\n } else {\n displayValue = raw;\n }\n entries.push([key, displayValue]);\n }\n return entries;\n }\n }, {\n key: \"_render\",\n value: function _render() {\n var _this2 = this;\n this.element.appendChild(this.titleElement);\n var allEntries = this.findViableDataEntriesInSchemaOrder(this.childPlacement);\n var visibleEntries = allEntries.slice(0, this.maxEntriesToShow);\n var hasMoreFields = allEntries.length > this.maxEntriesToShow;\n if (allEntries.length === 0) {\n this.titleElement.style.marginBottom = \"0px\";\n }\n visibleEntries.forEach(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n key = _ref2[0],\n value = _ref2[1];\n var dataRow = document.createElement('div');\n dataRow.className = 'content-details-child-view-data-row';\n var keyElement = document.createElement('div');\n keyElement.className = 'content-details-child-view-data-key';\n keyElement.textContent = key.toUpperCase();\n var valueElement = document.createElement('div');\n valueElement.className = 'content-details-child-view-data-value';\n valueElement.textContent = _this2._truncateText(String(value), _this2.maxValueLength);\n dataRow.appendChild(keyElement);\n dataRow.appendChild(valueElement);\n _this2.element.appendChild(dataRow);\n });\n if (hasMoreFields) {\n var moreHint = document.createElement('div');\n moreHint.className = 'content-details-child-view-more-hint';\n moreHint.setAttribute('aria-hidden', 'true');\n moreHint.textContent = '…';\n this.element.appendChild(moreHint);\n }\n }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ContentChildButton);\n\n//# sourceURL=webpack://waygomaps/./src/components/ContentPlacementView/ContentChildButton.js?");
|
|
717
717
|
|
|
718
718
|
/***/ }),
|
|
719
719
|
|
package/dist/style.css
CHANGED
|
@@ -1819,6 +1819,18 @@ html, body {
|
|
|
1819
1819
|
max-width: 100%;
|
|
1820
1820
|
}
|
|
1821
1821
|
|
|
1822
|
+
.content-details-child-view-more-hint {
|
|
1823
|
+
margin-top: 6px;
|
|
1824
|
+
margin-bottom: 2px;
|
|
1825
|
+
font-size: 13px;
|
|
1826
|
+
line-height: 1;
|
|
1827
|
+
letter-spacing: 0.12em;
|
|
1828
|
+
color: #808587;
|
|
1829
|
+
font-weight: 500;
|
|
1830
|
+
text-align: left;
|
|
1831
|
+
opacity: 0.85;
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1822
1834
|
|
|
1823
1835
|
|
|
1824
1836
|
/* ------------------------------------------------- */
|