@tomtom-org/maps-sdk 0.36.4 → 0.36.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- import{generateTomTomHeaders as e,generateId as t,poiCategoriesToID as r,bboxFromCoordsArray as i,bboxCenter as o,TomTomConfig as a,formatDuration as s,getPosition as n,formatDistance as c,mergeFromGlobal as l,indexedMagnitudes as A}from"@tomtom-org/maps-sdk/core";import{Map as _,getRTLTextPluginStatus as u,setRTLTextPlugin as E}from"maplibre-gl";var R="object"==typeof global&&global&&global.Object===Object&&global,T="object"==typeof self&&self&&self.Object===Object&&self,h=R||T||Function("return this")(),I=h.Symbol,p=Object.prototype,S=p.hasOwnProperty,f=p.toString,d=I?I.toStringTag:void 0;var N=Object.prototype.toString;var y=I?I.toStringTag:void 0;function O(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":y&&y in Object(e)?function(e){var t=S.call(e,d),r=e[d];try{e[d]=void 0;var i=!0}catch(a){}var o=f.call(e);return i&&(t?e[d]=r:delete e[d]),o}(e):function(e){return N.call(e)}(e)}function L(e){return null!=e&&"object"==typeof e}function C(e){return"symbol"==typeof e||L(e)&&"[object Symbol]"==O(e)}function g(e,t){for(var r=-1,i=null==e?0:e.length,o=Array(i);++r<i;)o[r]=t(e[r],r,e);return o}var m=Array.isArray,U=I?I.prototype:void 0,b=U?U.toString:void 0;function M(e){if("string"==typeof e)return e;if(m(e))return g(e,M)+"";if(C(e))return b?b.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function P(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function v(e){return e}function D(e){if(!P(e))return!1;var t=O(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var H,w=h["__core-js_shared__"],F=(H=/[^.]+$/.exec(w&&w.keys&&w.keys.IE_PROTO||""))?"Symbol(src)_1."+H:"";var G=Function.prototype.toString;function B(e){if(null!=e){try{return G.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var x=/^\[object .+?Constructor\]$/,V=Function.prototype,W=Object.prototype,Y=V.toString,j=W.hasOwnProperty,k=RegExp("^"+Y.call(j).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function K(e){return!(!P(e)||(t=e,F&&F in t))&&(D(e)?k:x).test(B(e));var t}function z(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return K(r)?r:void 0}var $=z(h,"WeakMap");var X=Date.now;var Z,J,Q,q=function(){try{var e=z(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),ee=q?function(e,t){return q(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:v,te=(Z=ee,J=0,Q=0,function(){var e=X(),t=16-(e-Q);if(Q=e,t>0){if(++J>=800)return arguments[0]}else J=0;return Z.apply(void 0,arguments)});var re=/^(?:0|[1-9]\d*)$/;function ie(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&re.test(e))&&e>-1&&e%1==0&&e<t}function oe(e,t,r){"__proto__"==t&&q?q(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function ae(e,t){return e===t||e!=e&&t!=t}var se=Object.prototype.hasOwnProperty;function ne(e,t,r){var i=e[t];se.call(e,t)&&ae(i,r)&&(void 0!==r||t in e)||oe(e,t,r)}var ce=Math.max;function le(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Ae(e){return null!=e&&le(e.length)&&!D(e)}var _e=Object.prototype;function ue(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||_e)}function Ee(e){return L(e)&&"[object Arguments]"==O(e)}var Re=Object.prototype,Te=Re.hasOwnProperty,he=Re.propertyIsEnumerable,Ie=Ee(/* @__PURE__ */function(){return arguments}())?Ee:function(e){return L(e)&&Te.call(e,"callee")&&!he.call(e,"callee")};var pe="object"==typeof exports&&exports&&!exports.nodeType&&exports,Se=pe&&"object"==typeof module&&module&&!module.nodeType&&module,fe=Se&&Se.exports===pe?h.Buffer:void 0,de=(fe?fe.isBuffer:void 0)||function(){return!1},Ne={};function ye(e){return function(t){return e(t)}}Ne["[object Float32Array]"]=Ne["[object Float64Array]"]=Ne["[object Int8Array]"]=Ne["[object Int16Array]"]=Ne["[object Int32Array]"]=Ne["[object Uint8Array]"]=Ne["[object Uint8ClampedArray]"]=Ne["[object Uint16Array]"]=Ne["[object Uint32Array]"]=!0,Ne["[object Arguments]"]=Ne["[object Array]"]=Ne["[object ArrayBuffer]"]=Ne["[object Boolean]"]=Ne["[object DataView]"]=Ne["[object Date]"]=Ne["[object Error]"]=Ne["[object Function]"]=Ne["[object Map]"]=Ne["[object Number]"]=Ne["[object Object]"]=Ne["[object RegExp]"]=Ne["[object Set]"]=Ne["[object String]"]=Ne["[object WeakMap]"]=!1;var Oe="object"==typeof exports&&exports&&!exports.nodeType&&exports,Le=Oe&&"object"==typeof module&&module&&!module.nodeType&&module,Ce=Le&&Le.exports===Oe&&R.process,ge=function(){try{var e=Le&&Le.require&&Le.require("util").types;return e||Ce&&Ce.binding&&Ce.binding("util")}catch(t){}}(),me=ge&&ge.isTypedArray,Ue=me?ye(me):function(e){return L(e)&&le(e.length)&&!!Ne[O(e)]},be=Object.prototype.hasOwnProperty;function Me(e,t){var r=m(e),i=!r&&Ie(e),o=!r&&!i&&de(e),a=!r&&!i&&!o&&Ue(e),s=r||i||o||a,n=s?function(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}(e.length,String):[],c=n.length;for(var l in e)!t&&!be.call(e,l)||s&&("length"==l||o&&("offset"==l||"parent"==l)||a&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||ie(l,c))||n.push(l);return n}function Pe(e,t){return function(r){return e(t(r))}}var ve=Pe(Object.keys,Object),De=Object.prototype.hasOwnProperty;function He(e){if(!ue(e))return ve(e);var t=[];for(var r in Object(e))De.call(e,r)&&"constructor"!=r&&t.push(r);return t}function we(e){return Ae(e)?Me(e):He(e)}var Fe=Object.prototype.hasOwnProperty;function Ge(e){if(!P(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=ue(e),r=[];for(var i in e)("constructor"!=i||!t&&Fe.call(e,i))&&r.push(i);return r}function Be(e){return Ae(e)?Me(e,!0):Ge(e)}var xe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ve=/^\w*$/;function We(e,t){if(m(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!C(e))||(Ve.test(e)||!xe.test(e)||null!=t&&e in Object(t))}var Ye=z(Object,"create");var je=Object.prototype.hasOwnProperty;var ke=Object.prototype.hasOwnProperty;function Ke(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function ze(e,t){for(var r=e.length;r--;)if(ae(e[r][0],t))return r;return-1}Ke.prototype.clear=function(){this.__data__=Ye?Ye(null):{},this.size=0},Ke.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ke.prototype.get=function(e){var t=this.__data__;if(Ye){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return je.call(t,e)?t[e]:void 0},Ke.prototype.has=function(e){var t=this.__data__;return Ye?void 0!==t[e]:ke.call(t,e)},Ke.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Ye&&void 0===t?"__lodash_hash_undefined__":t,this};var $e=Array.prototype.splice;function Xe(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}Xe.prototype.clear=function(){this.__data__=[],this.size=0},Xe.prototype.delete=function(e){var t=this.__data__,r=ze(t,e);return!(r<0)&&(r==t.length-1?t.pop():$e.call(t,r,1),--this.size,!0)},Xe.prototype.get=function(e){var t=this.__data__,r=ze(t,e);return r<0?void 0:t[r][1]},Xe.prototype.has=function(e){return ze(this.__data__,e)>-1},Xe.prototype.set=function(e,t){var r=this.__data__,i=ze(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this};var Ze=z(h,"Map");function Je(e,t){var r,i,o=e.__data__;return("string"==(i=typeof(r=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function Qe(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}Qe.prototype.clear=function(){this.size=0,this.__data__={hash:new Ke,map:new(Ze||Xe),string:new Ke}},Qe.prototype.delete=function(e){var t=Je(this,e).delete(e);return this.size-=t?1:0,t},Qe.prototype.get=function(e){return Je(this,e).get(e)},Qe.prototype.has=function(e){return Je(this,e).has(e)},Qe.prototype.set=function(e,t){var r=Je(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this};function qe(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var i=arguments,o=t?t.apply(this,i):i[0],a=r.cache;if(a.has(o))return a.get(o);var s=e.apply(this,i);return r.cache=a.set(o,s)||a,s};return r.cache=new(qe.Cache||Qe),r}qe.Cache=Qe;var et=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tt=/\\(\\)?/g,rt=function(e){var t=qe(e,function(e){return 500===r.size&&r.clear(),e}),r=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(et,function(e,r,i,o){t.push(i?o.replace(tt,"$1"):r||e)}),t});function it(e,t){return m(e)?e:We(e,t)?[e]:rt(function(e){return null==e?"":M(e)}(e))}function ot(e){if("string"==typeof e||C(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function at(e,t){for(var r=0,i=(t=it(t,e)).length;null!=e&&r<i;)e=e[ot(t[r++])];return r&&r==i?e:void 0}function st(e,t){for(var r=-1,i=t.length,o=e.length;++r<i;)e[o+r]=t[r];return e}var nt=I?I.isConcatSpreadable:void 0;function ct(e){return m(e)||Ie(e)||!!(nt&&e&&e[nt])}function lt(e){return(null==e?0:e.length)?function(e,t,r,i,o){var a=-1,s=e.length;for(r||(r=ct),o||(o=[]);++a<s;){var n=e[a];r(n)?st(o,n):o[o.length]=n}return o}(e):[]}var At=Pe(Object.getPrototypeOf,Object),_t=Function.prototype,ut=Object.prototype,Et=_t.toString,Rt=ut.hasOwnProperty,Tt=Et.call(Object);function ht(e){var t=this.__data__=new Xe(e);this.size=t.size}ht.prototype.clear=function(){this.__data__=new Xe,this.size=0},ht.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},ht.prototype.get=function(e){return this.__data__.get(e)},ht.prototype.has=function(e){return this.__data__.has(e)},ht.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Xe){var i=r.__data__;if(!Ze||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new Qe(i)}return r.set(e,t),this.size=r.size,this};var It="object"==typeof exports&&exports&&!exports.nodeType&&exports,pt=It&&"object"==typeof module&&module&&!module.nodeType&&module,St=pt&&pt.exports===It?h.Buffer:void 0;function ft(){return[]}St&&St.allocUnsafe;var dt=Object.prototype.propertyIsEnumerable,Nt=Object.getOwnPropertySymbols,yt=Nt?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var r=-1,i=null==e?0:e.length,o=0,a=[];++r<i;){var s=e[r];t(s,r,e)&&(a[o++]=s)}return a}(Nt(e),function(t){return dt.call(e,t)}))}:ft,Ot=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)st(t,yt(e)),e=At(e);return t}:ft;function Lt(e,t,r){var i=t(e);return m(e)?i:st(i,r(e))}function Ct(e){return Lt(e,we,yt)}function gt(e){return Lt(e,Be,Ot)}var mt=z(h,"DataView"),Ut=z(h,"Promise"),bt=z(h,"Set"),Mt="[object Map]",Pt="[object Promise]",vt="[object Set]",Dt="[object WeakMap]",Ht="[object DataView]",wt=B(mt),Ft=B(Ze),Gt=B(Ut),Bt=B(bt),xt=B($),Vt=O;(mt&&Vt(new mt(new ArrayBuffer(1)))!=Ht||Ze&&Vt(new Ze)!=Mt||Ut&&Vt(Ut.resolve())!=Pt||bt&&Vt(new bt)!=vt||$&&Vt(new $)!=Dt)&&(Vt=function(e){var t=O(e),r="[object Object]"==t?e.constructor:void 0,i=r?B(r):"";if(i)switch(i){case wt:return Ht;case Ft:return Mt;case Gt:return Pt;case Bt:return vt;case xt:return Dt}return t});var Wt=Object.prototype.hasOwnProperty;var Yt=h.Uint8Array;function jt(e){var t=new e.constructor(e.byteLength);return new Yt(t).set(new Yt(e)),t}var kt=/\w*$/;var Kt=I?I.prototype:void 0,zt=Kt?Kt.valueOf:void 0;function $t(e,t,r){var i,o,a,s,n,c=e.constructor;switch(t){case"[object ArrayBuffer]":return jt(e);case"[object Boolean]":case"[object Date]":return new c(+e);case"[object DataView]":return n=jt((s=e).buffer),new s.constructor(n,s.byteOffset,s.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e){var t=jt(e.buffer);return new e.constructor(t,e.byteOffset,e.length)}(e);case"[object Map]":case"[object Set]":return new c;case"[object Number]":case"[object String]":return new c(e);case"[object RegExp]":return(a=new(o=e).constructor(o.source,kt.exec(o))).lastIndex=o.lastIndex,a;case"[object Symbol]":return i=e,zt?Object(zt.call(i)):{}}}var Xt=ge&&ge.isMap,Zt=Xt?ye(Xt):function(e){return L(e)&&"[object Map]"==Vt(e)};var Jt=ge&&ge.isSet,Qt=Jt?ye(Jt):function(e){return L(e)&&"[object Set]"==Vt(e)},qt="[object Arguments]",er="[object Function]",tr="[object Object]",rr={};function ir(e,t,r,i,o,a){var s;if(r&&(s=o?r(e,i,o,a):r(e)),void 0!==s)return s;if(!P(e))return e;var n=m(e);if(n)s=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Wt.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e);else{var c=Vt(e),l=c==er||"[object GeneratorFunction]"==c;if(de(e))return e.slice();if(c==tr||c==qt||l&&!o)s={};else{if(!rr[c])return o?e:{};s=$t(e,c)}}a||(a=new ht);var A=a.get(e);if(A)return A;a.set(e,s),Qt(e)?e.forEach(function(i){s.add(ir(i,t,r,i,e,a))}):Zt(e)&&e.forEach(function(i,o){s.set(o,ir(i,t,r,o,e,a))});var _=n?void 0:gt(e);return function(e,t){for(var r=-1,i=null==e?0:e.length;++r<i&&!1!==t(e[r],r,e););}(_||e,function(i,o){_&&(i=e[o=i]),ne(s,o,ir(i,t,r,o,e,a))}),s}rr[qt]=rr["[object Array]"]=rr["[object ArrayBuffer]"]=rr["[object DataView]"]=rr["[object Boolean]"]=rr["[object Date]"]=rr["[object Float32Array]"]=rr["[object Float64Array]"]=rr["[object Int8Array]"]=rr["[object Int16Array]"]=rr["[object Int32Array]"]=rr["[object Map]"]=rr["[object Number]"]=rr[tr]=rr["[object RegExp]"]=rr["[object Set]"]=rr["[object String]"]=rr["[object Symbol]"]=rr["[object Uint8Array]"]=rr["[object Uint8ClampedArray]"]=rr["[object Uint16Array]"]=rr["[object Uint32Array]"]=!0,rr["[object Error]"]=rr[er]=rr["[object WeakMap]"]=!1;function or(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new Qe;++t<r;)this.add(e[t])}function ar(e,t){for(var r=-1,i=null==e?0:e.length;++r<i;)if(t(e[r],r,e))return!0;return!1}or.prototype.add=or.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},or.prototype.has=function(e){return this.__data__.has(e)};function sr(e,t,r,i,o,a){var s=1&r,n=e.length,c=t.length;if(n!=c&&!(s&&c>n))return!1;var l=a.get(e),A=a.get(t);if(l&&A)return l==t&&A==e;var _=-1,u=!0,E=2&r?new or:void 0;for(a.set(e,t),a.set(t,e);++_<n;){var R=e[_],T=t[_];if(i)var h=s?i(T,R,_,t,e,a):i(R,T,_,e,t,a);if(void 0!==h){if(h)continue;u=!1;break}if(E){if(!ar(t,function(e,t){if(s=t,!E.has(s)&&(R===e||o(R,e,r,i,a)))return E.push(t);var s})){u=!1;break}}else if(R!==T&&!o(R,T,r,i,a)){u=!1;break}}return a.delete(e),a.delete(t),u}function nr(e){var t=-1,r=Array(e.size);return e.forEach(function(e,i){r[++t]=[i,e]}),r}function cr(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}var lr=I?I.prototype:void 0,Ar=lr?lr.valueOf:void 0;var _r=Object.prototype.hasOwnProperty;var ur="[object Arguments]",Er="[object Array]",Rr="[object Object]",Tr=Object.prototype.hasOwnProperty;function hr(e,t,r,i,o,a){var s=m(e),n=m(t),c=s?Er:Vt(e),l=n?Er:Vt(t),A=(c=c==ur?Rr:c)==Rr,_=(l=l==ur?Rr:l)==Rr,u=c==l;if(u&&de(e)){if(!de(t))return!1;s=!0,A=!1}if(u&&!A)return a||(a=new ht),s||Ue(e)?sr(e,t,r,i,o,a):function(e,t,r,i,o,a,s){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!a(new Yt(e),new Yt(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ae(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var n=nr;case"[object Set]":var c=1&i;if(n||(n=cr),e.size!=t.size&&!c)return!1;var l=s.get(e);if(l)return l==t;i|=2,s.set(e,t);var A=sr(n(e),n(t),i,o,a,s);return s.delete(e),A;case"[object Symbol]":if(Ar)return Ar.call(e)==Ar.call(t)}return!1}(e,t,c,r,i,o,a);if(!(1&r)){var E=A&&Tr.call(e,"__wrapped__"),R=_&&Tr.call(t,"__wrapped__");if(E||R){var T=E?e.value():e,h=R?t.value():t;return a||(a=new ht),o(T,h,r,i,a)}}return!!u&&(a||(a=new ht),function(e,t,r,i,o,a){var s=1&r,n=Ct(e),c=n.length;if(c!=Ct(t).length&&!s)return!1;for(var l=c;l--;){var A=n[l];if(!(s?A in t:_r.call(t,A)))return!1}var _=a.get(e),u=a.get(t);if(_&&u)return _==t&&u==e;var E=!0;a.set(e,t),a.set(t,e);for(var R=s;++l<c;){var T=e[A=n[l]],h=t[A];if(i)var I=s?i(h,T,A,t,e,a):i(T,h,A,e,t,a);if(!(void 0===I?T===h||o(T,h,r,i,a):I)){E=!1;break}R||(R="constructor"==A)}if(E&&!R){var p=e.constructor,S=t.constructor;p==S||!("constructor"in e)||!("constructor"in t)||"function"==typeof p&&p instanceof p&&"function"==typeof S&&S instanceof S||(E=!1)}return a.delete(e),a.delete(t),E}(e,t,r,i,o,a))}function Ir(e,t,r,i,o){return e===t||(null==e||null==t||!L(e)&&!L(t)?e!=e&&t!=t:hr(e,t,r,i,Ir,o))}function pr(e){return e==e&&!P(e)}function Sr(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}function fr(e){var t=function(e){for(var t=we(e),r=t.length;r--;){var i=t[r],o=e[i];t[r]=[i,o,pr(o)]}return t}(e);return 1==t.length&&t[0][2]?Sr(t[0][0],t[0][1]):function(r){return r===e||function(e,t,r,i){var o=r.length,a=o;if(null==e)return!a;for(e=Object(e);o--;){var s=r[o];if(s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++o<a;){var n=(s=r[o])[0],c=e[n],l=s[1];if(s[2]){if(void 0===c&&!(n in e))return!1}else if(!Ir(l,c,3,i,new ht))return!1}return!0}(r,0,t)}}function dr(e,t){return null!=e&&t in Object(e)}function Nr(e,t){return null!=e&&function(e,t,r){for(var i=-1,o=(t=it(t,e)).length,a=!1;++i<o;){var s=ot(t[i]);if(!(a=null!=e&&r(e,s)))break;e=e[s]}return a||++i!=o?a:!!(o=null==e?0:e.length)&&le(o)&&ie(s,o)&&(m(e)||Ie(e))}(e,t,dr)}function yr(e,t){return We(e)&&pr(t)?Sr(ot(e),t):function(r){var i=function(e,t,r){var i=null==e?void 0:at(e,t);return void 0===i?r:i}(r,e);return void 0===i&&i===t?Nr(r,e):Ir(t,i,3)}}function Or(e){return We(e)?(t=ot(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return at(t,e)}}(e);var t}function Lr(e){return"function"==typeof e?e:null==e?v:"object"==typeof e?m(e)?yr(e[0],e[1]):fr(e):Or(e)}function Cr(e,t){return t.length<2?e:at(e,function(e,t,r){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(o);++i<o;)a[i]=e[i+t];return a}(t,0,-1))}var gr=Object.prototype.hasOwnProperty;function mr(e){if(null==e)return!0;if(Ae(e)&&(m(e)||"string"==typeof e||"function"==typeof e.splice||de(e)||Ue(e)||Ie(e)))return!e.length;var t=Vt(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(ue(e))return!He(e).length;for(var r in e)if(gr.call(e,r))return!1;return!0}function Ur(e,t){return Ir(e,t)}function br(e){return null==e}function Mr(e,t){return null==(e=Cr(e,t=it(t,e)))||delete e[ot((r=t,i=null==r?0:r.length,i?r[i-1]:void 0))];var r,i}function Pr(e){return function(e){if(!L(e)||"[object Object]"!=O(e))return!1;var t=At(e);if(null===t)return!0;var r=Rt.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Et.call(r)==Tt}(e)?void 0:e}var vr=function(e){return te(function(e,t,r){return t=ce(void 0===t?e.length-1:t,0),function(){for(var i=arguments,o=-1,a=ce(i.length-t,0),s=Array(a);++o<a;)s[o]=i[t+o];o=-1;for(var n=Array(t+1);++o<t;)n[o]=i[o];return n[t]=r(s),function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}(e,this,n)}}(e,void 0,lt),e+"")}(function(e,t){var r={};if(null==e)return r;var i=!1;t=g(t,function(t){return t=it(t,e),i||(i=t.length>1),t}),function(e,t,r){var i=!r;r||(r={});for(var o=-1,a=t.length;++o<a;){var s=t[o],n=void 0;void 0===n&&(n=e[s]),i?oe(r,s,n):ne(r,s,n)}}(e,gt(e),r),i&&(r=ir(r,7,Pr));for(var o=t.length;o--;)Mr(r,t[o]);return r});function Dr(e,t,r,i){if(!P(e))return e;for(var o=-1,a=(t=it(t,e)).length,s=a-1,n=e;null!=n&&++o<a;){var c=ot(t[o]),l=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=s){var A=n[c];void 0===(l=void 0)&&(l=P(A)?A:ie(t[o+1])?[]:{})}ne(n,c,l),n=n[c]}return e}function Hr(e,t){if(null==e)return{};var r=g(gt(e),function(e){return[e]});return t=Lr(t),function(e,t,r){for(var i=-1,o=t.length,a={};++i<o;){var s=t[i],n=at(e,s);r(n,s)&&Dr(a,it(s,e),n)}return a}(e,r,function(e,r){return t(e,r[0])})}function wr(e,t){return Hr(e,function(e){if("function"!=typeof e)throw new TypeError("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}(Lr(t)))}var Fr=Array.prototype.splice;function Gr(e,t){var r=[];if(!e||!e.length)return r;var i=-1,o=[],a=e.length;for(t=Lr(t);++i<a;){var s=e[i];t(s,i,e)&&(r.push(s),o.push(i))}return function(e,t){for(var r=e?t.length:0,i=r-1;r--;){var o=t[r];if(r==i||o!==a){var a=o;ie(o)?Fr.call(e,o,1):Mr(e,o)}}}(e,o),r}const Br=e=>new Error(`Trying to ${e} while it is not in the map style. Did you exclude it when loading the map?`),xr=()=>"undefined"!=typeof document&&"undefined"!=typeof DOMParser&&"undefined"!=typeof btoa,Vr=e=>{if(!xr())return;const t=document.createElement("img");return t.src=`data:image/svg+xml;base64,${btoa((new XMLSerializer).serializeToString(e))}`,t},Wr=e=>(new DOMParser).parseFromString(e,"image/svg+xml").documentElement,Yr=e=>{const t=Wr('<svg xmlns="http://www.w3.org/2000/svg" width="120" height="140">\n <path id="background" d="M63.95 137.516c6.556-12.737 19.098-21.09 30.828-29.388C110.046 97.324 120 79.603 120 59.574 120 26.671 93.138 0 60 0S0 26.671 0 59.574c0 20.029 9.954 37.75 25.22 48.55 11.734 8.302 24.274 16.652 30.83 29.388 1.706 3.316 6.194 3.316 7.9 0z"\n fill="#1988cf"/>\n <path id="outline" d="M91.298 103.272C105.052 93.544 114 77.596 114 59.574c0-29.61-24.176-53.617-54-53.617S6 29.964 6 59.574c0 18.022 8.95 33.97 22.7 43.698l2.27 1.601c10.172 7.153 21.922 15.423 29.03 27.416 7.104-11.993 18.858-20.259 29.03-27.416l2.268-1.601zm1.468 6.274c-11.13 7.845-22.632 15.957-28.816 27.966-1.706 3.316-6.194 3.316-7.9 0-6.182-12.009-17.686-20.121-28.816-27.966l-2.016-1.422C9.954 97.324 0 79.603 0 59.574 0 26.671 26.862 0 60 0s60 26.671 60 59.574c0 20.029-9.954 37.75-25.222 48.55l-2.016 1.422z"\n fill-opacity=".3"/>\n</svg>\n');return e?.fillColor&&t.querySelector("#background")?.setAttribute("fill",e.fillColor),e?.outlineColor&&t.querySelector("#outline")?.setAttribute("fill",e.outlineColor),void 0!==e?.outlineOpacity&&t.querySelector("#outline")?.setAttribute("fill-opacity",e.outlineOpacity.toString()),t};const jr=e=>(function(e){if(br(e))throw new Error(`${e} must not be null/undefined. Something went wrong with its initialization.`)}(e),e);class kr{constructor(e,t,r){this.id=e,this.spec=t,this.runtimeSource=r}ensureAddedToMap(e){this.runtimeSource||(!e.getSource(this.id)&&this.spec&&e.addSource(this.id,this.spec),this.runtimeSource=e.getSource(this.id))}}class Kr{constructor(e,t,r){this.map=e,this.source=t,this._layerSpecs=r,this._updateSourceAndLayerIDs()}isAnyLayerVisible(e){return this.getLayerSpecs(e).some(e=>this.isLayerVisible(e))}areAllLayersVisible(e){return this.getLayerSpecs(e).every(e=>this.isLayerVisible(e))}getLayerSpecs(e){return e?this._layerSpecs.filter(e):this._layerSpecs}_updateSourceAndLayerIDs(){this._sourceAndLayerIDs={sourceID:this.source.id,layerIDs:this._layerSpecs.map(e=>e.id)}}isLayerVisible(e){return"none"!==this.map.getLayoutProperty(e.id,"visibility")}setLayersVisible(e,t){for(const r of this.getLayerSpecs(t))this.map.setLayoutProperty(r.id,"visibility",e?"visible":"none",{validate:!1})}get sourceAndLayerIDs(){return this._sourceAndLayerIDs}equalSourceAndLayerIDs(e){return this.sourceAndLayerIDs.sourceID===e.sourceAndLayerIDs.sourceID&&this.sourceAndLayerIDs.layerIDs.length===e.sourceAndLayerIDs.layerIDs.length&&this.sourceAndLayerIDs.layerIDs.every((t,r)=>t===e.sourceAndLayerIDs.layerIDs[r])}}const zr=(e,t)=>e.getStyle().layers.filter(e=>t.includes(e?.source));class $r extends Kr{constructor(e,t,r){let i=zr(e,[t.id]);r&&(i=i.filter(r)),super(e,new kr(t.id,e.getStyle().sources[t.id],t),i)}}class Xr extends Kr{constructor(e,t,r,i){super(e,new kr(t,r),i.map(e=>({...e,source:t})))}ensureLayersAddedToMap(){for(const e of this._layerSpecs)this.map.getLayer(e.id)||this.map.addLayer(e,e.beforeID)}ensureAddedToMapWithVisibility(e,t){this.source.ensureAddedToMap(this.map),t&&(this.ensureLayersAddedToMap(),this.setLayersVisible(e))}}const Zr={type:"FeatureCollection",features:[]};class Jr extends Xr{constructor(e,t,r,i=!0){super(e,t,{type:"geojson",data:Zr,promoteId:"id"},r),this.shownFeatures=Zr,this.ensureAddedToMapWithVisibility(!1,i)}show(e){this.shownFeatures=e,jr(this.source.runtimeSource).setData(e),this.setLayersVisible(!!e.features.length)}clear(){this.show(Zr)}findFeature(e){return"index"in e?this.shownFeatures.features[e.index]:"id"in e?this.shownFeatures.features.find(t=>t.id===e.id):void 0}putEventState(e){if("put"===(e.mode??"put"))for(const r of this.shownFeatures.features)r.properties?.eventState===e.state&&delete r.properties.eventState;const t=this.findFeature(e);t&&(t.properties={...t.properties,eventState:e.state}),!1!==e.show&&this.show(this.shownFeatures)}cleanEventState(e){const t=this.findFeature(e);t?.properties?.eventState&&(delete t?.properties?.eventState,!1!==e?.show&&this.show(this.shownFeatures))}cleanEventStates(e){let t=!1;for(const r of this.shownFeatures.features)e?.states&&!e.states.includes(r.properties?.eventState)||(delete r.properties?.eventState,t=!0);!1!==e?.show&&t&&this.show(this.shownFeatures)}}const Qr=async e=>{e.mapReady||(await e.mapLibreMap.once("styledata"),await Qr(e))},qr=e=>{for(const r of e)if(r&&Object.keys(r.properties).length)for(const e in r.properties)if("string"==typeof r.properties[e])try{r.properties[e]=JSON.parse(r.properties[e])}catch(t){}},ei=(e,t,r)=>{const i=e.id;e.maxzoom===t.maxzoom&&e.minzoom===t.minzoom||r.setLayerZoomRange(i,e.minzoom??r.getMinZoom(),e.maxzoom??r.getMaxZoom()),r.setFilter(i,e.filter,{validate:!1});for(const o of Object.keys(t.layout??[]))e.layout?.[o]||r.setLayoutProperty(i,o,void 0,{validate:!1});for(const o of Object.keys(t.paint??[]))e.paint?.[o]||r.setPaintProperty(i,o,void 0,{validate:!1});for(const[o,a]of Object.entries(e.paint??[]))r.setPaintProperty(i,o,a,{validate:!1});for(const[o,a]of Object.entries(e.layout??[]))r.setLayoutProperty(i,o,a,{validate:!1})},ti=(e,t,r)=>{e.forEach((e,i)=>ei(e,t[i],r))},ri=(e,t)=>{const r=/* @__PURE__ */new Set,i=e=>{t.getLayer(e.id)||t.addLayer({...e,layout:{...e.layout,visibility:"none"}},e.beforeID),r.add(e.id)},o={};for(e.forEach(e=>{e.beforeID?r.has(e.beforeID)||t.getLayer(e.beforeID)?(r.add(e.beforeID),i(e)):o[e.beforeID]?o[e.beforeID].push(e):o[e.beforeID]=[e]:i(e)});Object.keys(o).length>0;){const e=Object.keys(o).filter(e=>r.has(e));if(0===e.length)throw Error(`Circular dependency for before Ids ${JSON.stringify(Object.keys(o))}`);e.forEach(e=>{o[e].forEach(e=>i(e)),delete o[e]})}},ii=(e,t)=>{switch(typeof e){case"undefined":return{type:"standard",include:[t]};case"string":return{type:"standard",id:e,include:[t]};default:if("standard"===e.type)return e.include?{...e,include:[...e.include,t]}:{...e,include:[t]};throw(e=>new Error(`Trying to add style module ${e} to the custom style!`))(t)}},oi=async(e,t,r)=>{e.mapLibreMap.getSource(t)||(e.mapLibreMap.isStyleLoaded()||await e.mapLibreMap.once("idle"),e.setStyle(ii(e.getStyle(),r)),await(async(e,t)=>{e.mapLibreMap.getSource(t)&&e.mapLibreMap.isSourceLoaded(t)||await e.mapLibreMap.once("sourcedata")})(e,t),e.mapLibreMap.once("styledata",()=>{for(const r of zr(e.mapLibreMap,[t]))e.mapLibreMap.setLayoutProperty(r.id,"visibility","none",{validate:!1})}))},ai=async(e,t,r,i,o)=>{if(!r)return void console.warn(`addOrUpdateImage called with empty image for ID ${t}`);const a=e=>{i.hasImage(t)||i.addImage(t,e,o)},s=e=>{e.complete?e.naturalWidth>0?a(e):console.warn(`Failed to load image for ID ${t}`):(e.onload=()=>a(e),e.onerror=()=>console.warn(`Failed to load image for ID ${t}`))};if("string"==typeof r)if(r.includes("<svg")){s(Vr(Wr(r)))}else a((await i.loadImage(r)).data);else s(r)},si=e=>{switch(e){case"standardDark":case"drivingDark":case"monoDark":case"satellite":return"dark";default:return"light"}},ni=e=>{if("string"==typeof e)return si(e);const t=e;return t?.id?si(t.id):"light"};class ci{constructor(e,t,r){this._initializing=!0,this.moduleReady=!1,this.sourceType=e,this.tomtomMap=t,this.eventsProxy=t._eventsProxy,this.mapLibreMap=t.mapLibreMap,this.initSourcesWithLayers(r),this.applyConfig(r),this.tomtomMap.addStyleChangeHandler({onStyleAboutToChange:()=>{this.moduleReady=!1},onStyleChanged:()=>this.restoreDataAndConfig()}),this._initializing=!1}initSourcesWithLayers(e,t){this.moduleReady=!1,this.sourcesWithLayers=this._initSourcesWithLayers(e,t),this._sourceAndLayerIDs=Object.fromEntries(Object.entries(this.sourcesWithLayers).map(([e,t])=>[e,t.sourceAndLayerIDs])),t&&this.eventsProxy.updateIfRegistered(this.sourcesWithLayers),this.tomtomMap.mapReady&&(this.moduleReady=!0)}async waitUntilModuleReady(){await Qr(this.tomtomMap),this.moduleReady||await new Promise(e=>{const t=setInterval(()=>{this.tomtomMap.mapReady&&this.moduleReady&&(clearInterval(t),e())},200)})}applyConfig(e){this.config=this._applyConfig(e)}resetConfig(){this.applyConfig(void 0)}async restoreDataAndConfig(){this.moduleReady=!1,"geojson"===this.sourceType?setTimeout(()=>this.restoreDataAndConfigImpl(),400):this.restoreDataAndConfigImpl()}restoreDataAndConfigImpl(){this.initSourcesWithLayers(this.config,!0),this._applyConfig(this.config)}getConfig(){return this.config&&{...this.config}}get sourceAndLayerIDs(){return this._sourceAndLayerIDs}}class li{constructor(e,t){this.eventProxy=e,this.sourceWithLayers=t}on(e,t){this.eventProxy.addEventHandler(this.sourceWithLayers,t,e)}off(e){this.eventProxy.remove(this.sourceWithLayers,e)}}class Ai{constructor(){this.interactiveLayerIDs=[],this.handlers={},this.findHandlers=(e,t,r)=>t&&r&&e.flatMap(e=>{const i=this.handlers[t]?.[e];return 1===i?.length?i:this.handlers[t]?.[e]?.filter(e=>e.layerIDs.includes(r))||[]})||[]}ensureInteractiveLayerIDsAdded(e){e._layerSpecs.forEach(e=>{this.interactiveLayerIDs.includes(e.id)||this.interactiveLayerIDs.push(e.id)})}addEventHandler(e,t,r){this.ensureInteractiveLayerIDsAdded(e);const i=e.source.id;this.handlers[i]||(this.handlers[i]={[r]:[]}),this.handlers[i][r]??=[],this.handlers[i][r]?.push({sourceWithLayers:e,layerIDs:e._layerSpecs.map(e=>e.id),fn:t})}remove(e,t){const r=this.handlers[e.source.id]?.[t];r&&(Gr(r,t=>{return r=e._layerSpecs,t.layerIDs.every((e,t)=>e===r[t].id);var r}),r.length||(delete this.handlers[e.source.id]?.[t],mr(this.handlers[e.source.id])&&delete this.handlers[e.source.id]));for(const i of e._layerSpecs)Gr(this.interactiveLayerIDs,e=>i.id===e)}removeAll(){this.interactiveLayerIDs=[],this.handlers={}}hasSourceID(e){return!!this.handlers[e]}updateIfRegistered(e){for(const t of Object.values(e)){const e=this.handlers[t.source.id];if(e)for(const r of Object.values(e))for(const e of r)t.equalSourceAndLayerIDs(e.sourceWithLayers)&&(e.sourceWithLayers=t)}}}const _i=e=>"click"===e||"contextmenu"===e,ui=(e,t,r,i="updateInProps")=>{const{feature:o,index:a}=((e,t)=>{for(let r=0;r<e.length;r++){const i=e[r];if(i.id===t)return{feature:i,index:r}}})(r,t)||{};if(o&&(!_i(o.properties?.eventState)||_i(e))){const t={...o,properties:"updateInProps"===i?{...o?.properties,eventState:e}:vr(o?.properties,"eventState")};return r.splice(a,1,t),a}},Ei=(e,t,r)=>{const i=[...r.shownFeatures.features];br(ui(e,t.id,i,"removeFromProps"))||r.show({...r.shownFeatures,features:i})},Ri=(e,t,r,i,o)=>{if(t&&i instanceof Jr){const n=[...i.shownFeatures.features],c=ui(e,t.id,n);return!r||(s=t,(a=r)&&s&&a.id===s.id)||(o===i?ui(e,r.id,n,"removeFromProps"):o instanceof Jr&&Ei(e,r,o)),i.show({...i.shownFeatures,features:n}),{feature:n[c],index:c}}var a,s;return r&&o instanceof Jr&&Ei(e,r,o),{feature:t}},Ti={precisionMode:"box",paddingBoxPx:5,cursorOnHover:"pointer",cursorOnMouseDown:"grabbing",cursorOnMap:"default",longHoverDelayAfterMapMoveMS:800,longHoverDelayOnStillMapMS:300};class hi extends Ai{constructor(e,t={}){super(),this.enabled=!0,this.firstDelayedHoverSinceMapMove=!0,this.map=e,this.mapCanvas=e.getCanvas(),this.config={...Ti,...t},this.mapCanvas.style.cursor=this.config.cursorOnMap,this.lastCursorStyle=this.config.cursorOnMap,this.defaultZoomLevel=Math.round(this.map.getZoom()),this.listenToEvents()}listenToEvents(){this.map.on("mousemove",e=>this.onMouseMove(e)),this.map.on("movestart",()=>this.onMouseStart()),this.map.on("mouseout",()=>this.onMouseOut()),this.map.on("mouseover",e=>this.onMouseMove(e)),this.map.on("mousedown",()=>this.onMouseDown()),this.map.on("mouseup",()=>this.onMouseUp()),this.map.on("click",e=>this.onMapClick("click",e)),this.map.on("contextmenu",e=>this.onMapClick("contextmenu",e))}enable(e){this.enabled=e,e||this.clearLongHoverTimeout()}toPaddedBounds(e){const t=this.config.paddingBoxPx;return[[e.x-t,e.y+t],[e.x+t,e.y-t]]}isEnabled(){return this.enabled&&!this.map.isMoving()}getRenderedFeatures(e){if(!this.interactiveLayerIDs.length)return[];const t={layers:this.interactiveLayerIDs,validate:!1},r=this.config.precisionMode,i="point-then-box"===r||"point"===r?this.map.queryRenderedFeatures(e,t):[];return i.length||"point"===r?i:this.map.queryRenderedFeatures(this.toPaddedBounds(e),t)}clearLongHoverTimeout(){window.clearTimeout(this.longHoverTimeoutHandlerID)}restartLongHoverTimeout(){this.clearLongHoverTimeout(),this.longHoverTimeoutHandlerID=window.setTimeout(()=>this.handleLongHoverTimeout(),this.firstDelayedHoverSinceMapMove?this.config.longHoverDelayAfterMapMoveMS:this.config.longHoverDelayOnStillMapMS)}handleLongHoverTimeout(){if(this.firstDelayedHoverSinceMapMove=!1,this.hoveringSourceWithLayers){const e=Ri("long-hover",this.hoveringFeature,void 0,this.hoveringSourceWithLayers,void 0);this.findHandlers(["long-hover"],this.hoveringFeature?.source,this.hoveringFeature?.layer.id).forEach(t=>t.fn(e.feature,this.hoveringLngLat,this.hoveringFeatures,this.hoveringSourceWithLayers))}}onMouseStart(){this.firstDelayedHoverSinceMapMove=!0,this.clearLongHoverTimeout()}onMouseOut(){this.clearLongHoverTimeout()}onMouseDown(){this.lastCursorStyle=this.mapCanvas.style.cursor,this.mapCanvas.style.cursor=this.config.cursorOnMouseDown}onMouseUp(){this.mapCanvas.style.cursor=this.lastCursorStyle}onMouseMove(e){if(!this.isEnabled())return;this.hoveringFeatures=this.getRenderedFeatures(e.point),qr(this.hoveringFeatures);const[t]=this.hoveringFeatures;if(t&&!this.hasSourceID(t.source))return;const{hoverChanged:r,mouseInMotionOverHoveredFeature:i}=((e,t,r,i)=>{if(t){if(!i)return{hoverChanged:!0};if(t.id&&t.id!==i.id||t.properties.id&&t.properties.id!==i.properties.id||t.source!==i.source||t.layer.id!==i.layer.id)return{hoverChanged:!0};if(r&&(e.x-r.x!=0||e.y-r.y!=0))return{mouseInMotionOverHoveredFeature:!0}}else if(i)return{hoverChanged:!0};return{}})(e.point,t,this.hoveringPoint,this.hoveringFeature);if(r||i){this.hoveringLngLat=e.lngLat,this.hoveringPoint=e.point;const i=this.hoveringFeature;this.hoveringFeature=t;const o=this.hoveringSourceWithLayers,a=this.findHandlers(["hover","long-hover","click","contextmenu"],t?.source,t?.layer.id);if(this.hoveringSourceWithLayers=a?.[0]?.sourceWithLayers,r){this.updateCursor(i);const r=Ri("hover",this.hoveringFeature,i,this.hoveringSourceWithLayers,o),a=this.findHandlers(["hover"],t?.source,t?.layer.id);for(const t of a)t.fn(r.feature,e.lngLat,this.hoveringFeatures,this.hoveringSourceWithLayers)}this.restartLongHoverTimeout()}}updateCursor(e){!e&&this.hoveringFeature?this.mapCanvas.style.cursor=this.config.cursorOnHover:e&&!this.hoveringFeature&&(this.mapCanvas.style.cursor=this.config.cursorOnMap)}onMapClick(e,t){if(!this.isEnabled())return;const r=this.getRenderedFeatures(t.point);qr(r);const i=this.lastClickedFeature;this.lastClickedFeature=r[0];const o=this.lastClickedSourceWithLayers,a=this.findHandlers([e],this.lastClickedFeature?.source,this.lastClickedFeature?.layer.id);this.lastClickedSourceWithLayers=a?.[0]?.sourceWithLayers,console.log(this.lastClickedSourceWithLayers);const s=Ri(e,this.lastClickedFeature,i,this.lastClickedSourceWithLayers,o);console.log(s);for(const n of a)n.fn(s.feature,t.lngLat,r,this.lastClickedSourceWithLayers)}}const Ii={country:"Places - Country name",lowestPlaceLabel:"Places - Village / Hamlet",poi:"POI",lowestLabel:"Borders - Treaty label",lowestRoadLine:"Tunnel - Railway outline",lowestBuilding:"Buildings - Underground"},pi="vectorTiles",Si="hillshade",fi="vectorTiles",di="vectorTilesIncidents",Ni="vectorTilesFlow",yi=["POI","POI - Micro"],Oi={ACCESS_GATEWAY:"access_gateway",ADVENTURE_SPORTS_FACILITY:"adventure_sports_facility",ADVENTURE_SPORTS_VENUE:"adventure_sports_venue",AGRICULTURE:"agriculture_business",AIRPORT:"airport",AMUSEMENT_PARK:"amusement_park",AQUATIC_ZOO:"zoo_or_aquarium",ASHRAM:"religious_site",ATM:"atm",AUTOMOTIVE_DEALER:"automotive_dealer",BANK:"bank",BEACH:"beach",BUS_STOP:"bus_station",BUSINESS_PARK:"business_park",CAFE_PUB:"cafe",CAMPING_GROUND:"camping_ground",CAR_WASH:"car_wash",CASH_DISPENSER:"atm",CASINO:"casino",CHURCH:"religious_site",CINEMA:"cinema",CLOTHING_SHOP:"clothing_shop",CLUB_ASSOCIATION:"club_and_association",COLLEGE_UNIVERSITY:"college_or_university",COMMERCIAL_BUILDING:"commercial_building",COMMUNITY_CENTER:"community_center",COMPANY:"company_or_office",CONCERT_HALL:"nightlife",COURTHOUSE:"courthouse",CULTURAL_CENTER:"cultural_center",DENTIST:"dentist",DEPARTMENT_STORE:"department_store",DOCTOR:"doctor",ELECTRIC_VEHICLE_STATION:"charging_location",EMBASSY:"institution_office",EMERGENCY_MEDICAL_SERVICE:"emergency_medical_service",EMERGENCY_ROOM:"emergency_room",ENTERTAINMENT:"entertainment",EXCHANGE:"stock_exchange",EXHIBITION_CONVENTION_CENTER:"cultural_center",FERRY_TERMINAL:"ferry_terminal",FIRE_STATION_BRIGADE:"fire_station",FRONTIER_CROSSING:"frontier_crossing",FUEL_FACILITIES:"fuel_station",GAS_STATION:"fuel_station",GEOGRAPHIC_FEATURE:"geographic_feature",GOLD_EXCHANGE:"gold_exchange",GOLF_COURSE:"golf_course",GOVERNMENT_OFFICE:"institution_office",GURUDWARA:"religious_site",HEALTH_CARE_SERVICE:"healthcare_service",HELIPAD_HELICOPTER_LANDING:"heliport_or_helipad",HILL:"elevation_point",HOLIDAY_RENTAL:"holiday_home",HOSPITAL:"hospital",HOSPITAL_POLYCLINIC:"hospital",HOTEL_MOTEL:"hotel_or_motel",ICE_SKATING_RINK:"ice_skating_rink",IMPORTANT_TOURIST_ATTRACTION:"tourist_attraction",INDUSTRIAL_BUILDING:"industrial_building",LEISURE_CENTER:"leisure_center",LIBRARY:"library",MANUFACTURING_FACILITY:"manufacturing_facility",MARINA:"marina",MARKET:"marketplace",MEDIA_FACILITY:"media_facility",MILITARY_INSTALLATION:"military_facility",MOSQUE:"religious_site",MOTORING_ORGANIZATION_OFFICE:"motoring_organization_office",MOUNTAIN_PASS:"mountain_pass",MOUNTAIN_PEAK:"elevation_point",MOVIE_THEATER:"cinema",MUSEUM:"museum",NATIVE_RESERVATION:"native_reservation",NIGHTLIFE:"nightlife",NON_GOVERNMENTAL_ORGANIZATION:"non_governmental_organization",OPEN_PARKING_AREA:"parking_facility",OPERA_HOUSE:"theater",PAGODA:"religious_site",PARK_RECREATION_AREA:"park_and_recreation_area",PARKING_GARAGE:"parking_facility",PETROL_STATION:"fuel_station",PHARMACY:"pharmacy",PLACE_OF_WORSHIP:"place_of_worship",POLICE_STATION:"police_station",PORT_WAREHOUSE_FACILITY:"port_or_warehouse_facility",POST_OFFICE:"post_office",PRIMARY_RESOURCE_UTILITY:"primary_resource_or_utility",PRISON_CORRECTIONAL_FACILITY:"prison",PUBLIC_AMENITY:"public_amenity",PUBLIC_TRANSPORT_STOP:"public_transport_stop",RAILWAY_STATION:"railway_station",RENT_A_CAR_FACILITY:"car_rental",RENT_A_CAR_PARKING:"rent_a_car_parking",REPAIR_FACILITY:"repair_facility",RESEARCH_FACILITY:"research_facility",RESIDENTIAL_ACCOMMODATION:"urban_ground",REST_AREA:"rest_area",RESTAURANT:"restaurant",RESTAURANT_AREA:"restaurant_area",SCENIC_PANORAMIC_VIEW:"viewpoint",SCHOOL:"school",SHOP:"shop_or_store",SHOPPING_CENTER:"shop_or_store",SPORTS_CENTER:"sport_facility",STADIUM:"stadium",SUPERMARKETS_HYPERMARKETS:"supermarket",SWIMMING_POOL:"swimming_pool",SYNAGOG:"religious_site",TAXI_STAND:"taxi_stand",TEMPLE:"religious_site",TENNIS_COURT:"tennis_court",THEATER:"theater",TOLL_GATE:"toll_gate",TOURIST_INFORMATION_OFFICE:"tourist_information_office",TRAFFIC_CONTROL_DEPARTMENT:"traffic_control_department",TRAFFIC_SERVICE_CENTER:"traffic_service_center",TRAIL_SYSTEM:"trail_system",TRAILS:"trails",TRANSPORT_AUTHORITY_VEHICLE_REGISTRATION:"transport_authority_or_vehicle_registration",TRUCK_STOP:"truck_stop",VACATION_RENTAL:"vacation_rental",VETERINARIAN:"veterinarian",WATER_SPORT:"water_sport",WEIGH_STATION:"weigh_station",WELFARE_ORGANIZATION:"welfare_organization",WINERY:"manufacturing_facility",ZOOS_ARBORETA_BOTANICAL_GARDEN:"zoo_or_aquarium"},Li={...Oi,SECURED_ENTRANCE:"access_gateway",AGRICULTURAL_BUSINESS:"agriculture_business",FARM:"agriculture_business",HORTICULTURE:"agriculture_business",PRIMARY_PRODUCER:"agriculture_business",AIRFIELD:"airport",AIRLINE_ACCESS:"airport",MILITARY_AIRPORT:"airport",PRIVATE_AIRPORT:"airport",PUBLIC_AIRPORT:"airport",ATV_DEALER:"automotive_dealer",BOAT_DEALER:"automotive_dealer",BUS_DEALER:"automotive_dealer",CAR_DEALER:"automotive_dealer",MOTORCYCLE_DEALER:"automotive_dealer",RECREATIONAL_VEHICLE_DEALER:"automotive_dealer",TRUCK_DEALER:"automotive_dealer",VAN_DEALER:"automotive_dealer",DIVERSIFIED_FINANCIALS:"bank",SAVINGS_INSTITUTION:"bank",BEACH_CLUB:"beach",BAR:"cafe",CAFE:"cafe",COCKTAIL_BAR:"cafe",COFFEE_SHOP:"cafe",INTERNET_CAFE:"cafe",PUB:"cafe",TEA_HOUSE:"cafe",WINE_BAR:"cafe",CARAVAN_SITE:"camping_ground",RECREATIONAL_CAMPING_GROUND:"camping_ground",REST_CAMP:"camping_ground",TRUCK_WASH:"car_wash",DRIVE_IN_MOVIES:"cinema",CHILDRENS_CLOTHES:"clothing_shop",MENS_CLOTHING:"clothing_shop",SPECIALTY_CLOTHING_SHOP:"clothing_shop",WOMENS_CLOTHING:"clothing_shop",PRIVATE_CLUB:"club_and_association",JUNIOR_COLLEGE_COMMUNITY_COLLEGE:"college_or_university",BUILDING:"commercial_building",ADVERTISING_COMPANY:"company_or_office",AGRICULTURAL_TECHNOLOGY:"company_or_office",AIRLINE_COMPANY:"company_or_office",AUTOMOBILE_COMPANY:"company_or_office",BUSINESS_SERVICES:"company_or_office",BUS_CHARTER_COMPANY:"company_or_office",CABLE_TELEPHONE_COMPANY:"company_or_office",CLEANING_SERVICES:"company_or_office",COMPUTER_DATA_SERVICES:"company_or_office",CONSTRUCTION_COMPANY:"company_or_office",DELIVERY_SERVICE:"company_or_office",ELECTRONICS_COMPANY:"company_or_office",EQUIPMENT_RENTAL:"company_or_office",FUNERAL_SERVICE_MORTUARIES:"company_or_office",IMPORT_EXPORT_AND_DISTRIBUTION:"company_or_office",INSURANCE_COMPANY:"company_or_office",INVESTMENT_ADVISOR:"company_or_office",LEGAL_SERVICES:"company_or_office",MINING_COMPANY:"company_or_office",MOVING_STORAGE_COMPANY:"company_or_office",OIL_NATURAL_GAS:"company_or_office",PHARMACEUTICAL_COMPANY:"company_or_office",PUBLIC_HEALTH_TECHNOLOGY_COMPANY:"company_or_office",PUBLISHING_TECHNOLOGIES:"company_or_office",REAL_ESTATE_AGENT:"company_or_office",REAL_ESTATE_COMPANY:"company_or_office",SERVICE_COMPANY:"company_or_office",SOFTWARE_COMPANY:"company_or_office",TAX_SERVICES:"company_or_office",TELECOMMUNICATIONS:"company_or_office",TRANSPORT_COMPANY:"company_or_office",TRAVEL_AGENT:"company_or_office",WEDDING_SERVICES:"company_or_office",GENERAL_PRACTITIONER:"doctor",SPECIALIST:"doctor",RIDGE:"elevation_point",AMBULANCE_UNIT:"emergency_medical_service",ROAD_RESCUE:"emergency_medical_service",AMUSEMENT_ARCADE:"entertainment",AMUSEMENT_PLACE:"entertainment",BETTING_STATION:"entertainment",FAIRGROUND:"entertainment",MUSIC_CENTER:"entertainment",CHECKPOINT:"frontier_crossing",BAY:"geographic_feature",BRIDGE:"geographic_feature",BRIDGE_TUNNEL_OPERATIONS:"geographic_feature",CAPE:"geographic_feature",COVE:"geographic_feature",DAM:"geographic_feature",DUNE:"geographic_feature",ISLAND:"geographic_feature",LAGOON:"geographic_feature",LAKESHORE:"geographic_feature",LOCALE:"geographic_feature",MARSH:"geographic_feature",OASIS:"geographic_feature",PAN:"geographic_feature",PARKWAY:"geographic_feature",PLAIN_FLAT:"geographic_feature",PLATEAU:"geographic_feature",RAPIDS:"geographic_feature",REEF:"geographic_feature",RESERVOIR:"geographic_feature",RIVER_CROSSING:"geographic_feature",RIVER_SCENIC_AREA:"geographic_feature",ROCKS:"geographic_feature",SEASHORE:"geographic_feature",TUNNEL:"geographic_feature",VALLEY:"geographic_feature",WATER_HOLE:"geographic_feature",WELL:"geographic_feature",BUNGALOW_RENTAL:"holiday_home",CABINS_LODGES:"holiday_home",CHALET_RENTAL:"holiday_home",COTTAGE_RENTAL:"holiday_home",VILLA_RENTAL:"holiday_home",BLOOD_BANK:"hospital",HOSPITAL_FOR_WOMEN_AND_CHILDREN:"hospital",HOSPITAL_OF_CHINESE_MEDICINE:"hospital",SPECIAL_HOSPITAL:"hospital",B_B_GUEST_HOUSE:"hotel_or_motel",HOSTEL:"hotel_or_motel",HOTEL:"hotel_or_motel",MOTEL:"hotel_or_motel",RESORT:"hotel_or_motel",QUARRY:"industrial_building",AUTOMOBILE_MANUFACTURING:"manufacturing_facility",CHEMICAL_COMPANY:"manufacturing_facility",MANUFACTURING_COMPANY:"manufacturing_facility",MECHANICAL_ENGINEERING:"manufacturing_facility",MICROBREWERY:"manufacturing_facility",OEM:"manufacturing_facility",BOAT_LAUNCHING_RAMP:"marina",HARBOR:"marina",YACHT_BASIN:"marina",FARMERS_MARKET:"marketplace",FOOD_MARKET:"marketplace",INFORMAL_MARKET:"marketplace",PUBLIC_MARKET:"marketplace",PLANETARIUM:"museum",CABARET_THEATER:"nightlife",COMEDY_CLUB:"nightlife",DISCO_CLUB:"nightlife",JAZZ_CLUB:"nightlife",KARAOKE_CLUB:"nightlife",FISHING_HUNTING_AREA:"park_and_recreation_area",FOREST_AREA:"park_and_recreation_area",HISTORICAL_PARK:"park_and_recreation_area",NATURAL_RECREATION_ATTRACTION:"park_and_recreation_area",PARK:"park_and_recreation_area",PICNIC_AREA:"park_and_recreation_area",PRESERVE:"park_and_recreation_area",RECREATION_AREA:"park_and_recreation_area",WILDERNESS_AREA:"park_and_recreation_area",OPEN_CAR_PARKING_AREA:"parking_facility",DRUG_STORE:"pharmacy",MARIJUANA_DISPENSARY:"pharmacy",MEDICINAL_MARIJUANA_DISPENSARY:"pharmacy",RECREATIONAL_MARIJUANA_DISPENSARY:"pharmacy",COURIER_DROP_BOX:"post_office",LOCAL_POST_OFFICE:"post_office",PUBLIC_CALL_BOX:"public_amenity",PUBLIC_TOILET:"public_amenity",BUS_LINES:"public_transport_stop",COACH_STOP:"public_transport_stop",PASSENGER_TRANSPORT_TICKET_OFFICE:"public_transport_stop",PEDESTRIAN_SUBWAY:"public_transport_stop",STREETCAR_STOP:"public_transport_stop",SUBWAY_STATION:"public_transport_stop",INTERNATIONAL_RAILROAD_STATION:"railway_station",NATIONAL_RAILROAD_STATION:"railway_station",RAILROAD_SIDING:"railway_station",STATION_ACCESS:"railway_station",URBAN_STATION:"railway_station",BODYSHOP:"repair_facility",CAR_GLASS_REPLACEMENT_SHOP:"repair_facility",CAR_REPAIR_AND_SERVICE:"repair_facility",HOME_APPLIANCE_REPAIR:"repair_facility",MOTORCYCLE_REPAIR:"repair_facility",OTHER_REPAIR_SHOPS:"repair_facility",REPAIR_SHOP:"repair_facility",TIRE_SERVICE:"repair_facility",TRUCK_REPAIR_AND_SERVICE:"repair_facility",AFGHAN_RESTAURANT:"restaurant",AFRICAN_RESTAURANT:"restaurant",ALGERIAN_RESTAURANT:"restaurant",AMERICAN_RESTAURANT:"restaurant",ARABIAN_RESTAURANT:"restaurant",ARGENTINIAN_RESTAURANT:"restaurant",ARMENIAN_RESTAURANT:"restaurant",ASIAN_RESTAURANT:"restaurant",AUSTRALIAN_RESTAURANT:"restaurant",AUSTRIAN_RESTAURANT:"restaurant",BANQUET_ROOMS:"restaurant",BARBECUE_RESTAURANT:"restaurant",BASQUE_RESTAURANT:"restaurant",BELGIAN_RESTAURANT:"restaurant",BISTRO:"restaurant",BOLIVIAN_RESTAURANT:"restaurant",BOSNIAN_RESTAURANT:"restaurant",BRAZILIAN_RESTAURANT:"restaurant",BRITISH_RESTAURANT:"restaurant",BUFFET_RESTAURANT:"restaurant",BULGARIAN_RESTAURANT:"restaurant",BURMESE_RESTAURANT:"restaurant",CAFETERIA:"restaurant",CALIFORNIAN_RESTAURANT:"restaurant",CAMBODIAN_RESTAURANT:"restaurant",CANADIAN_RESTAURANT:"restaurant",CARIBBEAN_RESTAURANT:"restaurant",CATERING_SERVICES:"restaurant",CHICKEN_RESTAURANT:"restaurant",CHILEAN_RESTAURANT:"restaurant",CHINESE_RESTAURANT:"restaurant",COLOMBIAN_RESTAURANT:"restaurant",CORSICAN_RESTAURANT:"restaurant",CREOLE_RESTAURANT:"restaurant",CREPERIE:"restaurant",CUBAN_RESTAURANT:"restaurant",CYPRIOT_RESTAURANT:"restaurant",CZECH_RESTAURANT:"restaurant",DANISH_RESTAURANT:"restaurant",DINNER_THEATER:"restaurant",DOMINICAN_RESTAURANT:"restaurant",DONGBEI_RESTAURANT:"restaurant",DOUGHNUT_RESTAURANT:"restaurant",DUTCH_RESTAURANT:"restaurant",EGYPTIAN_RESTAURANT:"restaurant",ENGLISH_RESTAURANT:"restaurant",EROTIC_RESTAURANT:"restaurant",ETHIOPIAN_RESTAURANT:"restaurant",EXOTIC_RESTAURANT:"restaurant",FAST_FOOD:"restaurant",FINNISH_RESTAURANT:"restaurant",FONDUE_RESTAURANT:"restaurant",FRENCH_RESTAURANT:"restaurant",FUSION_RESTAURANT:"restaurant",GERMAN_RESTAURANT:"restaurant",GREEK_RESTAURANT:"restaurant",GRILL_RESTAURANT:"restaurant",GUANGDONG_RESTAURANT:"restaurant",HAMBURGER_RESTAURANT:"restaurant",HAWAIIAN_RESTAURANT:"restaurant",HOT_POT_RESTAURANT:"restaurant",HUNAN_RESTAURANT:"restaurant",HUNGARIAN_RESTAURANT:"restaurant",ICE_CREAM_PARLOR:"restaurant",INDIAN_RESTAURANT:"restaurant",INDONESIAN_RESTAURANT:"restaurant",INTERNATIONAL_RESTAURANT:"restaurant",IRANIAN_RESTAURANT:"restaurant",IRISH_RESTAURANT:"restaurant",ISRAELI_RESTAURANT:"restaurant",ITALIAN_RESTAURANT:"restaurant",JAMAICAN_RESTAURANT:"restaurant",JAPANESE_RESTAURANT:"restaurant",JEWISH_RESTAURANT:"restaurant",KOREAN_RESTAURANT:"restaurant",KOSHER_RESTAURANT:"restaurant",LATIN_AMERICAN_RESTAURANT:"restaurant",LEBANESE_RESTAURANT:"restaurant",LUXEMBOURGIAN_RESTAURANT:"restaurant",MACROBIOTIC_RESTAURANT:"restaurant",MAGHRIB_RESTAURANT:"restaurant",MALTESE_RESTAURANT:"restaurant",MAURITIAN_RESTAURANT:"restaurant",MEDITERRANEAN_RESTAURANT:"restaurant",MEXICAN_RESTAURANT:"restaurant",MIDDLE_EASTERN_RESTAURANT:"restaurant",MONGOLIAN_RESTAURANT:"restaurant",MOROCCAN_RESTAURANT:"restaurant",MUSSELS_RESTAURANT:"restaurant",NEPALESE_RESTAURANT:"restaurant",NORWEGIAN_RESTAURANT:"restaurant",ORGANIC_FOOD_RESTAURANT:"restaurant",ORIENTAL_RESTAURANT:"restaurant",PAKISTANI_RESTAURANT:"restaurant",PERUVIAN_RESTAURANT:"restaurant",PHILIPPINE_RESTAURANT:"restaurant",PIZZERIA:"restaurant",POLISH_RESTAURANT:"restaurant",POLYNESIAN_RESTAURANT:"restaurant",PORTUGUESE_RESTAURANT:"restaurant",PROVENCAL_RESTAURANT:"restaurant",PUB_FOOD:"restaurant",ROADSIDE_RESTAURANT:"restaurant",ROMANIAN_RESTAURANT:"restaurant",RUSSIAN_RESTAURANT:"restaurant",SALAD_BAR:"restaurant",SANDWICH_RESTAURANT:"restaurant",SAVOY_RESTAURANT:"restaurant",SCANDINAVIAN_RESTAURANT:"restaurant",SCOTTISH_RESTAURANT:"restaurant",SEAFOOD:"restaurant",SHANDONG_RESTAURANT:"restaurant",SHANGHAI_RESTAURANT:"restaurant",SICHUAN_RESTAURANT:"restaurant",SICILIAN_RESTAURANT:"restaurant",SLAVIC_RESTAURANT:"restaurant",SLOVAK_RESTAURANT:"restaurant",SNACKS_RESTAURANT:"restaurant",SOUL_FOOD:"restaurant",SOUP_RESTAURANT:"restaurant",SPANISH_RESTAURANT:"restaurant",STEAK_HOUSE:"restaurant",SUDANESE_RESTAURANT:"restaurant",SURINAMESE_RESTAURANT:"restaurant",SUSHI_RESTAURANT:"restaurant",SWEDISH_RESTAURANT:"restaurant",SWISS_RESTAURANT:"restaurant",SYRIAN_RESTAURANT:"restaurant",TAIWANESE_RESTAURANT:"restaurant",TAKEOUT_FOOD:"restaurant",TAPAS_RESTAURANT:"restaurant",TEPPANYAKI_RESTAURANT:"restaurant",THAI_RESTAURANT:"restaurant",TIBETAN_RESTAURANT:"restaurant",TUNISIAN_RESTAURANT:"restaurant",TURKISH_RESTAURANT:"restaurant",URUGUAYAN_RESTAURANT:"restaurant",VEGETARIAN_RESTAURANT:"restaurant",VENEZUELAN_RESTAURANT:"restaurant",VIETNAMESE_RESTAURANT:"restaurant",WELSH_RESTAURANT:"restaurant",WESTERN_RESTAURANT:"restaurant",YOGURT_JUICE_BAR:"restaurant",ART_SCHOOL:"school",CHILD_CARE_FACILITY:"school",CULINARY_SCHOOL:"school",DANCE_STUDIO_SCHOOL:"school",DRIVING_SCHOOL:"school",HIGH_SCHOOL:"school",LANGUAGE_SCHOOL:"school",MIDDLE_SCHOOL:"school",PRE_SCHOOL:"school",PRIMARY_SCHOOL:"school",SENIOR_HIGH_SCHOOL:"school",SPECIAL_SCHOOL:"school",SPORT_SCHOOL:"school",TECHNICAL_SCHOOL:"school",VOCATIONAL_SCHOOL:"school",AGRICULTURAL_SUPPLIES:"shop_or_store",ANTIQUE_ART_SHOP:"shop_or_store",BAGS_LEATHERWEAR:"shop_or_store",BAKERY:"shop_or_store",BEAUTY_SALON:"shop_or_store",BEAUTY_SUPPLIES:"shop_or_store",BOATING_EQUIPMENT_ACCESSORIES:"shop_or_store",BOOK_SHOP:"shop_or_store",BUTCHER:"shop_or_store",CAMERAS_PHOTOGRAPHY:"shop_or_store",CARPET_FLOOR_COVERINGS:"shop_or_store",CAR_ACCESSORIES:"shop_or_store",CHRISTMAS_HOLIDAY_SHOP:"shop_or_store",COMPUTER_COMPUTER_SUPPLIES:"shop_or_store",CONSTRUCTION_MATERIAL_EQUIPMENT:"shop_or_store",CONSUMER_ELECTRONICS:"shop_or_store",CONVENIENCE_STORE:"shop_or_store",CURTAINS_TEXTILES:"shop_or_store",C_DS_DVD_VIDEOS:"shop_or_store",DELICATESSEN:"shop_or_store",DO_IT_YOURSELF_CENTERS:"shop_or_store",DRIVE_THROUGH_BOTTLE_SHOP:"shop_or_store",DRY_CLEANER:"shop_or_store",ELECTRICAL_APPLIANCES_SHOP:"shop_or_store",FACTORY_OUTLET:"shop_or_store",FISHMONGER:"shop_or_store",FLORISTS:"shop_or_store",FOOTWEAR_SHOE_REPAIRS:"shop_or_store",FURNITURE_HOME_FURNISHINGS:"shop_or_store",GARDEN_CENTERS_SERVICES:"shop_or_store",GIFTS_CARDS_NOVELTIES_SOUVENIRS:"shop_or_store",GLASSWARE_CERAMIC_SHOP:"shop_or_store",GLASS_WINDOWS_STORE:"shop_or_store",GREENGROCER:"shop_or_store",GROCERY_STORE:"shop_or_store",HAIRDRESSER:"shop_or_store",HARDWARE_STORE:"shop_or_store",HOBBY_SHOP:"shop_or_store",HOUSE_GARDEN_FURNITURE_FITTINGS:"shop_or_store",JEWELRY_CLOCKS_WATCHES:"shop_or_store",KITCHENS_BATHROOMS:"shop_or_store",LAUNDRY:"shop_or_store",LIGHTING_SHOPS:"shop_or_store",LOCAL_SPECIALITIES_SHOP:"shop_or_store",LOTTERY_SHOP:"shop_or_store",MARINE_ELECTRONIC_EQUIPMENT:"shop_or_store",MEDICAL_SUPPLIES_EQUIPMENT:"shop_or_store",MOBILE_PHONE_SHOP:"shop_or_store",MUSIC_INSTRUMENTS_STORE:"shop_or_store",NAIL_SALON:"shop_or_store",NEWSAGENTS_TOBACCONISTS:"shop_or_store",OFFICE_EQUIPMENT:"shop_or_store",OPTICIAN:"shop_or_store",OTHER_FOOD_SHOPS:"shop_or_store",PAINTING_DECORATING:"shop_or_store",PAWN_SHOP:"shop_or_store",PERSONAL_CARE_FACILITY:"shop_or_store",PERSONAL_SERVICE:"shop_or_store",PET_SUPPLIES:"shop_or_store",PHOTOCOPY_SHOP:"shop_or_store",PHOTO_LAB_DEVELOPMENT:"shop_or_store",RECYCLING_SHOP:"shop_or_store",RETAIL_OUTLET:"shop_or_store",SAUNA_SOLARIUM_MASSAGE:"shop_or_store",SECURITY_PRODUCTS:"shop_or_store",SHOPPING_SERVICE:"shop_or_store",SPECIALTY_FOODS:"shop_or_store",SPORTS_EQUIPMENT_CLOTHING:"shop_or_store",STAMP_SHOP:"shop_or_store",TAILOR_SHOP:"shop_or_store",TOYS_GAMES_SHOP:"shop_or_store",VARIETY_STORE:"shop_or_store",VIDEO_RENTAL_SHOP:"shop_or_store",WHOLESALE_CLUB:"shop_or_store",WINE_SPIRITS:"shop_or_store",ATHLETICS_TRACK:"sport_facility",BASEBALL_PARK:"sport_facility",BASKETBALL_ARENA:"sport_facility",BOWLING_CENTER:"sport_facility",CRICKET_GROUND:"sport_facility",FITNESS_CLUB_CENTER:"sport_facility",FLYING_CLUB:"sport_facility",HOCKEY_CLUB:"sport_facility",HORSE_RACING_TRACK:"sport_facility",HORSE_RIDING_CENTER:"sport_facility",ICE_HOCKEY_ARENA:"sport_facility",OTHER_WINTER_SPORT:"sport_facility",RACE_TRACK:"sport_facility",RUGBY_GROUND:"sport_facility",SKI_RESORT:"sport_facility",SNOOKER_POOL_BILLIARD:"sport_facility",THEMATIC_SPORT_CENTER:"sport_facility",FOOTBALL_STADIUM:"stadium",MOTOR_RACING_STADIUM:"stadium",MULTI_PURPOSE_STADIUM:"stadium",NETBALL_STADIUM:"stadium",SOCCER_STADIUM:"stadium",STOCK_EXCHANGE:"stock_exchange",TAXI_LIMOUSINE_SHUTTLE_SERVICE:"taxi_stand",AMPHITHEATER:"theater",ARCH:"tourist_attraction",BATTLEFIELD:"tourist_attraction",CAVE:"tourist_attraction",CEMETERY:"tourist_attraction",HISTORIC_SITE:"tourist_attraction",MAUSOLEUM_GRAVE:"tourist_attraction",MEMORIAL:"tourist_attraction",MINERAL_HOT_SPRINGS:"tourist_attraction",MONUMENT:"tourist_attraction",NATURAL_TOURIST_ATTRACTION:"tourist_attraction",OBSERVATORY:"tourist_attraction",STATUE:"tourist_attraction",TOURIST_ATTRACTION:"tourist_attraction",TOWER:"tourist_attraction",ROAD_TRAFFIC_CONTROL_CENTER:"traffic_control_department",ADVENTURE_VEHICLE_TRAIL:"trails",HIKING_TRAIL:"trails",HORSE_RIDING_TRAIL:"trails",MOUNTAIN_BIKE_TRAIL:"trails",ROCK_CLIMBING_TRAIL:"trails",APARTMENT_RENTAL:"urban_ground",CONDOMINIUM_COMPLEX:"urban_ground",FLATS_APARTMENT_COMPLEX:"urban_ground",RESIDENTIAL_ESTATE:"urban_ground",RETIREMENT_COMMUNITY:"urban_ground",TOWNHOUSE_COMPLEX:"urban_ground",ANIMAL_SERVICES:"veterinarian",ANIMAL_SHELTER:"veterinarian",WEIGH_SCALES:"weigh_station",WILDLIFE_PARK:"zoo_or_aquarium",ZOO:"zoo_or_aquarium"},Ci=e=>Li[e],gi="Noto-Bold",mi="title",Ui="iconID",bi="default_place",Mi={"icon-image":["get",Ui],"icon-anchor":"bottom","icon-size":["interpolate",["linear"],["zoom"],8,.6,22,.8],"icon-allow-overlap":!0,"icon-padding":0},Pi={"icon-translate":[0,5],"icon-translate-anchor":"viewport"},vi={"text-optional":!0,"text-font":[gi],"text-field":["get",mi],"text-justify":"auto","text-variable-anchor":["top","left","right"],"text-variable-anchor-offset":["top",[0,.7],"left",[1.4,-1.4],"right",[-1.4,-1.4]],"text-size":["interpolate",["linear"],["zoom"],10,14,18,16],"text-padding":5},Di={"text-color":"#333333","text-halo-color":"#FFFFFF","text-halo-width":["interpolate",["linear"],["zoom"],6,1,10,1.5],"text-translate-anchor":"viewport"},Hi={type:"symbol",layout:{...Mi,...vi},paint:{...Pi,...Di}},wi=(e,t)=>`${e}-${t}`,Fi=["in",["get","eventState"],["literal",["click","contextmenu"]]],Gi=["has","eventState"],Bi="#3f9cd9",xi={...Hi,filter:["!",Gi]},Vi={...Hi,filter:Gi,layout:{...Hi.layout,"icon-size":["interpolate",["linear"],["zoom"],8,.8,22,1],"text-allow-overlap":!0},paint:{...Hi.paint,"text-color":Bi}},Wi=(e,t,r)=>{const i=t?.text,o=t?.layers?.[r];return{...e,layout:{...e.layout,...i?.size&&{"text-size":i.size},...i?.font&&{"text-font":i.font},...i?.offset&&{"text-offset":i.offset},...i?.title&&"function"!=typeof i?.title&&{"text-field":i?.title},...o?.layout},paint:{...e.paint,...i?.color&&{"text-color":i.color},...i?.haloColor&&{"text-halo-color":i.haloColor},...i?.haloWidth&&{"text-halo-width":i.haloWidth},...o?.paint},...o}},Yi=e=>JSON.parse(JSON.stringify(e)?.replace(/name/g,mi)),ji=(e,t)=>{let r;if("base-map"===e?.theme){const e=(e=>{const t=e.getStyle().layers.filter(e=>"POI"===e.id)[0]||{},r=t.layout?.["text-size"];return{filter:["!",Fi],type:"symbol",paint:t.paint,layout:{...t.layout,"text-field":["get",mi],"icon-image":["get",Ui],...r&&{"text-size":Yi(r)}}}})(t);r={main:e,selected:{...e,filter:Gi,layout:{...e.layout,"text-allow-overlap":!0},paint:{...e.paint,"text-color":Bi}}}}else r={main:xi,selected:Vi};return{main:Wi(r.main,e,"main"),selected:Wi(r.selected,e,"selected"),...e?.layers?.additional}},ki=e=>{if(xr())return Vr(Yr(e))},Ki=/* @__PURE__ */new Set([7339002,8099002,7369004,7321003,7376006,9362003,9362004,9160004,9376007,7315015,9376006,9376002,7315078,7315149,9376005,7372003,9352045,9352032,9361048,9902003,9378005,7383004,9910004,7320002,9362016,7320003,9362025,9942002,9942003,7380005,9663003,9361021,9379009,9379004,7315147,9376003,9160002,9160003,9352008,9361006,7389004,9910006]),zi=e=>e.properties.poi?.name??e.properties.address.freeformAddress,$i=(e,t,i)=>{if("pin"===t){return(e=>{if(e)return Ki.has(e)?e.toString():e.toString().substring(0,4)})(r[e])??i}{const t=Ci(e);return t?`poi-${t}`:i}},Xi=(e,t,r={})=>{const i=r.theme??"pin",o=wi(bi,t),a=r.icon?.mapping;if(a)return"imageID"===a.to?a.fn(e):$i(a.fn(e),i,o);const s=e.properties.poi?.classifications?.[0]?.code,n=r.icon?.categoryIcons?.find(e=>e.id===s);return n?wi(n.id,t):$i(s,i,o)},Zi=e=>{const t=e.properties.poi?.classifications?.[0]?.code;return t&&Ci(t)},Ji=e=>Array.isArray(e)?{type:"FeatureCollection",features:e}:"Feature"===e.type?{type:"FeatureCollection",features:[e]}:e,Qi=(e,r,i={})=>{const o=Ji(e);return{...o,features:o.features.map(e=>{const o="function"==typeof i?.text?.title?i?.text?.title(e):zi(e),a=i.extraFeatureProps?Object.fromEntries(Object.entries(i.extraFeatureProps).map(([t,r])=>[t,"function"==typeof r?r(e):r])):{},s=e.id??t();return{...e,id:s,geometry:{...e.geometry,bbox:e.bbox},properties:{...e.properties,id:s,title:o,iconID:Xi(e,r,i),..."base-map"===i?.theme&&{category:Zi(e)},...a}}})}},qi=class e extends ci{static async get(t,r){return await Qr(t),new e(t,r)}constructor(e,t){super("geojson",e,t)}_initSourcesWithLayers(t,r){return r||(e.lastInstanceIndex++,this.instanceIndex=e.lastInstanceIndex,this.sourceID=`places-${this.instanceIndex}`,this.layerIDPrefix=this.sourceID,this.defaultPlaceIconID=wi(bi,this.instanceIndex)),this.layerSpecs=this.buildLayerSpecs(t),{places:new Jr(this.mapLibreMap,this.sourceID,[this.layerSpecs.main,this.layerSpecs.selected])}}buildLayerSpecs(e){const t=ji(e,this.mapLibreMap);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,{...t,id:`${this.layerIDPrefix}-${e}`}]))}_applyConfig(e){return this.updateLayersAndData(e),e}restoreDataAndConfigImpl(){const e=this.sourcesWithLayers.places.shownFeatures;this.initSourcesWithLayers(this.config,!0),this.config&&this._applyConfig(this.config),this.show(e)}applyTheme(e){this.applyConfigPart({theme:e})}applyIconConfig(e){this.applyConfigPart({icon:e})}applyTextConfig(e){this.applyConfigPart({text:e})}applyConfigPart(e){const t={...this.config,...e};this.updateLayersAndData(t),this.config=t}applyExtraFeatureProps(e){const t={...this.config,extraFeatureProps:e};this.updateData(t),this.config=t}updateLayersAndData(e){this.setupImages(e);const t=this.buildLayerSpecs(e),r=[t.main,t.selected],i=[this.layerSpecs.main,this.layerSpecs.selected];ti(r,i,this.mapLibreMap),this.layerSpecs=t,this.updateData(e)}setupImages(e){if(e?.icon){for(const t of e.icon.categoryIcons??[])ai(0,wi(t.id,this.instanceIndex),t.image,this.mapLibreMap,{pixelRatio:t.pixelRatio??2});e.icon.default&&(e.icon.default.image&&ai(0,this.defaultPlaceIconID,e.icon.default.image.image,this.mapLibreMap,{pixelRatio:e.icon.default.image.pixelRatio??2}),e.icon.default.style&&ai(0,this.defaultPlaceIconID,ki(e.icon.default.style),this.mapLibreMap,{pixelRatio:2}))}else ai(0,this.defaultPlaceIconID,ki(),this.mapLibreMap,{pixelRatio:2})}updateData(e){this.sourcesWithLayers.places.source.runtimeSource?.setData(Qi(this.sourcesWithLayers.places.shownFeatures,this.instanceIndex,e))}async show(e){await this.waitUntilModuleReady(),this.sourcesWithLayers.places.show(Qi(e,this.instanceIndex,this.config))}async clear(){await this.waitUntilModuleReady(),this.sourcesWithLayers.places.clear()}putEventState(e){this.sourcesWithLayers.places.putEventState(e)}cleanEventState(e){this.sourcesWithLayers.places.cleanEventState(e)}cleanEventStates(e){this.sourcesWithLayers.places.cleanEventStates(e)}get events(){return new li(this.eventsProxy,this.sourcesWithLayers.places)}};qi.lastInstanceIndex=-1;let eo=qi;const to=e=>{if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!to(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}},ro=e=>e?.length?1===e.length?e[0]:{expression:["any",...e.map(e=>e?.expression)],legacy:["any",...e.map(e=>e?.legacy)]}:null,io=(e,t)=>{return t?["all",e[(r=t,to(r)?"expression":"legacy")],t]:e.expression;var r},oo=(e,t,r)=>{if(1===r.length){const i="only"===t?"==":"!=";return{expression:[i,["get",e],r[0]],legacy:[i,e,r[0]]}}const i=["in",["get",e],["literal",r]];return"only"===t?{expression:i,legacy:["in",e,...r]}:{expression:["!",i],legacy:["!in",e,...r]}},ao=(e,t,r)=>oo(e,t.show,r?t.values.map(r):t.values),so={FOOD_DRINKS_GROUP:["RESTAURANT","FAST_FOOD","CAFE_PUB","PUB","WINERY","PUB_FOOD","SOUL_FOOD","DELICATESSEN"],SHOPPING_GROUP:["SHOP","SHOPPING_CENTER","CLOTHING_SHOP","MARKET","FOOD_MARKET","SUPERMARKETS_HYPERMARKETS","DEPARTMENT_STORE","CONVENIENCE_STORE","GROCERY_STORE","HARDWARE_STORE","ELECTRICAL_APPLIANCES_SHOP"],TRANSPORTATION_GROUP:["AIRPORT","FERRY_TERMINAL","HELIPAD_HELICOPTER_LANDING","PUBLIC_TRANSPORT_STOP","RAILWAY_STATION","BUS_STOP","TAXI_STAND"],HEALTH_GROUP:["DOCTOR","EMERGENCY_MEDICAL_SERVICE","EMERGENCY_ROOM","HEALTH_CARE_SERVICE","HOSPITAL","HOSPITAL_POLYCLINIC","PHARMACY","DENTIST","WELFARE_ORGANIZATION"],PARKING_GROUP:["PARKING_GARAGE","OPEN_PARKING_AREA"],HOLIDAY_TOURISM_GROUP:["AMUSEMENT_PARK","BEACH","HOLIDAY_RENTAL","GEOGRAPHIC_FEATURE","IMPORTANT_TOURIST_ATTRACTION","LEISURE_CENTER","MOUNTAIN_PASS","MOUNTAIN_PEAK","MUSEUM","SCENIC_PANORAMIC_VIEW","TOURIST_INFORMATION_OFFICE"],EV_CHARGING_STATIONS_GROUP:["ELECTRIC_VEHICLE_STATION"],GAS_STATIONS_GROUP:["GAS_STATION","PETROL_STATION"],ACCOMMODATION_GROUP:["CAMPING_GROUND","HOTEL_MOTEL","HOLIDAY_RENTAL"],ENTERTAINMENT_GROUP:["CINEMA","THEATER","MOVIE_THEATER","NIGHTLIFE","CONCERT_HALL","ENTERTAINMENT","CLUB_ASSOCIATION","CASINO"],SPORTS_LEISURE_GROUP:["SPORTS_CENTER","WATER_SPORT","SWIMMING_POOL","GOLF_COURSE","STADIUM","BEACH","ICE_SKATING_RINK","LEISURE_CENTER","MOUNTAIN_PASS","MOUNTAIN_PEAK"],EDUCATION_GROUP:["SCHOOL","COLLEGE_UNIVERSITY","LIBRARY","CULTURAL_CENTER"],GOVERNMENT_GROUP:["GOVERNMENT_OFFICE","COURTHOUSE","EMBASSY","FIRE_STATION_BRIGADE","POLICE_STATION"]},no=e=>{const t=[];return e.forEach(e=>{e in so?t.push(...so[e].map(Ci)):t.push(Ci(e))}),[...new Set(t)]};class co extends ci{static async get(e,t){return await Qr(e),new co(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(){const e=this.mapLibreMap.getSource(pi);if(!e)throw Br(`init ${co.name} with source ID ${pi}`);const t=new $r(this.mapLibreMap,e,e=>yi.includes(e.id)),r=t.sourceAndLayerIDs.layerIDs[0];return this.mapLibreMap.getLayer(r)&&(this.originalFilter=this.mapLibreMap.getFilter(r)),{poi:t}}_applyConfig(e){return e&&!br(e.visible)?this.setVisible(e.visible):this._initializing||this.isVisible()||this.setVisible(!0),this.filterCategories(e?.filters?.categories),e}isVisible(){return this.sourcesWithLayers.poi.isAnyLayerVisible()}setVisible(e){this.config={...this.config,visible:e},this.tomtomMap.mapReady&&this.sourcesWithLayers.poi.setLayersVisible(e)}filterCategories(e){if(e){if(this.tomtomMap.mapReady){const t=oo("category",e.show,no(e.values));this.mapLibreMap.setFilter("POI",io(t,this.originalFilter))}this.config={...this.config,filters:{categories:e}}}else this.categoriesFilter&&(this.config={...this.config,filters:{categories:{show:"all_except",values:[]}}},this.tomtomMap.mapReady&&this.mapLibreMap.setFilter("POI",this.originalFilter));this.categoriesFilter=e}get events(){return new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.poi)}}const lo={land:{layerIDMatches:["lulc"],layerTypes:["fill"]},borders:{layerIDMatches:["borders"],layerTypes:["line"]},water:{layerIDMatches:["water"],layerTypes:["fill","line"]},buildings2D:{layerIDMatches:["building"],layerTypes:["fill","line"]},buildings3D:{layerIDMatches:["building"],layerTypes:["fill-extrusion"]},houseNumbers:{layerIDMatches:["house number"],layerTypes:["symbol"]},roadLines:{layerIDMatches:["road","tunnel","bridge","surface"],layerTypes:["fill","line"]},roadLabels:{layerIDMatches:["road","tunnel","bridge","surface"],layerTypes:["symbol"]},roadShields:{layerIDMatches:["shield"],layerTypes:["symbol"]},placeLabels:{layerIDMatches:["places"],layerTypes:["symbol"]},smallerTownLabels:{layerIDMatches:["town","village","neighbourhood"],layerTypes:["symbol"]},cityLabels:{layerIDMatches:["city","capital"],layerTypes:["symbol"]},capitalLabels:{layerIDMatches:["capital"],layerTypes:["symbol"]},stateLabels:{layerIDMatches:["state"],layerTypes:["symbol"]},countryLabels:{layerIDMatches:["places - country"],layerTypes:["symbol"]}},Ao=(e,t)=>{const r=lo[e];return r.layerIDMatches.some(e=>t.id.toLowerCase().includes(e))&&r.layerTypes.includes(t.type)},_o=e=>t=>(!e||((e,t)=>{const r=t?.mode,i=t?.names;if(r&&i?.length){if("include"===r)return i.some(t=>Ao(t,e));if("exclude"===r)return!i.some(t=>Ao(t,e))}return!0})(t,e))&&!yi.includes(t.id);class uo extends ci{static async get(e,t){return await Qr(e),new uo(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(e){const t=this.mapLibreMap.getSource(fi);if(!t)throw Br(`init ${uo.name} with source ID ${fi}`);return{vectorTiles:new $r(this.mapLibreMap,t,_o(e?.layerGroupsFilter))}}_applyConfig(e){return e&&!br(e.visible)?this.setVisible(e.visible):this._initializing||this.isVisible()||this.setVisible(!0),e?.layerGroupsVisibility&&this.setVisible(e.layerGroupsVisibility.visible,{layerGroups:e.layerGroupsVisibility}),this.config||e?{...this.config,...e}:void 0}isVisible(){return this.sourcesWithLayers.vectorTiles.isAnyLayerVisible()}setVisible(e,t){t?.layerGroups?this.config={...this.config,layerGroupsVisibility:{...t.layerGroups,visible:e}}:(delete this.config?.layerGroupsVisibility,this.config={...this.config,visible:e}),this.tomtomMap.mapReady&&this.sourcesWithLayers.vectorTiles.setLayersVisible(e,t?.layerGroups&&(e=>{const t=e.mode,r=e.names;return"include"===t?e=>r.some(t=>Ao(t,e)):"exclude"===t?e=>!r.some(t=>Ao(t,e)):(console.error("Unrecognized layer group mode:",t),()=>!0)})(t.layerGroups))}get events(){return new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.vectorTiles)}}const Eo=["land","water","borders","buildings2D","buildings3D","houseNumbers","roadLines","roadLabels","roadShields","placeLabels","smallerTownLabels","cityLabels","capitalLabels","stateLabels","countryLabels"],Ro="title",To="color",ho={warm:["#793F0D","#AC703D","#C38E63","#E49969","#E5AE86","#EEC5A9","#6E7649","#9D9754","#C7C397","#B4A851","#DFD27C","#E7E3B5","#846D74","#B7A6AD","#D3C9CE"],browns:["#edc4b3","#e6b8a2","#deab90","#d69f7e","#cd9777","#c38e70","#b07d62","#9d6b53","#8a5a44","#774936"],cold:["#344464","#548ca4","#549cac","#2c445c","#a4ccd4","#acbccc","#b4c4d4","#acd4cc","#5c8ca4"],fadedBlues:["#152033","#1d2d44","#2e455d","#3e5c76","#4c6884","#597491","#67809e","#6e86a5","#7b91ad","#879bb4"],blues:["#03045e","#023e8a","#0077b6","#0096c7","#00b4d8","#48cae4","#90e0ef","#ade8f4","#caf0f8"],greens:["#004b23","#006400","#007200","#008000","#38b000","#70e000","#9ef01a","#ccff33"],fadedGreenToBlue:["#d9ed92","#b5e48c","#99d98c","#76c893","#52b69a","#34a0a4","#168aad","#1a759f","#1e6091","#184e77"],blueToRed:["#033270","#1368aa","#4091c9","#9dcee2","#fedfd4","#f29479","#f26a4f","#ef3c2d","#cb1b16","#65010c"],greenToYellow:["#007f5f","#2b9348","#55a630","#80b918","#aacc00","#bfd200","#d4d700","#dddf00","#eeef20","#ffff3f"],pastel:["#fec5bb","#fcd5ce","#fae1dd","#f8edeb","#e8e8e4","#d8e2dc","#ece4db","#ffe5d9","#ffd7ba","#fec89a"],retro:["#f94144","#f3722c","#f8961e","#f9844a","#f9c74f","#90be6d","#43aa8b","#4d908e","#577590","#277da1"],contrastRetro:["#001219","#005f73","#0a9396","#94d2bd","#e9d8a6","#ee9b00","#ca6702","#bb3e03","#ae2012","#9b2226"],fadedRainbow:["#ffadad","#ffd6a5","#fdffb6","#caffbf","#9bf6ff","#a0c4ff","#bdb2ff","#ffc6ff","#fffffc"],pastelRainbow:["#54478c","#2c699a","#048ba8","#0db39e","#16db93","#83e377","#b9e769","#efea5a","#f1c453","#f29e4c"]},Io="#0A3653",po={type:"fill",paint:{"fill-color":["coalesce",["get",To],Io],"fill-opacity":.15,"fill-antialias":!1}},So={type:"line",paint:{"line-color":Io,"line-opacity":.45,"line-width":2}},fo=(e,t,r)=>{const i=r?.colorConfig,o=r?.lineConfig;return[{...po,id:e,paint:{...po.paint,...!br(i?.fillOpacity)&&{"fill-opacity":i?.fillOpacity},...i?.fillColor&&{"fill-color":["get","color"]}}},{...So,id:t,paint:{...So.paint,...!br(o?.lineColor)&&{"line-color":o?.lineColor},...!br(o?.lineWidth)&&{"line-width":o?.lineWidth},...!br(o?.lineOpacity)&&{"line-opacity":o?.lineOpacity}}}]},No=(e,t)=>{const r=t?.textConfig;return{type:"symbol",id:e,layout:{"text-field":["get",Ro],...r?.textField&&{"text-field":r.textField},"text-padding":5,"text-size":12,"text-font":[gi],"symbol-placement":"point"},paint:{"text-color":"#333333","text-halo-color":"#FFFFFF","text-halo-width":["interpolate",["linear"],["zoom"],6,1,10,1.5],"text-translate-anchor":"viewport"}}},yo=(e,r={})=>({...e,features:e.features.map((e,i)=>{const o=e.properties?.title??((e,t)=>t.textConfig?.textField?t.textConfig.textField:e.properties?.address?.freeformAddress)(e,r),a=e.properties?.color??((e,t)=>{const r=e?.colorConfig?.fillColor;if("string"==typeof r&&ho[r]){const e=ho[r];return e[t%e.length]}return r})(r,i);return{...e,properties:{...e.properties,...o&&{title:o},...a&&{color:a},id:e.properties?.id??t()}}})}),Oo=e=>{const r=e.features.map(e=>{let r;if(e.properties?.placeCoordinates)r=e.properties?.placeCoordinates;else if("MultiPolygon"===e.geometry.type){const t=(e=>e.flat().reduce((e,t)=>t.length>e.length?t:e,[]))(e.geometry.coordinates),a=i(t);r=a&&o(a)||null}else r=e.geometry.coordinates.flat();const a=e.id??e.properties?.id??t();return{type:"Feature",id:a,geometry:{type:"Point",coordinates:r},properties:{...e.properties,id:a}}});return{type:"FeatureCollection",bbox:e.bbox,features:r}},Lo=class e extends ci{static async get(t,r){return await Qr(t),new e(t,r)}constructor(e,t){super("geojson",e,t)}_initSourcesWithLayers(t,r){if(!r){e.lastInstanceIndex++,this.sourceID=`geometry-${e.lastInstanceIndex}`,this.titleSourceID=`geometryTitle-${e.lastInstanceIndex}`;const t=`geometry-${e.lastInstanceIndex}`;this.fillLayerID=`${t}_Fill`,this.outlineLayerID=`${t}_Outline`,this.titleLayerID=`${t}_Title`}const[i,o]=fo(this.fillLayerID,this.outlineLayerID,t),a=No(this.titleLayerID,t);return this.titleLayerSpecs=a,this.geometryFillLayerSpecs=i,this.geometryOutlineLayerSpecs=o,{geometry:new Jr(this.mapLibreMap,this.sourceID,[{...i},{...o}]),geometryLabel:new Jr(this.mapLibreMap,this.titleSourceID,[a])}}_applyConfig(e){return(e?.textConfig||e?.colorConfig||e?.lineConfig)&&this.updateLayerAndData(e),e?.beforeLayerConfig&&this.moveBeforeLayer(e.beforeLayerConfig),e}moveBeforeLayerID(e){for(const t of this.sourcesWithLayers.geometry.sourceAndLayerIDs.layerIDs)this.mapLibreMap.moveLayer(t,e)}moveBeforeLayer(e){this.config={...this.config,beforeLayerConfig:e},this.moveBeforeLayerID("top"===e?this.titleLayerID:Ii[e])}applyTextConfig(e){const t={...this.config,textConfig:e};this.updateLayerAndData(t),this.sourcesWithLayers.geometryLabel.show(Oo(this.sourcesWithLayers.geometry.shownFeatures)),this.config=t}updateLayerAndData(e){const[t,r]=fo(this.fillLayerID,this.outlineLayerID,e),i=No(this.titleLayerID,e);ei(t,this.geometryFillLayerSpecs,this.mapLibreMap),ei(r,this.geometryOutlineLayerSpecs,this.mapLibreMap),ei(i,this.titleLayerSpecs,this.mapLibreMap),this.geometryFillLayerSpecs=t,this.geometryOutlineLayerSpecs=r,this.titleLayerSpecs=i}restoreDataAndConfigImpl(){const e=this.sourcesWithLayers.geometry.shownFeatures;this.initSourcesWithLayers(this.config,!0),this.config&&this._applyConfig(this.config),this.show(e)}async show(e){await this.waitUntilModuleReady();const t=this.sourcesWithLayers.geometry;t.show(yo(e,this.config)),this.sourcesWithLayers.geometryLabel.show(Oo(t.shownFeatures))}async clear(){await this.waitUntilModuleReady(),this.sourcesWithLayers.geometry.clear()}get events(){return new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.geometry)}};Lo.lastInstanceIndex=-1;let Co=Lo;class go extends ci{static async get(e,t){return await Qr(e),await oi(e,Si,"hillshade"),new go(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(){const e=this.mapLibreMap.getSource(Si);if(!e)throw Br(`init ${go.name} with source ID ${Si}`);return{hillshade:new $r(this.mapLibreMap,e)}}_applyConfig(e){return this.setVisible(e?.visible??!1),e}setVisible(e){this.config={...this.config,visible:e},this.tomtomMap.mapReady&&this.sourcesWithLayers.hillshade.setLayersVisible(e)}isVisible(){return this.sourcesWithLayers.hillshade.isAnyLayerVisible()}get events(){return new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.hillshade)}}const mo=["standardLight","standardDark","drivingLight","drivingDark","monoLight","monoDark","satellite"],Uo=["trafficIncidents","trafficFlow","hillshade"],bo="#36A8F0",Mo="#105287",Po="#ABAFB3",vo="#3C4956",Do="#727C85",Ho=["interpolate",["linear"],["zoom"],1,3,5,4,10,7,18,10],wo=["==",["get","routeState"],"selected"],Fo=["==",["get","routeState"],"deselected"],Go="#AD0000",Bo="#FB2D09",xo="#f58240",Vo="#000000",Wo=e=>!1===e?.visible?"":e?.title??["format",["get","title"],"\n",["get","chargingPower"]," • ",["get","chargingDuration"]],Yo=e=>({...Hi,filter:wo,minzoom:4,layout:{...Hi.layout,"text-field":Wo(e?.text)},paint:{...Hi.paint}}),jo={filter:wo,minzoom:16},ko={...jo,type:"line",layout:{"line-cap":"round"}},Ko={...ko,paint:{"line-width":["interpolate",["linear"],["zoom"],16,14,22,20],"line-color":"grey"}},zo={...ko,paint:{"line-width":["interpolate",["linear"],["zoom"],16,12,22,17],"line-color":"white"}},$o="instruction-arrow",Xo={...jo,type:"symbol",layout:{"icon-allow-overlap":!0,"icon-image":$o,"icon-rotation-alignment":"map","icon-rotate":["get","lastPointBearingDegrees"],"icon-size":["interpolate",["linear"],["zoom"],16,1,22,2]}},Zo={filter:wo,type:"line",layout:{"line-join":"round"},paint:{"line-width":Ho,"line-color":"#6dc4ed"}},Jo={filter:wo,type:"symbol",minzoom:6,maxzoom:16.5,layout:{"symbol-placement":"point","symbol-avoid-edges":!0,"icon-image":"poi-ferry_terminal","icon-size":["interpolate",["linear"],["zoom"],6,.8,16.5,1],"icon-ignore-placement":!0}},Qo={type:"line",layout:{"line-join":"round","line-cap":"round","line-sort-key":["get","index"]}},qo=["interpolate",["linear"],["zoom"],1,5,5,6,10,10,18,14],ea={...Qo,filter:Fo,paint:{"line-color":vo,"line-width":qo}},ta={...Qo,filter:Fo,paint:{"line-color":Po,"line-width":Ho}},ra={...Qo,filter:wo,paint:{"line-color":Mo,"line-width":qo}},ia={type:"symbol",layout:{"symbol-placement":"line","icon-image":"roads-arrow-white","icon-rotate":180}},oa="selected-route-summary-popup",aa="deselected-route-summary-popup",sa={filter:wo,type:"line",layout:{"line-join":"round","line-cap":"round"},paint:{"line-width":["interpolate",["linear"],["zoom"],1,9,5,11,10,15,18,20],"line-color":"#BEBFFA"}},na={filter:wo,type:"symbol",minzoom:4,layout:{"symbol-placement":"point","symbol-avoid-edges":!0,"icon-image":"poi-toll_plaza","icon-size":["interpolate",["linear"],["zoom"],4,.8,16.5,1]}},ca=["interpolate",["linear"],["zoom"],1,2,5,3,10,4,18,6],la={type:"line",layout:{"line-cap":"round"},paint:{"line-width":ca,"line-color":["match",["get","magnitudeOfDelay"],"minor","#FFC105","moderate",Bo,"major",Go,"#C7D2D8"]}},Aa={type:"line",filter:["in",["get","magnitudeOfDelay"],["literal",["unknown","indefinite"]]],layout:{"line-join":"round"},paint:{"line-width":ca,"line-color":["match",["get","magnitudeOfDelay"],"unknown","rgba(190, 39, 27, 1)","rgba(137, 150, 168, 1)"],"line-dasharray":[1.5,1]}},_a=["match",["get","magnitudeOfDelay"],"minor",xo,"moderate",Bo,"major",Go,"indefinite","#666666",Vo],ua={filter:wo,type:"symbol",minzoom:6,layout:{"symbol-placement":"point","symbol-avoid-edges":!0,"icon-ignore-placement":!0}},Ea={...ua,filter:["all",["has","jamIconID"],ua.filter],layout:{...ua.layout,"icon-image":["get","jamIconID"],"icon-anchor":"bottom-left","text-anchor":"bottom-left","text-field":["get","title"],"text-font":[gi],"text-offset":[3.9,-1.4],"text-size":13},paint:{...ua.paint,"text-color":_a,"text-halo-color":"#FFFFFF","text-halo-width":1}},Ra={...ua,filter:["all",["has","causeIconID"],ua.filter],layout:{...ua.layout,"icon-image":["get","causeIconID"],"icon-anchor":"bottom-right"},paint:{...ua.paint}},Ta={filter:wo,type:"line",layout:{"line-join":"round"},paint:{"line-width":Ho,"line-color":"#000000","line-opacity":.3}},ha={filter:wo,type:"line",layout:{"line-join":"round"},paint:{"line-color":Mo,"line-width":Ho}},Ia={filter:wo,type:"line",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":bo,"line-width":["interpolate",["linear"],["zoom"],1,2,5,3,10,5,18,7],"line-dasharray":[0,1.5]}},pa="traffic-clear",Sa="traffic-major",fa="traffic-moderate",da="traffic-minor",Na=["has","formattedTraffic"],ya=e=>{const t=void 0!==e?wi(oa,e):oa,r=void 0!==e?wi(aa,e):aa,i=void 0!==e?wi(pa,e):pa,o=void 0!==e?wi(Sa,e):Sa,a=void 0!==e?wi(fa,e):fa,s=void 0!==e?wi(da,e):da;return{type:"symbol",layout:{"icon-image":["case",wo,t,r],"symbol-placement":"point","icon-rotation-alignment":"viewport","text-rotation-alignment":"viewport","symbol-sort-key":["case",wo,0,1],"icon-text-fit":"both","icon-text-fit-padding":[10,5,5,10],"text-font":["Noto-Medium"],"text-size":13,"icon-padding":0,"text-justify":"left","text-line-height":1.5,"text-field":["format",["get","formattedDuration"],{"text-font":["literal",[gi]],"text-color":["case",wo,"black",Do]},["concat","\t\t",["get","formattedDistance"]],{"text-color":Do},["case",Na,"\n",""],{},["image",["case",Na,["match",["get","magnitudeOfDelay"],"major",o,"moderate",a,"minor",s,i],""]],{},["case",Na,["concat"," ",["get","formattedTraffic"]],""],{"text-font":["literal",[gi]],"text-color":_a}]},paint:{"icon-translate":[0,-35],"text-translate":[0,-35]}}},Oa=ya(),La="start",Ca="middle",ga="finish",ma="indexType",Ua="stopDisplayIndex",ba="waypointStart",Ma="waypointStop",Pa="waypointSoft",va="waypointFinish",Da={"text-field":["get",Ua],"text-font":[gi],"text-size":["interpolate",["linear"],["zoom"],13,14,18,16],"text-offset":[0,-1.6],"icon-anchor":["case",["all",["==",["get",ma],Ca],["!",["has",Ua]]],"center","bottom"],"text-allow-overlap":!0},Ha={type:"symbol",paint:{...Pi,"text-color":"#ffffff"},layout:{...Mi,...Da,"symbol-sort-key":["case",["==",["get",Ui],Pa],0,["abs",["-",["get","index"],1e3]]]}},wa={type:"symbol",paint:{...Di,"text-color":"black","text-halo-width":1.5,"text-halo-color":"#ffffff"},layout:{...vi,"text-anchor":"top","text-offset":[0,.4]}},Fa=(e,t)=>e&&t&&(e.startsWith("route")||e.startsWith("waypoint"))?`${t}-${e}`:e,Ga=(e,t)=>e&&t?Object.fromEntries(Object.entries(e).map(([e,r])=>[e,r?.beforeID?{...r,beforeID:Fa(r.beforeID,t)}:r])):e,Ba=(e,t)=>e&&void 0!==t?`${e}-${t}`:e,xa=(e={},t,r)=>{const i=e.layers,o=i?.sections,a=e.theme?.mainColor;return{mainLines:{routeLineArrows:{...ia,beforeID:Ii.lowestLabel,...i?.mainLines?.routeLineArrows},routeLine:{...(s={color:a},{...Qo,filter:wo,paint:{"line-color":s?.color??bo,"line-width":Ho}}),beforeID:Fa("routeIncidentBackgroundLine",t),...i?.mainLines?.routeLine},routeOutline:{...ra,beforeID:Fa("routeLine",t),...i?.mainLines?.routeOutline},routeDeselectedLine:{...ta,beforeID:Fa("routeOutline",t),...i?.mainLines?.routeDeselectedLine},routeDeselectedOutline:{...ea,beforeID:Fa("routeDeselectedLine",t),...i?.mainLines?.routeDeselectedOutline},...Ga(i?.mainLines?.additional,t)},waypoints:{routeWaypointSymbol:{...Ha,beforeID:Fa("routeSummaryBubbleSymbol",t),...i?.waypoints?.routeWaypointSymbol},routeWaypointLabel:{...wa,beforeID:Fa("routeWaypointSymbol",t),...i?.waypoints?.routeWaypointLabel},...Ga(i?.waypoints?.additional,t)},chargingStops:{routeChargingStopSymbol:{...Yo(e.chargingStops),beforeID:Fa("routeWaypointSymbol",t),...i?.chargingStops?.routeChargingStopSymbol},...Ga(i?.chargingStops?.additional,t)},sections:{incident:{routeIncidentJamSymbol:{...Ea,beforeID:Fa("routeChargingStopSymbol",t),...o?.incident?.routeIncidentJamSymbol},routeIncidentCauseSymbol:{...Ra,beforeID:Fa("routeChargingStopSymbol",t),...o?.incident?.routeIncidentCauseSymbol},routeIncidentBackgroundLine:{...la,beforeID:Fa("routeIncidentDashedLine",t),...o?.incident?.routeIncidentBackgroundLine},routeIncidentDashedLine:{...Aa,beforeID:Fa("routeTunnelLine",t),...o?.incident?.routeIncidentDashedLine},...Ga(o?.incident?.additional,t)},ferry:{routeFerryLine:{...Zo,beforeID:Fa("routeLineArrows",t),...o?.ferry?.routeFerryLine},routeFerrySymbol:{...Jo,beforeID:Fa("routeIncidentJamSymbol",t),...o?.ferry?.routeFerrySymbol},...Ga(o?.ferry?.additional,t)},tollRoad:{routeTollRoadOutline:{...sa,beforeID:Fa("routeDeselectedOutline",t),...o?.tollRoad?.routeTollRoadOutline},routeTollRoadSymbol:{...na,beforeID:Fa("routeChargingStopSymbol",t),...o?.tollRoad?.routeTollRoadSymbol},...Ga(o?.tollRoad?.additional,t)},tunnel:{routeTunnelLine:{...Ta,beforeID:Fa("routeLineArrows",t),...o?.tunnel?.routeTunnelLine},...Ga(o?.tunnel?.additional,t)},vehicleRestricted:{routeVehicleRestrictedBackgroundLine:{...ha,beforeID:Fa("routeVehicleRestrictedForegroundLine",t),...o?.vehicleRestricted?.routeVehicleRestrictedBackgroundLine},routeVehicleRestrictedForegroundLine:{...Ia,beforeID:Ii.lowestLabel,...o?.vehicleRestricted?.routeVehicleRestrictedForegroundLine},...Ga(o?.vehicleRestricted?.additional,t)}},instructionLines:{routeInstructionLine:{...zo,beforeID:Ii.lowestLabel,...i?.instructionLines?.routeInstructionLine},routeInstructionOutline:{...Ko,beforeID:Fa("routeInstructionLine",t),...i?.instructionLines?.routeInstructionOutline},...Ga(i?.instructionLines?.additional,t)},instructionArrows:{routeInstructionArrowSymbol:{...Xo,beforeID:Fa("routeInstructionLine",t),...void 0!==r&&{layout:{...Xo.layout,"icon-image":Ba(Xo.layout?.["icon-image"],r)}},...i?.instructionArrows?.routeInstructionArrowSymbol},...Ga(i?.instructionArrows?.additional,t)},summaryBubbles:{routeSummaryBubbleSymbol:{...void 0!==r?ya(r):Oa,...i?.summaryBubbles?.routeSummaryBubbleSymbol},...Ga(i?.summaryBubbles?.additional,t)}};var s},Va=xa();let Wa;xr()&&(Wa=Vr(Wr('<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50">\n <path d="M1.562 40.569L25 1.562l23.438 39.007L25 27.566 1.562 40.569z" fill="#fff"/>\n <path d="M25.369.107c.782.429.506.167.917.682l23.438 39.007c.79 1.316-.671 2.829-2.014 2.085L25 29.281l-22.71 12.6c-1.343.744-2.804-.769-2.014-2.085L23.714.789c.461-.694.9-.682 1.656-.682zM25 1.562L1.562 40.569 25 27.566l23.438 13.003L25 1.562z"\n fill="gray"/>\n</svg>\n')));const Ya=e=>{if(!xr())return;const t=Wr('<svg xmlns="http://www.w3.org/2000/svg" width="160" height="65">\n <g filter="url(#A)">\n <rect id="pin" x="81.899" y="47" width="10" height="10" rx="2" transform="rotate(45 81.899 47)"/>\n <rect id="bubble" x="10" y="10" width="140" height="45" rx="12"/>\n </g>\n <defs>\n <filter id="A">\n <feDropShadow dx="0" dy="2" stdDeviation="4" flood-opacity=".3"/>\n </filter>\n </defs>\n</svg>\n');return t.querySelector("#bubble")?.setAttribute("fill",e),t.querySelector("#pin")?.setAttribute("fill",e),Vr(t)},ja={pixelRatio:2,stretchX:[[20,45],[100,130]],stretchY:[[20,35]],content:[10,10,130,45]},ka=e=>{if(!xr())return;const t=Wr('<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32">\n <g id="main">\n <path fill-rule="evenodd"\n d="M11.389 4H9.025a.86.86 0 0 0-.517.173l-.001-.001a.5.5 0 0 1-.464.059l-.028-.011a.5.5 0 0 1-.129-.83A1.86 1.86 0 0 1 9.025 3h2.364a2 2 0 0 1 1.789 1.106l1.02 2.04c.471.176.802.63.802 1.156v.803c0 .543 0 .815-.071 1.038a1.5 1.5 0 0 1-.914.953c-.219.08-.491.092-1.034.114l-1.481.062v-.166-.803a2.23 2.23 0 0 0-1.055-1.897l-.74-1.479 2.326.033h.955l-.703-1.406A1 1 0 0 0 11.389 4zM12 8.4a1 1 0 1 1 2 0 .5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5z"/>\n <path d="M11.833 11.115c0-.109.089-.198.198-.198h1.979c.109 0 .198.089.198.198 0 .328-.266.594-.594.594h-1.187c-.328 0-.594-.266-.594-.594z"/>\n <path fill-rule="evenodd"\n d="M1.802 8.146C1.331 8.321 1 8.776 1 9.302v.803c0 .543 0 .815.071 1.038a1.5 1.5 0 0 0 .914.953c.219.08.491.092 1.034.114l2.731.114 2.731-.114c.543-.023.814-.034 1.034-.114a1.5 1.5 0 0 0 .914-.953c.071-.223.071-.494.071-1.038v-.803c0-.526-.331-.98-.802-1.156l-1.02-2.04A2 2 0 0 0 6.889 5H4.611a2 2 0 0 0-1.789 1.106l-1.02 2.04zM6.889 6H4.611a1 1 0 0 0-.894.553l-.703 1.406h.955 3.563.955l-.703-1.406A1 1 0 0 0 6.889 6zM2 10.4a1 1 0 1 1 2 0 .5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm6.5-1a1 1 0 0 0-1 1 .5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5 1 1 0 0 0-1-1z"/>\n <path d="M1.792 13.115c0-.109.089-.198.198-.198h1.979c.109 0 .198.089.198.198 0 .328-.266.594-.594.594H2.385c-.328 0-.594-.266-.594-.594zm5.739-.198c-.109 0-.198.089-.198.198 0 .328.266.594.594.594h1.188c.328 0 .594-.266.594-.594 0-.109-.089-.198-.198-.198h-1.98z"/>\n </g>\n</svg>\n'),r=t.querySelector("#main");return r.setAttribute("transform","scale(2)"),r.setAttribute("fill",e),Vr(t)},Ka=(e,t)=>{if(!xr())return;const r=Yr(t);return e&&r.appendChild(e),Vr(r)},za=(e={},t)=>Object.entries(e).map(([e,r])=>({...r,id:t?`${t}-${e}`:e})),$a=(e={},t)=>({mainLines:za(e.mainLines,t),waypoints:za(e.waypoints,t),chargingStops:za(e?.chargingStops,t),ferries:za(e.sections?.ferry,t),incidents:za(e.sections?.incident,t),tollRoads:za(e.sections?.tollRoad,t),tunnels:za(e.sections?.tunnel,t),vehicleRestricted:za(e.sections?.vehicleRestricted,t),instructionLines:za(e.instructionLines,t),instructionArrows:za(e.instructionArrows,t),summaryBubbles:za(e.summaryBubbles,t)}),Xa=(e,t,r)=>{const i=a.instance.get().displayUnits,o=e?.displayUnits;return{...e,...o?{}:{displayUnits:i},layers:xa(e,t,r)}},Za={commonBaseURL:"https://api.tomtom.com",apiKey:"",apiVersion:1},Ja=class{constructor(){this.config={...Za}}put(e){this.config={...this.config,...e}}reset(){this.config={...Za}}get(){return this.config}};Ja.instance=new Ja;let Qa=Ja;const qa=()=>Date.now().toString(36)+Math.random().toString(36).substring(2);Object.fromEntries(Object.entries({SPORTS_CENTER:7320,STADIUM:7374,RESTAURANT:7315,CAFE_PUB:9376,HEALTH_CARE_SERVICE:9663,HOSPITAL:7321,HOSPITAL_POLYCLINIC:7321,DOCTOR:9373,SHOP:9361,MARIJUANA_DISPENSARY:9364,MARKET:7332,PUBLIC_AMENITY:9932,ROAD_TRAFFIC_CONTROL_CENTER:7301,POST_OFFICE:7324,COLLEGE_UNIVERSITY:7377,OPEN_PARKING_AREA:7369,CLUB_ASSOCIATION:9937,CAMPING_GROUND:7360,HOLIDAY_RENTAL:7304,VACATION_RENTAL:7304,AMUSEMENT_PARK:9902,RESIDENTIAL_ACCOMMODATION:7303,AGRICULTURAL_BUSINESS:7335,AGRICULTURE:7335,AIRPORT:7383,COMPANY:9352,NIGHTLIFE:9379,REPAIR_SHOP:7310,REPAIR_FACILITY:7310,HOTEL_MOTEL:7314,SCHOOL:7372,AUTOMOTIVE_DEALER:9910,MOVIE_THEATER:7342,CINEMA:7342,THEATER:7318,PARK_RECREATION_AREA:9362,PLACE_OF_WORSHIP:7339,IMPORTANT_TOURIST_ATTRACTION:7376,TOURIST_ATTRACTION:7376,TRAIL_SYSTEM:7302,TRAILS:7302,RAILWAY_STATION:7380,PUBLIC_TRANSPORT_STOP:9942,EXCHANGE:9160,MARINA:7347,WEIGH_STATION:7359,CAR_WASH:9155,LEISURE_CENTER:9378,ACCESS_GATEWAY:7389,GEOGRAPHIC_FEATURE:8099,URBAN_STATION:7380004,ADVENTURE_VEHICLE_TRAIL:7302003,ADVERTISING_COMPANY:9352003,AFGHAN_RESTAURANT:7315081,AFRICAN_RESTAURANT:7315002,AGRICULTURAL_SUPPLIES:9361073,AGRICULTURAL_TECHNOLOGY:9352012,AIRFIELD:7383005,AIRLINE_COMPANY:9352034,AIRLINE_ACCESS:7389002,ALGERIAN_RESTAURANT:7315082,AMBULANCE_UNIT:9663005,AMERICAN_RESTAURANT:7315003,AMPHITHEATER:7318007,AMUSEMENT_ARCADE:9902002,AMUSEMENT_PLACE:9902004,ANIMAL_SERVICES:9361048,ANIMAL_SHELTER:9352045,ANTIQUE_ART_SHOP:9361049,APARTMENT_RENTAL:7304006,AQUATIC_ZOO:9927004,ARABIAN_RESTAURANT:7315083,ARCH:7376012,ARGENTINIAN_RESTAURANT:7315084,ARMENIAN_RESTAURANT:7315085,ART_SCHOOL:7372012,ASHRAM:7339007,ASIAN_RESTAURANT:7315062,ATHLETICS_TRACK:7374002,ATV_DEALER:9910009,AUSTRALIAN_RESTAURANT:7315086,AUSTRIAN_RESTAURANT:7315004,AUTOMOBILE_COMPANY:9352013,AUTOMOBILE_MANUFACTURING:9352041,BAGS_LEATHERWEAR:9361058,BANQUET_ROOMS:7315146,BAR:9379004,BARBECUE_RESTAURANT:7315005,BASEBALL_PARK:7374009,BASKETBALL_ARENA:7374012,BASQUE_RESTAURANT:7315087,BATTLEFIELD:9362002,BAY:8099016,BEACH_CLUB:9937002,BEAUTY_SALON:9361067,BEAUTY_SUPPLIES:9361050,B_B_GUEST_HOUSE:7314002,BELGIAN_RESTAURANT:7315006,BETTING_STATION:9361072,BISTRO:7315007,BLOOD_BANK:9663004,BOAT_DEALER:9910004,BOAT_LAUNCHING_RAMP:9362032,BOATING_EQUIPMENT_ACCESSORIES:9361083,BODYSHOP:7310002,BOLIVIAN_RESTAURANT:7315088,BOOK_SHOP:9361002,BOSNIAN_RESTAURANT:7315089,BOWLING_CENTER:9378002,BRAZILIAN_RESTAURANT:7315072,BRIDGE:7376010,BRIDGE_TUNNEL_OPERATIONS:9352035,BRITISH_RESTAURANT:7315008,BUFFET_RESTAURANT:7315142,BUILDING:7376002,BULGARIAN_RESTAURANT:7315090,BUNGALOW_RENTAL:7304004,BURMESE_RESTAURANT:7315091,BUS_DEALER:9910008,BUS_CHARTER_COMPANY:9352025,BUS_LINES:9352027,BUS_STOP:9942002,BUSINESS_SERVICES:9352039,CABARET_THEATER:7318006,CABINS_LODGES:7314007,CABLE_TELEPHONE_COMPANY:9352040,CAFE:9376002,CAFETERIA:7315147,CALIFORNIAN_RESTAURANT:7315009,CAMBODIAN_RESTAURANT:7315092,CANADIAN_RESTAURANT:7315010,CAPE:8099020,CAR_DEALER:9910002,CAR_GLASS_REPLACEMENT_SHOP:7310003,CARAVAN_SITE:7360003,CARIBBEAN_RESTAURANT:7315011,CATERING_SERVICES:9352043,CAVE:8099003,C_DS_DVD_VIDEOS:9361003,VIDEO_RENTAL_SHOP:9361044,CEMETERY:9362003,CHALET_RENTAL:7304005,CHEMICAL_COMPANY:9352014,CHICKEN_RESTAURANT:7315070,CHILD_CARE_FACILITY:7372003,CHILEAN_RESTAURANT:7315093,CHINESE_RESTAURANT:7315012,CHRISTMAS_HOLIDAY_SHOP:9361082,CHURCH:7339002,CLEANING_SERVICES:9352029,CHILDRENS_CLOTHES:9361004,FOOTWEAR_SHOE_REPAIRS:9361005,CLOTHING_SHOP:9361006,MENS_CLOTHING:9361007,SPECIALTY_CLOTHING_SHOP:9361079,WOMENS_CLOTHING:9361008,COACH_STOP:9942005,COCKTAIL_BAR:9379006,COFFEE_SHOP:9376006,COLOMBIAN_RESTAURANT:7315094,COMEDY_CLUB:9379009,COMPUTER_DATA_SERVICES:9352004,SOFTWARE_COMPANY:9352005,CONCERT_HALL:7318002,CONDOMINIUM_COMPLEX:7303006,CONSTRUCTION_COMPANY:9352032,CONSTRUCTION_MATERIAL_EQUIPMENT:9361042,CONVENIENCE_STORE:9361009,CORSICAN_RESTAURANT:7315095,COTTAGE_RENTAL:7304002,COVE:8099017,CREOLE_RESTAURANT:7315063,CREPERIE:7315013,CRICKET_GROUND:7374003,CUBAN_RESTAURANT:7315096,CULINARY_SCHOOL:7372015,CYPRIOT_RESTAURANT:7315097,CZECH_RESTAURANT:7315068,DAM:7376007,DANCE_STUDIO_SCHOOL:9378003,DANISH_RESTAURANT:7315098,DELICATESSEN:9361060,DINNER_THEATER:7318008,DISCO_CLUB:9379002,DIVERSIFIED_FINANCIALS:9352006,DOMINICAN_RESTAURANT:7315099,DONGBEI_RESTAURANT:7315057,DOUGHNUT_RESTAURANT:7315079,DRIVE_THROUGH_BOTTLE_SHOP:9361076,DRIVE_IN_MOVIES:7342003,DRIVING_SCHOOL:7372016,DRUG_STORE:9361051,DRY_CLEANER:9361010,DUNE:8099005,DUTCH_RESTAURANT:7315014,EGYPTIAN_RESTAURANT:7315100,ELECTRICAL_APPLIANCES_SHOP:9361052,CAMERAS_PHOTOGRAPHY:9361011,COMPUTER_COMPUTER_SUPPLIES:9361012,CONSUMER_ELECTRONICS:9361013,OFFICE_EQUIPMENT:9361014,ENGLISH_RESTAURANT:7315101,EQUIPMENT_RENTAL:9352038,EROTIC_RESTAURANT:7315132,ETHIOPIAN_RESTAURANT:7315102,EXOTIC_RESTAURANT:7315133,FACTORY_OUTLET:9361016,FAIRGROUND:9362017,FARM:7335004,FARMERS_MARKET:7332004,FAST_FOOD:7315015,PHILIPPINE_RESTAURANT:7315016,FINNISH_RESTAURANT:7315104,FISHING_HUNTING_AREA:9362016,FITNESS_CLUB_CENTER:7320002,FLATS_APARTMENT_COMPLEX:7303003,FLORISTS:9361017,FLYING_CLUB:9378004,FONDUE_RESTAURANT:7315134,BAKERY:9361018,BUTCHER:9361019,FISHMONGER:9361020,FOOD_MARKET:9361021,GREENGROCER:9361022,GROCERY_STORE:9361023,OTHER_FOOD_SHOPS:9361024,WINE_SPIRITS:9361025,FOOTBALL_STADIUM:7374010,FOREST_AREA:9362015,FRENCH_RESTAURANT:7315017,FUNERAL_SERVICE_MORTUARIES:9352036,FURNITURE_HOME_FURNISHINGS:9361054,FUSION_RESTAURANT:7315071,CAR_REPAIR_AND_SERVICE:7310004,GENERAL_PRACTITIONER:9373002,GERMAN_RESTAURANT:7315018,GIFTS_CARDS_NOVELTIES_SOUVENIRS:9361026,GLASSWARE_CERAMIC_SHOP:9361055,GOLD_EXCHANGE:9160003,GREEK_RESTAURANT:7315019,GRILL_RESTAURANT:7315020,GUANGDONG_RESTAURANT:7315054,GURUDWARA:7339006,HAIRDRESSER:9361027,HAMBURGER_RESTAURANT:7315069,HARBOR:8099018,HARDWARE_STORE:9361069,HAWAIIAN_RESTAURANT:7315021,HIGH_SCHOOL:7372006,HIKING_TRAIL:7302004,HILL:8099025,HISTORIC_SITE:9362004,HISTORICAL_PARK:9362005,HOBBY_SHOP:9361053,HOCKEY_CLUB:9937003,HOME_APPLIANCE_REPAIR:9352044,HORSE_RACING_TRACK:7374005,HORSE_RIDING_CENTER:7320003,HORTICULTURE:7335002,HOSPITAL_FOR_WOMEN_AND_CHILDREN:7321005,HOSPITAL_OF_CHINESE_MEDICINE:7321004,HOSTEL:7314004,HOT_POT_RESTAURANT:7315058,HOTEL:7314003,CARPET_FLOOR_COVERINGS:9361028,CURTAINS_TEXTILES:9361029,DO_IT_YOURSELF_CENTERS:9361030,HOUSE_GARDEN_FURNITURE_FITTINGS:9361031,GARDEN_CENTERS_SERVICES:9361032,GLASS_WINDOWS_STORE:9361080,KITCHENS_BATHROOMS:9361033,LIGHTING_SHOPS:9361034,PAINTING_DECORATING:9361035,HUNAN_RESTAURANT:7315052,HUNGARIAN_RESTAURANT:7315022,ICE_CREAM_PARLOR:7315078,ICE_HOCKEY_ARENA:7374008,IMPORT_EXPORT_AND_DISTRIBUTION:9352042,INDIAN_RESTAURANT:7315023,INDONESIAN_RESTAURANT:7315024,INFORMAL_MARKET:7332002,INSURANCE_COMPANY:9352007,INTERNATIONAL_RESTAURANT:7315073,INTERNATIONAL_RAILROAD_STATION:7380002,INTERNET_CAFE:9376004,INVESTMENT_ADVISOR:9352037,IRANIAN_RESTAURANT:7315105,IRISH_RESTAURANT:7315065,ISLAND:8099022,ISRAELI_RESTAURANT:7315106,ITALIAN_RESTAURANT:7315025,JAMAICAN_RESTAURANT:7315066,JAPANESE_RESTAURANT:7315026,JAZZ_CLUB:9379008,JEWELRY_CLOCKS_WATCHES:9361036,JEWISH_RESTAURANT:7315027,JUNIOR_COLLEGE_COMMUNITY_COLLEGE:7377003,KARAOKE_CLUB:9379010,KOREAN_RESTAURANT:7315028,KOSHER_RESTAURANT:7315067,LAGOON:8099019,LAKESHORE:9362006,LANGUAGE_SCHOOL:7372010,LATIN_AMERICAN_RESTAURANT:7315029,LAUNDRY:9361045,LEBANESE_RESTAURANT:7315030,LEGAL_SERVICES:9352023,LOCAL_POST_OFFICE:7324003,LOCAL_SPECIALITIES_SHOP:9361056,LOCALE:8099027,LOTTERY_SHOP:9361071,LUXEMBOURGIAN_RESTAURANT:7315107,MACROBIOTIC_RESTAURANT:7315135,MAGHRIB_RESTAURANT:7315108,DELIVERY_SERVICE:9352008,MALTESE_RESTAURANT:7315031,MANUFACTURING_COMPANY:9352011,MARINE_ELECTRONIC_EQUIPMENT:9361065,MARSH:8099023,MAURITIAN_RESTAURANT:7315109,MAUSOLEUM_GRAVE:7376011,MECHANICAL_ENGINEERING:9352016,MEDICAL_SUPPLIES_EQUIPMENT:9361043,MEDITERRANEAN_RESTAURANT:7315032,MEMORIAL:9362007,SUBWAY_STATION:7380005,MEXICAN_RESTAURANT:7315033,MICROBREWERY:9376007,MIDDLE_EASTERN_RESTAURANT:7315034,MIDDLE_SCHOOL:7372014,MILITARY_AIRPORT:7383004,MINERAL_HOT_SPRINGS:8099021,MINING_COMPANY:9352031,MOBILE_PHONE_SHOP:9361075,MONGOLIAN_RESTAURANT:7315110,MONUMENT:7376003,MOROCCAN_RESTAURANT:7315074,MOSQUE:7339003,MOTEL:7314006,MOTOR_RACING_STADIUM:7374011,MOTORCYCLE_DEALER:9910003,MOTORCYCLE_REPAIR:7310008,MOUNTAIN_BIKE_TRAIL:7302002,MOUNTAIN_PEAK:8099002,MOVING_STORAGE_COMPANY:9352033,MULTI_PURPOSE_STADIUM:7374006,MUSIC_CENTER:7318003,MUSIC_INSTRUMENTS_STORE:9361059,MUSSELS_RESTAURANT:7315136,NAIL_SALON:9361068,NATIONAL_RAILROAD_STATION:7380003,NATURAL_RECREATION_ATTRACTION:9362030,NEPALESE_RESTAURANT:7315111,NETBALL_STADIUM:7374014,NEWSAGENTS_TOBACCONISTS:9361037,NORWEGIAN_RESTAURANT:7315112,OASIS:8099011,OBSERVATORY:7376005,OEM:9352021,OIL_NATURAL_GAS:9352030,OPERA_HOUSE:7318004,OPTICIAN:9361038,ORGANIC_FOOD_RESTAURANT:7315075,ORIENTAL_RESTAURANT:7315035,OTHER_REPAIR_SHOPS:7310005,OTHER_WINTER_SPORT:9362025,PAGODA:7339008,PAKISTANI_RESTAURANT:7315127,PAN:8099009,PARK:9362008,PARKWAY:9362009,PASSENGER_TRANSPORT_TICKET_OFFICE:9932002,PAWN_SHOP:9361070,PEDESTRIAN_SUBWAY:9932003,PERSONAL_CARE_FACILITY:9663003,PERSONAL_SERVICE:9663002,PERUVIAN_RESTAURANT:7315061,PET_SUPPLIES:9361064,PHARMACEUTICAL_COMPANY:9352018,PHOTO_LAB_DEVELOPMENT:9361046,PHOTOCOPY_SHOP:9361047,PICNIC_AREA:9362033,PIZZERIA:7315036,PLAIN_FLAT:8099007,PLANETARIUM:7376006,PLATEAU:8099008,POLISH_RESTAURANT:7315037,POLYNESIAN_RESTAURANT:7315129,PORTUGUESE_RESTAURANT:7315038,PRE_SCHOOL:7372004,PRESERVE:9362010,PRIMARY_PRODUCER:7335003,PRIMARY_SCHOOL:7372005,PRIVATE_AIRPORT:7383003,PRIVATE_CLUB:9379003,PROVENCAL_RESTAURANT:7315130,PUB:9376003,PUB_FOOD:7315039,PUBLIC_MARKET:7332003,PUBLIC_AIRPORT:7383002,PUBLIC_CALL_BOX:9932004,PUBLIC_HEALTH_TECHNOLOGY_COMPANY:9352017,PUBLISHING_TECHNOLOGIES:9352019,QUARRY:8099026,RACE_TRACK:7374013,RAILROAD_SIDING:7380006,RAPIDS:8099015,REAL_ESTATE_COMPANY:9352009,REAL_ESTATE_AGENT:9361015,RECREATION_AREA:9362011,RECREATIONAL_CAMPING_GROUND:7360002,RECREATIONAL_VEHICLE_DEALER:9910005,RECYCLING_SHOP:9361057,REEF:8099014,RESERVOIR:8099013,RESIDENTIAL_ESTATE:7303004,RESORT:7314005,REST_CAMP:7314008,RETAIL_OUTLET:9361063,RETIREMENT_COMMUNITY:7303002,RIDGE:8099004,RIVER_CROSSING:8099024,ROAD_RESCUE:9932006,ROADSIDE_RESTAURANT:7315041,ROCK_CLIMBING_TRAIL:7302006,ROCKS:8099012,RUGBY_GROUND:7374007,ROMANIAN_RESTAURANT:7315131,RUSSIAN_RESTAURANT:7315040,SALAD_BAR:7315143,CAR_ACCESSORIES:7310006,SANDWICH_RESTAURANT:7315042,SAUNA_SOLARIUM_MASSAGE:9378005,SAVINGS_INSTITUTION:9352010,SAVOY_RESTAURANT:7315113,SCANDINAVIAN_RESTAURANT:7315114,SCOTTISH_RESTAURANT:7315115,SEAFOOD:7315043,SEASHORE:9362013,SECURED_ENTRANCE:7389004,SECURITY_PRODUCTS:9361078,SENIOR_HIGH_SCHOOL:7372007,SERVICE_COMPANY:9352002,SHANDONG_RESTAURANT:7315053,SHANGHAI_RESTAURANT:7315055,SHOPPING_SERVICE:9361062,SICHUAN_RESTAURANT:7315056,SICILIAN_RESTAURANT:7315116,SKI_RESORT:9362026,SLAVIC_RESTAURANT:7315117,SLOVAK_RESTAURANT:7315080,SNACKS_RESTAURANT:7315139,SNOOKER_POOL_BILLIARD:9378006,SOCCER_STADIUM:7374004,SOUL_FOOD:7315064,SOUP_RESTAURANT:7315140,SPANISH_RESTAURANT:7315044,SPECIAL_HOSPITAL:7321003,SPECIAL_SCHOOL:7372013,SPECIALIST:9373003,SPECIALTY_FOODS:9361061,SPORT_SCHOOL:7372011,SPORTS_EQUIPMENT_CLOTHING:9361039,STAMP_SHOP:9361074,STATION_ACCESS:7389003,STATUE:7376013,STEAK_HOUSE:7315045,STOCK_EXCHANGE:9160002,SUDANESE_RESTAURANT:7315118,SUPERMARKETS_HYPERMARKETS:7332005,SURINAMESE_RESTAURANT:7315046,SUSHI_RESTAURANT:7315148,SWEDISH_RESTAURANT:7315119,SWISS_RESTAURANT:7315047,SYNAGOG:7339004,SYRIAN_RESTAURANT:7315120,TAILOR_SHOP:9361077,TAIWANESE_RESTAURANT:7315059,TAKEOUT_FOOD:7315145,TAPAS_RESTAURANT:7315076,TAX_SERVICES:9352022,TAXI_STAND:9942003,TAXI_LIMOUSINE_SHUTTLE_SERVICE:9352026,TEA_HOUSE:9376005,TECHNICAL_SCHOOL:7372009,TELECOMMUNICATIONS:9352020,TEMPLE:7339005,TEPPANYAKI_RESTAURANT:7315121,THAI_RESTAURANT:7315048,THEMATIC_SPORT_CENTER:7320005,TIBETAN_RESTAURANT:7315122,PUBLIC_TOILET:9932005,TOWER:7376009,TOWNHOUSE_COMPLEX:7303005,TOYS_GAMES_SHOP:9361040,TRAFFIC_SERVICE_CENTER:7301002,TRAFFIC_CONTROL_DEPARTMENT:7301002,STREETCAR_STOP:9942004,TRANSPORT_COMPANY:9352024,TRAVEL_AGENT:9361041,TRUCK_DEALER:9910006,TRUCK_REPAIR_AND_SERVICE:7310009,TRUCK_WASH:9155003,TUNISIAN_RESTAURANT:7315123,TUNNEL:7376008,TURKISH_RESTAURANT:7315049,TIRE_SERVICE:7310007,URUGUAYAN_RESTAURANT:7315124,VALLEY:8099006,VAN_DEALER:9910007,VARIETY_STORE:9361081,VEGETARIAN_RESTAURANT:7315050,VENEZUELAN_RESTAURANT:7315125,VIETNAMESE_RESTAURANT:7315051,VILLA_RENTAL:7304003,VOCATIONAL_SCHOOL:7372008,WATER_HOLE:7376014,WEDDING_SERVICES:9352046,WEIGH_SCALES:7359003,WELL:8099010,WELSH_RESTAURANT:7315126,WESTERN_RESTAURANT:7315060,WHOLESALE_CLUB:9361066,WILDERNESS_AREA:9362014,WILDLIFE_PARK:9927005,WINE_BAR:9379007,YACHT_BASIN:7347003,YOGURT_JUICE_BAR:7315149,ZOO:9927003,ZOOS_ARBORETA_BOTANICAL_GARDEN:9927,ELECTRONICS_COMPANY:9352015,RIVER_SCENIC_AREA:9362036,HORSE_RIDING_TRAIL:7302005,NATURAL_TOURIST_ATTRACTION:7376004,OPEN_CAR_PARKING_AREA:7369002,MEDICINAL_MARIJUANA_DISPENSARY:9364002,RECREATIONAL_MARIJUANA_DISPENSARY:9364003,ICE_SKATING_RINK:9360,TENNIS_COURT:9369,GOLF_COURSE:9911,WATER_SPORT:9371,SWIMMING_POOL:7338,RESTAURANT_AREA:9359,DENTIST:9374,VETERINARIAN:9375,PHARMACY:7326,EMERGENCY_ROOM:9956,DEPARTMENT_STORE:7327,SHOPPING_CENTER:7373,FIRE_STATION_BRIGADE:7392,NON_GOVERNMENTAL_ORGANIZATION:9152,PRISON_CORRECTIONAL_FACILITY:9154,EMBASSY:7365,LIBRARY:9913,TRANSPORT_AUTHORITY_VEHICLE_REGISTRATION:9151,WELFARE_ORGANIZATION:9153,NATIVE_RESERVATION:9389,COURTHOUSE:9363,POLICE_STATION:7322,PRIMARY_RESOURCE_UTILITY:9150,GOVERNMENT_OFFICE:7367,MILITARY_INSTALLATION:9388,RENT_A_CAR_PARKING:9930,MUSEUM:7317,INDUSTRIAL_BUILDING:9383,PARKING_GARAGE:7313,TOURIST_INFORMATION_OFFICE:7316,MEDIA_FACILITY:9158,WINERY:7349,EMERGENCY_MEDICAL_SERVICE:7391,CASINO:7341,MANUFACTURING_FACILITY:9156,COMMERCIAL_BUILDING:9382,CULTURAL_CENTER:7319,EXHIBITION_CONVENTION_CENTER:9377,RENT_A_CAR_FACILITY:7312,TRUCK_STOP:7358,ADVENTURE_SPORTS_FACILITY:7305,ADVENTURE_SPORTS_VENUE:7305,REST_AREA:7395,RESEARCH_FACILITY:9157,COURIER_DROP_BOX:7388,GAS_STATION:7311,PETROL_STATION:7311,FUEL_FACILITIES:7311,MOTORING_ORGANIZATION_OFFICE:7368,CASH_DISPENSER:7397,ATM:7397,COMMUNITY_CENTER:7363,BEACH:9357,PORT_WAREHOUSE_FACILITY:9159,ELECTRIC_VEHICLE_STATION:7309,SCENIC_PANORAMIC_VIEW:7337,ENTERTAINMENT:9900,BUSINESS_PARK:7378,BANK:7328,HELIPAD_HELICOPTER_LANDING:7308,CHECKPOINT:9955,FRONTIER_CROSSING:7366,MOUNTAIN_PASS:9935,TOLL_GATE:7375,FERRY_TERMINAL:7352}).map(([e,t])=>[t,e]));const es=e=>e?.minutes??"min",ts=(e,t)=>{if(e){const i=Math.abs(e)/3600;let o=Math.floor(i),a=Math.round(i%1*60);60===a&&(a=0,o++);const s={...Qa.instance.get().displayUnits?.time,...t};if(o)return`${o} ${r=s,r?.hours??"hr"} ${a.toString().padStart(2,"0")} ${es(s)}`;if(a)return`${a.toString()} ${es(s)}`}var r},rs=(e,t)=>{const r=t?.chargingStops?.icon;if(r?.mapping){const t=r.mapping;switch(t.basedOn){case"chargingSpeed":if(e.properties.chargingConnectionInfo?.chargingSpeed)return t.value[e.properties.chargingConnectionInfo?.chargingSpeed];break;case"custom":return t.fn(e)}}return"7309"},is=e=>{const t=e.properties;return t.chargingParkName??t.chargingParkOperatorName},os=(e,t)=>{const r=[];if(!1!==t?.chargingStops?.visible)for(const i of e.features)for(const e of i.properties.sections.leg){const o=e.summary.chargingInformationAtEndOfLeg;if(o){const e=o.properties;r.push({...o,properties:{...o.properties,id:o.properties.chargingParkId??qa(),iconID:rs(o,t),title:is(o),chargingPower:`${e.chargingConnectionInfo?.chargingPowerInkW} kW`,chargingDuration:ts(e.chargingTimeInSeconds,t?.displayUnits?.time),routeState:i.properties.routeState}})}}return{type:"FeatureCollection",features:r}},as=e=>e.categories.includes("jam"),ss=e=>{const t=(e=>{if(as(e))return s(e.delayInSeconds)})(e),r=((e,t)=>as(e)?`traffic-jam-${e.magnitudeOfDelay??"unknown"}-${(e=>e?.length?e.length<6?"small":e.length<8?"medium":"large":"collapsed")(t)}`:null)(e,t),i=(e=>{switch(e.categories.find(e=>"jam"!==e)){case"accident":return"traffic-incidents-accident";case"roadworks":return"traffic-incidents-roadworks";case"road-closed":return"traffic-incidents-road_closed";case"danger":case"animals-on-road":return"traffic-incidents-danger";case"broken-down-vehicle":return"traffic-incidents-broken_down_vehicle";case"lane-closed":case"narrow-lanes":return"traffic-incidents-lane_closed";case"wind":return"traffic-incidents-wind";case"fog":return"traffic-incidents-fog";case"rain":return"traffic-incidents-rain";case"frost":return"traffic-incidents-frost";case"flooding":return"traffic-incidents-flooding";default:return null}})(e);return{...e,...r&&{jamIconID:r},...i&&{causeIconID:i},...t&&{title:t}}},ns=(e,t,r)=>{if(e.properties.radiusMeters)return void 0!==r?wi(Pa,r):Pa;let i;switch(t){case"start":i=ba;break;case"finish":i=va;break;default:i=Ma}return void 0!==r?wi(i,r):i},cs=(e,r,i)=>{let o=-1;return{type:"FeatureCollection",features:e.map((a,s)=>{if(!a)return o++,null;const c=(e=>{return Array.isArray(e)?{type:"Feature",geometry:{type:"Point",coordinates:e},properties:{}}:"Point"===e.type?{type:"Feature",geometry:t=e,properties:{},...t.bbox&&{bbox:t.bbox}}:e;var t})(a),l=((e,t)=>0===e?La:e<t-1?Ca:ga)(s,e.length),A=(e=>!e.properties.radiusMeters)(c);A&&o++;const _=(e=>{const t=e?.properties;return t?.poi?.name??t?.address?.freeformAddress??void 0})(c),u=c.id??t();return{...c,..."main-when-available"===r?.entryPoints&&{geometry:{type:"Point",coordinates:n(c,{useEntryPoint:"main-when-available"})}},id:u,properties:{...c.properties,id:u,index:s,indexType:l,..._&&{title:_},iconID:ns(c,l,i),...A&&l===Ca&&{stopDisplayIndex:o}}}}).filter(e=>e)}};function ls(e){return e%360*Math.PI/180}function As(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return[...e.geometry.coordinates];if("Point"===e.type)return[...e.coordinates]}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return[...e];throw new Error("coord must be GeoJSON Point or an Array of numbers")}function _s(e,t,r={}){if(!0===r.final)return function(e,t){let r=_s(t,e);return r=(r+180)%360,r}(e,t);const i=As(e),o=As(t),a=ls(i[0]),s=ls(o[0]),n=ls(i[1]),c=ls(o[1]),l=Math.sin(s-a)*Math.cos(c),A=Math.cos(n)*Math.sin(c)-Math.sin(n)*Math.cos(c)*Math.cos(s-a);return Math.atan2(l,A)%(2*Math.PI)*180/Math.PI}var us=_s;const Es=(e,r,i)=>({type:"FeatureCollection",features:e.features.flatMap(e=>((e,r,i)=>e.properties.sections[r]?.map(r=>{const o=r.id??t();return{type:"Feature",id:o,geometry:{type:"LineString",coordinates:e.geometry.coordinates.slice(r.startPointIndex,r.endPointIndex+1)},properties:{...i?i(r,e.properties):r,routeState:e.properties.routeState,routeIndex:e.properties.index,id:o}}})||[])(e,r,i))}),Rs=(e,t)=>{return t.show((r=e,i=t.shownFeatures,{...i,features:i.features.map(e=>({...e,properties:{...e.properties,routeState:r.features[e.properties.routeIndex||0].properties.routeState}}))}));var r,i},Ts=(e,r=0)=>{const i="features"in e?e:{type:"FeatureCollection",features:[e]};return{...i,features:i.features.map((e,i)=>{const o=e.id??t();return{...e,id:o,properties:{...e.properties,id:o,routeState:i===r?"selected":"deselected"}}})}},hs=(e,t)=>e.some(e=>e.magnitudeOfDelay===t),Is=(e,r)=>({type:"FeatureCollection",features:e.features.map(e=>{const i=e.properties.summary,o=e.geometry.coordinates,a=s(i.trafficDelayInSeconds,r?.time),n=(e=>{const t=e.properties.sections.traffic;if(t?.length)return hs(t,"major")?"major":hs(t,"moderate")?"moderate":hs(t,"minor")?"minor":void 0})(e),l=e.id??t();return{type:"Feature",id:l,geometry:{type:"Point",coordinates:o[Math.round(o.length/2)]},properties:{id:l,routeIndex:e.properties.index,routeState:e.properties.routeState,formattedDistance:c(i.lengthInMeters,r?.distance),...n&&{magnitudeOfDelay:n},...a&&{formattedTraffic:a},formattedDuration:s(i.travelTimeInSeconds,r?.time)}}})}),ps=class e extends ci{static async get(t,r){return await Qr(t),new e(t,r)}constructor(e,t){super("geojson",e,t)}createSourcesWithLayers(e){const t=wi("routes",this.instanceIndex);return{mainLines:new Jr(this.mapLibreMap,`${t}-mainLines`,e.mainLines,!1),waypoints:new Jr(this.mapLibreMap,`${t}-waypoints`,e.waypoints,!1),incidents:new Jr(this.mapLibreMap,`${t}-incidents`,e.incidents,!1),ferries:new Jr(this.mapLibreMap,`${t}-ferries`,e.ferries,!1),chargingStops:new Jr(this.mapLibreMap,`${t}-chargingStops`,e.chargingStops,!1),tollRoads:new Jr(this.mapLibreMap,`${t}-tollRoads`,e.tollRoads,!1),tunnels:new Jr(this.mapLibreMap,`${t}-tunnels`,e.tunnels,!1),vehicleRestricted:new Jr(this.mapLibreMap,`${t}-vehicleRestricted`,e.vehicleRestricted,!1),instructionLines:new Jr(this.mapLibreMap,`${t}-instructionLines`,e.instructionLines,!1),instructionArrows:new Jr(this.mapLibreMap,`${t}-instructionArrows`,e.instructionArrows,!1),summaryBubbles:new Jr(this.mapLibreMap,`${t}-summaryBubbles`,e.summaryBubbles,!1)}}_initSourcesWithLayers(t,r){r||(e.lastInstanceIndex++,this.instanceIndex=e.lastInstanceIndex,this.layerIDPrefix=wi("routes",this.instanceIndex)),this.layersSpecs=$a(Xa(t,this.layerIDPrefix,this.instanceIndex).layers,this.layerIDPrefix);const i=this.createSourcesWithLayers(this.layersSpecs);ri(Object.values(i).flatMap(e=>e._layerSpecs),this.mapLibreMap);const o={fillColor:t?.theme?.mainColor,...t?.waypoints?.icon?.style},a={pixelRatio:2},s=wi(ba,this.instanceIndex),n=wi(Ma,this.instanceIndex),c=wi(Pa,this.instanceIndex),l=wi(va,this.instanceIndex),A=wi($o,this.instanceIndex),_=wi(oa,this.instanceIndex),u=wi(aa,this.instanceIndex),E=wi(pa,this.instanceIndex),R=wi(Sa,this.instanceIndex),T=wi(fa,this.instanceIndex),h=wi(da,this.instanceIndex);this.addImageIfNotExisting(s,(e=>{if(xr())return Ka(Wr('<svg xmlns="http://www.w3.org/2000/svg" width="120" height="140">\n <path d="M63.734 86.383c-1.404.026-2.78-.393-3.93-1.197s-2.01-1.949-2.46-3.271l-3.15-9.339c-1.093-3.403-3.748-6.089-7.154-7.238L37.5 62.21c-2.742-.902-4.567-3.477-4.5-6.345-.058-2.874 1.761-5.457 4.5-6.388l36-11.886c2.461-.88 5.213-.27 7.062 1.567s2.466 4.571 1.578 7.015L70.17 81.918c-.938 2.719-3.54 4.526-6.436 4.469h0z"\n fill="#f4f5f6"/>\n</svg>\n'),e)})(o),a),this.addImageIfNotExisting(n,Ka(void 0,o),a),this.addImageIfNotExisting(c,(()=>{if(xr())return Vr(Wr('<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">\n <circle id="circle" cx="16" cy="16" r="12" fill="white" stroke="#105287" stroke-width="4"/>\n</svg>\n'))})(),a),this.addImageIfNotExisting(l,(e=>{if(xr())return Ka(Wr('<svg xmlns="http://www.w3.org/2000/svg" width="120" height="140">\n <path d="M33 83.404a2.99 2.99 0 0 1-3-2.978V44.681a2.99 2.99 0 1 1 6 0v35.745a2.99 2.99 0 0 1-3 2.978zm48-38.723H39v17.872h42V44.681zm3.878 37.851a3.02 3.02 0 0 0 4.244 0c.561-.559.878-1.317.878-2.106V44.681a2.99 2.99 0 1 0-6 0v35.745c0 .789.317 1.547.878 2.106z"\n fill="#f4f5f6"/>\n</svg>\n'),e)})(o),a),this.addImageIfNotExisting(A,Wa,a),this.addImageIfNotExisting(_,Ya("white"),ja),this.addImageIfNotExisting(u,Ya("#EEEEEE"),ja),this.addImageIfNotExisting(E,ka(Vo),a),this.addImageIfNotExisting(R,ka(Go),a),this.addImageIfNotExisting(T,ka(Bo),a),this.addImageIfNotExisting(h,ka(xo),a);for(const e of t?.chargingStops?.icon?.customIcons??[])this.addImageIfNotExisting(e.id,e.image,{pixelRatio:e.pixelRatio??2});return i}_applyConfig(e){const t=Xa(e,this.layerIDPrefix,this.instanceIndex);if(this.config){const e=$a(t.layers,this.layerIDPrefix);Object.keys(e).forEach(t=>{const r=t;((e,t,r,i)=>{const o=e.reduce((e,t)=>({...e,[t.id]:t}),{}),a=t.reduce((e,t)=>({...e,[t.id]:t}),{}),s=[],n=[],c=[],l=[];Object.keys(o).forEach(e=>{a[e]?(c.push(o[e]),l.push(a[e])):s.push(e)}),Object.keys(a).forEach(e=>{o[e]||n.push(e)});const A=r._layerSpecs;n.forEach(e=>{i.removeLayer(e);for(let t=0;t<A.length;t++)if(A[t].id===e){A.splice(t,1);break}}),s.forEach(e=>{const t={...o[e],source:r.source.id};A.push(t)}),r._updateSourceAndLayerIDs(),ti(c,l,i)})(e[r],this.layersSpecs[r],this.sourcesWithLayers[r],this.mapLibreMap)});const r=Object.values(this.sourcesWithLayers);ri(r.flatMap(e=>e._layerSpecs),this.mapLibreMap),r.forEach(e=>e.setLayersVisible(!!e.shownFeatures.features.length)),this.layersSpecs=e}return!Ur(this.config?.displayUnits,t.displayUnits)&&this.sourcesWithLayers.summaryBubbles.shownFeatures.features.length&&this.sourcesWithLayers.summaryBubbles.show(Is(this.sourcesWithLayers.mainLines.shownFeatures,t.displayUnits)),t}async restoreDataAndConfigImpl(){const e=Object.entries(this.sourcesWithLayers).map(e=>({[e[0]]:e[1].shownFeatures})).reduce((e,t)=>({...e,...t}),{});this.initSourcesWithLayers(this.config,!0),this._applyConfig(this.config);for(const t of Object.keys(e))this.sourcesWithLayers[t].show(e[t])}addImageIfNotExisting(e,t,r){ai(0,e,t,this.mapLibreMap,r)}async showRoutes(e,r){const i=Ts(e,r?.selectedIndex);await this.waitUntilModuleReady(),this.sourcesWithLayers.mainLines.show(i),this.sourcesWithLayers.vehicleRestricted.show(Es(i,"vehicleRestricted")),this.sourcesWithLayers.incidents.show(Es(i,"traffic",ss)),this.sourcesWithLayers.chargingStops.show(os(i,this.config)),this.sourcesWithLayers.ferries.show(Es(i,"ferry")),this.sourcesWithLayers.tunnels.show(Es(i,"tunnel")),this.sourcesWithLayers.tollRoads.show(Es(i,"toll")),this.sourcesWithLayers.instructionLines.show((e=>({type:"FeatureCollection",features:e.features.flatMap((e,r)=>e.properties.guidance?.instructions?.filter(e=>e.routePath?.length).map(i=>({type:"Feature",geometry:{type:"LineString",coordinates:i.routePath.map(e=>e.point)},properties:{...i,id:t(),routeIndex:r,routeState:e.properties.routeState}}))||[])}))(i)),this.sourcesWithLayers.instructionArrows.show((e=>({type:"FeatureCollection",features:e.features.flatMap((e,r)=>e.properties.guidance?.instructions?.filter(e=>e.routePath?.length&&e.routePath.length>1).map(i=>{const o=[i.routePath[i.routePath.length-2]?.point,i.routePath[i.routePath.length-1]?.point];return{type:"Feature",geometry:{type:"Point",coordinates:o[1]},properties:{...i,id:t(),routeIndex:r,routeState:e.properties.routeState,lastPointBearingDegrees:us(o[0],o[1])}}})||[])}))(i)),this.sourcesWithLayers.summaryBubbles.show(Is(i,this.config?.displayUnits))}async clearRoutes(){await this.waitUntilModuleReady();for(const e of Object.keys(this.sourcesWithLayers))"waypoints"!==e&&this.sourcesWithLayers[e].clear()}async selectRoute(e){const t=Ts(this.sourcesWithLayers.mainLines.shownFeatures,e);await this.waitUntilModuleReady(),this.sourcesWithLayers.mainLines.show(t),this.sourcesWithLayers.chargingStops.show(os(t,this.config)),Rs(t,this.sourcesWithLayers.vehicleRestricted),Rs(t,this.sourcesWithLayers.incidents),Rs(t,this.sourcesWithLayers.ferries),Rs(t,this.sourcesWithLayers.tollRoads),Rs(t,this.sourcesWithLayers.tunnels),Rs(t,this.sourcesWithLayers.instructionLines),Rs(t,this.sourcesWithLayers.instructionArrows),Rs(t,this.sourcesWithLayers.summaryBubbles)}async showWaypoints(e){const t=Array.isArray(e)?cs(e,this.config?.waypoints,this.instanceIndex):cs(e.features,this.config?.waypoints,this.instanceIndex);await this.waitUntilModuleReady(),this.sourcesWithLayers.waypoints.show(t)}async clearWaypoints(){await this.waitUntilModuleReady(),this.sourcesWithLayers.waypoints.clear()}get events(){return{mainLines:new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.mainLines),waypoints:new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.waypoints),chargingStops:new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.chargingStops),summaryBubbles:new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.summaryBubbles),incidents:new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.incidents),vehicleRestricted:new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.vehicleRestricted),ferries:new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.ferries),tollRoads:new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.tollRoads),tunnels:new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.tunnels),instructionLines:new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.instructionLines)}}getLayerToRenderLinesUnder(){return Ii.lowestLabel}};ps.lastInstanceIndex=-1;let Ss=ps;const fs="standardLight",ds={standardLight:{trafficIncidents:"incidents_light",trafficFlow:"flow_relative-light",hillshade:"hillshade_light"},standardDark:{trafficIncidents:"incidents_dark",trafficFlow:"flow_relative-dark",hillshade:"hillshade_dark"},drivingLight:{trafficIncidents:"incidents_light",trafficFlow:"flow_relative-light",hillshade:"hillshade_light"},drivingDark:{trafficIncidents:"incidents_dark",trafficFlow:"flow_relative-dark",hillshade:"hillshade_dark"},monoLight:{trafficIncidents:"incidents_light",trafficFlow:"flow_relative-light",hillshade:"hillshade_mono-light"},monoDark:{trafficIncidents:"incidents_dark",trafficFlow:"flow_relative-dark",hillshade:"hillshade_mono-dark"},satellite:{trafficIncidents:"incidents_light",trafficFlow:"flow_relative-light",hillshade:"hillshade_satellite"}},Ns=e=>`\${baseURL}/maps/orbis/assets/styles/\${version}/style.json?&apiVersion=1&key=\${apiKey}&map=${e}`,ys={standardLight:Ns("basic_street-light"),standardDark:Ns("basic_street-dark"),drivingLight:Ns("basic_street-light-driving"),drivingDark:Ns("basic_street-dark-driving"),monoLight:Ns("basic_mono-light"),monoDark:Ns("basic_mono-dark"),satellite:Ns("basic_street-satellite")},Os=(e,t,r)=>{const i=e.id??fs,o=new URL(ys[i].replace("${baseURL}",t).replace("${version}",e.version??"0.6.0-0").replace("${apiKey}",r));for(const a of e.include??Uo)o.searchParams.append(a,ds[i][a]);return o.toString()},Ls=e=>{const t=e.style,r=e.commonBaseURL,i=e.apiKey;return"string"==typeof t?Os({id:t},r,i):"standard"===t?.type?Os(t,r,i):"custom"===t?.type&&t?.url?((e,t)=>{const r=new URL(e);return r.searchParams.has("key")?console.warn("The style URL is coming with an API key parameter which takes priority. If you want to use the SDK configured API key, remove the key param from the style URL"):r.searchParams.set("key",t),r.toString()})(t.url,i):"custom"===t?.type&&t?.json?t.json:Os({id:fs},r,i)};class Cs{constructor(t,r){this.mapReady=!1,this.styleChangeHandlers=[],this.setStyle=(e,t={keepState:!0})=>{this.mapReady=!1;for(const o of this.styleChangeHandlers)try{o.onStyleAboutToChange()}catch(i){console.error(i)}const r=t.keepState?((e,t)=>t&&"object"==typeof t&&"standard"===t.type&&t.include&&("string"==typeof e||"standard"===e.type&&!e.include)?{type:"standard",id:"string"==typeof e?e:e.id,include:t.include}:e)(e,this._params.style):e;this._params={...this._params,style:r},this.styleLightDarkTheme=ni(r),this.mapLibreMap.once("styledata",()=>{!this.mapReady&&Ur(r,this._params.style)&&this.handleStyleData(t.keepState||!0)}),this.mapLibreMap.setStyle(Ls(this._params),{validate:!1})},this.getStyle=()=>this._params.style,this._params=l(r),this.styleLightDarkTheme=ni(this._params.style),this.ensureMapLibreCSSLoaded(),this.mapLibreMap=new _(((t,r)=>{return{validateStyle:!1,maxTileCacheZoomLevels:22,cancelPendingTileRequestsWhileZooming:!1,...t,style:Ls(r),attributionControl:{compact:!1},transformRequest:(i=r,(t,r)=>t.includes("tomtom.com")?"Image"===r?{url:t}:{url:t,headers:{...e(i)}}:{url:t})};var i})(t,this._params)),this.mapLibreMap.once("styledata",()=>{this.handleStyleData(!1)}),this._eventsProxy=new hi(this.mapLibreMap,this._params?.eventsConfig),this.loadRTLTextPlugin()}loadRTLTextPlugin(){setTimeout(()=>{["deferred","loaded"].includes(u())||E("https://unpkg.com/@mapbox/mapbox-gl-rtl-text@0.3.0/dist/mapbox-gl-rtl-text.js",!0).catch(e=>console.error("Something went wrong when setting RTL plugin",e))})}ensureMapLibreCSSLoaded(){if("undefined"==typeof document)return;if(Array.from(document.querySelectorAll('link[rel="stylesheet"], style')).some(e=>e.textContent?.includes(".maplibregl-map")))return;const e=document.createElement("link");e.rel="stylesheet",e.href="https://unpkg.com/maplibre-gl@5.14.0/dist/maplibre-gl.css",document.head.appendChild(e)}_setLanguage(e){this._params={...this._params,language:e};const t=e?.includes("-")?e.split("-")[0]:e;this.mapLibreMap.getStyle().layers.forEach(e=>{if("symbol"===e.type&&(e=>{const t=e.layout?.["text-field"]??"";return!!t&&("{name}"===t||2===t.length&&"name"===t[1]||3===t.length&&Array.isArray(t[1])&&"string"==typeof t[1][1]&&t[1][1].includes("name_")&&Array.isArray(t[2])&&t[2].includes("name"))})(e)){const r=t?["coalesce",["get",`name_${t}`],["get","name"]]:["get","name"];this.mapLibreMap.setLayoutProperty(e.id,"text-field",r,{validate:!1})}})}setLanguage(e){this.mapReady?this._setLanguage(e):this.mapLibreMap.once("styledata",()=>this.setLanguage(e))}getBBox(){return this.mapLibreMap.getBounds().toArray().flat()}handleStyleData(e){for(const r of zr(this.mapLibreMap,[di,Ni,Si]))this.mapLibreMap.setLayoutProperty(r.id,"visibility","none",{validate:!1});if((async(e,t)=>{t.setSprite(`${e.commonBaseURL}/maps/orbis/assets/sprites/2.*/sprite?key=${e.apiKey}&poi=poi_${ni(e.style)}&apiVersion=1&apiChannel=preview`,{validate:!1})})(this._params,this.mapLibreMap),this._params.language&&this._setLanguage(this._params.language),this.mapReady=!0,e)for(const r of this.styleChangeHandlers)try{r.onStyleChanged()}catch(t){console.error(t)}}addStyleChangeHandler(e){this.styleChangeHandlers.push(e)}}const gs=["unknown","accident","fog","dangerous_conditions","rain","ice","jam","lane_closed","road_closed","road_works","wind","flooding","broken_down_vehicle"],ms={unknown:0,accident:1,fog:2,dangerous_conditions:3,rain:4,ice:5,jam:6,lane_closed:7,road_closed:8,road_works:9,wind:10,flooding:11,broken_down_vehicle:14},Us=["motorway","trunk","primary","secondary","tertiary","street"],bs=["connecting","major_local"],Ms=["local","minor_local"],Ps=(e,t)=>e.length?1===e.length?{expression:e[0],legacy:t[0]}:{expression:["all",...e],legacy:["all",...t]}:null,vs=(e,t,r)=>{e&&(t.push(e.expression),r.push(e.legacy))},Ds=(e,t,r,i)=>{e&&vs(ao(t,e),r,i)},Hs=(e,t,r)=>{Ds(e.roadCategories,"road_category",t,r),Ds(e.roadSubCategories,"road_subcategory",t,r)},ws=e=>{const t=[],r=[];if(Hs(e,t,r),e.incidentCategories){const i=ao("icon_category_0",e.incidentCategories,e=>ms[e]);vs(i,t,r)}if(e.magnitudes){const i=ao("magnitude",e.magnitudes,e=>A.indexOf(e));vs(i,t,r)}return e.delays&&vs((e=>{const t=[],r=[];if(e.mustHaveDelay&&e.minDelayMinutes){const i=60*e.minDelayMinutes;t.push([">=",["get","delay"],i]),r.push([">=","delay",i])}else if(e.mustHaveDelay)t.push([">",["get","delay"],0]),r.push([">","delay",0]);else if(e.minDelayMinutes){const i=60*e.minDelayMinutes;t.push(["any",["!",["has","delay"]],["==",["get","delay"],0],[">=",["get","delay"],i]]),r.push(["any",["!has","delay"],["==","delay",0],[">=","delay",i]])}return Ps(t,r)})(e.delays),t,r),Ps(t,r)},Fs=e=>{if(!e?.any?.length)return null;const t=e.any.map(ws).filter(e=>!br(e));return ro(t)},Gs=e=>{const t=[],r=[];if(Hs(e,t,r),e.showRoadClosures){const i="only"===e.showRoadClosures?"==":"!=";t.push([i,["get","road_closure"],!0]),r.push([i,"road_closure",!0])}return Ps(t,r)},Bs=(e,t,r,i)=>{for(const o of t)r.setFilter(o.id,e?io(e,i[o.id]):i[o.id])};class xs extends ci{static async get(e,t){return await Qr(e),await oi(e,Ni,"trafficFlow"),new xs(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(){const e=this.mapLibreMap.getSource(Ni);if(!e)throw Br(`init ${xs.name} with source ID ${Ni}`);this.originalFilters={};for(const t of this.getLayers())this.originalFilters[t.id]=t.filter;return{trafficFlow:new $r(this.mapLibreMap,e)}}_applyConfig(e){return this.setVisible(e?.visible??!1),this._filter(e?.filters,!1),e}getLayers(){return zr(this.tomtomMap.mapLibreMap,[Ni])}filter(e){this._filter(e)}_filter(e,t=!0){if(this.tomtomMap.mapReady)if(e?.any?.length){const t=(e=>{if(!e?.any?.length)return null;const t=e.any.map(Gs).filter(e=>!br(e));return ro(t)})(e);t&&Bs(t,this.getLayers(),this.mapLibreMap,this.originalFilters)}else this.config?.filters?.any?.length&&Bs(void 0,this.getLayers(),this.mapLibreMap,this.originalFilters);t&&(this.config=wr({...this.config,filters:e},br))}setVisible(e){this.config={...this.config,visible:e},this.tomtomMap.mapReady&&this.sourcesWithLayers.trafficFlow.setLayersVisible(e)}isVisible(){return this.sourcesWithLayers.trafficFlow.isAnyLayerVisible()}get events(){return new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.trafficFlow)}}class Vs extends ci{static async get(e,t){return await Qr(e),await oi(e,di,"trafficIncidents"),new Vs(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(){const e=this.mapLibreMap.getSource(di);if(!e)throw Br(`init ${Vs.name} with source ID ${di}`);this.originalFilters={};for(const t of this.getLayers())this.originalFilters[t.id]=t.filter;return{trafficIncidents:new $r(this.mapLibreMap,e)}}_applyConfig(e){return this._setVisible(e?.visible??!1,{updateConfig:!1}),br(e?.icons?.visible)||this.setIconsVisible(e.icons.visible),this._filter(e?.filters,e?.icons?.filters,!1),e}filter(e,t){this._filter(e,t)}_filter(e,t,r=!0){if(this.tomtomMap.mapReady){if(e?.any?.length){const r=Fs(e);if(r){const e=t?this.getNonSymbolLayers():this.getLayers();Bs(r,e,this.mapLibreMap,this.originalFilters)}}else this.config?.filters?.any?.length&&Bs(void 0,this.getLayers(),this.mapLibreMap,this.originalFilters);if(t?.any?.length){const e=Fs(t);e&&Bs(e,this.getSymbolLayers(),this.mapLibreMap,this.originalFilters)}}r&&(this.config=wr({...this.config,filters:e,icons:{...this.config?.icons,filters:t}},br))}getLayers(){return zr(this.tomtomMap.mapLibreMap,[di])}getSymbolLayers(){return this.getLayers().filter(e=>"symbol"===e.type)}getNonSymbolLayers(){return this.getLayers().filter(e=>"symbol"!=e.type)}setIconsVisible(e){this.config={...this.config,icons:{...this.config?.icons,visible:e}},this.tomtomMap.mapReady&&this.sourcesWithLayers.trafficIncidents.setLayersVisible(e,e=>"symbol"===e.type)}setVisible(e){this._setVisible(e)}_setVisible(e,t){(t?.updateConfig??!0)&&(delete this.config?.icons?.visible,this.config={...wr({...this.config},mr),visible:e}),this.tomtomMap.mapReady&&this.sourcesWithLayers.trafficIncidents.setLayersVisible(e)}isVisible(){return this.sourcesWithLayers.trafficIncidents.isAnyLayerVisible()}anyIconLayersVisible(){return!!this.sourcesWithLayers.trafficIncidents?.isAnyLayerVisible(e=>"symbol"===e.type)}get events(){return new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.trafficIncidents)}}export{ci as AbstractMapModule,Kr as AbstractSourceWithLayers,Xr as AddedSourceWithLayers,fi as BASE_MAP_SOURCE_ID,uo as BaseMapModule,Po as DESELECTED_FOREGROUND_COLOR,vo as DESELECTED_OUTLINE_COLOR,Fo as DESELECTED_ROUTE_FILTER,Do as DESELECTED_SECONDARY_COLOR,li as EventsModule,hi as EventsProxy,ga as FINISH_INDEX,To as GEOMETRY_COLOR_PROP,Ro as GEOMETRY_TITLE_PROP,Jr as GeoJSONSourceWithLayers,Co as GeometriesModule,Si as HILLSHADE_SOURCE_ID,go as HillshadeModule,ma as INDEX_TYPE,Go as MAJOR_DELAY_COLOR,Ca as MIDDLE_INDEX,xo as MINOR_DELAY_LABEL_COLOR,Bo as MODERATE_DELAY_COLOR,pi as POI_SOURCE_ID,co as POIsModule,eo as PlacesModule,bo as ROUTE_LINE_FOREGROUND_COLOR,Ho as ROUTE_LINE_FOREGROUND_WIDTH,Mo as ROUTE_LINE_OUTLINE_COLOR,Ss as RoutingModule,wo as SELECTED_ROUTE_FILTER,La as START_INDEX,Ua as STOP_DISPLAY_INDEX,$r as StyleSourceWithLayers,Ni as TRAFFIC_FLOW_SOURCE_ID,di as TRAFFIC_INCIDENTS_SOURCE_ID,Cs as TomTomMap,kr as TomTomMapSource,xs as TrafficFlowModule,Vs as TrafficIncidentsModule,Vo as UNKNOWN_DELAY_COLOR,Eo as baseMapLayerGroupNames,zi as buildPlaceTitle,xa as buildRoutingLayers,Va as defaultRoutingLayers,zr as filterLayersBySources,Xi as getIconIDForPlace,Zi as getPOILayerCategoryForPlace,no as getStyleCategories,gs as incidentCategories,ms as incidentCategoriesMapping,Oi as mapDisplayPoiCategoryMappings,Ii as mapStyleLayerIDs,so as poiCategoryGroups,yi as poiLayerIDs,Qi as preparePlacesForDisplay,Us as roadCategories,mo as standardStyleIDs,Ms as streetRoadCategories,Uo as styleModules,bs as tertiaryRoadCategories,Ci as toBaseMapPOICategory,Ji as toPlaces};
1
+ import{generateTomTomHeaders as e,generateId as t,poiCategoriesToID as r,bboxFromCoordsArray as i,bboxCenter as o,TomTomConfig as a,formatDuration as s,getPosition as n,formatDistance as c,mergeFromGlobal as l,indexedMagnitudes as u}from"@tomtom-org/maps-sdk/core";import{Map as h,getRTLTextPluginStatus as p,setRTLTextPlugin as _}from"maplibre-gl";var f="object"==typeof global&&global&&global.Object===Object&&global,d="object"==typeof self&&self&&self.Object===Object&&self,y=f||d||Function("return this")(),A=y.Symbol,E=Object.prototype,R=E.hasOwnProperty,g=E.toString,I=A?A.toStringTag:void 0;var T=Object.prototype.toString;var m=A?A.toStringTag:void 0;function S(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":m&&m in Object(e)?function(e){var t=R.call(e,I),r=e[I];try{e[I]=void 0;var i=!0}catch(a){}var o=g.call(e);return i&&(t?e[I]=r:delete e[I]),o}(e):function(e){return T.call(e)}(e)}function L(e){return null!=e&&"object"==typeof e}function O(e){return"symbol"==typeof e||L(e)&&"[object Symbol]"==S(e)}function N(e,t){for(var r=-1,i=null==e?0:e.length,o=Array(i);++r<i;)o[r]=t(e[r],r,e);return o}var b=Array.isArray,C=A?A.prototype:void 0,v=C?C.toString:void 0;function M(e){if("string"==typeof e)return e;if(b(e))return N(e,M)+"";if(O(e))return v?v.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function w(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function U(e){return e}function P(e){if(!w(e))return!1;var t=S(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var D,x=y["__core-js_shared__"],F=(D=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||""))?"Symbol(src)_1."+D:"";var H=Function.prototype.toString;function G(e){if(null!=e){try{return H.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var j=/^\[object .+?Constructor\]$/,B=Function.prototype,W=Object.prototype,V=B.toString,k=W.hasOwnProperty,Y=RegExp("^"+V.call(k).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function z(e){return!(!w(e)||(t=e,F&&F in t))&&(P(e)?Y:j).test(G(e));var t}function K(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return z(r)?r:void 0}var $=K(y,"WeakMap");var Z=Date.now;var q,X,J,Q=function(){try{var e=K(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),ee=Q?function(e,t){return Q(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:U,te=(q=ee,X=0,J=0,function(){var e=Z(),t=16-(e-J);if(J=e,t>0){if(++X>=800)return arguments[0]}else X=0;return q.apply(void 0,arguments)});var re=/^(?:0|[1-9]\d*)$/;function ie(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&re.test(e))&&e>-1&&e%1==0&&e<t}function oe(e,t,r){"__proto__"==t&&Q?Q(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function ae(e,t){return e===t||e!=e&&t!=t}var se=Object.prototype.hasOwnProperty;function ne(e,t,r){var i=e[t];se.call(e,t)&&ae(i,r)&&(void 0!==r||t in e)||oe(e,t,r)}var ce=Math.max;function le(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function ue(e){return null!=e&&le(e.length)&&!P(e)}var he=Object.prototype;function pe(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||he)}function _e(e){return L(e)&&"[object Arguments]"==S(e)}var fe=Object.prototype,de=fe.hasOwnProperty,ye=fe.propertyIsEnumerable,Ae=_e(/* @__PURE__ */function(){return arguments}())?_e:function(e){return L(e)&&de.call(e,"callee")&&!ye.call(e,"callee")};var Ee="object"==typeof exports&&exports&&!exports.nodeType&&exports,Re=Ee&&"object"==typeof module&&module&&!module.nodeType&&module,ge=Re&&Re.exports===Ee?y.Buffer:void 0,Ie=(ge?ge.isBuffer:void 0)||function(){return!1},Te={};function me(e){return function(t){return e(t)}}Te["[object Float32Array]"]=Te["[object Float64Array]"]=Te["[object Int8Array]"]=Te["[object Int16Array]"]=Te["[object Int32Array]"]=Te["[object Uint8Array]"]=Te["[object Uint8ClampedArray]"]=Te["[object Uint16Array]"]=Te["[object Uint32Array]"]=!0,Te["[object Arguments]"]=Te["[object Array]"]=Te["[object ArrayBuffer]"]=Te["[object Boolean]"]=Te["[object DataView]"]=Te["[object Date]"]=Te["[object Error]"]=Te["[object Function]"]=Te["[object Map]"]=Te["[object Number]"]=Te["[object Object]"]=Te["[object RegExp]"]=Te["[object Set]"]=Te["[object String]"]=Te["[object WeakMap]"]=!1;var Se="object"==typeof exports&&exports&&!exports.nodeType&&exports,Le=Se&&"object"==typeof module&&module&&!module.nodeType&&module,Oe=Le&&Le.exports===Se&&f.process,Ne=function(){try{var e=Le&&Le.require&&Le.require("util").types;return e||Oe&&Oe.binding&&Oe.binding("util")}catch(t){}}(),be=Ne&&Ne.isTypedArray,Ce=be?me(be):function(e){return L(e)&&le(e.length)&&!!Te[S(e)]},ve=Object.prototype.hasOwnProperty;function Me(e,t){var r=b(e),i=!r&&Ae(e),o=!r&&!i&&Ie(e),a=!r&&!i&&!o&&Ce(e),s=r||i||o||a,n=s?function(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}(e.length,String):[],c=n.length;for(var l in e)!t&&!ve.call(e,l)||s&&("length"==l||o&&("offset"==l||"parent"==l)||a&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||ie(l,c))||n.push(l);return n}function we(e,t){return function(r){return e(t(r))}}var Ue=we(Object.keys,Object),Pe=Object.prototype.hasOwnProperty;function De(e){if(!pe(e))return Ue(e);var t=[];for(var r in Object(e))Pe.call(e,r)&&"constructor"!=r&&t.push(r);return t}function xe(e){return ue(e)?Me(e):De(e)}var Fe=Object.prototype.hasOwnProperty;function He(e){if(!w(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=pe(e),r=[];for(var i in e)("constructor"!=i||!t&&Fe.call(e,i))&&r.push(i);return r}function Ge(e){return ue(e)?Me(e,!0):He(e)}var je=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Be=/^\w*$/;function We(e,t){if(b(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!O(e))||(Be.test(e)||!je.test(e)||null!=t&&e in Object(t))}var Ve=K(Object,"create");var ke=Object.prototype.hasOwnProperty;var Ye=Object.prototype.hasOwnProperty;function ze(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function Ke(e,t){for(var r=e.length;r--;)if(ae(e[r][0],t))return r;return-1}ze.prototype.clear=function(){this.__data__=Ve?Ve(null):{},this.size=0},ze.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ze.prototype.get=function(e){var t=this.__data__;if(Ve){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return ke.call(t,e)?t[e]:void 0},ze.prototype.has=function(e){var t=this.__data__;return Ve?void 0!==t[e]:Ye.call(t,e)},ze.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Ve&&void 0===t?"__lodash_hash_undefined__":t,this};var $e=Array.prototype.splice;function Ze(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}Ze.prototype.clear=function(){this.__data__=[],this.size=0},Ze.prototype.delete=function(e){var t=this.__data__,r=Ke(t,e);return!(r<0)&&(r==t.length-1?t.pop():$e.call(t,r,1),--this.size,!0)},Ze.prototype.get=function(e){var t=this.__data__,r=Ke(t,e);return r<0?void 0:t[r][1]},Ze.prototype.has=function(e){return Ke(this.__data__,e)>-1},Ze.prototype.set=function(e,t){var r=this.__data__,i=Ke(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this};var qe=K(y,"Map");function Xe(e,t){var r,i,o=e.__data__;return("string"==(i=typeof(r=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function Je(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}Je.prototype.clear=function(){this.size=0,this.__data__={hash:new ze,map:new(qe||Ze),string:new ze}},Je.prototype.delete=function(e){var t=Xe(this,e).delete(e);return this.size-=t?1:0,t},Je.prototype.get=function(e){return Xe(this,e).get(e)},Je.prototype.has=function(e){return Xe(this,e).has(e)},Je.prototype.set=function(e,t){var r=Xe(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this};function Qe(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var i=arguments,o=t?t.apply(this,i):i[0],a=r.cache;if(a.has(o))return a.get(o);var s=e.apply(this,i);return r.cache=a.set(o,s)||a,s};return r.cache=new(Qe.Cache||Je),r}Qe.Cache=Je;var et=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tt=/\\(\\)?/g,rt=function(e){var t=Qe(e,function(e){return 500===r.size&&r.clear(),e}),r=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(et,function(e,r,i,o){t.push(i?o.replace(tt,"$1"):r||e)}),t});function it(e,t){return b(e)?e:We(e,t)?[e]:rt(function(e){return null==e?"":M(e)}(e))}function ot(e){if("string"==typeof e||O(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function at(e,t){for(var r=0,i=(t=it(t,e)).length;null!=e&&r<i;)e=e[ot(t[r++])];return r&&r==i?e:void 0}function st(e,t){for(var r=-1,i=t.length,o=e.length;++r<i;)e[o+r]=t[r];return e}var nt=A?A.isConcatSpreadable:void 0;function ct(e){return b(e)||Ae(e)||!!(nt&&e&&e[nt])}function lt(e){return(null==e?0:e.length)?function(e,t,r,i,o){var a=-1,s=e.length;for(r||(r=ct),o||(o=[]);++a<s;){var n=e[a];r(n)?st(o,n):o[o.length]=n}return o}(e):[]}var ut=we(Object.getPrototypeOf,Object),ht=Function.prototype,pt=Object.prototype,_t=ht.toString,ft=pt.hasOwnProperty,dt=_t.call(Object);function yt(e){var t=this.__data__=new Ze(e);this.size=t.size}yt.prototype.clear=function(){this.__data__=new Ze,this.size=0},yt.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},yt.prototype.get=function(e){return this.__data__.get(e)},yt.prototype.has=function(e){return this.__data__.has(e)},yt.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Ze){var i=r.__data__;if(!qe||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new Je(i)}return r.set(e,t),this.size=r.size,this};var At="object"==typeof exports&&exports&&!exports.nodeType&&exports,Et=At&&"object"==typeof module&&module&&!module.nodeType&&module,Rt=Et&&Et.exports===At?y.Buffer:void 0;function gt(){return[]}Rt&&Rt.allocUnsafe;var It=Object.prototype.propertyIsEnumerable,Tt=Object.getOwnPropertySymbols,mt=Tt?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var r=-1,i=null==e?0:e.length,o=0,a=[];++r<i;){var s=e[r];t(s,r,e)&&(a[o++]=s)}return a}(Tt(e),function(t){return It.call(e,t)}))}:gt,St=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)st(t,mt(e)),e=ut(e);return t}:gt;function Lt(e,t,r){var i=t(e);return b(e)?i:st(i,r(e))}function Ot(e){return Lt(e,xe,mt)}function Nt(e){return Lt(e,Ge,St)}var bt=K(y,"DataView"),Ct=K(y,"Promise"),vt=K(y,"Set"),Mt="[object Map]",wt="[object Promise]",Ut="[object Set]",Pt="[object WeakMap]",Dt="[object DataView]",xt=G(bt),Ft=G(qe),Ht=G(Ct),Gt=G(vt),jt=G($),Bt=S;(bt&&Bt(new bt(new ArrayBuffer(1)))!=Dt||qe&&Bt(new qe)!=Mt||Ct&&Bt(Ct.resolve())!=wt||vt&&Bt(new vt)!=Ut||$&&Bt(new $)!=Pt)&&(Bt=function(e){var t=S(e),r="[object Object]"==t?e.constructor:void 0,i=r?G(r):"";if(i)switch(i){case xt:return Dt;case Ft:return Mt;case Ht:return wt;case Gt:return Ut;case jt:return Pt}return t});var Wt=Object.prototype.hasOwnProperty;var Vt=y.Uint8Array;function kt(e){var t=new e.constructor(e.byteLength);return new Vt(t).set(new Vt(e)),t}var Yt=/\w*$/;var zt=A?A.prototype:void 0,Kt=zt?zt.valueOf:void 0;function $t(e,t,r){var i,o,a,s,n,c=e.constructor;switch(t){case"[object ArrayBuffer]":return kt(e);case"[object Boolean]":case"[object Date]":return new c(+e);case"[object DataView]":return n=kt((s=e).buffer),new s.constructor(n,s.byteOffset,s.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e){var t=kt(e.buffer);return new e.constructor(t,e.byteOffset,e.length)}(e);case"[object Map]":case"[object Set]":return new c;case"[object Number]":case"[object String]":return new c(e);case"[object RegExp]":return(a=new(o=e).constructor(o.source,Yt.exec(o))).lastIndex=o.lastIndex,a;case"[object Symbol]":return i=e,Kt?Object(Kt.call(i)):{}}}var Zt=Ne&&Ne.isMap,qt=Zt?me(Zt):function(e){return L(e)&&"[object Map]"==Bt(e)};var Xt=Ne&&Ne.isSet,Jt=Xt?me(Xt):function(e){return L(e)&&"[object Set]"==Bt(e)},Qt="[object Arguments]",er="[object Function]",tr="[object Object]",rr={};function ir(e,t,r,i,o,a){var s;if(r&&(s=o?r(e,i,o,a):r(e)),void 0!==s)return s;if(!w(e))return e;var n=b(e);if(n)s=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Wt.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e);else{var c=Bt(e),l=c==er||"[object GeneratorFunction]"==c;if(Ie(e))return e.slice();if(c==tr||c==Qt||l&&!o)s={};else{if(!rr[c])return o?e:{};s=$t(e,c)}}a||(a=new yt);var u=a.get(e);if(u)return u;a.set(e,s),Jt(e)?e.forEach(function(i){s.add(ir(i,t,r,i,e,a))}):qt(e)&&e.forEach(function(i,o){s.set(o,ir(i,t,r,o,e,a))});var h=n?void 0:Nt(e);return function(e,t){for(var r=-1,i=null==e?0:e.length;++r<i&&!1!==t(e[r],r,e););}(h||e,function(i,o){h&&(i=e[o=i]),ne(s,o,ir(i,t,r,o,e,a))}),s}rr[Qt]=rr["[object Array]"]=rr["[object ArrayBuffer]"]=rr["[object DataView]"]=rr["[object Boolean]"]=rr["[object Date]"]=rr["[object Float32Array]"]=rr["[object Float64Array]"]=rr["[object Int8Array]"]=rr["[object Int16Array]"]=rr["[object Int32Array]"]=rr["[object Map]"]=rr["[object Number]"]=rr[tr]=rr["[object RegExp]"]=rr["[object Set]"]=rr["[object String]"]=rr["[object Symbol]"]=rr["[object Uint8Array]"]=rr["[object Uint8ClampedArray]"]=rr["[object Uint16Array]"]=rr["[object Uint32Array]"]=!0,rr["[object Error]"]=rr[er]=rr["[object WeakMap]"]=!1;function or(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new Je;++t<r;)this.add(e[t])}function ar(e,t){for(var r=-1,i=null==e?0:e.length;++r<i;)if(t(e[r],r,e))return!0;return!1}or.prototype.add=or.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},or.prototype.has=function(e){return this.__data__.has(e)};function sr(e,t,r,i,o,a){var s=1&r,n=e.length,c=t.length;if(n!=c&&!(s&&c>n))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var h=-1,p=!0,_=2&r?new or:void 0;for(a.set(e,t),a.set(t,e);++h<n;){var f=e[h],d=t[h];if(i)var y=s?i(d,f,h,t,e,a):i(f,d,h,e,t,a);if(void 0!==y){if(y)continue;p=!1;break}if(_){if(!ar(t,function(e,t){if(s=t,!_.has(s)&&(f===e||o(f,e,r,i,a)))return _.push(t);var s})){p=!1;break}}else if(f!==d&&!o(f,d,r,i,a)){p=!1;break}}return a.delete(e),a.delete(t),p}function nr(e){var t=-1,r=Array(e.size);return e.forEach(function(e,i){r[++t]=[i,e]}),r}function cr(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}var lr=A?A.prototype:void 0,ur=lr?lr.valueOf:void 0;var hr=Object.prototype.hasOwnProperty;var pr="[object Arguments]",_r="[object Array]",fr="[object Object]",dr=Object.prototype.hasOwnProperty;function yr(e,t,r,i,o,a){var s=b(e),n=b(t),c=s?_r:Bt(e),l=n?_r:Bt(t),u=(c=c==pr?fr:c)==fr,h=(l=l==pr?fr:l)==fr,p=c==l;if(p&&Ie(e)){if(!Ie(t))return!1;s=!0,u=!1}if(p&&!u)return a||(a=new yt),s||Ce(e)?sr(e,t,r,i,o,a):function(e,t,r,i,o,a,s){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!a(new Vt(e),new Vt(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ae(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var n=nr;case"[object Set]":var c=1&i;if(n||(n=cr),e.size!=t.size&&!c)return!1;var l=s.get(e);if(l)return l==t;i|=2,s.set(e,t);var u=sr(n(e),n(t),i,o,a,s);return s.delete(e),u;case"[object Symbol]":if(ur)return ur.call(e)==ur.call(t)}return!1}(e,t,c,r,i,o,a);if(!(1&r)){var _=u&&dr.call(e,"__wrapped__"),f=h&&dr.call(t,"__wrapped__");if(_||f){var d=_?e.value():e,y=f?t.value():t;return a||(a=new yt),o(d,y,r,i,a)}}return!!p&&(a||(a=new yt),function(e,t,r,i,o,a){var s=1&r,n=Ot(e),c=n.length;if(c!=Ot(t).length&&!s)return!1;for(var l=c;l--;){var u=n[l];if(!(s?u in t:hr.call(t,u)))return!1}var h=a.get(e),p=a.get(t);if(h&&p)return h==t&&p==e;var _=!0;a.set(e,t),a.set(t,e);for(var f=s;++l<c;){var d=e[u=n[l]],y=t[u];if(i)var A=s?i(y,d,u,t,e,a):i(d,y,u,e,t,a);if(!(void 0===A?d===y||o(d,y,r,i,a):A)){_=!1;break}f||(f="constructor"==u)}if(_&&!f){var E=e.constructor,R=t.constructor;E==R||!("constructor"in e)||!("constructor"in t)||"function"==typeof E&&E instanceof E&&"function"==typeof R&&R instanceof R||(_=!1)}return a.delete(e),a.delete(t),_}(e,t,r,i,o,a))}function Ar(e,t,r,i,o){return e===t||(null==e||null==t||!L(e)&&!L(t)?e!=e&&t!=t:yr(e,t,r,i,Ar,o))}function Er(e){return e==e&&!w(e)}function Rr(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}function gr(e){var t=function(e){for(var t=xe(e),r=t.length;r--;){var i=t[r],o=e[i];t[r]=[i,o,Er(o)]}return t}(e);return 1==t.length&&t[0][2]?Rr(t[0][0],t[0][1]):function(r){return r===e||function(e,t,r,i){var o=r.length,a=o;if(null==e)return!a;for(e=Object(e);o--;){var s=r[o];if(s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++o<a;){var n=(s=r[o])[0],c=e[n],l=s[1];if(s[2]){if(void 0===c&&!(n in e))return!1}else if(!Ar(l,c,3,i,new yt))return!1}return!0}(r,0,t)}}function Ir(e,t){return null!=e&&t in Object(e)}function Tr(e,t){return null!=e&&function(e,t,r){for(var i=-1,o=(t=it(t,e)).length,a=!1;++i<o;){var s=ot(t[i]);if(!(a=null!=e&&r(e,s)))break;e=e[s]}return a||++i!=o?a:!!(o=null==e?0:e.length)&&le(o)&&ie(s,o)&&(b(e)||Ae(e))}(e,t,Ir)}function mr(e,t){return We(e)&&Er(t)?Rr(ot(e),t):function(r){var i=function(e,t,r){var i=null==e?void 0:at(e,t);return void 0===i?r:i}(r,e);return void 0===i&&i===t?Tr(r,e):Ar(t,i,3)}}function Sr(e){return We(e)?(t=ot(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return at(t,e)}}(e);var t}function Lr(e){return"function"==typeof e?e:null==e?U:"object"==typeof e?b(e)?mr(e[0],e[1]):gr(e):Sr(e)}function Or(e,t){return t.length<2?e:at(e,function(e,t,r){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(o);++i<o;)a[i]=e[i+t];return a}(t,0,-1))}var Nr=Object.prototype.hasOwnProperty;function br(e){if(null==e)return!0;if(ue(e)&&(b(e)||"string"==typeof e||"function"==typeof e.splice||Ie(e)||Ce(e)||Ae(e)))return!e.length;var t=Bt(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(pe(e))return!De(e).length;for(var r in e)if(Nr.call(e,r))return!1;return!0}function Cr(e,t){return Ar(e,t)}function vr(e){return null==e}function Mr(e,t){return null==(e=Or(e,t=it(t,e)))||delete e[ot((r=t,i=null==r?0:r.length,i?r[i-1]:void 0))];var r,i}function wr(e){return function(e){if(!L(e)||"[object Object]"!=S(e))return!1;var t=ut(e);if(null===t)return!0;var r=ft.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&_t.call(r)==dt}(e)?void 0:e}var Ur=function(e){return te(function(e,t,r){return t=ce(void 0===t?e.length-1:t,0),function(){for(var i=arguments,o=-1,a=ce(i.length-t,0),s=Array(a);++o<a;)s[o]=i[t+o];o=-1;for(var n=Array(t+1);++o<t;)n[o]=i[o];return n[t]=r(s),function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}(e,this,n)}}(e,void 0,lt),e+"")}(function(e,t){var r={};if(null==e)return r;var i=!1;t=N(t,function(t){return t=it(t,e),i||(i=t.length>1),t}),function(e,t,r){var i=!r;r||(r={});for(var o=-1,a=t.length;++o<a;){var s=t[o],n=void 0;void 0===n&&(n=e[s]),i?oe(r,s,n):ne(r,s,n)}}(e,Nt(e),r),i&&(r=ir(r,7,wr));for(var o=t.length;o--;)Mr(r,t[o]);return r});function Pr(e,t,r,i){if(!w(e))return e;for(var o=-1,a=(t=it(t,e)).length,s=a-1,n=e;null!=n&&++o<a;){var c=ot(t[o]),l=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=s){var u=n[c];void 0===(l=void 0)&&(l=w(u)?u:ie(t[o+1])?[]:{})}ne(n,c,l),n=n[c]}return e}function Dr(e,t){if(null==e)return{};var r=N(Nt(e),function(e){return[e]});return t=Lr(t),function(e,t,r){for(var i=-1,o=t.length,a={};++i<o;){var s=t[i],n=at(e,s);r(n,s)&&Pr(a,it(s,e),n)}return a}(e,r,function(e,r){return t(e,r[0])})}function xr(e,t){return Dr(e,function(e){if("function"!=typeof e)throw new TypeError("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}(Lr(t)))}var Fr=Array.prototype.splice;function Hr(e,t){var r=[];if(!e||!e.length)return r;var i=-1,o=[],a=e.length;for(t=Lr(t);++i<a;){var s=e[i];t(s,i,e)&&(r.push(s),o.push(i))}return function(e,t){for(var r=e?t.length:0,i=r-1;r--;){var o=t[r];if(r==i||o!==a){var a=o;ie(o)?Fr.call(e,o,1):Mr(e,o)}}}(e,o),r}const Gr=e=>new Error(`Trying to ${e} while it is not in the map style. Did you exclude it when loading the map?`),jr=()=>"undefined"!=typeof document&&"undefined"!=typeof DOMParser&&"undefined"!=typeof btoa,Br=e=>{if(!jr())return;const t=document.createElement("img");return t.src=`data:image/svg+xml;base64,${btoa((new XMLSerializer).serializeToString(e))}`,t},Wr=e=>(new DOMParser).parseFromString(e,"image/svg+xml").documentElement,Vr=e=>{const t=Wr('<svg xmlns="http://www.w3.org/2000/svg" width="120" height="140">\n <path id="background" d="M63.95 137.516c6.556-12.737 19.098-21.09 30.828-29.388C110.046 97.324 120 79.603 120 59.574 120 26.671 93.138 0 60 0S0 26.671 0 59.574c0 20.029 9.954 37.75 25.22 48.55 11.734 8.302 24.274 16.652 30.83 29.388 1.706 3.316 6.194 3.316 7.9 0z"\n fill="#1988cf"/>\n <path id="outline" d="M91.298 103.272C105.052 93.544 114 77.596 114 59.574c0-29.61-24.176-53.617-54-53.617S6 29.964 6 59.574c0 18.022 8.95 33.97 22.7 43.698l2.27 1.601c10.172 7.153 21.922 15.423 29.03 27.416 7.104-11.993 18.858-20.259 29.03-27.416l2.268-1.601zm1.468 6.274c-11.13 7.845-22.632 15.957-28.816 27.966-1.706 3.316-6.194 3.316-7.9 0-6.182-12.009-17.686-20.121-28.816-27.966l-2.016-1.422C9.954 97.324 0 79.603 0 59.574 0 26.671 26.862 0 60 0s60 26.671 60 59.574c0 20.029-9.954 37.75-25.222 48.55l-2.016 1.422z"\n fill-opacity=".3"/>\n</svg>\n');return e?.fillColor&&t.querySelector("#background")?.setAttribute("fill",e.fillColor),e?.outlineColor&&t.querySelector("#outline")?.setAttribute("fill",e.outlineColor),void 0!==e?.outlineOpacity&&t.querySelector("#outline")?.setAttribute("fill-opacity",e.outlineOpacity.toString()),t};const kr=e=>(function(e){if(vr(e))throw new Error(`${e} must not be null/undefined. Something went wrong with its initialization.`)}(e),e);class Yr{constructor(e,t,r){this.id=e,this.spec=t,this.runtimeSource=r}ensureAddedToMap(e){this.runtimeSource||(!e.getSource(this.id)&&this.spec&&e.addSource(this.id,this.spec),this.runtimeSource=e.getSource(this.id))}}class zr{constructor(e,t,r){this.map=e,this.source=t,this._layerSpecs=r,this._updateSourceAndLayerIDs()}isAnyLayerVisible(e){return this.getLayerSpecs(e).some(e=>this.isLayerVisible(e))}areAllLayersVisible(e){return this.getLayerSpecs(e).every(e=>this.isLayerVisible(e))}getLayerSpecs(e){return e?this._layerSpecs.filter(e):this._layerSpecs}_updateSourceAndLayerIDs(){this._sourceAndLayerIDs={sourceID:this.source.id,layerIDs:this._layerSpecs.map(e=>e.id)}}isLayerVisible(e){return"none"!==this.map.getLayoutProperty(e.id,"visibility")}setLayersVisible(e,t){for(const r of this.getLayerSpecs(t))this.map.setLayoutProperty(r.id,"visibility",e?"visible":"none",{validate:!1})}get sourceAndLayerIDs(){return this._sourceAndLayerIDs}equalSourceAndLayerIDs(e){return this.sourceAndLayerIDs.sourceID===e.sourceAndLayerIDs.sourceID&&this.sourceAndLayerIDs.layerIDs.length===e.sourceAndLayerIDs.layerIDs.length&&this.sourceAndLayerIDs.layerIDs.every((t,r)=>t===e.sourceAndLayerIDs.layerIDs[r])}}const Kr=(e,t)=>e.getStyle().layers.filter(e=>t.includes(e?.source));class $r extends zr{constructor(e,t,r){let i=Kr(e,[t.id]);r&&(i=i.filter(r)),super(e,new Yr(t.id,e.getStyle().sources[t.id],t),i)}}class Zr extends zr{constructor(e,t,r,i){super(e,new Yr(t,r),i.map(e=>({...e,source:t})))}ensureLayersAddedToMap(){for(const e of this._layerSpecs)this.map.getLayer(e.id)||this.map.addLayer(e,e.beforeID)}ensureAddedToMapWithVisibility(e,t){this.source.ensureAddedToMap(this.map),t&&(this.ensureLayersAddedToMap(),this.setLayersVisible(e))}}const qr={type:"FeatureCollection",features:[]};class Xr extends Zr{constructor(e,t,r,i=!0){super(e,t,{type:"geojson",data:qr,promoteId:"id"},r),this.shownFeatures=qr,this.ensureAddedToMapWithVisibility(!1,i)}show(e){this.shownFeatures=e,kr(this.source.runtimeSource).setData(e),this.setLayersVisible(!!e.features.length)}clear(){this.show(qr)}findFeature(e){return"index"in e?this.shownFeatures.features[e.index]:"id"in e?this.shownFeatures.features.find(t=>t.id===e.id):void 0}putEventState(e){if("put"===(e.mode??"put"))for(const r of this.shownFeatures.features)r.properties?.eventState===e.state&&delete r.properties.eventState;const t=this.findFeature(e);t&&(t.properties={...t.properties,eventState:e.state}),!1!==e.show&&this.show(this.shownFeatures)}cleanEventState(e){const t=this.findFeature(e);t?.properties?.eventState&&(delete t?.properties?.eventState,!1!==e?.show&&this.show(this.shownFeatures))}cleanEventStates(e){let t=!1;for(const r of this.shownFeatures.features)e?.states&&!e.states.includes(r.properties?.eventState)||(delete r.properties?.eventState,t=!0);!1!==e?.show&&t&&this.show(this.shownFeatures)}}const Jr=async e=>{e.mapReady||(await e.mapLibreMap.once("styledata"),await Jr(e))},Qr=e=>{for(const r of e)if(r&&Object.keys(r.properties).length)for(const e in r.properties)if("string"==typeof r.properties[e])try{r.properties[e]=JSON.parse(r.properties[e])}catch(t){}},ei=(e,t,r)=>{const i=e.id;e.maxzoom===t.maxzoom&&e.minzoom===t.minzoom||r.setLayerZoomRange(i,e.minzoom??r.getMinZoom(),e.maxzoom??r.getMaxZoom()),r.setFilter(i,e.filter,{validate:!1});for(const o of Object.keys(t.layout??[]))e.layout?.[o]||r.setLayoutProperty(i,o,void 0,{validate:!1});for(const o of Object.keys(t.paint??[]))e.paint?.[o]||r.setPaintProperty(i,o,void 0,{validate:!1});for(const[o,a]of Object.entries(e.paint??[]))r.setPaintProperty(i,o,a,{validate:!1});for(const[o,a]of Object.entries(e.layout??[]))r.setLayoutProperty(i,o,a,{validate:!1})},ti=(e,t,r)=>{e.forEach((e,i)=>ei(e,t[i],r))},ri=(e,t)=>{const r=/* @__PURE__ */new Set,i=e=>{t.getLayer(e.id)||t.addLayer({...e,layout:{...e.layout,visibility:"none"}},e.beforeID),r.add(e.id)},o={};for(e.forEach(e=>{e.beforeID?r.has(e.beforeID)||t.getLayer(e.beforeID)?(r.add(e.beforeID),i(e)):o[e.beforeID]?o[e.beforeID].push(e):o[e.beforeID]=[e]:i(e)});Object.keys(o).length>0;){const e=Object.keys(o).filter(e=>r.has(e));if(0===e.length)throw Error(`Circular dependency for before Ids ${JSON.stringify(Object.keys(o))}`);e.forEach(e=>{o[e].forEach(e=>i(e)),delete o[e]})}},ii=(e,t)=>{switch(typeof e){case"undefined":return{type:"standard",include:[t]};case"string":return{type:"standard",id:e,include:[t]};default:if("standard"===e.type)return e.include?{...e,include:[...e.include,t]}:{...e,include:[t]};throw(e=>new Error(`Trying to add style module ${e} to the custom style!`))(t)}},oi=async(e,t,r)=>{e.mapLibreMap.getSource(t)||(e.mapLibreMap.isStyleLoaded()||await e.mapLibreMap.once("idle"),e.setStyle(ii(e.getStyle(),r)),await(async(e,t)=>{e.mapLibreMap.getSource(t)&&e.mapLibreMap.isSourceLoaded(t)||await e.mapLibreMap.once("sourcedata")})(e,t),e.mapLibreMap.once("styledata",()=>{for(const r of Kr(e.mapLibreMap,[t]))e.mapLibreMap.setLayoutProperty(r.id,"visibility","none",{validate:!1})}))},ai=async(e,t,r,i,o)=>{if(!r)return void console.warn(`addOrUpdateImage called with empty image for ID ${t}`);const a=e=>{i.hasImage(t)||i.addImage(t,e,o)},s=e=>{e.complete?e.naturalWidth>0?a(e):console.warn(`Failed to load image for ID ${t}`):(e.onload=()=>a(e),e.onerror=()=>console.warn(`Failed to load image for ID ${t}`))};if("string"==typeof r)if(r.includes("<svg")){s(Br(Wr(r)))}else a((await i.loadImage(r)).data);else s(r)},si=e=>{switch(e){case"standardDark":case"drivingDark":case"monoDark":case"satellite":return"dark";default:return"light"}},ni=e=>{if("string"==typeof e)return si(e);const t=e;return t?.id?si(t.id):"light"};class ci{constructor(e,t,r){this._initializing=!0,this.moduleReady=!1,this.sourceType=e,this.tomtomMap=t,this.eventsProxy=t._eventsProxy,this.mapLibreMap=t.mapLibreMap,this.initSourcesWithLayers(r),this.applyConfig(r),this.tomtomMap.addStyleChangeHandler({onStyleAboutToChange:()=>{this.moduleReady=!1},onStyleChanged:()=>this.restoreDataAndConfig()}),this._initializing=!1}initSourcesWithLayers(e,t){this.moduleReady=!1,this.sourcesWithLayers=this._initSourcesWithLayers(e,t),this._sourceAndLayerIDs=Object.fromEntries(Object.entries(this.sourcesWithLayers).map(([e,t])=>[e,t.sourceAndLayerIDs])),t&&this.eventsProxy.updateIfRegistered(this.sourcesWithLayers),this.tomtomMap.mapReady&&(this.moduleReady=!0)}async waitUntilModuleReady(){await Jr(this.tomtomMap),this.moduleReady||await new Promise(e=>{const t=setInterval(()=>{this.tomtomMap.mapReady&&this.moduleReady&&(clearInterval(t),e())},200)})}applyConfig(e){this.config=this._applyConfig(e)}resetConfig(){this.applyConfig(void 0)}async restoreDataAndConfig(){this.moduleReady=!1,"geojson"===this.sourceType?setTimeout(()=>this.restoreDataAndConfigImpl(),400):this.restoreDataAndConfigImpl()}restoreDataAndConfigImpl(){this.initSourcesWithLayers(this.config,!0),this._applyConfig(this.config)}getConfig(){return this.config&&{...this.config}}get sourceAndLayerIDs(){return this._sourceAndLayerIDs}}class li{constructor(e,t){this.eventProxy=e,this.sourceWithLayers=t}on(e,t){this.eventProxy.addEventHandler(this.sourceWithLayers,t,e)}off(e){this.eventProxy.remove(this.sourceWithLayers,e)}}class ui{constructor(){this.interactiveLayerIDs=[],this.handlers={},this.findHandlers=(e,t,r)=>t&&r&&e.flatMap(e=>{const i=this.handlers[t]?.[e];return 1===i?.length?i:this.handlers[t]?.[e]?.filter(e=>e.layerIDs.includes(r))||[]})||[]}ensureInteractiveLayerIDsAdded(e){e._layerSpecs.forEach(e=>{this.interactiveLayerIDs.includes(e.id)||this.interactiveLayerIDs.push(e.id)})}addEventHandler(e,t,r){this.ensureInteractiveLayerIDsAdded(e);const i=e.source.id;this.handlers[i]||(this.handlers[i]={[r]:[]}),this.handlers[i][r]??=[],this.handlers[i][r]?.push({sourceWithLayers:e,layerIDs:e._layerSpecs.map(e=>e.id),fn:t})}remove(e,t){const r=this.handlers[e.source.id]?.[t];r&&(Hr(r,t=>{return r=e._layerSpecs,t.layerIDs.every((e,t)=>e===r[t].id);var r}),r.length||(delete this.handlers[e.source.id]?.[t],br(this.handlers[e.source.id])&&delete this.handlers[e.source.id]));for(const i of e._layerSpecs)Hr(this.interactiveLayerIDs,e=>i.id===e)}removeAll(){this.interactiveLayerIDs=[],this.handlers={}}hasSourceID(e){return!!this.handlers[e]}updateIfRegistered(e){for(const t of Object.values(e)){const e=this.handlers[t.source.id];if(e)for(const r of Object.values(e))for(const e of r)t.equalSourceAndLayerIDs(e.sourceWithLayers)&&(e.sourceWithLayers=t)}}}const hi=e=>"click"===e||"contextmenu"===e,pi=(e,t,r,i="updateInProps")=>{const{feature:o,index:a}=((e,t)=>{for(let r=0;r<e.length;r++){const i=e[r];if(i.id===t)return{feature:i,index:r}}})(r,t)||{};if(o&&(!hi(o.properties?.eventState)||hi(e))){const t={...o,properties:"updateInProps"===i?{...o?.properties,eventState:e}:Ur(o?.properties,"eventState")};return r.splice(a,1,t),a}},_i=(e,t,r)=>{const i=[...r.shownFeatures.features];vr(pi(e,t.id,i,"removeFromProps"))||r.show({...r.shownFeatures,features:i})},fi=(e,t,r,i,o)=>{if(t&&i instanceof Xr){const n=[...i.shownFeatures.features],c=pi(e,t.id,n);return!r||(s=t,(a=r)&&s&&a.id===s.id)||(o===i?pi(e,r.id,n,"removeFromProps"):o instanceof Xr&&_i(e,r,o)),i.show({...i.shownFeatures,features:n}),{feature:n[c],index:c}}var a,s;return r&&o instanceof Xr&&_i(e,r,o),{feature:t}},di={precisionMode:"box",paddingBoxPx:5,cursorOnHover:"pointer",cursorOnMouseDown:"grabbing",cursorOnMap:"default",longHoverDelayAfterMapMoveMS:800,longHoverDelayOnStillMapMS:300};class yi extends ui{constructor(e,t={}){super(),this.enabled=!0,this.firstDelayedHoverSinceMapMove=!0,this.map=e,this.mapCanvas=e.getCanvas(),this.config={...di,...t},this.mapCanvas.style.cursor=this.config.cursorOnMap,this.lastCursorStyle=this.config.cursorOnMap,this.defaultZoomLevel=Math.round(this.map.getZoom()),this.listenToEvents()}listenToEvents(){this.map.on("mousemove",e=>this.onMouseMove(e)),this.map.on("movestart",()=>this.onMouseStart()),this.map.on("mouseout",()=>this.onMouseOut()),this.map.on("mouseover",e=>this.onMouseMove(e)),this.map.on("mousedown",()=>this.onMouseDown()),this.map.on("mouseup",()=>this.onMouseUp()),this.map.on("click",e=>this.onMapClick("click",e)),this.map.on("contextmenu",e=>this.onMapClick("contextmenu",e))}enable(e){this.enabled=e,e||this.clearLongHoverTimeout()}toPaddedBounds(e){const t=this.config.paddingBoxPx;return[[e.x-t,e.y+t],[e.x+t,e.y-t]]}isEnabled(){return this.enabled&&!this.map.isMoving()}getRenderedFeatures(e){if(!this.interactiveLayerIDs.length)return[];const t={layers:this.interactiveLayerIDs,validate:!1},r=this.config.precisionMode,i="point-then-box"===r||"point"===r?this.map.queryRenderedFeatures(e,t):[];return i.length||"point"===r?i:this.map.queryRenderedFeatures(this.toPaddedBounds(e),t)}clearLongHoverTimeout(){window.clearTimeout(this.longHoverTimeoutHandlerID)}restartLongHoverTimeout(){this.clearLongHoverTimeout(),this.longHoverTimeoutHandlerID=window.setTimeout(()=>this.handleLongHoverTimeout(),this.firstDelayedHoverSinceMapMove?this.config.longHoverDelayAfterMapMoveMS:this.config.longHoverDelayOnStillMapMS)}handleLongHoverTimeout(){if(this.firstDelayedHoverSinceMapMove=!1,this.hoveringSourceWithLayers){const e=fi("long-hover",this.hoveringFeature,void 0,this.hoveringSourceWithLayers,void 0);this.findHandlers(["long-hover"],this.hoveringFeature?.source,this.hoveringFeature?.layer.id).forEach(t=>t.fn(e.feature,this.hoveringLngLat,this.hoveringFeatures,this.hoveringSourceWithLayers))}}onMouseStart(){this.firstDelayedHoverSinceMapMove=!0,this.clearLongHoverTimeout()}onMouseOut(){this.clearLongHoverTimeout()}onMouseDown(){this.lastCursorStyle=this.mapCanvas.style.cursor,this.mapCanvas.style.cursor=this.config.cursorOnMouseDown}onMouseUp(){this.mapCanvas.style.cursor=this.lastCursorStyle}onMouseMove(e){if(!this.isEnabled())return;this.hoveringFeatures=this.getRenderedFeatures(e.point),Qr(this.hoveringFeatures);const[t]=this.hoveringFeatures;if(t&&!this.hasSourceID(t.source))return;const{hoverChanged:r,mouseInMotionOverHoveredFeature:i}=((e,t,r,i)=>{if(t){if(!i)return{hoverChanged:!0};if(t.id&&t.id!==i.id||t.properties.id&&t.properties.id!==i.properties.id||t.source!==i.source||t.layer.id!==i.layer.id)return{hoverChanged:!0};if(r&&(e.x-r.x!=0||e.y-r.y!=0))return{mouseInMotionOverHoveredFeature:!0}}else if(i)return{hoverChanged:!0};return{}})(e.point,t,this.hoveringPoint,this.hoveringFeature);if(r||i){this.hoveringLngLat=e.lngLat,this.hoveringPoint=e.point;const i=this.hoveringFeature;this.hoveringFeature=t;const o=this.hoveringSourceWithLayers,a=this.findHandlers(["hover","long-hover","click","contextmenu"],t?.source,t?.layer.id);if(this.hoveringSourceWithLayers=a?.[0]?.sourceWithLayers,r){this.updateCursor(i);const r=fi("hover",this.hoveringFeature,i,this.hoveringSourceWithLayers,o),a=this.findHandlers(["hover"],t?.source,t?.layer.id);for(const t of a)t.fn(r.feature,e.lngLat,this.hoveringFeatures,this.hoveringSourceWithLayers)}this.restartLongHoverTimeout()}}updateCursor(e){!e&&this.hoveringFeature?this.mapCanvas.style.cursor=this.config.cursorOnHover:e&&!this.hoveringFeature&&(this.mapCanvas.style.cursor=this.config.cursorOnMap)}onMapClick(e,t){if(!this.isEnabled())return;const r=this.getRenderedFeatures(t.point);Qr(r);const i=this.lastClickedFeature;this.lastClickedFeature=r[0];const o=this.lastClickedSourceWithLayers,a=this.findHandlers([e],this.lastClickedFeature?.source,this.lastClickedFeature?.layer.id);this.lastClickedSourceWithLayers=a?.[0]?.sourceWithLayers,console.log(this.lastClickedSourceWithLayers);const s=fi(e,this.lastClickedFeature,i,this.lastClickedSourceWithLayers,o);console.log(s);for(const n of a)n.fn(s.feature,t.lngLat,r,this.lastClickedSourceWithLayers)}}const Ai={country:"Places - Country name",lowestPlaceLabel:"Places - Village / Hamlet",poi:"POI",lowestLabel:"Borders - Treaty label",lowestRoadLine:"Tunnel - Railway outline",lowestBuilding:"Buildings - Underground"},Ei="vectorTiles",Ri="hillshade",gi="vectorTiles",Ii="vectorTilesIncidents",Ti="vectorTilesFlow",mi=["POI","POI - Micro"],Si={ACCESS_GATEWAY:"access_gateway",ADVENTURE_SPORTS_FACILITY:"adventure_sports_facility",ADVENTURE_SPORTS_VENUE:"adventure_sports_venue",AGRICULTURE:"agriculture_business",AIRPORT:"airport",AMUSEMENT_PARK:"amusement_park",AQUATIC_ZOO:"zoo_or_aquarium",ASHRAM:"religious_site",ATM:"atm",AUTOMOTIVE_DEALER:"automotive_dealer",BANK:"bank",BEACH:"beach",BUS_STOP:"bus_station",BUSINESS_PARK:"business_park",CAFE_PUB:"cafe",CAMPING_GROUND:"camping_ground",CAR_WASH:"car_wash",CASH_DISPENSER:"atm",CASINO:"casino",CHURCH:"religious_site",CINEMA:"cinema",CLOTHING_SHOP:"clothing_shop",CLUB_ASSOCIATION:"club_and_association",COLLEGE_UNIVERSITY:"college_or_university",COMMERCIAL_BUILDING:"commercial_building",COMMUNITY_CENTER:"community_center",COMPANY:"company_or_office",CONCERT_HALL:"nightlife",COURTHOUSE:"courthouse",CULTURAL_CENTER:"cultural_center",DENTIST:"dentist",DEPARTMENT_STORE:"department_store",DOCTOR:"doctor",ELECTRIC_VEHICLE_STATION:"charging_location",EMBASSY:"institution_office",EMERGENCY_MEDICAL_SERVICE:"emergency_medical_service",EMERGENCY_ROOM:"emergency_room",ENTERTAINMENT:"entertainment",EXCHANGE:"stock_exchange",EXHIBITION_CONVENTION_CENTER:"cultural_center",FERRY_TERMINAL:"ferry_terminal",FIRE_STATION_BRIGADE:"fire_station",FRONTIER_CROSSING:"frontier_crossing",FUEL_FACILITIES:"fuel_station",GAS_STATION:"fuel_station",GEOGRAPHIC_FEATURE:"geographic_feature",GOLD_EXCHANGE:"gold_exchange",GOLF_COURSE:"golf_course",GOVERNMENT_OFFICE:"institution_office",GURUDWARA:"religious_site",HEALTH_CARE_SERVICE:"healthcare_service",HELIPAD_HELICOPTER_LANDING:"heliport_or_helipad",HILL:"elevation_point",HOLIDAY_RENTAL:"holiday_home",HOSPITAL:"hospital",HOSPITAL_POLYCLINIC:"hospital",HOTEL_MOTEL:"hotel_or_motel",ICE_SKATING_RINK:"ice_skating_rink",IMPORTANT_TOURIST_ATTRACTION:"tourist_attraction",INDUSTRIAL_BUILDING:"industrial_building",LEISURE_CENTER:"leisure_center",LIBRARY:"library",MANUFACTURING_FACILITY:"manufacturing_facility",MARINA:"marina",MARKET:"marketplace",MEDIA_FACILITY:"media_facility",MILITARY_INSTALLATION:"military_facility",MOSQUE:"religious_site",MOTORING_ORGANIZATION_OFFICE:"motoring_organization_office",MOUNTAIN_PASS:"mountain_pass",MOUNTAIN_PEAK:"elevation_point",MOVIE_THEATER:"cinema",MUSEUM:"museum",NATIVE_RESERVATION:"native_reservation",NIGHTLIFE:"nightlife",NON_GOVERNMENTAL_ORGANIZATION:"non_governmental_organization",OPEN_PARKING_AREA:"parking_facility",OPERA_HOUSE:"theater",PAGODA:"religious_site",PARK_RECREATION_AREA:"park_and_recreation_area",PARKING_GARAGE:"parking_facility",PETROL_STATION:"fuel_station",PHARMACY:"pharmacy",PLACE_OF_WORSHIP:"place_of_worship",POLICE_STATION:"police_station",PORT_WAREHOUSE_FACILITY:"port_or_warehouse_facility",POST_OFFICE:"post_office",PRIMARY_RESOURCE_UTILITY:"primary_resource_or_utility",PRISON_CORRECTIONAL_FACILITY:"prison",PUBLIC_AMENITY:"public_amenity",PUBLIC_TRANSPORT_STOP:"public_transport_stop",RAILWAY_STATION:"railway_station",RENT_A_CAR_FACILITY:"car_rental",RENT_A_CAR_PARKING:"rent_a_car_parking",REPAIR_FACILITY:"repair_facility",RESEARCH_FACILITY:"research_facility",RESIDENTIAL_ACCOMMODATION:"urban_ground",REST_AREA:"rest_area",RESTAURANT:"restaurant",RESTAURANT_AREA:"restaurant_area",SCENIC_PANORAMIC_VIEW:"viewpoint",SCHOOL:"school",SHOP:"shop_or_store",SHOPPING_CENTER:"shop_or_store",SPORTS_CENTER:"sport_facility",STADIUM:"stadium",SUPERMARKETS_HYPERMARKETS:"supermarket",SWIMMING_POOL:"swimming_pool",SYNAGOG:"religious_site",TAXI_STAND:"taxi_stand",TEMPLE:"religious_site",TENNIS_COURT:"tennis_court",THEATER:"theater",TOLL_GATE:"toll_gate",TOURIST_INFORMATION_OFFICE:"tourist_information_office",TRAFFIC_CONTROL_DEPARTMENT:"traffic_control_department",TRAFFIC_SERVICE_CENTER:"traffic_service_center",TRAIL_SYSTEM:"trail_system",TRAILS:"trails",TRANSPORT_AUTHORITY_VEHICLE_REGISTRATION:"transport_authority_or_vehicle_registration",TRUCK_STOP:"truck_stop",VACATION_RENTAL:"vacation_rental",VETERINARIAN:"veterinarian",WATER_SPORT:"water_sport",WEIGH_STATION:"weigh_station",WELFARE_ORGANIZATION:"welfare_organization",WINERY:"manufacturing_facility",ZOOS_ARBORETA_BOTANICAL_GARDEN:"zoo_or_aquarium"},Li={...Si,SECURED_ENTRANCE:"access_gateway",AGRICULTURAL_BUSINESS:"agriculture_business",FARM:"agriculture_business",HORTICULTURE:"agriculture_business",PRIMARY_PRODUCER:"agriculture_business",AIRFIELD:"airport",AIRLINE_ACCESS:"airport",MILITARY_AIRPORT:"airport",PRIVATE_AIRPORT:"airport",PUBLIC_AIRPORT:"airport",ATV_DEALER:"automotive_dealer",BOAT_DEALER:"automotive_dealer",BUS_DEALER:"automotive_dealer",CAR_DEALER:"automotive_dealer",MOTORCYCLE_DEALER:"automotive_dealer",RECREATIONAL_VEHICLE_DEALER:"automotive_dealer",TRUCK_DEALER:"automotive_dealer",VAN_DEALER:"automotive_dealer",DIVERSIFIED_FINANCIALS:"bank",SAVINGS_INSTITUTION:"bank",BEACH_CLUB:"beach",BAR:"cafe",CAFE:"cafe",COCKTAIL_BAR:"cafe",COFFEE_SHOP:"cafe",INTERNET_CAFE:"cafe",PUB:"cafe",TEA_HOUSE:"cafe",WINE_BAR:"cafe",CARAVAN_SITE:"camping_ground",RECREATIONAL_CAMPING_GROUND:"camping_ground",REST_CAMP:"camping_ground",TRUCK_WASH:"car_wash",DRIVE_IN_MOVIES:"cinema",CHILDRENS_CLOTHES:"clothing_shop",MENS_CLOTHING:"clothing_shop",SPECIALTY_CLOTHING_SHOP:"clothing_shop",WOMENS_CLOTHING:"clothing_shop",PRIVATE_CLUB:"club_and_association",JUNIOR_COLLEGE_COMMUNITY_COLLEGE:"college_or_university",BUILDING:"commercial_building",ADVERTISING_COMPANY:"company_or_office",AGRICULTURAL_TECHNOLOGY:"company_or_office",AIRLINE_COMPANY:"company_or_office",AUTOMOBILE_COMPANY:"company_or_office",BUSINESS_SERVICES:"company_or_office",BUS_CHARTER_COMPANY:"company_or_office",CABLE_TELEPHONE_COMPANY:"company_or_office",CLEANING_SERVICES:"company_or_office",COMPUTER_DATA_SERVICES:"company_or_office",CONSTRUCTION_COMPANY:"company_or_office",DELIVERY_SERVICE:"company_or_office",ELECTRONICS_COMPANY:"company_or_office",EQUIPMENT_RENTAL:"company_or_office",FUNERAL_SERVICE_MORTUARIES:"company_or_office",IMPORT_EXPORT_AND_DISTRIBUTION:"company_or_office",INSURANCE_COMPANY:"company_or_office",INVESTMENT_ADVISOR:"company_or_office",LEGAL_SERVICES:"company_or_office",MINING_COMPANY:"company_or_office",MOVING_STORAGE_COMPANY:"company_or_office",OIL_NATURAL_GAS:"company_or_office",PHARMACEUTICAL_COMPANY:"company_or_office",PUBLIC_HEALTH_TECHNOLOGY_COMPANY:"company_or_office",PUBLISHING_TECHNOLOGIES:"company_or_office",REAL_ESTATE_AGENT:"company_or_office",REAL_ESTATE_COMPANY:"company_or_office",SERVICE_COMPANY:"company_or_office",SOFTWARE_COMPANY:"company_or_office",TAX_SERVICES:"company_or_office",TELECOMMUNICATIONS:"company_or_office",TRANSPORT_COMPANY:"company_or_office",TRAVEL_AGENT:"company_or_office",WEDDING_SERVICES:"company_or_office",GENERAL_PRACTITIONER:"doctor",SPECIALIST:"doctor",RIDGE:"elevation_point",AMBULANCE_UNIT:"emergency_medical_service",ROAD_RESCUE:"emergency_medical_service",AMUSEMENT_ARCADE:"entertainment",AMUSEMENT_PLACE:"entertainment",BETTING_STATION:"entertainment",FAIRGROUND:"entertainment",MUSIC_CENTER:"entertainment",CHECKPOINT:"frontier_crossing",BAY:"geographic_feature",BRIDGE:"geographic_feature",BRIDGE_TUNNEL_OPERATIONS:"geographic_feature",CAPE:"geographic_feature",COVE:"geographic_feature",DAM:"geographic_feature",DUNE:"geographic_feature",ISLAND:"geographic_feature",LAGOON:"geographic_feature",LAKESHORE:"geographic_feature",LOCALE:"geographic_feature",MARSH:"geographic_feature",OASIS:"geographic_feature",PAN:"geographic_feature",PARKWAY:"geographic_feature",PLAIN_FLAT:"geographic_feature",PLATEAU:"geographic_feature",RAPIDS:"geographic_feature",REEF:"geographic_feature",RESERVOIR:"geographic_feature",RIVER_CROSSING:"geographic_feature",RIVER_SCENIC_AREA:"geographic_feature",ROCKS:"geographic_feature",SEASHORE:"geographic_feature",TUNNEL:"geographic_feature",VALLEY:"geographic_feature",WATER_HOLE:"geographic_feature",WELL:"geographic_feature",BUNGALOW_RENTAL:"holiday_home",CABINS_LODGES:"holiday_home",CHALET_RENTAL:"holiday_home",COTTAGE_RENTAL:"holiday_home",VILLA_RENTAL:"holiday_home",BLOOD_BANK:"hospital",HOSPITAL_FOR_WOMEN_AND_CHILDREN:"hospital",HOSPITAL_OF_CHINESE_MEDICINE:"hospital",SPECIAL_HOSPITAL:"hospital",B_B_GUEST_HOUSE:"hotel_or_motel",HOSTEL:"hotel_or_motel",HOTEL:"hotel_or_motel",MOTEL:"hotel_or_motel",RESORT:"hotel_or_motel",QUARRY:"industrial_building",AUTOMOBILE_MANUFACTURING:"manufacturing_facility",CHEMICAL_COMPANY:"manufacturing_facility",MANUFACTURING_COMPANY:"manufacturing_facility",MECHANICAL_ENGINEERING:"manufacturing_facility",MICROBREWERY:"manufacturing_facility",OEM:"manufacturing_facility",BOAT_LAUNCHING_RAMP:"marina",HARBOR:"marina",YACHT_BASIN:"marina",FARMERS_MARKET:"marketplace",FOOD_MARKET:"marketplace",INFORMAL_MARKET:"marketplace",PUBLIC_MARKET:"marketplace",PLANETARIUM:"museum",CABARET_THEATER:"nightlife",COMEDY_CLUB:"nightlife",DISCO_CLUB:"nightlife",JAZZ_CLUB:"nightlife",KARAOKE_CLUB:"nightlife",FISHING_HUNTING_AREA:"park_and_recreation_area",FOREST_AREA:"park_and_recreation_area",HISTORICAL_PARK:"park_and_recreation_area",NATURAL_RECREATION_ATTRACTION:"park_and_recreation_area",PARK:"park_and_recreation_area",PICNIC_AREA:"park_and_recreation_area",PRESERVE:"park_and_recreation_area",RECREATION_AREA:"park_and_recreation_area",WILDERNESS_AREA:"park_and_recreation_area",OPEN_CAR_PARKING_AREA:"parking_facility",DRUG_STORE:"pharmacy",MARIJUANA_DISPENSARY:"pharmacy",MEDICINAL_MARIJUANA_DISPENSARY:"pharmacy",RECREATIONAL_MARIJUANA_DISPENSARY:"pharmacy",COURIER_DROP_BOX:"post_office",LOCAL_POST_OFFICE:"post_office",PUBLIC_CALL_BOX:"public_amenity",PUBLIC_TOILET:"public_amenity",BUS_LINES:"public_transport_stop",COACH_STOP:"public_transport_stop",PASSENGER_TRANSPORT_TICKET_OFFICE:"public_transport_stop",PEDESTRIAN_SUBWAY:"public_transport_stop",STREETCAR_STOP:"public_transport_stop",SUBWAY_STATION:"public_transport_stop",INTERNATIONAL_RAILROAD_STATION:"railway_station",NATIONAL_RAILROAD_STATION:"railway_station",RAILROAD_SIDING:"railway_station",STATION_ACCESS:"railway_station",URBAN_STATION:"railway_station",BODYSHOP:"repair_facility",CAR_GLASS_REPLACEMENT_SHOP:"repair_facility",CAR_REPAIR_AND_SERVICE:"repair_facility",HOME_APPLIANCE_REPAIR:"repair_facility",MOTORCYCLE_REPAIR:"repair_facility",OTHER_REPAIR_SHOPS:"repair_facility",REPAIR_SHOP:"repair_facility",TIRE_SERVICE:"repair_facility",TRUCK_REPAIR_AND_SERVICE:"repair_facility",AFGHAN_RESTAURANT:"restaurant",AFRICAN_RESTAURANT:"restaurant",ALGERIAN_RESTAURANT:"restaurant",AMERICAN_RESTAURANT:"restaurant",ARABIAN_RESTAURANT:"restaurant",ARGENTINIAN_RESTAURANT:"restaurant",ARMENIAN_RESTAURANT:"restaurant",ASIAN_RESTAURANT:"restaurant",AUSTRALIAN_RESTAURANT:"restaurant",AUSTRIAN_RESTAURANT:"restaurant",BANQUET_ROOMS:"restaurant",BARBECUE_RESTAURANT:"restaurant",BASQUE_RESTAURANT:"restaurant",BELGIAN_RESTAURANT:"restaurant",BISTRO:"restaurant",BOLIVIAN_RESTAURANT:"restaurant",BOSNIAN_RESTAURANT:"restaurant",BRAZILIAN_RESTAURANT:"restaurant",BRITISH_RESTAURANT:"restaurant",BUFFET_RESTAURANT:"restaurant",BULGARIAN_RESTAURANT:"restaurant",BURMESE_RESTAURANT:"restaurant",CAFETERIA:"restaurant",CALIFORNIAN_RESTAURANT:"restaurant",CAMBODIAN_RESTAURANT:"restaurant",CANADIAN_RESTAURANT:"restaurant",CARIBBEAN_RESTAURANT:"restaurant",CATERING_SERVICES:"restaurant",CHICKEN_RESTAURANT:"restaurant",CHILEAN_RESTAURANT:"restaurant",CHINESE_RESTAURANT:"restaurant",COLOMBIAN_RESTAURANT:"restaurant",CORSICAN_RESTAURANT:"restaurant",CREOLE_RESTAURANT:"restaurant",CREPERIE:"restaurant",CUBAN_RESTAURANT:"restaurant",CYPRIOT_RESTAURANT:"restaurant",CZECH_RESTAURANT:"restaurant",DANISH_RESTAURANT:"restaurant",DINNER_THEATER:"restaurant",DOMINICAN_RESTAURANT:"restaurant",DONGBEI_RESTAURANT:"restaurant",DOUGHNUT_RESTAURANT:"restaurant",DUTCH_RESTAURANT:"restaurant",EGYPTIAN_RESTAURANT:"restaurant",ENGLISH_RESTAURANT:"restaurant",EROTIC_RESTAURANT:"restaurant",ETHIOPIAN_RESTAURANT:"restaurant",EXOTIC_RESTAURANT:"restaurant",FAST_FOOD:"restaurant",FINNISH_RESTAURANT:"restaurant",FONDUE_RESTAURANT:"restaurant",FRENCH_RESTAURANT:"restaurant",FUSION_RESTAURANT:"restaurant",GERMAN_RESTAURANT:"restaurant",GREEK_RESTAURANT:"restaurant",GRILL_RESTAURANT:"restaurant",GUANGDONG_RESTAURANT:"restaurant",HAMBURGER_RESTAURANT:"restaurant",HAWAIIAN_RESTAURANT:"restaurant",HOT_POT_RESTAURANT:"restaurant",HUNAN_RESTAURANT:"restaurant",HUNGARIAN_RESTAURANT:"restaurant",ICE_CREAM_PARLOR:"restaurant",INDIAN_RESTAURANT:"restaurant",INDONESIAN_RESTAURANT:"restaurant",INTERNATIONAL_RESTAURANT:"restaurant",IRANIAN_RESTAURANT:"restaurant",IRISH_RESTAURANT:"restaurant",ISRAELI_RESTAURANT:"restaurant",ITALIAN_RESTAURANT:"restaurant",JAMAICAN_RESTAURANT:"restaurant",JAPANESE_RESTAURANT:"restaurant",JEWISH_RESTAURANT:"restaurant",KOREAN_RESTAURANT:"restaurant",KOSHER_RESTAURANT:"restaurant",LATIN_AMERICAN_RESTAURANT:"restaurant",LEBANESE_RESTAURANT:"restaurant",LUXEMBOURGIAN_RESTAURANT:"restaurant",MACROBIOTIC_RESTAURANT:"restaurant",MAGHRIB_RESTAURANT:"restaurant",MALTESE_RESTAURANT:"restaurant",MAURITIAN_RESTAURANT:"restaurant",MEDITERRANEAN_RESTAURANT:"restaurant",MEXICAN_RESTAURANT:"restaurant",MIDDLE_EASTERN_RESTAURANT:"restaurant",MONGOLIAN_RESTAURANT:"restaurant",MOROCCAN_RESTAURANT:"restaurant",MUSSELS_RESTAURANT:"restaurant",NEPALESE_RESTAURANT:"restaurant",NORWEGIAN_RESTAURANT:"restaurant",ORGANIC_FOOD_RESTAURANT:"restaurant",ORIENTAL_RESTAURANT:"restaurant",PAKISTANI_RESTAURANT:"restaurant",PERUVIAN_RESTAURANT:"restaurant",PHILIPPINE_RESTAURANT:"restaurant",PIZZERIA:"restaurant",POLISH_RESTAURANT:"restaurant",POLYNESIAN_RESTAURANT:"restaurant",PORTUGUESE_RESTAURANT:"restaurant",PROVENCAL_RESTAURANT:"restaurant",PUB_FOOD:"restaurant",ROADSIDE_RESTAURANT:"restaurant",ROMANIAN_RESTAURANT:"restaurant",RUSSIAN_RESTAURANT:"restaurant",SALAD_BAR:"restaurant",SANDWICH_RESTAURANT:"restaurant",SAVOY_RESTAURANT:"restaurant",SCANDINAVIAN_RESTAURANT:"restaurant",SCOTTISH_RESTAURANT:"restaurant",SEAFOOD:"restaurant",SHANDONG_RESTAURANT:"restaurant",SHANGHAI_RESTAURANT:"restaurant",SICHUAN_RESTAURANT:"restaurant",SICILIAN_RESTAURANT:"restaurant",SLAVIC_RESTAURANT:"restaurant",SLOVAK_RESTAURANT:"restaurant",SNACKS_RESTAURANT:"restaurant",SOUL_FOOD:"restaurant",SOUP_RESTAURANT:"restaurant",SPANISH_RESTAURANT:"restaurant",STEAK_HOUSE:"restaurant",SUDANESE_RESTAURANT:"restaurant",SURINAMESE_RESTAURANT:"restaurant",SUSHI_RESTAURANT:"restaurant",SWEDISH_RESTAURANT:"restaurant",SWISS_RESTAURANT:"restaurant",SYRIAN_RESTAURANT:"restaurant",TAIWANESE_RESTAURANT:"restaurant",TAKEOUT_FOOD:"restaurant",TAPAS_RESTAURANT:"restaurant",TEPPANYAKI_RESTAURANT:"restaurant",THAI_RESTAURANT:"restaurant",TIBETAN_RESTAURANT:"restaurant",TUNISIAN_RESTAURANT:"restaurant",TURKISH_RESTAURANT:"restaurant",URUGUAYAN_RESTAURANT:"restaurant",VEGETARIAN_RESTAURANT:"restaurant",VENEZUELAN_RESTAURANT:"restaurant",VIETNAMESE_RESTAURANT:"restaurant",WELSH_RESTAURANT:"restaurant",WESTERN_RESTAURANT:"restaurant",YOGURT_JUICE_BAR:"restaurant",ART_SCHOOL:"school",CHILD_CARE_FACILITY:"school",CULINARY_SCHOOL:"school",DANCE_STUDIO_SCHOOL:"school",DRIVING_SCHOOL:"school",HIGH_SCHOOL:"school",LANGUAGE_SCHOOL:"school",MIDDLE_SCHOOL:"school",PRE_SCHOOL:"school",PRIMARY_SCHOOL:"school",SENIOR_HIGH_SCHOOL:"school",SPECIAL_SCHOOL:"school",SPORT_SCHOOL:"school",TECHNICAL_SCHOOL:"school",VOCATIONAL_SCHOOL:"school",AGRICULTURAL_SUPPLIES:"shop_or_store",ANTIQUE_ART_SHOP:"shop_or_store",BAGS_LEATHERWEAR:"shop_or_store",BAKERY:"shop_or_store",BEAUTY_SALON:"shop_or_store",BEAUTY_SUPPLIES:"shop_or_store",BOATING_EQUIPMENT_ACCESSORIES:"shop_or_store",BOOK_SHOP:"shop_or_store",BUTCHER:"shop_or_store",CAMERAS_PHOTOGRAPHY:"shop_or_store",CARPET_FLOOR_COVERINGS:"shop_or_store",CAR_ACCESSORIES:"shop_or_store",CHRISTMAS_HOLIDAY_SHOP:"shop_or_store",COMPUTER_COMPUTER_SUPPLIES:"shop_or_store",CONSTRUCTION_MATERIAL_EQUIPMENT:"shop_or_store",CONSUMER_ELECTRONICS:"shop_or_store",CONVENIENCE_STORE:"shop_or_store",CURTAINS_TEXTILES:"shop_or_store",C_DS_DVD_VIDEOS:"shop_or_store",DELICATESSEN:"shop_or_store",DO_IT_YOURSELF_CENTERS:"shop_or_store",DRIVE_THROUGH_BOTTLE_SHOP:"shop_or_store",DRY_CLEANER:"shop_or_store",ELECTRICAL_APPLIANCES_SHOP:"shop_or_store",FACTORY_OUTLET:"shop_or_store",FISHMONGER:"shop_or_store",FLORISTS:"shop_or_store",FOOTWEAR_SHOE_REPAIRS:"shop_or_store",FURNITURE_HOME_FURNISHINGS:"shop_or_store",GARDEN_CENTERS_SERVICES:"shop_or_store",GIFTS_CARDS_NOVELTIES_SOUVENIRS:"shop_or_store",GLASSWARE_CERAMIC_SHOP:"shop_or_store",GLASS_WINDOWS_STORE:"shop_or_store",GREENGROCER:"shop_or_store",GROCERY_STORE:"shop_or_store",HAIRDRESSER:"shop_or_store",HARDWARE_STORE:"shop_or_store",HOBBY_SHOP:"shop_or_store",HOUSE_GARDEN_FURNITURE_FITTINGS:"shop_or_store",JEWELRY_CLOCKS_WATCHES:"shop_or_store",KITCHENS_BATHROOMS:"shop_or_store",LAUNDRY:"shop_or_store",LIGHTING_SHOPS:"shop_or_store",LOCAL_SPECIALITIES_SHOP:"shop_or_store",LOTTERY_SHOP:"shop_or_store",MARINE_ELECTRONIC_EQUIPMENT:"shop_or_store",MEDICAL_SUPPLIES_EQUIPMENT:"shop_or_store",MOBILE_PHONE_SHOP:"shop_or_store",MUSIC_INSTRUMENTS_STORE:"shop_or_store",NAIL_SALON:"shop_or_store",NEWSAGENTS_TOBACCONISTS:"shop_or_store",OFFICE_EQUIPMENT:"shop_or_store",OPTICIAN:"shop_or_store",OTHER_FOOD_SHOPS:"shop_or_store",PAINTING_DECORATING:"shop_or_store",PAWN_SHOP:"shop_or_store",PERSONAL_CARE_FACILITY:"shop_or_store",PERSONAL_SERVICE:"shop_or_store",PET_SUPPLIES:"shop_or_store",PHOTOCOPY_SHOP:"shop_or_store",PHOTO_LAB_DEVELOPMENT:"shop_or_store",RECYCLING_SHOP:"shop_or_store",RETAIL_OUTLET:"shop_or_store",SAUNA_SOLARIUM_MASSAGE:"shop_or_store",SECURITY_PRODUCTS:"shop_or_store",SHOPPING_SERVICE:"shop_or_store",SPECIALTY_FOODS:"shop_or_store",SPORTS_EQUIPMENT_CLOTHING:"shop_or_store",STAMP_SHOP:"shop_or_store",TAILOR_SHOP:"shop_or_store",TOYS_GAMES_SHOP:"shop_or_store",VARIETY_STORE:"shop_or_store",VIDEO_RENTAL_SHOP:"shop_or_store",WHOLESALE_CLUB:"shop_or_store",WINE_SPIRITS:"shop_or_store",ATHLETICS_TRACK:"sport_facility",BASEBALL_PARK:"sport_facility",BASKETBALL_ARENA:"sport_facility",BOWLING_CENTER:"sport_facility",CRICKET_GROUND:"sport_facility",FITNESS_CLUB_CENTER:"sport_facility",FLYING_CLUB:"sport_facility",HOCKEY_CLUB:"sport_facility",HORSE_RACING_TRACK:"sport_facility",HORSE_RIDING_CENTER:"sport_facility",ICE_HOCKEY_ARENA:"sport_facility",OTHER_WINTER_SPORT:"sport_facility",RACE_TRACK:"sport_facility",RUGBY_GROUND:"sport_facility",SKI_RESORT:"sport_facility",SNOOKER_POOL_BILLIARD:"sport_facility",THEMATIC_SPORT_CENTER:"sport_facility",FOOTBALL_STADIUM:"stadium",MOTOR_RACING_STADIUM:"stadium",MULTI_PURPOSE_STADIUM:"stadium",NETBALL_STADIUM:"stadium",SOCCER_STADIUM:"stadium",STOCK_EXCHANGE:"stock_exchange",TAXI_LIMOUSINE_SHUTTLE_SERVICE:"taxi_stand",AMPHITHEATER:"theater",ARCH:"tourist_attraction",BATTLEFIELD:"tourist_attraction",CAVE:"tourist_attraction",CEMETERY:"tourist_attraction",HISTORIC_SITE:"tourist_attraction",MAUSOLEUM_GRAVE:"tourist_attraction",MEMORIAL:"tourist_attraction",MINERAL_HOT_SPRINGS:"tourist_attraction",MONUMENT:"tourist_attraction",NATURAL_TOURIST_ATTRACTION:"tourist_attraction",OBSERVATORY:"tourist_attraction",STATUE:"tourist_attraction",TOURIST_ATTRACTION:"tourist_attraction",TOWER:"tourist_attraction",ROAD_TRAFFIC_CONTROL_CENTER:"traffic_control_department",ADVENTURE_VEHICLE_TRAIL:"trails",HIKING_TRAIL:"trails",HORSE_RIDING_TRAIL:"trails",MOUNTAIN_BIKE_TRAIL:"trails",ROCK_CLIMBING_TRAIL:"trails",APARTMENT_RENTAL:"urban_ground",CONDOMINIUM_COMPLEX:"urban_ground",FLATS_APARTMENT_COMPLEX:"urban_ground",RESIDENTIAL_ESTATE:"urban_ground",RETIREMENT_COMMUNITY:"urban_ground",TOWNHOUSE_COMPLEX:"urban_ground",ANIMAL_SERVICES:"veterinarian",ANIMAL_SHELTER:"veterinarian",WEIGH_SCALES:"weigh_station",WILDLIFE_PARK:"zoo_or_aquarium",ZOO:"zoo_or_aquarium"},Oi=e=>Li[e],Ni="Noto-Bold",bi="title",Ci="iconID",vi="default_place",Mi={"icon-image":["get",Ci],"icon-anchor":"bottom","icon-size":["interpolate",["linear"],["zoom"],8,.6,22,.8],"icon-allow-overlap":!0,"icon-padding":0},wi={"icon-translate":[0,5],"icon-translate-anchor":"viewport"},Ui={"text-optional":!0,"text-font":[Ni],"text-field":["get",bi],"text-justify":"auto","text-variable-anchor":["top","left","right"],"text-variable-anchor-offset":["top",[0,.7],"left",[1.4,-1.4],"right",[-1.4,-1.4]],"text-size":["interpolate",["linear"],["zoom"],10,14,18,16],"text-padding":5},Pi={"text-color":"#333333","text-halo-color":"#FFFFFF","text-halo-width":["interpolate",["linear"],["zoom"],6,1,10,1.5],"text-translate-anchor":"viewport"},Di={type:"symbol",layout:{...Mi,...Ui},paint:{...wi,...Pi}},xi=(e,t)=>`${e}-${t}`,Fi=["in",["get","eventState"],["literal",["click","contextmenu"]]],Hi=["has","eventState"],Gi="#3f9cd9",ji={...Di,filter:["!",Hi]},Bi={...Di,filter:Hi,layout:{...Di.layout,"icon-size":["interpolate",["linear"],["zoom"],8,.8,22,1],"text-allow-overlap":!0},paint:{...Di.paint,"text-color":Gi}},Wi=(e,t,r)=>{const i=t?.text,o=t?.layers?.[r];return{...e,layout:{...e.layout,...i?.size&&{"text-size":i.size},...i?.font&&{"text-font":i.font},...i?.offset&&{"text-offset":i.offset},...i?.title&&"function"!=typeof i?.title&&{"text-field":i?.title},...o?.layout},paint:{...e.paint,...i?.color&&{"text-color":i.color},...i?.haloColor&&{"text-halo-color":i.haloColor},...i?.haloWidth&&{"text-halo-width":i.haloWidth},...o?.paint},...o}},Vi=e=>JSON.parse(JSON.stringify(e)?.replace(/name/g,bi)),ki=(e,t)=>{let r;if("base-map"===e?.theme){const e=(e=>{const t=e.getStyle().layers.filter(e=>"POI"===e.id)[0]||{},r=t.layout?.["text-size"];return{filter:["!",Fi],type:"symbol",paint:t.paint,layout:{...t.layout,"text-field":["get",bi],"icon-image":["get",Ci],...r&&{"text-size":Vi(r)}}}})(t);r={main:e,selected:{...e,filter:Hi,layout:{...e.layout,"text-allow-overlap":!0},paint:{...e.paint,"text-color":Gi}}}}else r={main:ji,selected:Bi};return{main:Wi(r.main,e,"main"),selected:Wi(r.selected,e,"selected"),...e?.layers?.additional}},Yi=e=>{if(jr())return Br(Vr(e))},zi=/* @__PURE__ */new Set([7339002,8099002,7369004,7321003,7376006,9362003,9362004,9160004,9376007,7315015,9376006,9376002,7315078,7315149,9376005,7372003,9352045,9352032,9361048,9902003,9378005,7383004,9910004,7320002,9362016,7320003,9362025,9942002,9942003,7380005,9663003,9361021,9379009,9379004,7315147,9376003,9160002,9160003,9352008,9361006,7389004,9910006]),Ki=e=>e.properties.poi?.name??e.properties.address.freeformAddress,$i=(e,t,i)=>{if("pin"===t){return(e=>{if(e)return zi.has(e)?e.toString():e.toString().substring(0,4)})(r[e])??i}{const t=Oi(e);return t?`poi-${t}`:i}},Zi=(e,t,r={})=>{const i=r.theme??"pin",o=xi(vi,t),a=r.icon?.mapping;if(a)return"imageID"===a.to?a.fn(e):$i(a.fn(e),i,o);const s=e.properties.poi?.classifications?.[0]?.code,n=r.icon?.categoryIcons?.find(e=>e.id===s);return n?xi(n.id,t):$i(s,i,o)},qi=e=>{const t=e.properties.poi?.classifications?.[0]?.code;return t&&Oi(t)},Xi=e=>Array.isArray(e)?{type:"FeatureCollection",features:e}:"Feature"===e.type?{type:"FeatureCollection",features:[e]}:e,Ji=(e,r,i={})=>{const o=Xi(e);return{...o,features:o.features.map(e=>{const o="function"==typeof i?.text?.title?i?.text?.title(e):Ki(e),a=i.extraFeatureProps?Object.fromEntries(Object.entries(i.extraFeatureProps).map(([t,r])=>[t,"function"==typeof r?r(e):r])):{},s=e.id??t();return{...e,id:s,geometry:{...e.geometry,bbox:e.bbox},properties:{...e.properties,id:s,title:o,iconID:Zi(e,r,i),..."base-map"===i?.theme&&{category:qi(e)},...a}}})}},Qi=class e extends ci{static async get(t,r){return await Jr(t),new e(t,r)}constructor(e,t){super("geojson",e,t)}_initSourcesWithLayers(t,r){return r||(e.lastInstanceIndex++,this.instanceIndex=e.lastInstanceIndex,this.sourceID=`places-${this.instanceIndex}`,this.layerIDPrefix=this.sourceID,this.defaultPlaceIconID=xi(vi,this.instanceIndex)),this.layerSpecs=this.buildLayerSpecs(t),{places:new Xr(this.mapLibreMap,this.sourceID,[this.layerSpecs.main,this.layerSpecs.selected])}}buildLayerSpecs(e){const t=ki(e,this.mapLibreMap);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,{...t,id:`${this.layerIDPrefix}-${e}`}]))}_applyConfig(e){return this.updateLayersAndData(e),e}restoreDataAndConfigImpl(){const e=this.sourcesWithLayers.places.shownFeatures;this.initSourcesWithLayers(this.config,!0),this.config&&this._applyConfig(this.config),this.show(e)}applyTheme(e){this.applyConfigPart({theme:e})}applyIconConfig(e){this.applyConfigPart({icon:e})}applyTextConfig(e){this.applyConfigPart({text:e})}applyConfigPart(e){const t={...this.config,...e};this.updateLayersAndData(t),this.config=t}applyExtraFeatureProps(e){const t={...this.config,extraFeatureProps:e};this.updateData(t),this.config=t}updateLayersAndData(e){this.setupImages(e);const t=this.buildLayerSpecs(e),r=[t.main,t.selected],i=[this.layerSpecs.main,this.layerSpecs.selected];ti(r,i,this.mapLibreMap),this.layerSpecs=t,this.updateData(e)}setupImages(e){if(e?.icon){for(const t of e.icon.categoryIcons??[])ai(0,xi(t.id,this.instanceIndex),t.image,this.mapLibreMap,{pixelRatio:t.pixelRatio??2});e.icon.default&&(e.icon.default.image&&ai(0,this.defaultPlaceIconID,e.icon.default.image.image,this.mapLibreMap,{pixelRatio:e.icon.default.image.pixelRatio??2}),e.icon.default.style&&ai(0,this.defaultPlaceIconID,Yi(e.icon.default.style),this.mapLibreMap,{pixelRatio:2}))}else ai(0,this.defaultPlaceIconID,Yi(),this.mapLibreMap,{pixelRatio:2})}updateData(e){this.sourcesWithLayers.places.source.runtimeSource?.setData(Ji(this.sourcesWithLayers.places.shownFeatures,this.instanceIndex,e))}async show(e){await this.waitUntilModuleReady(),this.sourcesWithLayers.places.show(Ji(e,this.instanceIndex,this.config))}async clear(){await this.waitUntilModuleReady(),this.sourcesWithLayers.places.clear()}putEventState(e){this.sourcesWithLayers.places.putEventState(e)}cleanEventState(e){this.sourcesWithLayers.places.cleanEventState(e)}cleanEventStates(e){this.sourcesWithLayers.places.cleanEventStates(e)}get events(){return new li(this.eventsProxy,this.sourcesWithLayers.places)}};Qi.lastInstanceIndex=-1;let eo=Qi;const to=e=>{if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!to(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}},ro=e=>e?.length?1===e.length?e[0]:{expression:["any",...e.map(e=>e?.expression)],legacy:["any",...e.map(e=>e?.legacy)]}:null,io=(e,t)=>{return t?["all",e[(r=t,to(r)?"expression":"legacy")],t]:e.expression;var r},oo=(e,t,r)=>{if(1===r.length){const i="only"===t?"==":"!=";return{expression:[i,["get",e],r[0]],legacy:[i,e,r[0]]}}const i=["in",["get",e],["literal",r]];return"only"===t?{expression:i,legacy:["in",e,...r]}:{expression:["!",i],legacy:["!in",e,...r]}},ao=(e,t,r)=>oo(e,t.show,r?t.values.map(r):t.values),so={FOOD_DRINKS_GROUP:["RESTAURANT","FAST_FOOD","CAFE_PUB","PUB","WINERY","PUB_FOOD","SOUL_FOOD","DELICATESSEN"],SHOPPING_GROUP:["SHOP","SHOPPING_CENTER","CLOTHING_SHOP","MARKET","FOOD_MARKET","SUPERMARKETS_HYPERMARKETS","DEPARTMENT_STORE","CONVENIENCE_STORE","GROCERY_STORE","HARDWARE_STORE","ELECTRICAL_APPLIANCES_SHOP"],TRANSPORTATION_GROUP:["AIRPORT","FERRY_TERMINAL","HELIPAD_HELICOPTER_LANDING","PUBLIC_TRANSPORT_STOP","RAILWAY_STATION","BUS_STOP","TAXI_STAND"],HEALTH_GROUP:["DOCTOR","EMERGENCY_MEDICAL_SERVICE","EMERGENCY_ROOM","HEALTH_CARE_SERVICE","HOSPITAL","HOSPITAL_POLYCLINIC","PHARMACY","DENTIST","WELFARE_ORGANIZATION"],PARKING_GROUP:["PARKING_GARAGE","OPEN_PARKING_AREA"],HOLIDAY_TOURISM_GROUP:["AMUSEMENT_PARK","BEACH","HOLIDAY_RENTAL","GEOGRAPHIC_FEATURE","IMPORTANT_TOURIST_ATTRACTION","LEISURE_CENTER","MOUNTAIN_PASS","MOUNTAIN_PEAK","MUSEUM","SCENIC_PANORAMIC_VIEW","TOURIST_INFORMATION_OFFICE"],EV_CHARGING_STATIONS_GROUP:["ELECTRIC_VEHICLE_STATION"],GAS_STATIONS_GROUP:["GAS_STATION","PETROL_STATION"],ACCOMMODATION_GROUP:["CAMPING_GROUND","HOTEL_MOTEL","HOLIDAY_RENTAL"],ENTERTAINMENT_GROUP:["CINEMA","THEATER","MOVIE_THEATER","NIGHTLIFE","CONCERT_HALL","ENTERTAINMENT","CLUB_ASSOCIATION","CASINO"],SPORTS_LEISURE_GROUP:["SPORTS_CENTER","WATER_SPORT","SWIMMING_POOL","GOLF_COURSE","STADIUM","BEACH","ICE_SKATING_RINK","LEISURE_CENTER","MOUNTAIN_PASS","MOUNTAIN_PEAK"],EDUCATION_GROUP:["SCHOOL","COLLEGE_UNIVERSITY","LIBRARY","CULTURAL_CENTER"],GOVERNMENT_GROUP:["GOVERNMENT_OFFICE","COURTHOUSE","EMBASSY","FIRE_STATION_BRIGADE","POLICE_STATION"]},no=e=>{const t=[];return e.forEach(e=>{e in so?t.push(...so[e].map(Oi)):t.push(Oi(e))}),[...new Set(t)]};class co extends ci{static async get(e,t){return await Jr(e),new co(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(){const e=this.mapLibreMap.getSource(Ei);if(!e)throw Gr(`init ${co.name} with source ID ${Ei}`);const t=new $r(this.mapLibreMap,e,e=>mi.includes(e.id)),r=t.sourceAndLayerIDs.layerIDs[0];return this.mapLibreMap.getLayer(r)&&(this.originalFilter=this.mapLibreMap.getFilter(r)),{poi:t}}_applyConfig(e){return e&&!vr(e.visible)?this.setVisible(e.visible):this._initializing||this.isVisible()||this.setVisible(!0),this.filterCategories(e?.filters?.categories),e}isVisible(){return this.sourcesWithLayers.poi.isAnyLayerVisible()}setVisible(e){this.config={...this.config,visible:e},this.tomtomMap.mapReady&&this.sourcesWithLayers.poi.setLayersVisible(e)}filterCategories(e){if(e){if(this.tomtomMap.mapReady){const t=oo("category",e.show,no(e.values));this.mapLibreMap.setFilter("POI",io(t,this.originalFilter))}this.config={...this.config,filters:{categories:e}}}else this.categoriesFilter&&(this.config={...this.config,filters:{categories:{show:"all_except",values:[]}}},this.tomtomMap.mapReady&&this.mapLibreMap.setFilter("POI",this.originalFilter));this.categoriesFilter=e}get events(){return new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.poi)}}const lo={land:{layerIDMatches:["lulc"],layerTypes:["fill"]},borders:{layerIDMatches:["borders"],layerTypes:["line"]},water:{layerIDMatches:["water"],layerTypes:["fill","line"]},buildings2D:{layerIDMatches:["building"],layerTypes:["fill","line"]},buildings3D:{layerIDMatches:["building"],layerTypes:["fill-extrusion"]},houseNumbers:{layerIDMatches:["house number"],layerTypes:["symbol"]},roadLines:{layerIDMatches:["road","tunnel","bridge","surface"],layerTypes:["fill","line"]},roadLabels:{layerIDMatches:["road","tunnel","bridge","surface"],layerTypes:["symbol"]},roadShields:{layerIDMatches:["shield"],layerTypes:["symbol"]},placeLabels:{layerIDMatches:["places"],layerTypes:["symbol"]},smallerTownLabels:{layerIDMatches:["town","village","neighbourhood"],layerTypes:["symbol"]},cityLabels:{layerIDMatches:["city","capital"],layerTypes:["symbol"]},capitalLabels:{layerIDMatches:["capital"],layerTypes:["symbol"]},stateLabels:{layerIDMatches:["state"],layerTypes:["symbol"]},countryLabels:{layerIDMatches:["places - country"],layerTypes:["symbol"]}},uo=(e,t)=>{const r=lo[e];return r.layerIDMatches.some(e=>t.id.toLowerCase().includes(e))&&r.layerTypes.includes(t.type)},ho=e=>t=>(!e||((e,t)=>{const r=t?.mode,i=t?.names;if(r&&i?.length){if("include"===r)return i.some(t=>uo(t,e));if("exclude"===r)return!i.some(t=>uo(t,e))}return!0})(t,e))&&!mi.includes(t.id);class po extends ci{static async get(e,t){return await Jr(e),new po(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(e){const t=this.mapLibreMap.getSource(gi);if(!t)throw Gr(`init ${po.name} with source ID ${gi}`);return{vectorTiles:new $r(this.mapLibreMap,t,ho(e?.layerGroupsFilter))}}_applyConfig(e){return e&&!vr(e.visible)?this.setVisible(e.visible):this._initializing||this.isVisible()||this.setVisible(!0),e?.layerGroupsVisibility&&this.setVisible(e.layerGroupsVisibility.visible,{layerGroups:e.layerGroupsVisibility}),this.config||e?{...this.config,...e}:void 0}isVisible(){return this.sourcesWithLayers.vectorTiles.isAnyLayerVisible()}setVisible(e,t){t?.layerGroups?this.config={...this.config,layerGroupsVisibility:{...t.layerGroups,visible:e}}:(delete this.config?.layerGroupsVisibility,this.config={...this.config,visible:e}),this.tomtomMap.mapReady&&this.sourcesWithLayers.vectorTiles.setLayersVisible(e,t?.layerGroups&&(e=>{const t=e.mode,r=e.names;return"include"===t?e=>r.some(t=>uo(t,e)):"exclude"===t?e=>!r.some(t=>uo(t,e)):(console.error("Unrecognized layer group mode:",t),()=>!0)})(t.layerGroups))}get events(){return new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.vectorTiles)}}const _o=["land","water","borders","buildings2D","buildings3D","houseNumbers","roadLines","roadLabels","roadShields","placeLabels","smallerTownLabels","cityLabels","capitalLabels","stateLabels","countryLabels"],fo="title",yo="color",Ao={warm:["#793F0D","#AC703D","#C38E63","#E49969","#E5AE86","#EEC5A9","#6E7649","#9D9754","#C7C397","#B4A851","#DFD27C","#E7E3B5","#846D74","#B7A6AD","#D3C9CE"],browns:["#edc4b3","#e6b8a2","#deab90","#d69f7e","#cd9777","#c38e70","#b07d62","#9d6b53","#8a5a44","#774936"],cold:["#344464","#548ca4","#549cac","#2c445c","#a4ccd4","#acbccc","#b4c4d4","#acd4cc","#5c8ca4"],fadedBlues:["#152033","#1d2d44","#2e455d","#3e5c76","#4c6884","#597491","#67809e","#6e86a5","#7b91ad","#879bb4"],blues:["#03045e","#023e8a","#0077b6","#0096c7","#00b4d8","#48cae4","#90e0ef","#ade8f4","#caf0f8"],greens:["#004b23","#006400","#007200","#008000","#38b000","#70e000","#9ef01a","#ccff33"],fadedGreenToBlue:["#d9ed92","#b5e48c","#99d98c","#76c893","#52b69a","#34a0a4","#168aad","#1a759f","#1e6091","#184e77"],blueToRed:["#033270","#1368aa","#4091c9","#9dcee2","#fedfd4","#f29479","#f26a4f","#ef3c2d","#cb1b16","#65010c"],greenToYellow:["#007f5f","#2b9348","#55a630","#80b918","#aacc00","#bfd200","#d4d700","#dddf00","#eeef20","#ffff3f"],pastel:["#fec5bb","#fcd5ce","#fae1dd","#f8edeb","#e8e8e4","#d8e2dc","#ece4db","#ffe5d9","#ffd7ba","#fec89a"],retro:["#f94144","#f3722c","#f8961e","#f9844a","#f9c74f","#90be6d","#43aa8b","#4d908e","#577590","#277da1"],contrastRetro:["#001219","#005f73","#0a9396","#94d2bd","#e9d8a6","#ee9b00","#ca6702","#bb3e03","#ae2012","#9b2226"],fadedRainbow:["#ffadad","#ffd6a5","#fdffb6","#caffbf","#9bf6ff","#a0c4ff","#bdb2ff","#ffc6ff","#fffffc"],pastelRainbow:["#54478c","#2c699a","#048ba8","#0db39e","#16db93","#83e377","#b9e769","#efea5a","#f1c453","#f29e4c"]},Eo="#0A3653",Ro={type:"fill",paint:{"fill-color":["coalesce",["get",yo],Eo],"fill-opacity":.15,"fill-antialias":!1}},go={type:"line",paint:{"line-color":Eo,"line-opacity":.45,"line-width":2}},Io=(e,t,r)=>{const i=r?.colorConfig,o=r?.lineConfig;return[{...Ro,id:e,paint:{...Ro.paint,...!vr(i?.fillOpacity)&&{"fill-opacity":i?.fillOpacity},...i?.fillColor&&{"fill-color":["get","color"]}}},{...go,id:t,paint:{...go.paint,...!vr(o?.lineColor)&&{"line-color":o?.lineColor},...!vr(o?.lineWidth)&&{"line-width":o?.lineWidth},...!vr(o?.lineOpacity)&&{"line-opacity":o?.lineOpacity}}}]},To=(e,t)=>{const r=t?.textConfig;return{type:"symbol",id:e,layout:{"text-field":["get",fo],...r?.textField&&{"text-field":r.textField},"text-padding":5,"text-size":12,"text-font":[Ni],"symbol-placement":"point"},paint:{"text-color":"#333333","text-halo-color":"#FFFFFF","text-halo-width":["interpolate",["linear"],["zoom"],6,1,10,1.5],"text-translate-anchor":"viewport"}}},mo=(e,r={})=>({...e,features:e.features.map((e,i)=>{const o=e.properties?.title??((e,t)=>t.textConfig?.textField?t.textConfig.textField:e.properties?.address?.freeformAddress)(e,r),a=e.properties?.color??((e,t)=>{const r=e?.colorConfig?.fillColor;if("string"==typeof r&&Ao[r]){const e=Ao[r];return e[t%e.length]}return r})(r,i);return{...e,properties:{...e.properties,...o&&{title:o},...a&&{color:a},id:e.properties?.id??t()}}})}),So=e=>{const r=e.features.map(e=>{let r;if(e.properties?.placeCoordinates)r=e.properties?.placeCoordinates;else if("MultiPolygon"===e.geometry.type){const t=(e=>e.flat().reduce((e,t)=>t.length>e.length?t:e,[]))(e.geometry.coordinates),a=i(t);r=a&&o(a)||null}else r=e.geometry.coordinates.flat();const a=e.id??e.properties?.id??t();return{type:"Feature",id:a,geometry:{type:"Point",coordinates:r},properties:{...e.properties,id:a}}});return{type:"FeatureCollection",bbox:e.bbox,features:r}},Lo=class e extends ci{static async get(t,r){return await Jr(t),new e(t,r)}constructor(e,t){super("geojson",e,t)}_initSourcesWithLayers(t,r){if(!r){e.lastInstanceIndex++,this.sourceID=`geometry-${e.lastInstanceIndex}`,this.titleSourceID=`geometryTitle-${e.lastInstanceIndex}`;const t=`geometry-${e.lastInstanceIndex}`;this.fillLayerID=`${t}_Fill`,this.outlineLayerID=`${t}_Outline`,this.titleLayerID=`${t}_Title`}const[i,o]=Io(this.fillLayerID,this.outlineLayerID,t),a=To(this.titleLayerID,t);return this.titleLayerSpecs=a,this.geometryFillLayerSpecs=i,this.geometryOutlineLayerSpecs=o,{geometry:new Xr(this.mapLibreMap,this.sourceID,[{...i},{...o}]),geometryLabel:new Xr(this.mapLibreMap,this.titleSourceID,[a])}}_applyConfig(e){return(e?.textConfig||e?.colorConfig||e?.lineConfig)&&this.updateLayerAndData(e),e?.beforeLayerConfig&&this.moveBeforeLayer(e.beforeLayerConfig),e}moveBeforeLayerID(e){for(const t of this.sourcesWithLayers.geometry.sourceAndLayerIDs.layerIDs)this.mapLibreMap.moveLayer(t,e)}moveBeforeLayer(e){this.config={...this.config,beforeLayerConfig:e},this.moveBeforeLayerID("top"===e?this.titleLayerID:Ai[e])}applyTextConfig(e){const t={...this.config,textConfig:e};this.updateLayerAndData(t),this.sourcesWithLayers.geometryLabel.show(So(this.sourcesWithLayers.geometry.shownFeatures)),this.config=t}updateLayerAndData(e){const[t,r]=Io(this.fillLayerID,this.outlineLayerID,e),i=To(this.titleLayerID,e);ei(t,this.geometryFillLayerSpecs,this.mapLibreMap),ei(r,this.geometryOutlineLayerSpecs,this.mapLibreMap),ei(i,this.titleLayerSpecs,this.mapLibreMap),this.geometryFillLayerSpecs=t,this.geometryOutlineLayerSpecs=r,this.titleLayerSpecs=i}restoreDataAndConfigImpl(){const e=this.sourcesWithLayers.geometry.shownFeatures;this.initSourcesWithLayers(this.config,!0),this.config&&this._applyConfig(this.config),this.show(e)}async show(e){await this.waitUntilModuleReady();const t=this.sourcesWithLayers.geometry;t.show(mo(e,this.config)),this.sourcesWithLayers.geometryLabel.show(So(t.shownFeatures))}async clear(){await this.waitUntilModuleReady(),this.sourcesWithLayers.geometry.clear()}get events(){return new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.geometry)}};Lo.lastInstanceIndex=-1;let Oo=Lo;class No extends ci{static async get(e,t){return await Jr(e),await oi(e,Ri,"hillshade"),new No(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(){const e=this.mapLibreMap.getSource(Ri);if(!e)throw Gr(`init ${No.name} with source ID ${Ri}`);return{hillshade:new $r(this.mapLibreMap,e)}}_applyConfig(e){return this.setVisible(e?.visible??!1),e}setVisible(e){this.config={...this.config,visible:e},this.tomtomMap.mapReady&&this.sourcesWithLayers.hillshade.setLayersVisible(e)}isVisible(){return this.sourcesWithLayers.hillshade.isAnyLayerVisible()}get events(){return new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.hillshade)}}const bo=["standardLight","standardDark","drivingLight","drivingDark","monoLight","monoDark","satellite"],Co=["trafficIncidents","trafficFlow","hillshade"],vo="#36A8F0",Mo="#105287",wo="#ABAFB3",Uo="#3C4956",Po="#727C85",Do=["interpolate",["linear"],["zoom"],1,3,5,4,10,7,18,10],xo=["==",["get","routeState"],"selected"],Fo=["==",["get","routeState"],"deselected"],Ho="#AD0000",Go="#FB2D09",jo="#f58240",Bo="#000000",Wo=e=>!1===e?.visible?"":e?.title??["format",["get","title"],"\n",["get","chargingPower"]," • ",["get","chargingDuration"]],Vo=e=>({...Di,filter:xo,minzoom:4,layout:{...Di.layout,"text-field":Wo(e?.text)},paint:{...Di.paint}}),ko={filter:xo,minzoom:16},Yo={...ko,type:"line",layout:{"line-cap":"round"}},zo={...Yo,paint:{"line-width":["interpolate",["linear"],["zoom"],16,14,22,20],"line-color":"grey"}},Ko={...Yo,paint:{"line-width":["interpolate",["linear"],["zoom"],16,12,22,17],"line-color":"white"}},$o="instruction-arrow",Zo={...ko,type:"symbol",layout:{"icon-allow-overlap":!0,"icon-image":$o,"icon-rotation-alignment":"map","icon-rotate":["get","lastPointBearingDegrees"],"icon-size":["interpolate",["linear"],["zoom"],16,1,22,2]}},qo={filter:xo,type:"line",layout:{"line-join":"round"},paint:{"line-width":Do,"line-color":"#6dc4ed"}},Xo={filter:xo,type:"symbol",minzoom:6,maxzoom:16.5,layout:{"symbol-placement":"point","symbol-avoid-edges":!0,"icon-image":"poi-ferry_terminal","icon-size":["interpolate",["linear"],["zoom"],6,.8,16.5,1],"icon-ignore-placement":!0}},Jo={type:"line",layout:{"line-join":"round","line-cap":"round","line-sort-key":["get","index"]}},Qo=["interpolate",["linear"],["zoom"],1,5,5,6,10,10,18,14],ea={...Jo,filter:Fo,paint:{"line-color":Uo,"line-width":Qo}},ta={...Jo,filter:Fo,paint:{"line-color":wo,"line-width":Do}},ra={...Jo,filter:xo,paint:{"line-color":Mo,"line-width":Qo}},ia={type:"symbol",layout:{"symbol-placement":"line","icon-image":"roads-arrow-white","icon-rotate":180}},oa="selected-route-summary-popup",aa="deselected-route-summary-popup",sa={filter:xo,type:"line",layout:{"line-join":"round","line-cap":"round"},paint:{"line-width":["interpolate",["linear"],["zoom"],1,9,5,11,10,15,18,20],"line-color":"#BEBFFA"}},na={filter:xo,type:"symbol",minzoom:4,layout:{"symbol-placement":"point","symbol-avoid-edges":!0,"icon-image":"poi-toll_plaza","icon-size":["interpolate",["linear"],["zoom"],4,.8,16.5,1]}},ca=["interpolate",["linear"],["zoom"],1,2,5,3,10,4,18,6],la={type:"line",layout:{"line-cap":"round"},paint:{"line-width":ca,"line-color":["match",["get","magnitudeOfDelay"],"minor","#FFC105","moderate",Go,"major",Ho,"#C7D2D8"]}},ua={type:"line",filter:["in",["get","magnitudeOfDelay"],["literal",["unknown","indefinite"]]],layout:{"line-join":"round"},paint:{"line-width":ca,"line-color":["match",["get","magnitudeOfDelay"],"unknown","rgba(190, 39, 27, 1)","rgba(137, 150, 168, 1)"],"line-dasharray":[1.5,1]}},ha=["match",["get","magnitudeOfDelay"],"minor",jo,"moderate",Go,"major",Ho,"indefinite","#666666",Bo],pa={filter:xo,type:"symbol",minzoom:6,layout:{"symbol-placement":"point","symbol-avoid-edges":!0,"icon-ignore-placement":!0}},_a={...pa,filter:["all",["has","jamIconID"],pa.filter],layout:{...pa.layout,"icon-image":["get","jamIconID"],"icon-anchor":"bottom-left","text-anchor":"bottom-left","text-field":["get","title"],"text-font":[Ni],"text-offset":[3.9,-1.4],"text-size":13},paint:{...pa.paint,"text-color":ha,"text-halo-color":"#FFFFFF","text-halo-width":1}},fa={...pa,filter:["all",["has","causeIconID"],pa.filter],layout:{...pa.layout,"icon-image":["get","causeIconID"],"icon-anchor":"bottom-right"},paint:{...pa.paint}},da={filter:xo,type:"line",layout:{"line-join":"round"},paint:{"line-width":Do,"line-color":"#000000","line-opacity":.3}},ya={filter:xo,type:"line",layout:{"line-join":"round"},paint:{"line-color":Mo,"line-width":Do}},Aa={filter:xo,type:"line",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":vo,"line-width":["interpolate",["linear"],["zoom"],1,2,5,3,10,5,18,7],"line-dasharray":[0,1.5]}},Ea="traffic-clear",Ra="traffic-major",ga="traffic-moderate",Ia="traffic-minor",Ta=["has","formattedTraffic"],ma=e=>{const t=void 0!==e?xi(oa,e):oa,r=void 0!==e?xi(aa,e):aa,i=void 0!==e?xi(Ea,e):Ea,o=void 0!==e?xi(Ra,e):Ra,a=void 0!==e?xi(ga,e):ga,s=void 0!==e?xi(Ia,e):Ia;return{type:"symbol",layout:{"icon-image":["case",xo,t,r],"symbol-placement":"point","icon-rotation-alignment":"viewport","text-rotation-alignment":"viewport","symbol-sort-key":["case",xo,0,1],"icon-text-fit":"both","icon-text-fit-padding":[10,5,5,10],"text-font":["Noto-Medium"],"text-size":13,"icon-padding":0,"text-justify":"left","text-line-height":1.5,"text-field":["format",["get","formattedDuration"],{"text-font":["literal",[Ni]],"text-color":["case",xo,"black",Po]},["concat","\t\t",["get","formattedDistance"]],{"text-color":Po},["case",Ta,"\n",""],{},["image",["case",Ta,["match",["get","magnitudeOfDelay"],"major",o,"moderate",a,"minor",s,i],""]],{},["case",Ta,["concat"," ",["get","formattedTraffic"]],""],{"text-font":["literal",[Ni]],"text-color":ha}]},paint:{"icon-translate":[0,-35],"text-translate":[0,-35]}}},Sa=ma(),La="start",Oa="middle",Na="finish",ba="indexType",Ca="stopDisplayIndex",va="waypointStart",Ma="waypointStop",wa="waypointSoft",Ua="waypointFinish",Pa={"text-field":["get",Ca],"text-font":[Ni],"text-size":["interpolate",["linear"],["zoom"],13,14,18,16],"text-offset":[0,-1.6],"icon-anchor":["case",["all",["==",["get",ba],Oa],["!",["has",Ca]]],"center","bottom"],"text-allow-overlap":!0},Da={type:"symbol",paint:{...wi,"text-color":"#ffffff"},layout:{...Mi,...Pa,"symbol-sort-key":["case",["==",["get",Ci],wa],0,["abs",["-",["get","index"],1e3]]]}},xa={type:"symbol",paint:{...Pi,"text-color":"black","text-halo-width":1.5,"text-halo-color":"#ffffff"},layout:{...Ui,"text-anchor":"top","text-offset":[0,.4]}},Fa=(e,t)=>e&&t&&(e.startsWith("route")||e.startsWith("waypoint"))?`${t}-${e}`:e,Ha=(e,t)=>e&&t?Object.fromEntries(Object.entries(e).map(([e,r])=>[e,r?.beforeID?{...r,beforeID:Fa(r.beforeID,t)}:r])):e,Ga=(e,t)=>e&&void 0!==t?`${e}-${t}`:e,ja=(e={},t,r)=>{const i=e.layers,o=i?.sections,a=e.theme?.mainColor;return{mainLines:{routeLineArrows:{...ia,beforeID:Ai.lowestLabel,...i?.mainLines?.routeLineArrows},routeLine:{...(s={color:a},{...Jo,filter:xo,paint:{"line-color":s?.color??vo,"line-width":Do}}),beforeID:Fa("routeIncidentBackgroundLine",t),...i?.mainLines?.routeLine},routeOutline:{...ra,beforeID:Fa("routeLine",t),...i?.mainLines?.routeOutline},routeDeselectedLine:{...ta,beforeID:Fa("routeOutline",t),...i?.mainLines?.routeDeselectedLine},routeDeselectedOutline:{...ea,beforeID:Fa("routeDeselectedLine",t),...i?.mainLines?.routeDeselectedOutline},...Ha(i?.mainLines?.additional,t)},waypoints:{routeWaypointSymbol:{...Da,beforeID:Fa("routeSummaryBubbleSymbol",t),...i?.waypoints?.routeWaypointSymbol},routeWaypointLabel:{...xa,beforeID:Fa("routeWaypointSymbol",t),...i?.waypoints?.routeWaypointLabel},...Ha(i?.waypoints?.additional,t)},chargingStops:{routeChargingStopSymbol:{...Vo(e.chargingStops),beforeID:Fa("routeWaypointSymbol",t),...i?.chargingStops?.routeChargingStopSymbol},...Ha(i?.chargingStops?.additional,t)},sections:{incident:{routeIncidentJamSymbol:{..._a,beforeID:Fa("routeChargingStopSymbol",t),...o?.incident?.routeIncidentJamSymbol},routeIncidentCauseSymbol:{...fa,beforeID:Fa("routeChargingStopSymbol",t),...o?.incident?.routeIncidentCauseSymbol},routeIncidentBackgroundLine:{...la,beforeID:Fa("routeIncidentDashedLine",t),...o?.incident?.routeIncidentBackgroundLine},routeIncidentDashedLine:{...ua,beforeID:Fa("routeTunnelLine",t),...o?.incident?.routeIncidentDashedLine},...Ha(o?.incident?.additional,t)},ferry:{routeFerryLine:{...qo,beforeID:Fa("routeLineArrows",t),...o?.ferry?.routeFerryLine},routeFerrySymbol:{...Xo,beforeID:Fa("routeIncidentJamSymbol",t),...o?.ferry?.routeFerrySymbol},...Ha(o?.ferry?.additional,t)},tollRoad:{routeTollRoadOutline:{...sa,beforeID:Fa("routeDeselectedOutline",t),...o?.tollRoad?.routeTollRoadOutline},routeTollRoadSymbol:{...na,beforeID:Fa("routeChargingStopSymbol",t),...o?.tollRoad?.routeTollRoadSymbol},...Ha(o?.tollRoad?.additional,t)},tunnel:{routeTunnelLine:{...da,beforeID:Fa("routeLineArrows",t),...o?.tunnel?.routeTunnelLine},...Ha(o?.tunnel?.additional,t)},vehicleRestricted:{routeVehicleRestrictedBackgroundLine:{...ya,beforeID:Fa("routeVehicleRestrictedForegroundLine",t),...o?.vehicleRestricted?.routeVehicleRestrictedBackgroundLine},routeVehicleRestrictedForegroundLine:{...Aa,beforeID:Ai.lowestLabel,...o?.vehicleRestricted?.routeVehicleRestrictedForegroundLine},...Ha(o?.vehicleRestricted?.additional,t)}},instructionLines:{routeInstructionLine:{...Ko,beforeID:Ai.lowestLabel,...i?.instructionLines?.routeInstructionLine},routeInstructionOutline:{...zo,beforeID:Fa("routeInstructionLine",t),...i?.instructionLines?.routeInstructionOutline},...Ha(i?.instructionLines?.additional,t)},instructionArrows:{routeInstructionArrowSymbol:{...Zo,beforeID:Fa("routeInstructionLine",t),...void 0!==r&&{layout:{...Zo.layout,"icon-image":Ga(Zo.layout?.["icon-image"],r)}},...i?.instructionArrows?.routeInstructionArrowSymbol},...Ha(i?.instructionArrows?.additional,t)},summaryBubbles:{routeSummaryBubbleSymbol:{...void 0!==r?ma(r):Sa,...i?.summaryBubbles?.routeSummaryBubbleSymbol},...Ha(i?.summaryBubbles?.additional,t)}};var s},Ba=ja();let Wa;jr()&&(Wa=Br(Wr('<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50">\n <path d="M1.562 40.569L25 1.562l23.438 39.007L25 27.566 1.562 40.569z" fill="#fff"/>\n <path d="M25.369.107c.782.429.506.167.917.682l23.438 39.007c.79 1.316-.671 2.829-2.014 2.085L25 29.281l-22.71 12.6c-1.343.744-2.804-.769-2.014-2.085L23.714.789c.461-.694.9-.682 1.656-.682zM25 1.562L1.562 40.569 25 27.566l23.438 13.003L25 1.562z"\n fill="gray"/>\n</svg>\n')));const Va=e=>{if(!jr())return;const t=Wr('<svg xmlns="http://www.w3.org/2000/svg" width="160" height="65">\n <g filter="url(#A)">\n <rect id="pin" x="81.899" y="47" width="10" height="10" rx="2" transform="rotate(45 81.899 47)"/>\n <rect id="bubble" x="10" y="10" width="140" height="45" rx="12"/>\n </g>\n <defs>\n <filter id="A">\n <feDropShadow dx="0" dy="2" stdDeviation="4" flood-opacity=".3"/>\n </filter>\n </defs>\n</svg>\n');return t.querySelector("#bubble")?.setAttribute("fill",e),t.querySelector("#pin")?.setAttribute("fill",e),Br(t)},ka={pixelRatio:2,stretchX:[[20,45],[100,130]],stretchY:[[20,35]],content:[10,10,130,45]},Ya=e=>{if(!jr())return;const t=Wr('<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32">\n <g id="main">\n <path fill-rule="evenodd"\n d="M11.389 4H9.025a.86.86 0 0 0-.517.173l-.001-.001a.5.5 0 0 1-.464.059l-.028-.011a.5.5 0 0 1-.129-.83A1.86 1.86 0 0 1 9.025 3h2.364a2 2 0 0 1 1.789 1.106l1.02 2.04c.471.176.802.63.802 1.156v.803c0 .543 0 .815-.071 1.038a1.5 1.5 0 0 1-.914.953c-.219.08-.491.092-1.034.114l-1.481.062v-.166-.803a2.23 2.23 0 0 0-1.055-1.897l-.74-1.479 2.326.033h.955l-.703-1.406A1 1 0 0 0 11.389 4zM12 8.4a1 1 0 1 1 2 0 .5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5z"/>\n <path d="M11.833 11.115c0-.109.089-.198.198-.198h1.979c.109 0 .198.089.198.198 0 .328-.266.594-.594.594h-1.187c-.328 0-.594-.266-.594-.594z"/>\n <path fill-rule="evenodd"\n d="M1.802 8.146C1.331 8.321 1 8.776 1 9.302v.803c0 .543 0 .815.071 1.038a1.5 1.5 0 0 0 .914.953c.219.08.491.092 1.034.114l2.731.114 2.731-.114c.543-.023.814-.034 1.034-.114a1.5 1.5 0 0 0 .914-.953c.071-.223.071-.494.071-1.038v-.803c0-.526-.331-.98-.802-1.156l-1.02-2.04A2 2 0 0 0 6.889 5H4.611a2 2 0 0 0-1.789 1.106l-1.02 2.04zM6.889 6H4.611a1 1 0 0 0-.894.553l-.703 1.406h.955 3.563.955l-.703-1.406A1 1 0 0 0 6.889 6zM2 10.4a1 1 0 1 1 2 0 .5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm6.5-1a1 1 0 0 0-1 1 .5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5 1 1 0 0 0-1-1z"/>\n <path d="M1.792 13.115c0-.109.089-.198.198-.198h1.979c.109 0 .198.089.198.198 0 .328-.266.594-.594.594H2.385c-.328 0-.594-.266-.594-.594zm5.739-.198c-.109 0-.198.089-.198.198 0 .328.266.594.594.594h1.188c.328 0 .594-.266.594-.594 0-.109-.089-.198-.198-.198h-1.98z"/>\n </g>\n</svg>\n'),r=t.querySelector("#main");return r.setAttribute("transform","scale(2)"),r.setAttribute("fill",e),Br(t)},za=(e,t)=>{if(!jr())return;const r=Vr(t);return e&&r.appendChild(e),Br(r)},Ka=(e={},t)=>Object.entries(e).map(([e,r])=>({...r,id:t?`${t}-${e}`:e})),$a=(e={},t)=>({mainLines:Ka(e.mainLines,t),waypoints:Ka(e.waypoints,t),chargingStops:Ka(e?.chargingStops,t),ferries:Ka(e.sections?.ferry,t),incidents:Ka(e.sections?.incident,t),tollRoads:Ka(e.sections?.tollRoad,t),tunnels:Ka(e.sections?.tunnel,t),vehicleRestricted:Ka(e.sections?.vehicleRestricted,t),instructionLines:Ka(e.instructionLines,t),instructionArrows:Ka(e.instructionArrows,t),summaryBubbles:Ka(e.summaryBubbles,t)}),Za=(e,t,r)=>{const i=a.instance.get().displayUnits,o=e?.displayUnits;return{...e,...o?{}:{displayUnits:i},layers:ja(e,t,r)}},qa=(e,t)=>{const r=t?.chargingStops?.icon;if(r?.mapping){const t=r.mapping;switch(t.basedOn){case"chargingSpeed":if(e.properties.chargingConnectionInfo?.chargingSpeed)return t.value[e.properties.chargingConnectionInfo?.chargingSpeed];break;case"custom":return t.fn(e)}}return"7309"},Xa=e=>{const t=e.properties;return t.chargingParkName??t.chargingParkOperatorName},Ja=(e,r)=>{const i=[];if(!1!==r?.chargingStops?.visible)for(const o of e.features)for(const e of o.properties.sections.leg){const a=e.summary.chargingInformationAtEndOfLeg;if(a){const e=a.properties;i.push({...a,properties:{...a.properties,id:a.properties.chargingParkId??t(),iconID:qa(a,r),title:Xa(a),chargingPower:`${e.chargingConnectionInfo?.chargingPowerInkW} kW`,chargingDuration:s(e.chargingTimeInSeconds,r?.displayUnits?.time),routeState:o.properties.routeState}})}}return{type:"FeatureCollection",features:i}},Qa=e=>e.categories.includes("jam"),es=e=>{const t=(e=>{if(Qa(e))return s(e.delayInSeconds)})(e),r=((e,t)=>Qa(e)?`traffic-jam-${e.magnitudeOfDelay??"unknown"}-${(e=>e?.length?e.length<6?"small":e.length<8?"medium":"large":"collapsed")(t)}`:null)(e,t),i=(e=>{switch(e.categories.find(e=>"jam"!==e)){case"accident":return"traffic-incidents-accident";case"roadworks":return"traffic-incidents-roadworks";case"road-closed":return"traffic-incidents-road_closed";case"danger":case"animals-on-road":return"traffic-incidents-danger";case"broken-down-vehicle":return"traffic-incidents-broken_down_vehicle";case"lane-closed":case"narrow-lanes":return"traffic-incidents-lane_closed";case"wind":return"traffic-incidents-wind";case"fog":return"traffic-incidents-fog";case"rain":return"traffic-incidents-rain";case"frost":return"traffic-incidents-frost";case"flooding":return"traffic-incidents-flooding";default:return null}})(e);return{...e,...r&&{jamIconID:r},...i&&{causeIconID:i},...t&&{title:t}}},ts=(e,t,r)=>{if(e.properties.radiusMeters)return void 0!==r?xi(wa,r):wa;let i;switch(t){case"start":i=va;break;case"finish":i=Ua;break;default:i=Ma}return void 0!==r?xi(i,r):i},rs=(e,r,i)=>{let o=-1;return{type:"FeatureCollection",features:e.map((a,s)=>{if(!a)return o++,null;const c=(e=>{return Array.isArray(e)?{type:"Feature",geometry:{type:"Point",coordinates:e},properties:{}}:"Point"===e.type?{type:"Feature",geometry:t=e,properties:{},...t.bbox&&{bbox:t.bbox}}:e;var t})(a),l=((e,t)=>0===e?La:e<t-1?Oa:Na)(s,e.length),u=(e=>!e.properties.radiusMeters)(c);u&&o++;const h=(e=>{const t=e?.properties;return t?.poi?.name??t?.address?.freeformAddress??void 0})(c),p=c.id??t();return{...c,..."main-when-available"===r?.entryPoints&&{geometry:{type:"Point",coordinates:n(c,{useEntryPoint:"main-when-available"})}},id:p,properties:{...c.properties,id:p,index:s,indexType:l,...h&&{title:h},iconID:ts(c,l,i),...u&&l===Oa&&{stopDisplayIndex:o}}}}).filter(e=>e)}};function is(e){return e%360*Math.PI/180}function os(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return[...e.geometry.coordinates];if("Point"===e.type)return[...e.coordinates]}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return[...e];throw new Error("coord must be GeoJSON Point or an Array of numbers")}function as(e,t,r={}){if(!0===r.final)return function(e,t){let r=as(t,e);return r=(r+180)%360,r}(e,t);const i=os(e),o=os(t),a=is(i[0]),s=is(o[0]),n=is(i[1]),c=is(o[1]),l=Math.sin(s-a)*Math.cos(c),u=Math.cos(n)*Math.sin(c)-Math.sin(n)*Math.cos(c)*Math.cos(s-a);return Math.atan2(l,u)%(2*Math.PI)*180/Math.PI}var ss=as;const ns=(e,r,i)=>({type:"FeatureCollection",features:e.features.flatMap(e=>((e,r,i)=>e.properties.sections[r]?.map(r=>{const o=r.id??t();return{type:"Feature",id:o,geometry:{type:"LineString",coordinates:e.geometry.coordinates.slice(r.startPointIndex,r.endPointIndex+1)},properties:{...i?i(r,e.properties):r,routeState:e.properties.routeState,routeIndex:e.properties.index,id:o}}})||[])(e,r,i))}),cs=(e,t)=>{return t.show((r=e,i=t.shownFeatures,{...i,features:i.features.map(e=>({...e,properties:{...e.properties,routeState:r.features[e.properties.routeIndex||0].properties.routeState}}))}));var r,i},ls=(e,r=0)=>{const i="features"in e?e:{type:"FeatureCollection",features:[e]};return{...i,features:i.features.map((e,i)=>{const o=e.id??t();return{...e,id:o,properties:{...e.properties,id:o,routeState:i===r?"selected":"deselected"}}})}},us=(e,t)=>e.some(e=>e.magnitudeOfDelay===t),hs=(e,r)=>({type:"FeatureCollection",features:e.features.map(e=>{const i=e.properties.summary,o=e.geometry.coordinates,a=s(i.trafficDelayInSeconds,r?.time),n=(e=>{const t=e.properties.sections.traffic;if(t?.length)return us(t,"major")?"major":us(t,"moderate")?"moderate":us(t,"minor")?"minor":void 0})(e),l=e.id??t();return{type:"Feature",id:l,geometry:{type:"Point",coordinates:o[Math.round(o.length/2)]},properties:{id:l,routeIndex:e.properties.index,routeState:e.properties.routeState,formattedDistance:c(i.lengthInMeters,r?.distance),...n&&{magnitudeOfDelay:n},...a&&{formattedTraffic:a},formattedDuration:s(i.travelTimeInSeconds,r?.time)}}})}),ps=class e extends ci{static async get(t,r){return await Jr(t),new e(t,r)}constructor(e,t){super("geojson",e,t)}createSourcesWithLayers(e){const t=xi("routes",this.instanceIndex);return{mainLines:new Xr(this.mapLibreMap,`${t}-mainLines`,e.mainLines,!1),waypoints:new Xr(this.mapLibreMap,`${t}-waypoints`,e.waypoints,!1),incidents:new Xr(this.mapLibreMap,`${t}-incidents`,e.incidents,!1),ferries:new Xr(this.mapLibreMap,`${t}-ferries`,e.ferries,!1),chargingStops:new Xr(this.mapLibreMap,`${t}-chargingStops`,e.chargingStops,!1),tollRoads:new Xr(this.mapLibreMap,`${t}-tollRoads`,e.tollRoads,!1),tunnels:new Xr(this.mapLibreMap,`${t}-tunnels`,e.tunnels,!1),vehicleRestricted:new Xr(this.mapLibreMap,`${t}-vehicleRestricted`,e.vehicleRestricted,!1),instructionLines:new Xr(this.mapLibreMap,`${t}-instructionLines`,e.instructionLines,!1),instructionArrows:new Xr(this.mapLibreMap,`${t}-instructionArrows`,e.instructionArrows,!1),summaryBubbles:new Xr(this.mapLibreMap,`${t}-summaryBubbles`,e.summaryBubbles,!1)}}_initSourcesWithLayers(t,r){r||(e.lastInstanceIndex++,this.instanceIndex=e.lastInstanceIndex,this.layerIDPrefix=xi("routes",this.instanceIndex)),this.layersSpecs=$a(Za(t,this.layerIDPrefix,this.instanceIndex).layers,this.layerIDPrefix);const i=this.createSourcesWithLayers(this.layersSpecs);ri(Object.values(i).flatMap(e=>e._layerSpecs),this.mapLibreMap);const o={fillColor:t?.theme?.mainColor,...t?.waypoints?.icon?.style},a={pixelRatio:2},s=xi(va,this.instanceIndex),n=xi(Ma,this.instanceIndex),c=xi(wa,this.instanceIndex),l=xi(Ua,this.instanceIndex),u=xi($o,this.instanceIndex),h=xi(oa,this.instanceIndex),p=xi(aa,this.instanceIndex),_=xi(Ea,this.instanceIndex),f=xi(Ra,this.instanceIndex),d=xi(ga,this.instanceIndex),y=xi(Ia,this.instanceIndex);this.addImageIfNotExisting(s,(e=>{if(jr())return za(Wr('<svg xmlns="http://www.w3.org/2000/svg" width="120" height="140">\n <path d="M63.734 86.383c-1.404.026-2.78-.393-3.93-1.197s-2.01-1.949-2.46-3.271l-3.15-9.339c-1.093-3.403-3.748-6.089-7.154-7.238L37.5 62.21c-2.742-.902-4.567-3.477-4.5-6.345-.058-2.874 1.761-5.457 4.5-6.388l36-11.886c2.461-.88 5.213-.27 7.062 1.567s2.466 4.571 1.578 7.015L70.17 81.918c-.938 2.719-3.54 4.526-6.436 4.469h0z"\n fill="#f4f5f6"/>\n</svg>\n'),e)})(o),a),this.addImageIfNotExisting(n,za(void 0,o),a),this.addImageIfNotExisting(c,(()=>{if(jr())return Br(Wr('<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">\n <circle id="circle" cx="16" cy="16" r="12" fill="white" stroke="#105287" stroke-width="4"/>\n</svg>\n'))})(),a),this.addImageIfNotExisting(l,(e=>{if(jr())return za(Wr('<svg xmlns="http://www.w3.org/2000/svg" width="120" height="140">\n <path d="M33 83.404a2.99 2.99 0 0 1-3-2.978V44.681a2.99 2.99 0 1 1 6 0v35.745a2.99 2.99 0 0 1-3 2.978zm48-38.723H39v17.872h42V44.681zm3.878 37.851a3.02 3.02 0 0 0 4.244 0c.561-.559.878-1.317.878-2.106V44.681a2.99 2.99 0 1 0-6 0v35.745c0 .789.317 1.547.878 2.106z"\n fill="#f4f5f6"/>\n</svg>\n'),e)})(o),a),this.addImageIfNotExisting(u,Wa,a),this.addImageIfNotExisting(h,Va("white"),ka),this.addImageIfNotExisting(p,Va("#EEEEEE"),ka),this.addImageIfNotExisting(_,Ya(Bo),a),this.addImageIfNotExisting(f,Ya(Ho),a),this.addImageIfNotExisting(d,Ya(Go),a),this.addImageIfNotExisting(y,Ya(jo),a);for(const e of t?.chargingStops?.icon?.customIcons??[])this.addImageIfNotExisting(e.id,e.image,{pixelRatio:e.pixelRatio??2});return i}_applyConfig(e){const t=Za(e,this.layerIDPrefix,this.instanceIndex);if(this.config){const e=$a(t.layers,this.layerIDPrefix);Object.keys(e).forEach(t=>{const r=t;((e,t,r,i)=>{const o=e.reduce((e,t)=>({...e,[t.id]:t}),{}),a=t.reduce((e,t)=>({...e,[t.id]:t}),{}),s=[],n=[],c=[],l=[];Object.keys(o).forEach(e=>{a[e]?(c.push(o[e]),l.push(a[e])):s.push(e)}),Object.keys(a).forEach(e=>{o[e]||n.push(e)});const u=r._layerSpecs;n.forEach(e=>{i.removeLayer(e);for(let t=0;t<u.length;t++)if(u[t].id===e){u.splice(t,1);break}}),s.forEach(e=>{const t={...o[e],source:r.source.id};u.push(t)}),r._updateSourceAndLayerIDs(),ti(c,l,i)})(e[r],this.layersSpecs[r],this.sourcesWithLayers[r],this.mapLibreMap)});const r=Object.values(this.sourcesWithLayers);ri(r.flatMap(e=>e._layerSpecs),this.mapLibreMap),r.forEach(e=>e.setLayersVisible(!!e.shownFeatures.features.length)),this.layersSpecs=e}return!Cr(this.config?.displayUnits,t.displayUnits)&&this.sourcesWithLayers.summaryBubbles.shownFeatures.features.length&&this.sourcesWithLayers.summaryBubbles.show(hs(this.sourcesWithLayers.mainLines.shownFeatures,t.displayUnits)),t}async restoreDataAndConfigImpl(){const e=Object.entries(this.sourcesWithLayers).map(e=>({[e[0]]:e[1].shownFeatures})).reduce((e,t)=>({...e,...t}),{});this.initSourcesWithLayers(this.config,!0),this._applyConfig(this.config);for(const t of Object.keys(e))this.sourcesWithLayers[t].show(e[t])}addImageIfNotExisting(e,t,r){ai(0,e,t,this.mapLibreMap,r)}async showRoutes(e,r){const i=ls(e,r?.selectedIndex);await this.waitUntilModuleReady(),this.sourcesWithLayers.mainLines.show(i),this.sourcesWithLayers.vehicleRestricted.show(ns(i,"vehicleRestricted")),this.sourcesWithLayers.incidents.show(ns(i,"traffic",es)),this.sourcesWithLayers.chargingStops.show(Ja(i,this.config)),this.sourcesWithLayers.ferries.show(ns(i,"ferry")),this.sourcesWithLayers.tunnels.show(ns(i,"tunnel")),this.sourcesWithLayers.tollRoads.show(ns(i,"toll")),this.sourcesWithLayers.instructionLines.show((e=>({type:"FeatureCollection",features:e.features.flatMap((e,r)=>e.properties.guidance?.instructions?.filter(e=>e.routePath?.length).map(i=>({type:"Feature",geometry:{type:"LineString",coordinates:i.routePath.map(e=>e.point)},properties:{...i,id:t(),routeIndex:r,routeState:e.properties.routeState}}))||[])}))(i)),this.sourcesWithLayers.instructionArrows.show((e=>({type:"FeatureCollection",features:e.features.flatMap((e,r)=>e.properties.guidance?.instructions?.filter(e=>e.routePath?.length&&e.routePath.length>1).map(i=>{const o=[i.routePath[i.routePath.length-2]?.point,i.routePath[i.routePath.length-1]?.point];return{type:"Feature",geometry:{type:"Point",coordinates:o[1]},properties:{...i,id:t(),routeIndex:r,routeState:e.properties.routeState,lastPointBearingDegrees:ss(o[0],o[1])}}})||[])}))(i)),this.sourcesWithLayers.summaryBubbles.show(hs(i,this.config?.displayUnits))}async clearRoutes(){await this.waitUntilModuleReady();for(const e of Object.keys(this.sourcesWithLayers))"waypoints"!==e&&this.sourcesWithLayers[e].clear()}async selectRoute(e){const t=ls(this.sourcesWithLayers.mainLines.shownFeatures,e);await this.waitUntilModuleReady(),this.sourcesWithLayers.mainLines.show(t),this.sourcesWithLayers.chargingStops.show(Ja(t,this.config)),cs(t,this.sourcesWithLayers.vehicleRestricted),cs(t,this.sourcesWithLayers.incidents),cs(t,this.sourcesWithLayers.ferries),cs(t,this.sourcesWithLayers.tollRoads),cs(t,this.sourcesWithLayers.tunnels),cs(t,this.sourcesWithLayers.instructionLines),cs(t,this.sourcesWithLayers.instructionArrows),cs(t,this.sourcesWithLayers.summaryBubbles)}async showWaypoints(e){const t=Array.isArray(e)?rs(e,this.config?.waypoints,this.instanceIndex):rs(e.features,this.config?.waypoints,this.instanceIndex);await this.waitUntilModuleReady(),this.sourcesWithLayers.waypoints.show(t)}async clearWaypoints(){await this.waitUntilModuleReady(),this.sourcesWithLayers.waypoints.clear()}get events(){return{mainLines:new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.mainLines),waypoints:new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.waypoints),chargingStops:new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.chargingStops),summaryBubbles:new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.summaryBubbles),incidents:new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.incidents),vehicleRestricted:new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.vehicleRestricted),ferries:new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.ferries),tollRoads:new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.tollRoads),tunnels:new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.tunnels),instructionLines:new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.instructionLines)}}getLayerToRenderLinesUnder(){return Ai.lowestLabel}};ps.lastInstanceIndex=-1;let _s=ps;const fs="standardLight",ds={standardLight:{trafficIncidents:"incidents_light",trafficFlow:"flow_relative-light",hillshade:"hillshade_light"},standardDark:{trafficIncidents:"incidents_dark",trafficFlow:"flow_relative-dark",hillshade:"hillshade_dark"},drivingLight:{trafficIncidents:"incidents_light",trafficFlow:"flow_relative-light",hillshade:"hillshade_light"},drivingDark:{trafficIncidents:"incidents_dark",trafficFlow:"flow_relative-dark",hillshade:"hillshade_dark"},monoLight:{trafficIncidents:"incidents_light",trafficFlow:"flow_relative-light",hillshade:"hillshade_mono-light"},monoDark:{trafficIncidents:"incidents_dark",trafficFlow:"flow_relative-dark",hillshade:"hillshade_mono-dark"},satellite:{trafficIncidents:"incidents_light",trafficFlow:"flow_relative-light",hillshade:"hillshade_satellite"}},ys=e=>`\${baseURL}/maps/orbis/assets/styles/\${version}/style.json?&apiVersion=1&key=\${apiKey}&map=${e}`,As={standardLight:ys("basic_street-light"),standardDark:ys("basic_street-dark"),drivingLight:ys("basic_street-light-driving"),drivingDark:ys("basic_street-dark-driving"),monoLight:ys("basic_mono-light"),monoDark:ys("basic_mono-dark"),satellite:ys("basic_street-satellite")},Es=(e,t,r)=>{const i=e.id??fs,o=new URL(As[i].replace("${baseURL}",t).replace("${version}",e.version??"0.6.0-0").replace("${apiKey}",r));for(const a of e.include??Co)o.searchParams.append(a,ds[i][a]);return o.toString()},Rs=e=>{const t=e.style,r=e.commonBaseURL,i=e.apiKey;return"string"==typeof t?Es({id:t},r,i):"standard"===t?.type?Es(t,r,i):"custom"===t?.type&&t?.url?((e,t)=>{const r=new URL(e);return r.searchParams.has("key")?console.warn("The style URL is coming with an API key parameter which takes priority. If you want to use the SDK configured API key, remove the key param from the style URL"):r.searchParams.set("key",t),r.toString()})(t.url,i):"custom"===t?.type&&t?.json?t.json:Es({id:fs},r,i)};class gs{constructor(t,r){this.mapReady=!1,this.styleChangeHandlers=[],this.setStyle=(e,t={keepState:!0})=>{this.mapReady=!1;for(const o of this.styleChangeHandlers)try{o.onStyleAboutToChange()}catch(i){console.error(i)}const r=t.keepState?((e,t)=>t&&"object"==typeof t&&"standard"===t.type&&t.include&&("string"==typeof e||"standard"===e.type&&!e.include)?{type:"standard",id:"string"==typeof e?e:e.id,include:t.include}:e)(e,this._params.style):e;this._params={...this._params,style:r},this.styleLightDarkTheme=ni(r),this.mapLibreMap.once("styledata",()=>{!this.mapReady&&Cr(r,this._params.style)&&this.handleStyleData(t.keepState||!0)}),this.mapLibreMap.setStyle(Rs(this._params),{validate:!1})},this.getStyle=()=>this._params.style,this._params=l(r),this.styleLightDarkTheme=ni(this._params.style),this.ensureMapLibreCSSLoaded(),this.mapLibreMap=new h(((t,r)=>{return{validateStyle:!1,maxTileCacheZoomLevels:22,cancelPendingTileRequestsWhileZooming:!1,...t,style:Rs(r),attributionControl:{compact:!1},transformRequest:(i=r,(t,r)=>t.includes("tomtom.com")?"Image"===r?{url:t}:{url:t,headers:{...e(i)}}:{url:t})};var i})(t,this._params)),this.mapLibreMap.once("styledata",()=>{this.handleStyleData(!1)}),this._eventsProxy=new yi(this.mapLibreMap,this._params?.eventsConfig),this.loadRTLTextPlugin()}loadRTLTextPlugin(){setTimeout(()=>{["deferred","loaded"].includes(p())||_("https://unpkg.com/@mapbox/mapbox-gl-rtl-text@0.3.0/dist/mapbox-gl-rtl-text.js",!0).catch(e=>console.error("Something went wrong when setting RTL plugin",e))})}ensureMapLibreCSSLoaded(){if("undefined"==typeof document)return;if(Array.from(document.querySelectorAll('link[rel="stylesheet"], style')).some(e=>e.textContent?.includes(".maplibregl-map")))return;const e=document.createElement("link");e.rel="stylesheet",e.href="https://unpkg.com/maplibre-gl@5.14.0/dist/maplibre-gl.css",document.head.appendChild(e)}_setLanguage(e){this._params={...this._params,language:e};const t=e?.includes("-")?e.split("-")[0]:e;this.mapLibreMap.getStyle().layers.forEach(e=>{if("symbol"===e.type&&(e=>{const t=e.layout?.["text-field"]??"";return!!t&&("{name}"===t||2===t.length&&"name"===t[1]||3===t.length&&Array.isArray(t[1])&&"string"==typeof t[1][1]&&t[1][1].includes("name_")&&Array.isArray(t[2])&&t[2].includes("name"))})(e)){const r=t?["coalesce",["get",`name_${t}`],["get","name"]]:["get","name"];this.mapLibreMap.setLayoutProperty(e.id,"text-field",r,{validate:!1})}})}setLanguage(e){this.mapReady?this._setLanguage(e):this.mapLibreMap.once("styledata",()=>this.setLanguage(e))}getBBox(){return this.mapLibreMap.getBounds().toArray().flat()}handleStyleData(e){for(const r of Kr(this.mapLibreMap,[Ii,Ti,Ri]))this.mapLibreMap.setLayoutProperty(r.id,"visibility","none",{validate:!1});if((async(e,t)=>{t.setSprite(`${e.commonBaseURL}/maps/orbis/assets/sprites/2.*/sprite?key=${e.apiKey}&poi=poi_${ni(e.style)}&apiVersion=1&apiChannel=preview`,{validate:!1})})(this._params,this.mapLibreMap),this._params.language&&this._setLanguage(this._params.language),this.mapReady=!0,e)for(const r of this.styleChangeHandlers)try{r.onStyleChanged()}catch(t){console.error(t)}}addStyleChangeHandler(e){this.styleChangeHandlers.push(e)}}const Is=["unknown","accident","fog","dangerous_conditions","rain","ice","jam","lane_closed","road_closed","road_works","wind","flooding","broken_down_vehicle"],Ts={unknown:0,accident:1,fog:2,dangerous_conditions:3,rain:4,ice:5,jam:6,lane_closed:7,road_closed:8,road_works:9,wind:10,flooding:11,broken_down_vehicle:14},ms=["motorway","trunk","primary","secondary","tertiary","street"],Ss=["connecting","major_local"],Ls=["local","minor_local"],Os=(e,t)=>e.length?1===e.length?{expression:e[0],legacy:t[0]}:{expression:["all",...e],legacy:["all",...t]}:null,Ns=(e,t,r)=>{e&&(t.push(e.expression),r.push(e.legacy))},bs=(e,t,r,i)=>{e&&Ns(ao(t,e),r,i)},Cs=(e,t,r)=>{bs(e.roadCategories,"road_category",t,r),bs(e.roadSubCategories,"road_subcategory",t,r)},vs=e=>{const t=[],r=[];if(Cs(e,t,r),e.incidentCategories){const i=ao("icon_category_0",e.incidentCategories,e=>Ts[e]);Ns(i,t,r)}if(e.magnitudes){const i=ao("magnitude",e.magnitudes,e=>u.indexOf(e));Ns(i,t,r)}return e.delays&&Ns((e=>{const t=[],r=[];if(e.mustHaveDelay&&e.minDelayMinutes){const i=60*e.minDelayMinutes;t.push([">=",["get","delay"],i]),r.push([">=","delay",i])}else if(e.mustHaveDelay)t.push([">",["get","delay"],0]),r.push([">","delay",0]);else if(e.minDelayMinutes){const i=60*e.minDelayMinutes;t.push(["any",["!",["has","delay"]],["==",["get","delay"],0],[">=",["get","delay"],i]]),r.push(["any",["!has","delay"],["==","delay",0],[">=","delay",i]])}return Os(t,r)})(e.delays),t,r),Os(t,r)},Ms=e=>{if(!e?.any?.length)return null;const t=e.any.map(vs).filter(e=>!vr(e));return ro(t)},ws=e=>{const t=[],r=[];if(Cs(e,t,r),e.showRoadClosures){const i="only"===e.showRoadClosures?"==":"!=";t.push([i,["get","road_closure"],!0]),r.push([i,"road_closure",!0])}return Os(t,r)},Us=(e,t,r,i)=>{for(const o of t)r.setFilter(o.id,e?io(e,i[o.id]):i[o.id])};class Ps extends ci{static async get(e,t){return await Jr(e),await oi(e,Ti,"trafficFlow"),new Ps(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(){const e=this.mapLibreMap.getSource(Ti);if(!e)throw Gr(`init ${Ps.name} with source ID ${Ti}`);this.originalFilters={};for(const t of this.getLayers())this.originalFilters[t.id]=t.filter;return{trafficFlow:new $r(this.mapLibreMap,e)}}_applyConfig(e){return this.setVisible(e?.visible??!1),this._filter(e?.filters,!1),e}getLayers(){return Kr(this.tomtomMap.mapLibreMap,[Ti])}filter(e){this._filter(e)}_filter(e,t=!0){if(this.tomtomMap.mapReady)if(e?.any?.length){const t=(e=>{if(!e?.any?.length)return null;const t=e.any.map(ws).filter(e=>!vr(e));return ro(t)})(e);t&&Us(t,this.getLayers(),this.mapLibreMap,this.originalFilters)}else this.config?.filters?.any?.length&&Us(void 0,this.getLayers(),this.mapLibreMap,this.originalFilters);t&&(this.config=xr({...this.config,filters:e},vr))}setVisible(e){this.config={...this.config,visible:e},this.tomtomMap.mapReady&&this.sourcesWithLayers.trafficFlow.setLayersVisible(e)}isVisible(){return this.sourcesWithLayers.trafficFlow.isAnyLayerVisible()}get events(){return new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.trafficFlow)}}class Ds extends ci{static async get(e,t){return await Jr(e),await oi(e,Ii,"trafficIncidents"),new Ds(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(){const e=this.mapLibreMap.getSource(Ii);if(!e)throw Gr(`init ${Ds.name} with source ID ${Ii}`);this.originalFilters={};for(const t of this.getLayers())this.originalFilters[t.id]=t.filter;return{trafficIncidents:new $r(this.mapLibreMap,e)}}_applyConfig(e){return this._setVisible(e?.visible??!1,{updateConfig:!1}),vr(e?.icons?.visible)||this.setIconsVisible(e.icons.visible),this._filter(e?.filters,e?.icons?.filters,!1),e}filter(e,t){this._filter(e,t)}_filter(e,t,r=!0){if(this.tomtomMap.mapReady){if(e?.any?.length){const r=Ms(e);if(r){const e=t?this.getNonSymbolLayers():this.getLayers();Us(r,e,this.mapLibreMap,this.originalFilters)}}else this.config?.filters?.any?.length&&Us(void 0,this.getLayers(),this.mapLibreMap,this.originalFilters);if(t?.any?.length){const e=Ms(t);e&&Us(e,this.getSymbolLayers(),this.mapLibreMap,this.originalFilters)}}r&&(this.config=xr({...this.config,filters:e,icons:{...this.config?.icons,filters:t}},vr))}getLayers(){return Kr(this.tomtomMap.mapLibreMap,[Ii])}getSymbolLayers(){return this.getLayers().filter(e=>"symbol"===e.type)}getNonSymbolLayers(){return this.getLayers().filter(e=>"symbol"!=e.type)}setIconsVisible(e){this.config={...this.config,icons:{...this.config?.icons,visible:e}},this.tomtomMap.mapReady&&this.sourcesWithLayers.trafficIncidents.setLayersVisible(e,e=>"symbol"===e.type)}setVisible(e){this._setVisible(e)}_setVisible(e,t){(t?.updateConfig??!0)&&(delete this.config?.icons?.visible,this.config={...xr({...this.config},br),visible:e}),this.tomtomMap.mapReady&&this.sourcesWithLayers.trafficIncidents.setLayersVisible(e)}isVisible(){return this.sourcesWithLayers.trafficIncidents.isAnyLayerVisible()}anyIconLayersVisible(){return!!this.sourcesWithLayers.trafficIncidents?.isAnyLayerVisible(e=>"symbol"===e.type)}get events(){return new li(this.tomtomMap._eventsProxy,this.sourcesWithLayers.trafficIncidents)}}export{ci as AbstractMapModule,zr as AbstractSourceWithLayers,Zr as AddedSourceWithLayers,gi as BASE_MAP_SOURCE_ID,po as BaseMapModule,wo as DESELECTED_FOREGROUND_COLOR,Uo as DESELECTED_OUTLINE_COLOR,Fo as DESELECTED_ROUTE_FILTER,Po as DESELECTED_SECONDARY_COLOR,li as EventsModule,yi as EventsProxy,Na as FINISH_INDEX,yo as GEOMETRY_COLOR_PROP,fo as GEOMETRY_TITLE_PROP,Xr as GeoJSONSourceWithLayers,Oo as GeometriesModule,Ri as HILLSHADE_SOURCE_ID,No as HillshadeModule,ba as INDEX_TYPE,Ho as MAJOR_DELAY_COLOR,Oa as MIDDLE_INDEX,jo as MINOR_DELAY_LABEL_COLOR,Go as MODERATE_DELAY_COLOR,Ei as POI_SOURCE_ID,co as POIsModule,eo as PlacesModule,vo as ROUTE_LINE_FOREGROUND_COLOR,Do as ROUTE_LINE_FOREGROUND_WIDTH,Mo as ROUTE_LINE_OUTLINE_COLOR,_s as RoutingModule,xo as SELECTED_ROUTE_FILTER,La as START_INDEX,Ca as STOP_DISPLAY_INDEX,$r as StyleSourceWithLayers,Ti as TRAFFIC_FLOW_SOURCE_ID,Ii as TRAFFIC_INCIDENTS_SOURCE_ID,gs as TomTomMap,Yr as TomTomMapSource,Ps as TrafficFlowModule,Ds as TrafficIncidentsModule,Bo as UNKNOWN_DELAY_COLOR,_o as baseMapLayerGroupNames,Ki as buildPlaceTitle,ja as buildRoutingLayers,Ba as defaultRoutingLayers,Kr as filterLayersBySources,Zi as getIconIDForPlace,qi as getPOILayerCategoryForPlace,no as getStyleCategories,Is as incidentCategories,Ts as incidentCategoriesMapping,Si as mapDisplayPoiCategoryMappings,Ai as mapStyleLayerIDs,so as poiCategoryGroups,mi as poiLayerIDs,Ji as preparePlacesForDisplay,ms as roadCategories,bo as standardStyleIDs,Ls as streetRoadCategories,Co as styleModules,Ss as tertiaryRoadCategories,Oi as toBaseMapPOICategory,Xi as toPlaces};
2
2
  //# sourceMappingURL=map.es.js.map