@maptiler/geocoding-control
Version:
The Javascript & TypeScript Map Control component for MapTiler Geocoding service. Easy to be integrated into any JavaScript mapping application.
179 lines (171 loc) • 70.9 kB
JavaScript
(function(c,U){typeof exports=="object"&&typeof module<"u"?U(exports):typeof define=="function"&&define.amd?define(["exports"],U):(c=typeof globalThis<"u"?globalThis:c||self,U(c.maptilerGeocoder={}))})(this,(function(c){"use strict";/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const U=globalThis,$e=U.ShadowRoot&&(U.ShadyCSS===void 0||U.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ee=Symbol(),ze=new WeakMap;let Ve=class{constructor(e,t,s){if(this._$cssResult$=!0,s!==Ee)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if($e&&e===void 0){const s=t!==void 0&&t.length===1;s&&(e=ze.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&ze.set(t,e))}return e}toString(){return this.cssText}};const _e=i=>new Ve(typeof i=="string"?i:i+"",void 0,Ee),F=(i,...e)=>{const t=i.length===1?i[0]:e.reduce(((s,r,o)=>s+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+i[o+1]),i[0]);return new Ve(t,i,Ee)},Gt=(i,e)=>{if($e)i.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const t of e){const s=document.createElement("style"),r=U.litNonce;r!==void 0&&s.setAttribute("nonce",r),s.textContent=t.cssText,i.appendChild(s)}},qe=$e?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(const s of e.cssRules)t+=s.cssText;return _e(t)})(i):i;/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const{is:Ut,defineProperty:Wt,getOwnPropertyDescriptor:Pt,getOwnPropertyNames:Ft,getOwnPropertySymbols:Rt,getPrototypeOf:Dt}=Object,ce=globalThis,Ze=ce.trustedTypes,Ht=Ze?Ze.emptyScript:"",Bt=ce.reactiveElementPolyfillSupport,J=(i,e)=>i,de={toAttribute(i,e){switch(e){case Boolean:i=i?Ht:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},Le=(i,e)=>!Ut(i,e),Ke={attribute:!0,type:String,converter:de,reflect:!1,useDefault:!1,hasChanged:Le};Symbol.metadata??=Symbol("metadata"),ce.litPropertyMetadata??=new WeakMap;let V=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Ke){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const s=Symbol(),r=this.getPropertyDescriptor(e,s,t);r!==void 0&&Wt(this.prototype,e,r)}}static getPropertyDescriptor(e,t,s){const{get:r,set:o}=Pt(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:r,set(a){const n=r?.call(this);o?.call(this,a),this.requestUpdate(e,n,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Ke}static _$Ei(){if(this.hasOwnProperty(J("elementProperties")))return;const e=Dt(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(J("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(J("properties"))){const t=this.properties,s=[...Ft(t),...Rt(t)];for(const r of s)this.createProperty(r,t[r])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[s,r]of t)this.elementProperties.set(s,r)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const r=this._$Eu(t,s);r!==void 0&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const r of s)t.unshift(qe(r))}else e!==void 0&&t.push(qe(e));return t}static _$Eu(e,t){const s=t.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const s of t.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Gt(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,s){this._$AK(e,s)}_$ET(e,t){const s=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,s);if(r!==void 0&&s.reflect===!0){const o=(s.converter?.toAttribute!==void 0?s.converter:de).toAttribute(t,s.type);this._$Em=e,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(e,t){const s=this.constructor,r=s._$Eh.get(e);if(r!==void 0&&this._$Em!==r){const o=s.getPropertyOptions(r),a=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:de;this._$Em=r;const n=a.fromAttribute(t,o.type);this[r]=n??this._$Ej?.get(r)??n,this._$Em=null}}requestUpdate(e,t,s){if(e!==void 0){const r=this.constructor,o=this[e];if(s??=r.getPropertyOptions(e),!((s.hasChanged??Le)(o,t)||s.useDefault&&s.reflect&&o===this._$Ej?.get(e)&&!this.hasAttribute(r._$Eu(e,s))))return;this.C(e,t,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:s,reflect:r,wrapped:o},a){s&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),o!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||s||(t=void 0),this._$AL.set(e,t)),r===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[r,o]of s){const{wrapped:a}=o,n=this[r];a!==!0||this._$AL.has(r)||n===void 0||this.C(r,void 0,o,n)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((s=>s.hostUpdate?.())),this.update(t)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};V.elementStyles=[],V.shadowRootOptions={mode:"open"},V[J("elementProperties")]=new Map,V[J("finalized")]=new Map,Bt?.({ReactiveElement:V}),(ce.reactiveElementVersions??=[]).push("2.1.1");/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const we=globalThis,he=we.trustedTypes,Qe=he?he.createPolicy("lit-html",{createHTML:i=>i}):void 0,Je="$lit$",W=`lit$${Math.random().toFixed(9).slice(2)}$`,Xe="?"+W,jt=`<${Xe}>`,R=document,X=()=>R.createComment(""),Y=i=>i===null||typeof i!="object"&&typeof i!="function",Se=Array.isArray,zt=i=>Se(i)||typeof i?.[Symbol.iterator]=="function",Me=`[
\f\r]`,ee=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ye=/-->/g,et=/>/g,D=RegExp(`>|${Me}(?:([^\\s"'>=/]+)(${Me}*=${Me}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`,"g"),tt=/'/g,it=/"/g,st=/^(?:script|style|textarea|title)$/i,rt=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),S=rt(1),ue=rt(2),G=Symbol.for("lit-noChange"),w=Symbol.for("lit-nothing"),ot=new WeakMap,H=R.createTreeWalker(R,129);function at(i,e){if(!Se(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Qe!==void 0?Qe.createHTML(e):e}const Vt=(i,e)=>{const t=i.length-1,s=[];let r,o=e===2?"<svg>":e===3?"<math>":"",a=ee;for(let n=0;n<t;n++){const l=i[n];let g,v,d=-1,b=0;for(;b<l.length&&(a.lastIndex=b,v=a.exec(l),v!==null);)b=a.lastIndex,a===ee?v[1]==="!--"?a=Ye:v[1]!==void 0?a=et:v[2]!==void 0?(st.test(v[2])&&(r=RegExp("</"+v[2],"g")),a=D):v[3]!==void 0&&(a=D):a===D?v[0]===">"?(a=r??ee,d=-1):v[1]===void 0?d=-2:(d=a.lastIndex-v[2].length,g=v[1],a=v[3]===void 0?D:v[3]==='"'?it:tt):a===it||a===tt?a=D:a===Ye||a===et?a=ee:(a=D,r=void 0);const m=a===D&&i[n+1].startsWith("/>")?" ":"";o+=a===ee?l+jt:d>=0?(s.push(g),l.slice(0,d)+Je+l.slice(d)+W+m):l+W+(d===-2?n:m)}return[at(i,o+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]};class te{constructor({strings:e,_$litType$:t},s){let r;this.parts=[];let o=0,a=0;const n=e.length-1,l=this.parts,[g,v]=Vt(e,t);if(this.el=te.createElement(g,s),H.currentNode=this.el.content,t===2||t===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(r=H.nextNode())!==null&&l.length<n;){if(r.nodeType===1){if(r.hasAttributes())for(const d of r.getAttributeNames())if(d.endsWith(Je)){const b=v[a++],m=r.getAttribute(d).split(W),y=/([.?@])?(.*)/.exec(b);l.push({type:1,index:o,name:y[2],strings:m,ctor:y[1]==="."?Zt:y[1]==="?"?Kt:y[1]==="@"?Qt:pe}),r.removeAttribute(d)}else d.startsWith(W)&&(l.push({type:6,index:o}),r.removeAttribute(d));if(st.test(r.tagName)){const d=r.textContent.split(W),b=d.length-1;if(b>0){r.textContent=he?he.emptyScript:"";for(let m=0;m<b;m++)r.append(d[m],X()),H.nextNode(),l.push({type:2,index:++o});r.append(d[b],X())}}}else if(r.nodeType===8)if(r.data===Xe)l.push({type:2,index:o});else{let d=-1;for(;(d=r.data.indexOf(W,d+1))!==-1;)l.push({type:7,index:o}),d+=W.length-1}o++}}static createElement(e,t){const s=R.createElement("template");return s.innerHTML=e,s}}function q(i,e,t=i,s){if(e===G)return e;let r=s!==void 0?t._$Co?.[s]:t._$Cl;const o=Y(e)?void 0:e._$litDirective$;return r?.constructor!==o&&(r?._$AO?.(!1),o===void 0?r=void 0:(r=new o(i),r._$AT(i,t,s)),s!==void 0?(t._$Co??=[])[s]=r:t._$Cl=r),r!==void 0&&(e=q(i,r._$AS(i,e.values),r,s)),e}let qt=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:s}=this._$AD,r=(e?.creationScope??R).importNode(t,!0);H.currentNode=r;let o=H.nextNode(),a=0,n=0,l=s[0];for(;l!==void 0;){if(a===l.index){let g;l.type===2?g=new Z(o,o.nextSibling,this,e):l.type===1?g=new l.ctor(o,l.name,l.strings,this,e):l.type===6&&(g=new Jt(o,this,e)),this._$AV.push(g),l=s[++n]}a!==l?.index&&(o=H.nextNode(),a++)}return H.currentNode=R,r}p(e){let t=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,t),t+=s.strings.length-2):s._$AI(e[t])),t++}};class Z{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,s,r){this.type=2,this._$AH=w,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=s,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=q(this,e,t),Y(e)?e===w||e==null||e===""?(this._$AH!==w&&this._$AR(),this._$AH=w):e!==this._$AH&&e!==G&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):zt(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==w&&Y(this._$AH)?this._$AA.nextSibling.data=e:this.T(R.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:s}=e,r=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=te.createElement(at(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===r)this._$AH.p(t);else{const o=new qt(r,this),a=o.u(this.options);o.p(t),this.T(a),this._$AH=o}}_$AC(e){let t=ot.get(e.strings);return t===void 0&&ot.set(e.strings,t=new te(e)),t}k(e){Se(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let s,r=0;for(const o of e)r===t.length?t.push(s=new Z(this.O(X()),this.O(X()),this,this.options)):s=t[r],s._$AI(o),r++;r<t.length&&(this._$AR(s&&s._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const s=e.nextSibling;e.remove(),e=s}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}}class pe{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,s,r,o){this.type=1,this._$AH=w,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=o,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=w}_$AI(e,t=this,s,r){const o=this.strings;let a=!1;if(o===void 0)e=q(this,e,t,0),a=!Y(e)||e!==this._$AH&&e!==G,a&&(this._$AH=e);else{const n=e;let l,g;for(e=o[0],l=0;l<o.length-1;l++)g=q(this,n[s+l],t,l),g===G&&(g=this._$AH[l]),a||=!Y(g)||g!==this._$AH[l],g===w?e=w:e!==w&&(e+=(g??"")+o[l+1]),this._$AH[l]=g}a&&!r&&this.j(e)}j(e){e===w?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Zt extends pe{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===w?void 0:e}}class Kt extends pe{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==w)}}class Qt extends pe{constructor(e,t,s,r,o){super(e,t,s,r,o),this.type=5}_$AI(e,t=this){if((e=q(this,e,t,0)??w)===G)return;const s=this._$AH,r=e===w&&s!==w||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,o=e!==w&&(s===w||r);r&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class Jt{constructor(e,t,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){q(this,e)}}const Xt={I:Z},Yt=we.litHtmlPolyfillSupport;Yt?.(te,Z),(we.litHtmlVersions??=[]).push("3.3.1");const ei=(i,e,t)=>{const s=t?.renderBefore??e;let r=s._$litPart$;if(r===void 0){const o=t?.renderBefore??null;s._$litPart$=r=new Z(e.insertBefore(X(),o),o,void 0,t??{})}return r._$AI(i),r};/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const Ae=globalThis;let k=class extends V{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ei(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return G}};k._$litElement$=!0,k.finalized=!0,Ae.litElementHydrateSupport?.({LitElement:k});const ti=Ae.litElementPolyfillSupport;ti?.({LitElement:k}),(Ae.litElementVersions??=[]).push("4.2.1");/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const B=i=>(e,t)=>{t!==void 0?t.addInitializer((()=>{customElements.define(i,e)})):customElements.define(i,e)};/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const ii={attribute:!0,type:String,converter:de,reflect:!1,hasChanged:Le},si=(i=ii,e,t)=>{const{kind:s,metadata:r}=t;let o=globalThis.litPropertyMetadata.get(r);if(o===void 0&&globalThis.litPropertyMetadata.set(r,o=new Map),s==="setter"&&((i=Object.create(i)).wrapped=!0),o.set(t.name,i),s==="accessor"){const{name:a}=t;return{set(n){const l=e.get.call(this);e.set.call(this,n),this.requestUpdate(a,l,i)},init(n){return n!==void 0&&this.C(a,void 0,i,n),n}}}if(s==="setter"){const{name:a}=t;return function(n){const l=this[a];e.call(this,n),this.requestUpdate(a,l,i)}}throw Error("Unsupported decorator location: "+s)};function f(i){return(e,t)=>typeof t=="object"?si(i,e,t):((s,r,o)=>{const a=r.hasOwnProperty(o);return r.constructor.createProperty(o,s),a?Object.getOwnPropertyDescriptor(r,o):void 0})(i,e,t)}/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/function x(i){return f({...i,state:!0,attribute:!1})}/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const ri=(i,e,t)=>(t.configurable=!0,t.enumerable=!0,Reflect.decorate&&typeof e!="object"&&Object.defineProperty(i,e,t),t);/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/function oi(i,e){return(t,s,r)=>{const o=a=>a.renderRoot?.querySelector(i)??null;return ri(t,s,{get(){return o(this)}})}}var ai=Object.getOwnPropertyDescriptor,ni=(i,e,t,s)=>{for(var r=s>1?void 0:s?ai(e,t):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(r=a(r)||r);return r};c.MaptilerGeocodeClearIconElement=class extends k{render(){return ue`
<svg viewBox="0 0 14 14" width="13" height="13">
<path
d="M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"
/>
</svg>
`}},c.MaptilerGeocodeClearIconElement.styles=F`
svg {
display: block;
fill: var(--color-icon-button);
}
`,c.MaptilerGeocodeClearIconElement=ni([B("maptiler-geocode-clear-icon")],c.MaptilerGeocodeClearIconElement);var li=Object.getOwnPropertyDescriptor,ci=(i,e,t,s)=>{for(var r=s>1?void 0:s?li(e,t):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(r=a(r)||r);return r};c.MaptilerGeocodeFailIconElement=class extends k{render(){return ue`
<svg viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"
/>
</svg>
`}},c.MaptilerGeocodeFailIconElement.styles=F`
svg {
display: block;
fill: #e15042;
}
`,c.MaptilerGeocodeFailIconElement=ci([B("maptiler-geocode-fail-icon")],c.MaptilerGeocodeFailIconElement);var di=Object.getOwnPropertyDescriptor,hi=(i,e,t,s)=>{for(var r=s>1?void 0:s?di(e,t):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(r=a(r)||r);return r};c.MaptilerGeocodeLoadingIconElement=class extends k{render(){return S`
<div>
<svg viewBox="0 0 18 18" width="24" height="24" class="loading-icon">
<path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z" />
<path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z" />
</svg>
</div>
`}},c.MaptilerGeocodeLoadingIconElement.styles=F`
div {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
pointer-events: none;
display: flex;
align-items: center;
}
.loading-icon {
animation: rotate 0.8s infinite cubic-bezier(0.45, 0.05, 0.55, 0.95);
}
@keyframes rotate {
from {
-webkit-transform: rotate(0);
transform: rotate(0);
}
to {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
`,c.MaptilerGeocodeLoadingIconElement=hi([B("maptiler-geocode-loading-icon")],c.MaptilerGeocodeLoadingIconElement);var ui=Object.getOwnPropertyDescriptor,pi=(i,e,t,s)=>{for(var r=s>1?void 0:s?ui(e,t):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(r=a(r)||r);return r};c.MaptilerGeocodeReverseGeocodingIconElement=class extends k{render(){return ue`
<svg viewBox="0 0 60.006 21.412" width="14" height="20">
<path
d="M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"
/>
</svg>
`}},c.MaptilerGeocodeReverseGeocodingIconElement.styles=F`
svg {
display: block;
fill: var(--color-icon-button);
}
`,c.MaptilerGeocodeReverseGeocodingIconElement=pi([B("maptiler-geocode-reverse-geocoding-icon")],c.MaptilerGeocodeReverseGeocodingIconElement);var mi=Object.getOwnPropertyDescriptor,fi=(i,e,t,s)=>{for(var r=s>1?void 0:s?mi(e,t):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(r=a(r)||r);return r};c.MaptilerGeocodeSearchIconElement=class extends k{render(){return ue`
<svg
xmlns="http://www.w3.org/2000/svg"
width="13"
height="13"
viewBox="0 0 13 13"
>
<circle cx="4.789" cy="4.787" r="3.85" />
<path d="M12.063 12.063 7.635 7.635" />
</svg>
`}},c.MaptilerGeocodeSearchIconElement.styles=F`
circle {
stroke-width: 1.875;
fill: none;
}
path {
stroke-width: 1.875;
stroke-linecap: round;
}
svg {
display: block;
stroke: var(--color-icon-button);
}
`,c.MaptilerGeocodeSearchIconElement=fi([B("maptiler-geocode-search-icon")],c.MaptilerGeocodeSearchIconElement);const vi=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(EAST|WEST|[EW])?$/i,nt=/^([+-]?[0-8]?[0-9])\s+([0-5]?[0-9]\.\d{3,})[\s,]{1,}([+-]?[0-1]?[0-9]?[0-9])\s+([0-5]?[0-9]\.\d{3,})$/,lt=/^(NORTH|SOUTH|[NS])?[\s]*([+-]?[0-8]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(NORTH|SOUTH|[NS])?[\s]*[,/;]?[\s]*(EAST|WEST|[EW])?[\s]*([+-]?[0-1]?[0-9]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(EAST|WEST|[EW])?$/i,ct=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(EAST|WEST|[EW])?$/i,dt=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)\s*(EAST|WEST|[EW])?$/i,ht=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|’’|´´|["″”\.])?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|´´|’’|["″”\.])?\s*(EAST|WEST|[EW])?$/i;function gi(i){if(!["DMS","DM","DD"].includes(i))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){const e=this.decimalCoordinates.split(",").map(m=>Number(m.trim())),t=Number(e[0]),s=Number(e[1]),r=Math.abs(t),o=Math.abs(s),a=t>0?"N":"S",n=s>0?"E":"W";let l;i=="DD"&&(l=`${r}° ${a}, ${o}° ${n}`);const g=Math.floor(r),v=Math.floor(o),d=(r-g)*60,b=(o-v)*60;if(i=="DM"){let m=ut(d,3).toFixed(3).padStart(6,"0"),y=ut(b,3).toFixed(3).padStart(6,"0");m.endsWith(".000")&&y.endsWith(".000")&&(m=m.replace(/\.000$/,""),y=y.replace(/\.000$/,"")),l=`${g}° ${m}' ${a}, ${v}° ${y}' ${n}`}if(i=="DMS"){const m=Math.floor(d),y=Math.floor(b);let L=((d-m)*60).toFixed(1).padStart(4,"0"),A=((b-y)*60).toFixed(1).padStart(4,"0");const E=m.toString().padStart(2,"0"),N=y.toString().padStart(2,"0");L.endsWith(".0")&&A.endsWith(".0")&&(L=L.replace(/\.0$/,""),A=A.replace(/\.0$/,"")),l=`${g}° ${E}' ${L}" ${a}, ${v}° ${N}' ${A}" ${n}`}return l}else throw new Error("no decimal coordinates to convert")}function ut(i,e){const t=Math.pow(10,e);return Math.round((i+Number.EPSILON)*t)/t}function xe(i,e){e||(e=5),i=i.replace(/\s+/g," ").trim();let t=null,s=null,r="",o="",a=null,n=[],l=!1;if(vi.test(i))throw new Error("invalid coordinate value");if(nt.test(i))if(n=nt.exec(i),l=ie(n),l)t=Math.abs(n[1])+n[2]/60,Number(n[1])<0&&(t*=-1),s=Math.abs(n[3])+n[4]/60,Number(n[3])<0&&(s*=-1),a="DM";else throw new Error("invalid coordinate format");else if(lt.test(i))if(n=lt.exec(i),l=ie(n),l){if(t=n[2],s=n[6],t.includes(",")&&(t=t.replace(",",".")),s.includes(",")&&(s=s.replace(",",".")),a="DD",Number(Math.round(t))==Number(t))throw new Error("integer only coordinate provided");if(Number(Math.round(s))==Number(s))throw new Error("integer only coordinate provided");n[1]?(r=n[1],o=n[5]):n[4]&&(r=n[4],o=n[8])}else throw new Error("invalid decimal coordinate format");else if(ct.test(i))if(n=ct.exec(i),l=ie(n),l)t=Math.abs(parseInt(n[2])),n[4]&&(t+=n[4]/60,a="DM"),n[6]&&(t+=n[6].replace(",",".")/3600,a="DMS"),parseInt(n[2])<0&&(t=-1*t),s=Math.abs(parseInt(n[9])),n[11]&&(s+=n[11]/60),n[13]&&(s+=n[13].replace(",",".")/3600),parseInt(n[9])<0&&(s=-1*s),n[1]?(r=n[1],o=n[8]):n[7]&&(r=n[7],o=n[14]);else throw new Error("invalid DMS coordinates format");else if(dt.test(i))if(n=dt.exec(i),l=ie(n),l)t=Math.abs(parseInt(n[2])),n[4]&&(t+=n[4]/60,a="DM"),n[6]&&(t+=n[6]/3600,a="DMS"),parseInt(n[2])<0&&(t=-1*t),s=Math.abs(parseInt(n[10])),n[12]&&(s+=n[12]/60),n[14]&&(s+=n[14]/3600),parseInt(n[10])<0&&(s=-1*s),n[1]?(r=n[1],o=n[9]):n[8]&&(r=n[8],o=n[16]);else throw new Error("invalid DMS coordinates format");else if(ht.test(i)){if(n=ht.exec(i),l=ie(n),n.filter(g=>g).length<=5)throw new Error("invalid coordinates format");if(l)t=Math.abs(parseInt(n[2])),n[4]&&(t+=n[4].replace(",",".")/60,a="DM"),n[6]&&(t+=n[6].replace(",",".")/3600,a="DMS"),parseInt(n[2])<0&&(t=-1*t),s=Math.abs(parseInt(n[10])),n[12]&&(s+=n[12].replace(",",".")/60),n[14]&&(s+=n[14].replace(",",".")/3600),parseInt(n[10])<0&&(s=-1*s),n[1]?(r=n[1],o=n[9]):n[8]&&(r=n[8],o=n[16]);else throw new Error("invalid coordinates format")}if(l){if(Math.abs(s)>=180)throw new Error("invalid longitude value");if(Math.abs(t)>=90)throw new Error("invalid latitude value");if(r&&!o||!r&&o)throw new Error("invalid coordinates value");if(r&&r==o)throw new Error("invalid coordinates format");t.toString().includes(",")&&(t=t.replace(",",".")),s.toString().includes(",")&&(s=s.replace(",","."));let g=/S|SOUTH/i;g.test(r)&&t>0&&(t=-1*t),g=/W|WEST/i,g.test(o)&&s>0&&(s=-1*s);const v=n[0].trim();let d,b;const m=/[,/;\u0020]/g,y=v.match(m);if(y==null){const E=Math.floor(i.length/2);d=v.substring(0,E).trim(),b=v.substring(E).trim()}else{let E;y.length%2==1?E=Math.floor(y.length/2):E=y.length/2-1;let N=0;if(E==0)N=v.indexOf(y[0]),d=v.substring(0,N).trim(),b=v.substring(N+1).trim();else{let je=0,Ot=0;for(;je<=E;)N=v.indexOf(y[je],Ot),Ot=N+1,je++;d=v.substring(0,N).trim(),b=v.substring(N+1).trim()}}const L=d.split(".");if(L.length==2&&L[1]==0&&L[1].length!=2)throw new Error("invalid coordinates format");const A=b.split(".");if(A.length==2&&A[1]==0&&A[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(d)||/^\d+$/.test(b))throw new Error("degree only coordinate/s provided");return t=Number(Number(t).toFixed(e)),s=Number(Number(s).toFixed(e)),Object.freeze({verbatimCoordinates:v,verbatimLatitude:d,verbatimLongitude:b,decimalLatitude:t,decimalLongitude:s,decimalCoordinates:`${t},${s}`,originalFormat:a,closeEnough:bi,toCoordinateFormat:gi})}else throw new Error("coordinates pattern match failed")}function ie(i){if(!isNaN(i[0]))return!1;const e=[...i];if(e.shift(),e.length%2>0)return!1;const t=/^[-+]?\d+([\.,]\d+)?$/,s=/[eastsouthnorthwest]+/i,r=e.length/2;for(let o=0;o<r;o++){const a=e[o],n=e[o+r],l=t.test(a)&&t.test(n),g=s.test(a)&&s.test(n),v=a==n;if(!(a==null&&n==null)){if(a==null||n==null)return!1;if(l||g||v)continue;return!1}}return!0}function pt(i,e){const t=Math.abs(i-e);return Number(t.toFixed(6))<=1e-5}function bi(i){if(!i)throw new Error("coords must be provided");if(i.includes(",")){const e=i.split(",");if(Number(e[0])==NaN||Number(e[1])==NaN)throw new Error("coords are not valid decimals");return pt(this.decimalLatitude,Number(e[0]))&&pt(this.decimalLongitude,e[1])}else throw new Error("coords being tested must be separated by a comma")}const yi=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});xe.to=yi;const $i=[{verbatimCoordinates:"40.123, -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:'40° 7´ 22.8" N 74° 7´ 22.8" W',verbatimLatitude:'40° 7´ 22.8" N',verbatimLongitude:'74° 7´ 22.8" W'},{verbatimCoordinates:"40° 7.38’ , -74° 7.38’",verbatimLatitude:"40° 7.38’",verbatimLongitude:"-74° 7.38’"},{verbatimCoordinates:"N40°7’22.8’’, W74°7’22.8’’",verbatimLatitude:"N40°7’22.8’’",verbatimLongitude:"W74°7’22.8’’"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:`40°7'22.8"N, 74°7'22.8"W`,verbatimLatitude:`40°7'22.8"N`,verbatimLongitude:`74°7'22.8"W`},{verbatimCoordinates:"40 7 22.8, -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"},{verbatimCoordinates:"40.123 -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123°,-74.123°",verbatimLatitude:"40.123°",verbatimLongitude:"-74.123°"},{verbatimCoordinates:"40.123N74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"4007.38N7407.38W",verbatimLatitude:"4007.38N",verbatimLongitude:"7407.38W"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:"400722.8N740722.8W",verbatimLatitude:"400722.8N",verbatimLongitude:"740722.8W"},{verbatimCoordinates:"N 40 7.38 W 74 7.38",verbatimLatitude:"N 40 7.38",verbatimLongitude:"W 74 7.38"},{verbatimCoordinates:"40:7:22.8N 74:7:22.8W",verbatimLatitude:"40:7:22.8N",verbatimLongitude:"74:7:22.8W"},{verbatimCoordinates:"40:7:23N,74:7:23W",verbatimLatitude:"40:7:23N",verbatimLongitude:"74:7:23W",decimalLatitude:40.1230555555,decimalLongitude:-74.1230555555},{verbatimCoordinates:'40°7’23"N 74°7’23"W',verbatimLatitude:'40°7’23"N',verbatimLongitude:'74°7’23"W',decimalLatitude:40.1230555555,decimalLongitude:-74.12305555555555},{verbatimCoordinates:'40°7’23"S 74°7’23"E',verbatimLatitude:'40°7’23"S',verbatimLongitude:'74°7’23"E',decimalLatitude:-40.1230555555,decimalLongitude:74.12305555555555},{verbatimCoordinates:'40°7’23" -74°7’23"',verbatimLatitude:'40°7’23"',verbatimLongitude:'-74°7’23"',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:'40d 7’ 23" N 74d 7’ 23" W',verbatimLatitude:'40d 7’ 23" N',verbatimLongitude:'74d 7’ 23" W',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:"40.123N 74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40 7 22.8; -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"}],Ei={decimalLatitude:40.123,decimalLongitude:-74.123},_i=[{verbatimCoordinates:`50°4'17.698"south, 14°24'2.826"east`,verbatimLatitude:`50°4'17.698"south`,verbatimLongitude:`14°24'2.826"east`,decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"50d4m17.698S 14d24m2.826E",verbatimLatitude:"50d4m17.698S",verbatimLongitude:"14d24m2.826E",decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"40:26:46N,79:56:55W",verbatimLatitude:"40:26:46N",verbatimLongitude:"79:56:55W",decimalLatitude:40.44611111111111,decimalLongitude:-79.9486111111111},{verbatimCoordinates:"40:26:46.302N 79:56:55.903W",verbatimLatitude:"40:26:46.302N",verbatimLongitude:"79:56:55.903W",decimalLatitude:40.446195,decimalLongitude:-79.94886194444445},{verbatimCoordinates:"40°26′47″N 79°58′36″W",verbatimLatitude:"40°26′47″N",verbatimLongitude:"79°58′36″W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40d 26′ 47″ N 79d 58′ 36″ W",verbatimLatitude:"40d 26′ 47″ N",verbatimLongitude:"79d 58′ 36″ W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40.446195N 79.948862W",verbatimLatitude:"40.446195N",verbatimLongitude:"79.948862W",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40,446195° 79,948862°",verbatimLatitude:"40,446195°",verbatimLongitude:"79,948862°",decimalLatitude:40.446195,decimalLongitude:79.948862},{verbatimCoordinates:"40° 26.7717, -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.446195, -79.948862",verbatimLatitude:"40.446195",verbatimLongitude:"-79.948862",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.123256; -74.123256",verbatimLatitude:"40.123256",verbatimLongitude:"-74.123256",decimalLatitude:40.123256,decimalLongitude:-74.123256},{verbatimCoordinates:"18°24S 22°45E",verbatimLatitude:"18°24S",verbatimLongitude:"22°45E",decimalLatitude:-18.4,decimalLongitude:22.75}],Li=[{verbatimCoordinates:"10.432342S 10.6345345E",verbatimLatitude:"10.432342S",verbatimLongitude:"10.6345345E",decimalLatitude:-10.432342,decimalLongitude:10.6345345},{verbatimCoordinates:"10.00S 10.00E",verbatimLatitude:"10.00S",verbatimLongitude:"10.00E",decimalLatitude:-10,decimalLongitude:10},{verbatimCoordinates:"00.00S 01.00E",verbatimLatitude:"00.00S",verbatimLongitude:"01.00E",decimalLatitude:0,decimalLongitude:1},{verbatimCoordinates:"18.24S 22.45E",verbatimLatitude:"18.24S",verbatimLongitude:"22.45E",decimalLatitude:-18.4,decimalLongitude:22.75},{verbatimCoordinates:"27deg 15min 45.2sec S 18deg 32min 53.7sec E",verbatimLatitude:"27deg 15min 45.2sec S",verbatimLongitude:"18deg 32min 53.7sec E",decimalLatitude:-27.262555555555554,decimalLongitude:18.54825},{verbatimCoordinates:"-23.3245° S / 28.2344° E",verbatimLatitude:"-23.3245° S",verbatimLongitude:"28.2344° E",decimalLatitude:-23.3245,decimalLongitude:28.2344},{verbatimCoordinates:"40° 26.7717 -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"27.15.45S 18.32.53E",verbatimLatitude:"27.15.45S",verbatimLongitude:"18.32.53E",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"-27.15.45 18.32.53",verbatimLatitude:"-27.15.45",verbatimLongitude:"18.32.53",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"27.15.45.2S 18.32.53.4E",verbatimLatitude:"27.15.45.2S",verbatimLongitude:"18.32.53.4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"27.15.45,2S 18.32.53,4E",verbatimLatitude:"27.15.45,2S",verbatimLongitude:"18.32.53,4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"S23.43563 ° E22.45634 °",verbatimLatitude:"S23.43563 °",verbatimLongitude:"E22.45634 °",decimalLatitude:-23.43563,decimalLongitude:22.45634},{verbatimCoordinates:"27,71372° S 23,07771° E",verbatimLatitude:"27,71372° S",verbatimLongitude:"23,07771° E",decimalLatitude:-27.71372,decimalLongitude:23.07771},{verbatimCoordinates:"27.45.34 S 23.23.23 E",verbatimLatitude:"27.45.34 S",verbatimLongitude:"23.23.23 E",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"S 27.45.34 E 23.23.23",verbatimLatitude:"S 27.45.34",verbatimLongitude:"E 23.23.23",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"53 16.3863,4 52.8171",verbatimLatitude:"53 16.3863",verbatimLongitude:"4 52.8171",decimalLatitude:53.273105,decimalLongitude:4.88029},{verbatimCoordinates:"50 8.2914,-5 2.4447",verbatimLatitude:"50 8.2914",verbatimLongitude:"-5 2.4447",decimalLatitude:50.13819,decimalLongitude:-5.040745},{verbatimCoordinates:"N 48° 30,6410', E 18° 57,4583'",verbatimLatitude:"N 48° 30,6410'",verbatimLongitude:"E 18° 57,4583'",decimalLatitude:48.51068,decimalLongitude:18.95764},{verbatimCoordinates:"1.23456, 18.33453",verbatimLatitude:"1.23456",verbatimLongitude:"18.33453",decimalLatitude:1.23456,decimalLongitude:18.33453}];function wi(){const i=[];return $i.forEach(e=>{e.decimalLatitude?i.push(e):i.push({...e,...Ei})}),[...i,..._i,...Li]}const Si=wi();xe.formats=Si.map(i=>i.verbatimCoordinates);const Mi=xe;/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const Ce={ATTRIBUTE:1,CHILD:2},Ie=i=>(...e)=>({_$litDirective$:i,values:e});let Te=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,s){this._$Ct=e,this._$AM=t,this._$Ci=s}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};/**
* @license
* Copyright 2018 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const me=Ie(class extends Te{constructor(i){if(super(i),i.type!==Ce.ATTRIBUTE||i.name!=="class"||i.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(i){return" "+Object.keys(i).filter((e=>i[e])).join(" ")+" "}update(i,[e]){if(this.st===void 0){this.st=new Set,i.strings!==void 0&&(this.nt=new Set(i.strings.join(" ").split(/\s/).filter((s=>s!==""))));for(const s in e)e[s]&&!this.nt?.has(s)&&this.st.add(s);return this.render(e)}const t=i.element.classList;for(const s of this.st)s in e||(t.remove(s),this.st.delete(s));for(const s in e){const r=!!e[s];r===this.st.has(s)||this.nt?.has(s)||(r?(t.add(s),this.st.add(s)):(t.remove(s),this.st.delete(s)))}return G}});/**
* @license
* Copyright 2020 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const{I:Ai}=Xt,mt=()=>document.createComment(""),se=(i,e,t)=>{const s=i._$AA.parentNode,r=e===void 0?i._$AB:e._$AA;if(t===void 0){const o=s.insertBefore(mt(),r),a=s.insertBefore(mt(),r);t=new Ai(o,a,i,i.options)}else{const o=t._$AB.nextSibling,a=t._$AM,n=a!==i;if(n){let l;t._$AQ?.(i),t._$AM=i,t._$AP!==void 0&&(l=i._$AU)!==a._$AU&&t._$AP(l)}if(o!==r||n){let l=t._$AA;for(;l!==o;){const g=l.nextSibling;s.insertBefore(l,r),l=g}}}return t},j=(i,e,t=i)=>(i._$AI(e,t),i),xi={},Ci=(i,e=xi)=>i._$AH=e,Ii=i=>i._$AH,Ne=i=>{i._$AR(),i._$AA.remove()};/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const ft=(i,e,t)=>{const s=new Map;for(let r=e;r<=t;r++)s.set(i[r],r);return s},Ti=Ie(class extends Te{constructor(i){if(super(i),i.type!==Ce.CHILD)throw Error("repeat() can only be used in text expressions")}dt(i,e,t){let s;t===void 0?t=e:e!==void 0&&(s=e);const r=[],o=[];let a=0;for(const n of i)r[a]=s?s(n,a):a,o[a]=t(n,a),a++;return{values:o,keys:r}}render(i,e,t){return this.dt(i,e,t).values}update(i,[e,t,s]){const r=Ii(i),{values:o,keys:a}=this.dt(e,t,s);if(!Array.isArray(r))return this.ut=a,o;const n=this.ut??=[],l=[];let g,v,d=0,b=r.length-1,m=0,y=o.length-1;for(;d<=b&&m<=y;)if(r[d]===null)d++;else if(r[b]===null)b--;else if(n[d]===a[m])l[m]=j(r[d],o[m]),d++,m++;else if(n[b]===a[y])l[y]=j(r[b],o[y]),b--,y--;else if(n[d]===a[y])l[y]=j(r[d],o[y]),se(i,l[y+1],r[d]),d++,y--;else if(n[b]===a[m])l[m]=j(r[b],o[m]),se(i,r[d],r[b]),b--,m++;else if(g===void 0&&(g=ft(a,m,y),v=ft(n,d,b)),g.has(n[d]))if(g.has(n[b])){const L=v.get(a[m]),A=L!==void 0?r[L]:null;if(A===null){const E=se(i,r[d]);j(E,o[m]),l[m]=E}else l[m]=j(A,o[m]),se(i,r[d],A),r[L]=null;m++}else Ne(r[b]),b--;else Ne(r[d]),d++;for(;m<=y;){const L=se(i,l[y+1]);j(L,o[m]),l[m++]=L}for(;d<=b;){const L=r[d++];L!==null&&Ne(L)}return this.ut=a,Ci(i,l),G}});function Ni(i,e,t){const s=e[1],r=e[0],o=s-r;return i===s&&t?i:((i-r)%o+o)%o+r}let re;async function ki(i,e,t){for(const s of e??[])if(!(i&&(s.minZoom!=null&&s.minZoom>i[0]||s.maxZoom!=null&&s.maxZoom<i[0]))){if(s.type==="fixed")return s.coordinates.join(",");if(s.type==="client-geolocation")if(re&&s.cachedLocationExpiry&&re.time+s.cachedLocationExpiry>Date.now()){if(re.coords)return re.coords}else{let r;try{return r=await new Promise((o,a)=>{t.signal.addEventListener("abort",()=>{a(Error("aborted"))}),navigator.geolocation.getCurrentPosition(n=>{o([n.coords.longitude,n.coords.latitude].map(l=>l.toFixed(6)).join(","))},n=>{a(n)},s)}),r}catch{}finally{s.cachedLocationExpiry&&(re={time:Date.now(),coords:r})}if(t.signal.aborted)return}if(s.type==="server-geolocation")return"ip";if(i&&s.type==="map-center")return i[1].toFixed(6)+","+i[2].toFixed(6)}}/**
* @license
* Copyright 2018 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const vt="important",Oi=" !"+vt,Gi=Ie(class extends Te{constructor(i){if(super(i),i.type!==Ce.ATTRIBUTE||i.name!=="style"||i.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(i){return Object.keys(i).reduce(((e,t)=>{const s=i[t];return s==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`}),"")}update(i,[e]){const{style:t}=i.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const s of this.ft)e[s]==null&&(this.ft.delete(s),s.includes("-")?t.removeProperty(s):t[s]=null);for(const s in e){const r=e[s];if(r!=null){this.ft.add(s);const o=typeof r=="string"&&r.endsWith(Oi);s.includes("-")||o?t.setProperty(s,o?r.slice(0,-11):r,o?vt:""):t[s]=r}}return G}}),Ui=".sprite-icon{align-self:center;justify-self:center;opacity:.75;background-repeat:no-repeat}li{text-align:left;cursor:default;display:grid;grid-template-columns:40px 1fr;color:var(--color-text);padding:8px 0;font-size:14px;line-height:18px;min-width:fit-content;outline:0}li:first-child{padding-top:10px}li:last-child{padding-bottom:10px}li.picked{background-color:#e7edff}li.picked .secondary{color:#96a4c7;padding-left:4px}li.picked .line2{color:#96a4c7}li.selected{background-color:#f3f6ff;animation:backAndForth 5s linear infinite}li.selected .primary{color:#2b8bfb}li.selected .secondary{color:#a2adc7;padding-left:4px}li.selected .line2{color:#a2adc7}li>img{align-self:center;justify-self:center;opacity:.75}.texts{padding:0 17px 0 0}.texts>*{white-space:nowrap;display:block;min-width:fit-content}.primary{font-weight:600}.secondary{color:#aeb6c7;padding-left:4px}.line2{color:#aeb6c7}@keyframes backAndForth{0%{transform:translate(0)}10%{transform:translate(0)}45%{transform:translate(calc(-100% + 270px))}55%{transform:translate(calc(-100% + 270px))}90%{transform:translate(0)}to{transform:translate(0)}}";var Wi=Object.defineProperty,Pi=Object.getOwnPropertyDescriptor,gt=i=>{throw TypeError(i)},O=(i,e,t,s)=>{for(var r=s>1?void 0:s?Pi(e,t):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(r=(s?a(e,t,r):a(r))||r);return s&&r&&Wi(e,t,r),r},bt=(i,e,t)=>e.has(i)||gt("Cannot "+t),_=(i,e,t)=>(bt(i,e,"read from private field"),t?t.call(i):e.get(i)),Fi=(i,e,t)=>e.has(i)?gt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),K=(i,e,t)=>(bt(i,e,"access private method"),t),$,fe,oe,M,yt,$t,ke,Oe;const Et=typeof devicePixelRatio>"u"||devicePixelRatio>1.25,_t=Et?"@2x":"",Q=Et?2:1;let z,Lt,I=class extends k{constructor(){super(...arguments),Fi(this,$),this.itemStyle="default",this.showPlaceType="if-needed",this.missingIconsCache=new Set,this.iconsBaseUrl="",this.index=0}willUpdate(i){i.has("feature")&&_(this,$,fe)&&(this.index=_(this,$,fe).length,K(this,$,ke).call(this))}render(){return S`
<li
tabindex="-1"
role="option"
aria-selected=${this.itemStyle==="selected"}
aria-checked=${this.itemStyle==="picked"}
class=${this.itemStyle}
@click=${()=>this.dispatchEvent(new CustomEvent("select"))}
>
${z&&this.spriteIcon?S`
<div
class="sprite-icon"
style=${Gi({width:`${this.spriteIcon.width/Q}px`,height:`${this.spriteIcon.height/Q}px`,backgroundImage:`url(${this.iconsBaseUrl}sprite${_t}.png)`,backgroundPosition:`-${this.spriteIcon.x/Q}px -${this.spriteIcon.y/Q}px`,backgroundSize:`${z.width/Q}px ${z.height/Q}px`})}
title=${_(this,$,M)}
/>
`:this.imageUrl?S` <img src=${this.imageUrl} alt=${this.category} title=${_(this,$,M)} @error=${K(this,$,$t)} />`:this.feature?.address?S` <img src=${this.iconsBaseUrl+"housenumber.svg"} alt=${_(this,$,M)} title=${_(this,$,M)} /> `:this.feature?.id.startsWith("road.")?S` <img src=${this.iconsBaseUrl+"road.svg"} alt=${_(this,$,M)} title=${_(this,$,M)} /> `:this.feature?.id.startsWith("address.")?S` <img src=${this.iconsBaseUrl+"street.svg"} alt=${_(this,$,M)} title=${_(this,$,M)} /> `:this.feature?.id.startsWith("postal_code.")?S` <img src=${this.iconsBaseUrl+"postal_code.svg"} alt=${_(this,$,M)} title=${_(this,$,M)} /> `:this.feature?.id.startsWith("poi.")?S` <img src=${this.iconsBaseUrl+"poi.svg"} alt=${_(this,$,M)} title=${_(this,$,M)} /> `:_(this,$,oe)?S` <img src=${this.iconsBaseUrl+"reverse.svg"} alt=${_(this,$,M)} title=${_(this,$,M)} /> `:S` <img src=${this.iconsBaseUrl+"area.svg"} alt=${_(this,$,M)} title=${_(this,$,M)} /> `}
<span class="texts">
<span>
<span class="primary"> ${_(this,$,oe)?this.feature?.place_name:this.feature?.place_name.replace(/,.*/,"")} </span>
${this.showPlaceType==="always"||this.showPlaceType!=="never"&&!this.feature?.address&&!this.feature?.id.startsWith("road.")&&!this.feature?.id.startsWith("address.")&&!this.feature?.id.startsWith("postal_code.")&&(!this.feature?.id.startsWith("poi.")||!this.imageUrl)&&!_(this,$,oe)?S` <span class="secondary"> ${_(this,$,M)} </span> `:w}
</span>
<span class="line2"> ${_(this,$,oe)?this.feature?.text:this.feature?.place_name.replace(/[^,]*,?s*/,"")} </span>
</span>
</li>
`}};$=new WeakSet,fe=function(){return this.feature?.properties?.categories},oe=function(){return this.feature?.place_type[0]==="reverse"},M=function(){return this.feature?.properties?.categories?.join(", ")??this.feature?.place_type_name?.[0]??this.feature?.place_type[0]},yt=function(){Lt??=fetch(`${this.iconsBaseUrl}sprite${_t}.json`).then(i=>i.json()).then(i=>{z=i}).catch(()=>{z=null})},$t=function(){this.imageUrl&&this.missingIconsCache.add(this.imageUrl),K(this,$,ke).call(this)},ke=function(){z!==void 0?K(this,$,Oe).call(this):(K(this,$,yt).call(this),Lt?.then(()=>{K(this,$,Oe).call(this)}))},Oe=function(){do{if(this.index--,this.category=_(this,$,fe)?.[this.index],this.spriteIcon=this.category?z?.icons[this.category]:void 0,this.spriteIcon)break;this.imageUrl=this.category?this.iconsBaseUrl+this.category.replace(/ /g,"_")+".svg":void 0}while(this.index>-1&&(!this.imageUrl||this.missingIconsCache.has(this.imageUrl)))},I.styles=F`
${_e(Ui)}
`,O([f({type:Object})],I.prototype,"feature",2),O([f({type:String})],I.prototype,"itemStyle",2),O([f({type:String})],I.prototype,"showPlaceType",2),O([f({attribute:!1})],I.prototype,"missingIconsCache",2),O([f({type:String})],I.prototype,"iconsBaseUrl",2),O([x()],I.prototype,"category",2),O([x()],I.prototype,"imageUrl",2),O([x()],I.prototype,"spriteIcon",2),O([x()],I.prototype,"index",2),I=O([B("maptiler-geocoder-feature-item")],I);const Ri="form{font-family:Open Sans,Ubuntu,Helvetica Neue,Arial,Helvetica,sans-serif;position:relative;background-color:#fff;z-index:10;border-radius:4px;margin:0;transition:max-width .25s;box-shadow:0 2px 5px #33335926;--color-text: #444952;--color-icon-button: #444952;pointer-events:all}form,form *,form *:after,form *:before{box-sizing:border-box}form.can-collapse{max-width:29px}form.can-collapse input::placeholder{transition:opacity .25s;opacity:0}form{width:270px;max-width:270px}form:focus-within,form:hover{width:270px;max-width:270px}form input::placeholder,form:focus-within input::placeholder,form:hover input::placeholder{opacity:1}input{font:inherit;font-size:14px;flex-grow:1;min-height:29px;background-color:transparent;color:#444952;white-space:nowrap;overflow:hidden;border:0;margin:0;padding:0}input:focus{color:#444952;outline:0;outline:none;box-shadow:none}ul,div.error,div.no-res