diff --git a/map-maplibre.bundle.js b/map-maplibre.bundle.js index 9194fc3..bc79a87 100644 --- a/map-maplibre.bundle.js +++ b/map-maplibre.bundle.js @@ -1,2 +1,2 @@ /*! For license information please see map-maplibre.bundle.js.LICENSE.txt */ -(self.webpackChunkopenlayers_vs_maplibre=self.webpackChunkopenlayers_vs_maplibre||[]).push([["map-maplibre"],{"./node_modules/@maplibre/maplibre-gl-geocoder/lib/exceptions.js":module=>{eval("module.exports = {\n 'fr': {\n 'name': 'France',\n 'bbox': [[-4.59235, 41.380007], [9.560016, 51.148506]]\n },\n 'us': {\n 'name': 'United States',\n 'bbox': [[-171.791111, 18.91619], [-66.96466, 71.357764]]\n },\n 'ru': {\n 'name': 'Russia',\n 'bbox': [[19.66064, 41.151416], [190.10042, 81.2504]]\n },\n 'ca': {\n 'name': 'Canada',\n 'bbox': [[-140.99778, 41.675105], [-52.648099, 83.23324]]\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQG1hcGxpYnJlL21hcGxpYnJlLWdsLWdlb2NvZGVyL2xpYi9leGNlcHRpb25zLmpzLmpzIiwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZXMiOlsid2VicGFjazovL29wZW5sYXllcnMtdnMtbWFwbGlicmUvLi9ub2RlX21vZHVsZXMvQG1hcGxpYnJlL21hcGxpYnJlLWdsLWdlb2NvZGVyL2xpYi9leGNlcHRpb25zLmpzPzM5YzAiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7XG4gICdmcic6IHtcbiAgICAnbmFtZSc6ICdGcmFuY2UnLFxuICAgICdiYm94JzogW1stNC41OTIzNSwgNDEuMzgwMDA3XSwgWzkuNTYwMDE2LCA1MS4xNDg1MDZdXVxuICB9LFxuICAndXMnOiB7XG4gICAgJ25hbWUnOiAnVW5pdGVkIFN0YXRlcycsXG4gICAgJ2Jib3gnOiBbWy0xNzEuNzkxMTExLCAxOC45MTYxOV0sIFstNjYuOTY0NjYsIDcxLjM1Nzc2NF1dXG4gIH0sXG4gICdydSc6IHtcbiAgICAnbmFtZSc6ICdSdXNzaWEnLFxuICAgICdiYm94JzogW1sxOS42NjA2NCwgNDEuMTUxNDE2XSwgWzE5MC4xMDA0MiwgODEuMjUwNF1dXG4gIH0sXG4gICdjYSc6IHtcbiAgICAnbmFtZSc6ICdDYW5hZGEnLFxuICAgICdiYm94JzogW1stMTQwLjk5Nzc4LCA0MS42NzUxMDVdLCBbLTUyLjY0ODA5OSwgODMuMjMzMjRdXVxuICB9XG59O1xuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/@maplibre/maplibre-gl-geocoder/lib/exceptions.js\n")},"./node_modules/@maplibre/maplibre-gl-geocoder/lib/index.js":(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval('\n\nvar Typeahead = __webpack_require__(/*! suggestions-list */ "./node_modules/suggestions-list/index.js");\nvar debounce = __webpack_require__(/*! lodash.debounce */ "./node_modules/lodash.debounce/index.js");\nvar extend = __webpack_require__(/*! xtend */ "./node_modules/xtend/immutable.js");\nvar EventEmitter = (__webpack_require__(/*! events */ "./node_modules/events/events.js").EventEmitter);\nvar exceptions = __webpack_require__(/*! ./exceptions */ "./node_modules/@maplibre/maplibre-gl-geocoder/lib/exceptions.js");\nvar localization = __webpack_require__(/*! ./localization */ "./node_modules/@maplibre/maplibre-gl-geocoder/lib/localization.js");\nvar subtag = __webpack_require__(/*! subtag */ "./node_modules/subtag/subtag.js");\n\n/**\n * A geocoder component that works with maplibre\n * @class MaplibreGeocoder\n * @param {Object} geocoderApi Any geocoder api that supports the functions reverseGeocode and forwardGeocode and returns a response which includes a FeatureCollection of results\n * @param {Object} options\n * @param {Object} [options.maplibregl] A [maplibre-gl](https://github.com/maplibre/maplibre-gl-js) instance to use when creating [Markers](https://maplibre.org/maplibre-gl-js-docs/api/markers/#marker). Required if `options.marker` is `true`.\n * @param {Number} [options.zoom=16] On geocoded result what zoom level should the map animate to when a `bbox` isn\'t found in the response. If a `bbox` is found the map will fit to the `bbox`.\n * @param {Boolean|Object} [options.flyTo=true] If `false`, animating the map to a selected result is disabled. If `true`, animating the map will use the default animation parameters. If an object, it will be passed as `options` to the map [`flyTo`](https://maplibre.org/maplibre-gl-js-docs/api/map/#map#flyto) or [`fitBounds`](https://maplibre.org/maplibre-gl-js-docs/api/map/#map#fitbounds) method providing control over the animation of the transition.\n * @param {String} [options.placeholder=Search] Override the default placeholder attribute value.\n * @param {Object} [options.proximity] a proximity argument: this is\n * a geographical point given as an object with `latitude` and `longitude`\n * properties. Search results closer to this point will be given\n * higher priority.\n * @param {Boolean} [options.trackProximity=true] If `true`, the geocoder proximity will automatically update based on the map view.\n * @param {Boolean} [options.collapsed=false] If `true`, the geocoder control will collapse until hovered or in focus.\n * @param {Boolean} [options.clearAndBlurOnEsc=false] If `true`, the geocoder control will clear it\'s contents and blur when user presses the escape key.\n * @param {Boolean} [options.clearOnBlur=false] If `true`, the geocoder control will clear its value when the input blurs.\n * @param {Array} [options.bbox] a bounding box argument: this is\n * a bounding box given as an array in the format `[minX, minY, maxX, maxY]`.\n * Search results will be limited to the bounding box.\n * @param {string} [options.countries] a comma separated list of country codes to\n * limit results to specified country or countries.\n * @param {string} [options.types] a comma seperated list of types that filter\n * results to match those specified. See https://docs.mapbox.com/api/search/#data-types\n * for available types.\n * If reverseGeocode is enabled, you should specify one type. If you configure more than one type, the first type will be used.\n * @param {Number} [options.minLength=2] Minimum number of characters to enter before results are shown.\n * @param {Number} [options.limit=5] Maximum number of results to show.\n * @param {string} [options.language] Specify the language to use for response text and query result weighting. Options are IETF language tags comprised of a mandatory ISO 639-1 language code and optionally one or more IETF subtags for country or script. More than one value can also be specified, separated by commas. Defaults to the browser\'s language settings.\n * @param {Function} [options.filter] A function which accepts a Feature in the [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md) format to filter out results from the Geocoding API response before they are included in the suggestions list. Return `true` to keep the item, `false` otherwise.\n * @param {Function} [options.localGeocoder] A function accepting the query string which performs local geocoding to supplement results from the Maplibre Geocoding API. Expected to return an Array of GeoJSON Features in the [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md) format.\n * @param {Function} [options.externalGeocoder] A function accepting the query string, current features list, and geocoder options which performs geocoding to supplement results from the Maplibre Geocoding API. Expected to return a Promise which resolves to an Array of GeoJSON Features in the [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md) format.\n * @param {distance|score} [options.reverseMode=distance] - Set the factors that are used to sort nearby results.\n * @param {boolean} [options.reverseGeocode=false] If `true`, enable reverse geocoding mode. In reverse geocoding, search input is expected to be coordinates in the form `lat, lon`, with suggestions being the reverse geocodes.\n * @param {Boolean} [options.enableEventLogging=true] Allow Maplibre to collect anonymous usage statistics from the plugin.\n * @param {Boolean|Object} [options.marker=true] If `true`, a [Marker](https://maplibre.org/maplibre-gl-js-docs/api/markers/#marker) will be added to the map at the location of the user-selected result using a default set of Marker options. If the value is an object, the marker will be constructed using these options. If `false`, no marker will be added to the map. Requires that `options.maplibregl` also be set.\n * @param {Boolean|Object} [options.popup=true] If `true`, a [Popup](https://maplibre.org/maplibre-gl-js-docs/api/markers/#popup) will be added to the map when clicking on a marker using a default set of popup options. If the value is an object, the popup will be constructed using these options. If `false`, no popup will be added to the map. Requires that `options.maplibregl` also be set.\n * @param {Boolean|Object} [options.showResultMarkers=true] If `true`, [Markers](https://maplibre.org/maplibre-gl-js-docs/api/markers/#marker) will be added to the map at the location the top results for the query. If the value is an object, the marker will be constructed using these options. If `false`, no marker will be added to the map. Requires that `options.maplibregl` also be set.\n * @param {Function} [options.render] A function that specifies how the results should be rendered in the dropdown menu. This function should accepts a single [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md) object as input and return a string. Any HTML in the returned string will be rendered.\n * @param {Function} [options.popupRender] A function that specifies how the results should be rendered in the popup menu. This function should accept a single [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md) object as input and return a string. Any HTML in the returned string will be rendered.\n * @param {Function} [options.getItemValue] A function that specifies how the selected result should be rendered in the search bar. This function should accept a single [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md) object as input and return a string. HTML tags in the output string will not be rendered. Defaults to `(item) => item.place_name`.\n * @param {Boolean} [options.localGeocoderOnly=false] If `true`, indicates that the `localGeocoder` results should be the only ones returned to the user. If `false`, indicates that the `localGeocoder` results should be combined with those from the Maplibre API with the `localGeocoder` results ranked higher.\n * @param {Boolean} [options.showResultsWhileTyping=false] If `false`, indicates that search will only occur on enter key press. If `true`, indicates that the Geocoder will search on the input box being updated above the minLength option.\n * @param {Number} [options.debounceSearch=200] Sets the amount of time, in milliseconds, to wait before querying the server when a user types into the Geocoder input box. This parameter may be useful for reducing the total number of API calls made for a single query.\n * @example\n *\n * var GeoApi = {\n * forwardGeocode: (config) => { return { features: [] } },\n * reverseGeocode: (config) => { return { features: [] } }\n * getSuggestions: (config) => { return { suggestions: string[] }}\n * getByPlaceId: (config) => { return { suggestions: {text: string, placeId?: string}[] }}\n * }\n * var geocoder = new MaplibreGeocoder(GeoApi, {});\n * map.addControl(geocoder);\n * @return {MaplibreGeocoder} `this`\n *\n */\n\nfunction MaplibreGeocoder(geocoderApi, options) {\n this._eventEmitter = new EventEmitter();\n this.options = extend({}, this.options, options);\n this.inputString = "";\n this.fresh = true;\n this.lastSelected = null;\n this.geocoderApi = geocoderApi;\n}\n\nMaplibreGeocoder.prototype = {\n options: {\n zoom: 16,\n flyTo: true,\n trackProximity: true,\n showResultsWhileTyping: false,\n minLength: 2,\n reverseGeocode: false,\n limit: 5,\n enableEventLogging: true,\n marker: true,\n popup: false,\n maplibregl: null,\n collapsed: false,\n clearAndBlurOnEsc: false,\n clearOnBlur: false,\n getItemValue: function (item) {\n return item.text !== undefined ? item.text : item.place_name;\n },\n render: function (item) {\n // Render as a suggestion\n if (!item.geometry) {\n var suggestionString = item.text;\n var indexOfMatch = suggestionString\n .toLowerCase()\n .indexOf(this.query.toLowerCase());\n var lengthOfMatch = this.query.length;\n var beforeMatch = suggestionString.substring(0, indexOfMatch);\n var match = suggestionString.substring(\n indexOfMatch,\n indexOfMatch + lengthOfMatch\n );\n var afterMatch = suggestionString.substring(\n indexOfMatch + lengthOfMatch\n );\n\n return (\n \'
\' +\n \'\' +\n \'
\' +\n \'
\' +\n beforeMatch +\n \'\' +\n match +\n "" +\n afterMatch +\n "
" +\n "
" +\n "
"\n );\n } else {\n // render as a search result\n var placeName = item.place_name.split(",");\n\n return (\n \'
\' +\n \'\' +\n "
" +\n \'
\' +\n placeName[0] +\n "
" +\n \'
\' +\n placeName.splice(1, placeName.length).join(",") +\n "
" +\n "
" +\n "
"\n );\n }\n },\n popupRender: function (item) {\n var placeName = item.place_name.split(",");\n return (\n \'"\n );\n },\n showResultMarkers: true,\n debounceSearch: 200,\n },\n\n /**\n * Add the geocoder to a container. The container can be either a `maplibregl.Map`, an `HTMLElement` or a CSS selector string.\n *\n * If the container is a [`maplibregl.Map`](https://maplibre.org/maplibre-gl-js-docs/api/map/#map), this function will behave identically to [`Map.addControl(geocoder)`](https://maplibre.org/maplibre-gl-js-docs/api/map/#map#addcontrol).\n * If the container is an instance of [`HTMLElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement), then the geocoder will be appended as a child of that [`HTMLElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement).\n * If the container is a [CSS selector string](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors), the geocoder will be appended to the element returned from the query.\n *\n * This function will throw an error if the container is none of the above.\n * It will also throw an error if the referenced HTML element cannot be found in the `document.body`.\n *\n * For example, if the HTML body contains the element `
`, the following script will append the geocoder to `#geocoder-container`:\n *\n * ```javascript\n * var GeoApi = {\n * forwardGeocode: (config) => { return { features: [] } },\n * reverseGeocode: (config) => { return { features: [] } }\n * }\n * var geocoder = new MaplibreGeocoder(GeoAPI, {});\n * geocoder.addTo(\'#geocoder-container\');\n * ```\n * @param {String|HTMLElement|maplibregl.Map} container A reference to the container to which to add the geocoder\n */\n addTo: function (container) {\n function addToExistingContainer(geocoder, container) {\n if (!document.body.contains(container)) {\n throw new Error(\n "Element provided to #addTo() exists, but is not in the DOM"\n );\n }\n var el = geocoder.onAdd(); //returns the input elements, which are then added to the requested html container\n container.appendChild(el);\n }\n\n // if the container is a map, add the control like normal\n if (container._controlContainer) {\n // it\'s a maplibre-gl map, add like normal\n container.addControl(this);\n }\n // if the container is an HTMLElement, then set the parent to be that element\n else if (container instanceof HTMLElement) {\n addToExistingContainer(this, container);\n }\n // if the container is a string, treat it as a CSS query\n else if (typeof container == "string") {\n var parent = document.querySelectorAll(container);\n if (parent.length === 0) {\n throw new Error("Element ", container, "not found.");\n }\n\n if (parent.length > 1) {\n throw new Error("Geocoder can only be added to a single html element");\n }\n\n addToExistingContainer(this, parent[0]);\n } else {\n throw new Error(\n "Error: addTo must be a maplibre-gl-js map, an html element, or a CSS selector query for a single html element"\n );\n }\n },\n\n onAdd: function (map) {\n if (map && typeof map != "string") {\n this._map = map;\n }\n\n this.setLanguage();\n\n if (this.options.localGeocoderOnly && !this.options.localGeocoder) {\n throw new Error(\n "A localGeocoder function must be specified to use localGeocoderOnly mode"\n );\n }\n\n this._onChange = this._onChange.bind(this);\n this._onKeyDown = this._onKeyDown.bind(this);\n this._onPaste = this._onPaste.bind(this);\n this._onBlur = this._onBlur.bind(this);\n this._showButton = this._showButton.bind(this);\n this._hideButton = this._hideButton.bind(this);\n this._onQueryResult = this._onQueryResult.bind(this);\n this.clear = this.clear.bind(this);\n this._updateProximity = this._updateProximity.bind(this);\n this._collapse = this._collapse.bind(this);\n this._unCollapse = this._unCollapse.bind(this);\n this._clear = this._clear.bind(this);\n this._clearOnBlur = this._clearOnBlur.bind(this);\n\n var el = (this.container = document.createElement("div"));\n el.className =\n "mapboxgl-ctrl-geocoder mapboxgl-ctrl maplibregl-ctrl-geocoder maplibregl-ctrl";\n\n var searchIcon = this.createIcon(\n "search",\n \'\'\n );\n\n this._inputEl = document.createElement("input");\n this._inputEl.type = "text";\n this._inputEl.className =\n "mapboxgl-ctrl-geocoder--input maplibregl-ctrl-geocoder--input";\n\n this.setPlaceholder();\n\n if (this.options.collapsed) {\n this._collapse();\n this.container.addEventListener("mouseenter", this._unCollapse);\n this.container.addEventListener("mouseleave", this._collapse);\n this._inputEl.addEventListener("focus", this._unCollapse);\n }\n\n if (this.options.collapsed || this.options.clearOnBlur) {\n this._inputEl.addEventListener("blur", this._onBlur);\n }\n\n this._inputEl.addEventListener(\n "keydown",\n debounce(this._onKeyDown, this.options.debounceSearch)\n );\n this._inputEl.addEventListener("paste", this._onPaste);\n this._inputEl.addEventListener("change", this._onChange);\n this.container.addEventListener("mouseenter", this._showButton);\n this.container.addEventListener("mouseleave", this._hideButton);\n\n var actions = document.createElement("div");\n actions.classList.add(\n "mapboxgl-ctrl-geocoder--pin-right",\n "maplibregl-ctrl-geocoder--pin-right"\n );\n\n this._clearEl = document.createElement("button");\n this._clearEl.setAttribute("aria-label", "Clear");\n this._clearEl.addEventListener("click", this.clear);\n this._clearEl.className =\n "mapboxgl-ctrl-geocoder--button maplibregl-ctrl-geocoder--button";\n\n var buttonIcon = this.createIcon(\n "close",\n \'\'\n );\n this._clearEl.appendChild(buttonIcon);\n\n this._loadingEl = this.createIcon(\n "loading",\n \'\'\n );\n\n actions.appendChild(this._clearEl);\n actions.appendChild(this._loadingEl);\n\n el.appendChild(searchIcon);\n el.appendChild(this._inputEl);\n el.appendChild(actions);\n\n this._typeahead = new Typeahead(this._inputEl, [], {\n filter: false,\n minLength: this.options.minLength,\n limit: this.options.limit,\n noInitialSelection: true,\n });\n\n this.setRenderFunction(this.options.render);\n this._typeahead.getItemValue = this.options.getItemValue;\n\n this.mapMarker = null;\n this.resultMarkers = [];\n this._handleMarker = this._handleMarker.bind(this);\n this._handleResultMarkers = this._handleResultMarkers.bind(this);\n if (this._map) {\n if (this.options.trackProximity) {\n this._updateProximity();\n this._map.on("moveend", this._updateProximity);\n }\n this._maplibregl = this.options.maplibregl;\n if (!this._maplibregl && this.options.marker) {\n // eslint-disable-next-line no-console\n console.error(\n "No maplibregl detected in options. Map markers are disabled. Please set options.maplibregl."\n );\n this.options.marker = false;\n }\n }\n return el;\n },\n\n createIcon: function (name, path) {\n var icon = document.createElementNS("http://www.w3.org/2000/svg", "svg");\n icon.setAttribute(\n "class",\n "mapboxgl-ctrl-geocoder--icon mapboxgl-ctrl-geocoder--icon-" +\n name +\n " maplibregl-ctrl-geocoder--icon maplibregl-ctrl-geocoder--icon-" +\n name\n );\n icon.setAttribute("viewBox", "0 0 18 18");\n icon.setAttribute("xml:space", "preserve");\n icon.setAttribute("width", 18);\n icon.setAttribute("height", 18);\n // IE does not have innerHTML for SVG nodes\n if (!("innerHTML" in icon)) {\n var SVGNodeContainer = document.createElement("div");\n SVGNodeContainer.innerHTML =\n "" + path.valueOf().toString() + "";\n var SVGNode = SVGNodeContainer.firstChild,\n SVGPath = SVGNode.firstChild;\n icon.appendChild(SVGPath);\n } else {\n icon.innerHTML = path;\n }\n return icon;\n },\n\n onRemove: function () {\n this.container.parentNode.removeChild(this.container);\n\n if (this.options.trackProximity && this._map) {\n this._map.off("moveend", this._updateProximity);\n }\n\n this._removeMarker();\n\n this._map = null;\n\n return this;\n },\n\n _onPaste: function (e) {\n var value = (e.clipboardData || window.clipboardData).getData("text");\n if (\n value.length >= this.options.minLength &&\n this.options.showResultsWhileTyping\n ) {\n this._geocode(value);\n }\n },\n\n _onKeyDown: function (e) {\n var ESC_KEY_CODE = 27,\n TAB_KEY_CODE = 9;\n\n if (e.keyCode === ESC_KEY_CODE && this.options.clearAndBlurOnEsc) {\n this._clear(e);\n return this._inputEl.blur();\n }\n\n // if target has shadowRoot, then get the actual active element inside the shadowRoot\n var target =\n e.target && e.target.shadowRoot\n ? e.target.shadowRoot.activeElement\n : e.target;\n var value = target ? target.value : "";\n\n if (!value) {\n this.fresh = true;\n // the user has removed all the text\n if (e.keyCode !== TAB_KEY_CODE) this.clear(e);\n return (this._clearEl.style.display = "none");\n }\n\n // TAB, ESC, LEFT, RIGHT, UP, DOWN\n if (\n e.metaKey ||\n [TAB_KEY_CODE, ESC_KEY_CODE, 37, 39, 38, 40].indexOf(e.keyCode) !== -1\n )\n return;\n\n // ENTER\n if (e.keyCode === 13) {\n if (!this.options.showResultsWhileTyping) {\n if (!this._typeahead.selected) {\n this._geocode(target.value);\n }\n } else {\n // Pressing enter on the search box will do a search for the currently string input\n if (\n this._typeahead.selected == null &&\n this.geocoderApi.getSuggestions\n ) {\n this._geocode(target.value, true);\n\n // If suggestions API is not defined pressing enter while the input box is selected will try to fit the results into the current map view\n } else if (this._typeahead.selected == null) {\n if (this.options.showResultMarkers) {\n this._fitBoundsForMarkers();\n }\n }\n return;\n }\n }\n\n // Show results while typing and greater than min length\n if (\n target.value.length >= this.options.minLength &&\n this.options.showResultsWhileTyping\n ) {\n this._geocode(target.value);\n }\n },\n\n _showButton: function () {\n if (this._inputEl.value.length > 0) this._clearEl.style.display = "block";\n },\n\n _hideButton: function () {\n if (this._typeahead.selected) this._clearEl.style.display = "none";\n },\n\n _onBlur: function (e) {\n if (this.options.clearOnBlur) {\n this._clearOnBlur(e);\n }\n if (this.options.collapsed) {\n this._collapse();\n }\n },\n // Change events are fire by suggestions library whenever the enter key is pressed or input is blurred\n // This can sometimes cause strange behavior as this function is called before our own onKeyDown handler and thus\n // we cannot depend on some internal values of the suggestion state like `selected` as those will change or before\n // our onKeyDown handler.\n _onChange: function () {\n var selected = this._typeahead.selected;\n\n // If a suggestion was selected\n if (selected && !selected.geometry) {\n if (selected.placeId) this._geocode(selected.placeId, true, true);\n else this._geocode(selected.text, true);\n } else if (selected && JSON.stringify(selected) !== this.lastSelected) {\n this._clearEl.style.display = "none";\n if (this.options.flyTo) {\n var flyOptions;\n this._removeResultMarkers();\n if (selected.properties && exceptions[selected.properties.short_code]) {\n // Certain geocoder search results return (and therefore zoom to fit)\n // an unexpectedly large bounding box: for example, both Russia and the\n // USA span both sides of -180/180, or France includes the island of\n // Reunion in the Indian Ocean. An incomplete list of these exceptions\n // at ./exceptions.json provides "reasonable" bounding boxes as a\n // short-term solution; this may be amended as necessary.\n flyOptions = extend({}, this.options.flyTo);\n if (this._map) {\n this._map.fitBounds(\n exceptions[selected.properties.short_code].bbox,\n flyOptions\n );\n }\n } else if (selected.bbox) {\n var bbox = selected.bbox;\n flyOptions = extend({}, this.options.flyTo);\n if (this._map) {\n this._map.fitBounds(\n [\n [bbox[0], bbox[1]],\n [bbox[2], bbox[3]],\n ],\n flyOptions\n );\n }\n } else {\n var defaultFlyOptions = {\n zoom: this.options.zoom,\n };\n flyOptions = extend({}, defaultFlyOptions, this.options.flyTo);\n // ensure that center is not overriden by custom options\n if (selected.center) {\n flyOptions.center = selected.center;\n } else if (\n selected.geometry &&\n selected.geometry.type &&\n selected.geometry.type === "Point" &&\n selected.geometry.coordinates\n ) {\n flyOptions.center = selected.geometry.coordinates;\n }\n\n if (this._map) {\n this._map.flyTo(flyOptions);\n }\n }\n }\n if (this.options.marker && this._maplibregl) {\n this._handleMarker(selected);\n }\n\n // After selecting a feature, re-focus the textarea and set\n // cursor at start, and reset the selected feature.\n this._inputEl.focus();\n this._inputEl.scrollLeft = 0;\n this._inputEl.setSelectionRange(0, 0);\n this.lastSelected = JSON.stringify(selected);\n this._typeahead.selected = null; // reset selection current selection value and set it to last selected\n this._eventEmitter.emit("result", { result: selected });\n }\n },\n\n _getConfigForRequest: function () {\n // Possible config proprerties to pass to client\n var keys = [\n "bbox",\n "limit",\n "proximity",\n "countries",\n "types",\n "language",\n "reverseMode",\n ];\n var self = this;\n // Create config object\n var config = keys.reduce(function (config, key) {\n if (self.options[key]) {\n // countries, types, and language need to be passed in as arrays to client\n // https://github.com/mapbox/mapbox-sdk-js/blob/master/services/geocoding.js#L38-L47\n ["countries", "types", "language"].indexOf(key) > -1\n ? (config[key] = self.options[key].split(/[\\s,]+/))\n : (config[key] = self.options[key]);\n\n if (\n key === "proximity" &&\n self.options[key] &&\n typeof self.options[key].longitude === "number" &&\n typeof self.options[key].latitude === "number"\n ) {\n config[key] = [\n self.options[key].longitude,\n self.options[key].latitude,\n ];\n }\n }\n return config;\n }, {});\n\n return config;\n },\n\n _geocode: function (searchInput, isSuggestion, isPlaceId) {\n this._loadingEl.style.display = "block";\n this._eventEmitter.emit("loading", { query: searchInput });\n this.inputString = searchInput;\n var geocoderError = null;\n\n // Create config object\n var config = this._getConfigForRequest();\n\n var request;\n if (this.options.localGeocoderOnly) {\n request = Promise.resolve();\n }\n // check if searchInput resembles coordinates, and if it does,\n // make the request a reverseGeocode\n else if (\n this.options.reverseGeocode &&\n /(-?\\d+\\.?\\d*)[, ]+(-?\\d+\\.?\\d*)[ ]*$/.test(searchInput)\n ) {\n // parse coordinates\n var coords = searchInput\n .split(/[\\s(,)?]+/)\n .map(function (c) {\n return parseFloat(c, 10);\n })\n .reverse();\n\n // client only accepts one type for reverseGeocode, so\n // use first config type if one, if not default to poi\n config.types ? [config.types[0]] : ["poi"];\n config = extend(config, { query: coords, limit: 1 });\n\n // drop proximity which may have been set by trackProximity since it\'s not supported by the reverseGeocoder\n if ("proximity" in config) {\n delete config.proximity;\n }\n\n request = this.geocoderApi.reverseGeocode(config);\n } else {\n config = extend(config, { query: searchInput });\n if (!this.geocoderApi.getSuggestions) {\n request = this.geocoderApi.forwardGeocode(config);\n } else {\n // user clicked on a suggestion\n if (isSuggestion) {\n // suggestion has place Id\n if (this.geocoderApi.searchByPlaceId && isPlaceId) {\n request = this.geocoderApi.searchByPlaceId(config);\n } else {\n request = this.geocoderApi.forwardGeocode(config);\n }\n } else {\n // user typed in text and should receive suggestions\n request = this.geocoderApi.getSuggestions(config);\n }\n }\n }\n\n var localGeocoderRes = [];\n if (this.options.localGeocoder) {\n localGeocoderRes = this.options.localGeocoder(searchInput);\n if (!localGeocoderRes) {\n localGeocoderRes = [];\n }\n }\n var externalGeocoderRes = [];\n request\n .catch(\n function (error) {\n geocoderError = error;\n }.bind(this)\n )\n .then(\n function (response) {\n this._loadingEl.style.display = "none";\n\n var res = {};\n\n if (!response) {\n res = {\n type: "FeatureCollection",\n features: [],\n };\n } else {\n res = response;\n }\n\n res.config = config;\n\n if (this.fresh) {\n this.fresh = false;\n }\n\n // supplement Maplibre Geocoding API results with locally populated results\n res.features = res.features\n ? localGeocoderRes.concat(res.features)\n : localGeocoderRes;\n\n if (this.options.externalGeocoder) {\n externalGeocoderRes =\n this.options.externalGeocoder(\n searchInput,\n res.features,\n config\n ) || [];\n // supplement Geocoding API results with features returned by a promise\n return externalGeocoderRes.then(\n function (features) {\n res.features = res.features\n ? features.concat(res.features)\n : features;\n return res;\n },\n function () {\n // on error, display the original result\n return res;\n }\n );\n }\n return res;\n }.bind(this)\n )\n .then(\n function (res) {\n if (geocoderError) {\n throw geocoderError;\n }\n\n // apply results filter if provided\n if (this.options.filter && res.features.length) {\n res.features = res.features.filter(this.options.filter);\n }\n\n var results = [];\n if (res.suggestions) {\n results = res.suggestions;\n } else if (res.place) {\n results = [res.place];\n } else {\n results = res.features;\n }\n\n if (results.length) {\n this._clearEl.style.display = "block";\n\n this._typeahead.update(results);\n if (\n (!this.options.showResultsWhileTyping || isSuggestion) &&\n this.options.showResultMarkers &&\n (res.features.length > 0 || res.place)\n ) {\n this._fitBoundsForMarkers();\n }\n\n this._eventEmitter.emit("results", res);\n } else {\n this._clearEl.style.display = "none";\n this._typeahead.selected = null;\n this._renderNoResults();\n this._eventEmitter.emit("results", res);\n }\n }.bind(this)\n )\n .catch(\n function (err) {\n this._loadingEl.style.display = "none";\n\n // in the event of an error in the Geocoding API still display results from the localGeocoder\n if (\n (localGeocoderRes.length && this.options.localGeocoder) ||\n (externalGeocoderRes.length && this.options.externalGeocoder)\n ) {\n this._clearEl.style.display = "block";\n this._typeahead.update(localGeocoderRes);\n } else {\n this._clearEl.style.display = "none";\n this._typeahead.selected = null;\n this._renderError();\n }\n\n this._eventEmitter.emit("results", { features: localGeocoderRes });\n this._eventEmitter.emit("error", { error: err });\n }.bind(this)\n );\n\n return request;\n },\n\n /**\n * Shared logic for clearing input\n * @param {Event} [ev] the event that triggered the clear, if available\n * @private\n *\n */\n _clear: function (ev) {\n if (ev) ev.preventDefault();\n this._inputEl.value = "";\n this._typeahead.selected = null;\n this._typeahead.clear();\n this._onChange();\n this._clearEl.style.display = "none";\n this._removeMarker();\n this._removeResultMarkers();\n this.lastSelected = null;\n this._eventEmitter.emit("clear");\n this.fresh = true;\n },\n\n /**\n * Clear and then focus the input.\n * @param {Event} [ev] the event that triggered the clear, if available\n *\n */\n clear: function (ev) {\n this._clear(ev);\n this._inputEl.focus();\n },\n\n /**\n * Clear the input, without refocusing it. Used to implement clearOnBlur\n * constructor option.\n * @param {Event} [ev] the blur event\n * @private\n */\n _clearOnBlur: function (ev) {\n var ctx = this;\n\n /*\n * If relatedTarget is not found, assume user targeted the suggestions list.\n * In that case, do not clear on blur. There are other edge cases where\n * ev.relatedTarget could be null. Clicking on list always results in null\n * relatedtarget because of upstream behavior in `suggestions`.\n *\n * The ideal solution would be to check if ev.relatedTarget is a child of\n * the list. See issue #258 for details on why we can\'t do that yet.\n */\n if (ev.relatedTarget) {\n ctx._clear(ev);\n }\n },\n\n _onQueryResult: function (response) {\n var results = response;\n if (!results.features.length) return;\n var result = results.features[0];\n this._typeahead.selected = result;\n this._inputEl.value = result.place_name;\n this._onChange();\n },\n\n _updateProximity: function () {\n // proximity is designed for local scale, if the user is looking at the whole world,\n // it doesn\'t make sense to factor in the arbitrary centre of the map\n if (!this._map) {\n return;\n }\n if (this._map.getZoom() > 9) {\n var center = this._map.getCenter().wrap();\n this.setProximity({ longitude: center.lng, latitude: center.lat });\n } else {\n this.setProximity(null);\n }\n },\n\n _collapse: function () {\n // do not collapse if input is in focus\n if (!this._inputEl.value && this._inputEl !== document.activeElement)\n this.container.classList.add(\n "mapboxgl-ctrl-geocoder--collapsed",\n "maplibregl-ctrl-geocoder--collapsed"\n );\n },\n\n _unCollapse: function () {\n this.container.classList.remove(\n "mapboxgl-ctrl-geocoder--collapsed",\n "maplibregl-ctrl-geocoder--collapsed"\n );\n },\n\n /**\n * Set & query the input\n * @param {string} searchInput location name or other search input\n * @returns {MaplibreGeocoder} this\n */\n query: function (searchInput) {\n this._geocode(searchInput).then(this._onQueryResult);\n return this;\n },\n\n _renderError: function () {\n var errorMessage =\n "
There was an error reaching the server
";\n this._renderMessage(errorMessage);\n },\n\n _renderNoResults: function () {\n var errorMessage =\n "
No results found
";\n this._renderMessage(errorMessage);\n },\n\n _renderMessage: function (msg) {\n this._typeahead.update([]);\n this._typeahead.selected = null;\n this._typeahead.clear();\n this._typeahead.renderError(msg);\n },\n\n /**\n * Get the text to use as the search bar placeholder\n *\n * If placeholder is provided in options, then use options.placeholder\n * Otherwise, if language is provided in options, then use the localized string of the first language if available\n * Otherwise use the default\n *\n * @returns {String} the value to use as the search bar placeholder\n * @private\n */\n _getPlaceholderText: function () {\n if (this.options.placeholder) return this.options.placeholder;\n if (this.options.language) {\n var firstLanguage = this.options.language.split(",")[0];\n var language = subtag.language(firstLanguage);\n var localizedValue = localization.placeholder[language];\n if (localizedValue) return localizedValue;\n }\n return "Search";\n },\n\n /**\n * Fits the map to the current bounds for the searched results\n *\n * @returns {MaplibreGeocoder} this\n * @private\n */\n _fitBoundsForMarkers: function () {\n if (this._typeahead.data.length < 1) return;\n\n // Filter out suggestions and restrict to limit\n var results = this._typeahead.data\n .filter(function (result) {\n return typeof result === "string" ? false : true;\n })\n .slice(0, this.options.limit);\n\n this._clearEl.style.display = "none";\n\n if (this.options.flyTo && this._maplibregl) {\n if (this._map) {\n var defaultFlyOptions = { padding: 100 };\n var flyOptions = extend({}, defaultFlyOptions, this.options.flyTo);\n var bounds = new this._maplibregl.LngLatBounds();\n results.forEach(function (feature) {\n bounds.extend(feature.geometry.coordinates);\n });\n\n this._map.fitBounds(bounds.toArray(), flyOptions);\n }\n }\n\n if (results.length > 0 && this._maplibregl) {\n this._handleResultMarkers(results);\n }\n\n return this;\n },\n\n /**\n * Set input\n * @param {string} searchInput location name or other search input\n * @returns {MaplibreGeocoder} this\n */\n setInput: function (searchInput) {\n // Set input value to passed value and clear everything else.\n this._inputEl.value = searchInput;\n this._typeahead.selected = null;\n this._typeahead.clear();\n if (\n searchInput.length >= this.options.minLength &&\n this.options.showResultsWhileTyping\n ) {\n this._geocode(searchInput);\n }\n return this;\n },\n\n /**\n * Set proximity\n * @param {Object} proximity The new `options.proximity` value. This is a geographical point given as an object with `latitude` and `longitude` properties.\n * @returns {MaplibreGeocoder} this\n */\n setProximity: function (proximity) {\n this.options.proximity = proximity;\n return this;\n },\n\n /**\n * Get proximity\n * @returns {Object} The geocoder proximity\n */\n getProximity: function () {\n return this.options.proximity;\n },\n\n /**\n * Set the render function used in the results dropdown\n * @param {Function} fn The function to use as a render function. This function accepts a single [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md) object as input and returns a string.\n * @returns {MaplibreGeocoder} this\n */\n setRenderFunction: function (fn) {\n if (fn && typeof fn == "function") {\n this._typeahead.render = fn;\n }\n return this;\n },\n\n /**\n * Get the function used to render the results dropdown\n *\n * @returns {Function} the render function\n */\n getRenderFunction: function () {\n return this._typeahead.render;\n },\n\n /**\n * Get the language to use in UI elements and when making search requests\n *\n * Look first at the explicitly set options otherwise use the browser\'s language settings\n * @param {String} language Specify the language to use for response text and query result weighting. Options are IETF language tags comprised of a mandatory ISO 639-1 language code and optionally one or more IETF subtags for country or script. More than one value can also be specified, separated by commas.\n * @returns {MaplibreGeocoder} this\n */\n setLanguage: function (language) {\n var browserLocale =\n navigator.language || navigator.userLanguage || navigator.browserLanguage;\n this.options.language = language || this.options.language || browserLocale;\n return this;\n },\n\n /**\n * Get the language to use in UI elements and when making search requests\n * @returns {String} The language(s) used by the plugin, if any\n */\n getLanguage: function () {\n return this.options.language;\n },\n\n /**\n * Get the zoom level the map will move to when there is no bounding box on the selected result\n * @returns {Number} the map zoom\n */\n getZoom: function () {\n return this.options.zoom;\n },\n\n /**\n * Set the zoom level\n * @param {Number} zoom The zoom level that the map should animate to when a `bbox` isn\'t found in the response. If a `bbox` is found the map will fit to the `bbox`.\n * @returns {MaplibreGeocoder} this\n */\n setZoom: function (zoom) {\n this.options.zoom = zoom;\n return this;\n },\n\n /**\n * Get the parameters used to fly to the selected response, if any\n * @returns {Boolean|Object} The `flyTo` option\n */\n getFlyTo: function () {\n return this.options.flyTo;\n },\n\n /**\n * Set the flyTo options\n * @param {Boolean|Object} flyTo If false, animating the map to a selected result is disabled. If true, animating the map will use the default animation parameters. If an object, it will be passed as `options` to the map [`flyTo`](https://maplibre.org/maplibre-gl-js-docs/api/map/#map#flyto) or [`fitBounds`](https://maplibre.org/maplibre-gl-js-docs/api/map/#map#fitbounds) method providing control over the animation of the transition.\n */\n setFlyTo: function (flyTo) {\n this.options.flyTo = flyTo;\n return this;\n },\n\n /**\n * Get the value of the placeholder string\n * @returns {String} The input element\'s placeholder value\n */\n getPlaceholder: function () {\n return this.options.placeholder;\n },\n\n /**\n * Set the value of the input element\'s placeholder\n * @param {String} placeholder the text to use as the input element\'s placeholder\n * @returns {MaplibreGeocoder} this\n */\n setPlaceholder: function (placeholder) {\n this.placeholder = placeholder ? placeholder : this._getPlaceholderText();\n this._inputEl.placeholder = this.placeholder;\n this._inputEl.setAttribute("aria-label", this.placeholder);\n return this;\n },\n\n /**\n * Get the bounding box used by the plugin\n * @returns {Array} the bounding box, if any\n */\n getBbox: function () {\n return this.options.bbox;\n },\n\n /**\n * Set the bounding box to limit search results to\n * @param {Array} bbox a bounding box given as an array in the format [minX, minY, maxX, maxY].\n * @returns {MaplibreGeocoder} this\n */\n setBbox: function (bbox) {\n this.options.bbox = bbox;\n return this;\n },\n\n /**\n * Get a list of the countries to limit search results to\n * @returns {String} a comma separated list of countries to limit to, if any\n */\n getCountries: function () {\n return this.options.countries;\n },\n\n /**\n * Set the countries to limit search results to\n * @param {String} countries a comma separated list of countries to limit to\n * @returns {MaplibreGeocoder} this\n */\n setCountries: function (countries) {\n this.options.countries = countries;\n return this;\n },\n\n /**\n * Get a list of the types to limit search results to\n * @returns {String} a comma separated list of types to limit to\n */\n getTypes: function () {\n return this.options.types;\n },\n\n /**\n * Set the types to limit search results to\n * @param {String} countries a comma separated list of types to limit to\n * @returns {MaplibreGeocoder} this\n */\n setTypes: function (types) {\n this.options.types = types;\n return this;\n },\n\n /**\n * Get the minimum number of characters typed to trigger results used in the plugin\n * @returns {Number} The minimum length in characters before a search is triggered\n */\n getMinLength: function () {\n return this.options.minLength;\n },\n\n /**\n * Set the minimum number of characters typed to trigger results used by the plugin\n * @param {Number} minLength the minimum length in characters\n * @returns {MaplibreGeocoder} this\n */\n setMinLength: function (minLength) {\n this.options.minLength = minLength;\n if (this._typeahead) this._typeahead.options.minLength = minLength;\n return this;\n },\n\n /**\n * Get the limit value for the number of results to display used by the plugin\n * @returns {Number} The limit value for the number of results to display used by the plugin\n */\n getLimit: function () {\n return this.options.limit;\n },\n\n /**\n * Set the limit value for the number of results to display used by the plugin\n * @param {Number} limit the number of search results to return\n * @returns {MaplibreGeocoder}\n */\n setLimit: function (limit) {\n this.options.limit = limit;\n if (this._typeahead) this._typeahead.options.limit = limit;\n return this;\n },\n\n /**\n * Get the filter function used by the plugin\n * @returns {Function} the filter function\n */\n getFilter: function () {\n return this.options.filter;\n },\n\n /**\n * Set the filter function used by the plugin.\n * @param {Function} filter A function which accepts a Feature in the [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md) format to filter out results from the Geocoding API response before they are included in the suggestions list. Return `true` to keep the item, `false` otherwise.\n * @returns {MaplibreGeocoder} this\n */\n setFilter: function (filter) {\n this.options.filter = filter;\n return this;\n },\n\n /**\n * Set the geocoding api used by the plugin.\n * @param {Object} geocoderApi An API which contains reverseGeocode and forwardGeocode functions to be used by this plugin\n * @param {Function} geocoderApi.forwardGeocode Forward geocode function should return an object including a collection of Features in [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md) format\n * @param {Object} geocoderApi.forwardGeocode.config Query parameters\n * @param {String} geocoderApi.forwardGeocode.config.query Search query string\n * @param {Number} geocoderApi.forwardGeocode.config.limit Number of results to limit by\n * @param {Array} geocoderApi.forwardGeocode.config.bbox a bounding box given as an array in the format `[minX, minY, maxX, maxY]`. Search results will be limited to the bounding box.\n * @param {Object} geocoderApi.forwardGeocode.config.proximity a geographical point given as an object with `latitude` and `longitude` properties. Search results closer to this point will be given higher priority.\n * @param {Array} geocoderApi.forwardGeocode.config.countries a comma separated list of country codes to limit results to specified country or countries.\n * @param {Array} geocoderApi.forwardGeocode.config.types a comma seperated list of types that filter results to match those specified. See https://docs.mapbox.com/api/search/#data-types for available types. If reverseGeocode is enabled, you should specify one type. If you configure more than one type, the first type will be used.\n * @param {String} geocoderApi.forwardGeocode.config.language Specify the language to use for response text and query result weighting. Options are IETF language tags comprised of a mandatory ISO 639-1 language code and optionally one or more IETF subtags for country or script. More than one value can also be specified, separated by commas. Defaults to the browser\'s language settings.\n * @param {distance|score} geocoderApi.forwardGeocode.config.reverseMode Set the factors that are used to sort nearby results.\n *\n * @param {Function} geocoderApi.reverseGeocode Reverse geocode function should return an object including a collection of Features in [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md) format\n * @param {Object} geocoderApi.reverseGeocode.config Query parameters\n * @param {Object} geocoderApi.reverseGeocode.config.query Search query coordinates\n * @param {Number} geocoderApi.reverseGeocode.config.limit Number of results to limit by\n * @param {Array} geocoderApi.reverseGeocode.config.bbox a bounding box given as an array in the format `[minX, minY, maxX, maxY]`. Search results will be limited to the bounding box.\n * @param {Object} geocoderApi.reverseGeocode.config.proximity a geographical point given as an object with `latitude` and `longitude` properties. Search results closer to this point will be given higher priority.\n * @param {Array} geocoderApi.reverseGeocode.config.countries a comma separated list of country codes to limit results to specified country or countries.\n * @param {Array} geocoderApi.reverseGeocode.config.types a comma seperated list of types that filter results to match those specified. See https://docs.mapbox.com/api/search/#data-types for available types. If reverseGeocode is enabled, you should specify one type. If you configure more than one type, the first type will be used.\n * @param {String} geocoderApi.reverseGeocode.config.language Specify the language to use for response text and query result weighting. Options are IETF language tags comprised of a mandatory ISO 639-1 language code and optionally one or more IETF subtags for country or script. More than one value can also be specified, separated by commas. Defaults to the browser\'s language settings.\n * @param {distance|score} geocoderApi.reverseGeocode.config.reverseMode Set the factors that are used to sort nearby results.\n * @returns {MaplibreGeocoder} this\n */\n setGeocoderApi: function (geocoderApi) {\n this.geocoderApi = geocoderApi;\n return this;\n },\n\n /**\n * Get the geocoding endpoint the plugin is currently set to\n * @returns {Object} the geocoding API\n */\n getGeocoderApi: function () {\n return this.geocoderApi;\n },\n\n /**\n * Handle the placement of a result marking the selected result\n * @private\n * @param {Object} selected the selected geojson feature\n * @returns {MaplibreGeocoder} this\n */\n _handleMarker: function (selected) {\n // clean up any old marker that might be present\n if (!this._map) {\n return;\n }\n this._removeMarker();\n var defaultMarkerOptions = {\n color: "#4668F2",\n };\n var markerOptions = extend({}, defaultMarkerOptions, this.options.marker);\n this.mapMarker = new this._maplibregl.Marker(markerOptions);\n\n var popup;\n if (this.options.popup) {\n var defaultPopupOptions = {};\n var popupOptions = extend({}, defaultPopupOptions, this.options.popup);\n popup = new this._maplibregl.Popup(popupOptions).setHTML(\n this.options.popupRender(selected)\n );\n }\n\n if (selected.center) {\n this.mapMarker.setLngLat(selected.center).addTo(this._map);\n\n if (this.options.popup) this.mapMarker.setPopup(popup);\n } else if (\n selected.geometry &&\n selected.geometry.type &&\n selected.geometry.type === "Point" &&\n selected.geometry.coordinates\n ) {\n this.mapMarker.setLngLat(selected.geometry.coordinates).addTo(this._map);\n\n if (this.options.popup) this.mapMarker.setPopup(popup);\n }\n return this;\n },\n\n /**\n * Handle the removal of a result marker\n * @private\n */\n _removeMarker: function () {\n if (this.mapMarker) {\n this.mapMarker.remove();\n this.mapMarker = null;\n }\n },\n\n /**\n * Handle the placement of a result marking the selected result\n * @private\n * @param {Object[]} results the top results to display on the map\n * @returns {MaplibreGeocoder} this\n */\n _handleResultMarkers: function (results) {\n // clean up any old marker that might be present\n if (!this._map) {\n return;\n }\n this._removeResultMarkers();\n var defaultMarkerOptions = {\n color: "#4668F2",\n };\n var markerOptions = extend(\n {},\n defaultMarkerOptions,\n this.options.showResultMarkers\n );\n\n results.forEach(\n function (result) {\n if (\n this.options.showResultMarkers &&\n this.options.showResultMarkers.element\n ) {\n var el = this.options.showResultMarkers.element.cloneNode(true);\n markerOptions = extend(markerOptions, { element: el });\n }\n\n var marker = new this._maplibregl.Marker(\n extend({}, markerOptions, { element: el })\n );\n\n var popup;\n if (this.options.popup) {\n var defaultPopupOptions = {};\n var popupOptions = extend(\n {},\n defaultPopupOptions,\n this.options.popup\n );\n popup = new this._maplibregl.Popup(popupOptions).setHTML(\n this.options.popupRender(result)\n );\n }\n if (result.center) {\n marker.setLngLat(result.center).addTo(this._map);\n if (this.options.popup) marker.setPopup(popup);\n } else if (\n result.geometry &&\n result.geometry.type &&\n result.geometry.type === "Point" &&\n result.geometry.coordinates\n ) {\n marker.setLngLat(result.geometry.coordinates).addTo(this._map);\n if (this.options.popup) marker.setPopup(popup);\n }\n this.resultMarkers.push(marker);\n }.bind(this)\n );\n return this;\n },\n\n /**\n * Handle the removal of a result marker\n * @private\n */\n _removeResultMarkers: function () {\n if (this.resultMarkers && this.resultMarkers.length > 0) {\n this.resultMarkers.forEach(function (marker) {\n marker.remove();\n });\n this.resultMarkers = [];\n }\n },\n\n /**\n * Subscribe to events that happen within the plugin.\n * @param {String} type name of event. Available events and the data passed into their respective event objects are:\n *\n * - __clear__ `Emitted when the input is cleared`\n * - __loading__ `{ query } Emitted when the geocoder is looking up a query`\n * - __results__ `{ results } Fired when the geocoder returns a response`\n * - __result__ `{ result } Fired when input is set`\n * - __error__ `{ error } Error as string`\n * @param {Function} fn function that\'s called when the event is emitted.\n * @returns {MaplibreGeocoder} this;\n */\n on: function (type, fn) {\n this._eventEmitter.on(type, fn);\n return this;\n },\n\n /**\n * Remove an event\n * @returns {MaplibreGeocoder} this\n * @param {String} type Event name.\n * @param {Function} fn Function that should unsubscribe to the event emitted.\n */\n off: function (type, fn) {\n this._eventEmitter.removeListener(type, fn);\n return this;\n },\n};\n\nmodule.exports = MaplibreGeocoder;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQG1hcGxpYnJlL21hcGxpYnJlLWdsLWdlb2NvZGVyL2xpYi9pbmRleC5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNB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wcm92aWRlcyBcInJlYXNvbmFibGVcIiBib3VuZGluZyBib3hlcyBhcyBhXG4gICAgICAgICAgLy8gc2hvcnQtdGVybSBzb2x1dGlvbjsgdGhpcyBtYXkgYmUgYW1lbmRlZCBhcyBuZWNlc3NhcnkuXG4gICAgICAgICAgZmx5T3B0aW9ucyA9IGV4dGVuZCh7fSwgdGhpcy5vcHRpb25zLmZseVRvKTtcbiAgICAgICAgICBpZiAodGhpcy5fbWFwKSB7XG4gICAgICAgICAgICB0aGlzLl9tYXAuZml0Qm91bmRzKFxuICAgICAgICAgICAgICBleGNlcHRpb25zW3NlbGVjdGVkLnByb3BlcnRpZXMuc2hvcnRfY29kZV0uYmJveCxcbiAgICAgICAgICAgICAgZmx5T3B0aW9uc1xuICAgICAgICAgICAgKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAoc2VsZWN0ZWQuYmJveCkge1xuICAgICAgICAgIHZhciBiYm94ID0gc2VsZWN0ZWQuYmJveDtcbiAgICAgICAgICBmbHlPcHRpb25zID0gZXh0ZW5kKHt9LCB0aGlzLm9wdGlvbnMuZmx5VG8pO1xuICAgICAgICAgIGlmICh0aGlzLl9tYXApIHtcbiAgICAgICAgICAgIHRoaXMuX21hcC5maXRCb3VuZHMoXG4gICAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICBbYmJveFswXSwgYmJveFsxXV0sXG4gICAgICAgICAgICAgICAgW2Jib3hbMl0sIGJib3hbM11dLFxuICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICBmbHlPcHRpb25zXG4gICAgICAgICAgICApO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB2YXIgZGVmYXVsdEZseU9wdGlvbnMgPSB7XG4gICAgICAgICAgICB6b29tOiB0aGlzLm9wdGlvbnMuem9vbSxcbiAgICAgICAgICB9O1xuICAgICAgICAgIGZseU9wdGlvbnMgPSBleHRlbmQoe30sIGRlZmF1bHRGbHlPcHRpb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cmVDb2xsZWN0aW9uXCIsXG4gICAgICAgICAgICAgIGZlYXR1cmVzOiBbXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlcyA9IHJlc3BvbnNlO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHJlcy5jb25maWcgPSBjb25maWc7XG5cbiAgICAgICAgICBpZiAodGhpcy5mcmVzaCkge1xuICAgICAgICAgICAgdGhpcy5mcmVzaCA9IGZhbHNlO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIC8vIHN1cHBsZW1lbnQgTWFwbGlicmUgR2VvY29kaW5nIEFQSSByZXN1bHRzIHdpdGggbG9jYWxseSBwb3B1bGF0ZWQgcmVzdWx0c1xuICAgICAgICAgIHJlcy5mZWF0dXJlcyA9IHJlcy5mZWF0dXJlc1xuICAgICAgICAgICAgPyBsb2NhbEdlb2NvZGVyUmVzLmNvbmNhdChyZXMuZmVhdHVyZXMpXG4gICAgICAgICAgICA6IGxvY2FsR2VvY29kZXJSZXM7XG5cbiAgICAgICAgICBpZiAodGhpcy5vcHRpb25zLmV4dGVybmFsR2VvY29kZXIpIHtcbiAgICAgICAgICAgIGV4dGVybmFsR2VvY29kZXJSZXMgPVxuICAgICAgICAgICAgICB0aGlzLm9wdGlvbnMuZXh0ZXJuYWxHZW9jb2RlcihcbiAgICAgICAgICAgICAgICBzZWFyY2hJbnB1dCxcbiAgICAgICAgICAgICAgICByZXMuZmVhdHVyZXMsXG4gICAgICAgICAgICAgICAgY29uZmlnXG4gICAgICAgICAgICAgICkgfHwgW107XG4gICAgICAgICAgICAvLyBzdXBwbGVtZW50IEdlb2NvZGluZyBBUEkgcmVzdWx0cyB3aXRoIGZlYXR1cmVzIHJldHVybmVkIGJ5IGEgcHJvbWlzZVxuICAgICAgICAgICAgcmV0dXJuIGV4dGVybmFsR2VvY29kZXJSZXMudGhlbihcbiAgICAgICAgICAgICAgZnVuY3Rpb24gKGZlYXR1cmVzKSB7XG4gICAgICAgICAgICAgICAgcmVzLmZlYXR1cmVzID0gcmVzLmZlYXR1cmVzXG4gICAgICAgICAgICAgICAgICA/IGZlYXR1cmVzLmNvbmNhdChyZXMuZmVhdHVyZXMpXG4gICAgICAgICAgICAgICAgICA6IGZlYXR1cmVzO1xuICAgICAgICAgICAgICAgIHJldHVybiByZXM7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAvLyBvbiBlcnJvciwgZGlzcGxheSB0aGUgb3JpZ2luYWwgcmVzdWx0XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlcztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIHJlcztcbiAgICAgICAgfS5iaW5kKHRoaXMpXG4gICAgICApXG4gICAgICAudGhlbihcbiAgICAgICAgZnVuY3Rpb24gKHJlcykge1xuICAgICAgICAgIGlmIChnZW9jb2RlckVycm9yKSB7XG4gICAgICAgICAgICB0aHJvdyBnZW9jb2RlckVycm9yO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIC8vIGFwcGx5IHJlc3VsdHMgZmlsdGVyIGlmIHByb3ZpZGVkXG4gICAgICAgICAgaWYgKHRoaXMub3B0aW9ucy5maWx0ZXIgJiYgcmVzLmZlYXR1cmVzLmxlbmd0aCkge1xuICAgICAgICAgICAgcmVzLmZlYXR1cmVzID0gcmVzLmZlYXR1cmVzLmZpbHRlcih0aGlzLm9wdGlvbnMuZmlsdGVyKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICB2YXIgcmVzdWx0cyA9IFtdO1xuICAgICAgICAgIGlmIChyZXMuc3VnZ2VzdGlvbnMpIHtcbiAgICAgICAgICAgIHJlc3VsdHMgPSByZXMuc3VnZ2VzdGlvbnM7XG4gICAgICAgICAgfSBlbHNlIGlmIChyZXMucGxhY2UpIHtcbiAgICAgICAgICAgIHJlc3VsdHMg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B7fSxcbiAgICAgIGRlZmF1bHRNYXJrZXJPcHRpb25zLFxuICAgICAgdGhpcy5vcHRpb25zLnNob3dSZXN1bHRNYXJrZXJzXG4gICAgKTtcblxuICAgIHJlc3VsdHMuZm9yRWFjaChcbiAgICAgIGZ1bmN0aW9uIChyZXN1bHQpIHtcbiAgICAgICAgaWYgKFxuICAgICAgICAgIHRoaXMub3B0aW9ucy5zaG93UmVzdWx0TWFya2VycyAmJlxuICAgICAgICAgIHRoaXMub3B0aW9ucy5zaG93UmVzdWx0TWFya2Vycy5lbGVtZW50XG4gICAgICAgICkge1xuICAgICAgICAgIHZhciBlbCA9IHRoaXMub3B0aW9ucy5zaG93UmVzdWx0TWFya2Vycy5lbGVtZW50LmNsb25lTm9kZSh0cnVlKTtcbiAgICAgICAgICBtYXJrZXJPcHRpb25zID0gZXh0ZW5kKG1hcmtlck9wdGlvbnMsIHsgZWxlbWVudDogZWwgfSk7XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgbWFya2VyID0gbmV3IHRoaXMuX21hcGxpYnJlZ2wuTWFya2VyKFxuICAgICAgICAgIGV4dGVuZCh7fSwgbWFya2VyT3B0aW9ucywgeyBlbGVtZW50OiBlbCB9KVxuICAgICAgICApO1xuXG4gICAgICAgIHZhciBwb3B1cDtcbiAgICAgICAgaWYgKHRoaXMub3B0aW9ucy5wb3B1cCkge1xuICAgICAgICAgIHZhciBkZWZhdWx0UG9wdXBPcHRpb25zID0ge307XG4gICAgICAgICAgdmFyIHBvcHVwT3B0aW9ucyA9IGV4dGVuZChcbiAgICAgICAgICAgIHt9LFxuICAgICAgICAgICAgZGVmYXVsdFBvcHVwT3B0aW9ucyxcbiAgICAgICAgICAgIHRoaXMub3B0aW9ucy5wb3B1cFxuICAgICAgICAgICk7XG4gICAgICAgICAgcG9wdXAgPSBuZXcgdGhpcy5fbWFwbGlicmVnbC5Qb3B1cChwb3B1cE9wdGlvbnMpLnNldEhUTUwoXG4gICAgICAgICAgICB0aGlzLm9wdGl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IHJldHVybiB0aGlzO1xuICB9LFxuXG4gIC8qKlxuICAgKiBSZW1vdmUgYW4gZXZlbnRcbiAgICogQHJldHVybnMge01hcGxpYnJlR2VvY29kZXJ9IHRoaXNcbiAgICogQHBhcmFtIHtTdHJpbmd9IHR5cGUgRXZlbnQgbmFtZS5cbiAgICogQHBhcmFtIHtGdW5jdGlvbn0gZm4gRnVuY3Rpb24gdGhhdCBzaG91bGQgdW5zdWJzY3JpYmUgdG8gdGhlIGV2ZW50IGVtaXR0ZWQuXG4gICAqL1xuICBvZmY6IGZ1bmN0aW9uICh0eXBlLCBmbikge1xuICAgIHRoaXMuX2V2ZW50RW1pdHRlci5yZW1vdmVMaXN0ZW5lcih0eXBlLCBmbik7XG4gICAgcmV0dXJuIHRoaXM7XG4gIH0sXG59O1xuXG5tb2R1bGUuZXhwb3J0cyA9IE1hcGxpYnJlR2VvY29kZXI7XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/@maplibre/maplibre-gl-geocoder/lib/index.js\n')},"./node_modules/@maplibre/maplibre-gl-geocoder/lib/localization.js":module=>{"use strict";eval("\n\n/**\n * Localized values for the placeholder string\n * \n * @private\n */\nvar placeholder = {\n // list drawn from https://docs.mapbox.com/api/search/#language-coverage\n 'de': 'Suche', // german\n 'it': 'Ricerca', //italian\n 'en': 'Search', // english\n 'nl': 'Zoeken', //dutch\n 'fr': 'Chercher', //french\n 'ca': 'Cerca', //catalan\n 'he': 'לחפש', //hebrew\n 'ja': 'サーチ', //japanese\n 'lv': 'Meklēt', //latvian\n 'pt': 'Procurar', //portuguese \n 'sr': 'Претрага', //serbian\n 'zh': '搜索', //chinese-simplified\n 'cs': 'Vyhledávání', //czech\n 'hu': 'Keresés', //hungarian\n 'ka': 'ძიება', // georgian\n 'nb': 'Søke', //norwegian\n 'sk': 'Vyhľadávanie', //slovak\n 'th': 'ค้นหา', //thai\n 'fi': 'Hae',//finnish\n 'is': 'Leita',//icelandic\n 'ko': '수색',//korean\n 'pl': 'Szukaj', //polish\n 'sl': 'Iskanje', //slovenian\n 'fa': 'جستجو', //persian(aka farsi)\n 'ru': 'Поиск'//russian\n}\n\nmodule.exports = {placeholder: placeholder};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvQG1hcGxpYnJlL21hcGxpYnJlLWdsLWdlb2NvZGVyL2xpYi9sb2NhbGl6YXRpb24uanMuanMiLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9vcGVubGF5ZXJzLXZzLW1hcGxpYnJlLy4vbm9kZV9tb2R1bGVzL0BtYXBsaWJyZS9tYXBsaWJyZS1nbC1nZW9jb2Rlci9saWIvbG9jYWxpemF0aW9uLmpzPzIyMmYiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xuXG4vKipcbiAqIExvY2FsaXplZCB2YWx1ZXMgZm9yIHRoZSBwbGFjZWhvbGRlciBzdHJpbmdcbiAqIFxuICogQHByaXZhdGVcbiAqL1xudmFyIHBsYWNlaG9sZGVyID0ge1xuICAvLyBsaXN0IGRyYXduIGZyb20gaHR0cHM6Ly9kb2NzLm1hcGJveC5jb20vYXBpL3NlYXJjaC8jbGFuZ3VhZ2UtY292ZXJhZ2VcbiAgJ2RlJzogJ1N1Y2hlJywgLy8gZ2VybWFuXG4gICdp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cjogcGxhY2Vob2xkZXJ9O1xuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/@maplibre/maplibre-gl-geocoder/lib/localization.js\n")},"./assets/js/components/defaults.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\nvar DEFAULT_OPTIONS = {\n center: [2.35, 48.85],\n // Paris\n zoom: 15\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DEFAULT_OPTIONS);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9hc3NldHMvanMvY29tcG9uZW50cy9kZWZhdWx0cy5qcy5qcyIsIm1hcHBpbmdzIjoiOzs7O0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUVBIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vb3BlbmxheWVycy12cy1tYXBsaWJyZS8uL2Fzc2V0cy9qcy9jb21wb25lbnRzL2RlZmF1bHRzLmpzPzA0NmQiXSwic291cmNlc0NvbnRlbnQiOlsiY29uc3QgREVGQVVMVF9PUFRJT05TID0ge1xuICAgIGNlbnRlcjogWzIuMzUsIDQ4Ljg1XSwgIC8vIFBhcmlzXG4gICAgem9vbTogMTVcbn07XG5cbmV4cG9ydCBkZWZhdWx0IERFRkFVTFRfT1BUSU9OUzsiXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./assets/js/components/defaults.js\n')},"./assets/js/components/maplibre/layer-switcher-control.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"LayerSwitcherControl\": () => (/* binding */ LayerSwitcherControl)\n/* harmony export */ });\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar LayerSwitcherControl = /*#__PURE__*/function () {\n function LayerSwitcherControl() {\n _classCallCheck(this, LayerSwitcherControl);\n }\n _createClass(LayerSwitcherControl, [{\n key: \"onAdd\",\n value: function onAdd(map) {\n this._map = map;\n this._style = map.getStyle();\n var layers = this._style.layers;\n layers.forEach(function (part, index) {\n var layer = this[index];\n if (!('source-layer' in layer)) {\n layer['source-layer'] = layer.id;\n }\n }, layers);\n this._buildContainer();\n return this._container;\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n this._container.parentNode.removeChild(this._container);\n this._map = undefined;\n }\n }, {\n key: \"_buildContainer\",\n value: function _buildContainer() {\n var _this = this;\n this._container = document.createElement('div');\n this._container.className = 'layer-switcher';\n var button = document.createElement('button');\n button.className = 'btn layer-switcher-control';\n button.innerHTML = '';\n button.addEventListener('click', function (event) {\n var ul = document.getElementById('layer-switcher-sources');\n var display = ul.style.display || 'none';\n ul.style.display = display === \"none\" ? \"block\" : \"none\";\n });\n this._container.append(button);\n var ulSrces = document.createElement('ul');\n ulSrces.className = 'layer-switcher-sources';\n ulSrces.id = 'layer-switcher-sources';\n this._container.append(ulSrces);\n if (this._style && this._style.sources) {\n var sources = Object.keys(this._style.sources);\n sources.forEach(function (source) {\n var li = _this._addSouce(source);\n ulSrces.append(li);\n var ul = document.createElement('ul');\n ul.className = 'layer-switcher-layers';\n li.append(ul);\n var layers = {};\n _this._style.layers.forEach(function (layer) {\n if (source === layer.source) {\n var name = layer[\"source-layer\"];\n if (!(name in layers)) {\n layers[name] = [];\n }\n layers[name].push(layer.id);\n }\n });\n for (var name in layers) {\n var _li = _this._addLayer(source, name, layers[name]);\n ul.append(_li);\n }\n });\n }\n }\n }, {\n key: \"_addSouce\",\n value: function _addSouce(source) {\n var _this2 = this;\n var li = document.createElement('li');\n li.className = 'layer-switcher-source';\n var cb = document.createElement('input');\n cb.type = 'checkbox';\n cb.className = 'source';\n cb.id = source;\n cb.dataset.source = source;\n cb.checked = true;\n\n /* Coche/decoche une source */\n cb.addEventListener('change', function (event) {\n var target = event.currentTarget;\n var checked = target.checked;\n var source = target.dataset.source;\n var parent = target.parentNode;\n var elements = parent.querySelectorAll(\"input.layer[data-source=\\\"\".concat(source, \"\\\"]\"));\n elements.forEach(function (element) {\n var visible = checked ? 'visible' : 'none';\n element.checked = checked;\n var layerIds = element.dataset.ids.split(',');\n layerIds.forEach(function (layerId) {\n _this2._map.setLayoutProperty(layerId, 'visibility', visible);\n });\n });\n });\n var label = this._addLabel(source);\n li.append(cb);\n li.append(label);\n return li;\n }\n }, {\n key: \"_addLayer\",\n value: function _addLayer(source, layer, ids) {\n var _this3 = this;\n var li = document.createElement('li');\n var cb = document.createElement('input');\n cb.type = 'checkbox';\n cb.className = 'layer';\n cb.id = layer;\n cb.dataset.source = source;\n cb.dataset.layer = layer;\n cb.dataset.ids = ids.join(',');\n cb.checked = true;\n\n /* Coche/decoche un layer */\n cb.addEventListener('change', function (event) {\n var target = event.currentTarget;\n var checked = target.checked;\n var visible = checked ? 'visible' : 'none';\n\n // Mise a jour de tous les styles de meme source-layer\n var layerIds = target.dataset.ids.split(',');\n layerIds.forEach(function (layerId) {\n _this3._map.setLayoutProperty(layerId, 'visibility', visible);\n });\n\n // Mise a jour (checked) de la checkbox de la source\n var source = target.dataset.source;\n var cbSource = document.querySelector(\"input.source[data-source=\\\"\".concat(source, \"\\\"]\"));\n var ulLayers = target.parentNode.parentNode;\n var elements = ulLayers.querySelectorAll('input.layer');\n var num = elements.length;\n var checkStates = {\n checked: 0,\n unchecked: 0\n };\n elements.forEach(function (element) {\n element.checked ? checkStates.checked++ : checkStates.unchecked++;\n });\n if (num === checkStates.checked) {\n cbSource.checked = true;\n } else if (num === checkStates.unchecked) {\n cbSource.checked = false;\n }\n });\n var label = this._addLabel(layer);\n li.append(cb);\n li.append(label);\n return li;\n }\n }, {\n key: \"_addLabel\",\n value: function _addLabel(id) {\n var label = document.createElement('label');\n label.htmlFor = id;\n var span = document.createElement('span');\n span.innerHTML = id;\n label.append(span);\n return label;\n }\n }]);\n return LayerSwitcherControl;\n}();//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9hc3NldHMvanMvY29tcG9uZW50cy9tYXBsaWJyZS9sYXllci1zd2l0Y2hlci1jb250cm9sLmpzLmpzIiwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUVBO0FBQ0E7QUFFQTtBQUNBO0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Y2VzKTtcbiAgICAgICAgICAgIHNvdXJjZXMuZm9yRWFjaChzb3VyY2UgPT4ge1xuICAgICAgICAgICAgICAgIGxldCBsaSA9IHRoaXMuX2FkZFNvdWNlKHNvdXJjZSk7XG4gICAgICAgICAgICAgICAgdWxTcmNlcy5hcHBlbmQobGkpO1xuXG4gICAgICAgICAgICAgICAgbGV0IHVsID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgndWwnKTtcbiAgICAgICAgICAgICAgICB1bC5jbGFzc05hbWUgPSAnbGF5ZXItc3dpdGNoZXItbGF5ZXJzJztcbiAgICAgICAgICAgICAgICBsaS5hcHBlbmQodWwpO1xuXG4gICAgICAgICAgICAgICAgY29uc3QgbGF5ZXJzID0ge307XG4gICAgICAgICAgICAgICAgdGhpcy5fc3R5bGUubGF5ZXJzLmZvckVhY2gobGF5ZXIgPT4ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoc291cmNlID09PSBsYXllci5zb3VyY2UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuYW1lID0gbGF5ZXJbXCJzb3VyY2UtbGF5ZXJcIl07XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoISAobmFtZSBpbiBsYXllcnMpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGF5ZXJzW25hbWVdID0gW107IFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgbGF5ZXJzW25hbWVdLnB1c2gobGF5ZXIuaWQpXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgIGZvciAobGV0IG5hbWUgaW4gbGF5ZXJzKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBsaSA9IHRoaXMuX2FkZExheWVyKHNvdXJjZSwgbmFtZSwgbGF5ZXJzW25hbWVdKTtcbiAgICAgICAgICAgICAgICAgICAgdWwuYXBwZW5kKGxpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgX2FkZFNvdWNlKHNvdXJjZSkge1xuICAgICAgICBsZXQgbGkgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdsaScpO1xuICAgICAgICBsaS5jbGFzc05hbWUgPSAnbGF5ZXItc3dpdGNoZXItc291cmNlJztcblxuICAgICAgICBsZXQgY2IgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdpbnB1dCcpO1xuICAgICAgICBjYi50eXBlICAgICAgICAgICAgID0gJ2NoZWNrYm94JztcbiAgICAgICAgY2IuY2xhc3NOYW1lICAgICAgICA9ICdzb3VyY2UnO1xuICAgICAgICBjYi5pZCAgICAgICAgICAgICAgID0gc291cmNlO1xuICAgICAgICBjYi5kYXRhc2V0LnNvdXJjZSAgID0gc291cmNlO1xuICAgICAgICBjYi5jaGVja2VkICAgICAgICAgID0gdHJ1ZTtcbiAgICAgICAgXG4gICAgICAgIC8qIENvY2hlL2RlY29jaGUgdW5lIHNvdXJjZSAqL1xuICAgICAgICBjYi5hZGRFdmVudExpc3RlbmVyKCdjaGFuZ2UnLCAoZXZlbnQpID0+IHtcbiAgICAgICAgICAgIGxldCB0YXJnZXQgID0gZXZlbnQuY3VycmVudFRhcmdldDtcbiAgICAgICAgICAgIGxldCBjaGVja2VkID0gdGFyZ2V0LmNoZWNrZWQ7XG4gICAgICAgICAgICBsZXQgc291cmNlICA9IHRhcmdldC5kYXRhc2V0LnNvdXJjZTtcblxuICAgICAgICAgICAgbGV0IHBhcmVudCA9IHRhcmdldC5wYXJlbnROb2RlO1xuICAgICAgICAgICAgY29uc3QgZWxlbWVudHMgPSBwYXJlbnQucXVlcnlTZWxlY3RvckFsbChgaW5wdXQubGF5ZXJbZGF0YS1zb3VyY2U9XCIke3NvdXJjZX1cIl1gKTtcblxuICAgICAgICAgICAgZWxlbWVudHMuZm9yRWFjaChlbGVtZW50ID0+IHtcbiAgICAgICAgICAgICAgICBsZXQgdmlzaWJsZSA9IGNoZWNrZWQgPyAndmlzaWJsZScgOiAnbm9uZSc7XG4gICAgICAgICAgICAgICAgZWxlbWVudC5jaGVja2VkID0gY2hlY2tlZDtcbiAgICAgICAgICAgICAgICBsZXQgbGF5ZXJJZHMgPSBlbGVtZW50LmRhdGFzZXQuaWRzLnNwbGl0KCcsJyk7XG4gICAgICAgICAgICAgICAgbGF5ZXJJZHMuZm9yRWFjaChsYXllcklkID0+IHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fbWFwLnNldExheW91dFByb3BlcnR5KGxheWVySWQsICd2aXNpYmlsaXR5JywgdmlzaWJsZSk7XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIH0pXG4gICAgICAgIH0pXG5cbiAgICAgICAgbGV0IGxhYmVsID0gdGhpcy5fYWRkTGFiZWwoc291cmNlKTtcblxuICAgICAgICBsaS5hcHBlbmQoY2IpO1xuICAgICAgICBsaS5hcHBlbmQobGFiZWwpO1xuICAgICAgICByZXR1cm4gbGk7ICBcbiAgICB9XG5cbiAgICBfYWRkTGF5ZXIoc291cmNlLCBsYXllciwgaWRzKSB7XG4gICAgICAgIGxldCBsaSA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2xpJyk7XG5cbiAgICAgICAgbGV0IGNiID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnaW5wdXQnKTtcbiAgICAgICAgY2IudHlwZSAgICAgICAgICAgICA9ICdjaGVja2JveCc7XG4gICAgICAgIGNiLmNsYXNzTmFtZSAgICAgICAgPSAnbGF5ZXInO1xuICAgICAgICBjYi5pZCAgICAgICAgICAgICAgID0gbGF5ZXI7XG4gICAgICAgIGNiLmRhdGFzZXQuc291cmNlICAgPSBzb3VyY2U7XG4gICAgICAgIGNiLmRhdGFzZXQubGF5ZXIgICAgPSBsYXllcjtcbiAgICAgICAgY2IuZGF0YXNldC5pZHMgICAgICA9IGlkcy5qb2luKCcsJyk7XG4gICAgICAgIGNiLmNoZWNrZWQgPSB0cnVlO1xuICAgICAgICBcbiAgICAgICAgLyogQ29jaGUvZGVjb2NoZSB1biBsYXllciAqL1xuICAgICAgICBjYi5hZGRFdmVudExpc3RlbmVyKCdjaGFuZ2UnLCAoZXZlbnQpID0+IHtcbiAgICAgICAgICAgIGxldCB0YXJnZXQgID0gZXZlbnQuY3VycmVudFRhcmdldDtcbiAgICAgICAgICAgIFxuICAgICAgICAgICAgbGV0IGNoZWNrZWQgPSB0YXJnZXQuY2hlY2tlZDtcbiAgICAgICAgICAgIGxldCB2aXNpYmxlID0gY2hlY2tlZCA/ICd2aXNpYmxlJyA6ICdub25lJztcblxuICAgICAgICAgICAgLy8gTWlzZSBhIGpvdXIgZGUgdG91cyBsZXMgc3R5bGVzIGRlIG1lbWUgc291cmNlLWxheWVyXG4gICAgICAgICAgICBsZXQgbGF5ZXJJZHMgPSB0YXJnZXQuZGF0YXNldC5pZHMuc3BsaXQoJywnKTtcbiAgICAgICAgICAgIGxheWVySWRzLmZvckVhY2gobGF5ZXJJZCA9PiB7XG4gICAgICAgICAgICAgICAgdGhpcy5fbWFwLnNldExheW91dFByb3BlcnR5KGxheWVySWQsICd2aXNpYmlsaXR5JywgdmlzaWJsZSk7XG4gICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICAvLyBNaXNlIGEgam91ciAoY2hlY2tlZCkgZGUgbGEgY2hlY2tib3ggZGUgbGEgc291cmNlXG4gICAgICAgICAgICBsZXQgc291cmNlID0gdGFyZ2V0LmRhdGFzZXQuc291cmNlO1xuICAgICAgICAgICAgbGV0IGNiU291cmNlID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcihgaW5wdXQuc291cmNlW2RhdGEtc291cmNlPVwiJHtzb3VyY2V9XCJdYClcblxuICAgICAgICAgICAgbGV0IHVsTGF5ZXJzID0gdGFyZ2V0LnBhcmVudE5vZGUucGFyZW50Tm9kZTtcbiAgICAgICAgICAgIGxldCBlbGVtZW50cyA9IHVsTGF5ZXJzLnF1ZXJ5U2VsZWN0b3JBbGwoJ2lucHV0LmxheWVyJyk7XG4gICAgICAgICAgICBsZXQgbnVtID0gZWxlbWVudHMubGVuZ3RoO1xuXG4gICAgICAgICAgICBsZXQgY2hlY2tTdGF0ZXMgPSB7IGNoZWNrZWQ6IDAsIHVuY2hlY2tlZDogMCB9O1xuICAgICAgICAgICAgZWxlbWVudHMuZm9yRWFjaChlbGVtZW50ID0+IHtcbiAgICAgICAgICAgICAgICBlbGVtZW50LmNoZWNrZWQgPyBjaGVja1N0YXRlcy5jaGVja2VkKysgOiBjaGVja1N0YXRlcy51bmNoZWNrZWQrKztcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICBpZiAobnVtID09PSBjaGVja1N0YXRlcy5jaGVja2VkKSB7XG4gICAgICAgICAgICAgICAgY2JTb3VyY2UuY2hlY2tlZCA9IHRydWU7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG51bSA9PT0gY2hlY2tTdGF0ZXMudW5jaGVja2VkKSB7XG4gICAgICAgICAgICAgICAgY2JTb3VyY2UuY2hlY2tlZCA9IGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KVxuXG4gICAgICAgIGxldCBsYWJlbCA9IHRoaXMuX2FkZExhYmVsKGxheWVyKTtcbiAgICAgICAgXG4gICAgICAgIGxpLmFwcGVuZChjYik7XG4gICAgICAgIGxpLmFwcGVuZChsYWJlbCk7XG4gICAgICAgIHJldHVybiBsaTsgICAgICBcbiAgICB9XG5cbiAgICBfYWRkTGFiZWwoaWQpIHtcbiAgICAgICAgbGV0IGxhYmVsID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnbGFiZWwnKTtcbiAgICAgICAgbGFiZWwuaHRtbEZvciA9IGlkO1xuXG4gICAgICAgIGxldCBzcGFuID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnc3BhbicpO1xuICAgICAgICBzcGFuLmlubmVySFRNTCA9IGlkO1xuICAgICAgICBsYWJlbC5hcHBlbmQoc3Bhbik7XG4gICAgICAgIHJldHVybiBsYWJlbDsgICAgXG4gICAgfVxufSJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./assets/js/components/maplibre/layer-switcher-control.js\n")},"./assets/js/components/maplibre/maplibre-ext.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ "MapLibreExt": () => (/* binding */ MapLibreExt)\n/* harmony export */ });\n/* harmony import */ var maplibre_gl_dist_maplibre_gl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! maplibre-gl/dist/maplibre-gl */ "./node_modules/maplibre-gl/dist/maplibre-gl.js");\n/* harmony import */ var maplibre_gl_dist_maplibre_gl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(maplibre_gl_dist_maplibre_gl__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var maplibre_gl_dist_maplibre_gl_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! maplibre-gl/dist/maplibre-gl.css */ "./node_modules/maplibre-gl/dist/maplibre-gl.css");\n/* harmony import */ var _maplibre_maplibre_gl_geocoder__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @maplibre/maplibre-gl-geocoder */ "./node_modules/@maplibre/maplibre-gl-geocoder/lib/index.js");\n/* harmony import */ var _maplibre_maplibre_gl_geocoder__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_maplibre_maplibre_gl_geocoder__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _maplibre_maplibre_gl_geocoder_dist_maplibre_gl_geocoder_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @maplibre/maplibre-gl-geocoder/dist/maplibre-gl-geocoder.css */ "./node_modules/@maplibre/maplibre-gl-geocoder/dist/maplibre-gl-geocoder.css");\n/* harmony import */ var _layer_switcher_control__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./layer-switcher-control */ "./assets/js/components/maplibre/layer-switcher-control.js");\n/* harmony import */ var _search__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./search */ "./assets/js/components/maplibre/search.js");\n/* harmony import */ var _defaults__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../defaults */ "./assets/js/components/defaults.js");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils */ "./assets/js/utils.js");\nfunction _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new 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 new 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 new 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(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _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(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\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(arr) { if (Array.isArray(arr)) return arr; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\n\n\n\n\nvar MapLibreExt = /*#__PURE__*/function (_Map) {\n _inherits(MapLibreExt, _Map);\n var _super = _createSuper(MapLibreExt);\n function MapLibreExt(container) {\n var _this;\n _classCallCheck(this, MapLibreExt);\n var options = Object.assign({\n container: container\n }, _defaults__WEBPACK_IMPORTED_MODULE_6__["default"]);\n options.zoom--; // ?????? Decalage avec les zooms d\'openlayers\n _this = _super.call(this, options);\n _this._wait = new _utils__WEBPACK_IMPORTED_MODULE_7__.Wait({\n id: container\n });\n _this.setStyle({\n version: 8,\n glyphs: \'https://fonts.openmaptiles.org/{fontstack}/{range}.pbf\',\n sources: {\n \'Plan IGN V2\': {\n type: \'raster\',\n tiles: [\'https://wxs.ign.fr/cartes/geoportail/wmts?SERVICE=WMTS&style=normal&VERSION=1.0.0&REQUEST=GetTile&format=image/png&layer=GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2&tilematrixset=PM&TileMatrix={z}&TileCol={x}&TileRow={y}\'],\n tileSize: 256,\n attribution: \'Orthophotos IGN\'\n }\n },\n layers: [{\n id: \'Plan IGN V2\',\n type: \'raster\',\n source: \'Plan IGN V2\',\n minzoom: 0,\n maxzoom: 22\n }]\n });\n\n // Ajout des controles\n _this.addControl(new maplibre_gl_dist_maplibre_gl__WEBPACK_IMPORTED_MODULE_0__.ScaleControl());\n _this.addControl(new (_maplibre_maplibre_gl_geocoder__WEBPACK_IMPORTED_MODULE_2___default())({\n forwardGeocode: _search__WEBPACK_IMPORTED_MODULE_5__["default"]\n }, {\n minLength: 3,\n showResultsWhileTyping: true,\n clearAndBlurOnEsc: true,\n clearOnBlur: true,\n marker: false,\n zoom: 14\n }), \'top-left\');\n _this.addControl(new maplibre_gl_dist_maplibre_gl__WEBPACK_IMPORTED_MODULE_0__.NavigationControl({\n visualizePitch: true\n }), \'top-left\');\n _this.on(\'load\', _this.onLoad);\n return _this;\n }\n _createClass(MapLibreExt, [{\n key: "onLoad",\n value: function onLoad() {\n var _this2 = this;\n this._wait.show("Chargement des tuiles vecteurs du PCI");\n this.addPCI().then(function (result) {\n for (var _i = 0, _Object$entries = Object.entries(result.sources); _i < _Object$entries.length; _i++) {\n var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),\n id = _Object$entries$_i[0],\n source = _Object$entries$_i[1];\n _this2.addSource(id, source);\n }\n\n // Ajout des styles\n result.layers.forEach(function (layer) {\n _this2.addLayer(layer);\n });\n _this2.on(\'mousemove\', function (e) {\n var features = _this2.queryRenderedFeatures(e.point);\n _this2.getCanvas().style.cursor = features.length ? \'pointer\' : \'\';\n });\n _this2.on(\'click\', _this2.onClick);\n _this2.addControl(new _layer_switcher_control__WEBPACK_IMPORTED_MODULE_4__.LayerSwitcherControl());\n _this2._wait.hide();\n })["catch"](function (err) {\n console.log(err.message);\n _this2._wait.hide();\n });\n }\n }, {\n key: "onClick",\n value: function onClick(e) {\n var _this3 = this;\n var features = this.queryRenderedFeatures(e.point);\n if (features.length === 1) {\n var form = this.createForm(this.getFingerprint(features[0]));\n new maplibre_gl_dist_maplibre_gl__WEBPACK_IMPORTED_MODULE_0__.Popup({\n maxWidth: \'none\'\n }).setLngLat(e.lngLat).setHTML(form.outerHTML).addTo(this);\n return;\n }\n var fingerprints = new _utils__WEBPACK_IMPORTED_MODULE_7__.SetExt();\n features.forEach(function (feature) {\n fingerprints.add(_this3.getFingerprint(feature));\n });\n var _iterator = _createForOfIteratorHelper(fingerprints),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var fp = _step.value;\n var _form = this.createForm(fp);\n new maplibre_gl_dist_maplibre_gl__WEBPACK_IMPORTED_MODULE_0__.Popup({\n maxWidth: \'none\'\n }).setLngLat(e.lngLat).setHTML(_form.outerHTML).addTo(this);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n\n /**\n * Ajout de la couche PCI\n * @returns \n */\n }, {\n key: "addPCI",\n value: function () {\n var _addPCI = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var response, style, result, _i2, _Object$entries2, _Object$entries2$_i, id, source;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return fetch(\'https://wxs.ign.fr/static/vectorTiles/styles/PCI/pci.json\');\n case 2:\n response = _context.sent;\n _context.next = 5;\n return response.json();\n case 5:\n style = _context.sent;\n result = {\n sources: {},\n layers: []\n };\n for (_i2 = 0, _Object$entries2 = Object.entries(style.sources); _i2 < _Object$entries2.length; _i2++) {\n _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2), id = _Object$entries2$_i[0], source = _Object$entries2$_i[1];\n source.scheme = \'xyz\';\n result.sources[id] = source;\n }\n style.layers.forEach(function (layer) {\n if (\'layout\' in layer && \'text-font\' in layer.layout) {\n layer.layout[\'text-font\'] = ["Open Sans Bold Italic"];\n }\n result.layers.push(layer);\n });\n return _context.abrupt("return", Promise.resolve(result));\n case 10:\n case "end":\n return _context.stop();\n }\n }, _callee);\n }));\n function addPCI() {\n return _addPCI.apply(this, arguments);\n }\n return addPCI;\n }()\n }, {\n key: "getFingerprint",\n value: function getFingerprint(feature) {\n return Object.assign({}, feature.properties, {\n source: feature.source,\n sourceLayer: feature.sourceLayer\n });\n }\n\n /**\n * Creation du formulaire d\'un feature\n * @param Object feature \n * @returns \n */\n }, {\n key: "createForm",\n value: function createForm(feature) {\n var unused = [\'source\', \'sourceLayer\'];\n var layer = feature.sourceLayer;\n var table = document.createElement(\'table\');\n var tbody = document.createElement(\'tbody\');\n table.append(tbody);\n var tr = document.createElement(\'tr\');\n var td = document.createElement(\'td\');\n td.className = "bg-primary text-center text-white";\n td.setAttribute(\'colspan\', 2);\n td.innerHTML = "
".concat(layer, "
");\n tr.append(td);\n tbody.append(tr);\n for (var _i3 = 0, _Object$entries3 = Object.entries(feature); _i3 < _Object$entries3.length; _i3++) {\n var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i3], 2),\n name = _Object$entries3$_i[0],\n value = _Object$entries3$_i[1];\n if (unused.includes(name)) {\n continue;\n }\n var _tr = document.createElement(\'tr\');\n var _td = document.createElement(\'td\');\n _td.innerHTML = "".concat(name, "");\n _tr.append(_td);\n _td = document.createElement(\'td\');\n _td.innerHTML = value;\n _tr.append(_td);\n tbody.append(_tr);\n }\n return table;\n }\n }]);\n return MapLibreExt;\n}(maplibre_gl_dist_maplibre_gl__WEBPACK_IMPORTED_MODULE_0__.Map);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9hc3NldHMvanMvY29tcG9uZW50cy9tYXBsaWJyZS9tYXBsaWJyZS1leHQuanMuanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7O0FBQ0E7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFEQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBR0E7QUFBQTtBQUFBO0FBQ0E7QUFBQTtBQUFBO0FBQ0E7QUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUVBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBR0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO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vcGVuZXJcIiBocmVmPVwiaHR0cDovL3d3dy5pZ24uZnJcIj5JR048L2E+J1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBsYXllcnM6IFt7XG4gICAgICAgICAgICAgICAgaWQ6ICdQbGFuIElHTiBWMicsXG4gICAgICAgICAgICAgICAgdHlwZTogJ3Jhc3RlcicsXG4gICAgICAgICAgICAgICAgc291cmNlOiAnUGxhbiBJR04gVjInLFxuICAgICAgICAgICAgICAgIG1pbnpvb206IDAsXG4gICAgICAgICAgICAgICAgbWF4em9vbTogMjJcbiAgICAgICAgICAgIH1dICAgIFxuICAgICAgICB9KTtcblxuICAgICAgICAvLyBBam91dCBkZXMgY29udHJvbGVzXG4gICAgICAgIHRoaXMuYWRkQ29udHJvbChuZXcgU2NhbGVDb250cm9sKCkpO1xuICAgICAgICB0aGlzLmFkZENvbnRyb2wobmV3IE1hcGxpYnJlR2VvY29kZXIoeyBmb3J3YXJkR2VvY29kZTogc2VhcmNoIH0sIHtcbiAgICAgICAgICAgIG1pbkxlbmd0aDogMyxcbiAgICAgICAgICAgIHNob3dSZXN1bHRzV2hpbGVUeXBpbmc6IHRydWUsXG4gICAgICAgICAgICBjbGVhckFuZEJsdXJPbkVzYzogdHJ1ZSxcbiAgICAgICAgICAgIGNsZWFyT25CbHVyOiB0cnVlLFxuICAgICAgICAgICAgbWFya2VyOiBmYWxzZSxcbiAgICAgICAgICAgIHpvb206IDE0XG4gICAgICAgIH0pLCAndG9wLWxlZnQnKTtcbiAgICAgICAgdGhpcy5hZGRDb250cm9sKG5ldyBOYXZpZ2F0aW9uQ29udHJvbCh7IHZpc3VhbGl6ZVBpdGNoOiB0cnVlIH0pLCAndG9wLWxlZnQnKTtcblxuICAgICAgICB0aGlzLm9uKCdsb2FkJywgdGhpcy5vbkxvYWQpO1xuICAgIH1cblxuICAgIG9uTG9hZCgpIHtcbiAgICAgICAgdGhpcy5fd2FpdC5zaG93KFwiQ2hhcmdlbWVudCBkZXMgdHVpbGVzIHZlY3RldXJzIGR1IFBDSVwiKTtcblxuICAgICAgICB0aGlzLmFkZFBDSSgpLnRoZW4ocmVzdWx0ID0+IHtcbiAgICAgICAgICAgIGZvciAoY29uc3QgW2lkLCBzb3VyY2VdIG9mIE9iamVjdC5lbnRyaWVzKHJlc3VsdC5zb3VyY2VzKSkge1xuICAgICAgICAgICAgICAgIHRoaXMuYWRkU291cmNlKGlkLCBzb3VyY2UpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgXG4gICAgICAgICAgICAvLyBBam91dCBkZXMgc3R5bGVzXG4gICAgICAgICAgICByZXN1bHQubGF5ZXJzLmZvckVhY2gobGF5ZXIgPT4ge1xuICAgICAgICAgICAgICAgIHRoaXMuYWRkTGF5ZXIobGF5ZXIpO1xuICAgICAgICAgICAgfSlcblxuICAgICAgICAgICAgdGhpcy5vbignbW91c2Vtb3ZlJywoZSkgPT4ge1xuICAgICAgICAgICAgICAgIGNvbnN0IGZlYXR1cmVzID0gdGhpcy5xdWVyeVJlbmRlcmVkRmVhdHVyZXMoZS5wb2ludCk7XG4gICAgICAgICAgICAgICAgdGhpcy5nZXRDYW52YXMoKS5zdHlsZS5jdXJzb3IgPSAoZmVhdHVyZXMubGVuZ3RoKSA/ICdwb2ludGVyJyA6ICcnO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB0aGlzLm9uKCdjbGljaycsIHRoaXMub25DbGljayk7XG5cbiAgICAgICAgICAgIHRoaXMuYWRkQ29udHJvbChuZXcgTGF5ZXJTd2l0Y2hlckNvbnRyb2woKSk7XG4gICAgICAgICAgICB0aGlzLl93YWl0LmhpZGUoKTtcbiAgICAgICAgfSkuY2F0Y2goZXJyID0+IHtcbiAgICAgICAgICAgIGNvbnNvbGUubG9nKGVyci5tZXNzYWdlKTtcbiAgICAgICAgICAgIHRoaXMuX3dhaXQuaGlkZSgpO1xuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBvbkNsaWNrKGUpIHtcbiAgICAgICAgY29uc3QgZmVhdHVyZXMgPSB0aGlzLnF1ZXJ5UmVuZGVyZWRGZWF0dXJlcyhlLnBvaW50KTtcbiAgICAgICAgaWYgKGZlYXR1cmVzLmxlbmd0aCA9PT0gMSkge1xuICAgICAgICAgICAgbGV0IGZvcm0gPSB0aGlzLmNyZWF0ZUZvcm0odGhpcy5nZXRGaW5nZXJwcmludChmZWF0dXJlc1swXSkpO1xuICAgICAgICAgICAgbmV3IFBvcHVwKHsgbWF4V2lkdGg6ICdub25lJyB9KVxuICAgICAgICAgICAgICAgIC5zZXRMbmdMYXQoZS5sbmdMYXQpXG4gICAgICAgICAgICAgICAgLnNldEhUTUwoZm9ybS5vdXRlckhUTUwpXG4gICAgICAgICAgICAgICAgLmFkZFRvKHRoaXMpOyBcbiAgICAgICAgICAgICAgICByZXR1cm47ICAgXG4gICAgICAgIH1cblxuICAgICAgICBsZXQgZmluZ2VycHJpbnRzID0gbmV3IFNldEV4dCgpO1xuICAgICAgICBmZWF0dXJlcy5mb3JFYWNoKGZlYXR1cmUgPT4ge1xuICAgICAgICAgICAgZmluZ2VycHJpbnRzLmFkZCh0aGlzLmdldEZpbmdlcnByaW50KGZlYXR1cmUpKTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgZm9yIChsZXQgZnAgb2YgZmluZ2VycHJpbnRzKSB7XG4gICAgICAgICAgICBsZXQgZm9ybSA9IHRoaXMuY3JlYXRlRm9ybShmcCk7XG4gICAgICAgICAgICBuZXcgUG9wdXAoeyBtYXhXaWR0aDogJ25vbmUnIH0pXG4gICAgICAgICAgICAgICAgLnNldExuZ0xhdChlLmxuZ0xhdClcbiAgICAgICAgICAgICAgICAuc2V0SFRNTChmb3JtLm91dGVySFRNTClcbiAgICAgICAgICAgICAgICAuYWRkVG8odGhpcyk7ICAgICAgIFxuICAgICAgICB9XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQWpvdXQgZGUgbGEgY291Y2hlIFBDSVxuICAgICAqIEByZXR1cm5zIFxuICAgICAqL1xuICAgIGFzeW5jIGFkZFBDSSgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgZmV0Y2goJ2h0dHBzOi8vd3hzLmlnbi5mci9zdGF0aWMvdmVjdG9yVGlsZXMvc3R5bGVzL1BDSS9wY2kuanNvbicpO1xuICAgICAgICBsZXQgc3R5bGUgPSBhd2FpdCByZXNwb25zZS5qc29uKCk7XG5cbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgc291cmNlczoge30sIGxheWVyczogW10gfTtcbiAgICAgICAgZm9yIChjb25zdCBbaWQsIHNvdXJjZV0gb2YgT2JqZWN0LmVudHJpZXMoc3R5bGUuc291cmNlcykpIHtcbiAgICAgICAgICAgIHNvdXJjZS5zY2hlbWUgPSAneHl6JztcbiAgICAgICAgICAgIHJlc3VsdC5zb3VyY2VzW2lkXSA9IHNvdXJjZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHN0eWxlLmxheWVycy5mb3JFYWNoKGxheWVyID0+IHtcbiAgICAgICAgICAgIGlmICgnbGF5b3V0JyBpbiBsYXllciAmJiAndGV4dC1mb250JyBpbiBsYXllci5sYXlvdXQpIHtcbiAgICAgICAgICAgICAgICBsYXllci5sYXlvdXRbJ3RleHQtZm9udCddID0gW1wiT3BlbiBTYW5zIEJvbGQgSXRhbGljXCJdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0LmxheWVycy5wdXNoKGxheWVyKTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZShyZXN1bHQpO1xuICAgIH1cblxuICAgIGdldEZpbmdlcnByaW50KGZlYXR1cmUpIHtcbiAgICAgICAgcmV0dXJuIE9iamVjdC5hc3NpZ24oe30sIGZlYXR1cmUucHJvcGVydGllcywgeyBcbiAgICAgICAgICAgIHNvdXJjZTogZmVhdHVyZS5zb3VyY2UsIFxuICAgICAgICAgICAgc291cmNlTGF5ZXI6IGZlYX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uICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBsZXQgdHIgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCd0cicpO1xuXG4gICAgICAgICAgICBsZXQgdGQgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCd0ZCcpO1xuICAgICAgICAgICAgdGQuaW5uZXJIVE1MID0gYDxzcGFuIGNsYXNzPVwiZm9udC13ZWlnaHQtYm9sZFwiPiR7bmFtZX08L3NwYW4+YDtcbiAgICAgICAgICAgIHRyLmFwcGVuZCh0ZCk7XG5cbiAgICAgICAgICAgIHRkID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgndGQnKTtcbiAgICAgICAgICAgIHRkLmlubmVySFRNTCA9IHZhbHVlO1xuICAgICAgICAgICAgdHIuYXBwZW5kKHRkKTtcblxuICAgICAgICAgICAgdGJvZHkuYXBwZW5kKHRyKTtcbiAgICAgICAgfVxuICAgICAgICBcbiAgICAgICAgcmV0dXJuIHRhYmxlO1xuICAgIH1cbn0iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./assets/js/components/maplibre/maplibre-ext.js\n')},"./assets/js/components/maplibre/search.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ "default": () => (/* binding */ search)\n/* harmony export */ });\nfunction _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new 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 new 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 new 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(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }\nvar baseurl = \'https://wxs.ign.fr/essentiels/ols/apis/completion\';\nfunction toCarmenGeoJson(datas) {\n var features = [];\n datas.forEach(function (data) {\n features.push({\n id: data.city,\n type: \'Feature\',\n properties: data,\n geometry: {\n type: \'Point\',\n coordinates: [data.x, data.y]\n },\n text: data.fulltext,\n place_name: data.fulltext,\n place_type: [data.kind],\n center: [data.x, data.y]\n });\n });\n return {\n features: features\n };\n}\n\n/**\n * Appel à l\'API d\'auto completion de l\'ign :\n * https://geoservices.ign.fr/documentation/services/api-et-services-ogc/autocompletion-rest)\n * @param {Object} config \n * @returns \n */\nfunction search(_x) {\n return _search.apply(this, arguments);\n}\nfunction _search() {\n _search = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(config) {\n var query, url, response;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n query = config.query;\n url = "".concat(baseurl, "?text=").concat(query, "&type=PositionOfInterest&maximumResponses=5");\n _context.prev = 2;\n _context.next = 5;\n return fetch(url);\n case 5:\n response = _context.sent;\n _context.next = 8;\n return response.json();\n case 8:\n response = _context.sent;\n return _context.abrupt("return", Promise.resolve(toCarmenGeoJson(response.results)));\n case 12:\n _context.prev = 12;\n _context.t0 = _context["catch"](2);\n console.log(_context.t0);\n case 15:\n case "end":\n return _context.stop();\n }\n }, _callee, null, [[2, 12]]);\n }));\n return _search.apply(this, arguments);\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9hc3NldHMvanMvY29tcG9uZW50cy9tYXBsaWJyZS9zZWFyY2guanMuanMiLCJtYXBwaW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gICBjb25zb2xlLmxvZyhlcnIpO1xuICAgIH1cbn0iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./assets/js/components/maplibre/search.js\n')},"./assets/js/map-maplibre.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _components_maplibre_maplibre_ext__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./components/maplibre/maplibre-ext */ \"./assets/js/components/maplibre/maplibre-ext.js\");\n\nvar map = new _components_maplibre_maplibre_ext__WEBPACK_IMPORTED_MODULE_0__.MapLibreExt('map-maplibre');//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9hc3NldHMvanMvbWFwLW1hcGxpYnJlLmpzLmpzIiwibWFwcGluZ3MiOiI7O0FBQUE7QUFFQSIsInNvdXJjZXMiOlsid2VicGFjazovL29wZW5sYXllcnMtdnMtbWFwbGlicmUvLi9hc3NldHMvanMvbWFwLW1hcGxpYnJlLmpzPzc1ZTYiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgTWFwTGlicmVFeHQgfSBmcm9tIFwiLi9jb21wb25lbnRzL21hcGxpYnJlL21hcGxpYnJlLWV4dFwiO1xuXG5jb25zdCBtYXAgPSBuZXcgTWFwTGlicmVFeHQoJ21hcC1tYXBsaWJyZScpOyJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./assets/js/map-maplibre.js\n")},"./assets/js/utils.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ "SetExt": () => (/* binding */ SetExt),\n/* harmony export */ "Wait": () => (/* binding */ Wait),\n/* harmony export */ "guid": () => (/* binding */ guid),\n/* harmony export */ "niceBytes": () => (/* binding */ niceBytes),\n/* harmony export */ "removeDiacritics": () => (/* binding */ removeDiacritics)\n/* harmony export */ });\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ "./node_modules/jquery/src/jquery.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 _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); } return self; }\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n/**\n * Returns unique identifier\n * @returns {String}\n */\nvar guid = function guid() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n }\n ;\n return s4() + s4() + \'-\' + s4() + \'-\' + s4() + \'-\' + s4() + \'-\' + s4() + s4() + s4();\n};\n\n/**\n * Convertit des octets en KB, MB ...\n * @param {integer} x \n * @returns \n */\nvar niceBytes = function niceBytes(x) {\n var units = [\'bytes\', \'KB\', \'MB\', \'GB\', \'TB\', \'PB\', \'EB\', \'ZB\', \'YB\'];\n var l = 0,\n n = parseInt(x, 10) || 0;\n while (n >= 1024 && ++l) {\n n = n / 1024;\n }\n return n.toFixed(n < 10 && l > 0 ? 2 : 0) + \' \' + units[l];\n};\n\n/**\n * Supprime les accents d\'une chaine de caracteres\n * œ => OE et æ => AE\n */\nvar removeDiacritics = function removeDiacritics(str) {\n function removeLigature(s) {\n return s.replace(/\\u0152/g, \'OE\').replace(/\\u0153/g, \'oe\').replace(/\\u00c6/g, \'AE\').replace(/\\u00e6/g, \'ae\');\n }\n if (!(typeof str === "string")) {\n return str;\n }\n var s = str.normalize(\'NFD\');\n s = removeLigature(s);\n return s.replace(/[\\u0300-\\u036f]/g, "");\n};\n\n/**\n * Extension de la classe Set pour filter les eventuels doublons\n * On considere l\'egalite de maniere superficielle (shallow equality)\n * A n\'utiliser que pour les set d\'objets\n */\nvar SetExt = /*#__PURE__*/function (_Set) {\n _inherits(SetExt, _Set);\n var _super = _createSuper(SetExt);\n function SetExt() {\n _classCallCheck(this, SetExt);\n return _super.apply(this, arguments);\n }\n _createClass(SetExt, [{\n key: "add",\n value: function add(o) {\n var _iterator = _createForOfIteratorHelper(this),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var i = _step.value;\n if (this.compare(o, i)) return this;\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n _get(_getPrototypeOf(SetExt.prototype), "add", this).call(this, o);\n return this;\n }\n }, {\n key: "compare",\n value: function compare(o, i) {\n var keys1 = Object.keys(o);\n var keys2 = Object.keys(i);\n if (keys1.length !== keys2.length) {\n return false;\n }\n for (var _i = 0, _keys = keys1; _i < _keys.length; _i++) {\n var key = _keys[_i];\n if (o[key] !== i[key]) {\n return false;\n }\n }\n return true;\n }\n }]);\n return SetExt;\n}( /*#__PURE__*/_wrapNativeSuper(Set));\n\n/**\n * Affichage d\'une patience sur la div dont l\'id est id. Si id n\'est pas defini => body\n * @param {string | undefined } id\n */\nvar Wait = /*#__PURE__*/function () {\n function Wait(options) {\n _classCallCheck(this, Wait);\n options = $.extend({\n id: \'body\'\n }, options);\n var uuid = guid();\n var template = "\\n
\\n
\\n
\\n
\\n
\\n
");\n var element = options.id !== \'body\' ? document.getElementById(options.id) : options.id;\n $(element).css(\'position\', \'relative\');\n var $template = $(template);\n $template.css({\n \'display\': \'none\',\n \'position\': \'absolute\',\n \'color\': \'white\',\n \'background-color\': \'rgba(0,0,0,0.5)\',\n \'z-index\': 1000,\n \'top\': 0,\n \'left\': 0,\n \'right\': 0,\n \'bottom\': 0\n });\n $(element).append($template);\n this.$div = $("div#wait-".concat(uuid));\n }\n _createClass(Wait, [{\n key: "show",\n value: function show(text) {\n this.$div.find(\'h6\').html(text);\n this.$div.css({\n \'display\': \'flex\',\n \'flex-direction\': \'column\',\n \'justify-content\': \'center\',\n \'align-items\': \'center\'\n });\n }\n }, {\n key: "hide",\n value: function hide() {\n this.$div.css({\n \'display\': \'none\',\n \'flex-direction\': \'\',\n \'justify-content\': \'\'\n });\n }\n }]);\n return Wait;\n}();//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9hc3NldHMvanMvdXRpbHMuanMuanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0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iBjbGFzcz1cInNwaW5uZXItYm9yZGVyXCIgcm9sZT1cInN0YXR1c1wiPlxuICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgIDxoNiBjbGFzcz1cImZvbnQtd2VpZ2h0LWJvbGRcIj48L2g2PlxuICAgICAgICAgICAgPC9kaXY+YDtcblxuICAgICAgICBsZXQgZWxlbWVudCA9IChvcHRpb25zLmlkICE9PSAnYm9keScpID8gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQob3B0aW9ucy5pZCkgOiBvcHRpb25zLmlkO1xuICAgICAgICAkKGVsZW1lbnQpLmNzcygncG9zaXRpb24nLCAncmVsYXRpdmUnKTtcblxuICAgICAgICBsZXQgJHRlbXBsYXRlID0gJCh0ZW1wbGF0ZSk7XG4gICAgICAgICR0ZW1wbGF0ZS5jc3MoeyBcbiAgICAgICAgICAgICdkaXNwbGF5JzogJ25vbmUnLCBcbiAgICAgICAgICAgICdwb3NpdGlvbic6ICdhYnNvbHV0ZScsIFxuICAgICAgICAgICAgJ2NvbG9yJzogJ3doaXRlJyxcbiAgICAgICAgICAgICdiYWNrZ3JvdW5kLWNvbG9yJzogJ3JnYmEoMCwwLDAsMC41KScsXG4gICAgICAgICAgICAnei1pbmRleCc6IDEwMDAsXG4gICAgICAgICAgICAndG9wJzogMCwgXG4gICAgICAgICAgICAnbGVmdCc6IDAsIFxuICAgICAgICAgICAgJ3JpZ2h0JzogMCwgXG4gICAgICAgICAgICAnYm90dG9tJzogMFxuICAgICAgICB9KTtcbiAgICAgICAgJChlbGVtZW50KS5hcHBlbmQoJHRlbXBsYXRlKTtcbiAgICAgICAgdGhpcy4kZGl2ID0gJChgZGl2I3dhaXQtJHt1dWlkfWApO1xuICAgIH1cbiAgXG4gICAgc2hvdyh0ZXh0KSB7XG4gICAgICAgIHRoaXMuJGRpdi5maW5kKCdoNicpLmh0bWwodGV4dCk7XG4gICAgICAgIHRoaXMuJGRpdi5jc3Moe1xuICAgICAgICAgICAgJ2Rpc3BsYXknOiAnZmxleCcsIFxuICAgICAgICAgICAgJ2ZsZXgtZGlyZWN0aW9uJzogJ2NvbHVtbicsIFxuICAgICAgICAgICAgJ2p1c3RpZnktY29udGVudCc6ICdjZW50ZXInLFxuICAgICAgICAgICAgJ2FsaWduLWl0ZW1zJzogJ2NlbnRlcidcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgaGlkZSgpIHtcbiAgICAgICAgdGhpcy4kZGl2LmNzcyh7XG4gICAgICAgICAgICAnZGlzcGxheSc6ICdub25lJywgXG4gICAgICAgICAgICAnZmxleC1kaXJlY3Rpb24nOiAnJywgXG4gICAgICAgICAgICAnanVzdGlmeS1jb250ZW50JzogJydcbiAgICAgICAgfSk7XG4gICAgfVxufSJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./assets/js/utils.js\n')},"./node_modules/events/events.js":module=>{"use strict";eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\nvar R = typeof Reflect === 'object' ? Reflect : null\nvar ReflectApply = R && typeof R.apply === 'function'\n ? R.apply\n : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n }\n\nvar ReflectOwnKeys\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target)\n .concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n}\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\nmodule.exports = EventEmitter;\nmodule.exports.once = once;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nfunction checkListener(listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n}\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function() {\n return defaultMaxListeners;\n },\n set: function(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function() {\n\n if (this._events === undefined ||\n this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n};\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n this._maxListeners = n;\n return this;\n};\n\nfunction _getMaxListeners(that) {\n if (that._maxListeners === undefined)\n return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return _getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n var doError = (type === 'error');\n\n var events = this._events;\n if (events !== undefined)\n doError = (doError && events.error === undefined);\n else if (!doError)\n return false;\n\n // If there is no 'error' event listener then throw.\n if (doError) {\n var er;\n if (args.length > 0)\n er = args[0];\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n }\n // At least give some kind of context to the user\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n\n if (handler === undefined)\n return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n for (var i = 0; i < len; ++i)\n ReflectApply(listeners[i], this, args);\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n checkListener(listener);\n\n events = target._events;\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type,\n listener.listener ? listener.listener : listener);\n\n // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n events = target._events;\n }\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] =\n prepend ? [listener, existing] : [existing, listener];\n // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n }\n\n // Check for listener leak\n m = _getMaxListeners(target);\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true;\n // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n var w = new Error('Possible EventEmitter memory leak detected. ' +\n existing.length + ' ' + String(type) + ' listeners ' +\n 'added. Use emitter.setMaxListeners() to ' +\n 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n };\n\nfunction onceWrapper() {\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n if (arguments.length === 0)\n return this.listener.call(this.target);\n return this.listener.apply(this.target, arguments);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n checkListener(listener);\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n function prependOnceListener(type, listener) {\n checkListener(listener);\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n checkListener(listener);\n\n events = this._events;\n if (events === undefined)\n return this;\n\n list = events[type];\n if (list === undefined)\n return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else {\n delete events[type];\n if (events.removeListener)\n this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (position === 0)\n list.shift();\n else {\n spliceOne(list, position);\n }\n\n if (list.length === 1)\n events[type] = list[0];\n\n if (events.removeListener !== undefined)\n this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n };\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners =\n function removeAllListeners(type) {\n var listeners, events, i;\n\n events = this._events;\n if (events === undefined)\n return this;\n\n // not listening for removeListener, no need to emit\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else\n delete events[type];\n }\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n };\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n\n if (events === undefined)\n return [];\n\n var evlistener = events[type];\n if (evlistener === undefined)\n return [];\n\n if (typeof evlistener === 'function')\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n return unwrap ?\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n for (var i = 0; i < n; ++i)\n copy[i] = arr[i];\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++)\n list[index] = list[index + 1];\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n return ret;\n}\n\nfunction once(emitter, name) {\n return new Promise(function (resolve, reject) {\n function errorListener(err) {\n emitter.removeListener(name, resolver);\n reject(err);\n }\n\n function resolver() {\n if (typeof emitter.removeListener === 'function') {\n emitter.removeListener('error', errorListener);\n }\n resolve([].slice.call(arguments));\n };\n\n eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });\n if (name !== 'error') {\n addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });\n }\n });\n}\n\nfunction addErrorHandlerIfEventEmitter(emitter, handler, flags) {\n if (typeof emitter.on === 'function') {\n eventTargetAgnosticAddListener(emitter, 'error', handler, flags);\n }\n}\n\nfunction eventTargetAgnosticAddListener(emitter, name, listener, flags) {\n if (typeof emitter.on === 'function') {\n if (flags.once) {\n emitter.once(name, listener);\n } else {\n emitter.on(name, listener);\n }\n } else if (typeof emitter.addEventListener === 'function') {\n // EventTarget does not have `error` event semantics like Node\n // EventEmitters, we do not listen for `error` events here.\n emitter.addEventListener(name, function wrapListener(arg) {\n // IE does not have builtin `{ once: true }` support so we\n // have to do it manually.\n if (flags.once) {\n emitter.removeEventListener(name, wrapListener);\n }\n listener(arg);\n });\n } else {\n throw new TypeError('The \"emitter\" argument must be of type EventEmitter. Received type ' + typeof emitter);\n }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvZXZlbnRzL2V2ZW50cy5qcy5qcyIsIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNB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OyBpID49IDA7IGktLSkge1xuICAgICAgICAgIGlmIChsaXN0W2ldID09PSBsaXN0ZW5lciB8fCBsaXN0W2ldLmxpc3RlbmVyID09PSBsaXN0ZW5lcikge1xuICAgICAgICAgICAgb3JpZ2luYWxMaXN0ZW5lciA9IGxpc3RbaV0ubGlzdGVuZXI7XG4gICAgICAgICAgICBwb3NpdGlvbiA9IGk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAocG9zaXRpb24gPCAwKVxuICAgICAgICAgIHJldHVybiB0aGlzO1xuXG4gICAgICAgIGlmIChwb3NpdGlvbiA9PT0gMClcbiAgICAgICAgICBsaXN0LnNoaWZ0KCk7XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgIHNwbGljZU9uZShsaXN0LCBwb3NpdGlvbik7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAobGlzdC5sZW5ndGggPT09IDEpXG4gICAgICAgICAgZXZlbnRzW3R5cGVdID0gbGlzdFswXTtcblxuICAgICAgICBpZiAoZXZlbnRzLnJlbW92ZUxpc3RlbmVyICE9PSB1bmRlZmluZWQpXG4gICAgICAgICAgdGhpcy5lbWl0KCdyZW1vdmVMaXN0ZW5lcicsIHR5cGUsIG9yaWdpbmFsTGlzdGVuZXIgfHwgbGlzdGVuZXIpO1xuICAgICAgfVxuXG4gICAgICByZXR1cm4gdGhpcztcbiAgICB9O1xuXG5FdmVudEVtaXR0ZXIucHJvdG90eXBlLm9mZiA9IEV2ZW50RW1pdHRlci5wcm90b3R5cGUucmVtb3ZlTGlzdGVuZXI7XG5cbkV2ZW50RW1pdHRlci5wcm90b3R5cGUucmVtb3ZlQWxsTGlzdGVuZXJzID1cbiAgICBmdW5jdGlvbiByZW1vdmVBbGxMaXN0ZW5lcnModHlwZSkge1xuICAgICAgdmFyIGxpc3RlbmVycywgZXZlbnRzLCBpO1xuXG4gICAgICBldmVudHMgPSB0aGlzLl9ldmVudHM7XG4gICAgICBpZiAoZXZlbnRzID09PSB1bmRlZmluZWQpXG4gICAgICAgIHJldHVybiB0aGlzO1xuXG4gICAgICAvLyBub3QgbGlzdGVuaW5nIGZvciByZW1vdmVMaXN0ZW5lciwgbm8gbmVlZCB0byBlbWl0XG4gICAgICBpZiAoZXZlbnRzLnJlbW92ZUxpc3RlbmVyID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgaWYgKGFyZ3VtZW50cy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICB0aGlzLl9ldmVudHMgPSBPYmplY3QuY3JlYXRlKG51bGwpO1xuICAgICAgICAgIHRoaXMuX2V2ZW50c0NvdW50ID0gMDtcbiAgICAgICAgfSBlbHNlIGlmIChldmVudHNbdHlwZV0gIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgIGlmICgtLXRoaXMuX2V2ZW50c0NvdW50ID09PSAwKVxuICAgICAgICAgICAgdGhpcy5fZXZlbnRzID0gT2JqZWN0LmNyZWF0ZShudWxsKTtcbiAgICAgICAgICBlbHNlXG4gICAgICAgICAgICBkZWxldGUgZXZlbnRzW3R5cGVdO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgfVxuXG4gICAgICAvLyBlbWl0IHJlbW92ZUxpc3RlbmVyIGZvciBhbGwgbGlzdGVuZXJzIG9uIGFsbCBldmVudHNcbiAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoID09PSAwKSB7XG4gICAgICAgIHZhciBrZXlzID0gT2JqZWN0LmtleXMoZXZlbnRzKTtcbiAgICAgICAgdmFyIGtleTtcbiAgICAgICAgZm9yIChpID0gMDsgaSA8IGtleXMubGVuZ3RoOyArK2kpIHtcbiAgICAgICAgICBrZXkgPSBrZXlzW2ldO1xuICAgICAgICAgIGlmIChrZXkgPT09ICdyZW1vdmVMaXN0ZW5lcicpIGNvbnRpbnVlO1xuICAgICAgICAgIHRoaXMucmVtb3ZlQWxsTGlzdGVuZXJzKGtleSk7XG4gICAgICAgIH1c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UpIHtcbiAgICAgIGVtaXR0ZXIub25jZShuYW1lLCBsaXN0ZW5lcik7XG4gICAgfSBlbHNlIHtcbiAgICAgIGVtaXR0ZXIub24obmFtZSwgbGlzdGVuZXIpO1xuICAgIH1cbiAgfSBlbHNlIGlmICh0eXBlb2YgZW1pdHRlci5hZGRFdmVudExpc3RlbmVyID09PSAnZnVuY3Rpb24nKSB7XG4gICAgLy8gRXZlbnRUYXJnZXQgZG9lcyBub3QgaGF2ZSBgZXJyb3JgIGV2ZW50IHNlbWFudGljcyBsaWtlIE5vZGVcbiAgICAvLyBFdmVudEVtaXR0ZXJzLCB3ZSBkbyBub3QgbGlzdGVuIGZvciBgZXJyb3JgIGV2ZW50cyBoZXJlLlxuICAgIGVtaXR0ZXIuYWRkRXZlbnRMaXN0ZW5lcihuYW1lLCBmdW5jdGlvbiB3cmFwTGlzdGVuZXIoYXJnKSB7XG4gICAgICAvLyBJRSBkb2VzIG5vdCBoYXZlIGJ1aWx0aW4gYHsgb25jZTogdHJ1ZSB9YCBzdXBwb3J0IHNvIHdlXG4gICAgICAvLyBoYXZlIHRvIGRvIGl0IG1hbnVhbGx5LlxuICAgICAgaWYgKGZsYWdzLm9uY2UpIHtcbiAgICAgICAgZW1pdHRlci5yZW1vdmVFdmVudExpc3RlbmVyKG5hbWUsIHdyYXBMaXN0ZW5lcik7XG4gICAgICB9XG4gICAgICBsaXN0ZW5lcihhcmcpO1xuICAgIH0pO1xuICB9IGVsc2Uge1xuICAgIHRocm93IG5ldyBUeXBlRXJyb3IoJ1RoZSBcImVtaXR0ZXJcIiBhcmd1bWVudCBtdXN0IGJlIG9mIHR5cGUgRXZlbnRFbWl0dGVyLiBSZWNlaXZlZCB0eXBlICcgKyB0eXBlb2YgZW1pdHRlcik7XG4gIH1cbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/events/events.js\n")},"./node_modules/fuzzy/lib/fuzzy.js":module=>{eval("/*\n * Fuzzy\n * https://github.com/myork/fuzzy\n *\n * Copyright (c) 2012 Matt York\n * Licensed under the MIT license.\n */\n\n(function() {\n\nvar root = this;\n\nvar fuzzy = {};\n\n// Use in node or in browser\nif (true) {\n module.exports = fuzzy;\n} else {}\n\n// Return all elements of `array` that have a fuzzy\n// match against `pattern`.\nfuzzy.simpleFilter = function(pattern, array) {\n return array.filter(function(str) {\n return fuzzy.test(pattern, str);\n });\n};\n\n// Does `pattern` fuzzy match `str`?\nfuzzy.test = function(pattern, str) {\n return fuzzy.match(pattern, str) !== null;\n};\n\n// If `pattern` matches `str`, wrap each matching character\n// in `opts.pre` and `opts.post`. If no match, return null\nfuzzy.match = function(pattern, str, opts) {\n opts = opts || {};\n var patternIdx = 0\n , result = []\n , len = str.length\n , totalScore = 0\n , currScore = 0\n // prefix\n , pre = opts.pre || ''\n // suffix\n , post = opts.post || ''\n // String to compare against. This might be a lowercase version of the\n // raw string\n , compareString = opts.caseSensitive && str || str.toLowerCase()\n , ch;\n\n pattern = opts.caseSensitive && pattern || pattern.toLowerCase();\n\n // For each character in the string, either add it to the result\n // or wrap in template if it's the next string in the pattern\n for(var idx = 0; idx < len; idx++) {\n ch = str[idx];\n if(compareString[idx] === pattern[patternIdx]) {\n ch = pre + ch + post;\n patternIdx += 1;\n\n // consecutive characters should increase the score more than linearly\n currScore += 1 + currScore;\n } else {\n currScore = 0;\n }\n totalScore += currScore;\n result[result.length] = ch;\n }\n\n // return rendered string if we have a match for every char\n if(patternIdx === pattern.length) {\n // if the string is an exact match with pattern, totalScore should be maxed\n totalScore = (compareString === pattern) ? Infinity : totalScore;\n return {rendered: result.join(''), score: totalScore};\n }\n\n return null;\n};\n\n// The normal entry point. Filters `arr` for matches against `pattern`.\n// It returns an array with matching values of the type:\n//\n// [{\n// string: 'lah' // The rendered string\n// , index: 2 // The index of the element in `arr`\n// , original: 'blah' // The original element in `arr`\n// }]\n//\n// `opts` is an optional argument bag. Details:\n//\n// opts = {\n// // string to put before a matching character\n// pre: ''\n//\n// // string to put after matching character\n// , post: ''\n//\n// // Optional function. Input is an entry in the given arr`,\n// // output should be the string to test `pattern` against.\n// // In this example, if `arr = [{crying: 'koala'}]` we would return\n// // 'koala'.\n// , extract: function(arg) { return arg.crying; }\n// }\nfuzzy.filter = function(pattern, arr, opts) {\n if(!arr || arr.length === 0) {\n return [];\n }\n if (typeof pattern !== 'string') {\n return arr;\n }\n opts = opts || {};\n return arr\n .reduce(function(prev, element, idx, arr) {\n var str = element;\n if(opts.extract) {\n str = opts.extract(element);\n }\n var rendered = fuzzy.match(pattern, str, opts);\n if(rendered != null) {\n prev[prev.length] = {\n string: rendered.rendered\n , score: rendered.score\n , index: idx\n , original: element\n };\n }\n return prev;\n }, [])\n\n // Sort by score. Browsers are inconsistent wrt stable/unstable\n // sorting, so force stable by using the index in the case of tie.\n // See http://ofb.net/~sethml/is-sort-stable.html\n .sort(function(a,b) {\n var compare = b.score - a.score;\n if(compare) return compare;\n return a.index - b.index;\n });\n};\n\n\n}());\n\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvZnV6enkvbGliL2Z1enp5LmpzLmpzIiwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUdBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0F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kZXJlZCA9IGZ1enp5Lm1hdGNoKHBhdHRlcm4sIHN0ciwgb3B0cyk7XG4gICAgICBpZihyZW5kZXJlZCAhPSBudWxsKSB7XG4gICAgICAgIHByZXZbcHJldi5sZW5ndGhdID0ge1xuICAgICAgICAgICAgc3RyaW5nOiByZW5kZXJlZC5yZW5kZXJlZFxuICAgICAgICAgICwgc2NvcmU6IHJlbmRlcmVkLnNjb3JlXG4gICAgICAgICAgLCBpbmRleDogaWR4XG4gICAgICAgICAgLCBvcmlnaW5hbDogZWxlbWVudFxuICAgICAgICB9O1xuICAgICAgfVxuICAgICAgcmV0dXJuIHByZXY7XG4gICAgfSwgW10pXG5cbiAgICAvLyBTb3J0IGJ5IHNjb3JlLiBCcm93c2VycyBhcmUgaW5jb25zaXN0ZW50IHdydCBzdGFibGUvdW5zdGFibGVcbiAgICAvLyBzb3J0aW5nLCBzbyBmb3JjZSBzdGFibGUgYnkgdXNpbmcgdGhlIGluZGV4IGluIHRoZSBjYXNlIG9mIHRpZS5cbiAgICAvLyBTZWUgaHR0cDovL29mYi5uZXQvfnNldGhtbC9pcy1zb3J0LXN0YWJsZS5odG1sXG4gICAgLnNvcnQoZnVuY3Rpb24oYSxiKSB7XG4gICAgICB2YXIgY29tcGFyZSA9IGIuc2NvcmUgLSBhLnNjb3JlO1xuICAgICAgaWYoY29tcGFyZSkgcmV0dXJuIGNvbXBhcmU7XG4gICAgICByZXR1cm4gYS5pbmRleCAtIGIuaW5kZXg7XG4gICAgfSk7XG59O1xuXG5cbn0oKSk7XG5cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/fuzzy/lib/fuzzy.js\n")},"./node_modules/jquery/external/sizzle/dist/sizzle.js":(module,exports,__webpack_require__)=>{eval('var __WEBPACK_AMD_DEFINE_RESULT__;/*!\n * Sizzle CSS Selector Engine v2.3.9\n * https://sizzlejs.com/\n *\n * Copyright JS Foundation and other contributors\n * Released under the MIT license\n * https://js.foundation/\n *\n * Date: 2022-12-19\n */\n( function( window ) {\nvar i,\n\tsupport,\n\tExpr,\n\tgetText,\n\tisXML,\n\ttokenize,\n\tcompile,\n\tselect,\n\toutermostContext,\n\tsortInput,\n\thasDuplicate,\n\n\t// Local document vars\n\tsetDocument,\n\tdocument,\n\tdocElem,\n\tdocumentIsHTML,\n\trbuggyQSA,\n\trbuggyMatches,\n\tmatches,\n\tcontains,\n\n\t// Instance-specific data\n\texpando = "sizzle" + 1 * new Date(),\n\tpreferredDoc = window.document,\n\tdirruns = 0,\n\tdone = 0,\n\tclassCache = createCache(),\n\ttokenCache = createCache(),\n\tcompilerCache = createCache(),\n\tnonnativeSelectorCache = createCache(),\n\tsortOrder = function( a, b ) {\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t}\n\t\treturn 0;\n\t},\n\n\t// Instance methods\n\thasOwn = ( {} ).hasOwnProperty,\n\tarr = [],\n\tpop = arr.pop,\n\tpushNative = arr.push,\n\tpush = arr.push,\n\tslice = arr.slice,\n\n\t// Use a stripped-down indexOf as it\'s faster than native\n\t// https://jsperf.com/thor-indexof-vs-for/5\n\tindexOf = function( list, elem ) {\n\t\tvar i = 0,\n\t\t\tlen = list.length;\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( list[ i ] === elem ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t},\n\n\tbooleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" +\n\t\t"ismap|loop|multiple|open|readonly|required|scoped",\n\n\t// Regular expressions\n\n\t// http://www.w3.org/TR/css3-selectors/#whitespace\n\twhitespace = "[\\\\x20\\\\t\\\\r\\\\n\\\\f]",\n\n\t// https://www.w3.org/TR/css-syntax-3/#ident-token-diagram\n\tidentifier = "(?:\\\\\\\\[\\\\da-fA-F]{1,6}" + whitespace +\n\t\t"?|\\\\\\\\[^\\\\r\\\\n\\\\f]|[\\\\w-]|[^\\0-\\\\x7f])+",\n\n\t// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors\n\tattributes = "\\\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +\n\n\t\t// Operator (capture 2)\n\t\t"*([*^$|!~]?=)" + whitespace +\n\n\t\t// "Attribute values must be CSS identifiers [capture 5]\n\t\t// or strings [capture 3 or capture 4]"\n\t\t"*(?:\'((?:\\\\\\\\.|[^\\\\\\\\\'])*)\'|\\"((?:\\\\\\\\.|[^\\\\\\\\\\"])*)\\"|(" + identifier + "))|)" +\n\t\twhitespace + "*\\\\]",\n\n\tpseudos = ":(" + identifier + ")(?:\\\\((" +\n\n\t\t// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:\n\t\t// 1. quoted (capture 3; capture 4 or capture 5)\n\t\t"(\'((?:\\\\\\\\.|[^\\\\\\\\\'])*)\'|\\"((?:\\\\\\\\.|[^\\\\\\\\\\"])*)\\")|" +\n\n\t\t// 2. simple (capture 6)\n\t\t"((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|" + attributes + ")*)|" +\n\n\t\t// 3. anything else (capture 2)\n\t\t".*" +\n\t\t")\\\\)|)",\n\n\t// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\n\trwhitespace = new RegExp( whitespace + "+", "g" ),\n\trtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)" +\n\t\twhitespace + "+$", "g" ),\n\n\trcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),\n\trcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace +\n\t\t"*" ),\n\trdescend = new RegExp( whitespace + "|>" ),\n\n\trpseudo = new RegExp( pseudos ),\n\tridentifier = new RegExp( "^" + identifier + "$" ),\n\n\tmatchExpr = {\n\t\t"ID": new RegExp( "^#(" + identifier + ")" ),\n\t\t"CLASS": new RegExp( "^\\\\.(" + identifier + ")" ),\n\t\t"TAG": new RegExp( "^(" + identifier + "|[*])" ),\n\t\t"ATTR": new RegExp( "^" + attributes ),\n\t\t"PSEUDO": new RegExp( "^" + pseudos ),\n\t\t"CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(" +\n\t\t\twhitespace + "*(even|odd|(([+-]|)(\\\\d*)n|)" + whitespace + "*(?:([+-]|)" +\n\t\t\twhitespace + "*(\\\\d+)|))" + whitespace + "*\\\\)|)", "i" ),\n\t\t"bool": new RegExp( "^(?:" + booleans + ")$", "i" ),\n\n\t\t// For use in libraries implementing .is()\n\t\t// We use this for POS matching in `select`\n\t\t"needsContext": new RegExp( "^" + whitespace +\n\t\t\t"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(" + whitespace +\n\t\t\t"*((?:-\\\\d)?\\\\d*)" + whitespace + "*\\\\)|)(?=[^-]|$)", "i" )\n\t},\n\n\trhtml = /HTML$/i,\n\trinputs = /^(?:input|select|textarea|button)$/i,\n\trheader = /^h\\d$/i,\n\n\trnative = /^[^{]+\\{\\s*\\[native \\w/,\n\n\t// Easily-parseable/retrievable ID or TAG or CLASS selectors\n\trquickExpr = /^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,\n\n\trsibling = /[+~]/,\n\n\t// CSS escapes\n\t// http://www.w3.org/TR/CSS21/syndata.html#escaped-characters\n\trunescape = new RegExp( "\\\\\\\\[\\\\da-fA-F]{1,6}" + whitespace + "?|\\\\\\\\([^\\\\r\\\\n\\\\f])", "g" ),\n\tfunescape = function( escape, nonHex ) {\n\t\tvar high = "0x" + escape.slice( 1 ) - 0x10000;\n\n\t\treturn nonHex ?\n\n\t\t\t// Strip the backslash prefix from a non-hex escape sequence\n\t\t\tnonHex :\n\n\t\t\t// Replace a hexadecimal escape sequence with the encoded Unicode code point\n\t\t\t// Support: IE <=11+\n\t\t\t// For values outside the Basic Multilingual Plane (BMP), manually construct a\n\t\t\t// surrogate pair\n\t\t\thigh < 0 ?\n\t\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n\t},\n\n\t// CSS string/identifier serialization\n\t// https://drafts.csswg.org/cssom/#common-serializing-idioms\n\trcssescape = /([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\0-\\x1f\\x7f-\\uFFFF\\w-]/g,\n\tfcssescape = function( ch, asCodePoint ) {\n\t\tif ( asCodePoint ) {\n\n\t\t\t// U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER\n\t\t\tif ( ch === "\\0" ) {\n\t\t\t\treturn "\\uFFFD";\n\t\t\t}\n\n\t\t\t// Control characters and (dependent upon position) numbers get escaped as code points\n\t\t\treturn ch.slice( 0, -1 ) + "\\\\" +\n\t\t\t\tch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";\n\t\t}\n\n\t\t// Other potentially-special ASCII characters get backslash-escaped\n\t\treturn "\\\\" + ch;\n\t},\n\n\t// Used for iframes\n\t// See setDocument()\n\t// Removing the function wrapper causes a "Permission Denied"\n\t// error in IE\n\tunloadHandler = function() {\n\t\tsetDocument();\n\t},\n\n\tinDisabledFieldset = addCombinator(\n\t\tfunction( elem ) {\n\t\t\treturn elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";\n\t\t},\n\t\t{ dir: "parentNode", next: "legend" }\n\t);\n\n// Optimize for push.apply( _, NodeList )\ntry {\n\tpush.apply(\n\t\t( arr = slice.call( preferredDoc.childNodes ) ),\n\t\tpreferredDoc.childNodes\n\t);\n\n\t// Support: Android<4.0\n\t// Detect silently failing push.apply\n\t// eslint-disable-next-line no-unused-expressions\n\tarr[ preferredDoc.childNodes.length ].nodeType;\n} catch ( e ) {\n\tpush = { apply: arr.length ?\n\n\t\t// Leverage slice if possible\n\t\tfunction( target, els ) {\n\t\t\tpushNative.apply( target, slice.call( els ) );\n\t\t} :\n\n\t\t// Support: IE<9\n\t\t// Otherwise append directly\n\t\tfunction( target, els ) {\n\t\t\tvar j = target.length,\n\t\t\t\ti = 0;\n\n\t\t\t// Can\'t trust NodeList.length\n\t\t\twhile ( ( target[ j++ ] = els[ i++ ] ) ) {}\n\t\t\ttarget.length = j - 1;\n\t\t}\n\t};\n}\n\nfunction Sizzle( selector, context, results, seed ) {\n\tvar m, i, elem, nid, match, groups, newSelector,\n\t\tnewContext = context && context.ownerDocument,\n\n\t\t// nodeType defaults to 9, since context defaults to document\n\t\tnodeType = context ? context.nodeType : 9;\n\n\tresults = results || [];\n\n\t// Return early from calls with invalid selector or context\n\tif ( typeof selector !== "string" || !selector ||\n\t\tnodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {\n\n\t\treturn results;\n\t}\n\n\t// Try to shortcut find operations (as opposed to filters) in HTML documents\n\tif ( !seed ) {\n\t\tsetDocument( context );\n\t\tcontext = context || document;\n\n\t\tif ( documentIsHTML ) {\n\n\t\t\t// If the selector is sufficiently simple, try using a "get*By*" DOM method\n\t\t\t// (excepting DocumentFragment context, where the methods don\'t exist)\n\t\t\tif ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {\n\n\t\t\t\t// ID selector\n\t\t\t\tif ( ( m = match[ 1 ] ) ) {\n\n\t\t\t\t\t// Document context\n\t\t\t\t\tif ( nodeType === 9 ) {\n\t\t\t\t\t\tif ( ( elem = context.getElementById( m ) ) ) {\n\n\t\t\t\t\t\t\t// Support: IE, Opera, Webkit\n\t\t\t\t\t\t\t// TODO: identify versions\n\t\t\t\t\t\t\t// getElementById can match elements by name instead of ID\n\t\t\t\t\t\t\tif ( elem.id === m ) {\n\t\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t// Element context\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// Support: IE, Opera, Webkit\n\t\t\t\t\t\t// TODO: identify versions\n\t\t\t\t\t\t// getElementById can match elements by name instead of ID\n\t\t\t\t\t\tif ( newContext && ( elem = newContext.getElementById( m ) ) &&\n\t\t\t\t\t\t\tcontains( context, elem ) &&\n\t\t\t\t\t\t\telem.id === m ) {\n\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t// Type selector\n\t\t\t\t} else if ( match[ 2 ] ) {\n\t\t\t\t\tpush.apply( results, context.getElementsByTagName( selector ) );\n\t\t\t\t\treturn results;\n\n\t\t\t\t// Class selector\n\t\t\t\t} else if ( ( m = match[ 3 ] ) && support.getElementsByClassName &&\n\t\t\t\t\tcontext.getElementsByClassName ) {\n\n\t\t\t\t\tpush.apply( results, context.getElementsByClassName( m ) );\n\t\t\t\t\treturn results;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Take advantage of querySelectorAll\n\t\t\tif ( support.qsa &&\n\t\t\t\t!nonnativeSelectorCache[ selector + " " ] &&\n\t\t\t\t( !rbuggyQSA || !rbuggyQSA.test( selector ) ) &&\n\n\t\t\t\t// Support: IE 8 only\n\t\t\t\t// Exclude object elements\n\t\t\t\t( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) {\n\n\t\t\t\tnewSelector = selector;\n\t\t\t\tnewContext = context;\n\n\t\t\t\t// qSA considers elements outside a scoping root when evaluating child or\n\t\t\t\t// descendant combinators, which is not what we want.\n\t\t\t\t// In such cases, we work around the behavior by prefixing every selector in the\n\t\t\t\t// list with an ID selector referencing the scope context.\n\t\t\t\t// The technique has to be used as well when a leading combinator is used\n\t\t\t\t// as such selectors are not recognized by querySelectorAll.\n\t\t\t\t// Thanks to Andrew Dupont for this technique.\n\t\t\t\tif ( nodeType === 1 &&\n\t\t\t\t\t( rdescend.test( selector ) || rcombinators.test( selector ) ) ) {\n\n\t\t\t\t\t// Expand context for sibling selectors\n\t\t\t\t\tnewContext = rsibling.test( selector ) && testContext( context.parentNode ) ||\n\t\t\t\t\t\tcontext;\n\n\t\t\t\t\t// We can use :scope instead of the ID hack if the browser\n\t\t\t\t\t// supports it & if we\'re not changing the context.\n\t\t\t\t\tif ( newContext !== context || !support.scope ) {\n\n\t\t\t\t\t\t// Capture the context ID, setting it first if necessary\n\t\t\t\t\t\tif ( ( nid = context.getAttribute( "id" ) ) ) {\n\t\t\t\t\t\t\tnid = nid.replace( rcssescape, fcssescape );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcontext.setAttribute( "id", ( nid = expando ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prefix every selector in the list\n\t\t\t\t\tgroups = tokenize( selector );\n\t\t\t\t\ti = groups.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tgroups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " +\n\t\t\t\t\t\t\ttoSelector( groups[ i ] );\n\t\t\t\t\t}\n\t\t\t\t\tnewSelector = groups.join( "," );\n\t\t\t\t}\n\n\t\t\t\ttry {\n\n\t\t\t\t\t// `qSA` may not throw for unrecognized parts using forgiving parsing:\n\t\t\t\t\t// https://drafts.csswg.org/selectors/#forgiving-selector\n\t\t\t\t\t// like the `:has()` pseudo-class:\n\t\t\t\t\t// https://drafts.csswg.org/selectors/#relational\n\t\t\t\t\t// `CSS.supports` is still expected to return `false` then:\n\t\t\t\t\t// https://drafts.csswg.org/css-conditional-4/#typedef-supports-selector-fn\n\t\t\t\t\t// https://drafts.csswg.org/css-conditional-4/#dfn-support-selector\n\t\t\t\t\tif ( support.cssSupportsSelector &&\n\n\t\t\t\t\t\t// eslint-disable-next-line no-undef\n\t\t\t\t\t\t!CSS.supports( "selector(:is(" + newSelector + "))" ) ) {\n\n\t\t\t\t\t\t// Support: IE 11+\n\t\t\t\t\t\t// Throw to get to the same code path as an error directly in qSA.\n\t\t\t\t\t\t// Note: once we only support browser supporting\n\t\t\t\t\t\t// `CSS.supports(\'selector(...)\')`, we can most likely drop\n\t\t\t\t\t\t// the `try-catch`. IE doesn\'t implement the API.\n\t\t\t\t\t\tthrow new Error();\n\t\t\t\t\t}\n\n\t\t\t\t\tpush.apply( results,\n\t\t\t\t\t\tnewContext.querySelectorAll( newSelector )\n\t\t\t\t\t);\n\t\t\t\t\treturn results;\n\t\t\t\t} catch ( qsaError ) {\n\t\t\t\t\tnonnativeSelectorCache( selector, true );\n\t\t\t\t} finally {\n\t\t\t\t\tif ( nid === expando ) {\n\t\t\t\t\t\tcontext.removeAttribute( "id" );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// All others\n\treturn select( selector.replace( rtrim, "$1" ), context, results, seed );\n}\n\n/**\n * Create key-value caches of limited size\n * @returns {function(string, object)} Returns the Object data after storing it on itself with\n *\tproperty name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)\n *\tdeleting the oldest entry\n */\nfunction createCache() {\n\tvar keys = [];\n\n\tfunction cache( key, value ) {\n\n\t\t// Use (key + " ") to avoid collision with native prototype properties (see Issue #157)\n\t\tif ( keys.push( key + " " ) > Expr.cacheLength ) {\n\n\t\t\t// Only keep the most recent entries\n\t\t\tdelete cache[ keys.shift() ];\n\t\t}\n\t\treturn ( cache[ key + " " ] = value );\n\t}\n\treturn cache;\n}\n\n/**\n * Mark a function for special use by Sizzle\n * @param {Function} fn The function to mark\n */\nfunction markFunction( fn ) {\n\tfn[ expando ] = true;\n\treturn fn;\n}\n\n/**\n * Support testing using an element\n * @param {Function} fn Passed the created element and returns a boolean result\n */\nfunction assert( fn ) {\n\tvar el = document.createElement( "fieldset" );\n\n\ttry {\n\t\treturn !!fn( el );\n\t} catch ( e ) {\n\t\treturn false;\n\t} finally {\n\n\t\t// Remove from its parent by default\n\t\tif ( el.parentNode ) {\n\t\t\tel.parentNode.removeChild( el );\n\t\t}\n\n\t\t// release memory in IE\n\t\tel = null;\n\t}\n}\n\n/**\n * Adds the same handler for all of the specified attrs\n * @param {String} attrs Pipe-separated list of attributes\n * @param {Function} handler The method that will be applied\n */\nfunction addHandle( attrs, handler ) {\n\tvar arr = attrs.split( "|" ),\n\t\ti = arr.length;\n\n\twhile ( i-- ) {\n\t\tExpr.attrHandle[ arr[ i ] ] = handler;\n\t}\n}\n\n/**\n * Checks document order of two siblings\n * @param {Element} a\n * @param {Element} b\n * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b\n */\nfunction siblingCheck( a, b ) {\n\tvar cur = b && a,\n\t\tdiff = cur && a.nodeType === 1 && b.nodeType === 1 &&\n\t\t\ta.sourceIndex - b.sourceIndex;\n\n\t// Use IE sourceIndex if available on both nodes\n\tif ( diff ) {\n\t\treturn diff;\n\t}\n\n\t// Check if b follows a\n\tif ( cur ) {\n\t\twhile ( ( cur = cur.nextSibling ) ) {\n\t\t\tif ( cur === b ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn a ? 1 : -1;\n}\n\n/**\n * Returns a function to use in pseudos for input types\n * @param {String} type\n */\nfunction createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === "input" && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for buttons\n * @param {String} type\n */\nfunction createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn ( name === "input" || name === "button" ) && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for :enabled/:disabled\n * @param {Boolean} disabled true for :disabled; false for :enabled\n */\nfunction createDisabledPseudo( disabled ) {\n\n\t// Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable\n\treturn function( elem ) {\n\n\t\t// Only certain elements can match :enabled or :disabled\n\t\t// https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled\n\t\t// https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled\n\t\tif ( "form" in elem ) {\n\n\t\t\t// Check for inherited disabledness on relevant non-disabled elements:\n\t\t\t// * listed form-associated elements in a disabled fieldset\n\t\t\t// https://html.spec.whatwg.org/multipage/forms.html#category-listed\n\t\t\t// https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled\n\t\t\t// * option elements in a disabled optgroup\n\t\t\t// https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled\n\t\t\t// All such elements have a "form" property.\n\t\t\tif ( elem.parentNode && elem.disabled === false ) {\n\n\t\t\t\t// Option elements defer to a parent optgroup if present\n\t\t\t\tif ( "label" in elem ) {\n\t\t\t\t\tif ( "label" in elem.parentNode ) {\n\t\t\t\t\t\treturn elem.parentNode.disabled === disabled;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn elem.disabled === disabled;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Support: IE 6 - 11\n\t\t\t\t// Use the isDisabled shortcut property to check for disabled fieldset ancestors\n\t\t\t\treturn elem.isDisabled === disabled ||\n\n\t\t\t\t\t// Where there is no isDisabled, check manually\n\t\t\t\t\t/* jshint -W018 */\n\t\t\t\t\telem.isDisabled !== !disabled &&\n\t\t\t\t\tinDisabledFieldset( elem ) === disabled;\n\t\t\t}\n\n\t\t\treturn elem.disabled === disabled;\n\n\t\t// Try to winnow out elements that can\'t be disabled before trusting the disabled property.\n\t\t// Some victims get caught in our net (label, legend, menu, track), but it shouldn\'t\n\t\t// even exist on them, let alone have a boolean value.\n\t\t} else if ( "label" in elem ) {\n\t\t\treturn elem.disabled === disabled;\n\t\t}\n\n\t\t// Remaining elements are neither :enabled nor :disabled\n\t\treturn false;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for positionals\n * @param {Function} fn\n */\nfunction createPositionalPseudo( fn ) {\n\treturn markFunction( function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction( function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ ( j = matchIndexes[ i ] ) ] ) {\n\t\t\t\t\tseed[ j ] = !( matches[ j ] = seed[ j ] );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t} );\n}\n\n/**\n * Checks a node for validity as a Sizzle context\n * @param {Element|Object=} context\n * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value\n */\nfunction testContext( context ) {\n\treturn context && typeof context.getElementsByTagName !== "undefined" && context;\n}\n\n// Expose support vars for convenience\nsupport = Sizzle.support = {};\n\n/**\n * Detects XML nodes\n * @param {Element|Object} elem An element or a document\n * @returns {Boolean} True iff elem is a non-HTML XML node\n */\nisXML = Sizzle.isXML = function( elem ) {\n\tvar namespace = elem && elem.namespaceURI,\n\t\tdocElem = elem && ( elem.ownerDocument || elem ).documentElement;\n\n\t// Support: IE <=8\n\t// Assume HTML when documentElement doesn\'t yet exist, such as inside loading iframes\n\t// https://bugs.jquery.com/ticket/4833\n\treturn !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );\n};\n\n/**\n * Sets document-related variables once based on the current document\n * @param {Element|Object} [doc] An element or document object to use to set the document\n * @returns {Object} Returns the current document\n */\nsetDocument = Sizzle.setDocument = function( node ) {\n\tvar hasCompare, subWindow,\n\t\tdoc = node ? node.ownerDocument || node : preferredDoc;\n\n\t// Return early if doc is invalid or already selected\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a "Permission denied" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {\n\t\treturn document;\n\t}\n\n\t// Update global variables\n\tdocument = doc;\n\tdocElem = document.documentElement;\n\tdocumentIsHTML = !isXML( document );\n\n\t// Support: IE 9 - 11+, Edge 12 - 18+\n\t// Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a "Permission denied" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( preferredDoc != document &&\n\t\t( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {\n\n\t\t// Support: IE 11, Edge\n\t\tif ( subWindow.addEventListener ) {\n\t\t\tsubWindow.addEventListener( "unload", unloadHandler, false );\n\n\t\t// Support: IE 9 - 10 only\n\t\t} else if ( subWindow.attachEvent ) {\n\t\t\tsubWindow.attachEvent( "onunload", unloadHandler );\n\t\t}\n\t}\n\n\t// Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only,\n\t// Safari 4 - 5 only, Opera <=11.6 - 12.x only\n\t// IE/Edge & older browsers don\'t support the :scope pseudo-class.\n\t// Support: Safari 6.0 only\n\t// Safari 6.0 supports :scope but it\'s an alias of :root there.\n\tsupport.scope = assert( function( el ) {\n\t\tdocElem.appendChild( el ).appendChild( document.createElement( "div" ) );\n\t\treturn typeof el.querySelectorAll !== "undefined" &&\n\t\t\t!el.querySelectorAll( ":scope fieldset div" ).length;\n\t} );\n\n\t// Support: Chrome 105+, Firefox 104+, Safari 15.4+\n\t// Make sure forgiving mode is not used in `CSS.supports( "selector(...)" )`.\n\t//\n\t// `:is()` uses a forgiving selector list as an argument and is widely\n\t// implemented, so it\'s a good one to test against.\n\tsupport.cssSupportsSelector = assert( function() {\n\t\t/* eslint-disable no-undef */\n\n\t\treturn CSS.supports( "selector(*)" ) &&\n\n\t\t\t// Support: Firefox 78-81 only\n\t\t\t// In old Firefox, `:is()` didn\'t use forgiving parsing. In that case,\n\t\t\t// fail this test as there\'s no selector to test against that.\n\t\t\t// `CSS.supports` uses unforgiving parsing\n\t\t\tdocument.querySelectorAll( ":is(:jqfake)" ) &&\n\n\t\t\t// `*` is needed as Safari & newer Chrome implemented something in between\n\t\t\t// for `:has()` - it throws in `qSA` if it only contains an unsupported\n\t\t\t// argument but multiple ones, one of which is supported, are fine.\n\t\t\t// We want to play safe in case `:is()` gets the same treatment.\n\t\t\t!CSS.supports( "selector(:is(*,:jqfake))" );\n\n\t\t/* eslint-enable */\n\t} );\n\n\t/* Attributes\n\t---------------------------------------------------------------------- */\n\n\t// Support: IE<8\n\t// Verify that getAttribute really returns attributes and not properties\n\t// (excepting IE8 booleans)\n\tsupport.attributes = assert( function( el ) {\n\t\tel.className = "i";\n\t\treturn !el.getAttribute( "className" );\n\t} );\n\n\t/* getElement(s)By*\n\t---------------------------------------------------------------------- */\n\n\t// Check if getElementsByTagName("*") returns only elements\n\tsupport.getElementsByTagName = assert( function( el ) {\n\t\tel.appendChild( document.createComment( "" ) );\n\t\treturn !el.getElementsByTagName( "*" ).length;\n\t} );\n\n\t// Support: IE<9\n\tsupport.getElementsByClassName = rnative.test( document.getElementsByClassName );\n\n\t// Support: IE<10\n\t// Check if getElementById returns elements by name\n\t// The broken getElementById methods don\'t pick up programmatically-set names,\n\t// so use a roundabout getElementsByName test\n\tsupport.getById = assert( function( el ) {\n\t\tdocElem.appendChild( el ).id = expando;\n\t\treturn !document.getElementsByName || !document.getElementsByName( expando ).length;\n\t} );\n\n\t// ID filter and find\n\tif ( support.getById ) {\n\t\tExpr.filter[ "ID" ] = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn elem.getAttribute( "id" ) === attrId;\n\t\t\t};\n\t\t};\n\t\tExpr.find[ "ID" ] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== "undefined" && documentIsHTML ) {\n\t\t\t\tvar elem = context.getElementById( id );\n\t\t\t\treturn elem ? [ elem ] : [];\n\t\t\t}\n\t\t};\n\t} else {\n\t\tExpr.filter[ "ID" ] = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\tvar node = typeof elem.getAttributeNode !== "undefined" &&\n\t\t\t\t\telem.getAttributeNode( "id" );\n\t\t\t\treturn node && node.value === attrId;\n\t\t\t};\n\t\t};\n\n\t\t// Support: IE 6 - 7 only\n\t\t// getElementById is not reliable as a find shortcut\n\t\tExpr.find[ "ID" ] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== "undefined" && documentIsHTML ) {\n\t\t\t\tvar node, i, elems,\n\t\t\t\t\telem = context.getElementById( id );\n\n\t\t\t\tif ( elem ) {\n\n\t\t\t\t\t// Verify the id attribute\n\t\t\t\t\tnode = elem.getAttributeNode( "id" );\n\t\t\t\t\tif ( node && node.value === id ) {\n\t\t\t\t\t\treturn [ elem ];\n\t\t\t\t\t}\n\n\t\t\t\t\t// Fall back on getElementsByName\n\t\t\t\t\telems = context.getElementsByName( id );\n\t\t\t\t\ti = 0;\n\t\t\t\t\twhile ( ( elem = elems[ i++ ] ) ) {\n\t\t\t\t\t\tnode = elem.getAttributeNode( "id" );\n\t\t\t\t\t\tif ( node && node.value === id ) {\n\t\t\t\t\t\t\treturn [ elem ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn [];\n\t\t\t}\n\t\t};\n\t}\n\n\t// Tag\n\tExpr.find[ "TAG" ] = support.getElementsByTagName ?\n\t\tfunction( tag, context ) {\n\t\t\tif ( typeof context.getElementsByTagName !== "undefined" ) {\n\t\t\t\treturn context.getElementsByTagName( tag );\n\n\t\t\t// DocumentFragment nodes don\'t have gEBTN\n\t\t\t} else if ( support.qsa ) {\n\t\t\t\treturn context.querySelectorAll( tag );\n\t\t\t}\n\t\t} :\n\n\t\tfunction( tag, context ) {\n\t\t\tvar elem,\n\t\t\t\ttmp = [],\n\t\t\t\ti = 0,\n\n\t\t\t\t// By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too\n\t\t\t\tresults = context.getElementsByTagName( tag );\n\n\t\t\t// Filter out possible comments\n\t\t\tif ( tag === "*" ) {\n\t\t\t\twhile ( ( elem = results[ i++ ] ) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\ttmp.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn tmp;\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\n\t// Class\n\tExpr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) {\n\t\tif ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {\n\t\t\treturn context.getElementsByClassName( className );\n\t\t}\n\t};\n\n\t/* QSA/matchesSelector\n\t---------------------------------------------------------------------- */\n\n\t// QSA and matchesSelector support\n\n\t// matchesSelector(:active) reports false when true (IE9/Opera 11.5)\n\trbuggyMatches = [];\n\n\t// qSa(:focus) reports false when true (Chrome 21)\n\t// We allow this because of a bug in IE8/9 that throws an error\n\t// whenever `document.activeElement` is accessed on an iframe\n\t// So, we allow :focus to pass through QSA all the time to avoid the IE error\n\t// See https://bugs.jquery.com/ticket/13378\n\trbuggyQSA = [];\n\n\tif ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) {\n\n\t\t// Build QSA regex\n\t\t// Regex strategy adopted from Diego Perini\n\t\tassert( function( el ) {\n\n\t\t\tvar input;\n\n\t\t\t// Select is set to empty string on purpose\n\t\t\t// This is to test IE\'s treatment of not explicitly\n\t\t\t// setting a boolean content attribute,\n\t\t\t// since its presence should be enough\n\t\t\t// https://bugs.jquery.com/ticket/12359\n\t\t\tdocElem.appendChild( el ).innerHTML = "" +\n\t\t\t\t"";\n\n\t\t\t// Support: IE8, Opera 11-12.16\n\t\t\t// Nothing should be selected when empty strings follow ^= or $= or *=\n\t\t\t// The test attribute must be unknown in Opera but "safe" for WinRT\n\t\t\t// https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section\n\t\t\tif ( el.querySelectorAll( "[msallowcapture^=\'\']" ).length ) {\n\t\t\t\trbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\'\'|\\"\\")" );\n\t\t\t}\n\n\t\t\t// Support: IE8\n\t\t\t// Boolean attributes and "value" are not treated correctly\n\t\t\tif ( !el.querySelectorAll( "[selected]" ).length ) {\n\t\t\t\trbuggyQSA.push( "\\\\[" + whitespace + "*(?:value|" + booleans + ")" );\n\t\t\t}\n\n\t\t\t// Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+\n\t\t\tif ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {\n\t\t\t\trbuggyQSA.push( "~=" );\n\t\t\t}\n\n\t\t\t// Support: IE 11+, Edge 15 - 18+\n\t\t\t// IE 11/Edge don\'t find elements on a `[name=\'\']` query in some cases.\n\t\t\t// Adding a temporary attribute to the document before the selection works\n\t\t\t// around the issue.\n\t\t\t// Interestingly, IE 10 & older don\'t seem to have the issue.\n\t\t\tinput = document.createElement( "input" );\n\t\t\tinput.setAttribute( "name", "" );\n\t\t\tel.appendChild( input );\n\t\t\tif ( !el.querySelectorAll( "[name=\'\']" ).length ) {\n\t\t\t\trbuggyQSA.push( "\\\\[" + whitespace + "*name" + whitespace + "*=" +\n\t\t\t\t\twhitespace + "*(?:\'\'|\\"\\")" );\n\t\t\t}\n\n\t\t\t// Webkit/Opera - :checked should return selected option elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( !el.querySelectorAll( ":checked" ).length ) {\n\t\t\t\trbuggyQSA.push( ":checked" );\n\t\t\t}\n\n\t\t\t// Support: Safari 8+, iOS 8+\n\t\t\t// https://bugs.webkit.org/show_bug.cgi?id=136851\n\t\t\t// In-page `selector#id sibling-combinator selector` fails\n\t\t\tif ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {\n\t\t\t\trbuggyQSA.push( ".#.+[+~]" );\n\t\t\t}\n\n\t\t\t// Support: Firefox <=3.6 - 5 only\n\t\t\t// Old Firefox doesn\'t throw on a badly-escaped identifier.\n\t\t\tel.querySelectorAll( "\\\\\\f" );\n\t\t\trbuggyQSA.push( "[\\\\r\\\\n\\\\f]" );\n\t\t} );\n\n\t\tassert( function( el ) {\n\t\t\tel.innerHTML = "" +\n\t\t\t\t"";\n\n\t\t\t// Support: Windows 8 Native Apps\n\t\t\t// The type and name attributes are restricted during .innerHTML assignment\n\t\t\tvar input = document.createElement( "input" );\n\t\t\tinput.setAttribute( "type", "hidden" );\n\t\t\tel.appendChild( input ).setAttribute( "name", "D" );\n\n\t\t\t// Support: IE8\n\t\t\t// Enforce case-sensitivity of name attribute\n\t\t\tif ( el.querySelectorAll( "[name=d]" ).length ) {\n\t\t\t\trbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );\n\t\t\t}\n\n\t\t\t// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( el.querySelectorAll( ":enabled" ).length !== 2 ) {\n\t\t\t\trbuggyQSA.push( ":enabled", ":disabled" );\n\t\t\t}\n\n\t\t\t// Support: IE9-11+\n\t\t\t// IE\'s :disabled selector does not pick up the children of disabled fieldsets\n\t\t\tdocElem.appendChild( el ).disabled = true;\n\t\t\tif ( el.querySelectorAll( ":disabled" ).length !== 2 ) {\n\t\t\t\trbuggyQSA.push( ":enabled", ":disabled" );\n\t\t\t}\n\n\t\t\t// Support: Opera 10 - 11 only\n\t\t\t// Opera 10-11 does not throw on post-comma invalid pseudos\n\t\t\tel.querySelectorAll( "*,:x" );\n\t\t\trbuggyQSA.push( ",.*:" );\n\t\t} );\n\t}\n\n\tif ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches ||\n\t\tdocElem.webkitMatchesSelector ||\n\t\tdocElem.mozMatchesSelector ||\n\t\tdocElem.oMatchesSelector ||\n\t\tdocElem.msMatchesSelector ) ) ) ) {\n\n\t\tassert( function( el ) {\n\n\t\t\t// Check to see if it\'s possible to do matchesSelector\n\t\t\t// on a disconnected node (IE 9)\n\t\t\tsupport.disconnectedMatch = matches.call( el, "*" );\n\n\t\t\t// This should fail with an exception\n\t\t\t// Gecko does not error, returns false instead\n\t\t\tmatches.call( el, "[s!=\'\']:x" );\n\t\t\trbuggyMatches.push( "!=", pseudos );\n\t\t} );\n\t}\n\n\tif ( !support.cssSupportsSelector ) {\n\n\t\t// Support: Chrome 105+, Safari 15.4+\n\t\t// `:has()` uses a forgiving selector list as an argument so our regular\n\t\t// `try-catch` mechanism fails to catch `:has()` with arguments not supported\n\t\t// natively like `:has(:contains("Foo"))`. Where supported & spec-compliant,\n\t\t// we now use `CSS.supports("selector(:is(SELECTOR_TO_BE_TESTED))")`, but\n\t\t// outside that we mark `:has` as buggy.\n\t\trbuggyQSA.push( ":has" );\n\t}\n\n\trbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );\n\trbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) );\n\n\t/* Contains\n\t---------------------------------------------------------------------- */\n\thasCompare = rnative.test( docElem.compareDocumentPosition );\n\n\t// Element contains another\n\t// Purposefully self-exclusive\n\t// As in, an element does not contain itself\n\tcontains = hasCompare || rnative.test( docElem.contains ) ?\n\t\tfunction( a, b ) {\n\n\t\t\t// Support: IE <9 only\n\t\t\t// IE doesn\'t have `contains` on `document` so we need to check for\n\t\t\t// `documentElement` presence.\n\t\t\t// We need to fall back to `a` when `documentElement` is missing\n\t\t\t// as `ownerDocument` of elements within `